@1771technologies/lytenyte-pro 2.0.0-dev.0 → 2.0.0-dev.2

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 (423) hide show
  1. package/dist/__play__/alpha.play.d.ts +3 -0
  2. package/dist/__play__/alpha.play.js +56 -0
  3. package/dist/__play__/basic-server-data/data.d.ts +10 -0
  4. package/dist/__play__/basic-server-data/data.js +17746 -0
  5. package/dist/__play__/basic-server-data/server.d.ts +36 -0
  6. package/dist/__play__/basic-server-data/server.js +105 -0
  7. package/dist/__play__/buttons.play.d.ts +4 -0
  8. package/dist/__play__/buttons.play.js +7 -0
  9. package/dist/__play__/inputs.play.d.ts +3 -0
  10. package/dist/__play__/inputs.play.js +13 -0
  11. package/dist/__play__/server.play.d.ts +3 -0
  12. package/dist/__play__/server.play.js +66 -0
  13. package/dist/__play__/tree.play.d.ts +3 -0
  14. package/dist/__play__/tree.play.js +47 -0
  15. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
  16. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
  17. package/dist/cell-selection/are-rects-equal.d.ts +2 -0
  18. package/dist/cell-selection/are-rects-equal.js +6 -0
  19. package/dist/cell-selection/bound-selection-rect.d.ts +3 -0
  20. package/dist/cell-selection/bound-selection-rect.js +16 -0
  21. package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
  22. package/dist/cell-selection/cell-selection-containers.js +86 -0
  23. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
  24. package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
  25. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
  26. package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
  27. package/dist/cell-selection/cell-style-row.d.ts +8 -0
  28. package/dist/cell-selection/cell-style-row.js +79 -0
  29. package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
  30. package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
  31. package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
  32. package/dist/cell-selection/deselect-rect-range.js +43 -0
  33. package/dist/cell-selection/expand-selection-down.d.ts +3 -0
  34. package/dist/cell-selection/expand-selection-down.js +78 -0
  35. package/dist/cell-selection/expand-selection-end.d.ts +3 -0
  36. package/dist/cell-selection/expand-selection-end.js +76 -0
  37. package/dist/cell-selection/expand-selection-start.d.ts +3 -0
  38. package/dist/cell-selection/expand-selection-start.js +73 -0
  39. package/dist/cell-selection/expand-selection-up.d.ts +3 -0
  40. package/dist/cell-selection/expand-selection-up.js +74 -0
  41. package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
  42. package/dist/cell-selection/full-width-start-end-index.js +4 -0
  43. package/dist/cell-selection/get-root-cell.d.ts +3 -0
  44. package/dist/cell-selection/get-root-cell.js +6 -0
  45. package/dist/cell-selection/index.d.ts +13 -0
  46. package/dist/cell-selection/index.js +13 -0
  47. package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
  48. package/dist/cell-selection/is-bottom-rect.js +4 -0
  49. package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
  50. package/dist/cell-selection/is-center-col-rect.js +3 -0
  51. package/dist/cell-selection/is-center-rect.d.ts +2 -0
  52. package/dist/cell-selection/is-center-rect.js +4 -0
  53. package/dist/cell-selection/is-end-rect.d.ts +5 -0
  54. package/dist/cell-selection/is-end-rect.js +3 -0
  55. package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
  56. package/dist/cell-selection/is-fully-within-rect.js +6 -0
  57. package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
  58. package/dist/cell-selection/is-overlapping-rect.js +5 -0
  59. package/dist/cell-selection/is-start-rect.d.ts +5 -0
  60. package/dist/cell-selection/is-start-rect.js +3 -0
  61. package/dist/cell-selection/is-top-rect.d.ts +2 -0
  62. package/dist/cell-selection/is-top-rect.js +3 -0
  63. package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
  64. package/dist/cell-selection/is-within-selection-rect.js +3 -0
  65. package/dist/cell-selection/split-cell-selection-rect.d.ts +47 -0
  66. package/dist/cell-selection/split-cell-selection-rect.js +88 -0
  67. package/dist/cell-selection/split-on-pivot.d.ts +3 -0
  68. package/dist/cell-selection/split-on-pivot.js +50 -0
  69. package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
  70. package/dist/cell-selection/update-additive-cell-selection.js +21 -0
  71. package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
  72. package/dist/cell-selection/use-edge-scroll.js +71 -0
  73. package/dist/components/checkbox/checkbox.d.ts +15 -0
  74. package/dist/components/checkbox/checkbox.js +42 -0
  75. package/dist/components/checkbox/checkbox.play.d.ts +2 -0
  76. package/dist/components/checkbox/checkbox.play.js +6 -0
  77. package/dist/components/column-manager/column-manager.d.ts +13 -0
  78. package/dist/components/column-manager/column-manager.js +47 -0
  79. package/dist/components/external/clsx.d.ts +2 -0
  80. package/dist/components/external/clsx.js +44 -0
  81. package/dist/components/external/floating-ui.d.ts +268 -0
  82. package/dist/components/external/floating-ui.js +1802 -0
  83. package/dist/components/headless/dialog/arrow.d.ts +6 -0
  84. package/dist/components/headless/dialog/arrow.js +16 -0
  85. package/dist/components/headless/dialog/close.d.ts +10 -0
  86. package/dist/components/headless/dialog/close.js +22 -0
  87. package/dist/components/headless/dialog/container.d.ts +5 -0
  88. package/dist/components/headless/dialog/container.js +221 -0
  89. package/dist/components/headless/dialog/context.d.ts +32 -0
  90. package/dist/components/headless/dialog/context.js +3 -0
  91. package/dist/components/headless/dialog/description.d.ts +9 -0
  92. package/dist/components/headless/dialog/description.js +20 -0
  93. package/dist/components/headless/dialog/index.parts.d.ts +30 -0
  94. package/dist/components/headless/dialog/index.parts.js +17 -0
  95. package/dist/components/headless/dialog/root.d.ts +32 -0
  96. package/dist/components/headless/dialog/root.js +75 -0
  97. package/dist/components/headless/dialog/title.d.ts +9 -0
  98. package/dist/components/headless/dialog/title.js +20 -0
  99. package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
  100. package/dist/components/headless/dialog/transform-origin.js +38 -0
  101. package/dist/components/headless/dialog/trigger.d.ts +10 -0
  102. package/dist/components/headless/dialog/trigger.js +24 -0
  103. package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
  104. package/dist/components/headless/dialog/use-dialog.js +12 -0
  105. package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
  106. package/dist/components/headless/menu/checkbox-item.js +42 -0
  107. package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
  108. package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
  109. package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
  110. package/dist/components/headless/menu/combo/combo-context.js +3 -0
  111. package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
  112. package/dist/components/headless/menu/combo/combo-input.js +58 -0
  113. package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
  114. package/dist/components/headless/menu/combo/combo-menu.js +24 -0
  115. package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
  116. package/dist/components/headless/menu/combo/combo-option.js +37 -0
  117. package/dist/components/headless/menu/container.d.ts +5 -0
  118. package/dist/components/headless/menu/container.js +19 -0
  119. package/dist/components/headless/menu/dom.d.ts +4 -0
  120. package/dist/components/headless/menu/dom.js +20 -0
  121. package/dist/components/headless/menu/index.d.ts +54 -0
  122. package/dist/components/headless/menu/index.js +39 -0
  123. package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
  124. package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
  125. package/dist/components/headless/menu/item/item.d.ts +9 -0
  126. package/dist/components/headless/menu/item/item.js +45 -0
  127. package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
  128. package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
  129. package/dist/components/headless/menu/menu-divider.d.ts +5 -0
  130. package/dist/components/headless/menu/menu-divider.js +6 -0
  131. package/dist/components/headless/menu/menu-group.d.ts +5 -0
  132. package/dist/components/headless/menu/menu-group.js +6 -0
  133. package/dist/components/headless/menu/menu-header.d.ts +5 -0
  134. package/dist/components/headless/menu/menu-header.js +6 -0
  135. package/dist/components/headless/menu/popover.d.ts +5 -0
  136. package/dist/components/headless/menu/popover.js +7 -0
  137. package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
  138. package/dist/components/headless/menu/radio-group/context.js +7 -0
  139. package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
  140. package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
  141. package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
  142. package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
  143. package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
  144. package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
  145. package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
  146. package/dist/components/headless/menu/submenu/submenu.js +55 -0
  147. package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
  148. package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
  149. package/dist/components/headless/menu/use-menu.d.ts +1 -0
  150. package/dist/components/headless/menu/use-menu.js +52 -0
  151. package/dist/components/headless/popover/container.d.ts +5 -0
  152. package/dist/components/headless/popover/container.js +7 -0
  153. package/dist/components/headless/popover/context.d.ts +6 -0
  154. package/dist/components/headless/popover/context.js +3 -0
  155. package/dist/components/headless/popover/index.d.ts +30 -0
  156. package/dist/components/headless/popover/index.js +17 -0
  157. package/dist/components/headless/popover/root.d.ts +6 -0
  158. package/dist/components/headless/popover/root.js +8 -0
  159. package/dist/components/headless/popover/trigger.d.ts +7 -0
  160. package/dist/components/headless/popover/trigger.js +11 -0
  161. package/dist/components/pill-manager/container.d.ts +5 -0
  162. package/dist/components/pill-manager/container.js +127 -0
  163. package/dist/components/pill-manager/expander.d.ts +9 -0
  164. package/dist/components/pill-manager/expander.js +21 -0
  165. package/dist/components/pill-manager/icons.d.ts +12 -0
  166. package/dist/components/pill-manager/icons.js +35 -0
  167. package/dist/components/pill-manager/index.d.ts +33 -0
  168. package/dist/components/pill-manager/index.js +13 -0
  169. package/dist/components/pill-manager/item.d.ts +10 -0
  170. package/dist/components/pill-manager/item.js +178 -0
  171. package/dist/components/pill-manager/label.d.ts +10 -0
  172. package/dist/components/pill-manager/label.js +31 -0
  173. package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
  174. package/dist/components/pill-manager/pill-manager.play.js +73 -0
  175. package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
  176. package/dist/components/pill-manager/pill-row.context.js +4 -0
  177. package/dist/components/pill-manager/pill-row.d.ts +12 -0
  178. package/dist/components/pill-manager/pill-row.js +22 -0
  179. package/dist/components/pill-manager/root.context.d.ts +40 -0
  180. package/dist/components/pill-manager/root.context.js +4 -0
  181. package/dist/components/pill-manager/root.d.ts +25 -0
  182. package/dist/components/pill-manager/root.js +33 -0
  183. package/dist/components/pill-manager/row-default.d.ts +3 -0
  184. package/dist/components/pill-manager/row-default.js +14 -0
  185. package/dist/components/pill-manager/types.d.ts +21 -0
  186. package/dist/components/pill-manager/types.js +1 -0
  187. package/dist/components/row-group-cell.d.ts +13 -0
  188. package/dist/components/row-group-cell.js +40 -0
  189. package/dist/components/select-all.d.ts +12 -0
  190. package/dist/components/select-all.js +34 -0
  191. package/dist/components/smart-select/chip-context.d.ts +8 -0
  192. package/dist/components/smart-select/chip-context.js +4 -0
  193. package/dist/components/smart-select/chip-remove.d.ts +1 -0
  194. package/dist/components/smart-select/chip-remove.js +13 -0
  195. package/dist/components/smart-select/chip.d.ts +13 -0
  196. package/dist/components/smart-select/chip.js +79 -0
  197. package/dist/components/smart-select/container.d.ts +1 -0
  198. package/dist/components/smart-select/container.js +13 -0
  199. package/dist/components/smart-select/context.d.ts +31 -0
  200. package/dist/components/smart-select/context.js +4 -0
  201. package/dist/components/smart-select/index.d.ts +30 -0
  202. package/dist/components/smart-select/index.js +19 -0
  203. package/dist/components/smart-select/option.d.ts +8 -0
  204. package/dist/components/smart-select/option.js +36 -0
  205. package/dist/components/smart-select/root.d.ts +17 -0
  206. package/dist/components/smart-select/root.js +165 -0
  207. package/dist/components/smart-select/smart-select.play.d.ts +2 -0
  208. package/dist/components/smart-select/smart-select.play.js +36 -0
  209. package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
  210. package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
  211. package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
  212. package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
  213. package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
  214. package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
  215. package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
  216. package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
  217. package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
  218. package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
  219. package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
  220. package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
  221. package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
  222. package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
  223. package/dist/components/smart-select/type.d.ts +44 -0
  224. package/dist/components/smart-select/type.js +1 -0
  225. package/dist/components/smart-select/use-async-options.d.ts +8 -0
  226. package/dist/components/smart-select/use-async-options.js +42 -0
  227. package/dist/components/tree-view/index.d.ts +4 -0
  228. package/dist/components/tree-view/index.js +2 -0
  229. package/dist/components/tree-view/root.d.ts +37 -0
  230. package/dist/components/tree-view/root.js +139 -0
  231. package/dist/components/tree-view/select-all.d.ts +7 -0
  232. package/dist/components/tree-view/select-all.js +22 -0
  233. package/dist/components/tree-view/tree-children.d.ts +2 -0
  234. package/dist/components/tree-view/tree-children.js +15 -0
  235. package/dist/components/tree-view/types.d.ts +31 -0
  236. package/dist/components/tree-view/types.js +1 -0
  237. package/dist/components/types.d.ts +4 -0
  238. package/dist/components/types.js +1 -0
  239. package/dist/components/virtual-from-coordinates.d.ts +2 -0
  240. package/dist/components/virtual-from-coordinates.js +15 -0
  241. package/dist/components.d.ts +16 -0
  242. package/dist/components.js +11 -0
  243. package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
  244. package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
  245. package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
  246. package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
  247. package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
  248. package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
  249. package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
  250. package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
  251. package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
  252. package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
  253. package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
  254. package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
  255. package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
  256. package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
  257. package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
  258. package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
  259. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
  260. package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
  261. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
  262. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
  263. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
  264. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
  265. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
  266. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
  267. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
  268. package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
  269. package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
  270. package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
  271. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
  272. package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
  273. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
  274. package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
  275. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
  276. package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
  277. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
  278. package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
  279. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
  280. package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
  281. package/dist/data-source-client/use-client-data-source.d.ts +91 -0
  282. package/dist/data-source-client/use-client-data-source.js +169 -0
  283. package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
  284. package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
  285. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
  286. package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
  287. package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
  288. package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
  289. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
  290. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
  291. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
  292. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
  293. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
  294. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
  295. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
  296. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
  297. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
  298. package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
  299. package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
  300. package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
  301. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
  302. package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
  303. package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
  304. package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
  305. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
  306. package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
  307. package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
  308. package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
  309. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
  310. package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
  311. package/dist/data-source-server/async-tree/types.d.ts +70 -0
  312. package/dist/data-source-server/async-tree/types.js +1 -0
  313. package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
  314. package/dist/data-source-server/range-tree/range-tree.js +102 -0
  315. package/dist/data-source-server/server-data.d.ts +73 -0
  316. package/dist/data-source-server/server-data.js +553 -0
  317. package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
  318. package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
  319. package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
  320. package/dist/data-source-server/source/use-on-view-change.js +13 -0
  321. package/dist/data-source-server/source/use-row-add.d.ts +3 -0
  322. package/dist/data-source-server/source/use-row-add.js +36 -0
  323. package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
  324. package/dist/data-source-server/source/use-row-by-id.js +8 -0
  325. package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
  326. package/dist/data-source-server/source/use-row-by-index.js +89 -0
  327. package/dist/data-source-server/source/use-row-children.d.ts +2 -0
  328. package/dist/data-source-server/source/use-row-children.js +16 -0
  329. package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
  330. package/dist/data-source-server/source/use-row-delete.js +39 -0
  331. package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
  332. package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
  333. package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
  334. package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
  335. package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
  336. package/dist/data-source-server/source/use-row-leafs.js +20 -0
  337. package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
  338. package/dist/data-source-server/source/use-row-parents.js +16 -0
  339. package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
  340. package/dist/data-source-server/source/use-row-siblings.js +15 -0
  341. package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
  342. package/dist/data-source-server/source/use-rows-between.js +20 -0
  343. package/dist/data-source-server/source/use-source-state.d.ts +28 -0
  344. package/dist/data-source-server/source/use-source-state.js +47 -0
  345. package/dist/data-source-server/source/use-source.d.ts +5 -0
  346. package/dist/data-source-server/source/use-source.js +66 -0
  347. package/dist/data-source-server/types.d.ts +42 -0
  348. package/dist/data-source-server/types.js +1 -0
  349. package/dist/data-source-server/use-server-data-source.d.ts +51 -0
  350. package/dist/data-source-server/use-server-data-source.js +192 -0
  351. package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
  352. package/dist/data-source-server/utils/get-node-depth.js +9 -0
  353. package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
  354. package/dist/data-source-server/utils/get-node-path.js +9 -0
  355. package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
  356. package/dist/data-source-server/utils/get-request-id.js +6 -0
  357. package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
  358. package/dist/data-source-tree/source/use-controlled-state.js +21 -0
  359. package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
  360. package/dist/data-source-tree/source/use-flattened.js +65 -0
  361. package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
  362. package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
  363. package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
  364. package/dist/data-source-tree/source/use-row-by-id.js +7 -0
  365. package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
  366. package/dist/data-source-tree/source/use-row-children.js +11 -0
  367. package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
  368. package/dist/data-source-tree/source/use-row-leafs.js +20 -0
  369. package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
  370. package/dist/data-source-tree/source/use-row-parents.js +16 -0
  371. package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
  372. package/dist/data-source-tree/source/use-row-siblings.js +12 -0
  373. package/dist/data-source-tree/source/use-tree.d.ts +3 -0
  374. package/dist/data-source-tree/source/use-tree.js +59 -0
  375. package/dist/data-source-tree/types.d.ts +16 -0
  376. package/dist/data-source-tree/types.js +1 -0
  377. package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
  378. package/dist/data-source-tree/use-tree-data-source.js +101 -0
  379. package/dist/data-source-tree/utils/is-object.d.ts +1 -0
  380. package/dist/data-source-tree/utils/is-object.js +3 -0
  381. package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
  382. package/dist/hooks/use-slot/get-element-ref.js +20 -0
  383. package/dist/hooks/use-slot/index.d.ts +3 -0
  384. package/dist/hooks/use-slot/index.js +1 -0
  385. package/dist/hooks/use-slot/merge-props.d.ts +4 -0
  386. package/dist/hooks/use-slot/merge-props.js +27 -0
  387. package/dist/hooks/use-slot/react-version.d.ts +3 -0
  388. package/dist/hooks/use-slot/react-version.js +5 -0
  389. package/dist/hooks/use-slot/types.d.ts +4 -0
  390. package/dist/hooks/use-slot/types.js +1 -0
  391. package/dist/hooks/use-slot/use-slot.d.ts +12 -0
  392. package/dist/hooks/use-slot/use-slot.js +28 -0
  393. package/dist/hooks/use-transitioned-open.d.ts +2 -0
  394. package/dist/hooks/use-transitioned-open.js +50 -0
  395. package/dist/index.d.ts +121 -0
  396. package/dist/index.js +23 -0
  397. package/dist/license/index.d.ts +1 -0
  398. package/dist/license/index.js +1 -0
  399. package/dist/license/license.d.ts +3 -0
  400. package/dist/license/license.js +215 -0
  401. package/dist/license/md5-hash.d.ts +9 -0
  402. package/dist/license/md5-hash.js +167 -0
  403. package/dist/license.d.ts +3 -0
  404. package/dist/license.js +214 -0
  405. package/dist/root/context.d.ts +16 -0
  406. package/dist/root/context.js +4 -0
  407. package/dist/root/hooks/use-pro-api.d.ts +2 -0
  408. package/dist/root/hooks/use-pro-api.js +8 -0
  409. package/dist/root/root.d.ts +15 -0
  410. package/dist/root/root.js +112 -0
  411. package/dist/types/api.d.ts +100 -0
  412. package/dist/types/api.js +1 -0
  413. package/dist/types/column.d.ts +73 -0
  414. package/dist/types/column.js +1 -0
  415. package/dist/types/events.d.ts +56 -0
  416. package/dist/types/events.js +1 -0
  417. package/dist/types/grid.d.ts +47 -0
  418. package/dist/types/grid.js +1 -0
  419. package/dist/types/index.d.ts +7 -0
  420. package/dist/types/index.js +1 -0
  421. package/dist/types/props.d.ts +187 -0
  422. package/dist/types/props.js +1 -0
  423. package/package.json +5 -5
@@ -0,0 +1,6 @@
1
+ import { type JSX } from "react";
2
+ import type { LnComponent } from "../../types.js";
3
+ export declare const DialogArrow: import("react").ForwardRefExoticComponent<Omit<DialogArrow.Props, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
+ export declare namespace DialogArrow {
5
+ type Props = LnComponent<JSX.IntrinsicElements["svg"], object>;
6
+ }
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { useCombinedRefs } from "@1771technologies/lytenyte-core/internal";
5
+ import { useSlot } from "../../../hooks/use-slot/use-slot.js";
6
+ const DialogArrowBase = ({ render, ...props }, ref) => {
7
+ const ctx = useDialogRoot();
8
+ const combined = useCombinedRefs(ref, ctx.setArrow);
9
+ const comp = useSlot({
10
+ props: [props],
11
+ ref: combined,
12
+ slot: render ?? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 8", "aria-hidden": true, height: 8, focusable: "false", ...props, ref: combined, "data-ln-dialog-arrow": true, children: [_jsx("polygon", { points: "0,8 8,0 16,8", "data-ln-dialog-arrow-area": true }), _jsx("path", { "data-ln-dialog-arrow-border": true, d: "M0 8 L8 0 L16 8", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" })] })),
13
+ });
14
+ return comp;
15
+ };
16
+ export const DialogArrow = forwardRef(DialogArrowBase);
@@ -0,0 +1,10 @@
1
+ import { type JSX } from "react";
2
+ import type { LnComponent } from "../../types";
3
+ export declare const DialogClose: import("react").ForwardRefExoticComponent<Omit<DialogClose.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
4
+ export declare namespace DialogClose {
5
+ type Props = LnComponent<JSX.IntrinsicElements["button"], State>;
6
+ type State = {
7
+ readonly open: boolean;
8
+ readonly openChange: (b: boolean) => void;
9
+ };
10
+ }
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { useSlot } from "../../../hooks/use-slot/index.js";
5
+ function DialogCloseImpl({ render, ...props }, ref) {
6
+ const ctx = useDialogRoot();
7
+ const internalProps = {
8
+ "aria-label": "Close dialog",
9
+ onClick: () => ctx.onOpenChange(false),
10
+ };
11
+ const final = useSlot({
12
+ props: [internalProps, props, { "data-ln-dialog-close": true }],
13
+ ref: ref,
14
+ slot: render ?? _jsx("button", {}),
15
+ state: {
16
+ open: ctx.open,
17
+ openChange: ctx.onOpenChange,
18
+ },
19
+ });
20
+ return final;
21
+ }
22
+ export const DialogClose = forwardRef(DialogCloseImpl);
@@ -0,0 +1,5 @@
1
+ import { type JSX } from "react";
2
+ export declare const DialogContainer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
3
+ export declare namespace DialogContainer {
4
+ type Props = JSX.IntrinsicElements["dialog"];
5
+ }
@@ -0,0 +1,221 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef, useEffect, useRef, useState } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { arrow, autoUpdate, computePosition, flip, hide, inline, offset, shift, } from "../../external/floating-ui.js";
5
+ import { transformOrigin } from "./transform-origin.js";
6
+ import { FocusTrap } from "@1771technologies/lytenyte-shared";
7
+ import { getActiveElement, getTabbables, SCROLL_LOCKER } from "@1771technologies/lytenyte-shared";
8
+ import { useCombinedRefs } from "@1771technologies/lytenyte-core/internal";
9
+ import { useTransitioned } from "../../../hooks/use-transitioned-open.js";
10
+ function DialogContainerBase(props, ref) {
11
+ const { open, onOpenChange, onOpenChangeComplete, titleId, descriptionId, focusCanReturn, focusCanTrap, focusFallback, focusInitial, focusPreventScroll, focusReturn, focusTrap, lockScroll, lightDismiss, modal = true, anchor, alignOffset, inline: inlineV, placement, shiftPadding, sideOffset, hide: shouldHide, arrow: arrowEl, } = useDialogRoot();
12
+ const [dialog, setDialog] = useState(null);
13
+ const [t, shouldMount] = useTransitioned(open, dialog, onOpenChangeComplete);
14
+ const locked = useRef(false);
15
+ useEffect(() => {
16
+ if (!open || !anchor)
17
+ return;
18
+ const anchorEl = typeof anchor === "string" ? document.querySelector(anchor) : anchor;
19
+ if (!anchorEl || !dialog)
20
+ return;
21
+ const middleware = [offset({ alignmentAxis: alignOffset, mainAxis: sideOffset })];
22
+ if (inlineV)
23
+ middleware.push(inline({ padding: shiftPadding }));
24
+ const flipMw = flip({
25
+ crossAxis: "alignment",
26
+ fallbackAxisSideDirection: "end",
27
+ });
28
+ const shiftMw = shift({
29
+ padding: shiftPadding,
30
+ mainAxis: true,
31
+ });
32
+ const shiftMwX = shift({
33
+ padding: shiftPadding,
34
+ crossAxis: true,
35
+ });
36
+ if (placement.includes("-"))
37
+ middleware.push(flipMw, shiftMw, shiftMwX);
38
+ else
39
+ middleware.push(shiftMw, flipMw, shiftMwX);
40
+ middleware.push(transformOrigin({ arrowHeight: 0, arrowWidth: 0 }));
41
+ if (shouldHide) {
42
+ middleware.push(hide());
43
+ }
44
+ if (arrowEl)
45
+ middleware.push(arrow({ element: arrowEl, padding: 0 }));
46
+ const clean = autoUpdate(anchorEl, dialog, async () => {
47
+ const pos = await computePosition(anchorEl, dialog, {
48
+ strategy: "fixed",
49
+ placement: placement,
50
+ middleware,
51
+ });
52
+ const hidden = pos.middlewareData.hide?.referenceHidden;
53
+ if (hidden && shouldHide) {
54
+ dialog.style.visibility = "hidden";
55
+ }
56
+ else {
57
+ dialog.style.visibility = "visible";
58
+ }
59
+ const x = pos.middlewareData.transformOrigin.x;
60
+ const y = pos.middlewareData.transformOrigin.y;
61
+ const anchorBB = anchorEl.getBoundingClientRect();
62
+ Object.assign(dialog.style, {
63
+ top: `${pos.y}px`,
64
+ left: `${pos.x}px`,
65
+ transformOrigin: `${x} ${y}`,
66
+ });
67
+ dialog.style.setProperty("--ln-anchor-width", `${anchorBB.width}px`);
68
+ dialog.style.setProperty("--ln-anchor-height", `${anchorBB.height}px`);
69
+ if (arrowEl) {
70
+ const { x, y } = pos.middlewareData.arrow ?? {};
71
+ const top = y;
72
+ const left = x;
73
+ arrowEl.setAttribute("data-ln-placement", pos.placement.split("-").at(0) ?? "");
74
+ Object.assign(arrowEl.style, {
75
+ left: left != null ? `${left}px` : "",
76
+ top: top != null ? `${top}px` : "",
77
+ });
78
+ }
79
+ });
80
+ return () => clean();
81
+ }, [
82
+ alignOffset,
83
+ anchor,
84
+ arrowEl,
85
+ dialog,
86
+ inlineV,
87
+ open,
88
+ placement,
89
+ shiftPadding,
90
+ shouldHide,
91
+ shouldMount,
92
+ sideOffset,
93
+ ]);
94
+ const lockTimeout = useRef(null);
95
+ useEffect(() => {
96
+ if (lockScroll == false)
97
+ return;
98
+ if (lockTimeout.current)
99
+ clearTimeout(lockTimeout.current);
100
+ if (shouldMount && !locked.current) {
101
+ SCROLL_LOCKER.acquire(null);
102
+ locked.current = true;
103
+ }
104
+ else if (!shouldMount && locked.current) {
105
+ SCROLL_LOCKER.release();
106
+ locked.current = false;
107
+ }
108
+ return () => {
109
+ lockTimeout.current = setTimeout(() => {
110
+ if (locked.current)
111
+ SCROLL_LOCKER.release();
112
+ locked.current = false;
113
+ lockTimeout.current = null;
114
+ }, 20);
115
+ };
116
+ // eslint-disable-next-line react-hooks/exhaustive-deps
117
+ }, [shouldMount]);
118
+ const trapRef = useRef(null);
119
+ useEffect(() => {
120
+ if (!dialog)
121
+ return;
122
+ const controller = new AbortController();
123
+ if (shouldMount) {
124
+ dialog.addEventListener("keydown", (ev) => {
125
+ if (ev.key === "Escape") {
126
+ // Check if the dialog contains another open dialog
127
+ const otherDialog = dialog.querySelector('[data-ln-light-dismiss="true"]');
128
+ if (otherDialog)
129
+ return;
130
+ ev.stopPropagation();
131
+ if (lightDismiss != false)
132
+ onOpenChange(false);
133
+ ev.preventDefault();
134
+ }
135
+ }, { signal: controller.signal });
136
+ }
137
+ if (shouldMount && lightDismiss != false) {
138
+ document.addEventListener("click", (ev) => {
139
+ const bb = dialog.getBoundingClientRect();
140
+ if (ev.button !== 0)
141
+ return;
142
+ if (ev.target != dialog && dialog.contains(ev.target))
143
+ return;
144
+ // Check if the dialog contains another open dialog
145
+ const otherDialog = dialog.querySelector('[data-ln-light-dismiss="true"]');
146
+ if (otherDialog)
147
+ return;
148
+ if (ev.clientX < bb.left ||
149
+ ev.clientX > bb.right ||
150
+ ev.clientY < bb.top ||
151
+ ev.clientY > bb.bottom) {
152
+ ev.stopPropagation();
153
+ ev.stopImmediatePropagation();
154
+ if (typeof lightDismiss === "function") {
155
+ const res = lightDismiss(ev.target);
156
+ if (!res)
157
+ return;
158
+ }
159
+ setTimeout(() => onOpenChange(false));
160
+ }
161
+ }, { capture: true, signal: controller.signal });
162
+ }
163
+ const options = {
164
+ preventScroll: focusPreventScroll,
165
+ checkCanReturnFocus: focusCanReturn,
166
+ checkCanFocusTrap: focusCanTrap,
167
+ fallbackFocus: focusFallback,
168
+ initialFocus: focusInitial,
169
+ setReturnFocus: focusReturn ?? getActiveElement(document),
170
+ };
171
+ Object.keys(options).forEach((c) => {
172
+ if (options[c] === undefined)
173
+ delete options[c];
174
+ });
175
+ let obsRef = null;
176
+ if (!options.checkCanFocusTrap) {
177
+ const checkCanFocusTrap = (dialog) => {
178
+ const tabbables = getTabbables(dialog[0]);
179
+ if (tabbables.length)
180
+ return Promise.resolve();
181
+ return new Promise((res) => {
182
+ obsRef = new MutationObserver(() => {
183
+ if (getTabbables(dialog[0])) {
184
+ obsRef?.disconnect();
185
+ res();
186
+ }
187
+ });
188
+ obsRef.observe(dialog[0], { childList: true, subtree: true });
189
+ });
190
+ };
191
+ options.checkCanFocusTrap = checkCanFocusTrap;
192
+ }
193
+ const trap = new FocusTrap(dialog, options);
194
+ trapRef.current = trap;
195
+ if (shouldMount) {
196
+ if (modal != false)
197
+ dialog.showModal();
198
+ else
199
+ dialog.showPopover();
200
+ if (focusTrap != false)
201
+ trap.activate();
202
+ }
203
+ return () => {
204
+ controller.abort();
205
+ trap.deactivate();
206
+ obsRef?.disconnect();
207
+ };
208
+ // eslint-disable-next-line react-hooks/exhaustive-deps
209
+ }, [dialog, shouldMount]);
210
+ // Deactivate and close the dialog if the component will no longer be mounted.
211
+ if (trapRef.current && !shouldMount) {
212
+ trapRef.current.deactivate();
213
+ trapRef.current = null;
214
+ }
215
+ const combined = useCombinedRefs(ref, setDialog);
216
+ const Element = (modal != false ? "dialog" : "div");
217
+ if (!shouldMount)
218
+ return null;
219
+ return (_jsx(Element, { ...props, popover: !modal ? "manual" : undefined, "aria-describedby": descriptionId, "aria-labelledby": titleId, "data-ln-light-dismiss": lightDismiss != false, "data-ln-transition": t, "data-ln-dialog": !props["data-ln-popover"] && !props["data-ln-menu-popover"] ? true : undefined, ref: combined, children: props.children }));
220
+ }
221
+ export const DialogContainer = forwardRef(DialogContainerBase);
@@ -0,0 +1,32 @@
1
+ import { type Dispatch, type SetStateAction } from "react";
2
+ import type { Placement, ReferenceElement } from "../../external/floating-ui";
3
+ import type { FocusTrapOptions } from "@1771technologies/lytenyte-shared";
4
+ export interface DialogContext {
5
+ readonly open: boolean;
6
+ readonly onOpenChange: (open: boolean) => void;
7
+ readonly onOpenChangeComplete: (open: boolean) => void;
8
+ readonly id: string;
9
+ readonly titleId: string;
10
+ readonly descriptionId: string;
11
+ readonly hide?: boolean;
12
+ readonly lockScroll?: boolean;
13
+ readonly modal?: boolean;
14
+ readonly lightDismiss?: boolean | ((el: HTMLElement) => boolean);
15
+ readonly focusTrap?: boolean;
16
+ readonly focusInitial?: FocusTrapOptions["initialFocus"];
17
+ readonly focusReturn?: FocusTrapOptions["setReturnFocus"];
18
+ readonly focusFallback?: FocusTrapOptions["fallbackFocus"];
19
+ readonly focusCanReturn?: FocusTrapOptions["checkCanReturnFocus"];
20
+ readonly focusCanTrap?: FocusTrapOptions["checkCanFocusTrap"];
21
+ readonly focusPreventScroll?: FocusTrapOptions["preventScroll"];
22
+ readonly anchor: ReferenceElement | string | null;
23
+ readonly placement: Placement;
24
+ readonly shiftPadding: number;
25
+ readonly inline: boolean;
26
+ readonly sideOffset: number;
27
+ readonly alignOffset: number;
28
+ readonly arrow: HTMLElement | null;
29
+ readonly setArrow: Dispatch<SetStateAction<HTMLElement | null>>;
30
+ }
31
+ export declare const context: import("react").Context<DialogContext>;
32
+ export declare const useDialogRoot: () => DialogContext;
@@ -0,0 +1,3 @@
1
+ import { createContext, useContext } from "react";
2
+ export const context = createContext(null);
3
+ export const useDialogRoot = () => useContext(context);
@@ -0,0 +1,9 @@
1
+ import { type JSX } from "react";
2
+ import type { LnComponent } from "../../types.js";
3
+ export declare const DialogDescription: import("react").ForwardRefExoticComponent<Omit<DialogDescription.Props, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
4
+ export declare namespace DialogDescription {
5
+ type Props = LnComponent<Omit<JSX.IntrinsicElements["p"], "id">, State>;
6
+ interface State {
7
+ readonly id: string;
8
+ }
9
+ }
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { useSlot } from "../../../hooks/use-slot/use-slot.js";
5
+ function DialogDescriptionBase({ render, ...props }, ref) {
6
+ const ctx = useDialogRoot();
7
+ const internalProps = {
8
+ id: ctx.descriptionId,
9
+ };
10
+ const final = useSlot({
11
+ props: [internalProps, props, { "data-ln-dialog-description": "true" }],
12
+ ref: ref,
13
+ slot: render ?? _jsx("p", {}),
14
+ state: {
15
+ id: ctx.descriptionId,
16
+ },
17
+ });
18
+ return final;
19
+ }
20
+ export const DialogDescription = forwardRef(DialogDescriptionBase);
@@ -0,0 +1,30 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import { DialogRoot } from "./root.js";
3
+ import { DialogTrigger } from "./trigger.js";
4
+ import { DialogArrow } from "./arrow.js";
5
+ import { DialogClose } from "./close.js";
6
+ import { DialogContainer } from "./container.js";
7
+ import { DialogDescription } from "./description.js";
8
+ import { DialogTitle } from "./title.js";
9
+ import { useDialog } from "./use-dialog.js";
10
+ export declare const Dialog: {
11
+ (props: PropsWithChildren<DialogRoot.Props>): import("react/jsx-runtime").JSX.Element;
12
+ Trigger: import("react").ForwardRefExoticComponent<Omit<DialogTrigger.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
13
+ Arrow: import("react").ForwardRefExoticComponent<Omit<DialogArrow.Props, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
14
+ Close: import("react").ForwardRefExoticComponent<Omit<DialogClose.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
15
+ Container: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement>, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
16
+ Description: import("react").ForwardRefExoticComponent<Omit<DialogDescription.Props, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
17
+ Title: import("react").ForwardRefExoticComponent<Omit<DialogTitle.Props, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
18
+ useControls: typeof useDialog;
19
+ };
20
+ export declare namespace Dialog {
21
+ type Props = DialogRoot.Props;
22
+ namespace Component {
23
+ type Trigger = DialogTrigger.Props;
24
+ type Arrow = DialogArrow.Props;
25
+ type Close = DialogClose.Props;
26
+ type Container = DialogContainer.Props;
27
+ type Description = DialogDescription.Props;
28
+ type Title = DialogTitle.Props;
29
+ }
30
+ }
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DialogRoot } from "./root.js";
3
+ import { DialogTrigger } from "./trigger.js";
4
+ import { DialogArrow } from "./arrow.js";
5
+ import { DialogClose } from "./close.js";
6
+ import { DialogContainer } from "./container.js";
7
+ import { DialogDescription } from "./description.js";
8
+ import { DialogTitle } from "./title.js";
9
+ import { useDialog } from "./use-dialog.js";
10
+ export const Dialog = (props) => _jsx(DialogRoot, { ...props });
11
+ Dialog.Trigger = DialogTrigger;
12
+ Dialog.Arrow = DialogArrow;
13
+ Dialog.Close = DialogClose;
14
+ Dialog.Container = DialogContainer;
15
+ Dialog.Description = DialogDescription;
16
+ Dialog.Title = DialogTitle;
17
+ Dialog.useControls = useDialog;
@@ -0,0 +1,32 @@
1
+ import { type PropsWithChildren } from "react";
2
+ import type { Placement, ReferenceElement } from "../../external/floating-ui.js";
3
+ import type { FocusTrapOptions } from "@1771technologies/lytenyte-shared";
4
+ export declare const DialogRoot: ({ open: openProp, onOpenChange: onOpenChangeProp, onOpenChangeComplete, openInitial, id: idProvided, descriptionId: descIdProvider, titleId: titleIdProvided, children, focusCanReturn, focusCanTrap, focusFallback, focusInitial, focusPreventScroll, focusReturn, focusTrap, lightDismiss, modal, hide, lockScroll, anchor, placement, shiftPadding, inline, sideOffset, alignOffset, }: PropsWithChildren<DialogRoot.Props>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare namespace DialogRoot {
6
+ interface Props {
7
+ readonly open?: boolean;
8
+ readonly openInitial?: boolean;
9
+ readonly onOpenChange?: (open: boolean) => void;
10
+ readonly onOpenChangeComplete?: (open: boolean) => void;
11
+ readonly id?: string;
12
+ readonly titleId?: string;
13
+ readonly descriptionId?: string;
14
+ readonly hide?: boolean;
15
+ readonly lockScroll?: boolean;
16
+ readonly lightDismiss?: boolean | ((el: HTMLElement) => boolean);
17
+ readonly modal?: boolean;
18
+ readonly focusTrap?: boolean;
19
+ readonly focusInitial?: FocusTrapOptions["initialFocus"];
20
+ readonly focusReturn?: FocusTrapOptions["setReturnFocus"];
21
+ readonly focusFallback?: FocusTrapOptions["fallbackFocus"];
22
+ readonly focusCanReturn?: FocusTrapOptions["checkCanReturnFocus"];
23
+ readonly focusCanTrap?: FocusTrapOptions["checkCanFocusTrap"];
24
+ readonly focusPreventScroll?: FocusTrapOptions["preventScroll"];
25
+ readonly anchor?: ReferenceElement | string | null;
26
+ readonly placement?: Placement;
27
+ readonly shiftPadding?: number;
28
+ readonly inline?: boolean;
29
+ readonly sideOffset?: number;
30
+ readonly alignOffset?: number;
31
+ }
32
+ }
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useId, useMemo, useState } from "react";
3
+ import { context } from "./context.js";
4
+ import { useControlled } from "@1771technologies/lytenyte-core/internal";
5
+ export const DialogRoot = ({ open: openProp, onOpenChange: onOpenChangeProp, onOpenChangeComplete, openInitial, id: idProvided, descriptionId: descIdProvider, titleId: titleIdProvided, children, focusCanReturn, focusCanTrap, focusFallback, focusInitial, focusPreventScroll, focusReturn, focusTrap, lightDismiss, modal, hide, lockScroll = modal ?? true, anchor = null, placement = "bottom", shiftPadding = 8, inline = false, sideOffset = 8, alignOffset = 0, }) => {
6
+ const [open, onOpenChange] = useControlled({ controlled: openProp, default: openInitial });
7
+ const [arrow, setArrow] = useState(null);
8
+ const id = useId();
9
+ const descriptionId = useId();
10
+ const titleId = useId();
11
+ const value = useMemo(() => {
12
+ return {
13
+ open,
14
+ onOpenChange: (b) => {
15
+ onOpenChange(b);
16
+ onOpenChangeProp?.(b);
17
+ },
18
+ onOpenChangeComplete: (b) => {
19
+ onOpenChangeComplete?.(b);
20
+ },
21
+ id: idProvided ?? id,
22
+ descriptionId: descIdProvider ?? descriptionId,
23
+ titleId: titleIdProvided ?? titleId,
24
+ hide,
25
+ lightDismiss,
26
+ focusCanReturn,
27
+ focusCanTrap,
28
+ focusFallback,
29
+ focusInitial,
30
+ focusPreventScroll,
31
+ focusReturn,
32
+ focusTrap,
33
+ lockScroll,
34
+ modal,
35
+ anchor,
36
+ placement,
37
+ shiftPadding,
38
+ inline,
39
+ sideOffset,
40
+ alignOffset,
41
+ arrow,
42
+ setArrow,
43
+ };
44
+ }, [
45
+ alignOffset,
46
+ anchor,
47
+ arrow,
48
+ descIdProvider,
49
+ descriptionId,
50
+ focusCanReturn,
51
+ focusCanTrap,
52
+ focusFallback,
53
+ focusInitial,
54
+ focusPreventScroll,
55
+ focusReturn,
56
+ focusTrap,
57
+ hide,
58
+ id,
59
+ idProvided,
60
+ inline,
61
+ lightDismiss,
62
+ lockScroll,
63
+ modal,
64
+ onOpenChange,
65
+ onOpenChangeComplete,
66
+ onOpenChangeProp,
67
+ open,
68
+ placement,
69
+ shiftPadding,
70
+ sideOffset,
71
+ titleId,
72
+ titleIdProvided,
73
+ ]);
74
+ return _jsx(context.Provider, { value: value, children: children });
75
+ };
@@ -0,0 +1,9 @@
1
+ import { type JSX } from "react";
2
+ import type { LnComponent } from "../../types.js";
3
+ export declare const DialogTitle: import("react").ForwardRefExoticComponent<Omit<DialogTitle.Props, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
4
+ export declare namespace DialogTitle {
5
+ type Props = LnComponent<Omit<JSX.IntrinsicElements["h2"], "id">, State>;
6
+ interface State {
7
+ readonly id: string;
8
+ }
9
+ }
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { useSlot } from "../../../hooks/use-slot/use-slot.js";
5
+ function DialogTitleBase({ render, ...props }, ref) {
6
+ const ctx = useDialogRoot();
7
+ const internalProps = {
8
+ id: ctx.titleId,
9
+ };
10
+ const final = useSlot({
11
+ props: [internalProps, props, { "data-ln-dialog-title": "true" }],
12
+ ref: ref,
13
+ slot: render ?? _jsx("h2", {}),
14
+ state: {
15
+ id: ctx.titleId,
16
+ },
17
+ });
18
+ return final;
19
+ }
20
+ export const DialogTitle = forwardRef(DialogTitleBase);
@@ -0,0 +1,5 @@
1
+ import type { Middleware } from "../../external/floating-ui.js";
2
+ export declare const transformOrigin: (options: {
3
+ arrowWidth: number;
4
+ arrowHeight: number;
5
+ }) => Middleware;
@@ -0,0 +1,38 @@
1
+ export const transformOrigin = (options) => ({
2
+ name: "transformOrigin",
3
+ options,
4
+ fn(data) {
5
+ const { placement, rects, middlewareData } = data;
6
+ const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
7
+ const isArrowHidden = cannotCenterArrow;
8
+ const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
9
+ const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
10
+ const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
11
+ const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
12
+ const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
13
+ const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
14
+ let x = "";
15
+ let y = "";
16
+ if (placedSide === "bottom") {
17
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
18
+ y = `${-arrowHeight}px`;
19
+ }
20
+ else if (placedSide === "top") {
21
+ x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
22
+ y = `${rects.floating.height + arrowHeight}px`;
23
+ }
24
+ else if (placedSide === "right") {
25
+ x = `${-arrowHeight}px`;
26
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
27
+ }
28
+ else if (placedSide === "left") {
29
+ x = `${rects.floating.width + arrowHeight}px`;
30
+ y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
31
+ }
32
+ return { data: { x, y } };
33
+ },
34
+ });
35
+ function getSideAndAlignFromPlacement(placement) {
36
+ const [side, align = "center"] = placement.split("-");
37
+ return [side, align];
38
+ }
@@ -0,0 +1,10 @@
1
+ import { type JSX } from "react";
2
+ import type { LnComponent } from "../../types.js";
3
+ export declare const DialogTrigger: import("react").ForwardRefExoticComponent<Omit<DialogTrigger.Props, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
4
+ export declare namespace DialogTrigger {
5
+ type Props = LnComponent<JSX.IntrinsicElements["button"], State>;
6
+ interface State {
7
+ readonly open: boolean;
8
+ readonly openChange: (b: boolean) => void;
9
+ }
10
+ }
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { useDialogRoot } from "./context.js";
4
+ import { useSlot } from "../../../hooks/use-slot/use-slot.js";
5
+ function DialogTriggerBase({ render, ...props }, ref) {
6
+ const ctx = useDialogRoot();
7
+ const internalProps = {
8
+ onClick: () => ctx.onOpenChange(!ctx.open),
9
+ "data-ln-dialog-open": ctx.open,
10
+ "aria-haspopup": "dialog",
11
+ "aria-controls": ctx.open ? ctx.id : undefined,
12
+ };
13
+ const final = useSlot({
14
+ props: [internalProps, props, { "data-ln-dialog-trigger": "true" }],
15
+ ref: ref,
16
+ slot: render ?? _jsx("button", {}),
17
+ state: {
18
+ open: ctx.open,
19
+ openChange: ctx.onOpenChange,
20
+ },
21
+ });
22
+ return final;
23
+ }
24
+ export const DialogTrigger = forwardRef(DialogTriggerBase);
@@ -0,0 +1,4 @@
1
+ export declare function useDialog(): {
2
+ open: boolean;
3
+ openChange: (b: boolean) => void;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { useMemo } from "react";
2
+ import { useDialogRoot } from "./context.js";
3
+ export function useDialog() {
4
+ const { open, onOpenChange } = useDialogRoot();
5
+ const api = useMemo(() => {
6
+ return {
7
+ open,
8
+ openChange: (b) => onOpenChange(b),
9
+ };
10
+ }, [onOpenChange, open]);
11
+ return api;
12
+ }