@accelint/design-toolkit 9.3.0 → 9.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/catalog-info.yaml +1 -1
- package/dist/components/accordion/context.d.ts +6 -0
- package/dist/components/accordion/context.js +6 -0
- package/dist/components/accordion/context.js.map +1 -1
- package/dist/components/accordion/group.d.ts +37 -2
- package/dist/components/accordion/group.js +34 -0
- package/dist/components/accordion/group.js.map +1 -1
- package/dist/components/accordion/header.d.ts +27 -2
- package/dist/components/accordion/header.js +25 -1
- package/dist/components/accordion/header.js.map +1 -1
- package/dist/components/accordion/index.d.ts +18 -4
- package/dist/components/accordion/index.js +16 -2
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/panel.d.ts +29 -2
- package/dist/components/accordion/panel.js +26 -0
- package/dist/components/accordion/panel.js.map +1 -1
- package/dist/components/accordion/trigger.d.ts +25 -2
- package/dist/components/accordion/trigger.js +23 -1
- package/dist/components/accordion/trigger.js.map +1 -1
- package/dist/components/accordion/types.d.ts +33 -0
- package/dist/components/action-bar/index.d.ts +29 -8
- package/dist/components/action-bar/index.js +27 -6
- package/dist/components/action-bar/index.js.map +1 -1
- package/dist/components/action-bar/types.d.ts +7 -0
- package/dist/components/avatar/context.d.ts +22 -4
- package/dist/components/avatar/context.js +18 -0
- package/dist/components/avatar/context.js.map +1 -1
- package/dist/components/avatar/index.d.ts +22 -15
- package/dist/components/avatar/index.js +21 -14
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/types.d.ts +13 -0
- package/dist/components/badge/context.d.ts +20 -2
- package/dist/components/badge/context.js +18 -0
- package/dist/components/badge/context.js.map +1 -1
- package/dist/components/badge/index.d.ts +28 -14
- package/dist/components/badge/index.js +28 -14
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/types.d.ts +9 -0
- package/dist/components/breadcrumbs/index.d.ts +8 -0
- package/dist/components/breadcrumbs/index.js +7 -0
- package/dist/components/breadcrumbs/index.js.map +1 -1
- package/dist/components/breadcrumbs/item.d.ts +23 -0
- package/dist/components/breadcrumbs/item.js +23 -1
- package/dist/components/breadcrumbs/item.js.map +1 -1
- package/dist/components/breadcrumbs/types.d.ts +17 -0
- package/dist/components/button/context.d.ts +62 -8
- package/dist/components/button/context.js +54 -0
- package/dist/components/button/context.js.map +1 -1
- package/dist/components/button/index.d.ts +21 -2
- package/dist/components/button/index.js +19 -0
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/link.d.ts +20 -0
- package/dist/components/button/link.js +20 -0
- package/dist/components/button/link.js.map +1 -1
- package/dist/components/button/toggle.d.ts +23 -2
- package/dist/components/button/toggle.js +22 -1
- package/dist/components/button/toggle.js.map +1 -1
- package/dist/components/button/types.d.ts +26 -0
- package/dist/components/checkbox/context.d.ts +9 -3
- package/dist/components/checkbox/context.js +6 -0
- package/dist/components/checkbox/context.js.map +1 -1
- package/dist/components/checkbox/group.d.ts +31 -2
- package/dist/components/checkbox/group.js +28 -0
- package/dist/components/checkbox/group.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +19 -2
- package/dist/components/checkbox/index.js +19 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/types.d.ts +19 -0
- package/dist/components/chip/context.d.ts +22 -4
- package/dist/components/chip/context.js +18 -0
- package/dist/components/chip/context.js.map +1 -1
- package/dist/components/chip/deletable.d.ts +38 -2
- package/dist/components/chip/deletable.js +36 -1
- package/dist/components/chip/deletable.js.map +1 -1
- package/dist/components/chip/index.d.ts +24 -2
- package/dist/components/chip/index.js +22 -0
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/list.d.ts +47 -2
- package/dist/components/chip/list.js +45 -0
- package/dist/components/chip/list.js.map +1 -1
- package/dist/components/chip/selectable.d.ts +32 -0
- package/dist/components/chip/selectable.js +31 -0
- package/dist/components/chip/selectable.js.map +1 -1
- package/dist/components/chip/types.d.ts +27 -0
- package/dist/components/classification-badge/context.d.ts +18 -2
- package/dist/components/classification-badge/context.js +16 -0
- package/dist/components/classification-badge/context.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +26 -8
- package/dist/components/classification-badge/index.js +25 -8
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +4 -0
- package/dist/components/classification-banner/context.d.ts +20 -4
- package/dist/components/classification-banner/context.js +16 -0
- package/dist/components/classification-banner/context.js.map +1 -1
- package/dist/components/classification-banner/index.d.ts +12 -2
- package/dist/components/classification-banner/index.js +9 -0
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +4 -0
- package/dist/components/clock/index.d.ts +12 -2
- package/dist/components/clock/index.js +10 -0
- package/dist/components/clock/index.js.map +1 -1
- package/dist/components/clock/types.d.ts +4 -0
- package/dist/components/color-picker/index.d.ts +12 -10
- package/dist/components/color-picker/index.js +10 -8
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/types.d.ts +8 -0
- package/dist/components/combobox-field/context.d.ts +20 -4
- package/dist/components/combobox-field/context.js +16 -0
- package/dist/components/combobox-field/context.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +15 -2
- package/dist/components/combobox-field/index.js +13 -1
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/types.d.ts +19 -0
- package/dist/components/coordinate-field/context.d.ts +15 -6
- package/dist/components/coordinate-field/context.js +9 -0
- package/dist/components/coordinate-field/context.js.map +1 -1
- package/dist/components/coordinate-field/coordinate-utils.d.ts +8 -0
- package/dist/components/coordinate-field/coordinate-utils.js +8 -0
- package/dist/components/coordinate-field/coordinate-utils.js.map +1 -1
- package/dist/components/coordinate-field/index.d.ts +29 -2
- package/dist/components/coordinate-field/index.js +29 -3
- package/dist/components/coordinate-field/index.js.map +1 -1
- package/dist/components/coordinate-field/segment.d.ts +27 -2
- package/dist/components/coordinate-field/segment.js +25 -0
- package/dist/components/coordinate-field/segment.js.map +1 -1
- package/dist/components/coordinate-field/styles.module.css +5 -1
- package/dist/components/date-field/index.d.ts +27 -2
- package/dist/components/date-field/index.js +25 -0
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/types.d.ts +19 -3
- package/dist/components/deferred-collection/index.d.ts +10 -2
- package/dist/components/deferred-collection/index.js +8 -0
- package/dist/components/deferred-collection/index.js.map +1 -1
- package/dist/components/deferred-collection/types.d.ts +6 -3
- package/dist/components/details-list/context.d.ts +25 -4
- package/dist/components/details-list/context.js +21 -0
- package/dist/components/details-list/context.js.map +1 -1
- package/dist/components/details-list/index.d.ts +9 -2
- package/dist/components/details-list/index.js +7 -0
- package/dist/components/details-list/index.js.map +1 -1
- package/dist/components/details-list/label.d.ts +18 -2
- package/dist/components/details-list/label.js +16 -0
- package/dist/components/details-list/label.js.map +1 -1
- package/dist/components/details-list/types.d.ts +14 -0
- package/dist/components/details-list/value.d.ts +20 -2
- package/dist/components/details-list/value.js +17 -0
- package/dist/components/details-list/value.js.map +1 -1
- package/dist/components/dialog/content.d.ts +23 -2
- package/dist/components/dialog/content.js +20 -0
- package/dist/components/dialog/content.js.map +1 -1
- package/dist/components/dialog/context.d.ts +5 -2
- package/dist/components/dialog/context.js +3 -0
- package/dist/components/dialog/context.js.map +1 -1
- package/dist/components/dialog/footer.d.ts +26 -2
- package/dist/components/dialog/footer.js +23 -0
- package/dist/components/dialog/footer.js.map +1 -1
- package/dist/components/dialog/index.d.ts +12 -2
- package/dist/components/dialog/index.js +10 -0
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/title.d.ts +21 -2
- package/dist/components/dialog/title.js +18 -0
- package/dist/components/dialog/title.js.map +1 -1
- package/dist/components/dialog/trigger.d.ts +18 -0
- package/dist/components/dialog/trigger.js +17 -0
- package/dist/components/dialog/trigger.js.map +1 -1
- package/dist/components/dialog/types.d.ts +12 -0
- package/dist/components/divider/context.d.ts +24 -4
- package/dist/components/divider/context.js +20 -0
- package/dist/components/divider/context.js.map +1 -1
- package/dist/components/divider/index.d.ts +13 -2
- package/dist/components/divider/index.js +10 -0
- package/dist/components/divider/index.js.map +1 -1
- package/dist/components/divider/types.d.ts +4 -4
- package/dist/components/drawer/back.d.ts +21 -2
- package/dist/components/drawer/back.js +19 -1
- package/dist/components/drawer/back.js.map +1 -1
- package/dist/components/drawer/close.d.ts +25 -2
- package/dist/components/drawer/close.js +28 -3
- package/dist/components/drawer/close.js.map +1 -1
- package/dist/components/drawer/content.d.ts +22 -2
- package/dist/components/drawer/content.js +19 -0
- package/dist/components/drawer/content.js.map +1 -1
- package/dist/components/drawer/context.d.ts +46 -4
- package/dist/components/drawer/context.js +45 -2
- package/dist/components/drawer/context.js.map +1 -1
- package/dist/components/drawer/events.d.ts +2 -0
- package/dist/components/drawer/events.js +2 -0
- package/dist/components/drawer/events.js.map +1 -1
- package/dist/components/drawer/footer.d.ts +24 -2
- package/dist/components/drawer/footer.js +21 -0
- package/dist/components/drawer/footer.js.map +1 -1
- package/dist/components/drawer/header-title.d.ts +22 -4
- package/dist/components/drawer/header-title.js +19 -2
- package/dist/components/drawer/header-title.js.map +1 -1
- package/dist/components/drawer/header.d.ts +34 -2
- package/dist/components/drawer/header.js +42 -2
- package/dist/components/drawer/header.js.map +1 -1
- package/dist/components/drawer/index.d.ts +14 -2
- package/dist/components/drawer/index.js +16 -0
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/layout-main.d.ts +23 -2
- package/dist/components/drawer/layout-main.js +20 -0
- package/dist/components/drawer/layout-main.js.map +1 -1
- package/dist/components/drawer/layout.d.ts +25 -2
- package/dist/components/drawer/layout.js +22 -0
- package/dist/components/drawer/layout.js.map +1 -1
- package/dist/components/drawer/menu-item.d.ts +25 -2
- package/dist/components/drawer/menu-item.js +22 -0
- package/dist/components/drawer/menu-item.js.map +1 -1
- package/dist/components/drawer/menu.d.ts +22 -2
- package/dist/components/drawer/menu.js +19 -0
- package/dist/components/drawer/menu.js.map +1 -1
- package/dist/components/drawer/panel.d.ts +21 -2
- package/dist/components/drawer/panel.js +18 -0
- package/dist/components/drawer/panel.js.map +1 -1
- package/dist/components/drawer/trigger.d.ts +31 -2
- package/dist/components/drawer/trigger.js +29 -1
- package/dist/components/drawer/trigger.js.map +1 -1
- package/dist/components/drawer/types.d.ts +149 -2
- package/dist/components/drawer/view.d.ts +25 -2
- package/dist/components/drawer/view.js +22 -0
- package/dist/components/drawer/view.js.map +1 -1
- package/dist/components/flashcard/index.d.ts +129 -27
- package/dist/components/flashcard/index.js +120 -18
- package/dist/components/flashcard/index.js.map +1 -1
- package/dist/components/flashcard/styles.module.css +1 -1
- package/dist/components/flashcard/types.d.ts +12 -0
- package/dist/components/hero/context.d.ts +5 -2
- package/dist/components/hero/context.js +3 -0
- package/dist/components/hero/context.js.map +1 -1
- package/dist/components/hero/index.d.ts +9 -2
- package/dist/components/hero/index.js +7 -0
- package/dist/components/hero/index.js.map +1 -1
- package/dist/components/hero/subtitle.d.ts +17 -2
- package/dist/components/hero/subtitle.js +15 -0
- package/dist/components/hero/subtitle.js.map +1 -1
- package/dist/components/hero/title.d.ts +15 -2
- package/dist/components/hero/title.js +13 -0
- package/dist/components/hero/title.js.map +1 -1
- package/dist/components/hero/types.d.ts +9 -0
- package/dist/components/hotkey/context.d.ts +24 -4
- package/dist/components/hotkey/context.js +20 -0
- package/dist/components/hotkey/context.js.map +1 -1
- package/dist/components/hotkey/index.d.ts +17 -2
- package/dist/components/hotkey/index.js +15 -0
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/hotkey/set.d.ts +21 -2
- package/dist/components/hotkey/set.js +18 -0
- package/dist/components/hotkey/set.js.map +1 -1
- package/dist/components/hotkey/types.d.ts +4 -0
- package/dist/components/icon/context.d.ts +24 -4
- package/dist/components/icon/context.js +20 -0
- package/dist/components/icon/context.js.map +1 -1
- package/dist/components/icon/index.d.ts +15 -2
- package/dist/components/icon/index.js +13 -0
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -0
- package/dist/components/input/context.d.ts +4 -0
- package/dist/components/input/context.js +4 -0
- package/dist/components/input/context.js.map +1 -1
- package/dist/components/input/index.d.ts +17 -2
- package/dist/components/input/index.js +16 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/types.d.ts +16 -0
- package/dist/components/kanban/card-body.d.ts +10 -2
- package/dist/components/kanban/card-body.js +8 -0
- package/dist/components/kanban/card-body.js.map +1 -1
- package/dist/components/kanban/card-header-actions.d.ts +10 -2
- package/dist/components/kanban/card-header-actions.js +8 -0
- package/dist/components/kanban/card-header-actions.js.map +1 -1
- package/dist/components/kanban/card-header-title.d.ts +10 -2
- package/dist/components/kanban/card-header-title.js +8 -0
- package/dist/components/kanban/card-header-title.js.map +1 -1
- package/dist/components/kanban/card-header.d.ts +12 -2
- package/dist/components/kanban/card-header.js +10 -0
- package/dist/components/kanban/card-header.js.map +1 -1
- package/dist/components/kanban/card.d.ts +26 -2
- package/dist/components/kanban/card.js +23 -0
- package/dist/components/kanban/card.js.map +1 -1
- package/dist/components/kanban/column-actions.d.ts +10 -2
- package/dist/components/kanban/column-actions.js +9 -1
- package/dist/components/kanban/column-actions.js.map +1 -1
- package/dist/components/kanban/column-container.d.ts +10 -2
- package/dist/components/kanban/column-container.js +8 -0
- package/dist/components/kanban/column-container.js.map +1 -1
- package/dist/components/kanban/column-content.d.ts +13 -2
- package/dist/components/kanban/column-content.js +11 -0
- package/dist/components/kanban/column-content.js.map +1 -1
- package/dist/components/kanban/column-header-actions.d.ts +13 -2
- package/dist/components/kanban/column-header-actions.js +11 -0
- package/dist/components/kanban/column-header-actions.js.map +1 -1
- package/dist/components/kanban/column-header-drag-handle.d.ts +7 -2
- package/dist/components/kanban/column-header-drag-handle.js +6 -1
- package/dist/components/kanban/column-header-drag-handle.js.map +1 -1
- package/dist/components/kanban/column-header-title.d.ts +10 -2
- package/dist/components/kanban/column-header-title.js +8 -0
- package/dist/components/kanban/column-header-title.js.map +1 -1
- package/dist/components/kanban/column-header.d.ts +12 -2
- package/dist/components/kanban/column-header.js +10 -0
- package/dist/components/kanban/column-header.js.map +1 -1
- package/dist/components/kanban/column.d.ts +22 -2
- package/dist/components/kanban/column.js +19 -0
- package/dist/components/kanban/column.js.map +1 -1
- package/dist/components/kanban/context.d.ts +49 -2
- package/dist/components/kanban/context.js +30 -0
- package/dist/components/kanban/context.js.map +1 -1
- package/dist/components/kanban/header-actions.d.ts +10 -2
- package/dist/components/kanban/header-actions.js +8 -0
- package/dist/components/kanban/header-actions.js.map +1 -1
- package/dist/components/kanban/header-search.d.ts +9 -2
- package/dist/components/kanban/header-search.js +7 -0
- package/dist/components/kanban/header-search.js.map +1 -1
- package/dist/components/kanban/header-title.d.ts +10 -2
- package/dist/components/kanban/header-title.js +8 -0
- package/dist/components/kanban/header-title.js.map +1 -1
- package/dist/components/kanban/header.d.ts +12 -2
- package/dist/components/kanban/header.js +10 -0
- package/dist/components/kanban/header.js.map +1 -1
- package/dist/components/kanban/kanban.d.ts +33 -4
- package/dist/components/kanban/kanban.js +29 -0
- package/dist/components/kanban/kanban.js.map +1 -1
- package/dist/components/kanban/types.d.ts +51 -0
- package/dist/components/label/context.d.ts +25 -4
- package/dist/components/label/context.js +21 -0
- package/dist/components/label/context.js.map +1 -1
- package/dist/components/label/index.d.ts +16 -2
- package/dist/components/label/index.js +14 -0
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/types.d.ts +5 -0
- package/dist/components/lines/index.d.ts +10 -0
- package/dist/components/lines/index.js +9 -0
- package/dist/components/lines/index.js.map +1 -1
- package/dist/components/lines/types.d.ts +6 -0
- package/dist/components/link/context.d.ts +21 -2
- package/dist/components/link/context.js +18 -0
- package/dist/components/link/context.js.map +1 -1
- package/dist/components/link/index.d.ts +12 -2
- package/dist/components/link/index.js +9 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/link/types.d.ts +5 -0
- package/dist/components/list/context.d.ts +11 -2
- package/dist/components/list/context.js +9 -0
- package/dist/components/list/context.js.map +1 -1
- package/dist/components/list/index.d.ts +11 -2
- package/dist/components/list/index.js +9 -0
- package/dist/components/list/index.js.map +1 -1
- package/dist/components/list/item-content.d.ts +9 -2
- package/dist/components/list/item-content.js +6 -0
- package/dist/components/list/item-content.js.map +1 -1
- package/dist/components/list/item-description.d.ts +9 -2
- package/dist/components/list/item-description.js +7 -0
- package/dist/components/list/item-description.js.map +1 -1
- package/dist/components/list/item-title.d.ts +9 -2
- package/dist/components/list/item-title.js +7 -0
- package/dist/components/list/item-title.js.map +1 -1
- package/dist/components/list/item.d.ts +10 -2
- package/dist/components/list/item.js +8 -0
- package/dist/components/list/item.js.map +1 -1
- package/dist/components/list/types.d.ts +22 -0
- package/dist/components/menu/context.d.ts +6 -2
- package/dist/components/menu/context.js +4 -0
- package/dist/components/menu/context.js.map +1 -1
- package/dist/components/menu/index.d.ts +24 -3
- package/dist/components/menu/index.js +22 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/item-description.d.ts +17 -2
- package/dist/components/menu/item-description.js +15 -0
- package/dist/components/menu/item-description.js.map +1 -1
- package/dist/components/menu/item-label.d.ts +17 -2
- package/dist/components/menu/item-label.js +15 -0
- package/dist/components/menu/item-label.js.map +1 -1
- package/dist/components/menu/item.d.ts +23 -2
- package/dist/components/menu/item.js +21 -1
- package/dist/components/menu/item.js.map +1 -1
- package/dist/components/menu/section.d.ts +23 -2
- package/dist/components/menu/section.js +20 -0
- package/dist/components/menu/section.js.map +1 -1
- package/dist/components/menu/separator.d.ts +16 -2
- package/dist/components/menu/separator.js +14 -0
- package/dist/components/menu/separator.js.map +1 -1
- package/dist/components/menu/submenu.d.ts +18 -2
- package/dist/components/menu/submenu.js +16 -0
- package/dist/components/menu/submenu.js.map +1 -1
- package/dist/components/menu/trigger.d.ts +15 -0
- package/dist/components/menu/trigger.js +15 -0
- package/dist/components/menu/trigger.js.map +1 -1
- package/dist/components/menu/types.d.ts +25 -0
- package/dist/components/notice/events.d.ts +9 -0
- package/dist/components/notice/events.js +9 -0
- package/dist/components/notice/events.js.map +1 -1
- package/dist/components/notice/index.d.ts +34 -2
- package/dist/components/notice/index.js +32 -1
- package/dist/components/notice/index.js.map +1 -1
- package/dist/components/notice/list.d.ts +31 -2
- package/dist/components/notice/list.js +28 -0
- package/dist/components/notice/list.js.map +1 -1
- package/dist/components/notice/notice-icon.d.ts +22 -2
- package/dist/components/notice/notice-icon.js +23 -1
- package/dist/components/notice/notice-icon.js.map +1 -1
- package/dist/components/notice/types.d.ts +60 -0
- package/dist/components/notice/utils.d.ts +8 -0
- package/dist/components/notice/utils.js +8 -0
- package/dist/components/notice/utils.js.map +1 -1
- package/dist/components/options/context.d.ts +1 -0
- package/dist/components/options/context.js +1 -0
- package/dist/components/options/context.js.map +1 -1
- package/dist/components/options/index.d.ts +15 -2
- package/dist/components/options/index.js +13 -0
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/item-content.d.ts +22 -2
- package/dist/components/options/item-content.js +19 -0
- package/dist/components/options/item-content.js.map +1 -1
- package/dist/components/options/item-description.d.ts +14 -2
- package/dist/components/options/item-description.js +12 -0
- package/dist/components/options/item-description.js.map +1 -1
- package/dist/components/options/item-label.d.ts +14 -2
- package/dist/components/options/item-label.js +12 -0
- package/dist/components/options/item-label.js.map +1 -1
- package/dist/components/options/item.d.ts +24 -2
- package/dist/components/options/item.js +21 -0
- package/dist/components/options/item.js.map +1 -1
- package/dist/components/options/section.d.ts +21 -2
- package/dist/components/options/section.js +18 -0
- package/dist/components/options/section.js.map +1 -1
- package/dist/components/options/types.d.ts +24 -0
- package/dist/components/pagination/context.d.ts +3 -2
- package/dist/components/pagination/context.js +1 -0
- package/dist/components/pagination/context.js.map +1 -1
- package/dist/components/pagination/index.d.ts +18 -11
- package/dist/components/pagination/index.js +15 -9
- package/dist/components/pagination/index.js.map +1 -1
- package/dist/components/pagination/next.d.ts +17 -2
- package/dist/components/pagination/next.js +15 -0
- package/dist/components/pagination/next.js.map +1 -1
- package/dist/components/pagination/pages.d.ts +21 -2
- package/dist/components/pagination/pages.js +18 -0
- package/dist/components/pagination/pages.js.map +1 -1
- package/dist/components/pagination/prev.d.ts +17 -2
- package/dist/components/pagination/prev.js +16 -1
- package/dist/components/pagination/prev.js.map +1 -1
- package/dist/components/pagination/types.d.ts +32 -0
- package/dist/components/pagination/utils.d.ts +35 -0
- package/dist/components/pagination/utils.js +35 -0
- package/dist/components/pagination/utils.js.map +1 -1
- package/dist/components/popover/content.d.ts +20 -2
- package/dist/components/popover/content.js +17 -0
- package/dist/components/popover/content.js.map +1 -1
- package/dist/components/popover/footer.d.ts +22 -2
- package/dist/components/popover/footer.js +19 -0
- package/dist/components/popover/footer.js.map +1 -1
- package/dist/components/popover/index.d.ts +9 -2
- package/dist/components/popover/index.js +8 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.module.css +6 -0
- package/dist/components/popover/title.d.ts +17 -2
- package/dist/components/popover/title.js +15 -0
- package/dist/components/popover/title.js.map +1 -1
- package/dist/components/popover/trigger.d.ts +24 -2
- package/dist/components/popover/trigger.js +21 -0
- package/dist/components/popover/trigger.js.map +1 -1
- package/dist/components/popover/types.d.ts +10 -0
- package/dist/components/query-builder/action-element.d.ts +20 -2
- package/dist/components/query-builder/action-element.js +17 -0
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/actions.d.ts +37 -4
- package/dist/components/query-builder/actions.js +36 -1
- package/dist/components/query-builder/actions.js.map +1 -1
- package/dist/components/query-builder/combinator-selector.d.ts +10 -2
- package/dist/components/query-builder/combinator-selector.js +8 -0
- package/dist/components/query-builder/combinator-selector.js.map +1 -1
- package/dist/components/query-builder/constants.d.ts +1 -0
- package/dist/components/query-builder/constants.js +1 -0
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +11 -2
- package/dist/components/query-builder/index.js +9 -0
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule-group.d.ts +52 -4
- package/dist/components/query-builder/rule-group.js +47 -0
- package/dist/components/query-builder/rule-group.js.map +1 -1
- package/dist/components/query-builder/rule.d.ts +20 -2
- package/dist/components/query-builder/rule.js +18 -0
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +9 -0
- package/dist/components/query-builder/utils.d.ts +15 -0
- package/dist/components/query-builder/utils.js +15 -0
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.d.ts +23 -2
- package/dist/components/query-builder/value-editor.js +20 -0
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.d.ts +23 -2
- package/dist/components/query-builder/value-selector.js +20 -0
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/context.d.ts +2 -2
- package/dist/components/radio/group.d.ts +19 -2
- package/dist/components/radio/group.js +16 -0
- package/dist/components/radio/group.js.map +1 -1
- package/dist/components/radio/index.d.ts +13 -26
- package/dist/components/radio/index.js +11 -24
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/types.d.ts +16 -0
- package/dist/components/search-field/context.d.ts +7 -4
- package/dist/components/search-field/context.js +3 -0
- package/dist/components/search-field/context.js.map +1 -1
- package/dist/components/search-field/index.d.ts +15 -24
- package/dist/components/search-field/index.js +16 -23
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/types.d.ts +13 -0
- package/dist/components/select-field/context.d.ts +11 -4
- package/dist/components/select-field/context.js +7 -0
- package/dist/components/select-field/context.js.map +1 -1
- package/dist/components/select-field/index.d.ts +19 -39
- package/dist/components/select-field/index.js +18 -38
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.module.css +8 -0
- package/dist/components/select-field/types.d.ts +18 -0
- package/dist/components/sidenav/avatar.d.ts +19 -2
- package/dist/components/sidenav/avatar.js +16 -0
- package/dist/components/sidenav/avatar.js.map +1 -1
- package/dist/components/sidenav/content.d.ts +23 -2
- package/dist/components/sidenav/content.js +20 -0
- package/dist/components/sidenav/content.js.map +1 -1
- package/dist/components/sidenav/context.d.ts +3 -2
- package/dist/components/sidenav/context.js +1 -0
- package/dist/components/sidenav/context.js.map +1 -1
- package/dist/components/sidenav/events.d.ts +2 -0
- package/dist/components/sidenav/events.js +2 -0
- package/dist/components/sidenav/events.js.map +1 -1
- package/dist/components/sidenav/footer.d.ts +16 -2
- package/dist/components/sidenav/footer.js +13 -0
- package/dist/components/sidenav/footer.js.map +1 -1
- package/dist/components/sidenav/header.d.ts +20 -2
- package/dist/components/sidenav/header.js +18 -1
- package/dist/components/sidenav/header.js.map +1 -1
- package/dist/components/sidenav/index.d.ts +11 -2
- package/dist/components/sidenav/index.js +9 -0
- package/dist/components/sidenav/index.js.map +1 -1
- package/dist/components/sidenav/item.d.ts +17 -2
- package/dist/components/sidenav/item.js +14 -0
- package/dist/components/sidenav/item.js.map +1 -1
- package/dist/components/sidenav/link.d.ts +17 -2
- package/dist/components/sidenav/link.js +15 -1
- package/dist/components/sidenav/link.js.map +1 -1
- package/dist/components/sidenav/menu-item.d.ts +16 -2
- package/dist/components/sidenav/menu-item.js +13 -0
- package/dist/components/sidenav/menu-item.js.map +1 -1
- package/dist/components/sidenav/menu.d.ts +19 -2
- package/dist/components/sidenav/menu.js +17 -1
- package/dist/components/sidenav/menu.js.map +1 -1
- package/dist/components/sidenav/trigger.d.ts +17 -2
- package/dist/components/sidenav/trigger.js +14 -0
- package/dist/components/sidenav/trigger.js.map +1 -1
- package/dist/components/sidenav/types.d.ts +53 -0
- package/dist/components/skeleton/index.d.ts +12 -27
- package/dist/components/skeleton/index.js +10 -24
- package/dist/components/skeleton/index.js.map +1 -1
- package/dist/components/skeleton/types.d.ts +4 -0
- package/dist/components/slider/index.d.ts +30 -29
- package/dist/components/slider/index.js +28 -27
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/types.d.ts +18 -0
- package/dist/components/switch/context.d.ts +16 -10
- package/dist/components/switch/context.js +13 -7
- package/dist/components/switch/context.js.map +1 -1
- package/dist/components/switch/index.d.ts +14 -31
- package/dist/components/switch/index.js +12 -29
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/types.d.ts +5 -0
- package/dist/components/table/body.d.ts +21 -2
- package/dist/components/table/body.js +18 -0
- package/dist/components/table/body.js.map +1 -1
- package/dist/components/table/cell.d.ts +22 -2
- package/dist/components/table/cell.js +19 -0
- package/dist/components/table/cell.js.map +1 -1
- package/dist/components/table/constants/table.d.ts +6 -0
- package/dist/components/table/constants/table.js +4 -0
- package/dist/components/table/constants/table.js.map +1 -1
- package/dist/components/table/context.d.ts +3 -2
- package/dist/components/table/context.js +1 -0
- package/dist/components/table/context.js.map +1 -1
- package/dist/components/table/header-cell.d.ts +24 -2
- package/dist/components/table/header-cell.js +24 -1
- package/dist/components/table/header-cell.js.map +1 -1
- package/dist/components/table/header.d.ts +20 -0
- package/dist/components/table/header.js +19 -0
- package/dist/components/table/header.js.map +1 -1
- package/dist/components/table/index.d.ts +28 -6
- package/dist/components/table/index.js +27 -5
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/row.d.ts +26 -2
- package/dist/components/table/row.js +23 -0
- package/dist/components/table/row.js.map +1 -1
- package/dist/components/table/types.d.ts +3 -0
- package/dist/components/tabs/context.d.ts +20 -10
- package/dist/components/tabs/context.js +17 -7
- package/dist/components/tabs/context.js.map +1 -1
- package/dist/components/tabs/index.d.ts +17 -40
- package/dist/components/tabs/index.js +15 -38
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs/list.d.ts +20 -4
- package/dist/components/tabs/list.js +17 -2
- package/dist/components/tabs/list.js.map +1 -1
- package/dist/components/tabs/panel.d.ts +21 -4
- package/dist/components/tabs/panel.js +18 -2
- package/dist/components/tabs/panel.js.map +1 -1
- package/dist/components/tabs/tab.d.ts +17 -4
- package/dist/components/tabs/tab.js +14 -2
- package/dist/components/tabs/tab.js.map +1 -1
- package/dist/components/tabs/types.d.ts +3 -0
- package/dist/components/text-area-field/context.d.ts +20 -10
- package/dist/components/text-area-field/context.js +17 -7
- package/dist/components/text-area-field/context.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +20 -15
- package/dist/components/text-area-field/index.js +18 -13
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.module.css +1 -1
- package/dist/components/text-area-field/types.d.ts +9 -0
- package/dist/components/text-field/context.d.ts +24 -4
- package/dist/components/text-field/context.js +20 -0
- package/dist/components/text-field/context.js.map +1 -1
- package/dist/components/text-field/index.d.ts +17 -82
- package/dist/components/text-field/index.js +15 -80
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/types.d.ts +9 -0
- package/dist/components/time-field/index.d.ts +23 -5
- package/dist/components/time-field/index.js +21 -4
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/time-field/types.d.ts +9 -0
- package/dist/components/tooltip/context.d.ts +3 -2
- package/dist/components/tooltip/context.js +1 -0
- package/dist/components/tooltip/context.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +15 -30
- package/dist/components/tooltip/index.js +13 -28
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/trigger.d.ts +22 -2
- package/dist/components/tooltip/trigger.js +19 -0
- package/dist/components/tooltip/trigger.js.map +1 -1
- package/dist/components/tooltip/types.d.ts +7 -0
- package/dist/components/tree/context.d.ts +5 -9
- package/dist/components/tree/context.js +2 -6
- package/dist/components/tree/context.js.map +1 -1
- package/dist/components/tree/index.d.ts +30 -8
- package/dist/components/tree/index.js +28 -6
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/item-actions.d.ts +19 -4
- package/dist/components/tree/item-actions.js +16 -2
- package/dist/components/tree/item-actions.js.map +1 -1
- package/dist/components/tree/item-content.d.ts +18 -4
- package/dist/components/tree/item-content.js +20 -3
- package/dist/components/tree/item-content.js.map +1 -1
- package/dist/components/tree/item-description.d.ts +15 -4
- package/dist/components/tree/item-description.js +13 -2
- package/dist/components/tree/item-description.js.map +1 -1
- package/dist/components/tree/item-label.d.ts +15 -4
- package/dist/components/tree/item-label.js +13 -2
- package/dist/components/tree/item-label.js.map +1 -1
- package/dist/components/tree/item-prefix-icon.d.ts +15 -4
- package/dist/components/tree/item-prefix-icon.js +13 -2
- package/dist/components/tree/item-prefix-icon.js.map +1 -1
- package/dist/components/tree/item.d.ts +24 -4
- package/dist/components/tree/item.js +21 -2
- package/dist/components/tree/item.js.map +1 -1
- package/dist/components/tree/lines.d.ts +10 -2
- package/dist/components/tree/lines.js +8 -0
- package/dist/components/tree/lines.js.map +1 -1
- package/dist/components/tree/types.d.ts +26 -0
- package/dist/components/view-stack/context.d.ts +20 -9
- package/dist/components/view-stack/context.js +18 -7
- package/dist/components/view-stack/context.js.map +1 -1
- package/dist/components/view-stack/events.d.ts +2 -0
- package/dist/components/view-stack/events.js +2 -0
- package/dist/components/view-stack/events.js.map +1 -1
- package/dist/components/view-stack/index.d.ts +16 -24
- package/dist/components/view-stack/index.js +14 -22
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/components/view-stack/trigger.d.ts +26 -4
- package/dist/components/view-stack/trigger.js +23 -2
- package/dist/components/view-stack/trigger.js.map +1 -1
- package/dist/components/view-stack/types.d.ts +29 -0
- package/dist/components/view-stack/view.d.ts +22 -2
- package/dist/components/view-stack/view.js +19 -0
- package/dist/components/view-stack/view.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-copy.d.ts +44 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js +35 -0
- package/dist/hooks/coordinate-field/use-coordinate-copy.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-field-state.d.ts +69 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js +50 -0
- package/dist/hooks/coordinate-field/use-coordinate-field-state.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-field.d.ts +61 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js +47 -0
- package/dist/hooks/coordinate-field/use-coordinate-field.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-focus.d.ts +51 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js +39 -0
- package/dist/hooks/coordinate-field/use-coordinate-focus.js.map +1 -1
- package/dist/hooks/coordinate-field/use-coordinate-paste.d.ts +63 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js +51 -0
- package/dist/hooks/coordinate-field/use-coordinate-paste.js.map +1 -1
- package/dist/hooks/coordinate-field/use-timeout-cleanup.d.ts +32 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js +30 -0
- package/dist/hooks/coordinate-field/use-timeout-cleanup.js.map +1 -1
- package/dist/hooks/use-frame-delay/index.d.ts +5 -0
- package/dist/hooks/use-frame-delay/index.js +5 -0
- package/dist/hooks/use-frame-delay/index.js.map +1 -1
- package/dist/hooks/use-tree/actions/index.d.ts +4 -2
- package/dist/hooks/use-tree/actions/index.js +4 -2
- package/dist/hooks/use-tree/actions/index.js.map +1 -1
- package/dist/hooks/use-tree/state/index.d.ts +7 -0
- package/dist/hooks/use-tree/state/index.js +7 -0
- package/dist/hooks/use-tree/state/index.js.map +1 -1
- package/dist/hooks/use-tree/types.d.ts +22 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/lib/types.d.ts +17 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.js +15 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/providers/portal.d.ts +11 -2
- package/dist/providers/portal.js +9 -0
- package/dist/providers/portal.js.map +1 -1
- package/dist/providers/theme-provider.d.ts +18 -2
- package/dist/providers/theme-provider.js +15 -0
- package/dist/providers/theme-provider.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AriaSlider","AriaSliderTrack","TooltipTrigger","Tooltip"],"sources":["../../../src/components/slider/index.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport {\n type CSSProperties,\n Fragment,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n Slider as AriaSlider,\n SliderTrack as AriaSliderTrack,\n composeRenderProps,\n Input,\n Label,\n SliderThumb,\n Text,\n} from 'react-aria-components';\nimport { Tooltip } from '../tooltip';\nimport { TooltipTrigger } from '../tooltip/trigger';\nimport styles from './styles.module.css';\nimport type { SliderMarker, SliderMarkersConfig, SliderProps } from './types';\n\nconst DEBOUNCE_MS = 500;\n\n/**\n * SliderInput - Internal component for debounced numeric input\n */\nfunction SliderInput({\n className,\n value,\n min,\n max,\n disabled,\n onChange,\n}: {\n className?: string;\n value: number;\n min: number;\n max: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n}) {\n const [localValue, setLocalValue] = useState(String(value));\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n\n // Sync local value when external value changes (e.g., from slider drag)\n useEffect(() => {\n setLocalValue(String(value));\n }, [value]);\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n const commitValue = (inputValue: string) => {\n const parsed = Number.parseFloat(inputValue);\n if (Number.isNaN(parsed)) {\n // Reset to min if invalid\n setLocalValue(String(min));\n onChange(min);\n } else {\n // Clamp to valid range\n const clamped = Math.min(Math.max(parsed, min), max);\n setLocalValue(String(clamped));\n onChange(clamped);\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n setLocalValue(newValue);\n\n // Clear existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n // Debounce the commit\n timeoutRef.current = setTimeout(() => {\n commitValue(newValue);\n }, DEBOUNCE_MS);\n };\n\n const handleBlur = () => {\n // Clear pending timeout and commit immediately\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n commitValue(localValue);\n };\n\n return (\n <Input\n className={className}\n value={localValue}\n disabled={disabled}\n data-disabled={disabled || undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n );\n}\n\n/**\n * Normalizes the markers configuration into a consistent sorted array format\n */\nfunction normalizeMarkers(\n markersConfig: SliderMarkersConfig | undefined,\n min: number,\n max: number,\n): SliderMarker[] {\n if (markersConfig === undefined) {\n return [];\n }\n\n // Number of evenly spaced markers\n if (typeof markersConfig === 'number') {\n if (markersConfig < 2) {\n return [];\n }\n const step = (max - min) / (markersConfig - 1);\n return Array.from({ length: markersConfig }, (_, i) => ({\n value: min + step * i,\n }));\n }\n\n // Array of numbers or marker objects - sort by value\n return markersConfig\n .map((item) => (typeof item === 'number' ? { value: item } : item))\n .sort((a, b) => a.value - b.value);\n}\n\n/**\n * Snaps a value to the nearest marker (curried for use with map)\n * Assumes markers are sorted by value for early exit optimization\n */\nfunction snapToNearestMarker(markers: SliderMarker[]) {\n return (value: number): number => {\n const firstMarker = markers[0];\n if (!firstMarker) {\n return value;\n }\n\n let nearestValue = firstMarker.value;\n let minDistance = Number.POSITIVE_INFINITY;\n\n for (const marker of markers) {\n const distance = Math.abs(value - marker.value);\n if (distance < minDistance) {\n minDistance = distance;\n nearestValue = marker.value;\n } else {\n // Since markers are sorted, if distance increases we've passed the nearest\n break;\n }\n }\n\n return nearestValue;\n };\n}\n\n/**\n * Checks if a marker with a label exists at the given value\n */\nfunction hasLabeledMarkerAtValue(\n markers: SliderMarker[],\n value: number,\n): boolean {\n return markers.some(\n (marker) =>\n marker.value === value &&\n marker.label !== undefined &&\n marker.label !== '',\n );\n}\n\n/**\n * Normalizes value to array format\n */\nfunction normalizeValue(\n value: number | number[] | undefined,\n): number[] | undefined {\n if (value === undefined) {\n return undefined;\n }\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Slider - An interactive range input component for numeric value selection\n *\n * Provides accessible slider functionality with optional input field integration,\n * flexible layouts, and comprehensive keyboard and mouse interaction support.\n * Perfect for settings, filters, or any numeric input requiring visual feedback.\n *\n * @example\n * // Basic slider\n * <Slider label=\"Volume\" defaultValue={50} />\n *\n * @example\n * // Slider with input field\n * <Slider label=\"Opacity\" defaultValue={50} showInput />\n *\n * @example\n * // Slider with labeled markers\n * <Slider\n * label=\"Quality\"\n * markers={[\n * { value: 0, label: 'Low' },\n * { value: 50, label: 'Medium' },\n * { value: 100, label: 'High' },\n * ]}\n * showMarkerLabels\n * />\n *\n * @example\n * // Slider that snaps to marker values only\n * <Slider\n * label=\"Rating\"\n * markers={[0, 25, 50, 75, 100]}\n * snapToMarkers\n * />\n */\nexport function Slider({\n classNames,\n defaultValue,\n label: labelProp,\n layout = 'grid',\n markers: markersProp,\n maxValue: maxValueProp = 100,\n minValue: minValueProp = 0,\n onChange,\n onChangeEnd,\n orientation = 'horizontal',\n showInput,\n showLabel = true,\n showMarkerLabels = false,\n showValueLabels = true,\n snapToMarkers = false,\n step: stepProp,\n value: valueProp,\n ...rest\n}: SliderProps) {\n const normalizedMarkers = useMemo(\n () => normalizeMarkers(markersProp, minValueProp, maxValueProp),\n [markersProp, minValueProp, maxValueProp],\n );\n\n const shouldSnap = snapToMarkers && normalizedMarkers.length > 0;\n\n // Normalize default value, applying snap if needed\n const normalizedDefaultValue = useMemo(() => {\n const normalized = normalizeValue(defaultValue);\n if (shouldSnap && normalized) {\n return normalized.map(snapToNearestMarker(normalizedMarkers));\n }\n return normalized ?? [minValueProp];\n }, [defaultValue, shouldSnap, normalizedMarkers, minValueProp]);\n\n // Use controlled state for value management\n const [value, setValue] = useControlledState(\n normalizeValue(valueProp),\n normalizedDefaultValue,\n onChange,\n );\n\n // Memoize marker percent calculations\n const markerPercents = useMemo(() => {\n const percents = new Map<number, number>();\n const range = maxValueProp - minValueProp;\n for (const marker of normalizedMarkers) {\n percents.set(marker.value, ((marker.value - minValueProp) / range) * 100);\n }\n return percents;\n }, [normalizedMarkers, minValueProp, maxValueProp]);\n\n // Determine if min/max labels should be hidden\n const hideMinValue =\n !showValueLabels ||\n (showMarkerLabels &&\n hasLabeledMarkerAtValue(normalizedMarkers, minValueProp));\n const hideMaxValue =\n !showValueLabels ||\n (showMarkerLabels &&\n hasLabeledMarkerAtValue(normalizedMarkers, maxValueProp));\n\n // Handle onChange - snap values when snapToMarkers is enabled\n const handleChange = (values: number[]) => {\n if (shouldSnap) {\n setValue(values.map(snapToNearestMarker(normalizedMarkers)));\n } else {\n setValue(values);\n }\n };\n\n // Handle onChangeEnd\n const handleChangeEnd = (values: number[]) => {\n if (shouldSnap) {\n onChangeEnd?.(values.map(snapToNearestMarker(normalizedMarkers)));\n } else {\n onChangeEnd?.(values);\n }\n };\n\n return (\n <AriaSlider\n {...rest}\n className={composeRenderProps(classNames?.slider, (className) =>\n clsx('group/slider', styles.slider, className),\n )}\n maxValue={maxValueProp}\n minValue={minValueProp}\n onChange={handleChange}\n onChangeEnd={handleChangeEnd}\n orientation={orientation}\n step={stepProp}\n value={value}\n aria-label={showLabel ? undefined : labelProp}\n data-layout={layout}\n >\n {({ state }) => (\n <>\n {showLabel && (\n <Label className={clsx(styles.label, classNames?.label)}>\n {labelProp}\n </Label>\n )}\n {showInput && (\n <div className={clsx(styles.inputs, classNames?.inputs)}>\n {state.values.map((val, index) => (\n <SliderInput\n key={`number-field-${index === 0 ? 'min' : 'max'}`}\n className={clsx(styles.input, classNames?.input)}\n value={val}\n min={minValueProp}\n max={maxValueProp}\n disabled={state.isDisabled}\n onChange={(newValue) => state.setThumbValue(index, newValue)}\n />\n ))}\n </div>\n )}\n <AriaSliderTrack\n className={composeRenderProps(classNames?.track, (className) =>\n clsx(styles.track, className),\n )}\n >\n <div\n className={clsx(\n styles.trackBackground,\n classNames?.trackBackground,\n )}\n />\n {/* Markers */}\n {normalizedMarkers.length > 0 && (\n <div className={clsx(styles.markers, classNames?.markers)}>\n {normalizedMarkers.map((marker) => (\n <div\n key={`marker-${marker.value}`}\n className={clsx(styles.marker, classNames?.marker)}\n data-percent={markerPercents.get(marker.value)}\n aria-hidden='true'\n >\n <div\n className={clsx(styles.markerDot, classNames?.markerDot)}\n />\n {showMarkerLabels && marker.label && (\n <span\n className={clsx(\n styles.markerLabel,\n classNames?.markerLabel,\n )}\n >\n {marker.label}\n </span>\n )}\n </div>\n ))}\n </div>\n )}\n {state.values.map((_, index) => (\n <Fragment key={`slider-${index === 0 ? 'min' : 'max'}`}>\n <div\n className={clsx(styles.trackValue, classNames?.trackValue)}\n style={\n {\n '--track-value-start':\n state.values.length === 1\n ? 0\n : state.getThumbPercent(0),\n '--track-value-end': state.getThumbPercent(\n state.values.length === 1 ? 0 : 1,\n ),\n } as CSSProperties\n }\n />\n <TooltipTrigger\n isDisabled={showInput || state.isThumbDragging(index)}\n >\n <SliderThumb\n index={index}\n className={composeRenderProps(\n classNames?.thumb,\n (className) => clsx(styles.thumb, className),\n )}\n />\n <Tooltip placement='top'>\n {state.getThumbValue(index)}\n </Tooltip>\n </TooltipTrigger>\n </Fragment>\n ))}\n </AriaSliderTrack>\n <Text\n slot='min'\n className={clsx(styles.minValue, classNames?.minValue)}\n hidden={hideMinValue}\n >\n {minValueProp}\n </Text>\n <Text\n slot='max'\n className={clsx(styles.maxValue, classNames?.maxValue)}\n hidden={hideMaxValue}\n >\n {maxValueProp}\n </Text>\n </>\n )}\n </AriaSlider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,cAAc;;;;AAKpB,SAAS,YAAY,EACnB,WACA,OACA,KACA,KACA,UACA,YAQC;CACD,MAAM,CAAC,YAAY,iBAAiB,SAAS,OAAO,MAAM,CAAC;CAC3D,MAAM,aAAa,O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BACP,YAAY,gBACb,GACD;KAED,kBAAkB,SAAS,KAC1B,oBAAC;MAAI,WAAW,KAAK,OAAO,SAAS,YAAY,QAAQ;gBACtD,kBAAkB,KAAK,WACtB,qBAAC;OAEC,WAAW,KAAK,OAAO,QAAQ,YAAY,OAAO;OAClD,gBAAc,eAAe,IAAI,OAAO,MAAM;OAC9C,eAAY;kBAEZ,oBAAC,SACC,WAAW,KAAK,OAAO,WAAW,YAAY,UAAU,GACxD,EACD,oBAAoB,OAAO,SAC1B,oBAAC;QACC,WAAW,KACT,OAAO,aACP,YAAY,YACb;kBAEA,OAAO;SACH;SAhBJ,UAAU,OAAO,QAkBlB,CACN;OACE;KAEP,MAAM,OAAO,KAAK,GAAG,UACpB,qBAAC,uBACC,oBAAC;MACC,WAAW,KAAK,OAAO,YAAY,YAAY,WAAW;MAC1D,OACE;OACE,uBACE,MAAM,OAAO,WAAW,IACpB,IACA,MAAM,gBAAgB,EAAE;OAC9B,qBAAqB,MAAM,gBACzB,MAAM,OAAO,WAAW,IAAI,IAAI,EACjC;OACF;OAEH,EACF,qBAACC;MACC,YAAY,aAAa,MAAM,gBAAgB,MAAM;iBAErD,oBAAC;OACQ;OACP,WAAW,mBACT,YAAY,QACX,cAAc,KAAK,OAAO,OAAO,UAAU,CAC7C;QACD,EACF,oBAACC;OAAQ,WAAU;iBAChB,MAAM,cAAc,MAAM;QACnB;OACK,KA5BJ,UAAU,UAAU,IAAI,QAAQ,QA6BpC,CACX;;KACc;GAClB,oBAAC;IACC,MAAK;IACL,WAAW,KAAK,OAAO,UAAU,YAAY,SAAS;IACtD,QAAQ;cAEP;KACI;GACP,oBAAC;IACC,MAAK;IACL,WAAW,KAAK,OAAO,UAAU,YAAY,SAAS;IACtD,QAAQ;cAEP;KACI;MACN;GAEM"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["AriaSlider","AriaSliderTrack","TooltipTrigger","Tooltip"],"sources":["../../../src/components/slider/index.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport {\n type CSSProperties,\n Fragment,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport {\n Slider as AriaSlider,\n SliderTrack as AriaSliderTrack,\n composeRenderProps,\n Input,\n Label,\n SliderThumb,\n Text,\n} from 'react-aria-components';\nimport { Tooltip } from '../tooltip';\nimport { TooltipTrigger } from '../tooltip/trigger';\nimport styles from './styles.module.css';\nimport type { SliderMarker, SliderMarkersConfig, SliderProps } from './types';\n\nconst DEBOUNCE_MS = 500;\n\n/**\n * SliderInput - Internal component for debounced numeric input\n */\nfunction SliderInput({\n className,\n value,\n min,\n max,\n disabled,\n onChange,\n}: {\n className?: string;\n value: number;\n min: number;\n max: number;\n disabled?: boolean;\n onChange: (value: number) => void;\n}) {\n const [localValue, setLocalValue] = useState(String(value));\n const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined);\n\n // Sync local value when external value changes (e.g., from slider drag)\n useEffect(() => {\n setLocalValue(String(value));\n }, [value]);\n\n // Cleanup timeout on unmount\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n const commitValue = (inputValue: string) => {\n const parsed = Number.parseFloat(inputValue);\n if (Number.isNaN(parsed)) {\n // Reset to min if invalid\n setLocalValue(String(min));\n onChange(min);\n } else {\n // Clamp to valid range\n const clamped = Math.min(Math.max(parsed, min), max);\n setLocalValue(String(clamped));\n onChange(clamped);\n }\n };\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = event.target.value;\n setLocalValue(newValue);\n\n // Clear existing timeout\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n\n // Debounce the commit\n timeoutRef.current = setTimeout(() => {\n commitValue(newValue);\n }, DEBOUNCE_MS);\n };\n\n const handleBlur = () => {\n // Clear pending timeout and commit immediately\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n commitValue(localValue);\n };\n\n return (\n <Input\n className={className}\n value={localValue}\n disabled={disabled}\n data-disabled={disabled || undefined}\n onChange={handleChange}\n onBlur={handleBlur}\n />\n );\n}\n\n/**\n * Normalizes the markers configuration into a consistent sorted array format\n */\nfunction normalizeMarkers(\n markersConfig: SliderMarkersConfig | undefined,\n min: number,\n max: number,\n): SliderMarker[] {\n if (markersConfig === undefined) {\n return [];\n }\n\n // Number of evenly spaced markers\n if (typeof markersConfig === 'number') {\n if (markersConfig < 2) {\n return [];\n }\n const step = (max - min) / (markersConfig - 1);\n return Array.from({ length: markersConfig }, (_, i) => ({\n value: min + step * i,\n }));\n }\n\n // Array of numbers or marker objects - sort by value\n return markersConfig\n .map((item) => (typeof item === 'number' ? { value: item } : item))\n .sort((a, b) => a.value - b.value);\n}\n\n/**\n * Snaps a value to the nearest marker (curried for use with map)\n * Assumes markers are sorted by value for early exit optimization\n */\nfunction snapToNearestMarker(markers: SliderMarker[]) {\n return (value: number): number => {\n const firstMarker = markers[0];\n if (!firstMarker) {\n return value;\n }\n\n let nearestValue = firstMarker.value;\n let minDistance = Number.POSITIVE_INFINITY;\n\n for (const marker of markers) {\n const distance = Math.abs(value - marker.value);\n if (distance < minDistance) {\n minDistance = distance;\n nearestValue = marker.value;\n } else {\n // Since markers are sorted, if distance increases we've passed the nearest\n break;\n }\n }\n\n return nearestValue;\n };\n}\n\n/**\n * Checks if a marker with a label exists at the given value\n */\nfunction hasLabeledMarkerAtValue(\n markers: SliderMarker[],\n value: number,\n): boolean {\n return markers.some(\n (marker) =>\n marker.value === value &&\n marker.label !== undefined &&\n marker.label !== '',\n );\n}\n\n/**\n * Normalizes value to array format\n */\nfunction normalizeValue(\n value: number | number[] | undefined,\n): number[] | undefined {\n if (value === undefined) {\n return undefined;\n }\n return Array.isArray(value) ? value : [value];\n}\n\n/**\n * Slider - Range input for numeric value selection\n *\n * Supports single values or ranges, optional input fields, markers, and snap-to-markers behavior.\n *\n * @param props - {@link SliderProps}\n * @param props.classNames - Custom CSS class names for slider elements.\n * @param props.defaultValue - Default value(s) for uncontrolled mode.\n * @param props.label - Label text for the slider.\n * @param props.layout - Layout variant for the slider.\n * @param props.markers - Marker configuration for discrete points.\n * @param props.maxValue - Maximum value of the slider range.\n * @param props.minValue - Minimum value of the slider range.\n * @param props.onChange - Callback when value changes.\n * @param props.onChangeEnd - Callback when user finishes dragging.\n * @param props.orientation - Slider orientation.\n * @param props.showInput - Whether to show numeric input fields.\n * @param props.showLabel - Whether to display the label.\n * @param props.showMarkerLabels - Whether to show labels on markers.\n * @param props.showValueLabels - Whether to show min/max value labels.\n * @param props.snapToMarkers - Whether to snap to marker values only.\n * @param props.step - Step increment for value changes.\n * @param props.value - Controlled value(s).\n * @returns The rendered Slider component.\n *\n * @example\n * ```tsx\n * <Slider\n * label=\"Volume\"\n * defaultValue={50}\n * minValue={0}\n * maxValue={100}\n * onChange={setVolume}\n * />\n * ```\n */\nexport function Slider({\n classNames,\n defaultValue,\n label: labelProp,\n layout = 'grid',\n markers: markersProp,\n maxValue: maxValueProp = 100,\n minValue: minValueProp = 0,\n onChange,\n onChangeEnd,\n orientation = 'horizontal',\n showInput,\n showLabel = true,\n showMarkerLabels = false,\n showValueLabels = true,\n snapToMarkers = false,\n step: stepProp,\n value: valueProp,\n ...rest\n}: SliderProps) {\n const normalizedMarkers = useMemo(\n () => normalizeMarkers(markersProp, minValueProp, maxValueProp),\n [markersProp, minValueProp, maxValueProp],\n );\n\n const shouldSnap = snapToMarkers && normalizedMarkers.length > 0;\n\n // Normalize default value, applying snap if needed\n const normalizedDefaultValue = useMemo(() => {\n const normalized = normalizeValue(defaultValue);\n if (shouldSnap && normalized) {\n return normalized.map(snapToNearestMarker(normalizedMarkers));\n }\n return normalized ?? [minValueProp];\n }, [defaultValue, shouldSnap, normalizedMarkers, minValueProp]);\n\n // Use controlled state for value management\n const [value, setValue] = useControlledState(\n normalizeValue(valueProp),\n normalizedDefaultValue,\n onChange,\n );\n\n // Memoize marker percent calculations\n const markerPercents = useMemo(() => {\n const percents = new Map<number, number>();\n const range = maxValueProp - minValueProp;\n for (const marker of normalizedMarkers) {\n percents.set(marker.value, ((marker.value - minValueProp) / range) * 100);\n }\n return percents;\n }, [normalizedMarkers, minValueProp, maxValueProp]);\n\n // Determine if min/max labels should be hidden\n const hideMinValue =\n !showValueLabels ||\n (showMarkerLabels &&\n hasLabeledMarkerAtValue(normalizedMarkers, minValueProp));\n const hideMaxValue =\n !showValueLabels ||\n (showMarkerLabels &&\n hasLabeledMarkerAtValue(normalizedMarkers, maxValueProp));\n\n // Handle onChange - snap values when snapToMarkers is enabled\n const handleChange = (values: number[]) => {\n if (shouldSnap) {\n setValue(values.map(snapToNearestMarker(normalizedMarkers)));\n } else {\n setValue(values);\n }\n };\n\n // Handle onChangeEnd\n const handleChangeEnd = (values: number[]) => {\n if (shouldSnap) {\n onChangeEnd?.(values.map(snapToNearestMarker(normalizedMarkers)));\n } else {\n onChangeEnd?.(values);\n }\n };\n\n return (\n <AriaSlider\n {...rest}\n className={composeRenderProps(classNames?.slider, (className) =>\n clsx('group/slider', styles.slider, className),\n )}\n maxValue={maxValueProp}\n minValue={minValueProp}\n onChange={handleChange}\n onChangeEnd={handleChangeEnd}\n orientation={orientation}\n step={stepProp}\n value={value}\n aria-label={showLabel ? undefined : labelProp}\n data-layout={layout}\n >\n {({ state }) => (\n <>\n {showLabel && (\n <Label className={clsx(styles.label, classNames?.label)}>\n {labelProp}\n </Label>\n )}\n {showInput && (\n <div className={clsx(styles.inputs, classNames?.inputs)}>\n {state.values.map((val, index) => (\n <SliderInput\n key={`number-field-${index === 0 ? 'min' : 'max'}`}\n className={clsx(styles.input, classNames?.input)}\n value={val}\n min={minValueProp}\n max={maxValueProp}\n disabled={state.isDisabled}\n onChange={(newValue) => state.setThumbValue(index, newValue)}\n />\n ))}\n </div>\n )}\n <AriaSliderTrack\n className={composeRenderProps(classNames?.track, (className) =>\n clsx(styles.track, className),\n )}\n >\n <div\n className={clsx(\n styles.trackBackground,\n classNames?.trackBackground,\n )}\n />\n {/* Markers */}\n {normalizedMarkers.length > 0 && (\n <div className={clsx(styles.markers, classNames?.markers)}>\n {normalizedMarkers.map((marker) => (\n <div\n key={`marker-${marker.value}`}\n className={clsx(styles.marker, classNames?.marker)}\n data-percent={markerPercents.get(marker.value)}\n aria-hidden='true'\n >\n <div\n className={clsx(styles.markerDot, classNames?.markerDot)}\n />\n {showMarkerLabels && marker.label && (\n <span\n className={clsx(\n styles.markerLabel,\n classNames?.markerLabel,\n )}\n >\n {marker.label}\n </span>\n )}\n </div>\n ))}\n </div>\n )}\n {state.values.map((_, index) => (\n <Fragment key={`slider-${index === 0 ? 'min' : 'max'}`}>\n <div\n className={clsx(styles.trackValue, classNames?.trackValue)}\n style={\n {\n '--track-value-start':\n state.values.length === 1\n ? 0\n : state.getThumbPercent(0),\n '--track-value-end': state.getThumbPercent(\n state.values.length === 1 ? 0 : 1,\n ),\n } as CSSProperties\n }\n />\n <TooltipTrigger\n isDisabled={showInput || state.isThumbDragging(index)}\n >\n <SliderThumb\n index={index}\n className={composeRenderProps(\n classNames?.thumb,\n (className) => clsx(styles.thumb, className),\n )}\n />\n <Tooltip placement='top'>\n {state.getThumbValue(index)}\n </Tooltip>\n </TooltipTrigger>\n </Fragment>\n ))}\n </AriaSliderTrack>\n <Text\n slot='min'\n className={clsx(styles.minValue, classNames?.minValue)}\n hidden={hideMinValue}\n >\n {minValueProp}\n </Text>\n <Text\n slot='max'\n className={clsx(styles.ma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AW,KAAK,OAAO,UAAU,YAAY,SAAS;IACtD,QAAQ;cAEP;KACI;GACP,oBAAC;IACC,MAAK;IACL,WAAW,KAAK,OAAO,UAAU,YAAY,SAAS;IACtD,QAAQ;cAEP;KACI;MACN;GAEM"}
|
|
@@ -13,12 +13,27 @@
|
|
|
13
13
|
import { LabelProps, SliderProps as SliderProps$1, SliderThumbProps, SliderTrackProps } from "react-aria-components";
|
|
14
14
|
|
|
15
15
|
//#region src/components/slider/types.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Marker configuration for a single slider marker.
|
|
18
|
+
*/
|
|
16
19
|
type SliderMarker = {
|
|
20
|
+
/** Numeric value where the marker is placed. */
|
|
17
21
|
value: number;
|
|
22
|
+
/** Optional label displayed at the marker position. */
|
|
18
23
|
label?: string;
|
|
19
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Configuration for slider markers.
|
|
27
|
+
*
|
|
28
|
+
* Can be a number (evenly spaced markers including min/max),
|
|
29
|
+
* an array of SliderMarker objects, or an array of numeric values.
|
|
30
|
+
*/
|
|
20
31
|
type SliderMarkersConfig = number | SliderMarker[] | number[];
|
|
32
|
+
/**
|
|
33
|
+
* Props for the Slider component.
|
|
34
|
+
*/
|
|
21
35
|
type SliderProps = Omit<SliderProps$1, 'children' | 'className'> & {
|
|
36
|
+
/** Custom CSS class names for slider elements. */
|
|
22
37
|
classNames?: {
|
|
23
38
|
slider?: SliderProps$1['className'];
|
|
24
39
|
label?: LabelProps['className'];
|
|
@@ -35,7 +50,9 @@ type SliderProps = Omit<SliderProps$1, 'children' | 'className'> & {
|
|
|
35
50
|
markerDot?: string;
|
|
36
51
|
markerLabel?: string;
|
|
37
52
|
};
|
|
53
|
+
/** Label text for the slider. */
|
|
38
54
|
label: string;
|
|
55
|
+
/** Layout variant for the slider. */
|
|
39
56
|
layout?: 'grid' | 'stack';
|
|
40
57
|
/**
|
|
41
58
|
* Configure discrete marker points on the slider track.
|
|
@@ -48,6 +65,7 @@ type SliderProps = Omit<SliderProps$1, 'children' | 'className'> & {
|
|
|
48
65
|
* Whether to display numeric input fields for direct value entry
|
|
49
66
|
*/
|
|
50
67
|
showInput?: boolean;
|
|
68
|
+
/** Whether to display the label. */
|
|
51
69
|
showLabel?: boolean;
|
|
52
70
|
/**
|
|
53
71
|
* Whether to show labels on markers (only applies when markers have labels)
|
|
@@ -13,26 +13,32 @@
|
|
|
13
13
|
import { ProviderProps } from "../../lib/types.js";
|
|
14
14
|
import { SwitchProps as SwitchProps$1 } from "./types.js";
|
|
15
15
|
import "client-only";
|
|
16
|
-
import * as
|
|
16
|
+
import * as react35 from "react";
|
|
17
17
|
import { ContextValue } from "react-aria-components";
|
|
18
|
-
import * as
|
|
18
|
+
import * as react_jsx_runtime156 from "react/jsx-runtime";
|
|
19
19
|
|
|
20
20
|
//#region src/components/switch/context.d.ts
|
|
21
|
+
/** Context for sharing props across Switch components */
|
|
22
|
+
declare const SwitchContext: react35.Context<ContextValue<SwitchProps$1, HTMLLabelElement>>;
|
|
21
23
|
/**
|
|
22
|
-
*
|
|
24
|
+
* Sets default props for all Switch components within.
|
|
23
25
|
*
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <SwitchProvider isDisabled={true}>
|
|
29
|
+
* <Switch>Option 1</Switch>
|
|
30
|
+
* <Switch>Option 2</Switch>
|
|
31
|
+
* </SwitchProvider>
|
|
32
|
+
* ```
|
|
29
33
|
*
|
|
30
|
-
*
|
|
34
|
+
* @param props - ProviderProps with SwitchProps.
|
|
35
|
+
* @param props.children - Child components that receive the context.
|
|
36
|
+
* @returns The SwitchContext provider wrapping children.
|
|
31
37
|
*/
|
|
32
38
|
declare function SwitchProvider({
|
|
33
39
|
children,
|
|
34
40
|
...props
|
|
35
|
-
}: ProviderProps<SwitchProps$1>):
|
|
41
|
+
}: ProviderProps<SwitchProps$1>): react_jsx_runtime156.JSX.Element;
|
|
36
42
|
//#endregion
|
|
37
43
|
export { SwitchContext, SwitchProvider };
|
|
38
44
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -18,16 +18,22 @@ import { createContext } from "react";
|
|
|
18
18
|
import { jsx } from "react/jsx-runtime";
|
|
19
19
|
|
|
20
20
|
//#region src/components/switch/context.tsx
|
|
21
|
-
/**
|
|
22
|
-
* Context for Switch component
|
|
23
|
-
*
|
|
24
|
-
* Provides context for Switch component to share props
|
|
25
|
-
*/
|
|
21
|
+
/** Context for sharing props across Switch components */
|
|
26
22
|
const SwitchContext = createContext(null);
|
|
27
23
|
/**
|
|
28
|
-
*
|
|
24
|
+
* Sets default props for all Switch components within.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <SwitchProvider isDisabled={true}>
|
|
29
|
+
* <Switch>Option 1</Switch>
|
|
30
|
+
* <Switch>Option 2</Switch>
|
|
31
|
+
* </SwitchProvider>
|
|
32
|
+
* ```
|
|
29
33
|
*
|
|
30
|
-
*
|
|
34
|
+
* @param props - ProviderProps with SwitchProps.
|
|
35
|
+
* @param props.children - Child components that receive the context.
|
|
36
|
+
* @returns The SwitchContext provider wrapping children.
|
|
31
37
|
*/
|
|
32
38
|
function SwitchProvider({ children, ...props }) {
|
|
33
39
|
return /* @__PURE__ */ jsx(SwitchContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","names":[],"sources":["../../../src/components/switch/context.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport type { ContextValue } from 'react-aria-components';\nimport type { ProviderProps } from '@/lib/types';\nimport type { SwitchProps } from './types';\n\n
|
|
1
|
+
{"version":3,"file":"context.js","names":[],"sources":["../../../src/components/switch/context.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport type { ContextValue } from 'react-aria-components';\nimport type { ProviderProps } from '@/lib/types';\nimport type { SwitchProps } from './types';\n\n/** Context for sharing props across Switch components */\nexport const SwitchContext =\n createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\n/**\n * Sets default props for all Switch components within.\n *\n * @example\n * ```tsx\n * <SwitchProvider isDisabled={true}>\n * <Switch>Option 1</Switch>\n * <Switch>Option 2</Switch>\n * </SwitchProvider>\n * ```\n *\n * @param props - ProviderProps with SwitchProps.\n * @param props.children - Child components that receive the context.\n * @returns The SwitchContext provider wrapping children.\n */\nexport function SwitchProvider({\n children,\n ...props\n}: ProviderProps<SwitchProps>) {\n return (\n <SwitchContext.Provider value={props}>{children}</SwitchContext.Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoBA,MAAa,gBACX,cAA2D,KAAK;;;;;;;;;;;;;;;;AAiBlE,SAAgB,eAAe,EAC7B,UACA,GAAG,SAC0B;AAC7B,QACE,oBAAC,cAAc;EAAS,OAAO;EAAQ;GAAkC"}
|
|
@@ -12,50 +12,33 @@
|
|
|
12
12
|
|
|
13
13
|
import { SwitchProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime158 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/switch/index.d.ts
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Switch -
|
|
20
|
+
* Switch - Toggle control for binary on/off states
|
|
21
21
|
*
|
|
22
|
-
* Provides
|
|
23
|
-
* or settings. Offers clear visual feedback for on/off states with smooth transitions
|
|
24
|
-
* and proper keyboard and screen reader support.
|
|
22
|
+
* Provides visual feedback with smooth transitions and accessible keyboard/screen reader support.
|
|
25
23
|
*
|
|
26
|
-
* @
|
|
27
|
-
*
|
|
28
|
-
*
|
|
24
|
+
* @param props - {@link SwitchProps}
|
|
25
|
+
* @param props.ref - Ref to the switch label element.
|
|
26
|
+
* @param props.children - Label content for the switch.
|
|
27
|
+
* @param props.classNames - Custom CSS class names for switch elements.
|
|
28
|
+
* @param props.labelPosition - Position of the label relative to the switch control.
|
|
29
|
+
* @returns The rendered Switch component.
|
|
29
30
|
*
|
|
30
31
|
* @example
|
|
31
|
-
*
|
|
32
|
-
* <Switch
|
|
33
|
-
*
|
|
34
|
-
* onChange={setIsEnabled}
|
|
35
|
-
* >
|
|
36
|
-
* Dark mode
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <Switch isSelected={enabled} onChange={setEnabled}>
|
|
34
|
+
* Enable notifications
|
|
37
35
|
* </Switch>
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* // Switch with default state
|
|
41
|
-
* <Switch defaultSelected>
|
|
42
|
-
* Auto-save documents
|
|
43
|
-
* </Switch>
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* // Disabled switch
|
|
47
|
-
* <Switch isDisabled>
|
|
48
|
-
* Premium feature (upgrade required)
|
|
49
|
-
* </Switch>
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* // Switch without label (icon-only)
|
|
53
|
-
* <Switch aria-label="Toggle sidebar" />
|
|
36
|
+
* ```
|
|
54
37
|
*/
|
|
55
38
|
declare function Switch({
|
|
56
39
|
ref,
|
|
57
40
|
...props
|
|
58
|
-
}: SwitchProps):
|
|
41
|
+
}: SwitchProps): react_jsx_runtime158.JSX.Element;
|
|
59
42
|
//#endregion
|
|
60
43
|
export { Switch };
|
|
61
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -22,40 +22,23 @@ import styles from "./styles.module.css";
|
|
|
22
22
|
|
|
23
23
|
//#region src/components/switch/index.tsx
|
|
24
24
|
/**
|
|
25
|
-
* Switch -
|
|
25
|
+
* Switch - Toggle control for binary on/off states
|
|
26
26
|
*
|
|
27
|
-
* Provides
|
|
28
|
-
* or settings. Offers clear visual feedback for on/off states with smooth transitions
|
|
29
|
-
* and proper keyboard and screen reader support.
|
|
27
|
+
* Provides visual feedback with smooth transitions and accessible keyboard/screen reader support.
|
|
30
28
|
*
|
|
31
|
-
* @
|
|
32
|
-
*
|
|
33
|
-
*
|
|
29
|
+
* @param props - {@link SwitchProps}
|
|
30
|
+
* @param props.ref - Ref to the switch label element.
|
|
31
|
+
* @param props.children - Label content for the switch.
|
|
32
|
+
* @param props.classNames - Custom CSS class names for switch elements.
|
|
33
|
+
* @param props.labelPosition - Position of the label relative to the switch control.
|
|
34
|
+
* @returns The rendered Switch component.
|
|
34
35
|
*
|
|
35
36
|
* @example
|
|
36
|
-
*
|
|
37
|
-
* <Switch
|
|
38
|
-
*
|
|
39
|
-
* onChange={setIsEnabled}
|
|
40
|
-
* >
|
|
41
|
-
* Dark mode
|
|
37
|
+
* ```tsx
|
|
38
|
+
* <Switch isSelected={enabled} onChange={setEnabled}>
|
|
39
|
+
* Enable notifications
|
|
42
40
|
* </Switch>
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // Switch with default state
|
|
46
|
-
* <Switch defaultSelected>
|
|
47
|
-
* Auto-save documents
|
|
48
|
-
* </Switch>
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* // Disabled switch
|
|
52
|
-
* <Switch isDisabled>
|
|
53
|
-
* Premium feature (upgrade required)
|
|
54
|
-
* </Switch>
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* // Switch without label (icon-only)
|
|
58
|
-
* <Switch aria-label="Toggle sidebar" />
|
|
41
|
+
* ```
|
|
59
42
|
*/
|
|
60
43
|
function Switch({ ref, ...props }) {
|
|
61
44
|
[props, ref] = useContextProps(props, ref ?? null, SwitchContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AriaSwitch","children"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport {\n Switch as AriaSwitch,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { SwitchContext } from './context';\nimport styles from './styles.module.css';\nimport type { SwitchProps } from './types';\n\n/**\n * Switch -
|
|
1
|
+
{"version":3,"file":"index.js","names":["AriaSwitch","children"],"sources":["../../../src/components/switch/index.tsx"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport {\n Switch as AriaSwitch,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { SwitchContext } from './context';\nimport styles from './styles.module.css';\nimport type { SwitchProps } from './types';\n\n/**\n * Switch - Toggle control for binary on/off states\n *\n * Provides visual feedback with smooth transitions and accessible keyboard/screen reader support.\n *\n * @param props - {@link SwitchProps}\n * @param props.ref - Ref to the switch label element.\n * @param props.children - Label content for the switch.\n * @param props.classNames - Custom CSS class names for switch elements.\n * @param props.labelPosition - Position of the label relative to the switch control.\n * @returns The rendered Switch component.\n *\n * @example\n * ```tsx\n * <Switch isSelected={enabled} onChange={setEnabled}>\n * Enable notifications\n * </Switch>\n * ```\n */\nexport function Switch({ ref, ...props }: SwitchProps) {\n [props, ref] = useContextProps(props, ref ?? null, SwitchContext);\n\n const { children, classNames, labelPosition = 'end', ...rest } = props;\n\n return (\n <AriaSwitch\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.switch, (className) =>\n clsx('group/switch', styles.switch, styles[labelPosition], className),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={clsx(styles.control, classNames?.control)} />\n {children != null && (\n <span className={clsx(styles.label, classNames?.label)}>\n {children}\n </span>\n )}\n </>\n ))}\n </AriaSwitch>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,OAAO,EAAE,KAAK,GAAG,SAAsB;AACrD,EAAC,OAAO,OAAO,gBAAgB,OAAO,OAAO,MAAM,cAAc;CAEjE,MAAM,EAAE,UAAU,YAAY,gBAAgB,OAAO,GAAG,SAAS;AAEjE,QACE,oBAACA;EACC,GAAI;EACC;EACL,WAAW,mBAAmB,YAAY,SAAS,cACjD,KAAK,gBAAgB,OAAO,QAAQ,OAAO,gBAAgB,UAAU,CACtE;YAEA,mBAAmB,WAAW,eAC7B,4CACE,oBAAC,UAAK,WAAW,KAAK,OAAO,SAAS,YAAY,QAAQ,GAAI,EAC7DC,cAAY,QACX,oBAAC;GAAK,WAAW,KAAK,OAAO,OAAO,YAAY,MAAM;aACnDA;IACI,IAER,CACH;GACS"}
|
|
@@ -14,12 +14,17 @@ import { RefAttributes } from "react";
|
|
|
14
14
|
import { SwitchProps as SwitchProps$1 } from "react-aria-components";
|
|
15
15
|
|
|
16
16
|
//#region src/components/switch/types.d.ts
|
|
17
|
+
/**
|
|
18
|
+
* Props for the Switch component.
|
|
19
|
+
*/
|
|
17
20
|
type SwitchProps = Omit<SwitchProps$1, 'className'> & RefAttributes<HTMLLabelElement> & {
|
|
21
|
+
/** Custom CSS class names for switch elements. */
|
|
18
22
|
classNames?: {
|
|
19
23
|
switch?: SwitchProps$1['className'];
|
|
20
24
|
control?: string;
|
|
21
25
|
label?: string;
|
|
22
26
|
};
|
|
27
|
+
/** Position of the label relative to the switch control. */
|
|
23
28
|
labelPosition?: 'start' | 'end';
|
|
24
29
|
};
|
|
25
30
|
//#endregion
|
|
@@ -11,16 +11,35 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { TableBodyProps } from "./types.js";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react_jsx_runtime145 from "react/jsx-runtime";
|
|
15
15
|
|
|
16
16
|
//#region src/components/table/body.d.ts
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* TableBody - Renders the table body section (`<tbody>`).
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <Table>
|
|
24
|
+
* <TableHeader headerGroups={table.getHeaderGroups()} />
|
|
25
|
+
* <TableBody rows={table.getRowModel().rows} />
|
|
26
|
+
* </Table>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @param props - {@link TableBodyProps}
|
|
30
|
+
* @param props.children - Custom children content.
|
|
31
|
+
* @param props.className - CSS class for the tbody element.
|
|
32
|
+
* @param props.ref - Ref to the tbody element.
|
|
33
|
+
* @param props.rows - Array of TanStack table rows to render.
|
|
34
|
+
* @returns The rendered TableBody component.
|
|
35
|
+
*/
|
|
17
36
|
declare function TableBody<T>({
|
|
18
37
|
children,
|
|
19
38
|
className,
|
|
20
39
|
ref,
|
|
21
40
|
rows,
|
|
22
41
|
...rest
|
|
23
|
-
}: TableBodyProps<T>):
|
|
42
|
+
}: TableBodyProps<T>): react_jsx_runtime145.JSX.Element;
|
|
24
43
|
//#endregion
|
|
25
44
|
export { TableBody };
|
|
26
45
|
//# sourceMappingURL=body.d.ts.map
|
|
@@ -16,6 +16,24 @@ import { clsx } from "@accelint/design-foundation/lib/utils";
|
|
|
16
16
|
import { jsx } from "react/jsx-runtime";
|
|
17
17
|
|
|
18
18
|
//#region src/components/table/body.tsx
|
|
19
|
+
/**
|
|
20
|
+
* TableBody - Renders the table body section (`<tbody>`).
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Table>
|
|
25
|
+
* <TableHeader headerGroups={table.getHeaderGroups()} />
|
|
26
|
+
* <TableBody rows={table.getRowModel().rows} />
|
|
27
|
+
* </Table>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param props - {@link TableBodyProps}
|
|
31
|
+
* @param props.children - Custom children content.
|
|
32
|
+
* @param props.className - CSS class for the tbody element.
|
|
33
|
+
* @param props.ref - Ref to the tbody element.
|
|
34
|
+
* @param props.rows - Array of TanStack table rows to render.
|
|
35
|
+
* @returns The rendered TableBody component.
|
|
36
|
+
*/
|
|
19
37
|
function TableBody({ children, className, ref, rows, ...rest }) {
|
|
20
38
|
return /* @__PURE__ */ jsx("tbody", {
|
|
21
39
|
...rest,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","names":[],"sources":["../../../src/components/table/body.tsx"],"sourcesContent":["// __private-exports\n/*\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 { TableRow } from './row';\nimport type { TableBodyProps } from './types';\n\nexport function TableBody<T>({\n children,\n className,\n ref,\n rows,\n ...rest\n}: TableBodyProps<T>) {\n return (\n <tbody {...rest} ref={ref} className={clsx('group/tbody', className)}>\n {children || rows?.map((row) => <TableRow key={row.id} row={row} />)}\n </tbody>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"body.js","names":[],"sources":["../../../src/components/table/body.tsx"],"sourcesContent":["// __private-exports\n/*\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 { TableRow } from './row';\nimport type { TableBodyProps } from './types';\n\n/**\n * TableBody - Renders the table body section (`<tbody>`).\n *\n * @example\n * ```tsx\n * <Table>\n * <TableHeader headerGroups={table.getHeaderGroups()} />\n * <TableBody rows={table.getRowModel().rows} />\n * </Table>\n * ```\n *\n * @param props - {@link TableBodyProps}\n * @param props.children - Custom children content.\n * @param props.className - CSS class for the tbody element.\n * @param props.ref - Ref to the tbody element.\n * @param props.rows - Array of TanStack table rows to render.\n * @returns The rendered TableBody component.\n */\nexport function TableBody<T>({\n children,\n className,\n ref,\n rows,\n ...rest\n}: TableBodyProps<T>) {\n return (\n <tbody {...rest} ref={ref} className={clsx('group/tbody', className)}>\n {children || rows?.map((row) => <TableRow key={row.id} row={row} />)}\n </tbody>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,UAAa,EAC3B,UACA,WACA,KACA,MACA,GAAG,QACiB;AACpB,QACE,oBAAC;EAAM,GAAI;EAAW;EAAK,WAAW,KAAK,eAAe,UAAU;YACjE,YAAY,MAAM,KAAK,QAAQ,oBAAC,YAA2B,OAAb,IAAI,GAAgB,CAAC;GAC9D"}
|
|
@@ -11,16 +11,36 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { TableCellProps } from "./types.js";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react_jsx_runtime147 from "react/jsx-runtime";
|
|
15
15
|
|
|
16
16
|
//#region src/components/table/cell.d.ts
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* TableCell - Data cell (`<td>`) within a table row.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <TableRow row={row}>
|
|
24
|
+
* {row.getAllCells().map(cell => (
|
|
25
|
+
* <TableCell key={cell.id} cell={cell} />
|
|
26
|
+
* ))}
|
|
27
|
+
* </TableRow>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @param props - {@link TableCellProps}
|
|
31
|
+
* @param props.children - Custom children content.
|
|
32
|
+
* @param props.ref - Ref to the td element.
|
|
33
|
+
* @param props.className - CSS class for the td element.
|
|
34
|
+
* @param props.cell - TanStack table cell object.
|
|
35
|
+
* @returns The rendered TableCell component.
|
|
36
|
+
*/
|
|
17
37
|
declare function TableCell<T>({
|
|
18
38
|
children,
|
|
19
39
|
ref,
|
|
20
40
|
className,
|
|
21
41
|
cell,
|
|
22
42
|
...rest
|
|
23
|
-
}: TableCellProps<T>):
|
|
43
|
+
}: TableCellProps<T>): react_jsx_runtime147.JSX.Element;
|
|
24
44
|
//#endregion
|
|
25
45
|
export { TableCell };
|
|
26
46
|
//# sourceMappingURL=cell.d.ts.map
|
|
@@ -20,6 +20,25 @@ import { flexRender } from "@tanstack/react-table";
|
|
|
20
20
|
import styles from "./styles.module.css";
|
|
21
21
|
|
|
22
22
|
//#region src/components/table/cell.tsx
|
|
23
|
+
/**
|
|
24
|
+
* TableCell - Data cell (`<td>`) within a table row.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <TableRow row={row}>
|
|
29
|
+
* {row.getAllCells().map(cell => (
|
|
30
|
+
* <TableCell key={cell.id} cell={cell} />
|
|
31
|
+
* ))}
|
|
32
|
+
* </TableRow>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param props - {@link TableCellProps}
|
|
36
|
+
* @param props.children - Custom children content.
|
|
37
|
+
* @param props.ref - Ref to the td element.
|
|
38
|
+
* @param props.className - CSS class for the td element.
|
|
39
|
+
* @param props.cell - TanStack table cell object.
|
|
40
|
+
* @returns The rendered TableCell component.
|
|
41
|
+
*/
|
|
23
42
|
function TableCell({ children, ref, className, cell, ...rest }) {
|
|
24
43
|
const { columnSelection, persistNumerals } = useContext(TableContext);
|
|
25
44
|
const isNumeral = cell?.column.id === HeaderColumnAction.NUMERAL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cell.js","names":[],"sources":["../../../src/components/table/cell.tsx"],"sourcesContent":["// __private-exports\n/*\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 { flexRender } from '@tanstack/react-table';\nimport { useContext } from 'react';\nimport { HeaderColumnAction } from './constants/table';\nimport { TableContext } from './context';\nimport styles from './styles.module.css';\nimport type { TableCellProps } from './types';\n\nexport function TableCell<T>({\n children,\n ref,\n className,\n cell,\n ...rest\n}: TableCellProps<T>) {\n const { columnSelection, persistNumerals } = useContext(TableContext);\n const isNumeral = cell?.column.id === HeaderColumnAction.NUMERAL;\n const isSelected = cell?.column.id === columnSelection;\n const notPersistNums = isNumeral && !persistNumerals;\n\n return (\n <td\n {...rest}\n ref={ref}\n className={clsx(\n styles.cell,\n notPersistNums && styles.hideInRow,\n className,\n )}\n data-selected={isSelected || null}\n style={{ width: cell?.column.getSize() }}\n >\n {children ||\n (cell && flexRender(cell.column.columnDef.cell, cell.getContext()))}\n </td>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cell.js","names":[],"sources":["../../../src/components/table/cell.tsx"],"sourcesContent":["// __private-exports\n/*\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 { flexRender } from '@tanstack/react-table';\nimport { useContext } from 'react';\nimport { HeaderColumnAction } from './constants/table';\nimport { TableContext } from './context';\nimport styles from './styles.module.css';\nimport type { TableCellProps } from './types';\n\n/**\n * TableCell - Data cell (`<td>`) within a table row.\n *\n * @example\n * ```tsx\n * <TableRow row={row}>\n * {row.getAllCells().map(cell => (\n * <TableCell key={cell.id} cell={cell} />\n * ))}\n * </TableRow>\n * ```\n *\n * @param props - {@link TableCellProps}\n * @param props.children - Custom children content.\n * @param props.ref - Ref to the td element.\n * @param props.className - CSS class for the td element.\n * @param props.cell - TanStack table cell object.\n * @returns The rendered TableCell component.\n */\nexport function TableCell<T>({\n children,\n ref,\n className,\n cell,\n ...rest\n}: TableCellProps<T>) {\n const { columnSelection, persistNumerals } = useContext(TableContext);\n const isNumeral = cell?.column.id === HeaderColumnAction.NUMERAL;\n const isSelected = cell?.column.id === columnSelection;\n const notPersistNums = isNumeral && !persistNumerals;\n\n return (\n <td\n {...rest}\n ref={ref}\n className={clsx(\n styles.cell,\n notPersistNums && styles.hideInRow,\n className,\n )}\n data-selected={isSelected || null}\n style={{ width: cell?.column.getSize() }}\n >\n {children ||\n (cell && flexRender(cell.column.columnDef.cell, cell.getContext()))}\n </td>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,UAAa,EAC3B,UACA,KACA,WACA,MACA,GAAG,QACiB;CACpB,MAAM,EAAE,iBAAiB,oBAAoB,WAAW,aAAa;CACrE,MAAM,YAAY,MAAM,OAAO,OAAO,mBAAmB;CACzD,MAAM,aAAa,MAAM,OAAO,OAAO;CACvC,MAAM,iBAAiB,aAAa,CAAC;AAErC,QACE,oBAAC;EACC,GAAI;EACC;EACL,WAAW,KACT,OAAO,MACP,kBAAkB,OAAO,WACzB,UACD;EACD,iBAAe,cAAc;EAC7B,OAAO,EAAE,OAAO,MAAM,OAAO,SAAS,EAAE;YAEvC,YACE,QAAQ,WAAW,KAAK,OAAO,UAAU,MAAM,KAAK,YAAY,CAAC;GACjE"}
|
|
@@ -13,18 +13,24 @@
|
|
|
13
13
|
import { SafeEnum } from "@accelint/core";
|
|
14
14
|
|
|
15
15
|
//#region src/components/table/constants/table.d.ts
|
|
16
|
+
/** Sort direction options for table columns. */
|
|
16
17
|
declare const SortDirection: Readonly<{
|
|
17
18
|
readonly ASC: "asc";
|
|
18
19
|
readonly DESC: "desc";
|
|
19
20
|
}>;
|
|
21
|
+
/** Special header column action types. */
|
|
20
22
|
declare const HeaderColumnAction: Readonly<{
|
|
21
23
|
readonly NUMERAL: "numeral";
|
|
22
24
|
readonly KEBAB: "kebab";
|
|
23
25
|
readonly SELECTION: "selection";
|
|
24
26
|
}>;
|
|
27
|
+
/** Type representing a valid sort direction value. */
|
|
25
28
|
type SortDirectionState = SafeEnum<typeof SortDirection>;
|
|
29
|
+
/** Array of valid sort direction values. */
|
|
26
30
|
declare const sortDirectionValues: readonly ["desc" | "asc", ...("desc" | "asc")[]];
|
|
31
|
+
/** Type representing a valid header column action key. */
|
|
27
32
|
type HeaderColumnActionKey = SafeEnum<typeof HeaderColumnAction>;
|
|
33
|
+
/** Array of valid header column action values. */
|
|
28
34
|
declare const headerColumnActionValues: readonly ["numeral" | "kebab" | "selection", ...("numeral" | "kebab" | "selection")[]];
|
|
29
35
|
//#endregion
|
|
30
36
|
export { HeaderColumnAction, HeaderColumnActionKey, SortDirection, SortDirectionState, headerColumnActionValues, sortDirectionValues };
|
|
@@ -14,16 +14,20 @@
|
|
|
14
14
|
import { getSafeEnumValues } from "@accelint/core";
|
|
15
15
|
|
|
16
16
|
//#region src/components/table/constants/table.ts
|
|
17
|
+
/** Sort direction options for table columns. */
|
|
17
18
|
const SortDirection = Object.freeze({
|
|
18
19
|
ASC: "asc",
|
|
19
20
|
DESC: "desc"
|
|
20
21
|
});
|
|
22
|
+
/** Special header column action types. */
|
|
21
23
|
const HeaderColumnAction = Object.freeze({
|
|
22
24
|
NUMERAL: "numeral",
|
|
23
25
|
KEBAB: "kebab",
|
|
24
26
|
SELECTION: "selection"
|
|
25
27
|
});
|
|
28
|
+
/** Array of valid sort direction values. */
|
|
26
29
|
const sortDirectionValues = getSafeEnumValues(SortDirection);
|
|
30
|
+
/** Array of valid header column action values. */
|
|
27
31
|
const headerColumnActionValues = getSafeEnumValues(HeaderColumnAction);
|
|
28
32
|
|
|
29
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","names":[],"sources":["../../../../src/components/table/constants/table.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { getSafeEnumValues, type SafeEnum } from '@accelint/core';\n\nexport const SortDirection = Object.freeze({\n ASC: 'asc',\n DESC: 'desc',\n} as const);\n\nexport const HeaderColumnAction = Object.freeze({\n NUMERAL: 'numeral',\n KEBAB: 'kebab',\n SELECTION: 'selection',\n} as const);\n\nexport type SortDirectionState = SafeEnum<typeof SortDirection>;\nexport const sortDirectionValues = getSafeEnumValues(SortDirection);\n\nexport type HeaderColumnActionKey = SafeEnum<typeof HeaderColumnAction>;\nexport const headerColumnActionValues = getSafeEnumValues(HeaderColumnAction);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"table.js","names":[],"sources":["../../../../src/components/table/constants/table.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { getSafeEnumValues, type SafeEnum } from '@accelint/core';\n\n/** Sort direction options for table columns. */\nexport const SortDirection = Object.freeze({\n ASC: 'asc',\n DESC: 'desc',\n} as const);\n\n/** Special header column action types. */\nexport const HeaderColumnAction = Object.freeze({\n NUMERAL: 'numeral',\n KEBAB: 'kebab',\n SELECTION: 'selection',\n} as const);\n\n/** Type representing a valid sort direction value. */\nexport type SortDirectionState = SafeEnum<typeof SortDirection>;\n\n/** Array of valid sort direction values. */\nexport const sortDirectionValues = getSafeEnumValues(SortDirection);\n\n/** Type representing a valid header column action key. */\nexport type HeaderColumnActionKey = SafeEnum<typeof HeaderColumnAction>;\n\n/** Array of valid header column action values. */\nexport const headerColumnActionValues = getSafeEnumValues(HeaderColumnAction);\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,MAAa,gBAAgB,OAAO,OAAO;CACzC,KAAK;CACL,MAAM;CACP,CAAU;;AAGX,MAAa,qBAAqB,OAAO,OAAO;CAC9C,SAAS;CACT,OAAO;CACP,WAAW;CACZ,CAAU;;AAMX,MAAa,sBAAsB,kBAAkB,cAAc;;AAMnE,MAAa,2BAA2B,kBAAkB,mBAAmB"}
|
|
@@ -11,10 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { TableContextValue } from "./types.js";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react34 from "react";
|
|
15
15
|
|
|
16
16
|
//#region src/components/table/context.d.ts
|
|
17
|
-
|
|
17
|
+
/** Context for sharing table configuration across subcomponents */
|
|
18
|
+
declare const TableContext: react34.Context<TableContextValue>;
|
|
18
19
|
//#endregion
|
|
19
20
|
export { TableContext };
|
|
20
21
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { createContext } from "react";
|
|
15
15
|
|
|
16
16
|
//#region src/components/table/context.tsx
|
|
17
|
+
/** Context for sharing table configuration across subcomponents */
|
|
17
18
|
const TableContext = createContext({
|
|
18
19
|
moveColumnLeft: () => void 0,
|
|
19
20
|
moveColumnRight: () => void 0,
|