@accelint/design-toolkit 9.3.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/catalog-info.yaml +1 -1
- 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 +29 -8
- package/dist/components/action-bar/index.js +27 -6
- package/dist/components/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/types.d.ts +7 -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 +20 -2
- package/dist/components/badge/context.js +18 -0
- package/dist/components/badge/context.js.map +1 -1
- package/dist/components/badge/index.d.ts +28 -14
- 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 +8 -0
- package/dist/components/breadcrumbs/index.js +7 -0
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/breadcrumbs/item.d.ts +23 -0
- 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 +20 -0
- 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 +47 -2
- package/dist/components/chip/list.js +45 -0
- package/dist/components/chip/list.js.map +1 -1
- package/dist/components/chip/selectable.d.ts +32 -0
- 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 +18 -2
- 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 +26 -8
- 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 +13 -1
- package/dist/components/combobox-field/index.js.map +1 -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 +29 -3
- package/dist/components/coordinate-field/index.js.map +1 -1
- package/dist/components/coordinate-field/segment.d.ts +27 -2
- package/dist/components/coordinate-field/segment.js +25 -0
- package/dist/components/coordinate-field/segment.js.map +1 -1
- package/dist/components/coordinate-field/styles.module.css +5 -1
- package/dist/components/date-field/index.d.ts +27 -2
- package/dist/components/date-field/index.js +25 -0
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/types.d.ts +19 -3
- package/dist/components/deferred-collection/index.d.ts +10 -2
- package/dist/components/deferred-collection/index.js +8 -0
- package/dist/components/deferred-collection/index.js.map +1 -1
- package/dist/components/deferred-collection/types.d.ts +6 -3
- 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/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 +4 -0
- 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 +16 -1
- package/dist/components/input/index.js.map +1 -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 +10 -0
- 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/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 +1 -0
- 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 +24 -2
- 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 +18 -38
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.module.css +8 -0
- package/dist/components/select-field/types.d.ts +18 -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 +3 -2
- 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 +20 -0
- 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 +1 -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 +23 -5
- package/dist/components/time-field/index.js +21 -4
- package/dist/components/time-field/index.js.map +1 -1
- 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 +5 -0
- package/dist/hooks/use-frame-delay/index.js +5 -0
- package/dist/hooks/use-frame-delay/index.js.map +1 -1
- 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 +4 -4
- package/dist/index.js +1 -1
- 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 +3 -3
|
@@ -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"}
|
|
@@ -15,6 +15,11 @@ interface UseFrameDelayResult {
|
|
|
15
15
|
* Useful for deferring expensive renders to allow the browser to paint
|
|
16
16
|
* a loading state first.
|
|
17
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
|
+
*
|
|
18
23
|
* @example
|
|
19
24
|
* ```tsx
|
|
20
25
|
* // Pattern 1: Reactive
|
|
@@ -20,6 +20,11 @@ import { useEffect, useState } from "react";
|
|
|
20
20
|
* Useful for deferring expensive renders to allow the browser to paint
|
|
21
21
|
* a loading state first.
|
|
22
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
|
+
*
|
|
23
28
|
* @example
|
|
24
29
|
* ```tsx
|
|
25
30
|
* // Pattern 1: Reactive
|
|
@@ -1 +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 * @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":"
|
|
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
|
@@ -86,12 +86,12 @@ import { DividerProps } from "./components/divider/types.js";
|
|
|
86
86
|
import { DividerContext, DividerProvider } from "./components/divider/context.js";
|
|
87
87
|
import { Divider } from "./components/divider/index.js";
|
|
88
88
|
import { DrawerBack } from "./components/drawer/back.js";
|
|
89
|
-
import { DrawerClose } from "./components/drawer/close.js";
|
|
90
|
-
import { DrawerContent } from "./components/drawer/content.js";
|
|
91
89
|
import { ViewStackEventNamespace, ViewStackEventTypes } from "./components/view-stack/events.js";
|
|
92
90
|
import { ViewStackBackEvent, ViewStackClearEvent, ViewStackContextValue, ViewStackEvent, ViewStackProps, ViewStackPushEvent, ViewStackResetEvent, ViewStackTriggerProps, ViewStackViewProps } from "./components/view-stack/types.js";
|
|
93
91
|
import { DrawerEventNamespace, DrawerEventTypes } from "./components/drawer/events.js";
|
|
94
|
-
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";
|
|
95
95
|
import { DrawerContext, DrawerEventHandlers, bus, useDrawerEmit } from "./components/drawer/context.js";
|
|
96
96
|
import { DrawerFooter } from "./components/drawer/footer.js";
|
|
97
97
|
import { DrawerHeaderTitle } from "./components/drawer/header-title.js";
|
|
@@ -274,4 +274,4 @@ import { useTreeState } from "./hooks/use-tree/state/index.js";
|
|
|
274
274
|
import { isSlottedContextValue } from "./lib/utils.js";
|
|
275
275
|
import { PortalProvider } from "./providers/portal.js";
|
|
276
276
|
import { ThemeMode, ThemeProvider, useTheme } from "./providers/theme-provider.js";
|
|
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, 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, 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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -71,7 +71,6 @@ import { DialogTrigger } from "./components/dialog/trigger.js";
|
|
|
71
71
|
import { Popover } from "./components/popover/index.js";
|
|
72
72
|
import { PopoverContent } from "./components/popover/content.js";
|
|
73
73
|
import { PopoverTitle } from "./components/popover/title.js";
|
|
74
|
-
import { PopoverTrigger } from "./components/popover/trigger.js";
|
|
75
74
|
import { Radio } from "./components/radio/index.js";
|
|
76
75
|
import { RadioContext } from "./components/radio/context.js";
|
|
77
76
|
import { RadioGroup } from "./components/radio/group.js";
|
|
@@ -177,6 +176,7 @@ import { PaginationPages } from "./components/pagination/pages.js";
|
|
|
177
176
|
import { PaginationPrev } from "./components/pagination/prev.js";
|
|
178
177
|
import { Pagination } from "./components/pagination/index.js";
|
|
179
178
|
import { PopoverFooter } from "./components/popover/footer.js";
|
|
179
|
+
import { PopoverTrigger } from "./components/popover/trigger.js";
|
|
180
180
|
import { CloneAction, LockAction, RemoveRuleAction } from "./components/query-builder/actions.js";
|
|
181
181
|
import { CombinatorSelector } from "./components/query-builder/combinator-selector.js";
|
|
182
182
|
import { SwitchContext, SwitchProvider } from "./components/switch/context.js";
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -16,35 +16,52 @@ import { AriaAttributes as AriaAttributes$1, AriaRole, CSSProperties, PropsWithC
|
|
|
16
16
|
/**
|
|
17
17
|
* Re-export due to not being exported by library
|
|
18
18
|
*/
|
|
19
|
+
/** Render props with optional default className merged with generic state */
|
|
19
20
|
type ClassNameRenderProps<T extends object> = T & {
|
|
21
|
+
/** Optional default CSS class name */
|
|
20
22
|
defaultClassName?: string;
|
|
21
23
|
};
|
|
24
|
+
/** CSS class name as string or render function receiving component state */
|
|
22
25
|
type RenderPropsClassName<T extends object> = string | ((values: ClassNameRenderProps<T>) => string);
|
|
26
|
+
/** Render props with optional default style merged with generic state */
|
|
23
27
|
type StylePropRenderProps<T extends object> = T & {
|
|
28
|
+
/** Optional default inline styles */
|
|
24
29
|
defaultStyle?: CSSProperties;
|
|
25
30
|
};
|
|
31
|
+
/** Inline styles as CSSProperties or render function receiving component state */
|
|
26
32
|
type RenderPropsStyle<T extends object> = CSSProperties | ((values: StylePropRenderProps<T>) => CSSProperties);
|
|
33
|
+
/** Render props with optional default children merged with generic state */
|
|
27
34
|
type ChildrenRenderProps<T extends object> = T & {
|
|
35
|
+
/** Optional default children content */
|
|
28
36
|
defaultChildren?: ReactNode;
|
|
29
37
|
};
|
|
38
|
+
/** Children as ReactNode or render function receiving component state */
|
|
30
39
|
type RenderPropsChildren<T extends object> = ReactNode | ((values: ChildrenRenderProps<T>) => ReactNode);
|
|
40
|
+
/** Props for className and style that accept render functions */
|
|
31
41
|
type StyleRenderProps<T extends object> = {
|
|
32
42
|
/** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */
|
|
33
43
|
className?: RenderPropsClassName<T>;
|
|
34
44
|
/** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state. */
|
|
35
45
|
style?: RenderPropsStyle<T>;
|
|
36
46
|
};
|
|
47
|
+
/** Combined render props for className, style, and children */
|
|
37
48
|
type RenderProps<T extends object> = StyleRenderProps<T> & {
|
|
38
49
|
/** The children of the component. A function may be provided to alter the children based on component state. */
|
|
39
50
|
children?: RenderPropsChildren<T>;
|
|
40
51
|
};
|
|
52
|
+
/** Container for slot-based context values */
|
|
41
53
|
type SlottedValue<T> = {
|
|
54
|
+
/** Map of slot names to their values */
|
|
42
55
|
slots?: Record<string | symbol, T>;
|
|
43
56
|
};
|
|
57
|
+
/** Props for context providers with slot support */
|
|
44
58
|
type ProviderProps<T> = PropsWithChildren<Omit<T, 'children' | 'slot'> & SlottedValue<T>>;
|
|
59
|
+
/** Extended ARIA attributes including role */
|
|
45
60
|
type AriaAttributes = AriaAttributes$1 & {
|
|
61
|
+
/** ARIA role for the element */
|
|
46
62
|
role?: AriaRole;
|
|
47
63
|
};
|
|
64
|
+
/** ARIA attributes combined with ref forwarding support */
|
|
48
65
|
type AriaAttributesWithRef<T> = AriaAttributes & RefAttributes<T>;
|
|
49
66
|
//#endregion
|
|
50
67
|
export { AriaAttributes, AriaAttributesWithRef, ChildrenRenderProps, ClassNameRenderProps, ProviderProps, RenderProps, RenderPropsChildren, RenderPropsClassName, RenderPropsStyle, SlottedValue, StylePropRenderProps, StyleRenderProps };
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -22,6 +22,21 @@ interface SlottedValue<T> {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* A helper to narrow the type of Context Value
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* function ComponentWithContext({ context }: { context: ContextValue<Props, HTMLElement> }) {
|
|
29
|
+
* if (isSlottedContextValue(context)) {
|
|
30
|
+
* // TypeScript knows context has 'slots' property
|
|
31
|
+
* const slotValue = context.slots?.['header'];
|
|
32
|
+
* return <div>{slotValue && 'Has header slot'}</div>;
|
|
33
|
+
* }
|
|
34
|
+
* return <div>No slots</div>;
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @param context - The context value to check.
|
|
39
|
+
* @returns True if the context contains slot definitions.
|
|
25
40
|
*/
|
|
26
41
|
declare function isSlottedContextValue<T, E>(context: ContextValue<T, E>): context is SlottedValue<WithRef<T, E>>;
|
|
27
42
|
//#endregion
|
package/dist/lib/utils.js
CHANGED
|
@@ -14,6 +14,21 @@
|
|
|
14
14
|
//#region src/lib/utils.ts
|
|
15
15
|
/**
|
|
16
16
|
* A helper to narrow the type of Context Value
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* function ComponentWithContext({ context }: { context: ContextValue<Props, HTMLElement> }) {
|
|
21
|
+
* if (isSlottedContextValue(context)) {
|
|
22
|
+
* // TypeScript knows context has 'slots' property
|
|
23
|
+
* const slotValue = context.slots?.['header'];
|
|
24
|
+
* return <div>{slotValue && 'Has header slot'}</div>;
|
|
25
|
+
* }
|
|
26
|
+
* return <div>No slots</div>;
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param context - The context value to check.
|
|
31
|
+
* @returns True if the context contains slot definitions.
|
|
17
32
|
*/
|
|
18
33
|
function isSlottedContextValue(context) {
|
|
19
34
|
return !!context && "slots" in context;
|
package/dist/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.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 type { ForwardedRef } from 'react';\nimport type { ContextValue } from 'react-aria-components';\n\n// Types copied from RAC due to not being exported\ntype WithRef<T, E> = T & {\n ref?: ForwardedRef<E>;\n};\n\ninterface SlottedValue<T> {\n slots?: Record<string | symbol, T>;\n}\n\n/**\n * A helper to narrow the type of Context Value\n */\nexport function isSlottedContextValue<T, E>(\n context: ContextValue<T, E>,\n): context is SlottedValue<WithRef<T, E>> {\n return !!context && 'slots' in context;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/lib/utils.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 type { ForwardedRef } from 'react';\nimport type { ContextValue } from 'react-aria-components';\n\n// Types copied from RAC due to not being exported\ntype WithRef<T, E> = T & {\n ref?: ForwardedRef<E>;\n};\n\ninterface SlottedValue<T> {\n slots?: Record<string | symbol, T>;\n}\n\n/**\n * A helper to narrow the type of Context Value\n *\n * @example\n * ```tsx\n * function ComponentWithContext({ context }: { context: ContextValue<Props, HTMLElement> }) {\n * if (isSlottedContextValue(context)) {\n * // TypeScript knows context has 'slots' property\n * const slotValue = context.slots?.['header'];\n * return <div>{slotValue && 'Has header slot'}</div>;\n * }\n * return <div>No slots</div>;\n * }\n * ```\n *\n * @param context - The context value to check.\n * @returns True if the context contains slot definitions.\n */\nexport function isSlottedContextValue<T, E>(\n context: ContextValue<T, E>,\n): context is SlottedValue<WithRef<T, E>> {\n return !!context && 'slots' in context;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,sBACd,SACwC;AACxC,QAAO,CAAC,CAAC,WAAW,WAAW"}
|
|
@@ -11,9 +11,18 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { PropsWithChildren, RefObject } from "react";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
15
15
|
|
|
16
16
|
//#region src/providers/portal.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Provides a portal container for rendering overlays and modals
|
|
19
|
+
*
|
|
20
|
+
* @param props - Component props.
|
|
21
|
+
* @param props.parentRef - Optional ref to parent element for portal attachment.
|
|
22
|
+
* @param props.inject - Optional element to inject as portal container.
|
|
23
|
+
* @param props.children - Content to render within the portal context.
|
|
24
|
+
* @returns The portal provider wrapping children.
|
|
25
|
+
*/
|
|
17
26
|
declare function PortalProvider({
|
|
18
27
|
parentRef,
|
|
19
28
|
inject,
|
|
@@ -21,7 +30,7 @@ declare function PortalProvider({
|
|
|
21
30
|
}: PropsWithChildren<{
|
|
22
31
|
parentRef?: RefObject<HTMLElement | null>;
|
|
23
32
|
inject?: HTMLElement | null;
|
|
24
|
-
}>):
|
|
33
|
+
}>): react_jsx_runtime9.JSX.Element;
|
|
25
34
|
//#endregion
|
|
26
35
|
export { PortalProvider };
|
|
27
36
|
//# sourceMappingURL=portal.d.ts.map
|
package/dist/providers/portal.js
CHANGED
|
@@ -17,6 +17,15 @@ import { UNSAFE_PortalProvider } from "@react-aria/overlays";
|
|
|
17
17
|
import { useIsSSR } from "@react-aria/ssr";
|
|
18
18
|
|
|
19
19
|
//#region src/providers/portal.tsx
|
|
20
|
+
/**
|
|
21
|
+
* Provides a portal container for rendering overlays and modals
|
|
22
|
+
*
|
|
23
|
+
* @param props - Component props.
|
|
24
|
+
* @param props.parentRef - Optional ref to parent element for portal attachment.
|
|
25
|
+
* @param props.inject - Optional element to inject as portal container.
|
|
26
|
+
* @param props.children - Content to render within the portal context.
|
|
27
|
+
* @returns The portal provider wrapping children.
|
|
28
|
+
*/
|
|
20
29
|
function PortalProvider({ parentRef, inject, children }) {
|
|
21
30
|
const isSSR = useIsSSR();
|
|
22
31
|
const [portal, setPortal] = useState(isSSR ? null : document.body);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","names":[],"sources":["../../src/providers/portal.tsx"],"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 { UNSAFE_PortalProvider } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport {\n type PropsWithChildren,\n type RefObject,\n useEffect,\n useState,\n} from 'react';\n\nexport function PortalProvider({\n parentRef,\n inject,\n children,\n}: PropsWithChildren<{\n parentRef?: RefObject<HTMLElement | null>;\n inject?: HTMLElement | null;\n}>) {\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n useEffect(() => {\n const node = parentRef?.current;\n // TODO: Ensure proper ssr hydration\n const port = isSSR ? null : inject;\n\n if (node && port) {\n node.appendChild(port);\n\n setPortal(port);\n } else if (node) {\n setPortal(node);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef, inject]);\n\n return (\n <UNSAFE_PortalProvider getContainer={() => portal}>\n {children}\n </UNSAFE_PortalProvider>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"portal.js","names":[],"sources":["../../src/providers/portal.tsx"],"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 { UNSAFE_PortalProvider } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport {\n type PropsWithChildren,\n type RefObject,\n useEffect,\n useState,\n} from 'react';\n\n/**\n * Provides a portal container for rendering overlays and modals\n *\n * @param props - Component props.\n * @param props.parentRef - Optional ref to parent element for portal attachment.\n * @param props.inject - Optional element to inject as portal container.\n * @param props.children - Content to render within the portal context.\n * @returns The portal provider wrapping children.\n */\nexport function PortalProvider({\n parentRef,\n inject,\n children,\n}: PropsWithChildren<{\n parentRef?: RefObject<HTMLElement | null>;\n inject?: HTMLElement | null;\n}>) {\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n useEffect(() => {\n const node = parentRef?.current;\n // TODO: Ensure proper ssr hydration\n const port = isSSR ? null : inject;\n\n if (node && port) {\n node.appendChild(port);\n\n setPortal(port);\n } else if (node) {\n setPortal(node);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef, inject]);\n\n return (\n <UNSAFE_PortalProvider getContainer={() => portal}>\n {children}\n </UNSAFE_PortalProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,eAAe,EAC7B,WACA,QACA,YAIE;CACF,MAAM,QAAQ,UAAU;CACxB,MAAM,CAAC,QAAQ,aAAa,SAAS,QAAQ,OAAO,SAAS,KAAK;AAElE,iBAAgB;EACd,MAAM,OAAO,WAAW;EAExB,MAAM,OAAO,QAAQ,OAAO;AAE5B,MAAI,QAAQ,MAAM;AAChB,QAAK,YAAY,KAAK;AAEtB,aAAU,KAAK;aACN,KACT,WAAU,KAAK;AAGjB,eAAa;AACX,SAAM,QAAQ;AAEd,aAAU,QAAQ,OAAO,SAAS,KAAK;;IAExC;EAAC;EAAO;EAAW;EAAO,CAAC;AAE9B,QACE,oBAAC;EAAsB,oBAAoB;EACxC;GACqB"}
|