@accelint/design-toolkit 9.9.2 → 9.10.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 +2 -2
- package/dist/components/accordion/group.d.ts +2 -2
- package/dist/components/accordion/header.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/styles.module.css +19 -3
- package/dist/components/accordion/trigger.d.ts +2 -2
- package/dist/components/action-bar/index.d.ts +2 -2
- package/dist/components/audio/index.d.ts +2 -2
- package/dist/components/avatar/context.d.ts +4 -4
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/context.d.ts +4 -4
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/breadcrumbs/index.d.ts +2 -2
- package/dist/components/breadcrumbs/item.d.ts +2 -2
- package/dist/components/button/context.d.ts +8 -8
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/link.d.ts +2 -2
- package/dist/components/button/styles.module.css +16 -0
- package/dist/components/button/toggle.d.ts +2 -2
- package/dist/components/carousel/context.d.ts +40 -0
- package/dist/components/carousel/context.js +55 -0
- package/dist/components/carousel/context.js.map +1 -0
- package/dist/components/carousel/gallery.d.ts +38 -0
- package/dist/components/carousel/gallery.js +84 -0
- package/dist/components/carousel/gallery.js.map +1 -0
- package/dist/components/carousel/index.d.ts +56 -0
- package/dist/components/carousel/index.js +66 -0
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/components/carousel/navigation.d.ts +51 -0
- package/dist/components/carousel/navigation.js +82 -0
- package/dist/components/carousel/navigation.js.map +1 -0
- package/dist/components/carousel/position.d.ts +33 -0
- package/dist/components/carousel/position.js +48 -0
- package/dist/components/carousel/position.js.map +1 -0
- package/dist/components/carousel/select.d.ts +38 -0
- package/dist/components/carousel/select.js +69 -0
- package/dist/components/carousel/select.js.map +1 -0
- package/dist/components/carousel/style.module.css +62 -0
- package/dist/components/carousel/types.d.ts +87 -0
- package/dist/components/carousel/types.js +12 -0
- package/dist/components/carousel/viewer.d.ts +40 -0
- package/dist/components/carousel/viewer.js +75 -0
- package/dist/components/carousel/viewer.js.map +1 -0
- package/dist/components/checkbox/context.d.ts +3 -3
- package/dist/components/checkbox/group.d.ts +2 -2
- package/dist/components/checkbox/group.js +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/chip/context.d.ts +4 -4
- package/dist/components/chip/deletable.d.ts +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/list.d.ts +4 -4
- package/dist/components/chip/selectable.d.ts +2 -2
- package/dist/components/classification-badge/context.d.ts +4 -4
- package/dist/components/classification-badge/index.d.ts +2 -2
- package/dist/components/classification-banner/context.d.ts +4 -4
- package/dist/components/classification-banner/index.d.ts +2 -2
- package/dist/components/clock/index.d.ts +2 -2
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/combobox-field/context.d.ts +4 -4
- package/dist/components/combobox-field/index.d.ts +2 -2
- package/dist/components/combobox-field/index.js +1 -1
- package/dist/components/combobox-field/styles.module.css +12 -0
- package/dist/components/coordinate-field/context.d.ts +6 -6
- package/dist/components/coordinate-field/index.d.ts +2 -2
- package/dist/components/coordinate-field/segment.d.ts +2 -2
- package/dist/components/date-field/index.d.ts +2 -2
- package/dist/components/deferred-collection/index.d.ts +2 -2
- package/dist/components/details-list/context.d.ts +4 -4
- package/dist/components/details-list/index.d.ts +2 -2
- package/dist/components/details-list/label.d.ts +2 -2
- package/dist/components/details-list/value.d.ts +2 -2
- package/dist/components/dialog/content.d.ts +2 -2
- package/dist/components/dialog/context.d.ts +2 -2
- package/dist/components/dialog/footer.d.ts +2 -2
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/styles.module.css +23 -0
- package/dist/components/dialog/title.d.ts +2 -2
- package/dist/components/divider/context.d.ts +4 -4
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/drawer/back.d.ts +2 -2
- package/dist/components/drawer/close.d.ts +2 -2
- package/dist/components/drawer/content.d.ts +2 -2
- package/dist/components/drawer/context.d.ts +2 -2
- package/dist/components/drawer/footer.d.ts +2 -2
- package/dist/components/drawer/header-title.d.ts +2 -2
- package/dist/components/drawer/header.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/layout-main.d.ts +2 -2
- package/dist/components/drawer/layout.d.ts +2 -2
- package/dist/components/drawer/menu-item.d.ts +2 -2
- package/dist/components/drawer/menu.d.ts +2 -2
- package/dist/components/drawer/panel.d.ts +2 -2
- package/dist/components/drawer/styles.module.css +54 -2
- package/dist/components/drawer/trigger.d.ts +2 -2
- package/dist/components/drawer/view.d.ts +2 -2
- package/dist/components/flashcard/index.d.ts +9 -9
- package/dist/components/floating-card/context.d.ts +37 -5
- package/dist/components/floating-card/context.js +18 -3
- package/dist/components/floating-card/context.js.map +1 -1
- package/dist/components/floating-card/index.d.ts +51 -1
- package/dist/components/floating-card/index.js +41 -11
- package/dist/components/floating-card/index.js.map +1 -1
- package/dist/components/floating-card/provider.d.ts +94 -17
- package/dist/components/floating-card/provider.js +116 -20
- package/dist/components/floating-card/provider.js.map +1 -1
- package/dist/components/floating-card/styles.module.css +5 -0
- package/dist/components/gantt/components/base-elements/point.d.ts +28 -0
- package/dist/components/gantt/components/base-elements/point.js +44 -0
- package/dist/components/gantt/components/base-elements/point.js.map +1 -0
- package/dist/components/gantt/components/base-elements/range.d.ts +30 -0
- package/dist/components/gantt/components/base-elements/range.js +51 -0
- package/dist/components/gantt/components/base-elements/range.js.map +1 -0
- package/dist/components/gantt/components/base-elements/use-point-element-layout/index.d.ts +12 -0
- package/dist/components/gantt/components/base-elements/use-point-element-layout/index.js +42 -0
- package/dist/components/gantt/components/base-elements/use-point-element-layout/index.js.map +1 -0
- package/dist/components/gantt/components/base-elements/use-range-element-layout/index.d.ts +23 -0
- package/dist/components/gantt/components/base-elements/use-range-element-layout/index.js +50 -0
- package/dist/components/gantt/components/base-elements/use-range-element-layout/index.js.map +1 -0
- package/dist/components/gantt/components/containers/external/gantt-content-container/index.d.ts +23 -0
- package/dist/components/gantt/components/containers/external/gantt-content-container/index.js +40 -0
- package/dist/components/gantt/components/containers/external/gantt-content-container/index.js.map +1 -0
- package/dist/components/gantt/components/containers/external/gantt-panel-container/index.d.ts +23 -0
- package/dist/components/gantt/components/containers/external/gantt-panel-container/index.js +33 -0
- package/dist/components/gantt/components/containers/external/gantt-panel-container/index.js.map +1 -0
- package/dist/components/gantt/components/containers/external/styles.module.css +32 -0
- package/dist/components/gantt/components/containers/internal/index.d.ts +22 -0
- package/dist/components/gantt/components/containers/internal/index.js +35 -0
- package/dist/components/gantt/components/containers/internal/index.js.map +1 -0
- package/dist/components/gantt/components/containers/internal/layout-container/index.d.ts +22 -0
- package/dist/components/gantt/components/containers/internal/layout-container/index.js +27 -0
- package/dist/components/gantt/components/containers/internal/layout-container/index.js.map +1 -0
- package/dist/components/gantt/components/containers/internal/styles.module.css +35 -0
- package/dist/components/gantt/components/containers/internal/virtualized-content-height-container/index.d.ts +22 -0
- package/dist/components/gantt/components/containers/internal/virtualized-content-height-container/index.js +38 -0
- package/dist/components/gantt/components/containers/internal/virtualized-content-height-container/index.js.map +1 -0
- package/dist/components/gantt/components/content-row/block.d.ts +27 -0
- package/dist/components/gantt/components/content-row/block.js +39 -0
- package/dist/components/gantt/components/content-row/block.js.map +1 -0
- package/dist/components/gantt/components/content-row/bracket.d.ts +23 -0
- package/dist/components/gantt/components/content-row/bracket.js +48 -0
- package/dist/components/gantt/components/content-row/bracket.js.map +1 -0
- package/dist/components/gantt/components/content-row/icon-marker.d.ts +27 -0
- package/dist/components/gantt/components/content-row/icon-marker.js +41 -0
- package/dist/components/gantt/components/content-row/icon-marker.js.map +1 -0
- package/dist/components/gantt/components/content-row/index.d.ts +24 -0
- package/dist/components/gantt/components/content-row/index.js +32 -0
- package/dist/components/gantt/components/content-row/index.js.map +1 -0
- package/dist/components/gantt/components/content-row/marker.d.ts +21 -0
- package/dist/components/gantt/components/content-row/marker.js +35 -0
- package/dist/components/gantt/components/content-row/marker.js.map +1 -0
- package/dist/components/gantt/components/content-row/spacer.d.ts +23 -0
- package/dist/components/gantt/components/content-row/spacer.js +35 -0
- package/dist/components/gantt/components/content-row/spacer.js.map +1 -0
- package/dist/components/gantt/components/content-row/styles.module.css +198 -0
- package/dist/components/gantt/components/content-row/use-elapsed-percentage/index.d.ts +19 -0
- package/dist/components/gantt/components/content-row/use-elapsed-percentage/index.js +27 -0
- package/dist/components/gantt/components/content-row/use-elapsed-percentage/index.js.map +1 -0
- package/dist/components/gantt/components/content-row/use-is-elapsed/index.d.ts +10 -0
- package/dist/components/gantt/components/content-row/use-is-elapsed/index.js +24 -0
- package/dist/components/gantt/components/content-row/use-is-elapsed/index.js.map +1 -0
- package/dist/components/gantt/components/current-time/index.d.ts +28 -0
- package/dist/components/gantt/components/current-time/index.js +63 -0
- package/dist/components/gantt/components/current-time/index.js.map +1 -0
- package/dist/components/gantt/components/current-time/styles.module.css +42 -0
- package/dist/components/gantt/components/current-time/use-current-time-layout/index.d.ts +31 -0
- package/dist/components/gantt/components/current-time/use-current-time-layout/index.js +58 -0
- package/dist/components/gantt/components/current-time/use-current-time-layout/index.js.map +1 -0
- package/dist/components/gantt/components/header/index.d.ts +25 -0
- package/dist/components/gantt/components/header/index.js +41 -0
- package/dist/components/gantt/components/header/index.js.map +1 -0
- package/dist/components/gantt/components/header/styles.module.css +23 -0
- package/dist/components/gantt/components/panel-row/index.d.ts +24 -0
- package/dist/components/gantt/components/panel-row/index.js +33 -0
- package/dist/components/gantt/components/panel-row/index.js.map +1 -0
- package/dist/components/gantt/components/panel-row/styles.module.css +24 -0
- package/dist/components/gantt/components/rows-virtualizer/index.d.ts +25 -0
- package/dist/components/gantt/components/rows-virtualizer/index.js +67 -0
- package/dist/components/gantt/components/rows-virtualizer/index.js.map +1 -0
- package/dist/components/gantt/components/rows-virtualizer/styles.module.css +30 -0
- package/dist/components/gantt/components/rows-virtualizer/use-rendered-rows/index.d.ts +29 -0
- package/dist/components/gantt/components/rows-virtualizer/use-rendered-rows/index.js +57 -0
- package/dist/components/gantt/components/rows-virtualizer/use-rendered-rows/index.js.map +1 -0
- package/dist/components/gantt/components/rows-virtualizer/use-scroll-sync/index.d.ts +10 -0
- package/dist/components/gantt/components/rows-virtualizer/use-scroll-sync/index.js +58 -0
- package/dist/components/gantt/components/rows-virtualizer/use-scroll-sync/index.js.map +1 -0
- package/dist/components/gantt/components/styles.module.css +46 -0
- package/dist/components/gantt/components/timeline/index.d.ts +19 -0
- package/dist/components/gantt/components/timeline/index.js +45 -0
- package/dist/components/gantt/components/timeline/index.js.map +1 -0
- package/dist/components/gantt/components/timeline/use-timeline-transform/index.d.ts +29 -0
- package/dist/components/gantt/components/timeline/use-timeline-transform/index.js +33 -0
- package/dist/components/gantt/components/timeline/use-timeline-transform/index.js.map +1 -0
- package/dist/components/gantt/components/timeline-chunk/index.d.ts +25 -0
- package/dist/components/gantt/components/timeline-chunk/index.js +43 -0
- package/dist/components/gantt/components/timeline-chunk/index.js.map +1 -0
- package/dist/components/gantt/constants.d.ts +31 -0
- package/dist/components/gantt/constants.js +57 -0
- package/dist/components/gantt/constants.js.map +1 -0
- package/dist/components/gantt/context/index.d.ts +60 -0
- package/dist/components/gantt/context/index.js +78 -0
- package/dist/components/gantt/context/index.js.map +1 -0
- package/dist/components/gantt/context/store/index.d.ts +45 -0
- package/dist/components/gantt/context/store/index.js +42 -0
- package/dist/components/gantt/context/store/index.js.map +1 -0
- package/dist/components/gantt/context/temporal-data/index.d.ts +48 -0
- package/dist/components/gantt/context/temporal-data/index.js +80 -0
- package/dist/components/gantt/context/temporal-data/index.js.map +1 -0
- package/dist/components/gantt/gantt.d.ts +50 -0
- package/dist/components/gantt/gantt.js +51 -0
- package/dist/components/gantt/gantt.js.map +1 -0
- package/dist/components/gantt/hooks/use-horizontal-scroll-update/index.d.ts +22 -0
- package/dist/components/gantt/hooks/use-horizontal-scroll-update/index.js +36 -0
- package/dist/components/gantt/hooks/use-horizontal-scroll-update/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-layout-subscription/index.d.ts +26 -0
- package/dist/components/gantt/hooks/use-layout-subscription/index.js +45 -0
- package/dist/components/gantt/hooks/use-layout-subscription/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-resize-intersection-effect/index.d.ts +26 -0
- package/dist/components/gantt/hooks/use-resize-intersection-effect/index.js +50 -0
- package/dist/components/gantt/hooks/use-resize-intersection-effect/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-root-element-height/index.d.ts +5 -0
- package/dist/components/gantt/hooks/use-root-element-height/index.js +24 -0
- package/dist/components/gantt/hooks/use-root-element-height/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-scrollbar-height/index.d.ts +5 -0
- package/dist/components/gantt/hooks/use-scrollbar-height/index.js +40 -0
- package/dist/components/gantt/hooks/use-scrollbar-height/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-total-data-region-thresholds/index.d.ts +19 -0
- package/dist/components/gantt/hooks/use-total-data-region-thresholds/index.js +87 -0
- package/dist/components/gantt/hooks/use-total-data-region-thresholds/index.js.map +1 -0
- package/dist/components/gantt/hooks/use-vertical-scroll-update/index.d.ts +22 -0
- package/dist/components/gantt/hooks/use-vertical-scroll-update/index.js +38 -0
- package/dist/components/gantt/hooks/use-vertical-scroll-update/index.js.map +1 -0
- package/dist/components/gantt/public-types.d.ts +31 -0
- package/dist/components/gantt/public-types.js +12 -0
- package/dist/components/gantt/store.d.ts +51 -0
- package/dist/components/gantt/store.js +46 -0
- package/dist/components/gantt/store.js.map +1 -0
- package/dist/components/gantt/styles.module.css +30 -0
- package/dist/components/gantt/types.d.ts +67 -0
- package/dist/components/gantt/types.js +12 -0
- package/dist/components/gantt/utils/conversions.d.ts +23 -0
- package/dist/components/gantt/utils/conversions.js +34 -0
- package/dist/components/gantt/utils/conversions.js.map +1 -0
- package/dist/components/gantt/utils/dates.d.ts +11 -0
- package/dist/components/gantt/utils/dates.js +41 -0
- package/dist/components/gantt/utils/dates.js.map +1 -0
- package/dist/components/gantt/utils/formatting.d.ts +5 -0
- package/dist/components/gantt/utils/formatting.js +54 -0
- package/dist/components/gantt/utils/formatting.js.map +1 -0
- package/dist/components/gantt/utils/generation.d.ts +19 -0
- package/dist/components/gantt/utils/generation.js +37 -0
- package/dist/components/gantt/utils/generation.js.map +1 -0
- package/dist/components/gantt/utils/helpers.d.ts +26 -0
- package/dist/components/gantt/utils/helpers.js +55 -0
- package/dist/components/gantt/utils/helpers.js.map +1 -0
- package/dist/components/gantt/utils/layout.d.ts +32 -0
- package/dist/components/gantt/utils/layout.js +55 -0
- package/dist/components/gantt/utils/layout.js.map +1 -0
- package/dist/components/gantt/utils/thresholds.d.ts +52 -0
- package/dist/components/gantt/utils/thresholds.js +116 -0
- package/dist/components/gantt/utils/thresholds.js.map +1 -0
- package/dist/components/hero/context.d.ts +2 -2
- package/dist/components/hero/index.d.ts +2 -2
- package/dist/components/hero/subtitle.d.ts +2 -2
- package/dist/components/hero/title.d.ts +2 -2
- package/dist/components/hotkey/context.d.ts +4 -4
- package/dist/components/hotkey/index.d.ts +2 -2
- package/dist/components/hotkey/set.d.ts +2 -2
- package/dist/components/icon/context.d.ts +4 -4
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/input/context.d.ts +2 -2
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/kanban/card-body.d.ts +2 -2
- package/dist/components/kanban/card-header-actions.d.ts +2 -2
- package/dist/components/kanban/card-header-title.d.ts +2 -2
- package/dist/components/kanban/card-header.d.ts +2 -2
- package/dist/components/kanban/card.d.ts +2 -2
- package/dist/components/kanban/column-actions.d.ts +2 -2
- package/dist/components/kanban/column-container.d.ts +2 -2
- package/dist/components/kanban/column-content.d.ts +2 -2
- package/dist/components/kanban/column-header-actions.d.ts +2 -2
- package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
- package/dist/components/kanban/column-header-title.d.ts +2 -2
- package/dist/components/kanban/column-header.d.ts +2 -2
- package/dist/components/kanban/column.d.ts +2 -2
- package/dist/components/kanban/context.d.ts +2 -2
- package/dist/components/kanban/header-actions.d.ts +2 -2
- package/dist/components/kanban/header-search.d.ts +2 -2
- package/dist/components/kanban/header-title.d.ts +2 -2
- package/dist/components/kanban/header.d.ts +2 -2
- package/dist/components/kanban/kanban.d.ts +4 -4
- package/dist/components/label/context.d.ts +4 -4
- package/dist/components/label/index.d.ts +2 -2
- package/dist/components/lines/index.d.ts +2 -2
- package/dist/components/link/context.d.ts +2 -2
- package/dist/components/link/index.d.ts +2 -2
- package/dist/components/list/context.d.ts +2 -2
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/item-content.d.ts +2 -2
- package/dist/components/list/item-description.d.ts +2 -2
- package/dist/components/list/item-title.d.ts +2 -2
- package/dist/components/list/item.d.ts +2 -2
- package/dist/components/media-controls/context.d.ts +4 -4
- package/dist/components/media-controls/fullscreen-button.d.ts +2 -2
- package/dist/components/media-controls/index.d.ts +2 -2
- package/dist/components/media-controls/mute-button.d.ts +2 -2
- package/dist/components/media-controls/play-button.d.ts +2 -2
- package/dist/components/media-controls/playback-rate.d.ts +2 -2
- package/dist/components/media-controls/seek-button.d.ts +2 -2
- package/dist/components/media-controls/time-display.d.ts +2 -2
- package/dist/components/media-controls/time-range.d.ts +2 -2
- package/dist/components/media-controls/volume-slider.d.ts +2 -2
- package/dist/components/menu/context.d.ts +2 -2
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/item-description.d.ts +2 -2
- package/dist/components/menu/item-label.d.ts +2 -2
- package/dist/components/menu/item.d.ts +2 -2
- package/dist/components/menu/section.d.ts +2 -2
- package/dist/components/menu/separator.d.ts +2 -2
- package/dist/components/menu/styles.module.css +12 -0
- package/dist/components/menu/submenu.d.ts +2 -2
- package/dist/components/notice/index.d.ts +2 -2
- package/dist/components/notice/index.js +1 -0
- package/dist/components/notice/index.js.map +1 -1
- package/dist/components/notice/list.d.ts +2 -2
- package/dist/components/notice/list.js +10 -1
- package/dist/components/notice/list.js.map +1 -1
- package/dist/components/notice/notice-icon.d.ts +2 -2
- package/dist/components/notice/styles.module.css +27 -0
- package/dist/components/options/context.d.ts +2 -2
- package/dist/components/options/index.d.ts +2 -2
- package/dist/components/options/item-content.d.ts +2 -2
- package/dist/components/options/item-description.d.ts +2 -2
- package/dist/components/options/item-label.d.ts +2 -2
- package/dist/components/options/item.d.ts +2 -2
- package/dist/components/options/section.d.ts +2 -2
- package/dist/components/pagination/context.d.ts +2 -2
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/next.d.ts +2 -2
- package/dist/components/pagination/pages.d.ts +2 -2
- package/dist/components/pagination/prev.d.ts +2 -2
- package/dist/components/popover/content.d.ts +2 -2
- package/dist/components/popover/footer.d.ts +2 -2
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/styles.module.css +34 -0
- package/dist/components/popover/title.d.ts +2 -2
- package/dist/components/popover/trigger.d.ts +2 -2
- package/dist/components/query-builder/action-element.d.ts +2 -2
- package/dist/components/query-builder/actions.d.ts +4 -4
- package/dist/components/query-builder/combinator-selector.d.ts +2 -2
- package/dist/components/query-builder/index.d.ts +2 -2
- package/dist/components/query-builder/rule-group.d.ts +4 -4
- package/dist/components/query-builder/rule.d.ts +2 -2
- package/dist/components/query-builder/value-editor.d.ts +2 -2
- package/dist/components/query-builder/value-selector.d.ts +2 -2
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/radio/context.d.ts +3 -3
- package/dist/components/radio/group.d.ts +2 -2
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/search-field/context.d.ts +4 -4
- package/dist/components/search-field/index.d.ts +2 -2
- package/dist/components/select-field/context.d.ts +4 -4
- package/dist/components/select-field/index.d.ts +2 -2
- package/dist/components/sidenav/avatar.d.ts +2 -2
- package/dist/components/sidenav/content.d.ts +2 -2
- package/dist/components/sidenav/context.d.ts +2 -2
- package/dist/components/sidenav/footer.d.ts +2 -2
- package/dist/components/sidenav/header.d.ts +2 -2
- package/dist/components/sidenav/index.d.ts +2 -2
- package/dist/components/sidenav/item.d.ts +2 -2
- package/dist/components/sidenav/link.d.ts +2 -2
- package/dist/components/sidenav/menu-item.d.ts +2 -2
- package/dist/components/sidenav/menu.d.ts +2 -2
- package/dist/components/sidenav/styles.module.css +10 -2
- package/dist/components/sidenav/trigger.d.ts +2 -2
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/status-indicator/index.d.ts +2 -2
- package/dist/components/switch/context.d.ts +4 -4
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/switch/styles.module.css +8 -0
- package/dist/components/table/body.d.ts +2 -2
- package/dist/components/table/cell.d.ts +2 -2
- package/dist/components/table/context.d.ts +2 -2
- package/dist/components/table/header-cell.d.ts +2 -2
- package/dist/components/table/header.d.ts +2 -2
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/index.js +2 -2
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/row.d.ts +2 -2
- package/dist/components/tabs/context.d.ts +6 -6
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/list.d.ts +2 -2
- package/dist/components/tabs/panel.d.ts +2 -2
- package/dist/components/tabs/tab.d.ts +2 -2
- package/dist/components/text-area-field/context.d.ts +4 -4
- package/dist/components/text-area-field/index.d.ts +2 -2
- package/dist/components/text-field/context.d.ts +4 -4
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/time-field/index.d.ts +2 -2
- package/dist/components/tooltip/context.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/styles.module.css +35 -0
- package/dist/components/tooltip/trigger.d.ts +2 -2
- package/dist/components/tree/context.d.ts +3 -3
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/index.js +20 -10
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/item-actions.d.ts +2 -2
- package/dist/components/tree/item-content.d.ts +2 -2
- package/dist/components/tree/item-content.js +3 -2
- package/dist/components/tree/item-content.js.map +1 -1
- package/dist/components/tree/item-description.d.ts +2 -2
- package/dist/components/tree/item-label.d.ts +2 -2
- package/dist/components/tree/item-prefix-icon.d.ts +2 -2
- package/dist/components/tree/item.d.ts +2 -2
- package/dist/components/tree/lines.d.ts +2 -2
- package/dist/components/tree/types.d.ts +1 -0
- package/dist/components/video/index.d.ts +2 -2
- package/dist/components/view-stack/index.d.ts +2 -2
- package/dist/components/view-stack/trigger.d.ts +2 -2
- package/dist/components/view-stack/view.d.ts +2 -2
- package/dist/hooks/use-tree/actions/cache.d.ts +20 -3
- package/dist/hooks/use-tree/actions/cache.js +110 -2
- package/dist/hooks/use-tree/actions/cache.js.map +1 -1
- package/dist/hooks/use-tree/actions/index.d.ts +2 -1
- package/dist/hooks/use-tree/actions/index.js +70 -11
- package/dist/hooks/use-tree/actions/index.js.map +1 -1
- package/dist/hooks/use-tree/state/index.d.ts +20 -1
- package/dist/hooks/use-tree/state/index.js +22 -2
- package/dist/hooks/use-tree/state/index.js.map +1 -1
- package/dist/hooks/use-tree/types.d.ts +14 -0
- package/dist/index.d.ts +24 -5
- package/dist/index.js +27 -10
- package/dist/providers/portal.d.ts +2 -2
- package/dist/providers/theme-provider.d.ts +2 -2
- package/package.json +64 -6
|
@@ -15,30 +15,45 @@ import { Icon } from "../icon/index.js";
|
|
|
15
15
|
import { Button } from "../button/index.js";
|
|
16
16
|
import { Divider } from "../divider/index.js";
|
|
17
17
|
import { FloatingCardContext, useFloatingCard } from "./context.js";
|
|
18
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
18
|
+
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
19
19
|
import { clsx } from "@accelint/design-foundation/lib/utils";
|
|
20
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import Cancel from "@accelint/icons/cancel";
|
|
22
|
+
import PinIcon from "@accelint/icons/pin";
|
|
22
23
|
import { DockviewReact } from "dockview-react";
|
|
23
24
|
import styles from "./styles.module.css";
|
|
24
25
|
|
|
25
26
|
//#region src/components/floating-card/provider.tsx
|
|
26
27
|
/**
|
|
27
28
|
* Internal component that registers a DOM ref for a card container.
|
|
28
|
-
*
|
|
29
|
+
*
|
|
30
|
+
* Used by the floating card engine to mount portal targets. Also manages
|
|
31
|
+
* the data-pinned attribute on the resize container to control drag handle visibility.
|
|
32
|
+
*
|
|
33
|
+
* @param props - Dockview panel props containing the card ID.
|
|
29
34
|
*/
|
|
30
35
|
function FloatingCardContainer(props) {
|
|
31
|
-
const { addRef } = useFloatingCard();
|
|
36
|
+
const { addRef, isPinned, subscribeToPinState } = useFloatingCard();
|
|
37
|
+
const cardId = props.api.id;
|
|
38
|
+
const pinned = useSyncExternalStore(subscribeToPinState, () => isPinned(cardId), () => false);
|
|
39
|
+
const cardRef = useRef(null);
|
|
32
40
|
const refCallback = useCallback((ref) => {
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
cardRef.current = ref;
|
|
42
|
+
addRef(cardId, ref);
|
|
43
|
+
}, [addRef, cardId]);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
const container = cardRef.current?.closest(".dv-resize-container");
|
|
46
|
+
if (!container) return;
|
|
47
|
+
if (pinned) container.dataset.pinned = "";
|
|
48
|
+
else delete container.dataset.pinned;
|
|
49
|
+
}, [pinned]);
|
|
35
50
|
return /* @__PURE__ */ jsx("div", {
|
|
36
51
|
className: styles.cardContent,
|
|
37
52
|
ref: refCallback
|
|
38
53
|
});
|
|
39
54
|
}
|
|
40
55
|
/**
|
|
41
|
-
* Default left header showing an optional custom icon
|
|
56
|
+
* Default left header showing an optional custom icon and the card's title.
|
|
42
57
|
*/
|
|
43
58
|
function DefaultLeftHeader({ title, icon, id }) {
|
|
44
59
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -52,14 +67,31 @@ function DefaultLeftHeader({ title, icon, id }) {
|
|
|
52
67
|
}) : null]
|
|
53
68
|
});
|
|
54
69
|
}
|
|
70
|
+
/** Stable no-op subscribe for useSyncExternalStore when no pin subscription is available. */
|
|
71
|
+
const noopSubscribe = () => () => void 0;
|
|
55
72
|
/**
|
|
56
73
|
* Default right header showing optional action buttons and an always-present close button.
|
|
74
|
+
*
|
|
75
|
+
* @remarks Handles rendering of 'divider' and 'pin' action types specially.
|
|
57
76
|
*/
|
|
58
|
-
function DefaultRightHeader({ closeGroup, headerActions, id }) {
|
|
77
|
+
function DefaultRightHeader({ closeGroup, headerActions, id, togglePinCard, isPinned, subscribeToPinState }) {
|
|
78
|
+
const pinned = useSyncExternalStore(subscribeToPinState ?? noopSubscribe, () => id && isPinned ? isPinned(id) : false, () => false);
|
|
59
79
|
return /* @__PURE__ */ jsxs("div", {
|
|
60
80
|
className: styles.headerSide,
|
|
61
81
|
children: [headerActions?.map((action, index) => {
|
|
62
82
|
if (action === "divider") return /* @__PURE__ */ jsx(Divider, { orientation: "vertical" }, `${id}-divider-${index}`);
|
|
83
|
+
if (action === "pin") return /* @__PURE__ */ jsx(Button, {
|
|
84
|
+
className: styles.pinButton,
|
|
85
|
+
variant: "icon",
|
|
86
|
+
size: "small",
|
|
87
|
+
color: pinned ? "accent" : void 0,
|
|
88
|
+
"aria-label": "Pin",
|
|
89
|
+
"aria-pressed": pinned,
|
|
90
|
+
onClick: () => {
|
|
91
|
+
if (id && togglePinCard) togglePinCard(id);
|
|
92
|
+
},
|
|
93
|
+
children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(PinIcon, {}) })
|
|
94
|
+
}, `${id}-pin-${index}`);
|
|
63
95
|
return /* @__PURE__ */ jsx(Button, {
|
|
64
96
|
variant: "icon",
|
|
65
97
|
size: "small",
|
|
@@ -75,7 +107,14 @@ function DefaultRightHeader({ closeGroup, headerActions, id }) {
|
|
|
75
107
|
});
|
|
76
108
|
}
|
|
77
109
|
/**
|
|
78
|
-
* Creates an adapter component to map Dockview's header action props to
|
|
110
|
+
* Creates an adapter component to map Dockview's header action props to custom header component props.
|
|
111
|
+
*
|
|
112
|
+
* Handles title change subscriptions and resolves MaybeFactory options (icon, headerActions)
|
|
113
|
+
* either as static values or by invoking factory functions with the active card ID.
|
|
114
|
+
*
|
|
115
|
+
* @param Component - The header component to wrap.
|
|
116
|
+
* @param options - Configuration options including icon and headerActions (static or factory).
|
|
117
|
+
* @returns Adapter component compatible with Dockview's header API.
|
|
79
118
|
*/
|
|
80
119
|
function createHeaderAdapter(Component, options) {
|
|
81
120
|
function HeaderAdapter(props) {
|
|
@@ -97,7 +136,10 @@ function createHeaderAdapter(Component, options) {
|
|
|
97
136
|
headerActions: typeof options?.headerActions === "function" ? options.headerActions(panelId) : options?.headerActions,
|
|
98
137
|
title,
|
|
99
138
|
id: props.activePanel?.id,
|
|
100
|
-
closeGroup: () => props.api.close()
|
|
139
|
+
closeGroup: () => props.api.close(),
|
|
140
|
+
togglePinCard: options.togglePinCard,
|
|
141
|
+
isPinned: options.isPinned,
|
|
142
|
+
subscribeToPinState: options.subscribeToPinState
|
|
101
143
|
});
|
|
102
144
|
}
|
|
103
145
|
HeaderAdapter.displayName = `HeaderAdapter(${Component.displayName ?? Component.name ?? "Anonymous"})`;
|
|
@@ -107,34 +149,72 @@ const components = { default: FloatingCardContainer };
|
|
|
107
149
|
/**
|
|
108
150
|
* Provides a context and layout area for floating cards within the application.
|
|
109
151
|
*
|
|
110
|
-
* Wraps
|
|
111
|
-
*
|
|
152
|
+
* Wraps children with floating card context and renders a Dockview instance to manage
|
|
153
|
+
* docking, dragging, and layout of floating cards.
|
|
112
154
|
*
|
|
113
155
|
* @param props - The props for the FloatingCardProvider component.
|
|
114
156
|
* @param props.children - Child components rendered inside the floating card provider.
|
|
115
|
-
* @param props.icon - Optional icon.
|
|
116
|
-
* @param props.headerActions - Optional
|
|
157
|
+
* @param props.icon - Optional icon rendered in all card headers (static or factory).
|
|
158
|
+
* @param props.headerActions - Optional action buttons for card headers (static or factory).
|
|
117
159
|
* @param props.className - Additional CSS class names for styling.
|
|
118
|
-
*
|
|
119
160
|
* @returns The FloatingCardProvider component that manages floating card layout and context.
|
|
120
161
|
*
|
|
121
162
|
* @remarks
|
|
122
|
-
* - Manages registration and
|
|
123
|
-
* - Exposes
|
|
124
|
-
* -
|
|
163
|
+
* - Manages registration and cleanup of floating card DOM references
|
|
164
|
+
* - Exposes closeCard, togglePinCard, and isPinned via context
|
|
165
|
+
* - Automatically cleans up refs when cards are removed via any path (drag close, group close, API close)
|
|
166
|
+
* - Cards are bounded within the viewport
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```tsx
|
|
170
|
+
* <FloatingCardProvider
|
|
171
|
+
* icon={<AppLogo />}
|
|
172
|
+
* headerActions={[
|
|
173
|
+
* { icon: <SettingsIcon />, onClick: openSettings },
|
|
174
|
+
* 'divider',
|
|
175
|
+
* 'pin'
|
|
176
|
+
* ]}
|
|
177
|
+
* >
|
|
178
|
+
* <FloatingCard id="panel-1" title="My Panel">
|
|
179
|
+
* <div>Panel content</div>
|
|
180
|
+
* </FloatingCard>
|
|
181
|
+
* </FloatingCardProvider>
|
|
182
|
+
* ```
|
|
125
183
|
*/
|
|
126
|
-
function FloatingCardProvider({ children, icon, headerActions, className }) {
|
|
184
|
+
function FloatingCardProvider({ children, icon, headerActions, initialPinned, className }) {
|
|
127
185
|
const [api, setApi] = useState(null);
|
|
128
186
|
const [cards, setCards] = useState({});
|
|
187
|
+
const pinnedCardsRef = useRef(new Set(initialPinned));
|
|
188
|
+
const pinListenersRef = useRef(/* @__PURE__ */ new Set());
|
|
129
189
|
const closeCard = useCallback((id) => {
|
|
130
190
|
api?.getPanel(id)?.api.close();
|
|
131
191
|
}, [api]);
|
|
192
|
+
const togglePinCard = useCallback((id) => {
|
|
193
|
+
const next = new Set(pinnedCardsRef.current);
|
|
194
|
+
if (next.has(id)) next.delete(id);
|
|
195
|
+
else next.add(id);
|
|
196
|
+
pinnedCardsRef.current = next;
|
|
197
|
+
for (const listener of pinListenersRef.current) listener();
|
|
198
|
+
}, []);
|
|
199
|
+
const isPinned = useCallback((id) => pinnedCardsRef.current.has(id), []);
|
|
200
|
+
const subscribeToPinState = useCallback((callback) => {
|
|
201
|
+
pinListenersRef.current.add(callback);
|
|
202
|
+
return () => {
|
|
203
|
+
pinListenersRef.current.delete(callback);
|
|
204
|
+
};
|
|
205
|
+
}, []);
|
|
132
206
|
const removeRef = useCallback((view) => {
|
|
133
207
|
setCards((prev) => {
|
|
134
208
|
const newCards = { ...prev };
|
|
135
209
|
delete newCards[view];
|
|
136
210
|
return newCards;
|
|
137
211
|
});
|
|
212
|
+
if (pinnedCardsRef.current.has(view)) {
|
|
213
|
+
const next = new Set(pinnedCardsRef.current);
|
|
214
|
+
next.delete(view);
|
|
215
|
+
pinnedCardsRef.current = next;
|
|
216
|
+
for (const listener of pinListenersRef.current) listener();
|
|
217
|
+
}
|
|
138
218
|
}, []);
|
|
139
219
|
const addRef = useCallback((id, ref) => {
|
|
140
220
|
if (ref) setCards((prev) => {
|
|
@@ -159,16 +239,32 @@ function FloatingCardProvider({ children, icon, headerActions, className }) {
|
|
|
159
239
|
addRef,
|
|
160
240
|
removeRef,
|
|
161
241
|
closeCard,
|
|
242
|
+
togglePinCard,
|
|
243
|
+
isPinned,
|
|
244
|
+
subscribeToPinState,
|
|
162
245
|
api
|
|
163
246
|
}), [
|
|
164
247
|
cards,
|
|
165
248
|
closeCard,
|
|
166
249
|
removeRef,
|
|
167
250
|
api,
|
|
168
|
-
addRef
|
|
251
|
+
addRef,
|
|
252
|
+
togglePinCard,
|
|
253
|
+
isPinned,
|
|
254
|
+
subscribeToPinState
|
|
169
255
|
]);
|
|
170
256
|
const leftAdapter = useMemo(() => createHeaderAdapter(DefaultLeftHeader, { icon }), [icon]);
|
|
171
|
-
const rightAdapter = useMemo(() => createHeaderAdapter(DefaultRightHeader, {
|
|
257
|
+
const rightAdapter = useMemo(() => createHeaderAdapter(DefaultRightHeader, {
|
|
258
|
+
headerActions,
|
|
259
|
+
togglePinCard,
|
|
260
|
+
isPinned,
|
|
261
|
+
subscribeToPinState
|
|
262
|
+
}), [
|
|
263
|
+
headerActions,
|
|
264
|
+
togglePinCard,
|
|
265
|
+
isPinned,
|
|
266
|
+
subscribeToPinState
|
|
267
|
+
]);
|
|
172
268
|
const theme = useMemo(() => ({
|
|
173
269
|
name: "accelint",
|
|
174
270
|
className: styles.floatingCardProvider ?? ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","names":["CloseIcon","components: Record<string, FunctionComponent<IDockviewPanelProps>>"],"sources":["../../../src/components/floating-card/provider.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport CloseIcon from '@accelint/icons/cancel';\nimport {\n type DockviewApi,\n DockviewReact,\n type DockviewReadyEvent,\n type IDockviewHeaderActionsProps,\n type IDockviewPanelProps,\n} from 'dockview-react';\nimport {\n type FunctionComponent,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState,\n} from 'react';\nimport { Button } from '../button';\nimport { Divider } from '../divider';\nimport { Icon } from '../icon';\nimport {\n FloatingCardContext,\n type FloatingCardContextValue,\n useFloatingCard,\n} from './context';\nimport styles from './styles.module.css';\nimport type { UniqueId } from '@accelint/core/utility/uuid';\n\n/** A value that is either `T` directly, or a function that receives the active card id and returns `T`. */\ntype MaybeFactory<T> = T | ((cardId: string) => T);\n\ntype FloatingCardHeaderProps = {\n id?: string;\n title?: string;\n icon?: ReactNode;\n closeGroup: () => void;\n headerActions?: (\n | {\n icon: ReactNode;\n onClick: () => void;\n }\n | 'divider'\n )[];\n};\n\n/**\n * Internal component that registers a DOM ref for a card container.\n * Used by the floating card engine to mount portal targets.\n */\nfunction FloatingCardContainer(props: Readonly<IDockviewPanelProps>) {\n const { addRef } = useFloatingCard();\n\n const refCallback = useCallback(\n (ref: HTMLDivElement | null) => {\n addRef(props.api.id as UniqueId, ref);\n },\n [addRef, props.api.id],\n );\n\n return <div className={styles.cardContent} ref={refCallback} />;\n}\n\n/**\n * Default left header showing an optional custom icon (or a placeholder) and the card's title.\n */\nfunction DefaultLeftHeader({\n title,\n icon,\n id,\n}: Readonly<FloatingCardHeaderProps>) {\n return (\n <div className={styles.headerSide}>\n {icon ? <Icon size='small'>{icon}</Icon> : null}\n {title && title !== id ? (\n <div className={styles.headerTitle}>{title}</div>\n ) : null}\n </div>\n );\n}\n\n/**\n * Default right header showing optional action buttons and an always-present close button.\n */\nfunction DefaultRightHeader({\n closeGroup,\n headerActions,\n id,\n}: Readonly<FloatingCardHeaderProps>) {\n return (\n <div className={styles.headerSide}>\n {headerActions?.map((action, index) => {\n if (action === 'divider') {\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here because the order of actions is unlikely to change.\n <Divider key={`${id}-divider-${index}`} orientation='vertical' />\n );\n }\n return (\n <Button\n key={`${id}-${\n // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here because the order of actions is unlikely to change.\n index\n }`}\n variant='icon'\n size='small'\n onClick={action.onClick}\n >\n <Icon>{action.icon}</Icon>\n </Button>\n );\n })}\n <Button variant='icon' size='small' onClick={closeGroup}>\n <Icon>\n <CloseIcon />\n </Icon>\n </Button>\n </div>\n );\n}\n\ntype HeaderAdapterOptions = {\n icon?: MaybeFactory<ReactNode>;\n headerActions?: MaybeFactory<FloatingCardHeaderProps['headerActions']>;\n};\n\n/**\n * Creates an adapter component to map Dockview's header action props to our custom header component props.\n */\nfunction createHeaderAdapter(\n Component: FunctionComponent<FloatingCardHeaderProps>,\n options?: HeaderAdapterOptions,\n): FunctionComponent<IDockviewHeaderActionsProps> {\n function HeaderAdapter(props: Readonly<IDockviewHeaderActionsProps>) {\n const panelId = props.panels[0]?.id ?? '';\n const [title, setTitle] = useState(props.activePanel?.title);\n\n useEffect(() => {\n const panel = props.activePanel;\n\n if (!panel) {\n return;\n }\n\n setTitle(panel.title);\n\n const disposable = panel.api.onDidTitleChange(() => {\n setTitle(panel.title);\n });\n\n return () => {\n disposable.dispose();\n };\n }, [props.activePanel]);\n const icon = props.activePanel\n ? typeof options?.icon === 'function'\n ? options.icon(panelId)\n : options?.icon\n : undefined;\n const headerActions =\n typeof options?.headerActions === 'function'\n ? options.headerActions(panelId)\n : options?.headerActions;\n return (\n <Component\n icon={icon}\n headerActions={headerActions}\n title={title}\n id={props.activePanel?.id}\n closeGroup={() => props.api.close()}\n />\n );\n }\n\n HeaderAdapter.displayName = `HeaderAdapter(${Component.displayName ?? Component.name ?? 'Anonymous'})`;\n return HeaderAdapter;\n}\n\nexport type FloatingCardProviderProps = Readonly<\n PropsWithChildren<{\n /**\n * Optional icon rendered at the very start of the floating card header.\n * Can be a `ReactNode` or a function `(cardId: string) => ReactNode`.\n */\n icon?: MaybeFactory<ReactNode>;\n /**\n * Optional action buttons rendered in the floating card header before the close button.\n * Can include dividers to separate groups of actions.\n * Can be an array or a function `(cardId: string) => array` to return\n * per-floating card actions.\n */\n headerActions?: MaybeFactory<\n (\n | {\n icon: ReactNode;\n onClick: () => void;\n }\n | 'divider'\n )[]\n >;\n className?: string;\n }>\n>;\n\nconst components: Record<string, FunctionComponent<IDockviewPanelProps>> = {\n default: FloatingCardContainer,\n};\n\n/**\n * Provides a context and layout area for floating cards within the application.\n *\n * Wraps its children with floating card context and renders a floating card engine instance\n * to manage docking and layout.\n *\n * @param props - The props for the FloatingCardProvider component.\n * @param props.children - Child components rendered inside the floating card provider.\n * @param props.icon - Optional icon.\n * @param props.headerActions - Optional actions for the header.\n * @param props.className - Additional CSS class names for styling.\n *\n * @returns The FloatingCardProvider component that manages floating card layout and context.\n *\n * @remarks\n * - Manages registration and unregistration of floating card references.\n * - Exposes `closeCard` via context for child components.\n * - Ensures floating cards are bounded within the viewport.\n */\nexport function FloatingCardProvider({\n children,\n icon,\n headerActions,\n className,\n}: FloatingCardProviderProps) {\n const [api, setApi] = useState<DockviewApi | null>(null);\n const [cards, setCards] = useState<Record<UniqueId, HTMLDivElement>>({});\n\n const closeCard = useCallback(\n (id: UniqueId) => {\n api?.getPanel(id)?.api.close();\n },\n [api],\n );\n\n const removeRef = useCallback((view: UniqueId) => {\n setCards((prev) => {\n const newCards = { ...prev };\n delete newCards[view];\n return newCards;\n });\n }, []);\n\n const addRef = useCallback((id: UniqueId, ref: HTMLDivElement | null) => {\n if (ref) {\n setCards((prev) => {\n if (prev[id]) {\n return prev;\n }\n return { ...prev, [id]: ref };\n });\n }\n }, []);\n\n // Clean up stale refs when cards are removed via any path\n // (drag close, group close, API close, etc.)\n useEffect(() => {\n if (!api) {\n return;\n }\n\n const disposable = api.onDidRemovePanel((event) => {\n removeRef(event.id as UniqueId);\n });\n\n return () => {\n disposable.dispose();\n };\n }, [api, removeRef]);\n\n const contextValue = useMemo<FloatingCardContextValue>(\n () => ({\n cards,\n addRef,\n removeRef,\n closeCard,\n api,\n }),\n [cards, closeCard, removeRef, api, addRef],\n );\n\n const leftAdapter = useMemo(\n () => createHeaderAdapter(DefaultLeftHeader, { icon }),\n [icon],\n );\n\n const rightAdapter = useMemo(\n () => createHeaderAdapter(DefaultRightHeader, { headerActions }),\n [headerActions],\n );\n\n const theme = useMemo(\n () => ({\n name: 'accelint',\n className: styles.floatingCardProvider ?? '',\n }),\n [],\n );\n\n const onReady = useCallback((event: DockviewReadyEvent) => {\n setApi(event.api);\n }, []);\n\n return (\n <FloatingCardContext.Provider value={contextValue}>\n <div className={clsx(styles.providerRoot, className)}>\n <DockviewReact\n locked\n floatingGroupBounds={'boundedWithinViewport'}\n components={components}\n prefixHeaderActionsComponent={leftAdapter}\n rightHeaderActionsComponent={rightAdapter}\n onReady={onReady}\n theme={theme}\n />\n {children}\n </div>\n </FloatingCardContext.Provider>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"provider.js","names":["CloseIcon","components: Record<string, FunctionComponent<IDockviewPanelProps>>"],"sources":["../../../src/components/floating-card/provider.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport CloseIcon from '@accelint/icons/cancel';\nimport PinIcon from '@accelint/icons/pin';\nimport {\n type DockviewApi,\n DockviewReact,\n type DockviewReadyEvent,\n type IDockviewHeaderActionsProps,\n type IDockviewPanelProps,\n} from 'dockview-react';\nimport {\n type FunctionComponent,\n type PropsWithChildren,\n type ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react';\nimport { Button } from '../button';\nimport { Divider } from '../divider';\nimport { Icon } from '../icon';\nimport {\n FloatingCardContext,\n type FloatingCardContextValue,\n useFloatingCard,\n} from './context';\nimport styles from './styles.module.css';\nimport type { UniqueId } from '@accelint/core/utility/uuid';\n\n/**\n * A value that can be static or dynamically computed per floating card.\n *\n * Enables per-card customization of props by passing a factory function\n * that receives the card ID and returns the appropriate value.\n *\n * @template T - The type of the static value or factory return type.\n */\ntype MaybeFactory<T> = T | ((cardId: string) => T);\n\n/**\n * Configuration for header action buttons in floating cards.\n *\n * Can be a custom button (with icon and onClick), a visual separator ('divider'),\n * or the built-in pin toggle ('pin').\n *\n * @remarks\n * - Custom buttons: Rendered as icon buttons with your provided onClick handler\n * - 'divider': Inserts a vertical divider between action groups\n * - 'pin': Adds built-in pin toggle button (disables dragging when pinned)\n *\n * @example\n * ```tsx\n * const headerActions: FloatingCardHeaderAction[] = [\n * { icon: <SettingsIcon />, onClick: () => openSettings() },\n * 'divider',\n * 'pin'\n * ];\n * ```\n */\nexport type FloatingCardHeaderAction =\n | {\n /** Icon to display in the action button */\n icon: ReactNode;\n /** Handler called when the action button is clicked */\n onClick: () => void;\n }\n | 'divider'\n | 'pin';\n\n/**\n * Props passed to floating card header components.\n *\n * @remarks Internal type used by header adapters to map Dockview props to custom header components.\n */\ntype FloatingCardHeaderProps = {\n /** ID of the active floating card panel */\n id?: string;\n /** Title text displayed in the header */\n title?: string;\n /** Optional icon displayed at the start of the header */\n icon?: ReactNode;\n /** Callback to close the entire card group */\n closeGroup: () => void;\n /** Toggles pin state for the specified card */\n togglePinCard?: (id: UniqueId) => void;\n /** Checks if the specified card is pinned */\n isPinned?: (id: UniqueId) => boolean;\n /** Subscribes to pin state changes; returns an unsubscribe function */\n subscribeToPinState?: (callback: () => void) => () => void;\n /** Custom action buttons to render in the header */\n headerActions?: FloatingCardHeaderAction[];\n};\n\n/**\n * Internal component that registers a DOM ref for a card container.\n *\n * Used by the floating card engine to mount portal targets. Also manages\n * the data-pinned attribute on the resize container to control drag handle visibility.\n *\n * @param props - Dockview panel props containing the card ID.\n */\nfunction FloatingCardContainer(props: Readonly<IDockviewPanelProps>) {\n const { addRef, isPinned, subscribeToPinState } = useFloatingCard();\n const cardId = props.api.id as UniqueId;\n\n const pinned = useSyncExternalStore(\n subscribeToPinState,\n () => isPinned(cardId),\n () => false,\n );\n\n const cardRef = useRef<HTMLDivElement | null>(null);\n\n const refCallback = useCallback(\n (ref: HTMLDivElement | null) => {\n cardRef.current = ref;\n addRef(cardId, ref);\n },\n [addRef, cardId],\n );\n\n // Toggle a data-pinned attribute on the ancestor .dv-resize-container\n // so CSS can disable pointer-events on the drag handle.\n useEffect(() => {\n const el = cardRef.current;\n const container = el?.closest<HTMLElement>('.dv-resize-container');\n\n if (!container) {\n return;\n }\n\n if (pinned) {\n container.dataset.pinned = '';\n } else {\n delete container.dataset.pinned;\n }\n }, [pinned]);\n\n return <div className={styles.cardContent} ref={refCallback} />;\n}\n\n/**\n * Default left header showing an optional custom icon and the card's title.\n */\nfunction DefaultLeftHeader({\n title,\n icon,\n id,\n}: Readonly<FloatingCardHeaderProps>) {\n return (\n <div className={styles.headerSide}>\n {icon ? <Icon size='small'>{icon}</Icon> : null}\n {title && title !== id ? (\n <div className={styles.headerTitle}>{title}</div>\n ) : null}\n </div>\n );\n}\n\n/** Stable no-op subscribe for useSyncExternalStore when no pin subscription is available. */\nconst noopSubscribe = () => () => undefined;\n\n/**\n * Default right header showing optional action buttons and an always-present close button.\n *\n * @remarks Handles rendering of 'divider' and 'pin' action types specially.\n */\nfunction DefaultRightHeader({\n closeGroup,\n headerActions,\n id,\n togglePinCard,\n isPinned,\n subscribeToPinState,\n}: Readonly<FloatingCardHeaderProps>) {\n const pinned = useSyncExternalStore(\n subscribeToPinState ?? noopSubscribe,\n () => (id && isPinned ? isPinned(id as UniqueId) : false),\n () => false,\n );\n\n return (\n <div className={styles.headerSide}>\n {headerActions?.map((action, index) => {\n if (action === 'divider') {\n return (\n // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here because the order of actions is unlikely to change.\n <Divider key={`${id}-divider-${index}`} orientation='vertical' />\n );\n }\n if (action === 'pin') {\n return (\n <Button\n className={styles.pinButton}\n // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here because the order of actions is unlikely to change.\n key={`${id}-pin-${index}`}\n variant='icon'\n size='small'\n color={pinned ? 'accent' : undefined}\n aria-label='Pin'\n aria-pressed={pinned}\n onClick={() => {\n if (id && togglePinCard) {\n togglePinCard(id as UniqueId);\n }\n }}\n >\n <Icon>\n <PinIcon />\n </Icon>\n </Button>\n );\n }\n return (\n <Button\n key={`${id}-${\n // biome-ignore lint/suspicious/noArrayIndexKey: Using index as key is acceptable here because the order of actions is unlikely to change.\n index\n }`}\n variant='icon'\n size='small'\n onClick={action.onClick}\n >\n <Icon>{action.icon}</Icon>\n </Button>\n );\n })}\n <Button variant='icon' size='small' onClick={closeGroup}>\n <Icon>\n <CloseIcon />\n </Icon>\n </Button>\n </div>\n );\n}\n\ntype HeaderAdapterOptions = {\n icon?: MaybeFactory<ReactNode>;\n headerActions?: MaybeFactory<FloatingCardHeaderProps['headerActions']>;\n togglePinCard?: (id: UniqueId) => void;\n isPinned?: (id: UniqueId) => boolean;\n subscribeToPinState?: (callback: () => void) => () => void;\n};\n\n/**\n * Creates an adapter component to map Dockview's header action props to custom header component props.\n *\n * Handles title change subscriptions and resolves MaybeFactory options (icon, headerActions)\n * either as static values or by invoking factory functions with the active card ID.\n *\n * @param Component - The header component to wrap.\n * @param options - Configuration options including icon and headerActions (static or factory).\n * @returns Adapter component compatible with Dockview's header API.\n */\nfunction createHeaderAdapter(\n Component: FunctionComponent<FloatingCardHeaderProps>,\n options: HeaderAdapterOptions,\n): FunctionComponent<IDockviewHeaderActionsProps> {\n function HeaderAdapter(props: Readonly<IDockviewHeaderActionsProps>) {\n const panelId = props.panels[0]?.id ?? '';\n const [title, setTitle] = useState(props.activePanel?.title);\n\n useEffect(() => {\n const panel = props.activePanel;\n\n if (!panel) {\n return;\n }\n\n setTitle(panel.title);\n\n const disposable = panel.api.onDidTitleChange(() => {\n setTitle(panel.title);\n });\n\n return () => {\n disposable.dispose();\n };\n }, [props.activePanel]);\n const icon = props.activePanel\n ? typeof options?.icon === 'function'\n ? options.icon(panelId)\n : options?.icon\n : undefined;\n const headerActions =\n typeof options?.headerActions === 'function'\n ? options.headerActions(panelId)\n : options?.headerActions;\n return (\n <Component\n icon={icon}\n headerActions={headerActions}\n title={title}\n id={props.activePanel?.id}\n closeGroup={() => props.api.close()}\n togglePinCard={options.togglePinCard}\n isPinned={options.isPinned}\n subscribeToPinState={options.subscribeToPinState}\n />\n );\n }\n\n HeaderAdapter.displayName = `HeaderAdapter(${Component.displayName ?? Component.name ?? 'Anonymous'})`;\n return HeaderAdapter;\n}\n\n/**\n * Props for the FloatingCardProvider component.\n *\n * Configures default icon and header actions for all floating cards. Both can be\n * static values or factory functions that receive the card ID for per-card customization.\n *\n * @example\n * ```tsx\n * <FloatingCardProvider\n * icon={<AppIcon />}\n * headerActions={(cardId) => {\n * if (cardId === 'settings') {\n * return [{ icon: <CogIcon />, onClick: openSettings }, 'pin'];\n * }\n * return ['pin'];\n * }}\n * >\n * {children}\n * </FloatingCardProvider>\n * ```\n */\nexport type FloatingCardProviderProps = Readonly<\n PropsWithChildren<{\n /**\n * Optional icon rendered at the very start of the floating card header.\n * Can be a `ReactNode` or a function `(cardId: string) => ReactNode`.\n */\n icon?: MaybeFactory<ReactNode>;\n /**\n * Optional action buttons rendered in the floating card header before the close button.\n * Can include `'divider'` to separate groups and `'pin'` to add a pin toggle button.\n * Can be an array or a function `(cardId: string) => array` to return\n * per-floating card actions.\n */\n headerActions?: MaybeFactory<FloatingCardHeaderAction[]>;\n /**\n * Optional set of card IDs that should be pinned when the provider first mounts.\n *\n * Like other `initial*` props, this value is only read once at mount time.\n * Changes after mount have no effect.\n */\n initialPinned?: readonly UniqueId[];\n /** Additional CSS class names for styling */\n className?: string;\n }>\n>;\n\nconst components: Record<string, FunctionComponent<IDockviewPanelProps>> = {\n default: FloatingCardContainer,\n};\n\n/**\n * Provides a context and layout area for floating cards within the application.\n *\n * Wraps children with floating card context and renders a Dockview instance to manage\n * docking, dragging, and layout of floating cards.\n *\n * @param props - The props for the FloatingCardProvider component.\n * @param props.children - Child components rendered inside the floating card provider.\n * @param props.icon - Optional icon rendered in all card headers (static or factory).\n * @param props.headerActions - Optional action buttons for card headers (static or factory).\n * @param props.className - Additional CSS class names for styling.\n * @returns The FloatingCardProvider component that manages floating card layout and context.\n *\n * @remarks\n * - Manages registration and cleanup of floating card DOM references\n * - Exposes closeCard, togglePinCard, and isPinned via context\n * - Automatically cleans up refs when cards are removed via any path (drag close, group close, API close)\n * - Cards are bounded within the viewport\n *\n * @example\n * ```tsx\n * <FloatingCardProvider\n * icon={<AppLogo />}\n * headerActions={[\n * { icon: <SettingsIcon />, onClick: openSettings },\n * 'divider',\n * 'pin'\n * ]}\n * >\n * <FloatingCard id=\"panel-1\" title=\"My Panel\">\n * <div>Panel content</div>\n * </FloatingCard>\n * </FloatingCardProvider>\n * ```\n */\nexport function FloatingCardProvider({\n children,\n icon,\n headerActions,\n initialPinned,\n className,\n}: FloatingCardProviderProps) {\n const [api, setApi] = useState<DockviewApi | null>(null);\n const [cards, setCards] = useState<Record<UniqueId, HTMLDivElement>>({});\n const pinnedCardsRef = useRef<Set<UniqueId>>(new Set(initialPinned));\n const pinListenersRef = useRef<Set<() => void>>(new Set());\n\n const closeCard = useCallback(\n (id: UniqueId) => {\n api?.getPanel(id)?.api.close();\n },\n [api],\n );\n\n const togglePinCard = useCallback((id: UniqueId) => {\n const next = new Set(pinnedCardsRef.current);\n if (next.has(id)) {\n next.delete(id);\n } else {\n next.add(id);\n }\n pinnedCardsRef.current = next;\n for (const listener of pinListenersRef.current) {\n listener();\n }\n }, []);\n\n const isPinned = useCallback(\n (id: UniqueId) => pinnedCardsRef.current.has(id),\n [],\n );\n\n const subscribeToPinState = useCallback((callback: () => void) => {\n pinListenersRef.current.add(callback);\n return () => {\n pinListenersRef.current.delete(callback);\n };\n }, []);\n\n const removeRef = useCallback((view: UniqueId) => {\n setCards((prev) => {\n const newCards = { ...prev };\n delete newCards[view];\n return newCards;\n });\n if (pinnedCardsRef.current.has(view)) {\n const next = new Set(pinnedCardsRef.current);\n next.delete(view);\n pinnedCardsRef.current = next;\n for (const listener of pinListenersRef.current) {\n listener();\n }\n }\n }, []);\n\n const addRef = useCallback((id: UniqueId, ref: HTMLDivElement | null) => {\n if (ref) {\n setCards((prev) => {\n if (prev[id]) {\n return prev;\n }\n return { ...prev, [id]: ref };\n });\n }\n }, []);\n\n // Clean up stale refs when cards are removed via any path\n // (drag close, group close, API close, etc.)\n useEffect(() => {\n if (!api) {\n return;\n }\n\n const disposable = api.onDidRemovePanel((event) => {\n removeRef(event.id as UniqueId);\n });\n\n return () => {\n disposable.dispose();\n };\n }, [api, removeRef]);\n\n const contextValue = useMemo<FloatingCardContextValue>(\n () => ({\n cards,\n addRef,\n removeRef,\n closeCard,\n togglePinCard,\n isPinned,\n subscribeToPinState,\n api,\n }),\n [\n cards,\n closeCard,\n removeRef,\n api,\n addRef,\n togglePinCard,\n isPinned,\n subscribeToPinState,\n ],\n );\n\n const leftAdapter = useMemo(\n () =>\n createHeaderAdapter(DefaultLeftHeader, {\n icon,\n }),\n [icon],\n );\n\n const rightAdapter = useMemo(\n () =>\n createHeaderAdapter(DefaultRightHeader, {\n headerActions,\n togglePinCard,\n isPinned,\n subscribeToPinState,\n }),\n [headerActions, togglePinCard, isPinned, subscribeToPinState],\n );\n\n const theme = useMemo(\n () => ({\n name: 'accelint',\n className: styles.floatingCardProvider ?? '',\n }),\n [],\n );\n\n const onReady = useCallback((event: DockviewReadyEvent) => {\n setApi(event.api);\n }, []);\n\n return (\n <FloatingCardContext.Provider value={contextValue}>\n <div className={clsx(styles.providerRoot, className)}>\n <DockviewReact\n locked\n floatingGroupBounds={'boundedWithinViewport'}\n components={components}\n prefixHeaderActionsComponent={leftAdapter}\n rightHeaderActionsComponent={rightAdapter}\n onReady={onReady}\n theme={theme}\n />\n {children}\n </div>\n </FloatingCardContext.Provider>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { GanttRowElementColorProp } from "../../types.js";
|
|
14
|
+
import { HTMLAttributes, PropsWithChildren } from "react";
|
|
15
|
+
import * as react_jsx_runtime196 from "react/jsx-runtime";
|
|
16
|
+
|
|
17
|
+
//#region src/components/gantt/components/base-elements/point.d.ts
|
|
18
|
+
/** Props for point-based Gantt elements (markers, brackets). */
|
|
19
|
+
type PointProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
/** Timestamp in epoch milliseconds for the point position on the timeline. */
|
|
21
|
+
timeMs: number;
|
|
22
|
+
/** Visual color variant. @default 'accent' */
|
|
23
|
+
color?: GanttRowElementColorProp;
|
|
24
|
+
};
|
|
25
|
+
declare function Point(props: PropsWithChildren<PointProps>): react_jsx_runtime196.JSX.Element | null;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Point, PointProps };
|
|
28
|
+
//# sourceMappingURL=point.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { timestampWithinBounds } from "../../utils/helpers.js";
|
|
15
|
+
import { useTemporalDataContext } from "../../context/temporal-data/index.js";
|
|
16
|
+
import { usePointElementLayout } from "./use-point-element-layout/index.js";
|
|
17
|
+
import { useCallback, useState } from "react";
|
|
18
|
+
import { jsx } from "react/jsx-runtime";
|
|
19
|
+
|
|
20
|
+
//#region src/components/gantt/components/base-elements/point.tsx
|
|
21
|
+
function PointInner({ children, timeMs, color = "accent", ...rest }) {
|
|
22
|
+
const [element, setElement] = useState(null);
|
|
23
|
+
usePointElementLayout({
|
|
24
|
+
element,
|
|
25
|
+
timeMs
|
|
26
|
+
});
|
|
27
|
+
return /* @__PURE__ */ jsx("div", {
|
|
28
|
+
ref: useCallback((node) => {
|
|
29
|
+
setElement(node);
|
|
30
|
+
}, []),
|
|
31
|
+
"data-color": color,
|
|
32
|
+
...rest,
|
|
33
|
+
children
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function Point(props) {
|
|
37
|
+
const { renderedRegionBounds } = useTemporalDataContext();
|
|
38
|
+
if (!timestampWithinBounds(props.timeMs, renderedRegionBounds)) return null;
|
|
39
|
+
return /* @__PURE__ */ jsx(PointInner, { ...props });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { Point };
|
|
44
|
+
//# sourceMappingURL=point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.js","names":[],"sources":["../../../../../src/components/gantt/components/base-elements/point.tsx"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2026 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 {\n type HTMLAttributes,\n type PropsWithChildren,\n useCallback,\n useState,\n} from 'react';\nimport { useTemporalDataContext } from '@/components/gantt/context/temporal-data';\nimport { timestampWithinBounds } from '@/components/gantt/utils/helpers';\nimport { usePointElementLayout } from './use-point-element-layout';\nimport type { GanttRowElementColorProp } from '@/components/gantt/types';\n\n/** Props for point-based Gantt elements (markers, brackets). */\nexport type PointProps = HTMLAttributes<HTMLDivElement> & {\n /** Timestamp in epoch milliseconds for the point position on the timeline. */\n timeMs: number;\n /** Visual color variant. @default 'accent' */\n color?: GanttRowElementColorProp;\n};\n\nfunction PointInner({\n children,\n timeMs,\n color = 'accent',\n ...rest\n}: PropsWithChildren<PointProps>) {\n const [element, setElement] = useState<HTMLDivElement | null>(null);\n\n usePointElementLayout({\n element,\n timeMs,\n });\n\n const assignElementRef = useCallback((node: HTMLDivElement | null) => {\n setElement(node);\n }, []);\n\n return (\n <div ref={assignElementRef} data-color={color} {...rest}>\n {children}\n </div>\n );\n}\n\nexport function Point(props: PropsWithChildren<PointProps>) {\n const { renderedRegionBounds } = useTemporalDataContext();\n\n if (!timestampWithinBounds(props.timeMs, renderedRegionBounds)) {\n return null;\n }\n\n return <PointInner {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgCA,SAAS,WAAW,EAClB,UACA,QACA,QAAQ,UACR,GAAG,QAC6B;CAChC,MAAM,CAAC,SAAS,cAAc,SAAgC,KAAK;AAEnE,uBAAsB;EACpB;EACA;EACD,CAAC;AAMF,QACE,oBAAC;EAAI,KALkB,aAAa,SAAgC;AACpE,cAAW,KAAK;KACf,EAAE,CAAC;EAGwB,cAAY;EAAO,GAAI;EAChD;GACG;;AAIV,SAAgB,MAAM,OAAsC;CAC1D,MAAM,EAAE,yBAAyB,wBAAwB;AAEzD,KAAI,CAAC,sBAAsB,MAAM,QAAQ,qBAAqB,CAC5D,QAAO;AAGT,QAAO,oBAAC,cAAW,GAAI,QAAS"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { GanttRowElementColorProp } from "../../types.js";
|
|
14
|
+
import { HTMLAttributes, PropsWithChildren } from "react";
|
|
15
|
+
import * as react_jsx_runtime197 from "react/jsx-runtime";
|
|
16
|
+
|
|
17
|
+
//#region src/components/gantt/components/base-elements/range.d.ts
|
|
18
|
+
/** Props for range-based Gantt elements (blocks, spacers). */
|
|
19
|
+
type RangeProps = HTMLAttributes<HTMLDivElement> & {
|
|
20
|
+
/** Start timestamp in epoch milliseconds for the range element. */
|
|
21
|
+
startTimeMs: number;
|
|
22
|
+
/** End timestamp in epoch milliseconds for the range element. */
|
|
23
|
+
endTimeMs: number;
|
|
24
|
+
/** Visual color variant. @default 'accent' */
|
|
25
|
+
color?: GanttRowElementColorProp;
|
|
26
|
+
};
|
|
27
|
+
declare function Range(props: PropsWithChildren<RangeProps>): react_jsx_runtime197.JSX.Element | null;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Range, RangeProps };
|
|
30
|
+
//# sourceMappingURL=range.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { shouldRenderRangeElement } from "../../utils/helpers.js";
|
|
15
|
+
import { useTemporalDataContext } from "../../context/temporal-data/index.js";
|
|
16
|
+
import { useRangeElementLayout } from "./use-range-element-layout/index.js";
|
|
17
|
+
import { useCallback, useState } from "react";
|
|
18
|
+
import { jsx } from "react/jsx-runtime";
|
|
19
|
+
|
|
20
|
+
//#region src/components/gantt/components/base-elements/range.tsx
|
|
21
|
+
function RangeInner({ children, startTimeMs, endTimeMs, color = "accent", ...rest }) {
|
|
22
|
+
const [element, setElement] = useState(null);
|
|
23
|
+
useRangeElementLayout({
|
|
24
|
+
element,
|
|
25
|
+
timeBounds: {
|
|
26
|
+
startMs: startTimeMs,
|
|
27
|
+
endMs: endTimeMs
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31
|
+
ref: useCallback((node) => {
|
|
32
|
+
setElement(node);
|
|
33
|
+
}, []),
|
|
34
|
+
"data-color": color,
|
|
35
|
+
...rest,
|
|
36
|
+
children
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function Range(props) {
|
|
40
|
+
const { renderedRegionBounds } = useTemporalDataContext();
|
|
41
|
+
const { startTimeMs, endTimeMs } = props;
|
|
42
|
+
if (!shouldRenderRangeElement(renderedRegionBounds, {
|
|
43
|
+
startMs: startTimeMs,
|
|
44
|
+
endMs: endTimeMs
|
|
45
|
+
})) return null;
|
|
46
|
+
return /* @__PURE__ */ jsx(RangeInner, { ...props });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { Range };
|
|
51
|
+
//# sourceMappingURL=range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range.js","names":[],"sources":["../../../../../src/components/gantt/components/base-elements/range.tsx"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2026 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 {\n type HTMLAttributes,\n type PropsWithChildren,\n useCallback,\n useState,\n} from 'react';\nimport { useTemporalDataContext } from '@/components/gantt/context/temporal-data';\nimport { shouldRenderRangeElement } from '@/components/gantt/utils/helpers';\nimport { useRangeElementLayout } from './use-range-element-layout';\nimport type { GanttRowElementColorProp } from '@/components/gantt/types';\n\n/** Props for range-based Gantt elements (blocks, spacers). */\nexport type RangeProps = HTMLAttributes<HTMLDivElement> & {\n /** Start timestamp in epoch milliseconds for the range element. */\n startTimeMs: number;\n /** End timestamp in epoch milliseconds for the range element. */\n endTimeMs: number;\n /** Visual color variant. @default 'accent' */\n color?: GanttRowElementColorProp;\n};\n\nfunction RangeInner({\n children,\n startTimeMs,\n endTimeMs,\n color = 'accent',\n ...rest\n}: PropsWithChildren<RangeProps>) {\n const [element, setElement] = useState<HTMLDivElement | null>(null);\n\n useRangeElementLayout({\n element,\n timeBounds: {\n startMs: startTimeMs,\n endMs: endTimeMs,\n },\n });\n\n const assignElementRef = useCallback((node: HTMLDivElement | null) => {\n setElement(node);\n }, []);\n\n return (\n <div ref={assignElementRef} data-color={color} {...rest}>\n {children}\n </div>\n );\n}\n\nexport function Range(props: PropsWithChildren<RangeProps>) {\n const { renderedRegionBounds } = useTemporalDataContext();\n const { startTimeMs, endTimeMs } = props;\n\n if (\n !shouldRenderRangeElement(renderedRegionBounds, {\n startMs: startTimeMs,\n endMs: endTimeMs,\n })\n ) {\n return null;\n }\n\n return <RangeInner {...props} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkCA,SAAS,WAAW,EAClB,UACA,aACA,WACA,QAAQ,UACR,GAAG,QAC6B;CAChC,MAAM,CAAC,SAAS,cAAc,SAAgC,KAAK;AAEnE,uBAAsB;EACpB;EACA,YAAY;GACV,SAAS;GACT,OAAO;GACR;EACF,CAAC;AAMF,QACE,oBAAC;EAAI,KALkB,aAAa,SAAgC;AACpE,cAAW,KAAK;KACf,EAAE,CAAC;EAGwB,cAAY;EAAO,GAAI;EAChD;GACG;;AAIV,SAAgB,MAAM,OAAsC;CAC1D,MAAM,EAAE,yBAAyB,wBAAwB;CACzD,MAAM,EAAE,aAAa,cAAc;AAEnC,KACE,CAAC,yBAAyB,sBAAsB;EAC9C,SAAS;EACT,OAAO;EACR,CAAC,CAEF,QAAO;AAGT,QAAO,oBAAC,cAAW,GAAI,QAAS"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//#region src/components/gantt/components/base-elements/use-point-element-layout/index.d.ts
|
|
2
|
+
type UsePointElementLayoutProps = {
|
|
3
|
+
element: HTMLDivElement | null;
|
|
4
|
+
timeMs: number;
|
|
5
|
+
};
|
|
6
|
+
declare function usePointElementLayout({
|
|
7
|
+
element,
|
|
8
|
+
timeMs
|
|
9
|
+
}: UsePointElementLayoutProps): void;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { usePointElementLayout };
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { TIMESCALE_MAPPING } from "../../../constants.js";
|
|
15
|
+
import { selectors } from "../../../store.js";
|
|
16
|
+
import { useTemporalDataContext } from "../../../context/temporal-data/index.js";
|
|
17
|
+
import { useLayoutSubscription } from "../../../hooks/use-layout-subscription/index.js";
|
|
18
|
+
import { derivePointElementLayout } from "../../../utils/layout.js";
|
|
19
|
+
import { useCallback, useMemo } from "react";
|
|
20
|
+
|
|
21
|
+
//#region src/components/gantt/components/base-elements/use-point-element-layout/index.ts
|
|
22
|
+
function usePointElementLayout({ element, timeMs }) {
|
|
23
|
+
const { renderedRegionBounds, msPerPx, timescale, totalBounds } = useTemporalDataContext();
|
|
24
|
+
useLayoutSubscription({
|
|
25
|
+
callback: useCallback(() => {
|
|
26
|
+
if (!element) return;
|
|
27
|
+
const { translateX } = derivePointElementLayout(renderedRegionBounds, timeMs, totalBounds, msPerPx);
|
|
28
|
+
element.style.setProperty("--translate-x", `${translateX}px`);
|
|
29
|
+
}, [
|
|
30
|
+
element,
|
|
31
|
+
renderedRegionBounds,
|
|
32
|
+
timeMs,
|
|
33
|
+
totalBounds,
|
|
34
|
+
msPerPx
|
|
35
|
+
]),
|
|
36
|
+
selector: useMemo(() => selectors.roundedCurrentPositionMs(TIMESCALE_MAPPING[timescale]), [timescale])
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
export { usePointElementLayout };
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/gantt/components/base-elements/use-point-element-layout/index.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2026 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 { useCallback, useMemo } from 'react';\nimport { TIMESCALE_MAPPING } from '@/components/gantt/constants';\nimport { useTemporalDataContext } from '@/components/gantt/context/temporal-data';\nimport { useLayoutSubscription } from '@/components/gantt/hooks/use-layout-subscription';\nimport { selectors } from '@/components/gantt/store';\nimport { derivePointElementLayout } from '@/components/gantt/utils/layout';\n\ntype UsePointElementLayoutProps = {\n element: HTMLDivElement | null;\n timeMs: number;\n};\n\nexport function usePointElementLayout({\n element,\n timeMs,\n}: UsePointElementLayoutProps) {\n const { renderedRegionBounds, msPerPx, timescale, totalBounds } =\n useTemporalDataContext();\n\n const applyLayout = useCallback(() => {\n if (!element) {\n return;\n }\n\n const { translateX } = derivePointElementLayout(\n renderedRegionBounds,\n timeMs,\n totalBounds,\n msPerPx,\n );\n\n element.style.setProperty('--translate-x', `${translateX}px`);\n }, [element, renderedRegionBounds, timeMs, totalBounds, msPerPx]);\n\n const selector = useMemo(\n () => selectors.roundedCurrentPositionMs(TIMESCALE_MAPPING[timescale]),\n [timescale],\n );\n\n useLayoutSubscription({\n callback: applyLayout,\n selector,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,sBAAsB,EACpC,SACA,UAC6B;CAC7B,MAAM,EAAE,sBAAsB,SAAS,WAAW,gBAChD,wBAAwB;AAsB1B,uBAAsB;EACpB,UArBkB,kBAAkB;AACpC,OAAI,CAAC,QACH;GAGF,MAAM,EAAE,eAAe,yBACrB,sBACA,QACA,aACA,QACD;AAED,WAAQ,MAAM,YAAY,iBAAiB,GAAG,WAAW,IAAI;KAC5D;GAAC;GAAS;GAAsB;GAAQ;GAAa;GAAQ,CAAC;EAS/D,UAPe,cACT,UAAU,yBAAyB,kBAAkB,WAAW,EACtE,CAAC,UAAU,CACZ;EAKA,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { GanttTimeBounds } from "../../../types.js";
|
|
14
|
+
|
|
15
|
+
//#region src/components/gantt/components/base-elements/use-range-element-layout/index.d.ts
|
|
16
|
+
type UseRangeElementLayoutProps = {
|
|
17
|
+
element: HTMLDivElement | null;
|
|
18
|
+
timeBounds: GanttTimeBounds;
|
|
19
|
+
};
|
|
20
|
+
declare function useRangeElementLayout(props: UseRangeElementLayoutProps): void;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { useRangeElementLayout };
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
import { TIMESCALE_MAPPING } from "../../../constants.js";
|
|
15
|
+
import { selectors } from "../../../store.js";
|
|
16
|
+
import { useTemporalDataContext } from "../../../context/temporal-data/index.js";
|
|
17
|
+
import { useLayoutSubscription } from "../../../hooks/use-layout-subscription/index.js";
|
|
18
|
+
import { deriveRangeElementLayout } from "../../../utils/layout.js";
|
|
19
|
+
import { useCallback, useMemo } from "react";
|
|
20
|
+
|
|
21
|
+
//#region src/components/gantt/components/base-elements/use-range-element-layout/index.ts
|
|
22
|
+
const storeSelector = (timescale) => (state) => [selectors.roundedCurrentPositionMs(TIMESCALE_MAPPING[timescale])(state), selectors.roundedCurrentRowScrollPx(state)];
|
|
23
|
+
function useRangeElementLayout(props) {
|
|
24
|
+
const { timeBounds, element } = props;
|
|
25
|
+
const { startMs, endMs } = timeBounds;
|
|
26
|
+
const { renderedRegionBounds, msPerPx, timescale, totalBounds } = useTemporalDataContext();
|
|
27
|
+
useLayoutSubscription({
|
|
28
|
+
callback: useCallback(() => {
|
|
29
|
+
if (!element) return;
|
|
30
|
+
const { widthPx, translateX } = deriveRangeElementLayout(renderedRegionBounds, {
|
|
31
|
+
startMs,
|
|
32
|
+
endMs
|
|
33
|
+
}, totalBounds, msPerPx);
|
|
34
|
+
element.style.width = `${widthPx}px`;
|
|
35
|
+
element.style.transform = `translateX(${translateX}px)`;
|
|
36
|
+
}, [
|
|
37
|
+
element,
|
|
38
|
+
renderedRegionBounds,
|
|
39
|
+
startMs,
|
|
40
|
+
endMs,
|
|
41
|
+
totalBounds,
|
|
42
|
+
msPerPx
|
|
43
|
+
]),
|
|
44
|
+
selector: useMemo(() => storeSelector(timescale), [timescale])
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { useRangeElementLayout };
|
|
50
|
+
//# sourceMappingURL=index.js.map
|