@accelint/design-toolkit 9.2.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -22
- package/catalog-info.yaml +4 -4
- package/dist/components/accordion/context.d.ts +6 -0
- package/dist/components/accordion/context.js +6 -0
- package/dist/components/accordion/context.js.map +1 -1
- package/dist/components/accordion/group.d.ts +37 -2
- package/dist/components/accordion/group.js +34 -0
- package/dist/components/accordion/group.js.map +1 -1
- package/dist/components/accordion/header.d.ts +27 -2
- package/dist/components/accordion/header.js +25 -1
- package/dist/components/accordion/header.js.map +1 -1
- package/dist/components/accordion/index.d.ts +18 -4
- package/dist/components/accordion/index.js +16 -2
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/panel.d.ts +29 -2
- package/dist/components/accordion/panel.js +26 -0
- package/dist/components/accordion/panel.js.map +1 -1
- package/dist/components/accordion/trigger.d.ts +25 -2
- package/dist/components/accordion/trigger.js +23 -1
- package/dist/components/accordion/trigger.js.map +1 -1
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/action-bar/index.d.ts +35 -6
- package/dist/components/action-bar/index.js +33 -5
- package/dist/components/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/styles.module.css +9 -1
- package/dist/components/action-bar/types.d.ts +8 -0
- package/dist/components/avatar/context.d.ts +22 -4
- package/dist/components/avatar/context.js +18 -0
- package/dist/components/avatar/context.js.map +1 -1
- package/dist/components/avatar/index.d.ts +22 -15
- package/dist/components/avatar/index.js +21 -14
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/types.d.ts +13 -0
- package/dist/components/badge/context.d.ts +22 -4
- package/dist/components/badge/context.js +18 -0
- package/dist/components/badge/context.js.map +1 -1
- package/dist/components/badge/index.d.ts +30 -16
- package/dist/components/badge/index.js +28 -14
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/types.d.ts +9 -0
- package/dist/components/breadcrumbs/index.d.ts +10 -2
- package/dist/components/breadcrumbs/index.js +7 -0
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/breadcrumbs/item.d.ts +25 -2
- package/dist/components/breadcrumbs/item.js +23 -1
- package/dist/components/breadcrumbs/item.js.map +1 -1
- package/dist/components/breadcrumbs/types.d.ts +17 -0
- package/dist/components/button/context.d.ts +62 -8
- package/dist/components/button/context.js +54 -0
- package/dist/components/button/context.js.map +1 -1
- package/dist/components/button/index.d.ts +21 -2
- package/dist/components/button/index.js +19 -0
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/link.d.ts +22 -2
- package/dist/components/button/link.js +20 -0
- package/dist/components/button/link.js.map +1 -1
- package/dist/components/button/toggle.d.ts +23 -2
- package/dist/components/button/toggle.js +22 -1
- package/dist/components/button/toggle.js.map +1 -1
- package/dist/components/button/types.d.ts +26 -0
- package/dist/components/checkbox/context.d.ts +9 -3
- package/dist/components/checkbox/context.js +6 -0
- package/dist/components/checkbox/context.js.map +1 -1
- package/dist/components/checkbox/group.d.ts +31 -2
- package/dist/components/checkbox/group.js +28 -0
- package/dist/components/checkbox/group.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +19 -2
- package/dist/components/checkbox/index.js +19 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/types.d.ts +19 -0
- package/dist/components/chip/context.d.ts +22 -4
- package/dist/components/chip/context.js +18 -0
- package/dist/components/chip/context.js.map +1 -1
- package/dist/components/chip/deletable.d.ts +38 -2
- package/dist/components/chip/deletable.js +36 -1
- package/dist/components/chip/deletable.js.map +1 -1
- package/dist/components/chip/index.d.ts +24 -2
- package/dist/components/chip/index.js +22 -0
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/list.d.ts +49 -4
- package/dist/components/chip/list.js +45 -0
- package/dist/components/chip/list.js.map +1 -1
- package/dist/components/chip/selectable.d.ts +34 -2
- package/dist/components/chip/selectable.js +31 -0
- package/dist/components/chip/selectable.js.map +1 -1
- package/dist/components/chip/types.d.ts +27 -0
- package/dist/components/classification-badge/context.d.ts +20 -4
- package/dist/components/classification-badge/context.js +16 -0
- package/dist/components/classification-badge/context.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +28 -10
- package/dist/components/classification-badge/index.js +25 -8
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +4 -0
- package/dist/components/classification-banner/context.d.ts +20 -4
- package/dist/components/classification-banner/context.js +16 -0
- package/dist/components/classification-banner/context.js.map +1 -1
- package/dist/components/classification-banner/index.d.ts +12 -2
- package/dist/components/classification-banner/index.js +9 -0
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +4 -0
- package/dist/components/clock/index.d.ts +12 -2
- package/dist/components/clock/index.js +10 -0
- package/dist/components/clock/index.js.map +1 -1
- package/dist/components/clock/types.d.ts +4 -0
- package/dist/components/color-picker/index.d.ts +12 -10
- package/dist/components/color-picker/index.js +10 -8
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/types.d.ts +8 -0
- package/dist/components/combobox-field/context.d.ts +20 -4
- package/dist/components/combobox-field/context.js +16 -0
- package/dist/components/combobox-field/context.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +15 -2
- package/dist/components/combobox-field/index.js +57 -38
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.module.css +5 -1
- package/dist/components/combobox-field/types.d.ts +19 -0
- package/dist/components/coordinate-field/context.d.ts +15 -6
- package/dist/components/coordinate-field/context.js +9 -0
- package/dist/components/coordinate-field/context.js.map +1 -1
- package/dist/components/coordinate-field/coordinate-utils.d.ts +8 -0
- package/dist/components/coordinate-field/coordinate-utils.js +8 -0
- package/dist/components/coordinate-field/coordinate-utils.js.map +1 -1
- package/dist/components/coordinate-field/index.d.ts +29 -2
- package/dist/components/coordinate-field/index.js +32 -4
- package/dist/components/coordinate-field/index.js.map +1 -1
- package/dist/components/coordinate-field/segment.d.ts +28 -2
- package/dist/components/coordinate-field/segment.js +28 -1
- package/dist/components/coordinate-field/segment.js.map +1 -1
- package/dist/components/coordinate-field/styles.module.css +19 -1
- package/dist/components/coordinate-field/types.d.ts +2 -0
- package/dist/components/coordinate-field/types.js.map +1 -1
- package/dist/components/date-field/index.d.ts +28 -2
- package/dist/components/date-field/index.js +29 -2
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.module.css +4 -0
- package/dist/components/date-field/types.d.ts +19 -3
- package/dist/components/deferred-collection/index.d.ts +51 -0
- package/dist/components/deferred-collection/index.js +52 -0
- package/dist/components/deferred-collection/index.js.map +1 -0
- package/dist/components/deferred-collection/types.d.ts +29 -0
- package/dist/components/deferred-collection/types.js +12 -0
- package/dist/components/details-list/context.d.ts +25 -4
- package/dist/components/details-list/context.js +21 -0
- package/dist/components/details-list/context.js.map +1 -1
- package/dist/components/details-list/index.d.ts +9 -2
- package/dist/components/details-list/index.js +7 -0
- package/dist/components/details-list/index.js.map +1 -1
- package/dist/components/details-list/label.d.ts +18 -2
- package/dist/components/details-list/label.js +16 -0
- package/dist/components/details-list/label.js.map +1 -1
- package/dist/components/details-list/types.d.ts +14 -0
- package/dist/components/details-list/value.d.ts +20 -2
- package/dist/components/details-list/value.js +17 -0
- package/dist/components/details-list/value.js.map +1 -1
- package/dist/components/dialog/content.d.ts +23 -2
- package/dist/components/dialog/content.js +20 -0
- package/dist/components/dialog/content.js.map +1 -1
- package/dist/components/dialog/context.d.ts +5 -2
- package/dist/components/dialog/context.js +3 -0
- package/dist/components/dialog/context.js.map +1 -1
- package/dist/components/dialog/footer.d.ts +26 -2
- package/dist/components/dialog/footer.js +23 -0
- package/dist/components/dialog/footer.js.map +1 -1
- package/dist/components/dialog/index.d.ts +12 -2
- package/dist/components/dialog/index.js +10 -0
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/title.d.ts +21 -2
- package/dist/components/dialog/title.js +18 -0
- package/dist/components/dialog/title.js.map +1 -1
- package/dist/components/dialog/trigger.d.ts +18 -0
- package/dist/components/dialog/trigger.js +17 -0
- package/dist/components/dialog/trigger.js.map +1 -1
- package/dist/components/dialog/types.d.ts +12 -0
- package/dist/components/divider/context.d.ts +24 -4
- package/dist/components/divider/context.js +20 -0
- package/dist/components/divider/context.js.map +1 -1
- package/dist/components/divider/index.d.ts +13 -2
- package/dist/components/divider/index.js +10 -0
- package/dist/components/divider/index.js.map +1 -1
- package/dist/components/divider/types.d.ts +4 -4
- package/dist/components/drawer/back.d.ts +21 -2
- package/dist/components/drawer/back.js +19 -1
- package/dist/components/drawer/back.js.map +1 -1
- package/dist/components/drawer/close.d.ts +25 -2
- package/dist/components/drawer/close.js +28 -3
- package/dist/components/drawer/close.js.map +1 -1
- package/dist/components/drawer/content.d.ts +22 -2
- package/dist/components/drawer/content.js +19 -0
- package/dist/components/drawer/content.js.map +1 -1
- package/dist/components/drawer/context.d.ts +46 -4
- package/dist/components/drawer/context.js +45 -2
- package/dist/components/drawer/context.js.map +1 -1
- package/dist/components/drawer/events.d.ts +2 -0
- package/dist/components/drawer/events.js +2 -0
- package/dist/components/drawer/events.js.map +1 -1
- package/dist/components/drawer/footer.d.ts +24 -2
- package/dist/components/drawer/footer.js +21 -0
- package/dist/components/drawer/footer.js.map +1 -1
- package/dist/components/drawer/header-title.d.ts +22 -4
- package/dist/components/drawer/header-title.js +19 -2
- package/dist/components/drawer/header-title.js.map +1 -1
- package/dist/components/drawer/header.d.ts +34 -2
- package/dist/components/drawer/header.js +42 -2
- package/dist/components/drawer/header.js.map +1 -1
- package/dist/components/drawer/index.d.ts +14 -2
- package/dist/components/drawer/index.js +16 -0
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/layout-main.d.ts +23 -2
- package/dist/components/drawer/layout-main.js +20 -0
- package/dist/components/drawer/layout-main.js.map +1 -1
- package/dist/components/drawer/layout.d.ts +25 -2
- package/dist/components/drawer/layout.js +22 -0
- package/dist/components/drawer/layout.js.map +1 -1
- package/dist/components/drawer/menu-item.d.ts +25 -2
- package/dist/components/drawer/menu-item.js +22 -0
- package/dist/components/drawer/menu-item.js.map +1 -1
- package/dist/components/drawer/menu.d.ts +22 -2
- package/dist/components/drawer/menu.js +19 -0
- package/dist/components/drawer/menu.js.map +1 -1
- package/dist/components/drawer/panel.d.ts +21 -2
- package/dist/components/drawer/panel.js +18 -0
- package/dist/components/drawer/panel.js.map +1 -1
- package/dist/components/drawer/styles.module.css +2 -2
- package/dist/components/drawer/trigger.d.ts +31 -2
- package/dist/components/drawer/trigger.js +29 -1
- package/dist/components/drawer/trigger.js.map +1 -1
- package/dist/components/drawer/types.d.ts +149 -2
- package/dist/components/drawer/view.d.ts +25 -2
- package/dist/components/drawer/view.js +22 -0
- package/dist/components/drawer/view.js.map +1 -1
- package/dist/components/flashcard/index.d.ts +129 -27
- package/dist/components/flashcard/index.js +120 -18
- package/dist/components/flashcard/index.js.map +1 -1
- package/dist/components/flashcard/styles.module.css +1 -1
- package/dist/components/flashcard/types.d.ts +12 -0
- package/dist/components/hero/context.d.ts +5 -2
- package/dist/components/hero/context.js +3 -0
- package/dist/components/hero/context.js.map +1 -1
- package/dist/components/hero/index.d.ts +9 -2
- package/dist/components/hero/index.js +7 -0
- package/dist/components/hero/index.js.map +1 -1
- package/dist/components/hero/subtitle.d.ts +17 -2
- package/dist/components/hero/subtitle.js +15 -0
- package/dist/components/hero/subtitle.js.map +1 -1
- package/dist/components/hero/title.d.ts +15 -2
- package/dist/components/hero/title.js +13 -0
- package/dist/components/hero/title.js.map +1 -1
- package/dist/components/hero/types.d.ts +9 -0
- package/dist/components/hotkey/context.d.ts +24 -4
- package/dist/components/hotkey/context.js +20 -0
- package/dist/components/hotkey/context.js.map +1 -1
- package/dist/components/hotkey/index.d.ts +17 -2
- package/dist/components/hotkey/index.js +15 -0
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/hotkey/set.d.ts +21 -2
- package/dist/components/hotkey/set.js +18 -0
- package/dist/components/hotkey/set.js.map +1 -1
- package/dist/components/hotkey/types.d.ts +4 -0
- package/dist/components/icon/context.d.ts +24 -4
- package/dist/components/icon/context.js +20 -0
- package/dist/components/icon/context.js.map +1 -1
- package/dist/components/icon/index.d.ts +15 -2
- package/dist/components/icon/index.js +13 -0
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -0
- package/dist/components/input/context.d.ts +6 -2
- package/dist/components/input/context.js +4 -0
- package/dist/components/input/context.js.map +1 -1
- package/dist/components/input/index.d.ts +17 -2
- package/dist/components/input/index.js +19 -3
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.module.css +5 -1
- package/dist/components/input/types.d.ts +16 -0
- package/dist/components/kanban/card-body.d.ts +10 -2
- package/dist/components/kanban/card-body.js +8 -0
- package/dist/components/kanban/card-body.js.map +1 -1
- package/dist/components/kanban/card-header-actions.d.ts +10 -2
- package/dist/components/kanban/card-header-actions.js +8 -0
- package/dist/components/kanban/card-header-actions.js.map +1 -1
- package/dist/components/kanban/card-header-title.d.ts +10 -2
- package/dist/components/kanban/card-header-title.js +8 -0
- package/dist/components/kanban/card-header-title.js.map +1 -1
- package/dist/components/kanban/card-header.d.ts +12 -2
- package/dist/components/kanban/card-header.js +10 -0
- package/dist/components/kanban/card-header.js.map +1 -1
- package/dist/components/kanban/card.d.ts +26 -2
- package/dist/components/kanban/card.js +23 -0
- package/dist/components/kanban/card.js.map +1 -1
- package/dist/components/kanban/column-actions.d.ts +10 -2
- package/dist/components/kanban/column-actions.js +9 -1
- package/dist/components/kanban/column-actions.js.map +1 -1
- package/dist/components/kanban/column-container.d.ts +10 -2
- package/dist/components/kanban/column-container.js +8 -0
- package/dist/components/kanban/column-container.js.map +1 -1
- package/dist/components/kanban/column-content.d.ts +13 -2
- package/dist/components/kanban/column-content.js +11 -0
- package/dist/components/kanban/column-content.js.map +1 -1
- package/dist/components/kanban/column-header-actions.d.ts +13 -2
- package/dist/components/kanban/column-header-actions.js +11 -0
- package/dist/components/kanban/column-header-actions.js.map +1 -1
- package/dist/components/kanban/column-header-drag-handle.d.ts +7 -2
- package/dist/components/kanban/column-header-drag-handle.js +6 -1
- package/dist/components/kanban/column-header-drag-handle.js.map +1 -1
- package/dist/components/kanban/column-header-title.d.ts +10 -2
- package/dist/components/kanban/column-header-title.js +8 -0
- package/dist/components/kanban/column-header-title.js.map +1 -1
- package/dist/components/kanban/column-header.d.ts +12 -2
- package/dist/components/kanban/column-header.js +10 -0
- package/dist/components/kanban/column-header.js.map +1 -1
- package/dist/components/kanban/column.d.ts +22 -2
- package/dist/components/kanban/column.js +19 -0
- package/dist/components/kanban/column.js.map +1 -1
- package/dist/components/kanban/context.d.ts +49 -2
- package/dist/components/kanban/context.js +30 -0
- package/dist/components/kanban/context.js.map +1 -1
- package/dist/components/kanban/header-actions.d.ts +10 -2
- package/dist/components/kanban/header-actions.js +8 -0
- package/dist/components/kanban/header-actions.js.map +1 -1
- package/dist/components/kanban/header-search.d.ts +9 -2
- package/dist/components/kanban/header-search.js +7 -0
- package/dist/components/kanban/header-search.js.map +1 -1
- package/dist/components/kanban/header-title.d.ts +10 -2
- package/dist/components/kanban/header-title.js +8 -0
- package/dist/components/kanban/header-title.js.map +1 -1
- package/dist/components/kanban/header.d.ts +12 -2
- package/dist/components/kanban/header.js +10 -0
- package/dist/components/kanban/header.js.map +1 -1
- package/dist/components/kanban/kanban.d.ts +33 -4
- package/dist/components/kanban/kanban.js +29 -0
- package/dist/components/kanban/kanban.js.map +1 -1
- package/dist/components/kanban/types.d.ts +51 -0
- package/dist/components/label/context.d.ts +25 -4
- package/dist/components/label/context.js +21 -0
- package/dist/components/label/context.js.map +1 -1
- package/dist/components/label/index.d.ts +16 -2
- package/dist/components/label/index.js +14 -0
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/types.d.ts +5 -0
- package/dist/components/lines/index.d.ts +12 -2
- package/dist/components/lines/index.js +9 -0
- package/dist/components/lines/index.js.map +1 -1
- package/dist/components/lines/types.d.ts +6 -0
- package/dist/components/link/context.d.ts +21 -2
- package/dist/components/link/context.js +18 -0
- package/dist/components/link/context.js.map +1 -1
- package/dist/components/link/index.d.ts +12 -2
- package/dist/components/link/index.js +9 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/link/types.d.ts +5 -0
- package/dist/components/list/context.d.ts +11 -2
- package/dist/components/list/context.js +9 -0
- package/dist/components/list/context.js.map +1 -1
- package/dist/components/list/index.d.ts +11 -2
- package/dist/components/list/index.js +9 -0
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list/item-content.d.ts +9 -2
- package/dist/components/list/item-content.js +6 -0
- package/dist/components/list/item-content.js.map +1 -1
- package/dist/components/list/item-description.d.ts +9 -2
- package/dist/components/list/item-description.js +7 -0
- package/dist/components/list/item-description.js.map +1 -1
- package/dist/components/list/item-title.d.ts +9 -2
- package/dist/components/list/item-title.js +7 -0
- package/dist/components/list/item-title.js.map +1 -1
- package/dist/components/list/item.d.ts +10 -2
- package/dist/components/list/item.js +8 -0
- package/dist/components/list/item.js.map +1 -1
- package/dist/components/list/types.d.ts +22 -0
- package/dist/components/menu/context.d.ts +6 -2
- package/dist/components/menu/context.js +4 -0
- package/dist/components/menu/context.js.map +1 -1
- package/dist/components/menu/index.d.ts +24 -3
- package/dist/components/menu/index.js +22 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/item-description.d.ts +17 -2
- package/dist/components/menu/item-description.js +15 -0
- package/dist/components/menu/item-description.js.map +1 -1
- package/dist/components/menu/item-label.d.ts +17 -2
- package/dist/components/menu/item-label.js +15 -0
- package/dist/components/menu/item-label.js.map +1 -1
- package/dist/components/menu/item.d.ts +23 -2
- package/dist/components/menu/item.js +21 -1
- package/dist/components/menu/item.js.map +1 -1
- package/dist/components/menu/section.d.ts +23 -2
- package/dist/components/menu/section.js +20 -0
- package/dist/components/menu/section.js.map +1 -1
- package/dist/components/menu/separator.d.ts +16 -2
- package/dist/components/menu/separator.js +14 -0
- package/dist/components/menu/separator.js.map +1 -1
- package/dist/components/menu/styles.module.css +62 -46
- package/dist/components/menu/submenu.d.ts +18 -2
- package/dist/components/menu/submenu.js +16 -0
- package/dist/components/menu/submenu.js.map +1 -1
- package/dist/components/menu/trigger.d.ts +15 -0
- package/dist/components/menu/trigger.js +15 -0
- package/dist/components/menu/trigger.js.map +1 -1
- package/dist/components/menu/types.d.ts +25 -0
- package/dist/components/notice/events.d.ts +9 -0
- package/dist/components/notice/events.js +9 -0
- package/dist/components/notice/events.js.map +1 -1
- package/dist/components/notice/index.d.ts +34 -2
- package/dist/components/notice/index.js +32 -1
- package/dist/components/notice/index.js.map +1 -1
- package/dist/components/notice/list.d.ts +31 -2
- package/dist/components/notice/list.js +28 -0
- package/dist/components/notice/list.js.map +1 -1
- package/dist/components/notice/notice-icon.d.ts +22 -2
- package/dist/components/notice/notice-icon.js +23 -1
- package/dist/components/notice/notice-icon.js.map +1 -1
- package/dist/components/notice/types.d.ts +60 -0
- package/dist/components/notice/utils.d.ts +8 -0
- package/dist/components/notice/utils.js +8 -0
- package/dist/components/notice/utils.js.map +1 -1
- package/dist/components/options/context.d.ts +3 -2
- package/dist/components/options/context.js +1 -0
- package/dist/components/options/context.js.map +1 -1
- package/dist/components/options/index.d.ts +15 -2
- package/dist/components/options/index.js +13 -0
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/item-content.d.ts +22 -2
- package/dist/components/options/item-content.js +19 -0
- package/dist/components/options/item-content.js.map +1 -1
- package/dist/components/options/item-description.d.ts +14 -2
- package/dist/components/options/item-description.js +12 -0
- package/dist/components/options/item-description.js.map +1 -1
- package/dist/components/options/item-label.d.ts +14 -2
- package/dist/components/options/item-label.js +12 -0
- package/dist/components/options/item-label.js.map +1 -1
- package/dist/components/options/item.d.ts +22 -0
- package/dist/components/options/item.js +21 -0
- package/dist/components/options/item.js.map +1 -1
- package/dist/components/options/section.d.ts +21 -2
- package/dist/components/options/section.js +18 -0
- package/dist/components/options/section.js.map +1 -1
- package/dist/components/options/types.d.ts +24 -0
- package/dist/components/pagination/context.d.ts +3 -2
- package/dist/components/pagination/context.js +1 -0
- package/dist/components/pagination/context.js.map +1 -1
- package/dist/components/pagination/index.d.ts +18 -11
- package/dist/components/pagination/index.js +15 -9
- package/dist/components/pagination/index.js.map +1 -1
- package/dist/components/pagination/next.d.ts +17 -2
- package/dist/components/pagination/next.js +15 -0
- package/dist/components/pagination/next.js.map +1 -1
- package/dist/components/pagination/pages.d.ts +21 -2
- package/dist/components/pagination/pages.js +18 -0
- package/dist/components/pagination/pages.js.map +1 -1
- package/dist/components/pagination/prev.d.ts +17 -2
- package/dist/components/pagination/prev.js +16 -1
- package/dist/components/pagination/prev.js.map +1 -1
- package/dist/components/pagination/types.d.ts +32 -0
- package/dist/components/pagination/utils.d.ts +35 -0
- package/dist/components/pagination/utils.js +35 -0
- package/dist/components/pagination/utils.js.map +1 -1
- package/dist/components/popover/content.d.ts +20 -2
- package/dist/components/popover/content.js +17 -0
- package/dist/components/popover/content.js.map +1 -1
- package/dist/components/popover/footer.d.ts +22 -2
- package/dist/components/popover/footer.js +19 -0
- package/dist/components/popover/footer.js.map +1 -1
- package/dist/components/popover/index.d.ts +9 -2
- package/dist/components/popover/index.js +8 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.module.css +6 -0
- package/dist/components/popover/title.d.ts +17 -2
- package/dist/components/popover/title.js +15 -0
- package/dist/components/popover/title.js.map +1 -1
- package/dist/components/popover/trigger.d.ts +24 -2
- package/dist/components/popover/trigger.js +21 -0
- package/dist/components/popover/trigger.js.map +1 -1
- package/dist/components/popover/types.d.ts +10 -0
- package/dist/components/query-builder/action-element.d.ts +20 -2
- package/dist/components/query-builder/action-element.js +17 -0
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/actions.d.ts +37 -4
- package/dist/components/query-builder/actions.js +36 -1
- package/dist/components/query-builder/actions.js.map +1 -1
- package/dist/components/query-builder/combinator-selector.d.ts +10 -2
- package/dist/components/query-builder/combinator-selector.js +8 -0
- package/dist/components/query-builder/combinator-selector.js.map +1 -1
- package/dist/components/query-builder/constants.d.ts +1 -0
- package/dist/components/query-builder/constants.js +1 -0
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +11 -2
- package/dist/components/query-builder/index.js +9 -0
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule-group.d.ts +52 -4
- package/dist/components/query-builder/rule-group.js +47 -0
- package/dist/components/query-builder/rule-group.js.map +1 -1
- package/dist/components/query-builder/rule.d.ts +20 -2
- package/dist/components/query-builder/rule.js +18 -0
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +9 -0
- package/dist/components/query-builder/utils.d.ts +15 -0
- package/dist/components/query-builder/utils.js +15 -0
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.d.ts +23 -2
- package/dist/components/query-builder/value-editor.js +20 -0
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.d.ts +23 -2
- package/dist/components/query-builder/value-selector.js +20 -0
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/context.d.ts +2 -2
- package/dist/components/radio/group.d.ts +19 -2
- package/dist/components/radio/group.js +16 -0
- package/dist/components/radio/group.js.map +1 -1
- package/dist/components/radio/index.d.ts +13 -26
- package/dist/components/radio/index.js +11 -24
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/types.d.ts +16 -0
- package/dist/components/search-field/context.d.ts +7 -4
- package/dist/components/search-field/context.js +3 -0
- package/dist/components/search-field/context.js.map +1 -1
- package/dist/components/search-field/index.d.ts +15 -24
- package/dist/components/search-field/index.js +16 -23
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/types.d.ts +13 -0
- package/dist/components/select-field/context.d.ts +11 -4
- package/dist/components/select-field/context.js +7 -0
- package/dist/components/select-field/context.js.map +1 -1
- package/dist/components/select-field/index.d.ts +19 -39
- package/dist/components/select-field/index.js +28 -42
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.module.css +12 -0
- package/dist/components/select-field/types.d.ts +19 -0
- package/dist/components/sidenav/avatar.d.ts +19 -2
- package/dist/components/sidenav/avatar.js +16 -0
- package/dist/components/sidenav/avatar.js.map +1 -1
- package/dist/components/sidenav/content.d.ts +23 -2
- package/dist/components/sidenav/content.js +20 -0
- package/dist/components/sidenav/content.js.map +1 -1
- package/dist/components/sidenav/context.d.ts +3 -2
- package/dist/components/sidenav/context.js +1 -0
- package/dist/components/sidenav/context.js.map +1 -1
- package/dist/components/sidenav/events.d.ts +2 -0
- package/dist/components/sidenav/events.js +2 -0
- package/dist/components/sidenav/events.js.map +1 -1
- package/dist/components/sidenav/footer.d.ts +16 -2
- package/dist/components/sidenav/footer.js +13 -0
- package/dist/components/sidenav/footer.js.map +1 -1
- package/dist/components/sidenav/header.d.ts +20 -2
- package/dist/components/sidenav/header.js +18 -1
- package/dist/components/sidenav/header.js.map +1 -1
- package/dist/components/sidenav/index.d.ts +11 -2
- package/dist/components/sidenav/index.js +9 -0
- package/dist/components/sidenav/index.js.map +1 -1
- package/dist/components/sidenav/item.d.ts +17 -2
- package/dist/components/sidenav/item.js +14 -0
- package/dist/components/sidenav/item.js.map +1 -1
- package/dist/components/sidenav/link.d.ts +17 -2
- package/dist/components/sidenav/link.js +15 -1
- package/dist/components/sidenav/link.js.map +1 -1
- package/dist/components/sidenav/menu-item.d.ts +16 -2
- package/dist/components/sidenav/menu-item.js +13 -0
- package/dist/components/sidenav/menu-item.js.map +1 -1
- package/dist/components/sidenav/menu.d.ts +19 -2
- package/dist/components/sidenav/menu.js +17 -1
- package/dist/components/sidenav/menu.js.map +1 -1
- package/dist/components/sidenav/trigger.d.ts +17 -2
- package/dist/components/sidenav/trigger.js +14 -0
- package/dist/components/sidenav/trigger.js.map +1 -1
- package/dist/components/sidenav/types.d.ts +53 -0
- package/dist/components/skeleton/index.d.ts +12 -27
- package/dist/components/skeleton/index.js +10 -24
- package/dist/components/skeleton/index.js.map +1 -1
- package/dist/components/skeleton/types.d.ts +4 -0
- package/dist/components/slider/index.d.ts +30 -29
- package/dist/components/slider/index.js +28 -27
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/types.d.ts +18 -0
- package/dist/components/switch/context.d.ts +16 -10
- package/dist/components/switch/context.js +13 -7
- package/dist/components/switch/context.js.map +1 -1
- package/dist/components/switch/index.d.ts +14 -31
- package/dist/components/switch/index.js +12 -29
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/types.d.ts +5 -0
- package/dist/components/table/body.d.ts +21 -2
- package/dist/components/table/body.js +18 -0
- package/dist/components/table/body.js.map +1 -1
- package/dist/components/table/cell.d.ts +22 -2
- package/dist/components/table/cell.js +19 -0
- package/dist/components/table/cell.js.map +1 -1
- package/dist/components/table/constants/table.d.ts +6 -0
- package/dist/components/table/constants/table.js +4 -0
- package/dist/components/table/constants/table.js.map +1 -1
- package/dist/components/table/context.d.ts +1 -0
- package/dist/components/table/context.js +1 -0
- package/dist/components/table/context.js.map +1 -1
- package/dist/components/table/header-cell.d.ts +24 -2
- package/dist/components/table/header-cell.js +24 -1
- package/dist/components/table/header-cell.js.map +1 -1
- package/dist/components/table/header.d.ts +22 -2
- package/dist/components/table/header.js +19 -0
- package/dist/components/table/header.js.map +1 -1
- package/dist/components/table/index.d.ts +28 -6
- package/dist/components/table/index.js +27 -5
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/row.d.ts +26 -2
- package/dist/components/table/row.js +23 -0
- package/dist/components/table/row.js.map +1 -1
- package/dist/components/table/types.d.ts +3 -0
- package/dist/components/tabs/context.d.ts +20 -10
- package/dist/components/tabs/context.js +17 -7
- package/dist/components/tabs/context.js.map +1 -1
- package/dist/components/tabs/index.d.ts +17 -40
- package/dist/components/tabs/index.js +15 -38
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs/list.d.ts +20 -4
- package/dist/components/tabs/list.js +17 -2
- package/dist/components/tabs/list.js.map +1 -1
- package/dist/components/tabs/panel.d.ts +21 -4
- package/dist/components/tabs/panel.js +18 -2
- package/dist/components/tabs/panel.js.map +1 -1
- package/dist/components/tabs/tab.d.ts +17 -4
- package/dist/components/tabs/tab.js +14 -2
- package/dist/components/tabs/tab.js.map +1 -1
- package/dist/components/tabs/types.d.ts +3 -0
- package/dist/components/text-area-field/context.d.ts +20 -10
- package/dist/components/text-area-field/context.js +17 -7
- package/dist/components/text-area-field/context.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +20 -15
- package/dist/components/text-area-field/index.js +18 -13
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.module.css +5 -1
- package/dist/components/text-area-field/types.d.ts +9 -0
- package/dist/components/text-field/context.d.ts +24 -4
- package/dist/components/text-field/context.js +20 -0
- package/dist/components/text-field/context.js.map +1 -1
- package/dist/components/text-field/index.d.ts +17 -82
- package/dist/components/text-field/index.js +15 -80
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/types.d.ts +9 -0
- package/dist/components/time-field/index.d.ts +24 -5
- package/dist/components/time-field/index.js +25 -6
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/time-field/styles.module.css +5 -2
- package/dist/components/time-field/types.d.ts +9 -0
- package/dist/components/tooltip/context.d.ts +3 -2
- package/dist/components/tooltip/context.js +1 -0
- package/dist/components/tooltip/context.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +15 -30
- package/dist/components/tooltip/index.js +13 -28
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/trigger.d.ts +22 -2
- package/dist/components/tooltip/trigger.js +19 -0
- package/dist/components/tooltip/trigger.js.map +1 -1
- package/dist/components/tooltip/types.d.ts +7 -0
- package/dist/components/tree/context.d.ts +5 -9
- package/dist/components/tree/context.js +2 -6
- package/dist/components/tree/context.js.map +1 -1
- package/dist/components/tree/index.d.ts +30 -8
- package/dist/components/tree/index.js +28 -6
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/item-actions.d.ts +19 -4
- package/dist/components/tree/item-actions.js +16 -2
- package/dist/components/tree/item-actions.js.map +1 -1
- package/dist/components/tree/item-content.d.ts +18 -4
- package/dist/components/tree/item-content.js +20 -3
- package/dist/components/tree/item-content.js.map +1 -1
- package/dist/components/tree/item-description.d.ts +15 -4
- package/dist/components/tree/item-description.js +13 -2
- package/dist/components/tree/item-description.js.map +1 -1
- package/dist/components/tree/item-label.d.ts +15 -4
- package/dist/components/tree/item-label.js +13 -2
- package/dist/components/tree/item-label.js.map +1 -1
- package/dist/components/tree/item-prefix-icon.d.ts +15 -4
- package/dist/components/tree/item-prefix-icon.js +13 -2
- package/dist/components/tree/item-prefix-icon.js.map +1 -1
- package/dist/components/tree/item.d.ts +24 -4
- package/dist/components/tree/item.js +21 -2
- package/dist/components/tree/item.js.map +1 -1
- package/dist/components/tree/lines.d.ts +10 -2
- package/dist/components/tree/lines.js +8 -0
- package/dist/components/tree/lines.js.map +1 -1
- package/dist/components/tree/types.d.ts +26 -0
- package/dist/components/view-stack/context.d.ts +20 -9
- package/dist/components/view-stack/context.js +18 -7
- package/dist/components/view-stack/context.js.map +1 -1
- package/dist/components/view-stack/events.d.ts +2 -0
- package/dist/components/view-stack/events.js +2 -0
- package/dist/components/view-stack/events.js.map +1 -1
- package/dist/components/view-stack/index.d.ts +16 -24
- package/dist/components/view-stack/index.js +14 -22
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/components/view-stack/trigger.d.ts +26 -4
- package/dist/components/view-stack/trigger.js +23 -2
- package/dist/components/view-stack/trigger.js.map +1 -1
- package/dist/components/view-stack/types.d.ts +29 -0
- package/dist/components/view-stack/view.d.ts +22 -2
- package/dist/components/view-stack/view.js +19 -0
- package/dist/components/view-stack/view.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-copy.d.ts +44 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js +35 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-field-state.d.ts +69 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js +50 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-field.d.ts +61 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js +47 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-focus.d.ts +51 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js +39 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-paste.d.ts +63 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js +51 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js.map +1 -1
- package/dist/hooks/coordinate-field/use-timeout-cleanup.d.ts +32 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js +30 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js.map +1 -1
- package/dist/hooks/use-frame-delay/index.d.ts +43 -0
- package/dist/hooks/use-frame-delay/index.js +66 -0
- package/dist/hooks/use-frame-delay/index.js.map +1 -0
- package/dist/hooks/use-tree/actions/index.d.ts +4 -2
- package/dist/hooks/use-tree/actions/index.js +4 -2
- package/dist/hooks/use-tree/actions/index.js.map +1 -1
- package/dist/hooks/use-tree/state/index.d.ts +7 -0
- package/dist/hooks/use-tree/state/index.js +7 -0
- package/dist/hooks/use-tree/state/index.js.map +1 -1
- package/dist/hooks/use-tree/types.d.ts +22 -0
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -2
- package/dist/lib/types.d.ts +17 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.js +15 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/providers/portal.d.ts +11 -2
- package/dist/providers/portal.js +9 -0
- package/dist/providers/portal.js.map +1 -1
- package/dist/providers/theme-provider.d.ts +18 -2
- package/dist/providers/theme-provider.js +15 -0
- package/dist/providers/theme-provider.js.map +1 -1
- package/package.json +15 -12
|
@@ -15,6 +15,57 @@ import { deduplicateMatchesByLocation, isCompleteCoordinate, parseCoordinatePast
|
|
|
15
15
|
import { useState } from "react";
|
|
16
16
|
|
|
17
17
|
//#region src/hooks/coordinate-field/use-coordinate-paste.ts
|
|
18
|
+
/**
|
|
19
|
+
* Handles paste events with coordinate parsing and disambiguation when multiple formats match
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* function CoordinateFieldWithPaste() {
|
|
24
|
+
* const [value, setValue] = useState<CoordinateValue | null>(null);
|
|
25
|
+
*
|
|
26
|
+
* const {
|
|
27
|
+
* disambiguationMatches,
|
|
28
|
+
* showDisambiguationModal,
|
|
29
|
+
* selectedDisambiguationFormat,
|
|
30
|
+
* handleInputPaste,
|
|
31
|
+
* handleDisambiguationSelect,
|
|
32
|
+
* setShowDisambiguationModal,
|
|
33
|
+
* setSelectedDisambiguationFormat,
|
|
34
|
+
* } = useCoordinatePaste({
|
|
35
|
+
* onValueApplied: setValue,
|
|
36
|
+
* onError: (msg) => console.error(msg),
|
|
37
|
+
* });
|
|
38
|
+
*
|
|
39
|
+
* return (
|
|
40
|
+
* <>
|
|
41
|
+
* <div onPaste={handleInputPaste}>
|
|
42
|
+
* // ...Coordinate input segments
|
|
43
|
+
* </div>
|
|
44
|
+
* {showDisambiguationModal && (
|
|
45
|
+
* <Dialog onClose={() => setShowDisambiguationModal(false)}>
|
|
46
|
+
* {disambiguationMatches.map((match) => (
|
|
47
|
+
* <Radio
|
|
48
|
+
* key={match.format}
|
|
49
|
+
* value={match.format}
|
|
50
|
+
* isSelected={selectedDisambiguationFormat === match.format}
|
|
51
|
+
* onChange={() => setSelectedDisambiguationFormat(match.format)}
|
|
52
|
+
* >
|
|
53
|
+
* {match.format}: {match.matched}
|
|
54
|
+
* </Radio>
|
|
55
|
+
* ))}
|
|
56
|
+
* <Button onPress={handleDisambiguationSelect}>Confirm</Button>
|
|
57
|
+
* </Dialog>
|
|
58
|
+
* )}
|
|
59
|
+
* </>
|
|
60
|
+
* );
|
|
61
|
+
* }
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @param options - {@link UseCoordinatePasteOptions}
|
|
65
|
+
* @param options.onValueApplied - Callback when a coordinate value is successfully parsed and applied.
|
|
66
|
+
* @param options.onError - Optional error callback for invalid paste attempts.
|
|
67
|
+
* @returns {@link UseCoordinatePasteResult} Paste handling utilities and disambiguation state.
|
|
68
|
+
*/
|
|
18
69
|
function useCoordinatePaste({ onValueApplied, onError }) {
|
|
19
70
|
const [disambiguationMatches, setDisambiguationMatches] = useState([]);
|
|
20
71
|
const [showDisambiguationModal, setShowDisambiguationModal] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-coordinate-paste.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-paste.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n deduplicateMatchesByLocation,\n isCompleteCoordinate,\n parseCoordinatePaste,\n} from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n ParsedCoordinateMatch,\n} from '../../components/coordinate-field/types';\n\nexport interface UseCoordinatePasteOptions {\n onValueApplied: (value: CoordinateValue) => void;\n onError?: (message: string, context?: Record<string, unknown>) => void;\n}\n\nexport interface UseCoordinatePasteResult {\n disambiguationMatches: ParsedCoordinateMatch[];\n showDisambiguationModal: boolean;\n selectedDisambiguationFormat: CoordinateSystem | null;\n handleInputPaste: (e: React.ClipboardEvent<HTMLDivElement>) => void;\n handleDisambiguationSelect: () => void;\n setShowDisambiguationModal: (show: boolean) => void;\n setSelectedDisambiguationFormat: (format: CoordinateSystem | null) => void;\n cleanupDisambiguationModal: () => void;\n}\n\nexport function useCoordinatePaste({\n onValueApplied,\n onError,\n}: UseCoordinatePasteOptions): UseCoordinatePasteResult {\n const [disambiguationMatches, setDisambiguationMatches] = useState<\n ParsedCoordinateMatch[]\n >([]);\n const [showDisambiguationModal, setShowDisambiguationModal] = useState(false);\n const [selectedDisambiguationFormat, setSelectedDisambiguationFormat] =\n useState<CoordinateSystem | null>(null);\n\n /**\n * Handles paste failure when no coordinate formats match\n * Calls onError with \"Invalid coordinate format\" message\n */\n const handlePasteNoMatches = (pastedText: string) => {\n const errorMsg = 'Invalid coordinate format';\n onError?.(errorMsg, { pastedText });\n };\n\n const handlePasteSingleMatch = (match: ParsedCoordinateMatch | undefined) => {\n if (match) {\n onValueApplied(match.value);\n }\n };\n\n const handlePasteMultipleMatches = (matches: ParsedCoordinateMatch[]) => {\n setDisambiguationMatches(matches);\n const firstMatch = matches[0];\n if (firstMatch) {\n setSelectedDisambiguationFormat(firstMatch.format);\n }\n setShowDisambiguationModal(true);\n };\n\n const handleCoordinatePaste = (pastedText: string) => {\n const allMatches = parseCoordinatePaste(pastedText);\n\n if (allMatches.length === 0) {\n handlePasteNoMatches(pastedText);\n return;\n }\n\n // Deduplicate matches by location - only show modal for different locations\n const matches = deduplicateMatchesByLocation(allMatches);\n\n if (matches.length === 1) {\n handlePasteSingleMatch(matches[0]);\n } else {\n handlePasteMultipleMatches(matches);\n }\n };\n\n const handleInputPaste = (e: React.ClipboardEvent<HTMLDivElement>) => {\n const pastedText = e.clipboardData?.getData('text/plain');\n if (pastedText && isCompleteCoordinate(pastedText)) {\n e.preventDefault();\n handleCoordinatePaste(pastedText);\n }\n };\n\n const cleanupDisambiguationModal = () => {\n setShowDisambiguationModal(false);\n setDisambiguationMatches([]);\n setSelectedDisambiguationFormat(null);\n };\n\n const handleDisambiguationSelect = () => {\n if (selectedDisambiguationFormat) {\n const match = disambiguationMatches.find(\n (m) => m.format === selectedDisambiguationFormat,\n );\n if (match) {\n onValueApplied(match.value);\n }\n }\n cleanupDisambiguationModal();\n };\n\n return {\n disambiguationMatches,\n showDisambiguationModal,\n selectedDisambiguationFormat,\n handleInputPaste,\n handleDisambiguationSelect,\n setShowDisambiguationModal,\n setSelectedDisambiguationFormat,\n cleanupDisambiguationModal,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-coordinate-paste.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-coordinate-paste.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useState } from 'react';\nimport {\n deduplicateMatchesByLocation,\n isCompleteCoordinate,\n parseCoordinatePaste,\n} from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n ParsedCoordinateMatch,\n} from '../../components/coordinate-field/types';\n\n/** Options for the useCoordinatePaste hook */\nexport interface UseCoordinatePasteOptions {\n /** Callback when a coordinate value is successfully parsed and applied */\n onValueApplied: (value: CoordinateValue) => void;\n /** Optional error callback for invalid paste attempts */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n}\n\n/** Return value from the useCoordinatePaste hook */\nexport interface UseCoordinatePasteResult {\n /** Array of parsed coordinate matches for disambiguation */\n disambiguationMatches: ParsedCoordinateMatch[];\n /** Whether the disambiguation modal is visible */\n showDisambiguationModal: boolean;\n /** Currently selected format in disambiguation modal */\n selectedDisambiguationFormat: CoordinateSystem | null;\n /** Paste event handler for coordinate input */\n handleInputPaste: (e: React.ClipboardEvent<HTMLDivElement>) => void;\n /** Confirm selection in disambiguation modal */\n handleDisambiguationSelect: () => void;\n /** Control disambiguation modal visibility */\n setShowDisambiguationModal: (show: boolean) => void;\n /** Set the selected format in disambiguation modal */\n setSelectedDisambiguationFormat: (format: CoordinateSystem | null) => void;\n /** Reset disambiguation modal state */\n cleanupDisambiguationModal: () => void;\n}\n\n/**\n * Handles paste events with coordinate parsing and disambiguation when multiple formats match\n *\n * @example\n * ```tsx\n * function CoordinateFieldWithPaste() {\n * const [value, setValue] = useState<CoordinateValue | null>(null);\n *\n * const {\n * disambiguationMatches,\n * showDisambiguationModal,\n * selectedDisambiguationFormat,\n * handleInputPaste,\n * handleDisambiguationSelect,\n * setShowDisambiguationModal,\n * setSelectedDisambiguationFormat,\n * } = useCoordinatePaste({\n * onValueApplied: setValue,\n * onError: (msg) => console.error(msg),\n * });\n *\n * return (\n * <>\n * <div onPaste={handleInputPaste}>\n * // ...Coordinate input segments\n * </div>\n * {showDisambiguationModal && (\n * <Dialog onClose={() => setShowDisambiguationModal(false)}>\n * {disambiguationMatches.map((match) => (\n * <Radio\n * key={match.format}\n * value={match.format}\n * isSelected={selectedDisambiguationFormat === match.format}\n * onChange={() => setSelectedDisambiguationFormat(match.format)}\n * >\n * {match.format}: {match.matched}\n * </Radio>\n * ))}\n * <Button onPress={handleDisambiguationSelect}>Confirm</Button>\n * </Dialog>\n * )}\n * </>\n * );\n * }\n * ```\n *\n * @param options - {@link UseCoordinatePasteOptions}\n * @param options.onValueApplied - Callback when a coordinate value is successfully parsed and applied.\n * @param options.onError - Optional error callback for invalid paste attempts.\n * @returns {@link UseCoordinatePasteResult} Paste handling utilities and disambiguation state.\n */\nexport function useCoordinatePaste({\n onValueApplied,\n onError,\n}: UseCoordinatePasteOptions): UseCoordinatePasteResult {\n const [disambiguationMatches, setDisambiguationMatches] = useState<\n ParsedCoordinateMatch[]\n >([]);\n const [showDisambiguationModal, setShowDisambiguationModal] = useState(false);\n const [selectedDisambiguationFormat, setSelectedDisambiguationFormat] =\n useState<CoordinateSystem | null>(null);\n\n /**\n * Handles paste failure when no coordinate formats match\n * Calls onError with \"Invalid coordinate format\" message\n */\n const handlePasteNoMatches = (pastedText: string) => {\n const errorMsg = 'Invalid coordinate format';\n onError?.(errorMsg, { pastedText });\n };\n\n const handlePasteSingleMatch = (match: ParsedCoordinateMatch | undefined) => {\n if (match) {\n onValueApplied(match.value);\n }\n };\n\n const handlePasteMultipleMatches = (matches: ParsedCoordinateMatch[]) => {\n setDisambiguationMatches(matches);\n const firstMatch = matches[0];\n if (firstMatch) {\n setSelectedDisambiguationFormat(firstMatch.format);\n }\n setShowDisambiguationModal(true);\n };\n\n const handleCoordinatePaste = (pastedText: string) => {\n const allMatches = parseCoordinatePaste(pastedText);\n\n if (allMatches.length === 0) {\n handlePasteNoMatches(pastedText);\n return;\n }\n\n // Deduplicate matches by location - only show modal for different locations\n const matches = deduplicateMatchesByLocation(allMatches);\n\n if (matches.length === 1) {\n handlePasteSingleMatch(matches[0]);\n } else {\n handlePasteMultipleMatches(matches);\n }\n };\n\n const handleInputPaste = (e: React.ClipboardEvent<HTMLDivElement>) => {\n const pastedText = e.clipboardData?.getData('text/plain');\n if (pastedText && isCompleteCoordinate(pastedText)) {\n e.preventDefault();\n handleCoordinatePaste(pastedText);\n }\n };\n\n const cleanupDisambiguationModal = () => {\n setShowDisambiguationModal(false);\n setDisambiguationMatches([]);\n setSelectedDisambiguationFormat(null);\n };\n\n const handleDisambiguationSelect = () => {\n if (selectedDisambiguationFormat) {\n const match = disambiguationMatches.find(\n (m) => m.format === selectedDisambiguationFormat,\n );\n if (match) {\n onValueApplied(match.value);\n }\n }\n cleanupDisambiguationModal();\n };\n\n return {\n disambiguationMatches,\n showDisambiguationModal,\n selectedDisambiguationFormat,\n handleInputPaste,\n handleDisambiguationSelect,\n setShowDisambiguationModal,\n setSelectedDisambiguationFormat,\n cleanupDisambiguationModal,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,SAAgB,mBAAmB,EACjC,gBACA,WACsD;CACtD,MAAM,CAAC,uBAAuB,4BAA4B,SAExD,EAAE,CAAC;CACL,MAAM,CAAC,yBAAyB,8BAA8B,SAAS,MAAM;CAC7E,MAAM,CAAC,8BAA8B,mCACnC,SAAkC,KAAK;;;;;CAMzC,MAAM,wBAAwB,eAAuB;AAEnD,YADiB,6BACG,EAAE,YAAY,CAAC;;CAGrC,MAAM,0BAA0B,UAA6C;AAC3E,MAAI,MACF,gBAAe,MAAM,MAAM;;CAI/B,MAAM,8BAA8B,YAAqC;AACvE,2BAAyB,QAAQ;EACjC,MAAM,aAAa,QAAQ;AAC3B,MAAI,WACF,iCAAgC,WAAW,OAAO;AAEpD,6BAA2B,KAAK;;CAGlC,MAAM,yBAAyB,eAAuB;EACpD,MAAM,aAAa,qBAAqB,WAAW;AAEnD,MAAI,WAAW,WAAW,GAAG;AAC3B,wBAAqB,WAAW;AAChC;;EAIF,MAAM,UAAU,6BAA6B,WAAW;AAExD,MAAI,QAAQ,WAAW,EACrB,wBAAuB,QAAQ,GAAG;MAElC,4BAA2B,QAAQ;;CAIvC,MAAM,oBAAoB,MAA4C;EACpE,MAAM,aAAa,EAAE,eAAe,QAAQ,aAAa;AACzD,MAAI,cAAc,qBAAqB,WAAW,EAAE;AAClD,KAAE,gBAAgB;AAClB,yBAAsB,WAAW;;;CAIrC,MAAM,mCAAmC;AACvC,6BAA2B,MAAM;AACjC,2BAAyB,EAAE,CAAC;AAC5B,kCAAgC,KAAK;;CAGvC,MAAM,mCAAmC;AACvC,MAAI,8BAA8B;GAChC,MAAM,QAAQ,sBAAsB,MACjC,MAAM,EAAE,WAAW,6BACrB;AACD,OAAI,MACF,gBAAe,MAAM,MAAM;;AAG/B,8BAA4B;;AAG9B,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
//#region src/hooks/coordinate-field/use-timeout-cleanup.d.ts
|
|
2
|
+
/** Return value from the useTimeoutCleanup hook */
|
|
2
3
|
interface UseTimeoutCleanupResult {
|
|
4
|
+
/** Register a timeout for automatic cleanup on unmount */
|
|
3
5
|
registerTimeout: (timeoutId: NodeJS.Timeout) => void;
|
|
4
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Registers timeouts for automatic cleanup on component unmount
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* function ComponentWithTimeouts() {
|
|
13
|
+
* const { registerTimeout } = useTimeoutCleanup();
|
|
14
|
+
* const [message, setMessage] = useState('');
|
|
15
|
+
*
|
|
16
|
+
* const handleClick = () => {
|
|
17
|
+
* setMessage('Saving...');
|
|
18
|
+
*
|
|
19
|
+
* registerTimeout(
|
|
20
|
+
* setTimeout(() => {
|
|
21
|
+
* setMessage('Saved!');
|
|
22
|
+
* }, 1000)
|
|
23
|
+
* );
|
|
24
|
+
* };
|
|
25
|
+
*
|
|
26
|
+
* return (
|
|
27
|
+
* <div>
|
|
28
|
+
* <Button onPress={handleClick}>Save</Button>
|
|
29
|
+
* <span>{message}</span>
|
|
30
|
+
* </div>
|
|
31
|
+
* );
|
|
32
|
+
* }
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @returns {@link UseTimeoutCleanupResult} Timeout registration function.
|
|
36
|
+
*/
|
|
5
37
|
declare function useTimeoutCleanup(): UseTimeoutCleanupResult;
|
|
6
38
|
//#endregion
|
|
7
39
|
export { UseTimeoutCleanupResult, useTimeoutCleanup };
|
|
@@ -14,6 +14,36 @@
|
|
|
14
14
|
import { useEffect, useRef } from "react";
|
|
15
15
|
|
|
16
16
|
//#region src/hooks/coordinate-field/use-timeout-cleanup.ts
|
|
17
|
+
/**
|
|
18
|
+
* Registers timeouts for automatic cleanup on component unmount
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* function ComponentWithTimeouts() {
|
|
23
|
+
* const { registerTimeout } = useTimeoutCleanup();
|
|
24
|
+
* const [message, setMessage] = useState('');
|
|
25
|
+
*
|
|
26
|
+
* const handleClick = () => {
|
|
27
|
+
* setMessage('Saving...');
|
|
28
|
+
*
|
|
29
|
+
* registerTimeout(
|
|
30
|
+
* setTimeout(() => {
|
|
31
|
+
* setMessage('Saved!');
|
|
32
|
+
* }, 1000)
|
|
33
|
+
* );
|
|
34
|
+
* };
|
|
35
|
+
*
|
|
36
|
+
* return (
|
|
37
|
+
* <div>
|
|
38
|
+
* <Button onPress={handleClick}>Save</Button>
|
|
39
|
+
* <span>{message}</span>
|
|
40
|
+
* </div>
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @returns {@link UseTimeoutCleanupResult} Timeout registration function.
|
|
46
|
+
*/
|
|
17
47
|
function useTimeoutCleanup() {
|
|
18
48
|
const timeoutIdsRef = useRef(/* @__PURE__ */ new Set());
|
|
19
49
|
const registerTimeout = (timeoutId) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-timeout-cleanup.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-timeout-cleanup.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useRef } from 'react';\n\nexport interface UseTimeoutCleanupResult {\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n}\n\nexport function useTimeoutCleanup(): UseTimeoutCleanupResult {\n const timeoutIdsRef = useRef<Set<NodeJS.Timeout>>(new Set());\n\n const registerTimeout = (timeoutId: NodeJS.Timeout) => {\n timeoutIdsRef.current.add(timeoutId);\n };\n\n useEffect(() => {\n return () => {\n timeoutIdsRef.current.forEach(clearTimeout);\n timeoutIdsRef.current.clear();\n };\n }, []);\n\n return { registerTimeout };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-timeout-cleanup.js","names":[],"sources":["../../../src/hooks/coordinate-field/use-timeout-cleanup.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useRef } from 'react';\n\n/** Return value from the useTimeoutCleanup hook */\nexport interface UseTimeoutCleanupResult {\n /** Register a timeout for automatic cleanup on unmount */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n}\n\n/**\n * Registers timeouts for automatic cleanup on component unmount\n *\n * @example\n * ```tsx\n * function ComponentWithTimeouts() {\n * const { registerTimeout } = useTimeoutCleanup();\n * const [message, setMessage] = useState('');\n *\n * const handleClick = () => {\n * setMessage('Saving...');\n *\n * registerTimeout(\n * setTimeout(() => {\n * setMessage('Saved!');\n * }, 1000)\n * );\n * };\n *\n * return (\n * <div>\n * <Button onPress={handleClick}>Save</Button>\n * <span>{message}</span>\n * </div>\n * );\n * }\n * ```\n *\n * @returns {@link UseTimeoutCleanupResult} Timeout registration function.\n */\nexport function useTimeoutCleanup(): UseTimeoutCleanupResult {\n const timeoutIdsRef = useRef<Set<NodeJS.Timeout>>(new Set());\n\n const registerTimeout = (timeoutId: NodeJS.Timeout) => {\n timeoutIdsRef.current.add(timeoutId);\n };\n\n useEffect(() => {\n return () => {\n timeoutIdsRef.current.forEach(clearTimeout);\n timeoutIdsRef.current.clear();\n };\n }, []);\n\n return { registerTimeout };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAgB,oBAA6C;CAC3D,MAAM,gBAAgB,uBAA4B,IAAI,KAAK,CAAC;CAE5D,MAAM,mBAAmB,cAA8B;AACrD,gBAAc,QAAQ,IAAI,UAAU;;AAGtC,iBAAgB;AACd,eAAa;AACX,iBAAc,QAAQ,QAAQ,aAAa;AAC3C,iBAAc,QAAQ,OAAO;;IAE9B,EAAE,CAAC;AAEN,QAAO,EAAE,iBAAiB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/hooks/use-frame-delay/index.d.ts
|
|
2
|
+
interface UseFrameDelayOptions {
|
|
3
|
+
/** Number of animation frames to wait (default: 2) */
|
|
4
|
+
frames?: number;
|
|
5
|
+
/** Callback fired when delay completes */
|
|
6
|
+
onReady?: () => void;
|
|
7
|
+
}
|
|
8
|
+
interface UseFrameDelayResult {
|
|
9
|
+
/** Whether the delay has completed */
|
|
10
|
+
isReady: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Delays execution by a specified number of animation frames.
|
|
14
|
+
*
|
|
15
|
+
* Useful for deferring expensive renders to allow the browser to paint
|
|
16
|
+
* a loading state first.
|
|
17
|
+
*
|
|
18
|
+
* @param options - {@link UseFrameDelayOptions}
|
|
19
|
+
* @param options.frames - Number of animation frames to wait (default: 2).
|
|
20
|
+
* @param options.onReady - Callback fired when delay completes.
|
|
21
|
+
* @returns {@link UseFrameDelayResult} Object with isReady boolean.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* // Pattern 1: Reactive
|
|
26
|
+
* function DeferredContent() {
|
|
27
|
+
* const { isReady } = useFrameDelay();
|
|
28
|
+
* if (!isReady) return <Fallback />;
|
|
29
|
+
* return <ExpensiveContent />;
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* // Pattern 2: Callback
|
|
33
|
+
* function WithCallback() {
|
|
34
|
+
* const [loaded, setLoaded] = useState(false);
|
|
35
|
+
* useFrameDelay({ onReady: () => setLoaded(true) });
|
|
36
|
+
* return loaded ? <Content /> : <Loading />;
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
declare function useFrameDelay(options?: UseFrameDelayOptions): UseFrameDelayResult;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { UseFrameDelayOptions, UseFrameDelayResult, useFrameDelay };
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { useEffect, useState } from "react";
|
|
15
|
+
|
|
16
|
+
//#region src/hooks/use-frame-delay/index.ts
|
|
17
|
+
/**
|
|
18
|
+
* Delays execution by a specified number of animation frames.
|
|
19
|
+
*
|
|
20
|
+
* Useful for deferring expensive renders to allow the browser to paint
|
|
21
|
+
* a loading state first.
|
|
22
|
+
*
|
|
23
|
+
* @param options - {@link UseFrameDelayOptions}
|
|
24
|
+
* @param options.frames - Number of animation frames to wait (default: 2).
|
|
25
|
+
* @param options.onReady - Callback fired when delay completes.
|
|
26
|
+
* @returns {@link UseFrameDelayResult} Object with isReady boolean.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // Pattern 1: Reactive
|
|
31
|
+
* function DeferredContent() {
|
|
32
|
+
* const { isReady } = useFrameDelay();
|
|
33
|
+
* if (!isReady) return <Fallback />;
|
|
34
|
+
* return <ExpensiveContent />;
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* // Pattern 2: Callback
|
|
38
|
+
* function WithCallback() {
|
|
39
|
+
* const [loaded, setLoaded] = useState(false);
|
|
40
|
+
* useFrameDelay({ onReady: () => setLoaded(true) });
|
|
41
|
+
* return loaded ? <Content /> : <Loading />;
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
function useFrameDelay(options = {}) {
|
|
46
|
+
const { frames = 2, onReady } = options;
|
|
47
|
+
const [isReady, setIsReady] = useState(false);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
let frameCount = 0;
|
|
50
|
+
let animationId;
|
|
51
|
+
const tick = () => {
|
|
52
|
+
frameCount++;
|
|
53
|
+
if (frameCount >= frames) {
|
|
54
|
+
setIsReady(true);
|
|
55
|
+
onReady?.();
|
|
56
|
+
} else animationId = requestAnimationFrame(tick);
|
|
57
|
+
};
|
|
58
|
+
animationId = requestAnimationFrame(tick);
|
|
59
|
+
return () => cancelAnimationFrame(animationId);
|
|
60
|
+
}, [frames, onReady]);
|
|
61
|
+
return { isReady };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { useFrameDelay };
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["animationId: number"],"sources":["../../../src/hooks/use-frame-delay/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useEffect, useState } from 'react';\n\nexport interface UseFrameDelayOptions {\n /** Number of animation frames to wait (default: 2) */\n frames?: number;\n /** Callback fired when delay completes */\n onReady?: () => void;\n}\n\nexport interface UseFrameDelayResult {\n /** Whether the delay has completed */\n isReady: boolean;\n}\n\n/**\n * Delays execution by a specified number of animation frames.\n *\n * Useful for deferring expensive renders to allow the browser to paint\n * a loading state first.\n *\n * @param options - {@link UseFrameDelayOptions}\n * @param options.frames - Number of animation frames to wait (default: 2).\n * @param options.onReady - Callback fired when delay completes.\n * @returns {@link UseFrameDelayResult} Object with isReady boolean.\n *\n * @example\n * ```tsx\n * // Pattern 1: Reactive\n * function DeferredContent() {\n * const { isReady } = useFrameDelay();\n * if (!isReady) return <Fallback />;\n * return <ExpensiveContent />;\n * }\n *\n * // Pattern 2: Callback\n * function WithCallback() {\n * const [loaded, setLoaded] = useState(false);\n * useFrameDelay({ onReady: () => setLoaded(true) });\n * return loaded ? <Content /> : <Loading />;\n * }\n * ```\n */\nexport function useFrameDelay(\n options: UseFrameDelayOptions = {},\n): UseFrameDelayResult {\n const { frames = 2, onReady } = options;\n const [isReady, setIsReady] = useState(false);\n\n useEffect(() => {\n let frameCount = 0;\n let animationId: number;\n\n const tick = () => {\n frameCount++;\n if (frameCount >= frames) {\n setIsReady(true);\n onReady?.();\n } else {\n animationId = requestAnimationFrame(tick);\n }\n };\n\n animationId = requestAnimationFrame(tick);\n return () => cancelAnimationFrame(animationId);\n }, [frames, onReady]);\n\n return { isReady };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,cACd,UAAgC,EAAE,EACb;CACrB,MAAM,EAAE,SAAS,GAAG,YAAY;CAChC,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;AAE7C,iBAAgB;EACd,IAAI,aAAa;EACjB,IAAIA;EAEJ,MAAM,aAAa;AACjB;AACA,OAAI,cAAc,QAAQ;AACxB,eAAW,KAAK;AAChB,eAAW;SAEX,eAAc,sBAAsB,KAAK;;AAI7C,gBAAc,sBAAsB,KAAK;AACzC,eAAa,qBAAqB,YAAY;IAC7C,CAAC,QAAQ,QAAQ,CAAC;AAErB,QAAO,EAAE,SAAS"}
|
|
@@ -22,7 +22,9 @@ import "client-only";
|
|
|
22
22
|
* Note: each operation returns the whole tree. Future iterations
|
|
23
23
|
* might want to return only the changed portion of the tree.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @param options - {@link UseTreeActionsOptions}
|
|
26
|
+
* @param options.nodes - Current tree nodes to operate on.
|
|
27
|
+
* @returns {@link TreeActions} Object containing all tree manipulation functions.
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* ```tsx
|
|
@@ -42,7 +44,7 @@ import "client-only";
|
|
|
42
44
|
* // Use tree actions
|
|
43
45
|
* const updatedTree = treeActions.insertAfter('child1', [
|
|
44
46
|
* { key: 'newChild', label: 'New Child' }
|
|
45
|
-
* ]);
|
|
47
|
+
* ]);
|
|
46
48
|
* ```
|
|
47
49
|
*/
|
|
48
50
|
declare function useTreeActions<T>({
|
|
@@ -26,7 +26,9 @@ import { useUpdateEffect } from "@react-aria/utils";
|
|
|
26
26
|
* Note: each operation returns the whole tree. Future iterations
|
|
27
27
|
* might want to return only the changed portion of the tree.
|
|
28
28
|
*
|
|
29
|
-
* @
|
|
29
|
+
* @param options - {@link UseTreeActionsOptions}
|
|
30
|
+
* @param options.nodes - Current tree nodes to operate on.
|
|
31
|
+
* @returns {@link TreeActions} Object containing all tree manipulation functions.
|
|
30
32
|
*
|
|
31
33
|
* @example
|
|
32
34
|
* ```tsx
|
|
@@ -46,7 +48,7 @@ import { useUpdateEffect } from "@react-aria/utils";
|
|
|
46
48
|
* // Use tree actions
|
|
47
49
|
* const updatedTree = treeActions.insertAfter('child1', [
|
|
48
50
|
* { key: 'newChild', label: 'New Child' }
|
|
49
|
-
* ]);
|
|
51
|
+
* ]);
|
|
50
52
|
* ```
|
|
51
53
|
*/
|
|
52
54
|
function useTreeActions({ nodes }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["nodes"],"sources":["../../../../src/hooks/use-tree/actions/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useUpdateEffect } from '@react-aria/utils';\nimport { useRef } from 'react';\nimport { Cache } from './cache';\nimport type { Key } from '@react-types/shared';\nimport type {\n TreeActions,\n TreeData,\n TreeNode,\n TreeNodeBase,\n UseTreeActionsOptions,\n} from '../types';\n\n/**\n * Stateless hook that transforms tree data according to actions\n * it takes in nodes and returns a new version of the tree.\n *\n * Note: each operation returns the whole tree. Future iterations\n * might want to return only the changed portion of the tree.\n *\n * @returns {TreeActions
|
|
1
|
+
{"version":3,"file":"index.js","names":["nodes"],"sources":["../../../../src/hooks/use-tree/actions/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useUpdateEffect } from '@react-aria/utils';\nimport { useRef } from 'react';\nimport { Cache } from './cache';\nimport type { Key } from '@react-types/shared';\nimport type {\n TreeActions,\n TreeData,\n TreeNode,\n TreeNodeBase,\n UseTreeActionsOptions,\n} from '../types';\n\n/**\n * Stateless hook that transforms tree data according to actions\n * it takes in nodes and returns a new version of the tree.\n *\n * Note: each operation returns the whole tree. Future iterations\n * might want to return only the changed portion of the tree.\n *\n * @param options - {@link UseTreeActionsOptions}\n * @param options.nodes - Current tree nodes to operate on.\n * @returns {@link TreeActions} Object containing all tree manipulation functions.\n *\n * @example\n * ```tsx\n * const treeActions = useTreeActions({\n * nodes: [\n * {\n * key: 'root',\n * label: 'Root',\n * children: [\n * { key: 'child1', label: 'Child 1' },\n * { key: 'child2', label: 'Child 2' }\n * ]\n * }\n * ]\n * });\n *\n * // Use tree actions\n * const updatedTree = treeActions.insertAfter('child1', [\n * { key: 'newChild', label: 'New Child' }\n * ]);\n * ```\n */\nexport function useTreeActions<T>({\n nodes,\n}: UseTreeActionsOptions<T>): TreeActions<T> {\n const cache = useRef(new Cache<T>(nodes)).current;\n\n useUpdateEffect(() => {\n cache.rebuild(nodes);\n }, [nodes]);\n\n /** GET NODE **/\n function getNode(key: Key) {\n return cache.getNode(key);\n }\n\n /** INSERT NODES **/\n function insertAfter(\n target: Key | null,\n nodes: TreeNode<T>[],\n ): TreeNode<T>[] {\n cache.addNodes(target, nodes, 'after');\n\n return cache.toTree(true);\n }\n\n function insertBefore(\n target: Key | null,\n nodes: TreeNode<T>[],\n ): TreeNode<T>[] {\n cache.addNodes(target, nodes, 'before');\n\n return cache.toTree(true);\n }\n\n function insertInto(target: Key | null, nodes: TreeNode<T>[]): TreeNode<T>[] {\n for (const node of nodes) {\n cache.insertNode(target, node, 0);\n }\n\n return cache.toTree(true);\n }\n\n /** MOVE NODES **/\n function moveAfter(target: Key | null, keys: Set<Key>): TreeNode<T>[] {\n cache.moveNodes(target, keys, 'after');\n\n return cache.toTree();\n }\n\n function moveBefore(target: Key | null, keys: Set<Key>): TreeNode<T>[] {\n cache.moveNodes(target, keys, 'before');\n\n return cache.toTree();\n }\n\n function moveInto(target: Key | null, keys: Set<Key>): TreeNode<T>[] {\n for (const key of keys) {\n cache.moveNode(target, key, 0);\n }\n\n return cache.toTree();\n }\n\n /** UPDATE NODES **/\n function updateNode(\n key: Key,\n callback: (node: TreeNodeBase<T>) => TreeNodeBase<T>,\n ): TreeNode<T>[] {\n const node = cache.getNode(key);\n\n cache.setNode(key, callback(node));\n\n return cache.toTree(true);\n }\n\n /** REMOVE NODES **/\n function remove(keys: Set<Key>): TreeNode<T>[] {\n for (const key of keys.values()) {\n cache.deleteNode(key);\n }\n\n return cache.toTree(true);\n }\n\n /** SELECTION **/\n function onSelectionChange(keys: Set<Key>): TreeNode<T>[] {\n unselectAll();\n\n for (const key of keys) {\n const node = cache.getNode(key);\n\n cache.setNode(node.key, {\n ...node,\n isSelected: true,\n });\n }\n\n return cache.toTree();\n }\n\n function selectAll(): TreeNode<T>[] {\n cache.setAllNodes({ isSelected: true });\n\n return cache.toTree();\n }\n\n function unselectAll(): TreeNode<T>[] {\n cache.setAllNodes({ isSelected: false });\n\n return cache.toTree();\n }\n\n /** EXPANSION **/\n function onExpandedChange(keys: Set<Key>): TreeNode<T>[] {\n collapseAll();\n\n for (const key of keys) {\n const node = cache.getNode(key);\n\n cache.setNode(node.key, {\n ...node,\n isExpanded: true,\n });\n }\n\n return cache.toTree();\n }\n\n function expandAll(): TreeNode<T>[] {\n cache.setAllNodes({ isExpanded: true });\n\n return cache.toTree();\n }\n\n function collapseAll(): TreeNode<T>[] {\n cache.setAllNodes({ isExpanded: false });\n\n return cache.toTree();\n }\n\n /** VISIBILITY **/\n function onVisibilityChange(keys: Set<Key>): TreeData<T> {\n hideAll();\n\n for (const key of keys) {\n const node = cache.getNode(key);\n cache.setNode(node.key, {\n ...node,\n isVisible: true,\n });\n }\n return cache.toTree(true);\n }\n\n function revealAll(): TreeNode<T>[] {\n cache.setAllNodes({ isVisible: true });\n\n return cache.toTree(true);\n }\n\n function hideAll(): TreeNode<T>[] {\n cache.setAllNodes({ isVisible: false });\n\n return cache.toTree(true);\n }\n\n return {\n getNode,\n insertAfter,\n insertBefore,\n insertInto,\n moveAfter,\n moveBefore,\n moveInto,\n remove,\n updateNode,\n\n // Expansion\n collapseAll,\n expandAll,\n onExpandedChange,\n\n // Selection\n selectAll,\n unselectAll,\n onSelectionChange,\n\n // Visibility\n hideAll,\n revealAll,\n onVisibilityChange,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,SAAgB,eAAkB,EAChC,SAC2C;CAC3C,MAAM,QAAQ,OAAO,IAAI,MAAS,MAAM,CAAC,CAAC;AAE1C,uBAAsB;AACpB,QAAM,QAAQ,MAAM;IACnB,CAAC,MAAM,CAAC;;CAGX,SAAS,QAAQ,KAAU;AACzB,SAAO,MAAM,QAAQ,IAAI;;;CAI3B,SAAS,YACP,QACA,SACe;AACf,QAAM,SAAS,QAAQA,SAAO,QAAQ;AAEtC,SAAO,MAAM,OAAO,KAAK;;CAG3B,SAAS,aACP,QACA,SACe;AACf,QAAM,SAAS,QAAQA,SAAO,SAAS;AAEvC,SAAO,MAAM,OAAO,KAAK;;CAG3B,SAAS,WAAW,QAAoB,SAAqC;AAC3E,OAAK,MAAM,QAAQA,QACjB,OAAM,WAAW,QAAQ,MAAM,EAAE;AAGnC,SAAO,MAAM,OAAO,KAAK;;;CAI3B,SAAS,UAAU,QAAoB,MAA+B;AACpE,QAAM,UAAU,QAAQ,MAAM,QAAQ;AAEtC,SAAO,MAAM,QAAQ;;CAGvB,SAAS,WAAW,QAAoB,MAA+B;AACrE,QAAM,UAAU,QAAQ,MAAM,SAAS;AAEvC,SAAO,MAAM,QAAQ;;CAGvB,SAAS,SAAS,QAAoB,MAA+B;AACnE,OAAK,MAAM,OAAO,KAChB,OAAM,SAAS,QAAQ,KAAK,EAAE;AAGhC,SAAO,MAAM,QAAQ;;;CAIvB,SAAS,WACP,KACA,UACe;EACf,MAAM,OAAO,MAAM,QAAQ,IAAI;AAE/B,QAAM,QAAQ,KAAK,SAAS,KAAK,CAAC;AAElC,SAAO,MAAM,OAAO,KAAK;;;CAI3B,SAAS,OAAO,MAA+B;AAC7C,OAAK,MAAM,OAAO,KAAK,QAAQ,CAC7B,OAAM,WAAW,IAAI;AAGvB,SAAO,MAAM,OAAO,KAAK;;;CAI3B,SAAS,kBAAkB,MAA+B;AACxD,eAAa;AAEb,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,QAAQ,IAAI;AAE/B,SAAM,QAAQ,KAAK,KAAK;IACtB,GAAG;IACH,YAAY;IACb,CAAC;;AAGJ,SAAO,MAAM,QAAQ;;CAGvB,SAAS,YAA2B;AAClC,QAAM,YAAY,EAAE,YAAY,MAAM,CAAC;AAEvC,SAAO,MAAM,QAAQ;;CAGvB,SAAS,cAA6B;AACpC,QAAM,YAAY,EAAE,YAAY,OAAO,CAAC;AAExC,SAAO,MAAM,QAAQ;;;CAIvB,SAAS,iBAAiB,MAA+B;AACvD,eAAa;AAEb,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,QAAQ,IAAI;AAE/B,SAAM,QAAQ,KAAK,KAAK;IACtB,GAAG;IACH,YAAY;IACb,CAAC;;AAGJ,SAAO,MAAM,QAAQ;;CAGvB,SAAS,YAA2B;AAClC,QAAM,YAAY,EAAE,YAAY,MAAM,CAAC;AAEvC,SAAO,MAAM,QAAQ;;CAGvB,SAAS,cAA6B;AACpC,QAAM,YAAY,EAAE,YAAY,OAAO,CAAC;AAExC,SAAO,MAAM,QAAQ;;;CAIvB,SAAS,mBAAmB,MAA6B;AACvD,WAAS;AAET,OAAK,MAAM,OAAO,MAAM;GACtB,MAAM,OAAO,MAAM,QAAQ,IAAI;AAC/B,SAAM,QAAQ,KAAK,KAAK;IACtB,GAAG;IACH,WAAW;IACZ,CAAC;;AAEJ,SAAO,MAAM,OAAO,KAAK;;CAG3B,SAAS,YAA2B;AAClC,QAAM,YAAY,EAAE,WAAW,MAAM,CAAC;AAEtC,SAAO,MAAM,OAAO,KAAK;;CAG3B,SAAS,UAAyB;AAChC,QAAM,YAAY,EAAE,WAAW,OAAO,CAAC;AAEvC,SAAO,MAAM,OAAO,KAAK;;AAG3B,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGA;EACA;EACA;EAGA;EACA;EACA;EAGA;EACA;EACA;EACD"}
|
|
@@ -14,6 +14,13 @@ import { UseTreeState, UseTreeStateOptions } from "../types.js";
|
|
|
14
14
|
import "client-only";
|
|
15
15
|
|
|
16
16
|
//#region src/hooks/use-tree/state/index.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Stateful tree manager with drag-and-drop, selection, expansion, and visibility controls
|
|
19
|
+
*
|
|
20
|
+
* @param options - {@link UseTreeStateOptions}
|
|
21
|
+
* @param options.items - Initial tree node items.
|
|
22
|
+
* @returns {@link UseTreeState} Tree state, actions, and drag-and-drop configuration.
|
|
23
|
+
*/
|
|
17
24
|
declare function useTreeState<T>({
|
|
18
25
|
items
|
|
19
26
|
}: UseTreeStateOptions<T>): UseTreeState<T>;
|
|
@@ -19,6 +19,13 @@ import "client-only";
|
|
|
19
19
|
import { useState } from "react";
|
|
20
20
|
|
|
21
21
|
//#region src/hooks/use-tree/state/index.ts
|
|
22
|
+
/**
|
|
23
|
+
* Stateful tree manager with drag-and-drop, selection, expansion, and visibility controls
|
|
24
|
+
*
|
|
25
|
+
* @param options - {@link UseTreeStateOptions}
|
|
26
|
+
* @param options.items - Initial tree node items.
|
|
27
|
+
* @returns {@link UseTreeState} Tree state, actions, and drag-and-drop configuration.
|
|
28
|
+
*/
|
|
22
29
|
function useTreeState({ items }) {
|
|
23
30
|
const [nodes, setNodes] = useState(items);
|
|
24
31
|
const actions = useTreeActions({ nodes });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["dragAndDropConfig: DragAndDropConfig","items"],"sources":["../../../../src/hooks/use-tree/state/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useState } from 'react';\nimport { useTreeActions } from '../actions';\nimport { processDroppedItems } from './utils';\nimport type {\n DragItem,\n DroppableCollectionInsertDropEvent,\n DroppableCollectionOnItemDropEvent,\n DroppableCollectionReorderEvent,\n DroppableCollectionRootDropEvent,\n Key,\n Selection,\n} from '@react-types/shared';\nimport type {\n DragAndDropConfig,\n UseTreeState,\n UseTreeStateOptions,\n} from '../types';\n\nexport function useTreeState<T>({\n items,\n}: UseTreeStateOptions<T>): UseTreeState<T> {\n const [nodes, setNodes] = useState(items);\n const actions = useTreeActions<T>({ nodes });\n\n const dragAndDropConfig: DragAndDropConfig = {\n getItems: (keys: Set<Key>): DragItem[] =>\n [...keys].map((key) => {\n const node = actions.getNode(key);\n\n return {\n key: `${key}`,\n 'text/plain': JSON.stringify(node),\n };\n }),\n onReorder: (e: DroppableCollectionReorderEvent) => {\n if (e.target.dropPosition === 'before') {\n setNodes(actions.moveBefore(e.target.key, e.keys));\n } else {\n setNodes(actions.moveAfter(e.target.key, e.keys));\n }\n },\n onInsert: ({ items, target }: DroppableCollectionInsertDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.id))),\n );\n\n if (target.dropPosition === 'before') {\n setNodes(actions.insertBefore(target.key, processedItems));\n } else if (target.dropPosition === 'after') {\n setNodes(actions.insertAfter(target.key, processedItems));\n }\n })();\n },\n onItemDrop: ({ target, items }: DroppableCollectionOnItemDropEvent) => {\n (async () => {\n const targetNode = actions.getNode(target.key);\n const [item] = items;\n\n if (\n target.dropPosition === 'on' &&\n targetNode &&\n item &&\n item.kind !== 'directory'\n ) {\n const key = await item.getText('key');\n\n if (key) {\n setNodes(actions.moveInto(target.key, new Set([key])));\n }\n }\n })();\n },\n onRootDrop: ({ items }: DroppableCollectionRootDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.key))),\n );\n setNodes(actions.insertAfter(null, processedItems));\n })();\n },\n };\n\n function collapseAll() {\n setNodes(actions.collapseAll());\n }\n\n function expandAll() {\n setNodes(actions.expandAll());\n }\n\n function onExpandedChange(keys: Set<Key>) {\n setNodes(actions.onExpandedChange(keys));\n }\n\n function selectAll() {\n setNodes(actions.selectAll());\n }\n\n function unselectAll() {\n setNodes(actions.unselectAll());\n }\n\n function onSelectionChange(keys: Selection) {\n if (keys === 'all') {\n return selectAll();\n }\n\n setNodes(actions.onSelectionChange(keys));\n }\n\n function hideAll() {\n setNodes(actions.hideAll());\n }\n\n function revealAll() {\n setNodes(actions.revealAll());\n }\n\n function onVisibilityChange(keys: Set<Key>) {\n setNodes(actions.onVisibilityChange(keys));\n }\n\n return {\n nodes,\n actions: {\n // Expansion\n collapseAll,\n expandAll,\n onExpandedChange,\n\n // Selection\n selectAll,\n unselectAll,\n onSelectionChange,\n\n // Visibility\n hideAll,\n revealAll,\n onVisibilityChange,\n },\n dragAndDropConfig,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["dragAndDropConfig: DragAndDropConfig","items"],"sources":["../../../../src/hooks/use-tree/state/index.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { useState } from 'react';\nimport { useTreeActions } from '../actions';\nimport { processDroppedItems } from './utils';\nimport type {\n DragItem,\n DroppableCollectionInsertDropEvent,\n DroppableCollectionOnItemDropEvent,\n DroppableCollectionReorderEvent,\n DroppableCollectionRootDropEvent,\n Key,\n Selection,\n} from '@react-types/shared';\nimport type {\n DragAndDropConfig,\n UseTreeState,\n UseTreeStateOptions,\n} from '../types';\n\n/**\n * Stateful tree manager with drag-and-drop, selection, expansion, and visibility controls\n *\n * @param options - {@link UseTreeStateOptions}\n * @param options.items - Initial tree node items.\n * @returns {@link UseTreeState} Tree state, actions, and drag-and-drop configuration.\n */\nexport function useTreeState<T>({\n items,\n}: UseTreeStateOptions<T>): UseTreeState<T> {\n const [nodes, setNodes] = useState(items);\n const actions = useTreeActions<T>({ nodes });\n\n const dragAndDropConfig: DragAndDropConfig = {\n getItems: (keys: Set<Key>): DragItem[] =>\n [...keys].map((key) => {\n const node = actions.getNode(key);\n\n return {\n key: `${key}`,\n 'text/plain': JSON.stringify(node),\n };\n }),\n onReorder: (e: DroppableCollectionReorderEvent) => {\n if (e.target.dropPosition === 'before') {\n setNodes(actions.moveBefore(e.target.key, e.keys));\n } else {\n setNodes(actions.moveAfter(e.target.key, e.keys));\n }\n },\n onInsert: ({ items, target }: DroppableCollectionInsertDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.id))),\n );\n\n if (target.dropPosition === 'before') {\n setNodes(actions.insertBefore(target.key, processedItems));\n } else if (target.dropPosition === 'after') {\n setNodes(actions.insertAfter(target.key, processedItems));\n }\n })();\n },\n onItemDrop: ({ target, items }: DroppableCollectionOnItemDropEvent) => {\n (async () => {\n const targetNode = actions.getNode(target.key);\n const [item] = items;\n\n if (\n target.dropPosition === 'on' &&\n targetNode &&\n item &&\n item.kind !== 'directory'\n ) {\n const key = await item.getText('key');\n\n if (key) {\n setNodes(actions.moveInto(target.key, new Set([key])));\n }\n }\n })();\n },\n onRootDrop: ({ items }: DroppableCollectionRootDropEvent) => {\n (async () => {\n const processedItems = await processDroppedItems(\n items,\n dragAndDropConfig.acceptedDragTypes ?? [],\n );\n\n setNodes(\n actions.remove(new Set(processedItems.map((item) => item.key))),\n );\n setNodes(actions.insertAfter(null, processedItems));\n })();\n },\n };\n\n function collapseAll() {\n setNodes(actions.collapseAll());\n }\n\n function expandAll() {\n setNodes(actions.expandAll());\n }\n\n function onExpandedChange(keys: Set<Key>) {\n setNodes(actions.onExpandedChange(keys));\n }\n\n function selectAll() {\n setNodes(actions.selectAll());\n }\n\n function unselectAll() {\n setNodes(actions.unselectAll());\n }\n\n function onSelectionChange(keys: Selection) {\n if (keys === 'all') {\n return selectAll();\n }\n\n setNodes(actions.onSelectionChange(keys));\n }\n\n function hideAll() {\n setNodes(actions.hideAll());\n }\n\n function revealAll() {\n setNodes(actions.revealAll());\n }\n\n function onVisibilityChange(keys: Set<Key>) {\n setNodes(actions.onVisibilityChange(keys));\n }\n\n return {\n nodes,\n actions: {\n // Expansion\n collapseAll,\n expandAll,\n onExpandedChange,\n\n // Selection\n selectAll,\n unselectAll,\n onSelectionChange,\n\n // Visibility\n hideAll,\n revealAll,\n onVisibilityChange,\n },\n dragAndDropConfig,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,aAAgB,EAC9B,SAC0C;CAC1C,MAAM,CAAC,OAAO,YAAY,SAAS,MAAM;CACzC,MAAM,UAAU,eAAkB,EAAE,OAAO,CAAC;CAE5C,MAAMA,oBAAuC;EAC3C,WAAW,SACT,CAAC,GAAG,KAAK,CAAC,KAAK,QAAQ;GACrB,MAAM,OAAO,QAAQ,QAAQ,IAAI;AAEjC,UAAO;IACL,KAAK,GAAG;IACR,cAAc,KAAK,UAAU,KAAK;IACnC;IACD;EACJ,YAAY,MAAuC;AACjD,OAAI,EAAE,OAAO,iBAAiB,SAC5B,UAAS,QAAQ,WAAW,EAAE,OAAO,KAAK,EAAE,KAAK,CAAC;OAElD,UAAS,QAAQ,UAAU,EAAE,OAAO,KAAK,EAAE,KAAK,CAAC;;EAGrD,WAAW,EAAE,gBAAO,aAAiD;AACnE,IAAC,YAAY;IACX,MAAM,iBAAiB,MAAM,oBAC3BC,SACA,kBAAkB,qBAAqB,EAAE,CAC1C;AAED,aACE,QAAQ,OAAO,IAAI,IAAI,eAAe,KAAK,SAAS,KAAK,GAAG,CAAC,CAAC,CAC/D;AAED,QAAI,OAAO,iBAAiB,SAC1B,UAAS,QAAQ,aAAa,OAAO,KAAK,eAAe,CAAC;aACjD,OAAO,iBAAiB,QACjC,UAAS,QAAQ,YAAY,OAAO,KAAK,eAAe,CAAC;OAEzD;;EAEN,aAAa,EAAE,QAAQ,qBAAgD;AACrE,IAAC,YAAY;IACX,MAAM,aAAa,QAAQ,QAAQ,OAAO,IAAI;IAC9C,MAAM,CAAC,QAAQA;AAEf,QACE,OAAO,iBAAiB,QACxB,cACA,QACA,KAAK,SAAS,aACd;KACA,MAAM,MAAM,MAAM,KAAK,QAAQ,MAAM;AAErC,SAAI,IACF,UAAS,QAAQ,SAAS,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;;OAGxD;;EAEN,aAAa,EAAE,qBAA8C;AAC3D,IAAC,YAAY;IACX,MAAM,iBAAiB,MAAM,oBAC3BA,SACA,kBAAkB,qBAAqB,EAAE,CAC1C;AAED,aACE,QAAQ,OAAO,IAAI,IAAI,eAAe,KAAK,SAAS,KAAK,IAAI,CAAC,CAAC,CAChE;AACD,aAAS,QAAQ,YAAY,MAAM,eAAe,CAAC;OACjD;;EAEP;CAED,SAAS,cAAc;AACrB,WAAS,QAAQ,aAAa,CAAC;;CAGjC,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,iBAAiB,MAAgB;AACxC,WAAS,QAAQ,iBAAiB,KAAK,CAAC;;CAG1C,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,cAAc;AACrB,WAAS,QAAQ,aAAa,CAAC;;CAGjC,SAAS,kBAAkB,MAAiB;AAC1C,MAAI,SAAS,MACX,QAAO,WAAW;AAGpB,WAAS,QAAQ,kBAAkB,KAAK,CAAC;;CAG3C,SAAS,UAAU;AACjB,WAAS,QAAQ,SAAS,CAAC;;CAG7B,SAAS,YAAY;AACnB,WAAS,QAAQ,WAAW,CAAC;;CAG/B,SAAS,mBAAmB,MAAgB;AAC1C,WAAS,QAAQ,mBAAmB,KAAK,CAAC;;AAG5C,QAAO;EACL;EACA,SAAS;GAEP;GACA;GACA;GAGA;GACA;GACA;GAGA;GACA;GACA;GACD;EACD;EACD"}
|
|
@@ -15,7 +15,9 @@ import { DropTarget, Selection } from "react-aria-components";
|
|
|
15
15
|
import { DragItem, DroppableCollectionInsertDropEvent, DroppableCollectionOnItemDropEvent, DroppableCollectionReorderEvent, DroppableCollectionRootDropEvent, Key as Key$1 } from "@react-types/shared";
|
|
16
16
|
|
|
17
17
|
//#region src/hooks/use-tree/types.d.ts
|
|
18
|
+
/** Configuration for tree drag-and-drop behavior */
|
|
18
19
|
type DragAndDropConfig = {
|
|
20
|
+
/** Returns drag items for the given keys */
|
|
19
21
|
getItems: (key: Set<Key$1>) => DragItem[];
|
|
20
22
|
/**
|
|
21
23
|
* Handler that is called when external items are dropped on the droppable collection's root.
|
|
@@ -33,8 +35,11 @@ type DragAndDropConfig = {
|
|
|
33
35
|
* moved to a different parent item within a tree.
|
|
34
36
|
*/
|
|
35
37
|
onMove?: (e: DroppableCollectionReorderEvent) => void;
|
|
38
|
+
/** Custom drag preview renderer */
|
|
36
39
|
renderDragPreview?: (items: DragItem[]) => ReactElement;
|
|
40
|
+
/** Custom drop indicator renderer */
|
|
37
41
|
renderDropIndicator?: (target: DropTarget) => ReactElement;
|
|
42
|
+
/** Accepted MIME types for drops */
|
|
38
43
|
acceptedDragTypes?: string[];
|
|
39
44
|
/**
|
|
40
45
|
* Handler that is called when external items are dropped "between" items.
|
|
@@ -45,25 +50,40 @@ type DragAndDropConfig = {
|
|
|
45
50
|
*/
|
|
46
51
|
onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void;
|
|
47
52
|
};
|
|
53
|
+
/** Options for the useTreeState hook */
|
|
48
54
|
type UseTreeStateOptions<T> = {
|
|
49
55
|
/** Initial root items in the tree. If omitted, will return an empty tree. */
|
|
50
56
|
items: TreeNode<T>[];
|
|
51
57
|
};
|
|
58
|
+
/** Return value from the useTreeState hook */
|
|
52
59
|
type UseTreeState<T> = {
|
|
60
|
+
/** Current tree nodes */
|
|
53
61
|
nodes: TreeNode<T>[];
|
|
62
|
+
/** Drag-and-drop configuration for the tree */
|
|
54
63
|
dragAndDropConfig: DragAndDropConfig;
|
|
64
|
+
/** Tree manipulation actions */
|
|
55
65
|
actions: {
|
|
66
|
+
/** Collapse all nodes */
|
|
56
67
|
collapseAll: () => void;
|
|
68
|
+
/** Expand all nodes */
|
|
57
69
|
expandAll: () => void;
|
|
70
|
+
/** Handle expansion state changes */
|
|
58
71
|
onExpandedChange: (keys: Set<Key$1>) => void;
|
|
72
|
+
/** Select all nodes */
|
|
59
73
|
selectAll: () => void;
|
|
74
|
+
/** Unselect all nodes */
|
|
60
75
|
unselectAll: () => void;
|
|
76
|
+
/** Handle selection state changes */
|
|
61
77
|
onSelectionChange: (keys: Selection) => void;
|
|
78
|
+
/** Hide all nodes */
|
|
62
79
|
hideAll: () => void;
|
|
80
|
+
/** Reveal all nodes */
|
|
63
81
|
revealAll: () => void;
|
|
82
|
+
/** Handle visibility state changes */
|
|
64
83
|
onVisibilityChange: (keys: Set<Key$1>) => void;
|
|
65
84
|
};
|
|
66
85
|
};
|
|
86
|
+
/** Array of tree nodes representing tree data */
|
|
67
87
|
type TreeData<T> = TreeNode<T>[];
|
|
68
88
|
/**
|
|
69
89
|
* The TreeNode is a wrapper that describes the relationship of this node
|
|
@@ -95,7 +115,9 @@ type TreeNode<T> = TreeNodeBase<T> & {
|
|
|
95
115
|
/** Children of the tree node. */
|
|
96
116
|
children?: TreeNode<T>[];
|
|
97
117
|
};
|
|
118
|
+
/** Options for the useTreeActions hook */
|
|
98
119
|
type UseTreeActionsOptions<T> = {
|
|
120
|
+
/** Current tree nodes to operate on */
|
|
99
121
|
nodes: TreeNode<T>[];
|
|
100
122
|
};
|
|
101
123
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -68,6 +68,8 @@ import { EXPECTED_SEGMENT_COUNTS, GROUP_SEPARATOR, ddSegmentConfigs, ddmSegmentC
|
|
|
68
68
|
import { CoordinateSegment } from "./components/coordinate-field/segment.js";
|
|
69
69
|
import { DateFieldProps } from "./components/date-field/types.js";
|
|
70
70
|
import { DateField } from "./components/date-field/index.js";
|
|
71
|
+
import { DeferredCollectionProps } from "./components/deferred-collection/types.js";
|
|
72
|
+
import { DeferredCollection } from "./components/deferred-collection/index.js";
|
|
71
73
|
import { DetailsListLabelProps, DetailsListProps, DetailsListValueProps } from "./components/details-list/types.js";
|
|
72
74
|
import { DetailsListContext, DetailsListProvider } from "./components/details-list/context.js";
|
|
73
75
|
import { DetailsList } from "./components/details-list/index.js";
|
|
@@ -84,12 +86,12 @@ import { DividerProps } from "./components/divider/types.js";
|
|
|
84
86
|
import { DividerContext, DividerProvider } from "./components/divider/context.js";
|
|
85
87
|
import { Divider } from "./components/divider/index.js";
|
|
86
88
|
import { DrawerBack } from "./components/drawer/back.js";
|
|
87
|
-
import { DrawerClose } from "./components/drawer/close.js";
|
|
88
|
-
import { DrawerContent } from "./components/drawer/content.js";
|
|
89
89
|
import { ViewStackEventNamespace, ViewStackEventTypes } from "./components/view-stack/events.js";
|
|
90
90
|
import { ViewStackBackEvent, ViewStackClearEvent, ViewStackContextValue, ViewStackEvent, ViewStackProps, ViewStackPushEvent, ViewStackResetEvent, ViewStackTriggerProps, ViewStackViewProps } from "./components/view-stack/types.js";
|
|
91
91
|
import { DrawerEventNamespace, DrawerEventTypes } from "./components/drawer/events.js";
|
|
92
|
-
import { DrawerContextValue, DrawerEvent, DrawerLayoutProps, DrawerMenuItemProps, DrawerMenuProps, DrawerOpenEvent, DrawerProps, DrawerTitleProps, DrawerToggleEvent, DrawerTriggerProps } from "./components/drawer/types.js";
|
|
92
|
+
import { ChainedEvents, DrawerCloseEvent, DrawerCloseProps, DrawerContextValue, DrawerEvent, DrawerLayoutProps, DrawerMenuItemProps, DrawerMenuProps, DrawerOpenEvent, DrawerProps, DrawerTitleProps, DrawerToggleEvent, DrawerTriggerProps, SimpleEvents, TargetedEvents } from "./components/drawer/types.js";
|
|
93
|
+
import { DrawerClose } from "./components/drawer/close.js";
|
|
94
|
+
import { DrawerContent } from "./components/drawer/content.js";
|
|
93
95
|
import { DrawerContext, DrawerEventHandlers, bus, useDrawerEmit } from "./components/drawer/context.js";
|
|
94
96
|
import { DrawerFooter } from "./components/drawer/footer.js";
|
|
95
97
|
import { DrawerHeaderTitle } from "./components/drawer/header-title.js";
|
|
@@ -266,9 +268,10 @@ import { UseCoordinateFocusOptions, UseCoordinateFocusResult, useCoordinateFocus
|
|
|
266
268
|
import { UseCoordinatePasteOptions, UseCoordinatePasteResult, useCoordinatePaste } from "./hooks/coordinate-field/use-coordinate-paste.js";
|
|
267
269
|
import { UseCoordinateFieldResult, useCoordinateField } from "./hooks/coordinate-field/use-coordinate-field.js";
|
|
268
270
|
import { useCardInteractions, useColumnInteractions } from "./hooks/kanban/index.js";
|
|
271
|
+
import { UseFrameDelayOptions, UseFrameDelayResult, useFrameDelay } from "./hooks/use-frame-delay/index.js";
|
|
269
272
|
import { useTreeActions } from "./hooks/use-tree/actions/index.js";
|
|
270
273
|
import { useTreeState } from "./hooks/use-tree/state/index.js";
|
|
271
274
|
import { isSlottedContextValue } from "./lib/utils.js";
|
|
272
275
|
import { PortalProvider } from "./providers/portal.js";
|
|
273
276
|
import { ThemeMode, ThemeProvider, useTheme } from "./providers/theme-provider.js";
|
|
274
|
-
export { Accordion, AccordionContext, AccordionGroup, type AccordionGroupProps, AccordionHeader, type AccordionHeaderProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, type AccordionStyleVariants, AccordionTrigger, type AccordionTriggerProps, ActionBar, type ActionBarProps, type AriaAttributes, type AriaAttributesWithRef, Avatar, AvatarContext, type AvatarProps, AvatarProvider, Badge, BadgeContext, type BadgeProps, BadgeProvider, BreadcrumbItem, type BreadcrumbItemProps, Breadcrumbs, Button, ButtonContext, type ButtonProps, ButtonProvider, type ButtonStyleVariants, COORDINATE_EPSILON, COORDINATE_ERROR_MESSAGES, COORDINATE_FORMAT_LABELS, COORDINATE_FORMAT_NAMES, COORDINATE_SYSTEMS, Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext, type CheckboxGroupProps, type CheckboxProps, type ChildrenRenderProps, Chip, ChipContext, type ChipContextValue, ChipList, type ChipListProps, ChipListRenderingContext, type ChipProps, ChipProvider, type ClassNameRenderProps, type ClassNames, ClassificationBadge, ClassificationBadgeContext, type ClassificationBadgeProps, ClassificationBadgeProvider, ClassificationBanner, ClassificationBannerContext, type ClassificationBannerProps, ClassificationBannerProvider, Clock, type ClockProps, CloneAction, ColorPicker, type ColorPickerProps, CombinatorSelector, ComboBoxField, ComboBoxFieldContext, type ComboBoxFieldProps, ComboBoxFieldProvider, CoordinateField, CoordinateFieldContext, type CoordinateFieldProps, CoordinateFieldProvider, type CoordinateFieldState, CoordinateFieldStateContext, CoordinateFieldStateProvider, type CoordinateFormatResult, CoordinateSegment, type CoordinateSegmentProps, type CoordinateSystem, type CoordinateValue, DateField, type DateFieldProps, type DefaultRQBProps, DeletableChip, type DeletableChipProps, DetailsList, DetailsListContext, DetailsListLabel, type DetailsListLabelProps, type DetailsListProps, DetailsListProvider, DetailsListValue, type DetailsListValueProps, Dialog, DialogContent, DialogContext, DialogFooter, type DialogProps, DialogTitle, DialogTrigger, type DialogTriggerProps, Divider, DividerContext, type DividerProps, DividerProvider, type DragAndDropConfig, DragContext, Drawer, DrawerBack, DrawerClose, DrawerContent, DrawerContext, type DrawerContextValue, type DrawerEvent, DrawerEventHandlers, DrawerEventNamespace, DrawerEventTypes, DrawerFooter, DrawerHeader, DrawerHeaderTitle, DrawerLayout, DrawerLayoutMain, type DrawerLayoutProps, DrawerMenu, DrawerMenuItem, type DrawerMenuItemProps, type DrawerMenuProps, type DrawerOpenEvent, DrawerPanel, type DrawerProps, type DrawerTitleProps, type DrawerToggleEvent, DrawerTrigger, type DrawerTriggerProps, DrawerView, type DropTargetInfo, EXPECTED_SEGMENT_COUNTS, type Field, Flashcard, FlashcardAdditionalData, type FlashcardComponentProps, FlashcardContext, FlashcardDetailsLabel, FlashcardDetailsList, type FlashcardDetailsListProps, FlashcardDetailsValue, FlashcardHero, type FlashcardProps, GROUP_SEPARATOR, HeaderColumnAction, type HeaderColumnActionKey, Hero, HeroContext, type HeroProps, HeroSubtitle, HeroTitle, Hotkey, HotkeyContext, type HotkeyProps, HotkeyProvider, HotkeySet, Icon, IconContext, type IconProps, IconProvider, Input, InputContext, type InputProps, Kanban, KanbanCard, KanbanCardBody, type KanbanCardData, KanbanCardHeader, KanbanCardHeaderActions, KanbanCardHeaderTitle, type KanbanCardProps, type KanbanColContentActionProps, type KanbanColContentProps, type KanbanColProps, KanbanColumn, KanbanColumnActions, KanbanColumnContainer, KanbanColumnContent, type KanbanColumnData, KanbanColumnHeader, KanbanColumnHeaderActions, KanbanColumnHeaderDragHandle, KanbanColumnHeaderTitle, type KanbanComponentProps, type KanbanContextData, KanbanHeader, KanbanHeaderActions, KanbanHeaderSearch, KanbanHeaderTitle, type KanbanMenuProps, type KanbanProps, KanbanProvider, type KanbanProviderProps, type KanbanSearchProps, Label, LabelContext, type LabelProps, LabelProvider, Lines, type LinesProps, Link, LinkButton, LinkButtonContext, type LinkButtonProps, LinkButtonProvider, type LinkProps, LinkProvider, List, ListContext, ListItem, ListItemContent, type ListItemContentProps, ListItemDescription, type ListItemDescriptionProps, type ListItemProps, ListItemTitle, type ListItemTitleProps, type ListItemVariant, type ListProps, LockAction, Menu, MenuContext, MenuItem, MenuItemDescription, MenuItemLabel, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, MenuSubmenu, MenuTrigger, type MoveCard, type MoveCardValidationParams, type MoveCardValidationResult, Notice, type NoticeActionEvent, type NoticeColor, type NoticeContent, type NoticeDequeueEvent, NoticeEventNamespace, NoticeEventTypes, NoticeIcon, type NoticeIconProps, NoticeList, type NoticeListProps, type NoticeProps, type NoticeQueueEvent, Options, OptionsContext, type OptionsDataItem, OptionsItem, OptionsItemContent, OptionsItemDescription, OptionsItemLabel, type OptionsItemProps, type OptionsProps, OptionsSection, type OptionsSectionProps, Pagination, PaginationContext, type PaginationContextValue, PaginationNext, type PaginationNextProps, PaginationPages, type PaginationPagesProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, type ParsedCoordinateMatch, Popover, PopoverContent, PopoverFooter, type PopoverProps, PopoverTitle, PopoverTrigger, type PopoverTriggerProps, PortalProvider, type ProviderProps, QueryBuilder, type QueryBuilderContextType, type QueryBuilderProps, type QueryBuilderValueEditors, Radio, RadioContext, RadioGroup, type RadioGroupProps, type RadioProps, RemoveRuleAction, type RenderProps, type RenderPropsChildren, type RenderPropsClassName, type RenderPropsStyle, type RuleGroupType, SearchField, SearchFieldContext, type SearchFieldProps, SearchFieldProvider, type SegmentConfig, type SegmentType, SelectField, SelectFieldContext, type SelectFieldProps, SelectFieldProvider, SelectableChip, type SelectableChipProps, Sidenav, SidenavAvatar, type SidenavAvatarProps, type SidenavCloseEvent, SidenavContent, type SidenavContentProps, SidenavContext, type SidenavContextValue, type SidenavDividerProps, type SidenavEvent, SidenavEventNamespace, SidenavEventTypes, SidenavFooter, type SidenavFooterProps, SidenavHeader, type SidenavHeaderProps, SidenavItem, type SidenavItemProps, SidenavLink, type SidenavLinkProps, SidenavMenu, SidenavMenuItem, type SidenavMenuItemProps, type SidenavMenuProps, type SidenavOpenEvent, type SidenavProps, type SidenavToggleEvent, SidenavTrigger, type SidenavTriggerProps, Skeleton, type SkeletonProps, Slider, type SliderMarker, type SliderMarkersConfig, type SliderProps, type SlottedValue, SortDirection, type SortDirectionState, type StylePropRenderProps, type StyleRenderProps, Switch, SwitchContext, type SwitchProps, SwitchProvider, Tab, TabList, TabPanel, Table, type TableBodyProps, type TableCellProps, TableContext, type TableContextValue, type TableHeaderCellProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, TabsContext, type TabsProps, TabsProvider, TextAreaField, TextAreaFieldContext, type TextAreaFieldProps, TextAreaFieldProvider, TextField, TextFieldContext, type TextFieldProps, TextFieldProvider, type ThemeMode, ThemeProvider, TimeField, type TimeFieldProps, ToggleButton, ToggleButtonContext, type ToggleButtonProps, ToggleButtonProvider, type ToggleButtonStyleVariants, Tooltip, TooltipContext, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, Tree, type TreeActions, TreeContext, type TreeContextValue, type TreeData, TreeItem, TreeItemActions, TreeItemContent, type TreeItemContentProps, type TreeItemContentRenderProps, TreeItemContext, type TreeItemContextValue, TreeItemDescription, TreeItemLabel, TreeItemPrefixIcon, type TreeItemProps, TreeLines, type TreeNode, type TreeNodeBase, type TreeProps, type TreeStyleVariant, type UseCoordinateCopyOptions, type UseCoordinateCopyResult, type UseCoordinateFieldResult, type UseCoordinateFieldStateOptions, type UseCoordinateFieldStateResult, type UseCoordinateFocusOptions, type UseCoordinateFocusResult, type UseCoordinatePasteOptions, type UseCoordinatePasteResult, type UseTimeoutCleanupResult, type UseTreeActionsOptions, type UseTreeState, type UseTreeStateOptions, ViewStack, type ViewStackBackEvent, type ViewStackClearEvent, ViewStackContext, type ViewStackContextValue, type ViewStackEvent, ViewStackEventHandlers, ViewStackEventNamespace, ViewStackEventTypes, type ViewStackProps, type ViewStackPushEvent, type ViewStackResetEvent, ViewStackTrigger, type ViewStackTriggerProps, ViewStackView, type ViewStackViewProps, areAllSegmentsFilled, areCoordinatesEqual, bus, calculateClosestEdge, columnData, convertDDToDisplaySegments, convertDisplaySegmentsToDD, ddSegmentConfigs, ddmSegmentConfigs, deduplicateMatchesByLocation, dmsSegmentConfigs, formatSegmentsToCoordinateString, getAllCoordinateFormats, getEditableSegmentCount, getFormatDescription, getInsertIndex, getSegmentConfigs, getSegmentLabel, hasAnySegmentValue, headerColumnActionValues, isCompleteCoordinate, isSlottedContextValue, matchesMetadata, mgrsSegmentConfigs, parseCoordinatePaste, parseCoordinateStringToSegments, parseDropTarget, sortDirectionValues, useCardInteractions, useColumnInteractions, useCoordinateCopy, useCoordinateField, useCoordinateFieldState, useCoordinateFieldStateContext, useCoordinateFocus, useCoordinatePaste, useDragContext, useDrawerEmit, useKanban, useListItemVariant, useTheme, useTimeoutCleanup, useTreeActions, useTreeState, useViewStackEmit, utmSegmentConfigs, validateCoordinateSegments, validateMoveCard };
|
|
277
|
+
export { Accordion, AccordionContext, AccordionGroup, type AccordionGroupProps, AccordionHeader, type AccordionHeaderProps, AccordionPanel, type AccordionPanelProps, type AccordionProps, type AccordionStyleVariants, AccordionTrigger, type AccordionTriggerProps, ActionBar, type ActionBarProps, type AriaAttributes, type AriaAttributesWithRef, Avatar, AvatarContext, type AvatarProps, AvatarProvider, Badge, BadgeContext, type BadgeProps, BadgeProvider, BreadcrumbItem, type BreadcrumbItemProps, Breadcrumbs, Button, ButtonContext, type ButtonProps, ButtonProvider, type ButtonStyleVariants, COORDINATE_EPSILON, COORDINATE_ERROR_MESSAGES, COORDINATE_FORMAT_LABELS, COORDINATE_FORMAT_NAMES, COORDINATE_SYSTEMS, type ChainedEvents, Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext, type CheckboxGroupProps, type CheckboxProps, type ChildrenRenderProps, Chip, ChipContext, type ChipContextValue, ChipList, type ChipListProps, ChipListRenderingContext, type ChipProps, ChipProvider, type ClassNameRenderProps, type ClassNames, ClassificationBadge, ClassificationBadgeContext, type ClassificationBadgeProps, ClassificationBadgeProvider, ClassificationBanner, ClassificationBannerContext, type ClassificationBannerProps, ClassificationBannerProvider, Clock, type ClockProps, CloneAction, ColorPicker, type ColorPickerProps, CombinatorSelector, ComboBoxField, ComboBoxFieldContext, type ComboBoxFieldProps, ComboBoxFieldProvider, CoordinateField, CoordinateFieldContext, type CoordinateFieldProps, CoordinateFieldProvider, type CoordinateFieldState, CoordinateFieldStateContext, CoordinateFieldStateProvider, type CoordinateFormatResult, CoordinateSegment, type CoordinateSegmentProps, type CoordinateSystem, type CoordinateValue, DateField, type DateFieldProps, type DefaultRQBProps, DeferredCollection, type DeferredCollectionProps, DeletableChip, type DeletableChipProps, DetailsList, DetailsListContext, DetailsListLabel, type DetailsListLabelProps, type DetailsListProps, DetailsListProvider, DetailsListValue, type DetailsListValueProps, Dialog, DialogContent, DialogContext, DialogFooter, type DialogProps, DialogTitle, DialogTrigger, type DialogTriggerProps, Divider, DividerContext, type DividerProps, DividerProvider, type DragAndDropConfig, DragContext, Drawer, DrawerBack, DrawerClose, type DrawerCloseEvent, type DrawerCloseProps, DrawerContent, DrawerContext, type DrawerContextValue, type DrawerEvent, DrawerEventHandlers, DrawerEventNamespace, DrawerEventTypes, DrawerFooter, DrawerHeader, DrawerHeaderTitle, DrawerLayout, DrawerLayoutMain, type DrawerLayoutProps, DrawerMenu, DrawerMenuItem, type DrawerMenuItemProps, type DrawerMenuProps, type DrawerOpenEvent, DrawerPanel, type DrawerProps, type DrawerTitleProps, type DrawerToggleEvent, DrawerTrigger, type DrawerTriggerProps, DrawerView, type DropTargetInfo, EXPECTED_SEGMENT_COUNTS, type Field, Flashcard, FlashcardAdditionalData, type FlashcardComponentProps, FlashcardContext, FlashcardDetailsLabel, FlashcardDetailsList, type FlashcardDetailsListProps, FlashcardDetailsValue, FlashcardHero, type FlashcardProps, GROUP_SEPARATOR, HeaderColumnAction, type HeaderColumnActionKey, Hero, HeroContext, type HeroProps, HeroSubtitle, HeroTitle, Hotkey, HotkeyContext, type HotkeyProps, HotkeyProvider, HotkeySet, Icon, IconContext, type IconProps, IconProvider, Input, InputContext, type InputProps, Kanban, KanbanCard, KanbanCardBody, type KanbanCardData, KanbanCardHeader, KanbanCardHeaderActions, KanbanCardHeaderTitle, type KanbanCardProps, type KanbanColContentActionProps, type KanbanColContentProps, type KanbanColProps, KanbanColumn, KanbanColumnActions, KanbanColumnContainer, KanbanColumnContent, type KanbanColumnData, KanbanColumnHeader, KanbanColumnHeaderActions, KanbanColumnHeaderDragHandle, KanbanColumnHeaderTitle, type KanbanComponentProps, type KanbanContextData, KanbanHeader, KanbanHeaderActions, KanbanHeaderSearch, KanbanHeaderTitle, type KanbanMenuProps, type KanbanProps, KanbanProvider, type KanbanProviderProps, type KanbanSearchProps, Label, LabelContext, type LabelProps, LabelProvider, Lines, type LinesProps, Link, LinkButton, LinkButtonContext, type LinkButtonProps, LinkButtonProvider, type LinkProps, LinkProvider, List, ListContext, ListItem, ListItemContent, type ListItemContentProps, ListItemDescription, type ListItemDescriptionProps, type ListItemProps, ListItemTitle, type ListItemTitleProps, type ListItemVariant, type ListProps, LockAction, Menu, MenuContext, MenuItem, MenuItemDescription, MenuItemLabel, type MenuItemProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, MenuSubmenu, MenuTrigger, type MoveCard, type MoveCardValidationParams, type MoveCardValidationResult, Notice, type NoticeActionEvent, type NoticeColor, type NoticeContent, type NoticeDequeueEvent, NoticeEventNamespace, NoticeEventTypes, NoticeIcon, type NoticeIconProps, NoticeList, type NoticeListProps, type NoticeProps, type NoticeQueueEvent, Options, OptionsContext, type OptionsDataItem, OptionsItem, OptionsItemContent, OptionsItemDescription, OptionsItemLabel, type OptionsItemProps, type OptionsProps, OptionsSection, type OptionsSectionProps, Pagination, PaginationContext, type PaginationContextValue, PaginationNext, type PaginationNextProps, PaginationPages, type PaginationPagesProps, PaginationPrev, type PaginationPrevProps, type PaginationProps, type ParsedCoordinateMatch, Popover, PopoverContent, PopoverFooter, type PopoverProps, PopoverTitle, PopoverTrigger, type PopoverTriggerProps, PortalProvider, type ProviderProps, QueryBuilder, type QueryBuilderContextType, type QueryBuilderProps, type QueryBuilderValueEditors, Radio, RadioContext, RadioGroup, type RadioGroupProps, type RadioProps, RemoveRuleAction, type RenderProps, type RenderPropsChildren, type RenderPropsClassName, type RenderPropsStyle, type RuleGroupType, SearchField, SearchFieldContext, type SearchFieldProps, SearchFieldProvider, type SegmentConfig, type SegmentType, SelectField, SelectFieldContext, type SelectFieldProps, SelectFieldProvider, SelectableChip, type SelectableChipProps, Sidenav, SidenavAvatar, type SidenavAvatarProps, type SidenavCloseEvent, SidenavContent, type SidenavContentProps, SidenavContext, type SidenavContextValue, type SidenavDividerProps, type SidenavEvent, SidenavEventNamespace, SidenavEventTypes, SidenavFooter, type SidenavFooterProps, SidenavHeader, type SidenavHeaderProps, SidenavItem, type SidenavItemProps, SidenavLink, type SidenavLinkProps, SidenavMenu, SidenavMenuItem, type SidenavMenuItemProps, type SidenavMenuProps, type SidenavOpenEvent, type SidenavProps, type SidenavToggleEvent, SidenavTrigger, type SidenavTriggerProps, type SimpleEvents, Skeleton, type SkeletonProps, Slider, type SliderMarker, type SliderMarkersConfig, type SliderProps, type SlottedValue, SortDirection, type SortDirectionState, type StylePropRenderProps, type StyleRenderProps, Switch, SwitchContext, type SwitchProps, SwitchProvider, Tab, TabList, TabPanel, Table, type TableBodyProps, type TableCellProps, TableContext, type TableContextValue, type TableHeaderCellProps, type TableHeaderProps, type TableProps, type TableRowProps, Tabs, TabsContext, type TabsProps, TabsProvider, type TargetedEvents, TextAreaField, TextAreaFieldContext, type TextAreaFieldProps, TextAreaFieldProvider, TextField, TextFieldContext, type TextFieldProps, TextFieldProvider, type ThemeMode, ThemeProvider, TimeField, type TimeFieldProps, ToggleButton, ToggleButtonContext, type ToggleButtonProps, ToggleButtonProvider, type ToggleButtonStyleVariants, Tooltip, TooltipContext, type TooltipProps, TooltipTrigger, type TooltipTriggerProps, Tree, type TreeActions, TreeContext, type TreeContextValue, type TreeData, TreeItem, TreeItemActions, TreeItemContent, type TreeItemContentProps, type TreeItemContentRenderProps, TreeItemContext, type TreeItemContextValue, TreeItemDescription, TreeItemLabel, TreeItemPrefixIcon, type TreeItemProps, TreeLines, type TreeNode, type TreeNodeBase, type TreeProps, type TreeStyleVariant, type UseCoordinateCopyOptions, type UseCoordinateCopyResult, type UseCoordinateFieldResult, type UseCoordinateFieldStateOptions, type UseCoordinateFieldStateResult, type UseCoordinateFocusOptions, type UseCoordinateFocusResult, type UseCoordinatePasteOptions, type UseCoordinatePasteResult, type UseFrameDelayOptions, type UseFrameDelayResult, type UseTimeoutCleanupResult, type UseTreeActionsOptions, type UseTreeState, type UseTreeStateOptions, ViewStack, type ViewStackBackEvent, type ViewStackClearEvent, ViewStackContext, type ViewStackContextValue, type ViewStackEvent, ViewStackEventHandlers, ViewStackEventNamespace, ViewStackEventTypes, type ViewStackProps, type ViewStackPushEvent, type ViewStackResetEvent, ViewStackTrigger, type ViewStackTriggerProps, ViewStackView, type ViewStackViewProps, areAllSegmentsFilled, areCoordinatesEqual, bus, calculateClosestEdge, columnData, convertDDToDisplaySegments, convertDisplaySegmentsToDD, ddSegmentConfigs, ddmSegmentConfigs, deduplicateMatchesByLocation, dmsSegmentConfigs, formatSegmentsToCoordinateString, getAllCoordinateFormats, getEditableSegmentCount, getFormatDescription, getInsertIndex, getSegmentConfigs, getSegmentLabel, hasAnySegmentValue, headerColumnActionValues, isCompleteCoordinate, isSlottedContextValue, matchesMetadata, mgrsSegmentConfigs, parseCoordinatePaste, parseCoordinateStringToSegments, parseDropTarget, sortDirectionValues, useCardInteractions, useColumnInteractions, useCoordinateCopy, useCoordinateField, useCoordinateFieldState, useCoordinateFieldStateContext, useCoordinateFocus, useCoordinatePaste, useDragContext, useDrawerEmit, useFrameDelay, useKanban, useListItemVariant, useTheme, useTimeoutCleanup, useTreeActions, useTreeState, useViewStackEmit, utmSegmentConfigs, validateCoordinateSegments, validateMoveCard };
|