@accelint/design-toolkit 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/catalog-info.yaml +12 -6
- package/dist/components/accordion/context.d.ts +0 -2
- package/dist/components/accordion/group.d.ts +0 -2
- package/dist/components/accordion/group.js +1 -1
- package/dist/components/accordion/group.js.map +1 -1
- package/dist/components/accordion/header.d.ts +0 -2
- package/dist/components/accordion/header.js +1 -1
- package/dist/components/accordion/header.js.map +1 -1
- package/dist/components/accordion/index.d.ts +0 -2
- package/dist/components/accordion/index.js +3 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/panel.d.ts +0 -2
- package/dist/components/accordion/panel.js +1 -1
- package/dist/components/accordion/panel.js.map +1 -1
- package/dist/components/accordion/styles.module.css +65 -0
- package/dist/components/accordion/trigger.d.ts +0 -2
- package/dist/components/accordion/trigger.js +1 -1
- package/dist/components/accordion/trigger.js.map +1 -1
- package/dist/components/accordion/types.d.ts +5 -5
- package/dist/components/action-bar/index.d.ts +1 -1
- package/dist/components/action-bar/index.js +1 -1
- package/dist/components/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/styles.module.css +27 -0
- package/dist/components/action-bar/types.d.ts +3 -1
- package/dist/components/avatar/context.d.ts +0 -3
- package/dist/components/avatar/index.d.ts +0 -3
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.module.css +45 -0
- package/dist/components/avatar/types.d.ts +1 -4
- package/dist/components/badge/context.d.ts +0 -2
- package/dist/components/badge/index.d.ts +0 -2
- package/dist/components/badge/index.js +3 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.module.css +67 -0
- package/dist/components/badge/types.d.ts +3 -4
- package/dist/components/breadcrumbs/index.js +1 -1
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/breadcrumbs/item.js +1 -1
- package/dist/components/breadcrumbs/item.js.map +1 -1
- package/dist/components/breadcrumbs/styles.module.css +41 -0
- package/dist/components/button/context.d.ts +0 -3
- package/dist/components/button/index.d.ts +0 -3
- package/dist/components/button/index.js +3 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/link.d.ts +0 -3
- package/dist/components/button/link.js +1 -1
- package/dist/components/button/link.js.map +1 -1
- package/dist/components/button/styles.module.css +917 -0
- package/dist/components/button/toggle.d.ts +0 -3
- package/dist/components/button/toggle.js +1 -1
- package/dist/components/button/toggle.js.map +1 -1
- package/dist/components/button/types.d.ts +6 -6
- package/dist/components/checkbox/group.js +1 -1
- package/dist/components/checkbox/group.js.map +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.module.css +111 -0
- package/dist/components/chip/context.d.ts +3 -6
- package/dist/components/chip/context.js +1 -1
- package/dist/components/chip/context.js.map +1 -1
- package/dist/components/chip/deletable.d.ts +0 -3
- package/dist/components/chip/deletable.js +1 -1
- package/dist/components/chip/deletable.js.map +1 -1
- package/dist/components/chip/index.d.ts +0 -3
- package/dist/components/chip/index.js +3 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/list.d.ts +0 -3
- package/dist/components/chip/list.js +1 -1
- package/dist/components/chip/list.js.map +1 -1
- package/dist/components/chip/selectable.d.ts +0 -3
- package/dist/components/chip/selectable.js +3 -1
- package/dist/components/chip/selectable.js.map +1 -1
- package/dist/components/chip/styles.module.css +129 -0
- package/dist/components/chip/types.d.ts +7 -8
- package/dist/components/classification-badge/context.d.ts +1 -2
- package/dist/components/classification-badge/index.d.ts +1 -2
- package/dist/components/classification-badge/index.js +3 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.module.css +63 -0
- package/dist/components/classification-badge/types.d.ts +3 -5
- package/dist/components/classification-banner/context.d.ts +0 -2
- package/dist/components/classification-banner/index.d.ts +0 -2
- package/dist/components/classification-banner/index.js +3 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.module.css +55 -0
- package/dist/components/classification-banner/types.d.ts +4 -5
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/styles.module.css +43 -0
- package/dist/components/combobox-field/context.d.ts +0 -3
- package/dist/components/combobox-field/index.d.ts +0 -3
- package/dist/components/combobox-field/index.js +1 -1
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.module.css +101 -0
- package/dist/components/combobox-field/types.d.ts +0 -3
- package/dist/components/coordinate-field/context.d.ts +77 -0
- package/dist/components/coordinate-field/context.js +2 -0
- package/dist/components/coordinate-field/context.js.map +1 -0
- package/dist/components/coordinate-field/coordinate-utils.d.ts +282 -0
- package/dist/components/coordinate-field/coordinate-utils.js +2 -0
- package/dist/components/coordinate-field/coordinate-utils.js.map +1 -0
- package/dist/components/coordinate-field/index.d.ts +66 -0
- package/dist/components/coordinate-field/index.js +4 -0
- package/dist/components/coordinate-field/index.js.map +1 -0
- package/dist/components/coordinate-field/segment-configs.d.ts +163 -0
- package/dist/components/coordinate-field/segment-configs.js +2 -0
- package/dist/components/coordinate-field/segment-configs.js.map +1 -0
- package/dist/components/coordinate-field/segment.d.ts +39 -0
- package/dist/components/coordinate-field/segment.js +4 -0
- package/dist/components/coordinate-field/segment.js.map +1 -0
- package/dist/components/coordinate-field/styles.module.css +129 -0
- package/dist/components/coordinate-field/types.d.ts +194 -0
- package/dist/components/coordinate-field/types.js +2 -0
- package/dist/components/coordinate-field/types.js.map +1 -0
- package/dist/components/coordinate-field/width-utils.d.ts +29 -0
- package/dist/components/coordinate-field/width-utils.js +2 -0
- package/dist/components/coordinate-field/width-utils.js.map +1 -0
- package/dist/components/date-field/index.d.ts +0 -2
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.module.css +103 -0
- package/dist/components/date-field/types.d.ts +1 -3
- package/dist/components/details-list/context.d.ts +0 -2
- package/dist/components/details-list/index.d.ts +0 -2
- package/dist/components/details-list/index.js +3 -1
- package/dist/components/details-list/index.js.map +1 -1
- package/dist/components/details-list/label.d.ts +0 -2
- package/dist/components/details-list/styles.module.css +52 -0
- package/dist/components/details-list/types.d.ts +2 -3
- package/dist/components/details-list/value.d.ts +0 -2
- package/dist/components/dialog/content.js +3 -1
- package/dist/components/dialog/content.js.map +1 -1
- package/dist/components/dialog/footer.js +1 -1
- package/dist/components/dialog/footer.js.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/styles.module.css +86 -0
- package/dist/components/dialog/title.js +1 -1
- package/dist/components/dialog/title.js.map +1 -1
- package/dist/components/dialog/trigger.d.ts +5 -1
- package/dist/components/dialog/trigger.js +1 -1
- package/dist/components/dialog/trigger.js.map +1 -1
- package/dist/components/divider/index.js +3 -1
- package/dist/components/divider/index.js.map +1 -1
- package/dist/components/divider/styles.module.css +44 -0
- package/dist/components/drawer/back.js +1 -1
- package/dist/components/drawer/back.js.map +1 -1
- package/dist/components/drawer/close.js +3 -1
- package/dist/components/drawer/close.js.map +1 -1
- package/dist/components/drawer/content.js +1 -3
- package/dist/components/drawer/content.js.map +1 -1
- package/dist/components/drawer/context.d.ts +0 -4
- package/dist/components/drawer/footer.js +1 -3
- package/dist/components/drawer/footer.js.map +1 -1
- package/dist/components/drawer/header-title.d.ts +0 -4
- package/dist/components/drawer/header-title.js +1 -1
- package/dist/components/drawer/header-title.js.map +1 -1
- package/dist/components/drawer/header.js +1 -1
- package/dist/components/drawer/header.js.map +1 -1
- package/dist/components/drawer/index.d.ts +0 -4
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/layout-main.js +1 -1
- package/dist/components/drawer/layout-main.js.map +1 -1
- package/dist/components/drawer/layout.d.ts +0 -4
- package/dist/components/drawer/layout.js +1 -3
- package/dist/components/drawer/layout.js.map +1 -1
- package/dist/components/drawer/menu-item.d.ts +0 -4
- package/dist/components/drawer/menu-item.js +3 -1
- package/dist/components/drawer/menu-item.js.map +1 -1
- package/dist/components/drawer/menu.d.ts +0 -4
- package/dist/components/drawer/menu.js +1 -3
- package/dist/components/drawer/menu.js.map +1 -1
- package/dist/components/drawer/panel.js +1 -1
- package/dist/components/drawer/panel.js.map +1 -1
- package/dist/components/drawer/styles.module.css +304 -0
- package/dist/components/drawer/trigger.d.ts +0 -4
- package/dist/components/drawer/trigger.js +1 -1
- package/dist/components/drawer/trigger.js.map +1 -1
- package/dist/components/drawer/types.d.ts +3 -5
- package/dist/components/drawer/view.js +1 -1
- package/dist/components/drawer/view.js.map +1 -1
- package/dist/components/hero/context.js +2 -0
- package/dist/components/hero/index.js +1 -1
- package/dist/components/hero/index.js.map +1 -1
- package/dist/components/hero/styles.module.css +51 -0
- package/dist/components/hero/title.js +2 -0
- package/dist/components/hotkey/context.d.ts +0 -2
- package/dist/components/hotkey/index.d.ts +0 -2
- package/dist/components/hotkey/index.js +1 -1
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/hotkey/set.d.ts +6 -0
- package/dist/components/hotkey/set.js +4 -0
- package/dist/components/hotkey/set.js.map +1 -0
- package/dist/components/hotkey/styles.module.css +36 -0
- package/dist/components/hotkey/types.d.ts +5 -6
- package/dist/components/icon/index.js +3 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.module.css +38 -0
- package/dist/components/input/context.d.ts +0 -4
- package/dist/components/input/index.d.ts +0 -4
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.module.css +175 -0
- package/dist/components/input/types.d.ts +7 -6
- package/dist/components/kanban/card-body.d.ts +12 -0
- package/dist/components/kanban/card-body.js +4 -0
- package/dist/components/kanban/card-body.js.map +1 -0
- package/dist/components/kanban/card-header-actions.d.ts +12 -0
- package/dist/components/kanban/card-header-actions.js +4 -0
- package/dist/components/kanban/card-header-actions.js.map +1 -0
- package/dist/components/kanban/card-header-title.d.ts +12 -0
- package/dist/components/kanban/card-header-title.js +4 -0
- package/dist/components/kanban/card-header-title.js.map +1 -0
- package/dist/components/kanban/card-header.d.ts +12 -0
- package/dist/components/kanban/card-header.js +4 -0
- package/dist/components/kanban/card-header.js.map +1 -0
- package/dist/components/kanban/card.d.ts +12 -0
- package/dist/components/kanban/card.js +4 -0
- package/dist/components/kanban/card.js.map +1 -0
- package/dist/components/kanban/column-actions.d.ts +12 -0
- package/dist/components/kanban/column-actions.js +4 -0
- package/dist/components/kanban/column-actions.js.map +1 -0
- package/dist/components/kanban/column-container.d.ts +12 -0
- package/dist/components/kanban/column-container.js +4 -0
- package/dist/components/kanban/column-container.js.map +1 -0
- package/dist/components/kanban/column-content.d.ts +12 -0
- package/dist/components/kanban/column-content.js +4 -0
- package/dist/components/kanban/column-content.js.map +1 -0
- package/dist/components/kanban/column-header-actions.d.ts +12 -0
- package/dist/components/kanban/column-header-actions.js +4 -0
- package/dist/components/kanban/column-header-actions.js.map +1 -0
- package/dist/components/kanban/column-header-drag-handle.d.ts +5 -0
- package/dist/components/kanban/column-header-drag-handle.js +4 -0
- package/dist/components/kanban/column-header-drag-handle.js.map +1 -0
- package/dist/components/kanban/column-header-title.d.ts +12 -0
- package/dist/components/kanban/column-header-title.js +4 -0
- package/dist/components/kanban/column-header-title.js.map +1 -0
- package/dist/components/kanban/column-header.d.ts +12 -0
- package/dist/components/kanban/column-header.js +4 -0
- package/dist/components/kanban/column-header.js.map +1 -0
- package/dist/components/kanban/column.d.ts +12 -0
- package/dist/components/kanban/column.js +4 -0
- package/dist/components/kanban/column.js.map +1 -0
- package/dist/components/kanban/context.d.ts +101 -0
- package/dist/components/kanban/context.js +2 -0
- package/dist/components/kanban/context.js.map +1 -0
- package/dist/components/kanban/header-actions.d.ts +12 -0
- package/dist/components/kanban/header-actions.js +4 -0
- package/dist/components/kanban/header-actions.js.map +1 -0
- package/dist/components/kanban/header-search.d.ts +12 -0
- package/dist/components/kanban/header-search.js +4 -0
- package/dist/components/kanban/header-search.js.map +1 -0
- package/dist/components/kanban/header-title.d.ts +12 -0
- package/dist/components/kanban/header-title.js +4 -0
- package/dist/components/kanban/header-title.js.map +1 -0
- package/dist/components/kanban/header.d.ts +12 -0
- package/dist/components/kanban/header.js +4 -0
- package/dist/components/kanban/header.js.map +1 -0
- package/dist/components/kanban/index.d.ts +9 -0
- package/dist/components/kanban/index.js +2 -0
- package/dist/components/kanban/index.js.map +1 -0
- package/dist/components/kanban/kanban.d.ts +18 -0
- package/dist/components/kanban/kanban.js +4 -0
- package/dist/components/kanban/kanban.js.map +1 -0
- package/dist/components/kanban/mock-data.d.ts +14 -0
- package/dist/components/kanban/mock-data.js +2 -0
- package/dist/components/kanban/mock-data.js.map +1 -0
- package/dist/components/kanban/styles.module.css +117 -0
- package/dist/components/kanban/types.d.ts +50 -0
- package/dist/components/label/index.js +3 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.module.css +23 -0
- package/dist/components/lines/index.d.ts +0 -2
- package/dist/components/lines/index.js +1 -1
- package/dist/components/lines/index.js.map +1 -1
- package/dist/components/lines/styles.module.css +95 -0
- package/dist/components/lines/types.d.ts +4 -5
- package/dist/components/link/index.js +3 -1
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/link/styles.module.css +37 -0
- package/dist/components/menu/context.d.ts +0 -2
- package/dist/components/menu/index.d.ts +0 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/item-description.js +3 -1
- package/dist/components/menu/item-description.js.map +1 -1
- package/dist/components/menu/item-label.js +1 -1
- package/dist/components/menu/item-label.js.map +1 -1
- package/dist/components/menu/item.d.ts +0 -2
- package/dist/components/menu/item.js +1 -1
- package/dist/components/menu/item.js.map +1 -1
- package/dist/components/menu/section.d.ts +0 -2
- package/dist/components/menu/section.js +3 -1
- package/dist/components/menu/section.js.map +1 -1
- package/dist/components/menu/separator.js +1 -1
- package/dist/components/menu/separator.js.map +1 -1
- package/dist/components/menu/styles.module.css +415 -0
- package/dist/components/menu/trigger.d.ts +5 -1
- package/dist/components/menu/trigger.js +3 -1
- package/dist/components/menu/trigger.js.map +1 -1
- package/dist/components/menu/types.d.ts +2 -3
- package/dist/components/notice/index.d.ts +0 -3
- package/dist/components/notice/index.js +1 -1
- package/dist/components/notice/index.js.map +1 -1
- package/dist/components/notice/list.d.ts +0 -3
- package/dist/components/notice/list.js +1 -1
- package/dist/components/notice/list.js.map +1 -1
- package/dist/components/notice/notice-icon.d.ts +0 -3
- package/dist/components/notice/notice-icon.js +2 -0
- package/dist/components/notice/styles.module.css +133 -0
- package/dist/components/notice/types.d.ts +3 -6
- package/dist/components/options/context.js +2 -0
- package/dist/components/options/index.js +1 -1
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/item-content.d.ts +2 -5
- package/dist/components/options/item-content.js +1 -1
- package/dist/components/options/item-content.js.map +1 -1
- package/dist/components/options/item-description.d.ts +2 -5
- package/dist/components/options/item-description.js +1 -3
- package/dist/components/options/item-description.js.map +1 -1
- package/dist/components/options/item-label.d.ts +2 -5
- package/dist/components/options/item-label.js +1 -1
- package/dist/components/options/item-label.js.map +1 -1
- package/dist/components/options/item.js +1 -1
- package/dist/components/options/item.js.map +1 -1
- package/dist/components/options/section.js +1 -1
- package/dist/components/options/section.js.map +1 -1
- package/dist/components/options/styles.module.css +397 -0
- package/dist/components/options/types.d.ts +2 -3
- package/dist/components/pagination/context.d.ts +9 -0
- package/dist/components/pagination/context.js +4 -0
- package/dist/components/pagination/context.js.map +1 -0
- package/dist/components/pagination/index.d.ts +25 -0
- package/dist/components/pagination/index.js +4 -0
- package/dist/components/pagination/index.js.map +1 -0
- package/dist/components/pagination/next.d.ts +10 -0
- package/dist/components/pagination/next.js +4 -0
- package/dist/components/pagination/next.js.map +1 -0
- package/dist/components/pagination/pages.d.ts +10 -0
- package/dist/components/pagination/pages.js +4 -0
- package/dist/components/pagination/pages.js.map +1 -0
- package/dist/components/pagination/prev.d.ts +10 -0
- package/dist/components/pagination/prev.js +4 -0
- package/dist/components/pagination/prev.js.map +1 -0
- package/dist/components/pagination/styles.module.css +25 -0
- package/dist/components/pagination/types.d.ts +35 -0
- package/dist/components/pagination/types.js +2 -0
- package/dist/components/pagination/types.js.map +1 -0
- package/dist/components/pagination/utils.d.ts +16 -0
- package/dist/components/pagination/utils.js +2 -0
- package/dist/components/pagination/utils.js.map +1 -0
- package/dist/components/popover/content.d.ts +2 -4
- package/dist/components/popover/content.js +3 -1
- package/dist/components/popover/content.js.map +1 -1
- package/dist/components/popover/footer.d.ts +2 -5
- package/dist/components/popover/footer.js +1 -1
- package/dist/components/popover/footer.js.map +1 -1
- package/dist/components/popover/index.d.ts +15 -19
- package/dist/components/popover/index.js +3 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.module.css +32 -0
- package/dist/components/popover/title.d.ts +2 -4
- package/dist/components/popover/title.js +1 -1
- package/dist/components/popover/title.js.map +1 -1
- package/dist/components/popover/trigger.d.ts +1 -1
- package/dist/components/popover/trigger.js +3 -1
- package/dist/components/popover/trigger.js.map +1 -1
- package/dist/components/popover/types.d.ts +11 -22
- package/dist/components/query-builder/actions.js +2 -0
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule-group.js +1 -1
- package/dist/components/query-builder/rule-group.js.map +1 -1
- package/dist/components/query-builder/rule.js +3 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/styles.module.css +87 -0
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +2 -0
- package/dist/components/radio/group.js +1 -1
- package/dist/components/radio/group.js.map +1 -1
- package/dist/components/radio/index.js +3 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.module.css +118 -0
- package/dist/components/search-field/context.d.ts +0 -4
- package/dist/components/search-field/index.d.ts +0 -4
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.module.css +104 -0
- package/dist/components/search-field/types.d.ts +2 -7
- package/dist/components/select-field/context.d.ts +0 -3
- package/dist/components/select-field/index.d.ts +0 -3
- package/dist/components/select-field/index.js +1 -1
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.module.css +78 -0
- package/dist/components/select-field/types.d.ts +0 -3
- package/dist/components/sidenav/avatar.js +1 -1
- package/dist/components/sidenav/avatar.js.map +1 -1
- package/dist/components/sidenav/content.js +3 -1
- package/dist/components/sidenav/content.js.map +1 -1
- package/dist/components/sidenav/footer.js +1 -3
- package/dist/components/sidenav/footer.js.map +1 -1
- package/dist/components/sidenav/header.js +1 -1
- package/dist/components/sidenav/header.js.map +1 -1
- package/dist/components/sidenav/index.js +3 -1
- package/dist/components/sidenav/index.js.map +1 -1
- package/dist/components/sidenav/item.js +1 -1
- package/dist/components/sidenav/item.js.map +1 -1
- package/dist/components/sidenav/link.js +1 -1
- package/dist/components/sidenav/link.js.map +1 -1
- package/dist/components/sidenav/menu-item.js +1 -1
- package/dist/components/sidenav/menu-item.js.map +1 -1
- package/dist/components/sidenav/menu.js +1 -1
- package/dist/components/sidenav/menu.js.map +1 -1
- package/dist/components/sidenav/styles.module.css +311 -0
- package/dist/components/sidenav/types.d.ts +1 -2
- package/dist/components/skeleton/index.d.ts +2 -4
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/skeleton/index.js.map +1 -1
- package/dist/components/skeleton/styles.module.css +33 -0
- package/dist/components/skeleton/types.d.ts +4 -5
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.module.css +220 -0
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.module.css +116 -0
- package/dist/components/table/body.d.ts +0 -3
- package/dist/components/table/body.js +1 -1
- package/dist/components/table/body.js.map +1 -1
- package/dist/components/table/cell.d.ts +0 -3
- package/dist/components/table/cell.js +1 -1
- package/dist/components/table/cell.js.map +1 -1
- package/dist/components/table/context.d.ts +0 -3
- package/dist/components/table/header-cell.d.ts +0 -3
- package/dist/components/table/header-cell.js +1 -1
- package/dist/components/table/header-cell.js.map +1 -1
- package/dist/components/table/header.d.ts +0 -3
- package/dist/components/table/header.js +1 -1
- package/dist/components/table/header.js.map +1 -1
- package/dist/components/table/index.d.ts +0 -3
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/row.d.ts +0 -3
- package/dist/components/table/row.js +1 -1
- package/dist/components/table/row.js.map +1 -1
- package/dist/components/table/styles.module.css +95 -0
- package/dist/components/table/types.d.ts +5 -15
- package/dist/components/tabs/index.js +3 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs/list.js +1 -1
- package/dist/components/tabs/list.js.map +1 -1
- package/dist/components/tabs/panel.js +3 -1
- package/dist/components/tabs/panel.js.map +1 -1
- package/dist/components/tabs/styles.module.css +140 -0
- package/dist/components/tabs/tab.js +1 -1
- package/dist/components/tabs/tab.js.map +1 -1
- package/dist/components/text-area-field/index.js +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.module.css +67 -0
- package/dist/components/text-field/context.d.ts +0 -4
- package/dist/components/text-field/index.d.ts +24 -4
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.module.css +37 -0
- package/dist/components/text-field/types.d.ts +0 -4
- package/dist/components/time-field/index.d.ts +0 -3
- package/dist/components/time-field/index.js +1 -1
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/time-field/styles.module.css +75 -0
- package/dist/components/time-field/types.d.ts +2 -5
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.module.css +20 -0
- package/dist/components/tree/context.d.ts +0 -2
- package/dist/components/tree/context.js +1 -1
- package/dist/components/tree/context.js.map +1 -1
- package/dist/components/tree/index.d.ts +0 -2
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/item-actions.js +1 -1
- package/dist/components/tree/item-actions.js.map +1 -1
- package/dist/components/tree/item-content.d.ts +0 -2
- package/dist/components/tree/item-content.js +1 -1
- package/dist/components/tree/item-content.js.map +1 -1
- package/dist/components/tree/item-description.js +1 -1
- package/dist/components/tree/item-description.js.map +1 -1
- package/dist/components/tree/item-label.js +1 -1
- package/dist/components/tree/item-label.js.map +1 -1
- package/dist/components/tree/item-prefix-icon.js +1 -1
- package/dist/components/tree/item-prefix-icon.js.map +1 -1
- package/dist/components/tree/item.d.ts +0 -2
- package/dist/components/tree/item.js +1 -1
- package/dist/components/tree/item.js.map +1 -1
- package/dist/components/tree/lines.js +1 -1
- package/dist/components/tree/lines.js.map +1 -1
- package/dist/components/tree/styles.module.css +183 -0
- package/dist/components/tree/types.d.ts +6 -5
- package/dist/components/view-stack/trigger.js +2 -0
- package/dist/hooks/coordinate-field/index.d.ts +9 -0
- package/dist/hooks/coordinate-field/index.js +2 -0
- package/dist/hooks/coordinate-field/index.js.map +1 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.d.ts +19 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js +2 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js.map +1 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.d.ts +28 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js +2 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js.map +1 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.d.ts +49 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js +2 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js.map +1 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.d.ts +21 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js +2 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js.map +1 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.d.ts +21 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js +2 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js.map +1 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.d.ts +6 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js +2 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js.map +1 -0
- package/dist/hooks/kanban/index.d.ts +93 -0
- package/dist/hooks/kanban/index.js +2 -0
- package/dist/hooks/kanban/index.js.map +1 -0
- package/dist/hooks/use-tree/state/index.js +2 -0
- package/dist/index.d.ts +58 -61
- package/dist/index.js +1 -1
- package/dist/index.module.css +19 -0
- package/dist/lib/utils.d.ts +1 -17
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/providers/theme-provider.d.ts +1 -1
- package/dist/providers/theme-provider.js +1 -1
- package/dist/providers/theme-provider.js.map +1 -1
- package/package.json +33 -46
- package/dist/components/accordion/styles.d.ts +0 -56
- package/dist/components/accordion/styles.js +0 -2
- package/dist/components/accordion/styles.js.map +0 -1
- package/dist/components/action-bar/styles.d.ts +0 -5
- package/dist/components/action-bar/styles.js +0 -2
- package/dist/components/action-bar/styles.js.map +0 -1
- package/dist/components/avatar/styles.d.ts +0 -48
- package/dist/components/avatar/styles.js +0 -2
- package/dist/components/avatar/styles.js.map +0 -1
- package/dist/components/badge/styles.d.ts +0 -32
- package/dist/components/badge/styles.js +0 -2
- package/dist/components/badge/styles.js.map +0 -1
- package/dist/components/breadcrumbs/styles.d.ts +0 -48
- package/dist/components/breadcrumbs/styles.js +0 -2
- package/dist/components/breadcrumbs/styles.js.map +0 -1
- package/dist/components/button/styles.d.ts +0 -129
- package/dist/components/button/styles.js +0 -2
- package/dist/components/button/styles.js.map +0 -1
- package/dist/components/checkbox/styles.d.ts +0 -54
- package/dist/components/checkbox/styles.js +0 -2
- package/dist/components/checkbox/styles.js.map +0 -1
- package/dist/components/chip/styles.d.ts +0 -247
- package/dist/components/chip/styles.js +0 -2
- package/dist/components/chip/styles.js.map +0 -1
- package/dist/components/classification-badge/styles.d.ts +0 -38
- package/dist/components/classification-badge/styles.js +0 -2
- package/dist/components/classification-badge/styles.js.map +0 -1
- package/dist/components/classification-banner/styles.d.ts +0 -38
- package/dist/components/classification-banner/styles.js +0 -2
- package/dist/components/classification-banner/styles.js.map +0 -1
- package/dist/components/color-picker/styles.d.ts +0 -42
- package/dist/components/color-picker/styles.js +0 -2
- package/dist/components/color-picker/styles.js.map +0 -1
- package/dist/components/combobox-field/styles.d.ts +0 -72
- package/dist/components/combobox-field/styles.js +0 -2
- package/dist/components/combobox-field/styles.js.map +0 -1
- package/dist/components/date-field/styles.d.ts +0 -59
- package/dist/components/date-field/styles.js +0 -2
- package/dist/components/date-field/styles.js.map +0 -1
- package/dist/components/details-list/styles.d.ts +0 -65
- package/dist/components/details-list/styles.js +0 -2
- package/dist/components/details-list/styles.js.map +0 -1
- package/dist/components/dialog/styles.d.ts +0 -60
- package/dist/components/dialog/styles.js +0 -2
- package/dist/components/dialog/styles.js.map +0 -1
- package/dist/components/divider/styles.d.ts +0 -5
- package/dist/components/divider/styles.js +0 -2
- package/dist/components/divider/styles.js.map +0 -1
- package/dist/components/drawer/styles.d.ts +0 -152
- package/dist/components/drawer/styles.js +0 -2
- package/dist/components/drawer/styles.js.map +0 -1
- package/dist/components/hero/styles.d.ts +0 -48
- package/dist/components/hero/styles.js +0 -2
- package/dist/components/hero/styles.js.map +0 -1
- package/dist/components/hotkey/hotkey-set.d.ts +0 -9
- package/dist/components/hotkey/hotkey-set.js +0 -2
- package/dist/components/hotkey/hotkey-set.js.map +0 -1
- package/dist/components/hotkey/styles.d.ts +0 -53
- package/dist/components/hotkey/styles.js +0 -2
- package/dist/components/hotkey/styles.js.map +0 -1
- package/dist/components/icon/styles.d.ts +0 -5
- package/dist/components/icon/styles.js +0 -2
- package/dist/components/icon/styles.js.map +0 -1
- package/dist/components/input/styles.d.ts +0 -142
- package/dist/components/input/styles.js +0 -2
- package/dist/components/input/styles.js.map +0 -1
- package/dist/components/label/styles.d.ts +0 -5
- package/dist/components/label/styles.js +0 -2
- package/dist/components/label/styles.js.map +0 -1
- package/dist/components/lines/styles.d.ts +0 -32
- package/dist/components/lines/styles.js +0 -2
- package/dist/components/lines/styles.js.map +0 -1
- package/dist/components/link/styles.d.ts +0 -5
- package/dist/components/link/styles.js +0 -2
- package/dist/components/link/styles.js.map +0 -1
- package/dist/components/menu/styles.d.ts +0 -71
- package/dist/components/menu/styles.js +0 -2
- package/dist/components/menu/styles.js.map +0 -1
- package/dist/components/notice/styles.d.ts +0 -60
- package/dist/components/notice/styles.js +0 -2
- package/dist/components/notice/styles.js.map +0 -1
- package/dist/components/options/styles.d.ts +0 -72
- package/dist/components/options/styles.js +0 -2
- package/dist/components/options/styles.js.map +0 -1
- package/dist/components/popover/body.d.ts +0 -8
- package/dist/components/popover/body.js +0 -4
- package/dist/components/popover/body.js.map +0 -1
- package/dist/components/popover/styles.d.ts +0 -48
- package/dist/components/popover/styles.js +0 -2
- package/dist/components/popover/styles.js.map +0 -1
- package/dist/components/query-builder/styles.d.ts +0 -152
- package/dist/components/query-builder/styles.js +0 -2
- package/dist/components/query-builder/styles.js.map +0 -1
- package/dist/components/radio/styles.d.ts +0 -54
- package/dist/components/radio/styles.js +0 -2
- package/dist/components/radio/styles.js.map +0 -1
- package/dist/components/search-field/styles.d.ts +0 -53
- package/dist/components/search-field/styles.js +0 -2
- package/dist/components/search-field/styles.js.map +0 -1
- package/dist/components/select-field/styles.d.ts +0 -66
- package/dist/components/select-field/styles.js +0 -2
- package/dist/components/select-field/styles.js.map +0 -1
- package/dist/components/sidenav/styles.d.ts +0 -156
- package/dist/components/sidenav/styles.js +0 -2
- package/dist/components/sidenav/styles.js.map +0 -1
- package/dist/components/skeleton/styles.d.ts +0 -23
- package/dist/components/skeleton/styles.js +0 -2
- package/dist/components/skeleton/styles.js.map +0 -1
- package/dist/components/slider/styles.d.ts +0 -84
- package/dist/components/slider/styles.js +0 -2
- package/dist/components/slider/styles.js.map +0 -1
- package/dist/components/switch/styles.d.ts +0 -44
- package/dist/components/switch/styles.js +0 -2
- package/dist/components/switch/styles.js.map +0 -1
- package/dist/components/table/styles.d.ts +0 -134
- package/dist/components/table/styles.js +0 -2
- package/dist/components/table/styles.js.map +0 -1
- package/dist/components/tabs/styles.d.ts +0 -48
- package/dist/components/tabs/styles.js +0 -2
- package/dist/components/tabs/styles.js.map +0 -1
- package/dist/components/text-area-field/styles.d.ts +0 -54
- package/dist/components/text-area-field/styles.js +0 -2
- package/dist/components/text-area-field/styles.js.map +0 -1
- package/dist/components/text-field/styles.d.ts +0 -54
- package/dist/components/text-field/styles.js +0 -2
- package/dist/components/text-field/styles.js.map +0 -1
- package/dist/components/time-field/styles.d.ts +0 -69
- package/dist/components/time-field/styles.js +0 -2
- package/dist/components/time-field/styles.js.map +0 -1
- package/dist/components/tooltip/styles.d.ts +0 -5
- package/dist/components/tooltip/styles.js +0 -2
- package/dist/components/tooltip/styles.js.map +0 -1
- package/dist/components/tree/styles.d.ts +0 -128
- package/dist/components/tree/styles.js +0 -2
- package/dist/components/tree/styles.js.map +0 -1
- package/dist/index.css +0 -196
- package/dist/styles.css +0 -9484
- package/dist/tokens/themes.css +0 -882
- package/dist/tokens/themes.d.ts +0 -1
- package/dist/tokens/tokens.css +0 -202
- package/dist/tokens/tokens.d.ts +0 -468
- package/dist/tokens/tokens.js +0 -2
- package/dist/tokens/tokens.js.map +0 -1
- package/dist/tokens/types.d.ts +0 -308
- package/dist/variants/variants.css +0 -86
- package/dist/variants/variants.d.ts +0 -2
- /package/dist/{tokens → components/kanban}/types.js +0 -0
- /package/dist/{tokens → components/kanban}/types.js.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item-actions.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item-actions.tsx"],"names":["useContext","TreeContext","s","n","m","className"],"mappings":"+MAuBE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAEA,CAAA,CAAA,CAAA,CAAA,CAAM,KAAE,CAAA,OAAYA,CAAWC,CAAW,CAAA,CAC1CC,UAAA,CAAAC,WAAA,CAAA,CAAA,OACGC,GAAA,CAAA,gBAA2B,gBAA0BC,CAAS,CAAA,CAC5D,CAAA,CAAA,CAAA,CAAA,CAAA,QAGP,CAAA,CAAA,CAAA,CAAA","file":"item-actions.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { type PropsWithChildren, useContext } from 'react';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\n\n/**\n * ItemActions - Action buttons for a tree item\n *\n * Container for action buttons in a tree item\n */\nexport function TreeItemActions({\n children,\n className,\n}: PropsWithChildren & { className?: string }) {\n const { variant } = useContext(TreeContext);\n return (\n <div className={clsx(styles.actions, styles[variant], className)}>\n {children}\n </div>\n );\n}\n"]}
|
|
@@ -2,10 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { TreeItemContentProps } from './types.js';
|
|
3
3
|
import '@react-types/shared';
|
|
4
4
|
import 'react-aria-components';
|
|
5
|
-
import 'tailwind-variants';
|
|
6
5
|
import '../../hooks/use-tree/types.js';
|
|
7
6
|
import 'react';
|
|
8
|
-
import './styles.js';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* ItemContent - Content of a tree item
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx,jsxs}from'react/jsx-runtime';import {Show,Hide,ChevronDown,ChevronUp,DragVert}from'@accelint/icons';import {useContext}from'react';import {TreeItemContent}from'react-aria-components';import {Button}from'../button/index.js';import {Checkbox}from'../checkbox/index.js';import {Icon}from'../icon/index.js';import {IconProvider}from'../icon/context.js';import {TreeContext,TreeItemContext}from'./context.js';import {TreeLines}from'./lines.js';import
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {clsx}from'@accelint/design-foundation/lib/utils';import {Show,Hide,ChevronDown,ChevronUp,DragVert}from'@accelint/icons';import {useContext}from'react';import {TreeItemContent}from'react-aria-components';import {Button}from'../button/index.js';import {Checkbox}from'../checkbox/index.js';import {Icon}from'../icon/index.js';import {IconProvider}from'../icon/context.js';import {TreeContext,TreeItemContext}from'./context.js';import {TreeLines}from'./lines.js';import t from'./styles.module.css';function $({children:n}){const{showVisibility:h,variant:o,visibleKeys:d,onVisibilityChange:b}=useContext(TreeContext),{isVisible:p,isViewable:u}=useContext(TreeItemContext),i=o==="cozy"?"medium":"small";return jsx(TreeItemContent,{children:f=>{const{id:s,allowsDragging:g,hasChildItems:v,level:y,selectionBehavior:T,selectionMode:w,state:x,isDisabled:r,isExpanded:S,isSelected:D}=f,C=!(x.collection.getItem(s)?.nextKey||v),z=T==="toggle"&&w!=="none",N=()=>{const a=new Set(d);d?.has(s)?a.delete(s):a.add(s),b?.(a);};return jsx(IconProvider,{size:i,children:jsxs("div",{className:clsx("group",t.content,t[o]),"data-last-of-set":C,children:[h&&jsx(Button,{variant:"icon",color:"mono-bold",size:i,onPress:N,isDisabled:r,className:t.visibility,children:jsx(Icon,{children:p?jsx(Show,{}):jsx(Hide,{})})}),y>1&&jsx(TreeLines,{level:y,isLastOfSet:C}),v?jsx(Button,{slot:"chevron",variant:"icon",size:i,className:t.expansion,children:jsx(Icon,{children:S?jsx(ChevronDown,{}):jsx(ChevronUp,{})})}):jsx("div",{className:clsx(t.spacing,t[o])}),jsx("div",{className:clsx(t.display,t[o]),children:typeof n=="function"?n({...f,variant:o,isVisible:p,isViewable:u,defaultChildren:null}):n}),z&&jsx(Checkbox,{slot:"selection",isSelected:D,isDisabled:r}),g&&jsx(Button,{slot:"drag",variant:"icon",size:i,isDisabled:r,className:t.drag,children:jsx(Icon,{children:jsx(DragVert,{})})})]})})}})}export{$ as TreeItemContent};//# sourceMappingURL=item-content.js.map
|
|
2
2
|
//# sourceMappingURL=item-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item-content.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item-content.tsx"],"names":["onVisibilityChange","variant","I","jsx","AriaTreeItemContent","id","e","allowsDragging","hasChildItems","level","selectionBehavior","selectionMode","state","renderProps","isLastOfSet","shouldShowSelection","handlePress","keys","jsxs","O","U","l","Button","size","m","TreeLines","c","L","K","M","styles","clsx","V","isVisible","isSelected","A","isDisabled","Icon","DragVert","P"],"mappings":"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","file":"item-content.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { ChevronDown, ChevronUp, DragVert, Hide, Show } from '@accelint/icons';\nimport { useContext } from 'react';\nimport { TreeItemContent as AriaTreeItemContent } from 'react-aria-components';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Icon } from '../icon';\nimport { IconProvider } from '../icon/context';\nimport { TreeContext, TreeItemContext } from './context';\nimport { TreeLines } from './lines';\nimport styles from './styles.module.css';\nimport type { Key } from '@react-types/shared';\nimport type { TreeItemContentProps } from './types';\n\n/**\n * ItemContent - Content of a tree item\n *\n * Renders the content of a tree item with proper styling\n */\nexport function TreeItemContent({ children }: TreeItemContentProps) {\n const { showVisibility, variant, visibleKeys, onVisibilityChange } =\n useContext(TreeContext);\n const { isVisible, isViewable } = useContext(TreeItemContext);\n const size = variant === 'cozy' ? 'medium' : 'small';\n\n return (\n <AriaTreeItemContent>\n {(renderProps) => {\n const {\n id,\n allowsDragging,\n hasChildItems,\n level,\n selectionBehavior,\n selectionMode,\n state,\n isDisabled,\n isExpanded,\n isSelected,\n } = renderProps;\n\n const isLastOfSet = !(\n state.collection.getItem(id)?.nextKey || hasChildItems\n );\n const shouldShowSelection =\n selectionBehavior === 'toggle' && selectionMode !== 'none';\n\n const handlePress = () => {\n const keys = new Set<Key>(visibleKeys);\n visibleKeys?.has(id) ? keys.delete(id) : keys.add(id);\n onVisibilityChange?.(keys);\n };\n\n return (\n <IconProvider size={size}>\n <div\n className={clsx('group', styles.content, styles[variant])}\n data-last-of-set={isLastOfSet}\n >\n {showVisibility && (\n <Button\n variant='icon'\n color='mono-bold'\n size={size}\n onPress={handlePress}\n isDisabled={isDisabled}\n className={styles.visibility}\n >\n <Icon>{isVisible ? <Show /> : <Hide />}</Icon>\n </Button>\n )}\n {level > 1 && (\n <TreeLines level={level} isLastOfSet={isLastOfSet} />\n )}\n {hasChildItems ? (\n <Button\n slot='chevron'\n variant='icon'\n size={size}\n className={styles.expansion}\n >\n <Icon>{isExpanded ? <ChevronDown /> : <ChevronUp />}</Icon>\n </Button>\n ) : (\n <div className={clsx(styles.spacing, styles[variant])} />\n )}\n <div className={clsx(styles.display, styles[variant])}>\n {typeof children === 'function'\n ? children({\n ...renderProps,\n variant,\n isVisible,\n isViewable: isViewable,\n defaultChildren: null,\n })\n : children}\n </div>\n {shouldShowSelection && (\n <Checkbox\n slot='selection'\n isSelected={isSelected}\n isDisabled={isDisabled}\n />\n )}\n {allowsDragging && (\n <Button\n slot='drag'\n variant='icon'\n size={size}\n isDisabled={isDisabled}\n className={styles.drag}\n >\n <Icon>\n <DragVert />\n </Icon>\n </Button>\n )}\n </div>\n </IconProvider>\n );\n }}\n </AriaTreeItemContent>\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {useContext}from'react';import {Text}from'react-aria-components';import {TreeContext}from'./context.js';import
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {clsx}from'@accelint/design-foundation/lib/utils';import {useContext}from'react';import {Text}from'react-aria-components';import {TreeContext}from'./context.js';import s from'./styles.module.css';function T({children:t,className:o}){const{variant:r}=useContext(TreeContext);return r!=="crammed"?jsx(Text,{"data-slot":"description",className:clsx(s.description,o),children:t}):null}export{T as TreeItemDescription};//# sourceMappingURL=item-description.js.map
|
|
2
2
|
//# sourceMappingURL=item-description.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item-description.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item-description.tsx"],"names":["useContext","TreeContext","m","p","n","i","e"],"mappings":"+OAuBO,SAA+B,CAAA,CAAA,CAAA,QAAU,CAAA,CAAA,CAAA,SAC9C,CAAA,CAAA,CAAA,CAAA,CAAM,KAAE,CAAA,OAAYA,CAAWC,CAAW,CAAA,CAE1CC,UAAA,CAAAC,WAAA,CAAA,CAAA,OAAmB,CAAA,GAAA,SAChB,CACCC,GAAA,CAAAC,IAAA,CAAA,CAAA,WAAU,CAAA,aACV,CAAA,SAAuB,CAAAC,IAAA,CAAA,CAAA,CAAA,WAEtB,CAAA,CAAA,CAAA,CAAA,QAED,CAAA,CAAA,CAAA,CACN,CAAA,IAAA","file":"item-description.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useContext } from 'react';\nimport { Text, type TextProps } from 'react-aria-components';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\n\n/**\n * ItemDescription - Description for a tree item\n *\n * Renders secondary descriptive text for a tree item\n */\nexport function TreeItemDescription({ children, className }: TextProps) {\n const { variant } = useContext(TreeContext);\n\n return variant !== 'crammed' ? (\n <Text\n data-slot='description'\n className={clsx(styles.description, className)}\n >\n {children}\n </Text>\n ) : null;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {Text}from'react-aria-components';import
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {clsx}from'@accelint/design-foundation/lib/utils';import {Text}from'react-aria-components';import m from'./styles.module.css';function T({children:e,className:t}){return jsx(Text,{className:clsx(m.label,t),children:e})}export{T as TreeItemLabel};//# sourceMappingURL=item-label.js.map
|
|
2
2
|
//# sourceMappingURL=item-label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item-label.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item-label.tsx"],"names":["children","className","Text","clsx","styles"],"mappings":"yKAqBO,UAAuB,CAAE,CAAA,QAAAA,CAAAA,CAAU,CAAA,SAAAC,CAAU,CAAA,CAAc,CAChE,CAAA,UAAQC,CAAAA,IAAA,CAAK,CAAA,SAAWC,CAAAA,IAAKC,EAAO,CAAA,KAAOH,CAAS,CAAA,CAAI,CAAA,QAAAD,EAAS,CACnE,CAAA","file":"item-label.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { Text, type TextProps } from 'react-aria-components';\nimport styles from './styles.module.css';\n\n/**\n * ItemLabel - Label for a tree item\n *\n * Renders the primary text label for a tree item\n */\nexport function TreeItemLabel({ children, className }: TextProps) {\n return <Text className={clsx(styles.label, className)}>{children}</Text>;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {Icon}from'../icon/index.js';import
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {clsx}from'@accelint/design-foundation/lib/utils';import {Icon}from'../icon/index.js';import n from'./styles.module.css';function s({children:o,className:r}){return jsx(Icon,{className:clsx(n.icon,r),children:o})}export{s as TreeItemPrefixIcon};//# sourceMappingURL=item-prefix-icon.js.map
|
|
2
2
|
//# sourceMappingURL=item-prefix-icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item-prefix-icon.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item-prefix-icon.tsx"],"names":["children","className","jsx","Icon","p","m","clsx","c"],"mappings":"oKAsBmC,SAAE,CAAAA,CAAAA,CAAU,QAAA,CAAA,CAAAC,CAAU,SACvD,CAAOC,EAACC,CAAAA,CAAA,OAAKC,GAAA,CAAAC,IAAA,CAAWC,CAAAA,SAA2B,CAAAC,IAAI,CAAA,CAAA,CAAA,IAAA,CAAA,CAAAP,EAAS,QAClE,CAAA,CAAA,CAAA,CAAA","file":"item-prefix-icon.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { Icon } from '../icon';\nimport styles from './styles.module.css';\nimport type { IconProps } from '../icon/types';\n\n/**\n * ItemIcon - Icon for a tree item\n *\n * Renders an icon for a tree item\n */\nexport function TreeItemPrefixIcon({ children, className }: IconProps) {\n return <Icon className={clsx(styles.icon, className)}>{children}</Icon>;\n}\n"]}
|
|
@@ -2,10 +2,8 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { TreeItemProps } from './types.js';
|
|
3
3
|
import '@react-types/shared';
|
|
4
4
|
import 'react-aria-components';
|
|
5
|
-
import 'tailwind-variants';
|
|
6
5
|
import '../../hooks/use-tree/types.js';
|
|
7
6
|
import 'react';
|
|
8
|
-
import './styles.js';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* TreeItem - Individual node in a tree
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {jsx}from'react/jsx-runtime';import'client-only';import {useContext}from'react';import {TreeItem,composeRenderProps}from'react-aria-components';import {TreeContext,TreeItemContext}from'./context.js';import
|
|
3
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {clsx}from'@accelint/design-foundation/lib/utils';import {useContext}from'react';import {TreeItem,composeRenderProps}from'react-aria-components';import {TreeContext,TreeItemContext}from'./context.js';import I from'./styles.module.css';function w({className:p,id:e,...l}){const{visibilityComputedKeys:c,visibleKeys:r,isStatic:u}=useContext(TreeContext),{ancestors:o}=useContext(TreeItemContext),s=c?.has(e)||u&&o.every(t=>r?.has(t)),i=r?.has(e);return jsx(TreeItemContext.Provider,{value:{isVisible:i,isViewable:s,ancestors:[...o,e]},children:jsx(TreeItem,{...l,id:e,className:composeRenderProps(p,t=>clsx("group/tree-item",I.item,t)),"data-viewable":s||null,"data-visible":i||null})})}export{w as TreeItem};//# sourceMappingURL=item.js.map
|
|
4
4
|
//# sourceMappingURL=item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/item.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/item.tsx"],"names":["id","rest","useContext","TreeContext","m","y","TreeItemContext","isViewable","visibilityComputedKeys","isStatic","ancestors","visibleKeys","isVisible","n","a","T","className","clsx","v"],"mappings":"0SA6BO,SAAoB,CAAA,CAAA,CAAA,SAAW,CAAAA,CAAAA,CAAI,EAAA,CAAGC,CAAK,CAAA,GAChD,CAAA,CAAA,CAAA,CAAM,KAAE,CAAA,sBAAwB,CAAA,CAAA,CAAA,WAAa,CAAA,CAAA,CAAA,QAC3CC,CAAWC,CAAW,CAAA,CAClBC,UAAE,CAAAC,WAAA,CAAA,CAAA,CAAA,SAAcH,CAAWI,CAAe,CAAA,CAC1CC,UAAAA,CACJC,eAAAA,CAAAA,CAAwB,CAAA,CAAA,CAAA,EAAM,GAC7BC,CAAAA,CAAAA,CAAYC,EAAU,CAAA,EAAA,CAAA,CAAA,KAAeC,CAAAA,CAAa,EAAA,CAAA,EAAO,GACtDC,CAAAA,CAAYD,CAAAA,CAAAA,CAAa,CAAA,CAAA,CAAA,EAAM,GAErC,CAAA,CAAA,CAAA,CAAA,OACmBE,GAAA,CAAAC,eAAA,CAAA,QACf,CAAA,CAAA,KACE,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SAAeJ,CAAAA,CAAWV,GAC5B,CAEA,CAAA,CAAA,CAAA,CAAA,CAAA,QAAC,CACEa,GAAA,CAAAE,QAAGd,CAAAA,CACJ,GAAID,CAAAA,CACJ,EAAA,CAAA,CAAA,CAAA,SAA0CgB,CAAAA,kBAAAA,CACxCC,CAAAA,CAAK,CAAA,EAAAC,IAAA,CAAA,iBAA0B,CAAA,CAAA,CAAMF,IAEvC,CAAA,CAAA,CAAA,CAAA,CAAA,eAA6B,CAAA,CAAA,EAC7B,IAAA,CAAA,cAA2B,CAAA,CAAA,EAC7B,IAGN,CAAA,CAAA,CAAA,CAAA","file":"item.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useContext } from 'react';\nimport {\n TreeItem as AriaTreeItem,\n composeRenderProps,\n} from 'react-aria-components';\nimport { TreeContext, TreeItemContext } from './context';\nimport styles from './styles.module.css';\nimport type { TreeItemProps } from './types';\n\n/**\n * TreeItem - Individual node in a tree\n *\n * Represents a single item in the tree structure\n */\nexport function TreeItem({ className, id, ...rest }: TreeItemProps) {\n const { visibilityComputedKeys, visibleKeys, isStatic } =\n useContext(TreeContext);\n const { ancestors } = useContext(TreeItemContext);\n const isViewable =\n visibilityComputedKeys?.has(id) ||\n (isStatic && ancestors.every((key) => visibleKeys?.has(key)));\n const isVisible = visibleKeys?.has(id);\n\n return (\n <TreeItemContext.Provider\n value={{\n isVisible,\n isViewable,\n ancestors: [...ancestors, id],\n }}\n >\n <AriaTreeItem\n {...rest}\n id={id}\n className={composeRenderProps(className, (className) =>\n clsx('group/tree-item', styles.item, className),\n )}\n data-viewable={isViewable || null}\n data-visible={isVisible || null}\n />\n </TreeItemContext.Provider>\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {memo,useContext}from'react';import {Lines}from'../lines/index.js';import {TreeContext}from'./context.js';import
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {clsx}from'@accelint/design-foundation/lib/utils';import {memo,useContext}from'react';import {Lines}from'../lines/index.js';import {TreeContext}from'./context.js';import t from'./styles.module.css';const z=memo(function({level:o,isLastOfSet:n}){const{showRuleLines:s,variant:r}=useContext(TreeContext);return Array.from({length:o}).map((b,e)=>{const i=e===o-1?"branch":"vert",m=n&&e>0?"last":i;return jsx(Lines,{variant:m,size:r==="crammed"?"medium":"large",isVisible:s,className:clsx(t.spacing,t[r])},e)})});export{z as TreeLines};//# sourceMappingURL=lines.js.map
|
|
2
2
|
//# sourceMappingURL=lines.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tree/lines.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/lines.tsx"],"names":["isLastOfSet","showRuleLines","useContext","TreeContext","c","u","i","type","f","p","variant","styles","a"],"mappings":"iPAmBE,sBACA,CAAA,KAAAA,CACF,CAAA,CAGG,WACO,CAAA,CAAA,CAAA,CAAA,CAAA,KAAAC,cAA2BC,CAAWC,CAAW,CAAA,OAEzD,CAAO,CAAA,CAAA,CAAAC,UAAA,CAAAC,WAAM,CAAA,CAAA,OAAO,KAAc,CAAC,IAAE,CAAA,CAAI,MAAIC,CAAM,CACjD,CAAA,CAAA,CAAA,GAAMC,CAAAA,CAAOD,MAAc,CAAA,YAAe,CAAA,CAAA,CAAA,CAAA,QACV,CAAA,MAAI,CAAA,CAASC,CAAAA,CAG7C,EAAA,CAAA,CAAA,CAAA,CAAA,MAII,CAAA,CAAA,CAAA,OACAC,GAAA,CAAAC,KAAA,CAAA,CAPSC,cAAwB,CAAA,CAAA,GAAA,SAAW,CAAA,gBAS5C,CAAA,SAAgBC,CAAAA,CAAO,CAAA,SAAgBD,CAAOE,IAAC,GAJ1CN,OAQZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"lines.js","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 { clsx } from '@accelint/design-foundation/lib/utils';\nimport { memo, useContext } from 'react';\nimport { Lines } from '../lines';\nimport { TreeContext } from './context';\nimport styles from './styles.module.css';\n\nexport const TreeLines = memo(function TreeLines({\n level,\n isLastOfSet,\n}: {\n level: number;\n isLastOfSet: boolean;\n}) {\n const { showRuleLines, variant } = useContext(TreeContext);\n\n return Array.from({ length: level }).map((_, i) => {\n const type = i === level - 1 ? 'branch' : 'vert';\n const line = isLastOfSet && i > 0 ? 'last' : type;\n const size = variant === 'crammed' ? 'medium' : 'large';\n\n return (\n <Lines\n // biome-ignore lint/suspicious/noArrayIndexKey: index should be the key, only count matters\n key={i}\n variant={line}\n size={size}\n isVisible={showRuleLines}\n className={clsx(styles.spacing, styles[variant])}\n />\n );\n });\n});\n"]}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at https://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@reference '../../index.module.css';
|
|
14
|
+
|
|
15
|
+
@layer components.l1 {
|
|
16
|
+
.tree {
|
|
17
|
+
@apply overflow-auto outline-hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.item {
|
|
21
|
+
@apply fg-primary-bold px-s rounded-medium;
|
|
22
|
+
|
|
23
|
+
@variant not-visible {
|
|
24
|
+
@apply fg-primary-muted;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@variant not-viewable {
|
|
28
|
+
@apply fg-primary-muted;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@variant hover {
|
|
32
|
+
@apply bg-interactive-muted-hover;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@variant focus-visible {
|
|
36
|
+
@apply bg-interactive-muted-hover;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@variant pressed {
|
|
40
|
+
@apply bg-interactive-muted-pressed;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@variant drop-target {
|
|
44
|
+
@apply outline-accent-primary-bold border;
|
|
45
|
+
background-color: --alpha(var(--bg-accent-primary-muted) / 20%);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@variant disabled {
|
|
49
|
+
@apply cursor-not-allowed border-none;
|
|
50
|
+
|
|
51
|
+
@variant hover {
|
|
52
|
+
@apply bg-transparent;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@variant data-[drop-target=true] {
|
|
56
|
+
@apply bg-transparent;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&.cozy {
|
|
61
|
+
@apply min-h-s;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.compact {
|
|
65
|
+
@apply min-h-l;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&.crammed {
|
|
69
|
+
@apply min-h-s;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.content {
|
|
74
|
+
@apply px-xs flex w-full items-center justify-items-start overflow-x-auto outline-hidden;
|
|
75
|
+
|
|
76
|
+
&.cozy {
|
|
77
|
+
@apply text-header-m;
|
|
78
|
+
min-height: 48px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&.compact {
|
|
82
|
+
@apply gap-xs text-header-s;
|
|
83
|
+
min-height: 36px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&.crammed {
|
|
87
|
+
@apply gap-xs text-header-s;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.display {
|
|
92
|
+
@apply grid flex-1 items-center;
|
|
93
|
+
grid-template-columns: auto auto 1fr auto;
|
|
94
|
+
grid-template-areas:
|
|
95
|
+
'icon label space action'
|
|
96
|
+
'icon description space action';
|
|
97
|
+
|
|
98
|
+
&.cozy {
|
|
99
|
+
@apply gap-x-s px-xs;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.compact {
|
|
103
|
+
@apply gap-x-s px-xxs;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.crammed {
|
|
107
|
+
@apply gap-x-xs px-xxs;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.icon {
|
|
112
|
+
grid-area: icon;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.label {
|
|
116
|
+
grid-area: label;
|
|
117
|
+
|
|
118
|
+
@variant not-has-[+[data-slot=description]] {
|
|
119
|
+
@apply row-span-full;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&.cozy,
|
|
123
|
+
&.compact,
|
|
124
|
+
&.crammed {
|
|
125
|
+
@apply gap-xs;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.description {
|
|
130
|
+
@apply fg-primary-muted text-body-s;
|
|
131
|
+
grid-area: description;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.actions {
|
|
135
|
+
@apply flex shrink-0 items-center;
|
|
136
|
+
grid-area: action;
|
|
137
|
+
|
|
138
|
+
&.cozy {
|
|
139
|
+
@apply gap-x-xs;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&.compact {
|
|
143
|
+
@apply gap-x-xxs;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.crammed {
|
|
147
|
+
@apply gap-x-xxs;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.spacing {
|
|
152
|
+
&.cozy {
|
|
153
|
+
min-height: 46px;
|
|
154
|
+
width: 28px;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.compact {
|
|
158
|
+
min-height: 38px;
|
|
159
|
+
width: 20px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.crammed {
|
|
163
|
+
@apply min-h-xl;
|
|
164
|
+
width: 20px;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.visibility,
|
|
169
|
+
.expansion,
|
|
170
|
+
.drag {
|
|
171
|
+
@apply fg-primary-bold;
|
|
172
|
+
|
|
173
|
+
@variant color-mono-bold {
|
|
174
|
+
@variant group-not-visible/tree-item {
|
|
175
|
+
@apply fg-primary-muted;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
@variant group-not-viewable/tree-item {
|
|
179
|
+
@apply fg-primary-muted;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Key } from '@react-types/shared';
|
|
2
2
|
import { TreeProps as TreeProps$1, RenderProps, TreeItemContentRenderProps as TreeItemContentRenderProps$1, TreeItemProps as TreeItemProps$1 } from 'react-aria-components';
|
|
3
|
-
import { VariantProps } from 'tailwind-variants';
|
|
4
3
|
import { TreeNode, DragAndDropConfig } from '../../hooks/use-tree/types.js';
|
|
5
|
-
import { TreeStyles } from './styles.js';
|
|
6
4
|
import 'react';
|
|
7
5
|
|
|
8
|
-
type
|
|
6
|
+
type TreeStyleVariant = 'cozy' | 'compact' | 'crammed';
|
|
7
|
+
type TreeProps<T> = Omit<TreeProps$1<TreeNode<T>>, 'defaultExpandedKeys' | 'defaultSelectedKeys' | 'disabledKeys' | 'expandedKeys' | 'selectedKeys' | 'onSelectionChange'> & {
|
|
9
8
|
disabledKeys?: Set<Key>;
|
|
10
9
|
dragAndDropConfig?: DragAndDropConfig;
|
|
11
10
|
expandedKeys?: Set<Key>;
|
|
@@ -15,14 +14,16 @@ type TreeProps<T> = Omit<TreeProps$1<TreeNode<T>>, 'defaultExpandedKeys' | 'defa
|
|
|
15
14
|
showVisibility?: boolean;
|
|
16
15
|
onVisibilityChange?: (keys: Set<Key>) => void;
|
|
17
16
|
onSelectionChange?: (keys: Set<Key>) => void;
|
|
17
|
+
variant?: TreeStyleVariant;
|
|
18
18
|
};
|
|
19
19
|
type TreeItemProps = Omit<TreeItemProps$1, 'id'> & {
|
|
20
20
|
id: Key;
|
|
21
21
|
};
|
|
22
22
|
type TreeItemContentProps = Pick<RenderProps<TreeItemContentRenderProps>, 'children'>;
|
|
23
|
-
type TreeItemContentRenderProps = TreeItemContentRenderProps$1 &
|
|
23
|
+
type TreeItemContentRenderProps = TreeItemContentRenderProps$1 & {
|
|
24
24
|
isViewable?: boolean;
|
|
25
25
|
isVisible?: boolean;
|
|
26
|
+
variant?: TreeStyleVariant;
|
|
26
27
|
};
|
|
27
28
|
type TreeContextValue = Required<Pick<TreeProps<unknown>, 'showRuleLines' | 'showVisibility' | 'variant' | 'onVisibilityChange'>> & {
|
|
28
29
|
disabledKeys?: Set<Key>;
|
|
@@ -38,4 +39,4 @@ type TreeItemContextValue = {
|
|
|
38
39
|
ancestors: Key[];
|
|
39
40
|
};
|
|
40
41
|
|
|
41
|
-
export type { TreeContextValue, TreeItemContentProps, TreeItemContentRenderProps, TreeItemContextValue, TreeItemProps, TreeProps };
|
|
42
|
+
export type { TreeContextValue, TreeItemContentProps, TreeItemContentRenderProps, TreeItemContextValue, TreeItemProps, TreeProps, TreeStyleVariant };
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import {jsx}from'react/jsx-runtime';import'client-only';import {isUUID}from'@accelint/core';import {useContext}from'react';import {Pressable}from'react-aria-components';import {ViewStackContext,useViewStackEmit}from'./context.js';function S({children:i,for:e}){const{parent:o}=useContext(ViewStackContext),n=useViewStackEmit();function s(){for(const r of Array.isArray(e)?e:[e]){let[p,t]=isUUID(r)?["push",r]:r.split(":");t??=o,t&&n[p](t);}}return jsx(Pressable,{onPress:s,children:i})}export{S as ViewStackTrigger};//# sourceMappingURL=trigger.js.map
|
|
2
4
|
//# sourceMappingURL=trigger.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { UseCoordinateCopyOptions, UseCoordinateCopyResult, useCoordinateCopy } from './use-coordinate-copy.js';
|
|
2
|
+
export { UseCoordinateFieldResult, useCoordinateField } from './use-coordinate-field.js';
|
|
3
|
+
export { UseCoordinateFieldStateOptions, UseCoordinateFieldStateResult, useCoordinateFieldState } from './use-coordinate-field-state.js';
|
|
4
|
+
export { UseCoordinateFocusOptions, UseCoordinateFocusResult, useCoordinateFocus } from './use-coordinate-focus.js';
|
|
5
|
+
export { UseCoordinatePasteOptions, UseCoordinatePasteResult, useCoordinatePaste } from './use-coordinate-paste.js';
|
|
6
|
+
export { UseTimeoutCleanupResult, useTimeoutCleanup } from './use-timeout-cleanup.js';
|
|
7
|
+
import '../../components/coordinate-field/types.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import 'react-aria-components';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export{useCoordinateCopy}from'./use-coordinate-copy.js';export{useCoordinateField}from'./use-coordinate-field.js';export{useCoordinateFieldState}from'./use-coordinate-field-state.js';export{useCoordinateFocus}from'./use-coordinate-focus.js';export{useCoordinatePaste}from'./use-coordinate-paste.js';export{useTimeoutCleanup}from'./use-timeout-cleanup.js';//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CoordinateValue, CoordinateSystem } from '../../components/coordinate-field/types.js';
|
|
2
|
+
import { UseTimeoutCleanupResult } from './use-timeout-cleanup.js';
|
|
3
|
+
import 'react';
|
|
4
|
+
import 'react-aria-components';
|
|
5
|
+
|
|
6
|
+
interface UseCoordinateCopyOptions {
|
|
7
|
+
currentValue: CoordinateValue | null;
|
|
8
|
+
validationErrors: string[];
|
|
9
|
+
isDisabled: boolean;
|
|
10
|
+
registerTimeout: UseTimeoutCleanupResult['registerTimeout'];
|
|
11
|
+
}
|
|
12
|
+
interface UseCoordinateCopyResult {
|
|
13
|
+
copiedFormat: CoordinateSystem | null;
|
|
14
|
+
handleCopyFormat: (formatToCopy: CoordinateSystem) => Promise<void>;
|
|
15
|
+
isFormatButtonEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function useCoordinateCopy({ currentValue, validationErrors, isDisabled, registerTimeout, }: UseCoordinateCopyOptions): UseCoordinateCopyResult;
|
|
18
|
+
|
|
19
|
+
export { type UseCoordinateCopyOptions, type UseCoordinateCopyResult, useCoordinateCopy };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {getLogger}from'@accelint/logger';import {useState}from'react';import {getAllCoordinateFormats}from'../../components/coordinate-field/coordinate-utils.js';const f=getLogger({enabled:process.env.NODE_ENV!=="production",level:"debug",prefix:"[CoordinateField]",pretty:true});const l=2e3;function v({currentValue:r,validationErrors:s,isDisabled:d,registerTimeout:a}){const[m,t]=useState(null),p=(o,n)=>{const e=document.createElement("textarea");e.value=o,e.style.position="fixed",e.style.left="-999999px",e.style.top="-999999px",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy"),t(n),a(setTimeout(()=>{t(null);},l));}catch(i){f.withError(i).warn("Fallback copy to clipboard failed");}document.body.removeChild(e);},u=async o=>{if(!r)return;const e=getAllCoordinateFormats(r)[o];if(e.isValid)try{await navigator.clipboard.writeText(e.value),t(o),a(setTimeout(()=>{t(null);},l));}catch{p(e.value,o);}},c=r!==null&&s.length===0&&!d;return {copiedFormat:m,handleCopyFormat:u,isFormatButtonEnabled:c}}export{v as useCoordinateCopy};//# sourceMappingURL=use-coordinate-copy.js.map
|
|
2
|
+
//# sourceMappingURL=use-coordinate-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/coordinate-field/use-coordinate-copy.ts"],"names":["logger","getLogger","useState","text","formatToCopy","textArea","registerTimeout","handleCopyFormat","currentValue","formatResult","isFormatButtonEnabled","isDisabled"],"mappings":"kKAeA,MAAMA,CAAAA,CAASC,SAAAA,CAAU,CACvB,OAAA,CAAS,OAAA,CAAQ,IAAI,QAAA,GAAa,YAAA,CAClC,MAAO,OAAA,CACP,MAAA,CAAQ,oBACR,MAAA,CAAQ,IACV,CAAC,CAAA,OASiC,CAAA,CAe3B,4BAEL,CAAA,CAAA,CAAA,gBACA,CAAA,CAAA,CAAA,4BAEoD,CACpD,CAAA,CAAA,CAAA,CAAA,KAAoC,CAAA,CAAIC,CAAAA,CACtC,WACF,IAUgC,CAC9BC,CAAAA,CACAC,CAAAA,CAAAA,CAAAA,CACG,CAEH,GAAA,CAAA,gBAA0B,CAAA,aAAc,CAAA,UAC/B,CAAA,CAAA,CAAA,CAAA,KAETC,CAAS,CAAA,CAAA,CAAA,CAAA,cAAiB,CAAA,eACX,CAAA,IAAO,CAAA,WACb,CAAA,CAAA,CAAA,KAAM,CAAM,eACrB,CAAA,QAAS,CAAA,gBACTA,EAAS,CAAA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAA,QAEL,CACF,GAAA,CAAA,QAAS,CAAA,WAAY,CAAA,MAGLD,CAAY,CAAA,CAG5BE,CAAAA,CACE,cAAW,CAAM,IACC,CAAA,CAAA,CAAI,IACM,EAC9B,CACF,CAAA,CAAA,CAAA,EAAA,CAAA,MACEN,CAAO,CAAA,CAAA,CAAA,CAAA,SAAe,CAAA,CAAA,CAAA,CAAA,mDAIf,CAAA,IAAK,CAAA,WAChB,CAWMO,GAAmB,CAAA,CAAA,CAAA,CAAA,MACvB,CAAA,EAAI,CAACC,GACH,CAAA,CAAA,CAAA,OAIF,MAD2CA,CAAY,wBACvBJ,CAAY,CAAA,CAE5C,CAAA,CAAA,CAAKK,CAAAA,GAAa,CAAA,CAAA,OAId,CAEF,GAAA,CAAA,MAAM,mBAAoB,CAAA,iBAGVL,CAAY,CAAA,CAG5BE,CAAAA,CACE,cAAW,CAAM,IACC,CAAA,CAAA,CAAI,IACM,EAC9B,CACF,CAAA,CAAA,CAAA,EAAA,CAAA,KAE0BG,CAAa,CAAA,CAAA,CAAA,CAAA,KAEzC,EAEMC,EAAAA,CACJF,CAAAA,CAAAA,CAAAA,CAAiB,QAAyB,EAAA,CAAA,CAAA,SAAiBG,CAAAA,YAG3D,CAAA,YACA,CAAA,CAAA,CAAA,gBACA,CAAA,CAAA,CAAA,qBAEJ,CAAA,CAAA,CAAA","file":"use-coordinate-copy.js","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 { getLogger } from '@accelint/logger';\nimport { useState } from 'react';\n\nconst logger = getLogger({\n enabled: process.env.NODE_ENV !== 'production',\n level: 'debug',\n prefix: '[CoordinateField]',\n pretty: true,\n});\n\nimport { getAllCoordinateFormats } from '../../components/coordinate-field/coordinate-utils';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n} from '../../components/coordinate-field/types';\nimport type { UseTimeoutCleanupResult } from './use-timeout-cleanup';\n\nconst COPY_FEEDBACK_DURATION_MS = 2000;\n\nexport interface UseCoordinateCopyOptions {\n currentValue: CoordinateValue | null;\n validationErrors: string[];\n isDisabled: boolean;\n registerTimeout: UseTimeoutCleanupResult['registerTimeout'];\n}\n\nexport interface UseCoordinateCopyResult {\n copiedFormat: CoordinateSystem | null;\n handleCopyFormat: (formatToCopy: CoordinateSystem) => Promise<void>;\n isFormatButtonEnabled: boolean;\n}\n\nexport function useCoordinateCopy({\n currentValue,\n validationErrors,\n isDisabled,\n registerTimeout,\n}: UseCoordinateCopyOptions): UseCoordinateCopyResult {\n const [copiedFormat, setCopiedFormat] = useState<CoordinateSystem | null>(\n null,\n );\n\n /**\n * Fallback clipboard copy for browsers that don't support navigator.clipboard API.\n * Creates a temporary textarea, copies text using document.execCommand('copy'),\n * and provides visual feedback by setting copiedFormat state for 2 seconds.\n *\n * @param text - The coordinate string to copy to clipboard\n * @param formatToCopy - The coordinate format being copied (for UI feedback)\n */\n const fallbackCopyToClipboard = (\n text: string,\n formatToCopy: CoordinateSystem,\n ) => {\n // Create temporary textarea for copy operation\n const textArea = document.createElement('textarea');\n textArea.value = text;\n // Position off-screen so it's not visible to user\n textArea.style.position = 'fixed';\n textArea.style.left = '-999999px';\n textArea.style.top = '-999999px';\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n\n try {\n document.execCommand('copy');\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (err) {\n logger.withError(err).warn('Fallback copy to clipboard failed');\n }\n\n // Clean up temporary textarea\n document.body.removeChild(textArea);\n };\n\n /**\n * Handles copying a coordinate in the specified format to the clipboard.\n * Uses modern clipboard API (navigator.clipboard.writeText) with fallback\n * to document.execCommand for older browsers.\n *\n * Sets copiedFormat state to show visual feedback (Check icon) for 2 seconds.\n *\n * @param formatToCopy - The coordinate format to copy (dd, ddm, dms, mgrs, utm)\n */\n const handleCopyFormat = async (formatToCopy: CoordinateSystem) => {\n if (!currentValue) {\n return;\n }\n\n const allFormats = getAllCoordinateFormats(currentValue);\n const formatResult = allFormats[formatToCopy];\n\n if (!formatResult.isValid) {\n return;\n }\n\n try {\n // Modern clipboard API - copy and show feedback\n await navigator.clipboard.writeText(formatResult.value);\n\n // Set copied format to show Check icon in UI\n setCopiedFormat(formatToCopy);\n\n // Reset to null after 2 seconds to return to Copy icon\n registerTimeout(\n setTimeout(() => {\n setCopiedFormat(null);\n }, COPY_FEEDBACK_DURATION_MS),\n );\n } catch (_err) {\n // Fall back to document.execCommand for older browsers\n fallbackCopyToClipboard(formatResult.value, formatToCopy);\n }\n };\n\n const isFormatButtonEnabled =\n currentValue !== null && validationErrors.length === 0 && !isDisabled;\n\n return {\n copiedFormat,\n handleCopyFormat,\n isFormatButtonEnabled,\n };\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { CoordinateValue, CoordinateSystem, SegmentConfig } from '../../components/coordinate-field/types.js';
|
|
3
|
+
import 'react-aria-components';
|
|
4
|
+
|
|
5
|
+
interface UseCoordinateFieldStateOptions {
|
|
6
|
+
value?: CoordinateValue | null;
|
|
7
|
+
defaultValue?: CoordinateValue;
|
|
8
|
+
format: CoordinateSystem;
|
|
9
|
+
onChange?: Dispatch<SetStateAction<CoordinateValue | null>> | ((value: CoordinateValue | null) => void);
|
|
10
|
+
onError?: (message: string, context?: Record<string, unknown>) => void;
|
|
11
|
+
registerTimeout?: (timeoutId: NodeJS.Timeout) => void;
|
|
12
|
+
}
|
|
13
|
+
interface UseCoordinateFieldStateResult {
|
|
14
|
+
currentValue: CoordinateValue | null;
|
|
15
|
+
segmentValues: string[];
|
|
16
|
+
validationErrors: string[];
|
|
17
|
+
segmentConfigs: SegmentConfig[];
|
|
18
|
+
editableSegmentConfigs: SegmentConfig[];
|
|
19
|
+
handleSegmentChange: (index: number, newValue: string) => void;
|
|
20
|
+
setSegmentValues: (values: string[]) => void;
|
|
21
|
+
setValidationErrors: (errors: string[]) => void;
|
|
22
|
+
effectiveErrorMessage: string | null;
|
|
23
|
+
applyPastedCoordinate: (pastedValue: CoordinateValue) => void;
|
|
24
|
+
flushPendingValidation: () => void;
|
|
25
|
+
}
|
|
26
|
+
declare function useCoordinateFieldState({ value, defaultValue, format, onChange, onError, registerTimeout, }: UseCoordinateFieldStateOptions): UseCoordinateFieldStateResult;
|
|
27
|
+
|
|
28
|
+
export { type UseCoordinateFieldStateOptions, type UseCoordinateFieldStateResult, useCoordinateFieldState };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {useState,useRef,useMemo,useCallback,useEffect}from'react';import {convertDDToDisplaySegments,areAllSegmentsFilled,validateCoordinateSegments,convertDisplaySegmentsToDD}from'../../components/coordinate-field/coordinate-utils.js';import {getSegmentConfigs}from'../../components/coordinate-field/segment-configs.js';function B({value:o,defaultValue:h,format:n,onChange:b,onError:y,registerTimeout:x}){const[m,I]=useState(h||null),[C,i]=useState([]),l=useRef(null),T=o!==void 0?o:m,s=()=>{l.current&&(clearTimeout(l.current),l.current=null);},a=e=>{o===void 0&&I(e),b?.(e);},S=useMemo(()=>getSegmentConfigs(n),[n]),d=useMemo(()=>S.filter(e=>e.type!=="literal"),[S]),[g,c]=useState(()=>{const e=o!==void 0?o:h;if(!e)return new Array(d.length).fill("");const t=convertDDToDisplaySegments(e,n);return t||new Array(d.length).fill("")}),f=useCallback(e=>{s();const t=e?convertDDToDisplaySegments(e,n):null;c(t||new Array(d.length).fill("")),i([]);},[n,d.length]),D=useRef(n);useEffect(()=>{D.current!==n&&(D.current=n,f(o!==void 0?o:m));},[n,o,m,f]),useEffect(()=>{o!==void 0&&f(o);},[o,f]);const A=e=>{const t=validateCoordinateSegments(e,n);if(t.length>0){i(t),y?.("Invalid coordinate value",{errors:t,format:n,segments:e}),a(null);return}const r=convertDisplaySegmentsToDD(e,n);if(!r){const u="Invalid coordinate value";i([u]),y?.(u,{format:n,segments:e}),a(null);return}i([]),a(r);},U=(e,t)=>{const r=[...g];if(r[e]=t,c(r),areAllSegmentsFilled(r)){s();const u=setTimeout(()=>{A(r),l.current=null;},400);l.current=u,x?.(u);}else s(),i([]),T!==null&&a(null);},w=e=>{s();const t=convertDDToDisplaySegments(e,n);t&&(c(t),i([]),a(e));},M=()=>{l.current&&(s(),areAllSegmentsFilled(g)&&A(g));},P=useMemo(()=>C[0]||null,[C]);return {currentValue:T,segmentValues:g,validationErrors:C,segmentConfigs:S,editableSegmentConfigs:d,handleSegmentChange:U,setSegmentValues:c,setValidationErrors:i,effectiveErrorMessage:P,applyPastedCoordinate:w,flushPendingValidation:M}}export{B as useCoordinateFieldState};//# sourceMappingURL=use-coordinate-field-state.js.map
|
|
2
|
+
//# sourceMappingURL=use-coordinate-field-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/hooks/coordinate-field/use-coordinate-field-state.ts"],"names":["value","format","onError","internalValue","setInternalValue","defaultValue","p","validationErrors","useState","validationTimeoutRef","useRef","currentValue","handleChange","onChange","newValue","segmentConfigs","getSegmentConfigs","N","editableSegmentConfigs","useMemo","V","config","segmentValues","setSegmentValues","initialValue","segments","convertDDToDisplaySegments","v","convertValueToSegmentsOrClear","useCallback","valueToConvert","clearValidationTimeout","O","useEffect","F","prevFormatRef","validateAndUpdateCoordinate","updatedValues","errors","validateCoordinateSegments","ddValue","convertDisplaySegmentsToDD","k","errorMsg","setValidationErrors","handleSegmentChange","index","areAllSegmentsFilled","R","timeoutId","applyPastedCoordinate","pastedValue","flushPendingValidation","effectiveErrorMessage"],"mappings":"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","file":"use-coordinate-field-state.js","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 {\n type Dispatch,\n type SetStateAction,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n areAllSegmentsFilled,\n convertDDToDisplaySegments,\n convertDisplaySegmentsToDD,\n validateCoordinateSegments,\n} from '../../components/coordinate-field/coordinate-utils';\nimport { getSegmentConfigs } from '../../components/coordinate-field/segment-configs';\nimport type {\n CoordinateSystem,\n CoordinateValue,\n SegmentConfig,\n} from '../../components/coordinate-field/types';\n\nexport interface UseCoordinateFieldStateOptions {\n value?: CoordinateValue | null;\n defaultValue?: CoordinateValue;\n format: CoordinateSystem;\n onChange?:\n | Dispatch<SetStateAction<CoordinateValue | null>>\n | ((value: CoordinateValue | null) => void);\n onError?: (message: string, context?: Record<string, unknown>) => void;\n registerTimeout?: (timeoutId: NodeJS.Timeout) => void;\n}\n\nexport interface UseCoordinateFieldStateResult {\n currentValue: CoordinateValue | null;\n segmentValues: string[];\n validationErrors: string[];\n segmentConfigs: SegmentConfig[];\n editableSegmentConfigs: SegmentConfig[];\n handleSegmentChange: (index: number, newValue: string) => void;\n setSegmentValues: (values: string[]) => void;\n setValidationErrors: (errors: string[]) => void;\n effectiveErrorMessage: string | null;\n applyPastedCoordinate: (pastedValue: CoordinateValue) => void;\n flushPendingValidation: () => void;\n}\n\nexport function useCoordinateFieldState({\n value,\n defaultValue,\n format,\n onChange,\n onError,\n registerTimeout,\n}: UseCoordinateFieldStateOptions): UseCoordinateFieldStateResult {\n const [internalValue, setInternalValue] = useState<CoordinateValue | null>(\n defaultValue || null,\n );\n const [validationErrors, setValidationErrors] = useState<string[]>([]);\n const validationTimeoutRef = useRef<NodeJS.Timeout | null>(null);\n\n const currentValue = value !== undefined ? value : internalValue;\n\n const clearValidationTimeout = () => {\n if (validationTimeoutRef.current) {\n clearTimeout(validationTimeoutRef.current);\n validationTimeoutRef.current = null;\n }\n };\n\n const handleChange = (newValue: CoordinateValue | null) => {\n if (value === undefined) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n };\n\n const segmentConfigs = useMemo(() => getSegmentConfigs(format), [format]);\n\n const editableSegmentConfigs = useMemo(\n () => segmentConfigs.filter((config) => config.type !== 'literal'),\n [segmentConfigs],\n );\n\n const [segmentValues, setSegmentValues] = useState<string[]>(() => {\n const initialValue = value !== undefined ? value : defaultValue;\n if (!initialValue) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n const segments = convertDDToDisplaySegments(initialValue, format);\n if (!segments) {\n return new Array(editableSegmentConfigs.length).fill('');\n }\n\n return segments;\n });\n\n const convertValueToSegmentsOrClear = useCallback(\n (valueToConvert: CoordinateValue | null) => {\n // Clear any pending validation when value changes\n clearValidationTimeout();\n\n const segments = valueToConvert\n ? convertDDToDisplaySegments(valueToConvert, format)\n : null;\n\n setSegmentValues(\n segments || new Array(editableSegmentConfigs.length).fill(''),\n );\n setValidationErrors([]);\n },\n [format, editableSegmentConfigs.length],\n );\n\n const prevFormatRef = useRef(format);\n\n useEffect(() => {\n if (prevFormatRef.current !== format) {\n prevFormatRef.current = format;\n const valueToConvert = value !== undefined ? value : internalValue;\n convertValueToSegmentsOrClear(valueToConvert);\n }\n }, [format, value, internalValue, convertValueToSegmentsOrClear]);\n\n useEffect(() => {\n if (value !== undefined) {\n convertValueToSegmentsOrClear(value);\n }\n }, [value, convertValueToSegmentsOrClear]);\n\n /**\n * Validates segment values and updates the coordinate state\n *\n * When validation fails, calls onError with \"Invalid coordinate value\" message\n * and context containing the detailed validation errors from @accelint/geo.\n *\n * @param updatedValues - Array of segment values to validate\n */\n const validateAndUpdateCoordinate = (updatedValues: string[]) => {\n const errors = validateCoordinateSegments(updatedValues, format);\n\n if (errors.length > 0) {\n setValidationErrors(errors);\n onError?.('Invalid coordinate value', {\n errors,\n format,\n segments: updatedValues,\n });\n handleChange(null);\n return;\n }\n\n const ddValue = convertDisplaySegmentsToDD(updatedValues, format);\n if (!ddValue) {\n const errorMsg = 'Invalid coordinate value';\n setValidationErrors([errorMsg]);\n onError?.(errorMsg, { format, segments: updatedValues });\n handleChange(null);\n return;\n }\n\n setValidationErrors([]);\n handleChange(ddValue);\n };\n\n const handleSegmentChange = (index: number, newValue: string) => {\n const updatedValues = [...segmentValues];\n updatedValues[index] = newValue;\n setSegmentValues(updatedValues);\n\n if (areAllSegmentsFilled(updatedValues)) {\n // Clear any pending validation timeout\n clearValidationTimeout();\n\n // Debounce validation by 400ms when all segments are full\n const timeoutId = setTimeout(() => {\n validateAndUpdateCoordinate(updatedValues);\n validationTimeoutRef.current = null;\n }, 400);\n\n validationTimeoutRef.current = timeoutId;\n registerTimeout?.(timeoutId);\n } else {\n // Clear any pending validation when segments become incomplete\n clearValidationTimeout();\n setValidationErrors([]);\n if (currentValue !== null) {\n handleChange(null);\n }\n }\n };\n\n const applyPastedCoordinate = (pastedValue: CoordinateValue) => {\n // Clear any pending validation when applying pasted coordinate\n clearValidationTimeout();\n\n const segments = convertDDToDisplaySegments(pastedValue, format);\n\n if (segments) {\n setSegmentValues(segments);\n setValidationErrors([]);\n handleChange(pastedValue);\n }\n };\n\n const flushPendingValidation = () => {\n if (validationTimeoutRef.current) {\n clearValidationTimeout();\n\n // Immediately validate if all segments are filled\n if (areAllSegmentsFilled(segmentValues)) {\n validateAndUpdateCoordinate(segmentValues);\n }\n }\n };\n\n const effectiveErrorMessage = useMemo(\n () => validationErrors[0] || null,\n [validationErrors],\n );\n\n return {\n currentValue,\n segmentValues,\n validationErrors,\n segmentConfigs,\n editableSegmentConfigs,\n handleSegmentChange,\n setSegmentValues,\n setValidationErrors,\n effectiveErrorMessage,\n applyPastedCoordinate,\n flushPendingValidation,\n };\n}\n"]}
|