@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.
- package/dist/__play__/alpha.play.d.ts +3 -0
- package/dist/__play__/alpha.play.js +56 -0
- package/dist/__play__/basic-server-data/data.d.ts +10 -0
- package/dist/__play__/basic-server-data/data.js +17746 -0
- package/dist/__play__/basic-server-data/server.d.ts +36 -0
- package/dist/__play__/basic-server-data/server.js +105 -0
- package/dist/__play__/buttons.play.d.ts +4 -0
- package/dist/__play__/buttons.play.js +7 -0
- package/dist/__play__/inputs.play.d.ts +3 -0
- package/dist/__play__/inputs.play.js +13 -0
- package/dist/__play__/server.play.d.ts +3 -0
- package/dist/__play__/server.play.js +66 -0
- package/dist/__play__/tree.play.d.ts +3 -0
- package/dist/__play__/tree.play.js +47 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
- package/dist/cell-selection/are-rects-equal.d.ts +2 -0
- package/dist/cell-selection/are-rects-equal.js +6 -0
- package/dist/cell-selection/bound-selection-rect.d.ts +3 -0
- package/dist/cell-selection/bound-selection-rect.js +16 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +86 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +79 -0
- package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
- package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
- package/dist/cell-selection/deselect-rect-range.js +43 -0
- package/dist/cell-selection/expand-selection-down.d.ts +3 -0
- package/dist/cell-selection/expand-selection-down.js +78 -0
- package/dist/cell-selection/expand-selection-end.d.ts +3 -0
- package/dist/cell-selection/expand-selection-end.js +76 -0
- package/dist/cell-selection/expand-selection-start.d.ts +3 -0
- package/dist/cell-selection/expand-selection-start.js +73 -0
- package/dist/cell-selection/expand-selection-up.d.ts +3 -0
- package/dist/cell-selection/expand-selection-up.js +74 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +4 -0
- package/dist/cell-selection/get-root-cell.d.ts +3 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +13 -0
- package/dist/cell-selection/index.js +13 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +4 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +3 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +4 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +3 -0
- package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
- package/dist/cell-selection/is-fully-within-rect.js +6 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +5 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +3 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +3 -0
- package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
- package/dist/cell-selection/is-within-selection-rect.js +3 -0
- package/dist/cell-selection/split-cell-selection-rect.d.ts +47 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
- package/dist/cell-selection/update-additive-cell-selection.js +21 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
- package/dist/cell-selection/use-edge-scroll.js +71 -0
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.js +42 -0
- package/dist/components/checkbox/checkbox.play.d.ts +2 -0
- package/dist/components/checkbox/checkbox.play.js +6 -0
- package/dist/components/column-manager/column-manager.d.ts +13 -0
- package/dist/components/column-manager/column-manager.js +47 -0
- package/dist/components/external/clsx.d.ts +2 -0
- package/dist/components/external/clsx.js +44 -0
- package/dist/components/external/floating-ui.d.ts +268 -0
- package/dist/components/external/floating-ui.js +1802 -0
- package/dist/components/headless/dialog/arrow.d.ts +6 -0
- package/dist/components/headless/dialog/arrow.js +16 -0
- package/dist/components/headless/dialog/close.d.ts +10 -0
- package/dist/components/headless/dialog/close.js +22 -0
- package/dist/components/headless/dialog/container.d.ts +5 -0
- package/dist/components/headless/dialog/container.js +221 -0
- package/dist/components/headless/dialog/context.d.ts +32 -0
- package/dist/components/headless/dialog/context.js +3 -0
- package/dist/components/headless/dialog/description.d.ts +9 -0
- package/dist/components/headless/dialog/description.js +20 -0
- package/dist/components/headless/dialog/index.parts.d.ts +30 -0
- package/dist/components/headless/dialog/index.parts.js +17 -0
- package/dist/components/headless/dialog/root.d.ts +32 -0
- package/dist/components/headless/dialog/root.js +75 -0
- package/dist/components/headless/dialog/title.d.ts +9 -0
- package/dist/components/headless/dialog/title.js +20 -0
- package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
- package/dist/components/headless/dialog/transform-origin.js +38 -0
- package/dist/components/headless/dialog/trigger.d.ts +10 -0
- package/dist/components/headless/dialog/trigger.js +24 -0
- package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
- package/dist/components/headless/dialog/use-dialog.js +12 -0
- package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
- package/dist/components/headless/menu/checkbox-item.js +42 -0
- package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
- package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
- package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-context.js +3 -0
- package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
- package/dist/components/headless/menu/combo/combo-input.js +58 -0
- package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
- package/dist/components/headless/menu/combo/combo-menu.js +24 -0
- package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-option.js +37 -0
- package/dist/components/headless/menu/container.d.ts +5 -0
- package/dist/components/headless/menu/container.js +19 -0
- package/dist/components/headless/menu/dom.d.ts +4 -0
- package/dist/components/headless/menu/dom.js +20 -0
- package/dist/components/headless/menu/index.d.ts +54 -0
- package/dist/components/headless/menu/index.js +39 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
- package/dist/components/headless/menu/item/item.d.ts +9 -0
- package/dist/components/headless/menu/item/item.js +45 -0
- package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
- package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
- package/dist/components/headless/menu/menu-divider.d.ts +5 -0
- package/dist/components/headless/menu/menu-divider.js +6 -0
- package/dist/components/headless/menu/menu-group.d.ts +5 -0
- package/dist/components/headless/menu/menu-group.js +6 -0
- package/dist/components/headless/menu/menu-header.d.ts +5 -0
- package/dist/components/headless/menu/menu-header.js +6 -0
- package/dist/components/headless/menu/popover.d.ts +5 -0
- package/dist/components/headless/menu/popover.js +7 -0
- package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
- package/dist/components/headless/menu/radio-group/context.js +7 -0
- package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
- package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
- package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
- package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
- package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
- package/dist/components/headless/menu/submenu/submenu.js +55 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
- package/dist/components/headless/menu/use-menu.d.ts +1 -0
- package/dist/components/headless/menu/use-menu.js +52 -0
- package/dist/components/headless/popover/container.d.ts +5 -0
- package/dist/components/headless/popover/container.js +7 -0
- package/dist/components/headless/popover/context.d.ts +6 -0
- package/dist/components/headless/popover/context.js +3 -0
- package/dist/components/headless/popover/index.d.ts +30 -0
- package/dist/components/headless/popover/index.js +17 -0
- package/dist/components/headless/popover/root.d.ts +6 -0
- package/dist/components/headless/popover/root.js +8 -0
- package/dist/components/headless/popover/trigger.d.ts +7 -0
- package/dist/components/headless/popover/trigger.js +11 -0
- package/dist/components/pill-manager/container.d.ts +5 -0
- package/dist/components/pill-manager/container.js +127 -0
- package/dist/components/pill-manager/expander.d.ts +9 -0
- package/dist/components/pill-manager/expander.js +21 -0
- package/dist/components/pill-manager/icons.d.ts +12 -0
- package/dist/components/pill-manager/icons.js +35 -0
- package/dist/components/pill-manager/index.d.ts +33 -0
- package/dist/components/pill-manager/index.js +13 -0
- package/dist/components/pill-manager/item.d.ts +10 -0
- package/dist/components/pill-manager/item.js +178 -0
- package/dist/components/pill-manager/label.d.ts +10 -0
- package/dist/components/pill-manager/label.js +31 -0
- package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
- package/dist/components/pill-manager/pill-manager.play.js +73 -0
- package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
- package/dist/components/pill-manager/pill-row.context.js +4 -0
- package/dist/components/pill-manager/pill-row.d.ts +12 -0
- package/dist/components/pill-manager/pill-row.js +22 -0
- package/dist/components/pill-manager/root.context.d.ts +40 -0
- package/dist/components/pill-manager/root.context.js +4 -0
- package/dist/components/pill-manager/root.d.ts +25 -0
- package/dist/components/pill-manager/root.js +33 -0
- package/dist/components/pill-manager/row-default.d.ts +3 -0
- package/dist/components/pill-manager/row-default.js +14 -0
- package/dist/components/pill-manager/types.d.ts +21 -0
- package/dist/components/pill-manager/types.js +1 -0
- package/dist/components/row-group-cell.d.ts +13 -0
- package/dist/components/row-group-cell.js +40 -0
- package/dist/components/select-all.d.ts +12 -0
- package/dist/components/select-all.js +34 -0
- package/dist/components/smart-select/chip-context.d.ts +8 -0
- package/dist/components/smart-select/chip-context.js +4 -0
- package/dist/components/smart-select/chip-remove.d.ts +1 -0
- package/dist/components/smart-select/chip-remove.js +13 -0
- package/dist/components/smart-select/chip.d.ts +13 -0
- package/dist/components/smart-select/chip.js +79 -0
- package/dist/components/smart-select/container.d.ts +1 -0
- package/dist/components/smart-select/container.js +13 -0
- package/dist/components/smart-select/context.d.ts +31 -0
- package/dist/components/smart-select/context.js +4 -0
- package/dist/components/smart-select/index.d.ts +30 -0
- package/dist/components/smart-select/index.js +19 -0
- package/dist/components/smart-select/option.d.ts +8 -0
- package/dist/components/smart-select/option.js +36 -0
- package/dist/components/smart-select/root.d.ts +17 -0
- package/dist/components/smart-select/root.js +165 -0
- package/dist/components/smart-select/smart-select.play.d.ts +2 -0
- package/dist/components/smart-select/smart-select.play.js +36 -0
- package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
- package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
- package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
- package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
- package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
- package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
- package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
- package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
- package/dist/components/smart-select/type.d.ts +44 -0
- package/dist/components/smart-select/type.js +1 -0
- package/dist/components/smart-select/use-async-options.d.ts +8 -0
- package/dist/components/smart-select/use-async-options.js +42 -0
- package/dist/components/tree-view/index.d.ts +4 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/root.d.ts +37 -0
- package/dist/components/tree-view/root.js +139 -0
- package/dist/components/tree-view/select-all.d.ts +7 -0
- package/dist/components/tree-view/select-all.js +22 -0
- package/dist/components/tree-view/tree-children.d.ts +2 -0
- package/dist/components/tree-view/tree-children.js +15 -0
- package/dist/components/tree-view/types.d.ts +31 -0
- package/dist/components/tree-view/types.js +1 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/components/types.js +1 -0
- package/dist/components/virtual-from-coordinates.d.ts +2 -0
- package/dist/components/virtual-from-coordinates.js +15 -0
- package/dist/components.d.ts +16 -0
- package/dist/components.js +11 -0
- package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
- package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
- package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
- package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
- package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
- package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
- package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
- package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
- package/dist/data-source-client/use-client-data-source.d.ts +91 -0
- package/dist/data-source-client/use-client-data-source.js +169 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
- package/dist/data-source-server/async-tree/types.d.ts +70 -0
- package/dist/data-source-server/async-tree/types.js +1 -0
- package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/data-source-server/range-tree/range-tree.js +102 -0
- package/dist/data-source-server/server-data.d.ts +73 -0
- package/dist/data-source-server/server-data.js +553 -0
- package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
- package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
- package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
- package/dist/data-source-server/source/use-on-view-change.js +13 -0
- package/dist/data-source-server/source/use-row-add.d.ts +3 -0
- package/dist/data-source-server/source/use-row-add.js +36 -0
- package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-by-id.js +8 -0
- package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
- package/dist/data-source-server/source/use-row-by-index.js +89 -0
- package/dist/data-source-server/source/use-row-children.d.ts +2 -0
- package/dist/data-source-server/source/use-row-children.js +16 -0
- package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
- package/dist/data-source-server/source/use-row-delete.js +39 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
- package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-server/source/use-row-leafs.js +20 -0
- package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-server/source/use-row-parents.js +16 -0
- package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-server/source/use-row-siblings.js +15 -0
- package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
- package/dist/data-source-server/source/use-rows-between.js +20 -0
- package/dist/data-source-server/source/use-source-state.d.ts +28 -0
- package/dist/data-source-server/source/use-source-state.js +47 -0
- package/dist/data-source-server/source/use-source.d.ts +5 -0
- package/dist/data-source-server/source/use-source.js +66 -0
- package/dist/data-source-server/types.d.ts +42 -0
- package/dist/data-source-server/types.js +1 -0
- package/dist/data-source-server/use-server-data-source.d.ts +51 -0
- package/dist/data-source-server/use-server-data-source.js +192 -0
- package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-depth.js +9 -0
- package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-path.js +9 -0
- package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/data-source-server/utils/get-request-id.js +6 -0
- package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
- package/dist/data-source-tree/source/use-controlled-state.js +21 -0
- package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
- package/dist/data-source-tree/source/use-flattened.js +65 -0
- package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
- package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
- package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-by-id.js +7 -0
- package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-children.js +11 -0
- package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-leafs.js +20 -0
- package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-parents.js +16 -0
- package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-siblings.js +12 -0
- package/dist/data-source-tree/source/use-tree.d.ts +3 -0
- package/dist/data-source-tree/source/use-tree.js +59 -0
- package/dist/data-source-tree/types.d.ts +16 -0
- package/dist/data-source-tree/types.js +1 -0
- package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
- package/dist/data-source-tree/use-tree-data-source.js +101 -0
- package/dist/data-source-tree/utils/is-object.d.ts +1 -0
- package/dist/data-source-tree/utils/is-object.js +3 -0
- package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
- package/dist/hooks/use-slot/get-element-ref.js +20 -0
- package/dist/hooks/use-slot/index.d.ts +3 -0
- package/dist/hooks/use-slot/index.js +1 -0
- package/dist/hooks/use-slot/merge-props.d.ts +4 -0
- package/dist/hooks/use-slot/merge-props.js +27 -0
- package/dist/hooks/use-slot/react-version.d.ts +3 -0
- package/dist/hooks/use-slot/react-version.js +5 -0
- package/dist/hooks/use-slot/types.d.ts +4 -0
- package/dist/hooks/use-slot/types.js +1 -0
- package/dist/hooks/use-slot/use-slot.d.ts +12 -0
- package/dist/hooks/use-slot/use-slot.js +28 -0
- package/dist/hooks/use-transitioned-open.d.ts +2 -0
- package/dist/hooks/use-transitioned-open.js +50 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +23 -0
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/root/context.d.ts +16 -0
- package/dist/root/context.js +4 -0
- package/dist/root/hooks/use-pro-api.d.ts +2 -0
- package/dist/root/hooks/use-pro-api.js +8 -0
- package/dist/root/root.d.ts +15 -0
- package/dist/root/root.js +112 -0
- package/dist/types/api.d.ts +100 -0
- package/dist/types/api.js +1 -0
- package/dist/types/column.d.ts +73 -0
- package/dist/types/column.js +1 -0
- package/dist/types/events.d.ts +56 -0
- package/dist/types/events.js +1 -0
- package/dist/types/grid.d.ts +47 -0
- package/dist/types/grid.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +1 -0
- package/dist/types/props.d.ts +187 -0
- package/dist/types/props.js +1 -0
- 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,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,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,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
|
+
}
|