@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
|
@@ -21,6 +21,7 @@ import { TestID, useRule, useStopEventPropagation } from "react-querybuilder";
|
|
|
21
21
|
import styles from "./styles.module.css";
|
|
22
22
|
|
|
23
23
|
//#region src/components/query-builder/rule.tsx
|
|
24
|
+
/** Renders connecting lines between rules in a query builder */
|
|
24
25
|
const QueryBuilderLines = memo(function QueryBuilderLines$1({ path, props, context }) {
|
|
25
26
|
return /* @__PURE__ */ jsx(Lines, {
|
|
26
27
|
variant: path[0] === props.schema.getQuery()?.rules.length - 1 ? "last" : "branch",
|
|
@@ -29,6 +30,23 @@ const QueryBuilderLines = memo(function QueryBuilderLines$1({ path, props, conte
|
|
|
29
30
|
className: styles.ruleLines
|
|
30
31
|
});
|
|
31
32
|
});
|
|
33
|
+
/**
|
|
34
|
+
* Rule - Individual rule component with field, operator, and value
|
|
35
|
+
*
|
|
36
|
+
* Renders the field selector, operator selector, value editor, and action buttons.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* <Rule
|
|
41
|
+
* rule={{ field: 'name', operator: 'equals', value: 'John' }}
|
|
42
|
+
* path={[0]}
|
|
43
|
+
* schema={queryBuilderSchema}
|
|
44
|
+
* />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param props - RuleProps from react-querybuilder.
|
|
48
|
+
* @returns The rendered Rule component with all selectors and actions.
|
|
49
|
+
*/
|
|
32
50
|
function Rule(props) {
|
|
33
51
|
const rule = useRule(props);
|
|
34
52
|
const context = useContext(props.context);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rule.js","names":["QueryBuilderLines","context: QueryBuilderContextType"],"sources":["../../../src/components/query-builder/rule.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'use client';\n\nimport 'client-only';\nimport { memo, useContext } from 'react';\nimport {\n type Path,\n type RuleProps,\n TestID,\n useRule,\n useStopEventPropagation,\n} from 'react-querybuilder';\nimport { Lines } from '../lines';\nimport styles from './styles.module.css';\nimport type { QueryBuilderContextType } from './types';\n\nconst QueryBuilderLines = memo(function QueryBuilderLines({\n path,\n props,\n context,\n}: {\n path: Path;\n props: RuleProps;\n context: QueryBuilderContextType;\n}) {\n const isLastRule = path[0] === props.schema.getQuery()?.rules.length - 1;\n const line = isLastRule ? 'last' : 'branch';\n\n return (\n <Lines\n variant={line}\n size='small'\n isVisible={context.showRuleLines}\n className={styles.ruleLines}\n />\n );\n});\n\nexport function Rule(props: RuleProps) {\n const rule = useRule(props);\n const context: QueryBuilderContextType = useContext(props.context);\n\n const {\n classNames,\n disabled,\n operators,\n outerClassName,\n rule: { field, operator, value, valueSource },\n schema: {\n controls: {\n fieldSelector: FieldSelectorControlElement,\n operatorSelector: OperatorSelectorControlElement,\n valueSourceSelector: ValueSourceSelectorControlElement,\n valueEditor: ValueEditorControlElement,\n cloneRuleAction: CloneRuleActionControlElement,\n lockRuleAction: LockRuleActionControlElement,\n removeRuleAction: RemoveRuleActionControlElement,\n },\n fields,\n listsAsArrays,\n parseNumbers,\n showCloneButtons,\n showLockButtons,\n },\n fieldData,\n generateOnChangeHandler,\n inputType,\n parentDisabled,\n path,\n translations,\n valueEditorType,\n valueEditorSeparator,\n values,\n valueSources,\n valueSourceOptions,\n validationResult,\n } = rule;\n\n const cloneRule = useStopEventPropagation(rule.cloneRule);\n const toggleLockRule = useStopEventPropagation(rule.toggleLockRule);\n const removeRule = useStopEventPropagation(rule.removeRule);\n\n const coreRuleProps = {\n context,\n disabled,\n level: path.length,\n path,\n schema: rule.schema,\n validation: validationResult,\n };\n const renderValueSources =\n !['null', 'notNull'].includes(operator) && valueSources.length > 1;\n\n return (\n <>\n {context.showRuleLines && (\n <QueryBuilderLines path={path} props={props} context={context} />\n )}\n <div className={outerClassName}>\n <FieldSelectorControlElement\n testID={TestID.fields}\n options={fields}\n title={translations.fields.title}\n value={field}\n operator={operator}\n className={classNames.fields}\n handleOnChange={generateOnChangeHandler('field')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <OperatorSelectorControlElement\n testID={TestID.operators}\n field={field}\n fieldData={rule.fieldData}\n title={rule.translations.operators.title}\n options={operators}\n value={operator}\n className={rule.classNames.operators}\n handleOnChange={rule.generateOnChangeHandler('operator')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <ValueEditorControlElement\n testID={TestID.valueEditor}\n field={field}\n fieldData={fieldData}\n title={translations.value.title}\n operator={operator}\n value={value}\n valueSource={valueSource ?? 'value'}\n type={valueEditorType}\n inputType={inputType}\n values={values}\n listsAsArrays={listsAsArrays}\n parseNumbers={parseNumbers}\n separator={valueEditorSeparator}\n className={rule.classNames.value}\n handleOnChange={generateOnChangeHandler('value')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n {renderValueSources && (\n <ValueSourceSelectorControlElement\n testID={TestID.valueSourceSelector}\n field={field}\n fieldData={fieldData}\n title={translations.valueSourceSelector.title}\n options={valueSourceOptions}\n value={valueSource ?? 'value'}\n className={classNames.valueSource}\n handleOnChange={generateOnChangeHandler('valueSource')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n <div className={outerClassName}>\n <RemoveRuleActionControlElement\n testID={TestID.removeRule}\n label={translations.removeRule.label ?? 'remove'}\n title={translations.removeRule.title ?? 'remove'}\n className={classNames.removeRule}\n handleOnClick={removeRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n {showCloneButtons && (\n <CloneRuleActionControlElement\n testID={TestID.cloneRule}\n label={translations.cloneRule.label ?? 'clone'}\n title={translations.cloneRule.title ?? 'clone'}\n className={classNames.cloneRule}\n handleOnClick={cloneRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n {showLockButtons && (\n <LockRuleActionControlElement\n testID={TestID.lockRule}\n label={translations.lockRule.label ?? 'lock'}\n title={translations.lockRule.title ?? 'lock'}\n className={classNames.lockRule}\n handleOnClick={toggleLockRule}\n disabledTranslation={\n parentDisabled ? undefined : translations.lockRuleDisabled\n }\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n </>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"rule.js","names":["QueryBuilderLines","context: QueryBuilderContextType"],"sources":["../../../src/components/query-builder/rule.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'use client';\n\nimport 'client-only';\nimport { memo, useContext } from 'react';\nimport {\n type Path,\n type RuleProps,\n TestID,\n useRule,\n useStopEventPropagation,\n} from 'react-querybuilder';\nimport { Lines } from '../lines';\nimport styles from './styles.module.css';\nimport type { QueryBuilderContextType } from './types';\n\n/** Renders connecting lines between rules in a query builder */\nconst QueryBuilderLines = memo(function QueryBuilderLines({\n path,\n props,\n context,\n}: {\n path: Path;\n props: RuleProps;\n context: QueryBuilderContextType;\n}) {\n const isLastRule = path[0] === props.schema.getQuery()?.rules.length - 1;\n const line = isLastRule ? 'last' : 'branch';\n\n return (\n <Lines\n variant={line}\n size='small'\n isVisible={context.showRuleLines}\n className={styles.ruleLines}\n />\n );\n});\n\n/**\n * Rule - Individual rule component with field, operator, and value\n *\n * Renders the field selector, operator selector, value editor, and action buttons.\n *\n * @example\n * ```tsx\n * <Rule\n * rule={{ field: 'name', operator: 'equals', value: 'John' }}\n * path={[0]}\n * schema={queryBuilderSchema}\n * />\n * ```\n *\n * @param props - RuleProps from react-querybuilder.\n * @returns The rendered Rule component with all selectors and actions.\n */\nexport function Rule(props: RuleProps) {\n const rule = useRule(props);\n const context: QueryBuilderContextType = useContext(props.context);\n\n const {\n classNames,\n disabled,\n operators,\n outerClassName,\n rule: { field, operator, value, valueSource },\n schema: {\n controls: {\n fieldSelector: FieldSelectorControlElement,\n operatorSelector: OperatorSelectorControlElement,\n valueSourceSelector: ValueSourceSelectorControlElement,\n valueEditor: ValueEditorControlElement,\n cloneRuleAction: CloneRuleActionControlElement,\n lockRuleAction: LockRuleActionControlElement,\n removeRuleAction: RemoveRuleActionControlElement,\n },\n fields,\n listsAsArrays,\n parseNumbers,\n showCloneButtons,\n showLockButtons,\n },\n fieldData,\n generateOnChangeHandler,\n inputType,\n parentDisabled,\n path,\n translations,\n valueEditorType,\n valueEditorSeparator,\n values,\n valueSources,\n valueSourceOptions,\n validationResult,\n } = rule;\n\n const cloneRule = useStopEventPropagation(rule.cloneRule);\n const toggleLockRule = useStopEventPropagation(rule.toggleLockRule);\n const removeRule = useStopEventPropagation(rule.removeRule);\n\n const coreRuleProps = {\n context,\n disabled,\n level: path.length,\n path,\n schema: rule.schema,\n validation: validationResult,\n };\n const renderValueSources =\n !['null', 'notNull'].includes(operator) && valueSources.length > 1;\n\n return (\n <>\n {context.showRuleLines && (\n <QueryBuilderLines path={path} props={props} context={context} />\n )}\n <div className={outerClassName}>\n <FieldSelectorControlElement\n testID={TestID.fields}\n options={fields}\n title={translations.fields.title}\n value={field}\n operator={operator}\n className={classNames.fields}\n handleOnChange={generateOnChangeHandler('field')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <OperatorSelectorControlElement\n testID={TestID.operators}\n field={field}\n fieldData={rule.fieldData}\n title={rule.translations.operators.title}\n options={operators}\n value={operator}\n className={rule.classNames.operators}\n handleOnChange={rule.generateOnChangeHandler('operator')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n <ValueEditorControlElement\n testID={TestID.valueEditor}\n field={field}\n fieldData={fieldData}\n title={translations.value.title}\n operator={operator}\n value={value}\n valueSource={valueSource ?? 'value'}\n type={valueEditorType}\n inputType={inputType}\n values={values}\n listsAsArrays={listsAsArrays}\n parseNumbers={parseNumbers}\n separator={valueEditorSeparator}\n className={rule.classNames.value}\n handleOnChange={generateOnChangeHandler('value')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n {renderValueSources && (\n <ValueSourceSelectorControlElement\n testID={TestID.valueSourceSelector}\n field={field}\n fieldData={fieldData}\n title={translations.valueSourceSelector.title}\n options={valueSourceOptions}\n value={valueSource ?? 'value'}\n className={classNames.valueSource}\n handleOnChange={generateOnChangeHandler('valueSource')}\n rule={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n <div className={outerClassName}>\n <RemoveRuleActionControlElement\n testID={TestID.removeRule}\n label={translations.removeRule.label ?? 'remove'}\n title={translations.removeRule.title ?? 'remove'}\n className={classNames.removeRule}\n handleOnClick={removeRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n {showCloneButtons && (\n <CloneRuleActionControlElement\n testID={TestID.cloneRule}\n label={translations.cloneRule.label ?? 'clone'}\n title={translations.cloneRule.title ?? 'clone'}\n className={classNames.cloneRule}\n handleOnClick={cloneRule}\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n {showLockButtons && (\n <LockRuleActionControlElement\n testID={TestID.lockRule}\n label={translations.lockRule.label ?? 'lock'}\n title={translations.lockRule.title ?? 'lock'}\n className={classNames.lockRule}\n handleOnClick={toggleLockRule}\n disabledTranslation={\n parentDisabled ? undefined : translations.lockRuleDisabled\n }\n ruleOrGroup={rule.rule}\n {...coreRuleProps}\n />\n )}\n </div>\n </>\n );\n}\n"],"mappings":"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"}
|
|
@@ -15,9 +15,17 @@ import { Classnames, Field as Field$1, FullCombinator, FullField, FullOperator,
|
|
|
15
15
|
import { LiteralUnion } from "type-fest";
|
|
16
16
|
|
|
17
17
|
//#region src/components/query-builder/types.d.ts
|
|
18
|
+
/** Re-export of RuleGroupType from react-querybuilder. */
|
|
18
19
|
type RuleGroupType = RuleGroupType$1;
|
|
20
|
+
/** Re-export of Field from react-querybuilder. */
|
|
19
21
|
type Field = Field$1;
|
|
22
|
+
/** Default QueryBuilder props with full field, operator, and combinator types. */
|
|
20
23
|
type DefaultRQBProps = QueryBuilderProps$1<RuleGroupType, FullField, FullOperator, FullCombinator>;
|
|
24
|
+
/**
|
|
25
|
+
* Map of value editor types to their React component implementations.
|
|
26
|
+
*
|
|
27
|
+
* TODO: need to add multiselect back in when we have a compatible component
|
|
28
|
+
*/
|
|
21
29
|
type QueryBuilderValueEditors = Record<LiteralUnion<Exclude<ValueEditorProps['type'], null | undefined | 'multiselect'>, string>, (props: ValueEditorProps) => ReactElement>;
|
|
22
30
|
/**
|
|
23
31
|
* Omitted props are currently unsupported functionality
|
|
@@ -30,6 +38,7 @@ type QueryBuilderProps = Partial<Omit<DefaultRQBProps, 'showCombinatorsBetweenRu
|
|
|
30
38
|
* Omitted classnames are for unsupported features
|
|
31
39
|
*/
|
|
32
40
|
type ClassNames = Omit<Classnames, 'betweenRules' | 'branches' | 'dndDragging' | 'dndOver' | 'dndCopy' | 'dndGroup' | 'dragHandle' | 'shiftActions' | 'notToggle'>;
|
|
41
|
+
/** Context value for QueryBuilder containing display settings. */
|
|
33
42
|
type QueryBuilderContextType = Pick<QueryBuilderProps, 'showRuleLines' | 'orientation'>;
|
|
34
43
|
//#endregion
|
|
35
44
|
export { ClassNames, DefaultRQBProps, Field, QueryBuilderContextType, QueryBuilderProps, QueryBuilderValueEditors, RuleGroupType };
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
import { RuleType, RuleValidator, ValidationResult } from "react-querybuilder";
|
|
14
14
|
|
|
15
15
|
//#region src/components/query-builder/utils.d.ts
|
|
16
|
+
/**
|
|
17
|
+
* Runs the validator on a rule and normalizes the result.
|
|
18
|
+
* Returns { valid: true } if no validator is provided.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const rule = { field: 'age', operator: 'greaterThan', value: 18 };
|
|
23
|
+
* const validator = (r) => r.value > 0;
|
|
24
|
+
* const result = getValidationResult(rule, validator); // { valid: true }
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @param rule - The rule to validate.
|
|
28
|
+
* @param validator - Optional validator function for the rule.
|
|
29
|
+
* @returns Normalized validation result with valid flag and optional reasons.
|
|
30
|
+
*/
|
|
16
31
|
declare const getValidationResult: (rule: RuleType, validator?: RuleValidator) => ValidationResult;
|
|
17
32
|
//#endregion
|
|
18
33
|
export { getValidationResult };
|
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
//#region src/components/query-builder/utils.ts
|
|
15
|
+
/**
|
|
16
|
+
* Runs the validator on a rule and normalizes the result.
|
|
17
|
+
* Returns { valid: true } if no validator is provided.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const rule = { field: 'age', operator: 'greaterThan', value: 18 };
|
|
22
|
+
* const validator = (r) => r.value > 0;
|
|
23
|
+
* const result = getValidationResult(rule, validator); // { valid: true }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param rule - The rule to validate.
|
|
27
|
+
* @param validator - Optional validator function for the rule.
|
|
28
|
+
* @returns Normalized validation result with valid flag and optional reasons.
|
|
29
|
+
*/
|
|
15
30
|
const getValidationResult = (rule, validator) => {
|
|
16
31
|
if (!validator) return { valid: true };
|
|
17
32
|
const result = validator(rule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/query-builder/utils.ts"],"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 type {\n RuleType,\n RuleValidator,\n ValidationResult,\n} from 'react-querybuilder';\n\nexport const getValidationResult = (\n rule: RuleType,\n validator?: RuleValidator,\n): ValidationResult => {\n if (!validator) {\n return { valid: true };\n }\n\n const result = validator(rule);\n\n if (typeof result === 'boolean') {\n return { valid: result };\n }\n\n return {\n valid: result.valid,\n reasons: result.valid ? [] : result.reasons,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/query-builder/utils.ts"],"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 type {\n RuleType,\n RuleValidator,\n ValidationResult,\n} from 'react-querybuilder';\n\n/**\n * Runs the validator on a rule and normalizes the result.\n * Returns { valid: true } if no validator is provided.\n *\n * @example\n * ```tsx\n * const rule = { field: 'age', operator: 'greaterThan', value: 18 };\n * const validator = (r) => r.value > 0;\n * const result = getValidationResult(rule, validator); // { valid: true }\n * ```\n *\n * @param rule - The rule to validate.\n * @param validator - Optional validator function for the rule.\n * @returns Normalized validation result with valid flag and optional reasons.\n */\nexport const getValidationResult = (\n rule: RuleType,\n validator?: RuleValidator,\n): ValidationResult => {\n if (!validator) {\n return { valid: true };\n }\n\n const result = validator(rule);\n\n if (typeof result === 'boolean') {\n return { valid: result };\n }\n\n return {\n valid: result.valid,\n reasons: result.valid ? [] : result.reasons,\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA,MAAa,uBACX,MACA,cACqB;AACrB,KAAI,CAAC,UACH,QAAO,EAAE,OAAO,MAAM;CAGxB,MAAM,SAAS,UAAU,KAAK;AAE9B,KAAI,OAAO,WAAW,UACpB,QAAO,EAAE,OAAO,QAAQ;AAG1B,QAAO;EACL,OAAO,OAAO;EACd,SAAS,OAAO,QAAQ,EAAE,GAAG,OAAO;EACrC"}
|
|
@@ -11,11 +11,32 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react_jsx_runtime126 from "react/jsx-runtime";
|
|
15
15
|
import { ValueEditorProps } from "react-querybuilder";
|
|
16
16
|
|
|
17
17
|
//#region src/components/query-builder/value-editor.d.ts
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* ValueEditor - Input component for editing rule values
|
|
21
|
+
*
|
|
22
|
+
* Renders appropriate editor based on field type: text, checkbox, radio, select, switch, or textarea.
|
|
23
|
+
* Supports multi-value operators (between, notBetween) with start/end inputs.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <ValueEditor
|
|
28
|
+
* fieldData={{ name: 'age', valueEditorType: 'text' }}
|
|
29
|
+
* operator="greaterThan"
|
|
30
|
+
* value="18"
|
|
31
|
+
* handleOnChange={(value) => console.log(value)}
|
|
32
|
+
* rule={{ field: 'age', operator: 'greaterThan', value: '18' }}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param props - ValueEditorProps from react-querybuilder.
|
|
37
|
+
* @returns The rendered value editor, or null for null/notNull operators.
|
|
38
|
+
*/
|
|
39
|
+
declare function ValueEditor(props: ValueEditorProps): react_jsx_runtime126.JSX.Element | null;
|
|
19
40
|
//#endregion
|
|
20
41
|
export { ValueEditor };
|
|
21
42
|
//# sourceMappingURL=value-editor.d.ts.map
|
|
@@ -130,6 +130,26 @@ const valueEditors = {
|
|
|
130
130
|
text: TextValueEditor,
|
|
131
131
|
textarea: TextareaValueEditor
|
|
132
132
|
};
|
|
133
|
+
/**
|
|
134
|
+
* ValueEditor - Input component for editing rule values
|
|
135
|
+
*
|
|
136
|
+
* Renders appropriate editor based on field type: text, checkbox, radio, select, switch, or textarea.
|
|
137
|
+
* Supports multi-value operators (between, notBetween) with start/end inputs.
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```tsx
|
|
141
|
+
* <ValueEditor
|
|
142
|
+
* fieldData={{ name: 'age', valueEditorType: 'text' }}
|
|
143
|
+
* operator="greaterThan"
|
|
144
|
+
* value="18"
|
|
145
|
+
* handleOnChange={(value) => console.log(value)}
|
|
146
|
+
* rule={{ field: 'age', operator: 'greaterThan', value: '18' }}
|
|
147
|
+
* />
|
|
148
|
+
* ```
|
|
149
|
+
*
|
|
150
|
+
* @param props - ValueEditorProps from react-querybuilder.
|
|
151
|
+
* @returns The rendered value editor, or null for null/notNull operators.
|
|
152
|
+
*/
|
|
133
153
|
function ValueEditor(props) {
|
|
134
154
|
const { fieldData: { name, valueEditorType }, operator, rule: ruleProp } = props;
|
|
135
155
|
const { valueAsArray, multiValueHandler } = useValueEditor({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-editor.js","names":["defaultOptions: unknown[]","valueEditors: QueryBuilderValueEditors"],"sources":["../../../src/components/query-builder/value-editor.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'use client';\n\nimport 'client-only';\nimport { useCallback } from 'react';\nimport { useValueEditor, type ValueEditorProps } from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { RadioGroup } from '../radio/group';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport { multiValueOperators } from './constants';\nimport styles from './styles.module.css';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\nimport type { InputProps } from '../input/types';\nimport type { QueryBuilderValueEditors } from './types';\n\nfunction CheckboxValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n classNames={{ checkbox: className }}\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <RadioGroup\n classNames={{ group: className }}\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </RadioGroup>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n className={className}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n classNames={{ switch: className }}\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n className,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{\n placeholder,\n type: (inputType as InputProps['type']) ?? 'text',\n }}\n size='small'\n value={value}\n classNames={{ field: className, input: { container: styles.textInput } }}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n className,\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n classNames={{ field: className }}\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"value-editor.js","names":["defaultOptions: unknown[]","valueEditors: QueryBuilderValueEditors"],"sources":["../../../src/components/query-builder/value-editor.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'use client';\n\nimport 'client-only';\nimport { useCallback } from 'react';\nimport { useValueEditor, type ValueEditorProps } from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { RadioGroup } from '../radio/group';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport { multiValueOperators } from './constants';\nimport styles from './styles.module.css';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\nimport type { InputProps } from '../input/types';\nimport type { QueryBuilderValueEditors } from './types';\n\nfunction CheckboxValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n classNames={{ checkbox: className }}\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <RadioGroup\n classNames={{ group: className }}\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </RadioGroup>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n className={className}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n className,\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n classNames={{ switch: className }}\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n className,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{\n placeholder,\n type: (inputType as InputProps['type']) ?? 'text',\n }}\n size='small'\n value={value}\n classNames={{ field: className, input: { container: styles.textInput } }}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n className,\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n classNames={{ field: className }}\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\n/**\n * ValueEditor - Input component for editing rule values\n *\n * Renders appropriate editor based on field type: text, checkbox, radio, select, switch, or textarea.\n * Supports multi-value operators (between, notBetween) with start/end inputs.\n *\n * @example\n * ```tsx\n * <ValueEditor\n * fieldData={{ name: 'age', valueEditorType: 'text' }}\n * operator=\"greaterThan\"\n * value=\"18\"\n * handleOnChange={(value) => console.log(value)}\n * rule={{ field: 'age', operator: 'greaterThan', value: '18' }}\n * />\n * ```\n *\n * @param props - ValueEditorProps from react-querybuilder.\n * @returns The rendered value editor, or null for null/notNull operators.\n */\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAS,oBAAoB,EAC3B,WACA,UACA,WAAW,EAAE,MAAM,aACnB,gBACA,MACA,SACmB;CACnB,MAAM,EAAE,UAAU,oBAAoB,MAAM,UAAU;AAEtD,QACE,oBAAC;EACC,YAAY,EAAE,UAAU,WAAW;EACnC,YAAY;EACZ,YAAY;EACZ,UAAU;EACV,gBAAc,CAAC;EACf,cAAY;GACZ;;AAIN,SAAS,sBAAsB,EAC7B,WACA,UACA,WAAW,EAAE,MAAM,aACnB,gBACA,MACA,OACA,UACmB;CACnB,MAAM,EAAE,UAAU,oBAAoB,MAAM,UAAU;AAEtD,QACE,oBAAC;EACC,YAAY,EAAE,OAAO,WAAW;EACzB;EACP,YAAY;EACZ,UAAU;EACV,gBAAc,CAAC;EACf,cAAY;EACZ,mBAAiB;YAEhB,QAAQ,KAAK,WACZ,oBAAC;GAAwB,OAAO,OAAO;aACpC,OAAO;KADE,OAAO,KAEX,CACR;GACS;;AAIjB,MAAMA,iBAA4B,EAAE;AAEpC,SAAS,kBAAkB,EACzB,WACA,UACA,WAAW,EAAE,MAAM,aACnB,gBACA,MACA,MACA,OACA,SAAS,gBACT,GAAG,QACgB;CACnB,MAAM,EAAE,UAAU,oBAAoB,MAAM,UAAU;AAEtD,QACE,oBAAC;EACC,GAAI;EACO;EACD;EACV,UAAU,SAAS;EACnB,SAAS;EACT,OAAO;EACP,YAAY,CAAC;EACN;EACS;EAChB,mBAAiB;GACjB;;AAIN,SAAS,kBAAkB,EACzB,WACA,UACA,WAAW,EAAE,MAAM,aACnB,gBACA,MACA,SACmB;CACnB,MAAM,EAAE,UAAU,oBAAoB,MAAM,UAAU;AAEtD,QACE,oBAAC;EACC,YAAY,EAAE,QAAQ,WAAW;EACjC,YAAY;EACZ,YAAY,QAAQ,MAAM;EAC1B,UAAU;EACV,gBAAc,CAAC;EACf,cAAY;EACZ,mBAAiB;GACjB;;AAIN,SAAS,gBAAgB,EACvB,UACA,WAAW,EAAE,MAAM,aAAa,aAChC,gBACA,WACA,MACA,OACA,aACmB;CACnB,MAAM,EAAE,OAAO,YAAY,oBAAoB,MAAM,UAAU;AAE/D,QACE,oBAAC;EACC,YAAY;GACV;GACA,MAAO,aAAoC;GAC5C;EACD,MAAK;EACE;EACP,YAAY;GAAE,OAAO;GAAW,OAAO,EAAE,WAAW,OAAO,WAAW;GAAE;EACxE,YAAY;EACZ,WAAW,CAAC;EACZ,UAAU;EACV,gBAAc,CAAC;EACf,cAAY;EACZ,mBAAiB;EACjB,cAAc,SAAS,KAAK,KAAK;GACjC;;AAIN,SAAS,oBAAoB,EAC3B,WACA,UACA,WAAW,EAAE,MAAM,aAAa,aAChC,gBACA,MACA,SACmB;CACnB,MAAM,EAAE,OAAO,YAAY,oBAAoB,MAAM,UAAU;AAE/D,QACE,oBAAC;EACC,YAAY,EAAE,OAAO,WAAW;EAChC,MAAK;EACL,cAAc,SAAS,KAAK,KAAK;EACjC,YAAY,EAAE,aAAa;EACpB;EACP,YAAY;EACZ,WAAW,CAAC;EACZ,UAAU;EACV,cAAY;EACZ,gBAAc,CAAC;EACf,mBAAiB;GACjB;;AAIN,MAAMC,eAAyC;CAC7C,UAAU;CACV,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,UAAU;CACX;;;;;;;;;;;;;;;;;;;;;AAsBD,SAAgB,YAAY,OAAyB;CACnD,MAAM,EACJ,WAAW,EAAE,MAAM,mBACnB,UACA,MAAM,aACJ;CAEJ,MAAM,EAAE,cAAc,sBAAsB,eAAe;EACzD,GAAG;EACH,UAAU;EACX,CAAC;CAEF,MAAM,OAAO,aACV,WAAmB;EAClB,GAAG;EACH,OAAO,aAAa;EACrB,GACD,CAAC,UAAU,aAAa,CACzB;CAED,MAAM,yBAAyB,aAC5B,UAAkB,kBAAkB,OAAO,EAAE,EAC9C,CAAC,kBAAkB,CACpB;CAED,MAAM,uBAAuB,aAC1B,UAAkB,kBAAkB,OAAO,EAAE,EAC9C,CAAC,kBAAkB,CACpB;CAED,MAAM,QACH,OAAO,oBAAoB,aACxB,gBAAgB,SAAS,GACzB,oBAAoB;CAE1B,MAAM,SAAS,eAAe;AAE9B,KAAI,aAAa,UAAU,aAAa,aAAa,CAAC,OACpD,QAAO;AAGT,KAAI,oBAAoB,SAAS,SAAS,CACxC,QACE,4CACG,CAAC,SAAS,MAAM,CAAC,KAAK,MAAM,UAC3B,oBAAC,mBACC,oBAAC;EACC,GAAI;EACJ,MAAM,KAAK,MAAM;EACjB,OAAO,aAAa;EACpB,gBACE,QAAQ,uBAAuB;GAEjC,IARM,GAAG,KAAK,GAAG,OASf,CACN,GACD;AAIP,QACE,oBAAC,mBACC,oBAAC,UAAO,GAAI,QAAS,GACjB"}
|
|
@@ -11,11 +11,32 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import "client-only";
|
|
14
|
-
import * as
|
|
14
|
+
import * as react_jsx_runtime127 from "react/jsx-runtime";
|
|
15
15
|
import { ValueSelectorProps } from "react-querybuilder";
|
|
16
16
|
|
|
17
17
|
//#region src/components/query-builder/value-selector.d.ts
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* ValueSelector - Dropdown for selecting predefined values
|
|
21
|
+
*
|
|
22
|
+
* Renders a ComboBoxField with options, supporting grouped and flat option lists.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <ValueSelector
|
|
27
|
+
* options={[
|
|
28
|
+
* { name: 'option1', label: 'Option 1' },
|
|
29
|
+
* { name: 'option2', label: 'Option 2' }
|
|
30
|
+
* ]}
|
|
31
|
+
* value="option1"
|
|
32
|
+
* handleOnChange={(value) => console.log(value)}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @param props - ValueSelectorProps from react-querybuilder.
|
|
37
|
+
* @returns The rendered ValueSelector dropdown.
|
|
38
|
+
*/
|
|
39
|
+
declare function ValueSelector(props: ValueSelectorProps): react_jsx_runtime127.JSX.Element;
|
|
19
40
|
//#endregion
|
|
20
41
|
export { ValueSelector };
|
|
21
42
|
//# sourceMappingURL=value-selector.d.ts.map
|
|
@@ -22,6 +22,26 @@ import { jsx } from "react/jsx-runtime";
|
|
|
22
22
|
import { isOptionGroupArray, useValueSelector } from "react-querybuilder";
|
|
23
23
|
|
|
24
24
|
//#region src/components/query-builder/value-selector.tsx
|
|
25
|
+
/**
|
|
26
|
+
* ValueSelector - Dropdown for selecting predefined values
|
|
27
|
+
*
|
|
28
|
+
* Renders a ComboBoxField with options, supporting grouped and flat option lists.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ValueSelector
|
|
33
|
+
* options={[
|
|
34
|
+
* { name: 'option1', label: 'Option 1' },
|
|
35
|
+
* { name: 'option2', label: 'Option 2' }
|
|
36
|
+
* ]}
|
|
37
|
+
* value="option1"
|
|
38
|
+
* handleOnChange={(value) => console.log(value)}
|
|
39
|
+
* />
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @param props - ValueSelectorProps from react-querybuilder.
|
|
43
|
+
* @returns The rendered ValueSelector dropdown.
|
|
44
|
+
*/
|
|
25
45
|
function ValueSelector(props) {
|
|
26
46
|
const { handleOnChange, disabled, listsAsArrays, options: optionsProp, multiple, title, validation, value, ...rest } = props;
|
|
27
47
|
const { onChange, val } = useValueSelector({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-selector.js","names":[],"sources":["../../../src/components/query-builder/value-selector.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'use client';\n\nimport type { Key } from '@react-types/shared';\nimport 'client-only';\nimport { useCallback, useMemo } from 'react';\nimport {\n isOptionGroupArray,\n useValueSelector,\n type ValueSelectorProps,\n} from 'react-querybuilder';\nimport { ComboBoxField } from '../combobox-field';\nimport { OptionsItem } from '../options/item';\nimport { OptionsSection } from '../options/section';\n\nexport function ValueSelector(props: ValueSelectorProps) {\n const {\n handleOnChange,\n disabled,\n listsAsArrays,\n options: optionsProp,\n multiple,\n title,\n validation,\n value,\n ...rest\n } = props;\n\n const { onChange, val } = useValueSelector({\n handleOnChange,\n listsAsArrays,\n multiple,\n value,\n });\n\n const handleSelectionChange = useCallback(\n (selection: Key | null) => {\n if (selection) {\n onChange(`${selection}`);\n }\n },\n [onChange],\n );\n\n const options = useMemo(\n () =>\n isOptionGroupArray(optionsProp)\n ? optionsProp.map((section) => (\n <OptionsSection key={section.label} header={section.label}>\n {section.options.map((option) => (\n <OptionsItem id={option.name} key={option.name}>\n {option.label}\n </OptionsItem>\n ))}\n </OptionsSection>\n ))\n : optionsProp.map((option) => (\n <OptionsItem\n textValue={option.label}\n id={option.name}\n key={option.name}\n >\n {option.label}\n </OptionsItem>\n )),\n [optionsProp],\n );\n\n return (\n <ComboBoxField\n size='small'\n isDisabled={disabled}\n {...rest}\n selectedKey={Array.isArray(val) ? val[0] : val}\n aria-labelledby={title}\n onSelectionChange={handleSelectionChange}\n >\n {options}\n </ComboBoxField>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"value-selector.js","names":[],"sources":["../../../src/components/query-builder/value-selector.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'use client';\n\nimport type { Key } from '@react-types/shared';\nimport 'client-only';\nimport { useCallback, useMemo } from 'react';\nimport {\n isOptionGroupArray,\n useValueSelector,\n type ValueSelectorProps,\n} from 'react-querybuilder';\nimport { ComboBoxField } from '../combobox-field';\nimport { OptionsItem } from '../options/item';\nimport { OptionsSection } from '../options/section';\n\n/**\n * ValueSelector - Dropdown for selecting predefined values\n *\n * Renders a ComboBoxField with options, supporting grouped and flat option lists.\n *\n * @example\n * ```tsx\n * <ValueSelector\n * options={[\n * { name: 'option1', label: 'Option 1' },\n * { name: 'option2', label: 'Option 2' }\n * ]}\n * value=\"option1\"\n * handleOnChange={(value) => console.log(value)}\n * />\n * ```\n *\n * @param props - ValueSelectorProps from react-querybuilder.\n * @returns The rendered ValueSelector dropdown.\n */\nexport function ValueSelector(props: ValueSelectorProps) {\n const {\n handleOnChange,\n disabled,\n listsAsArrays,\n options: optionsProp,\n multiple,\n title,\n validation,\n value,\n ...rest\n } = props;\n\n const { onChange, val } = useValueSelector({\n handleOnChange,\n listsAsArrays,\n multiple,\n value,\n });\n\n const handleSelectionChange = useCallback(\n (selection: Key | null) => {\n if (selection) {\n onChange(`${selection}`);\n }\n },\n [onChange],\n );\n\n const options = useMemo(\n () =>\n isOptionGroupArray(optionsProp)\n ? optionsProp.map((section) => (\n <OptionsSection key={section.label} header={section.label}>\n {section.options.map((option) => (\n <OptionsItem id={option.name} key={option.name}>\n {option.label}\n </OptionsItem>\n ))}\n </OptionsSection>\n ))\n : optionsProp.map((option) => (\n <OptionsItem\n textValue={option.label}\n id={option.name}\n key={option.name}\n >\n {option.label}\n </OptionsItem>\n )),\n [optionsProp],\n );\n\n return (\n <ComboBoxField\n size='small'\n isDisabled={disabled}\n {...rest}\n selectedKey={Array.isArray(val) ? val[0] : val}\n aria-labelledby={title}\n onSelectionChange={handleSelectionChange}\n >\n {options}\n </ComboBoxField>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,cAAc,OAA2B;CACvD,MAAM,EACJ,gBACA,UACA,eACA,SAAS,aACT,UACA,OACA,YACA,OACA,GAAG,SACD;CAEJ,MAAM,EAAE,UAAU,QAAQ,iBAAiB;EACzC;EACA;EACA;EACA;EACD,CAAC;CAEF,MAAM,wBAAwB,aAC3B,cAA0B;AACzB,MAAI,UACF,UAAS,GAAG,YAAY;IAG5B,CAAC,SAAS,CACX;CAED,MAAM,UAAU,cAEZ,mBAAmB,YAAY,GAC3B,YAAY,KAAK,YACf,oBAAC;EAAmC,QAAQ,QAAQ;YACjD,QAAQ,QAAQ,KAAK,WACpB,oBAAC;GAAY,IAAI,OAAO;aACrB,OAAO;KADyB,OAAO,KAE5B,CACd;IALiB,QAAQ,MAMZ,CACjB,GACF,YAAY,KAAK,WACf,oBAAC;EACC,WAAW,OAAO;EAClB,IAAI,OAAO;YAGV,OAAO;IAFH,OAAO,KAGA,CACd,EACR,CAAC,YAAY,CACd;AAED,QACE,oBAAC;EACC,MAAK;EACL,YAAY;EACZ,GAAI;EACJ,aAAa,MAAM,QAAQ,IAAI,GAAG,IAAI,KAAK;EAC3C,mBAAiB;EACjB,mBAAmB;YAElB;GACa"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { RadioGroupProps as RadioGroupProps$1 } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react31 from "react";
|
|
16
16
|
import { ContextValue } from "react-aria-components";
|
|
17
17
|
|
|
18
18
|
//#region src/components/radio/context.d.ts
|
|
@@ -21,7 +21,7 @@ import { ContextValue } from "react-aria-components";
|
|
|
21
21
|
*
|
|
22
22
|
* Provides context for RadioGroup component to share state with Radio components
|
|
23
23
|
*/
|
|
24
|
-
declare const RadioContext:
|
|
24
|
+
declare const RadioContext: react31.Context<ContextValue<RadioGroupProps$1, HTMLDivElement>>;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { RadioContext };
|
|
27
27
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -12,19 +12,36 @@
|
|
|
12
12
|
|
|
13
13
|
import { RadioGroupProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime128 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/radio/group.d.ts
|
|
18
|
+
|
|
18
19
|
/**
|
|
19
20
|
* RadioGroup - Container component for Radio buttons
|
|
20
21
|
*
|
|
21
22
|
* Groups related Radio components and manages their selection state.
|
|
22
23
|
* Only one Radio can be selected at a time within a RadioGroup.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <RadioGroup label="Size" value="medium" onChange={setValue}>
|
|
28
|
+
* <Radio value="small">Small</Radio>
|
|
29
|
+
* <Radio value="medium">Medium</Radio>
|
|
30
|
+
* <Radio value="large">Large</Radio>
|
|
31
|
+
* </RadioGroup>
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param props - {@link RadioGroupProps}
|
|
35
|
+
* @param props.ref - Forwarded ref for the group container.
|
|
36
|
+
* @param props.classNames - Custom CSS class names for group and label.
|
|
37
|
+
* @param props.label - Optional text label for the group.
|
|
38
|
+
* @param props.children - Radio components to render inside the group.
|
|
39
|
+
* @returns The rendered RadioGroup component.
|
|
23
40
|
*/
|
|
24
41
|
declare function RadioGroup({
|
|
25
42
|
ref,
|
|
26
43
|
...props
|
|
27
|
-
}: RadioGroupProps):
|
|
44
|
+
}: RadioGroupProps): react_jsx_runtime128.JSX.Element;
|
|
28
45
|
//#endregion
|
|
29
46
|
export { RadioGroup };
|
|
30
47
|
//# sourceMappingURL=group.d.ts.map
|
|
@@ -27,6 +27,22 @@ import styles from "./styles.module.css";
|
|
|
27
27
|
*
|
|
28
28
|
* Groups related Radio components and manages their selection state.
|
|
29
29
|
* Only one Radio can be selected at a time within a RadioGroup.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* <RadioGroup label="Size" value="medium" onChange={setValue}>
|
|
34
|
+
* <Radio value="small">Small</Radio>
|
|
35
|
+
* <Radio value="medium">Medium</Radio>
|
|
36
|
+
* <Radio value="large">Large</Radio>
|
|
37
|
+
* </RadioGroup>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @param props - {@link RadioGroupProps}
|
|
41
|
+
* @param props.ref - Forwarded ref for the group container.
|
|
42
|
+
* @param props.classNames - Custom CSS class names for group and label.
|
|
43
|
+
* @param props.label - Optional text label for the group.
|
|
44
|
+
* @param props.children - Radio components to render inside the group.
|
|
45
|
+
* @returns The rendered RadioGroup component.
|
|
30
46
|
*/
|
|
31
47
|
function RadioGroup({ ref, ...props }) {
|
|
32
48
|
[props, ref] = useContextProps(props, ref ?? null, RadioContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","names":["AriaRadioGroup","Label","children"],"sources":["../../../src/components/radio/group.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 RadioGroup as AriaRadioGroup,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioContext } from './context';\nimport styles from './styles.module.css';\nimport type { RadioGroupProps } from './types';\n\n/**\n * RadioGroup - Container component for Radio buttons\n *\n * Groups related Radio components and manages their selection state.\n * Only one Radio can be selected at a time within a RadioGroup.\n */\nexport function RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, ...rest } = props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n clsx('group/radio-group', styles.group, className),\n )}\n >\n {composeRenderProps(children, (children, { isDisabled, isRequired }) => (\n <>\n {label && (\n <Label\n className={clsx(styles.label, classNames?.label)}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"group.js","names":["AriaRadioGroup","Label","children"],"sources":["../../../src/components/radio/group.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 RadioGroup as AriaRadioGroup,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioContext } from './context';\nimport styles from './styles.module.css';\nimport type { RadioGroupProps } from './types';\n\n/**\n * RadioGroup - Container component for Radio buttons\n *\n * Groups related Radio components and manages their selection state.\n * Only one Radio can be selected at a time within a RadioGroup.\n *\n * @example\n * ```tsx\n * <RadioGroup label=\"Size\" value=\"medium\" onChange={setValue}>\n * <Radio value=\"small\">Small</Radio>\n * <Radio value=\"medium\">Medium</Radio>\n * <Radio value=\"large\">Large</Radio>\n * </RadioGroup>\n * ```\n *\n * @param props - {@link RadioGroupProps}\n * @param props.ref - Forwarded ref for the group container.\n * @param props.classNames - Custom CSS class names for group and label.\n * @param props.label - Optional text label for the group.\n * @param props.children - Radio components to render inside the group.\n * @returns The rendered RadioGroup component.\n */\nexport function RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, ...rest } = props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n clsx('group/radio-group', styles.group, className),\n )}\n >\n {composeRenderProps(children, (children, { isDisabled, isRequired }) => (\n <>\n {label && (\n <Label\n className={clsx(styles.label, classNames?.label)}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,SAAgB,WAAW,EAAE,KAAK,GAAG,SAA0B;AAC7D,EAAC,OAAO,OAAO,gBAAgB,OAAO,OAAO,MAAM,aAAa;CAEhE,MAAM,EAAE,UAAU,YAAY,OAAO,GAAG,SAAS;AAEjD,QACE,oBAACA;EACC,GAAI;EACC;EACL,WAAW,mBAAmB,YAAY,QAAQ,cAChD,KAAK,qBAAqB,OAAO,OAAO,UAAU,CACnD;YAEA,mBAAmB,WAAW,YAAU,EAAE,YAAY,iBACrD,4CACG,SACC,oBAACC;GACC,WAAW,KAAK,OAAO,OAAO,YAAY,MAAM;GACpC;GACA;aAEX;IACK,EAETC,cACA,CACH;GACa"}
|
|
@@ -12,46 +12,33 @@
|
|
|
12
12
|
|
|
13
13
|
import { RadioProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime129 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/radio/index.d.ts
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* Radio -
|
|
20
|
+
* Radio - Individual radio button option within a RadioGroup
|
|
21
21
|
*
|
|
22
|
-
*
|
|
23
|
-
* selected at a time within a group. Includes proper labeling, keyboard navigation,
|
|
24
|
-
* and visual feedback for selection states.
|
|
22
|
+
* Renders a selectable radio button with label. Must be used inside a RadioGroup.
|
|
25
23
|
*
|
|
26
|
-
* @
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* <Radio value="medium">Medium</Radio>
|
|
31
|
-
* <Radio value="large">Large</Radio>
|
|
32
|
-
* </RadioGroup>
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Radio group with default selection
|
|
36
|
-
* <RadioGroup defaultValue="medium" label="Size preference">
|
|
37
|
-
* <Radio value="small">Small (S)</Radio>
|
|
38
|
-
* <Radio value="medium">Medium (M)</Radio>
|
|
39
|
-
* <Radio value="large">Large (L)</Radio>
|
|
40
|
-
* </RadioGroup>
|
|
24
|
+
* @param props - {@link RadioProps}
|
|
25
|
+
* @param props.classNames - Custom CSS class names for radio, control, and label.
|
|
26
|
+
* @param props.children - Label content for the radio button.
|
|
27
|
+
* @returns The rendered Radio component.
|
|
41
28
|
*
|
|
42
29
|
* @example
|
|
43
|
-
*
|
|
44
|
-
* <RadioGroup label="
|
|
45
|
-
* <Radio value="
|
|
46
|
-
* <Radio value="
|
|
47
|
-
* <Radio value="overnight" isDisabled>Overnight (unavailable)</Radio>
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <RadioGroup label="Favorite color">
|
|
32
|
+
* <Radio value="red">Red</Radio>
|
|
33
|
+
* <Radio value="blue">Blue</Radio>
|
|
48
34
|
* </RadioGroup>
|
|
35
|
+
* ```
|
|
49
36
|
*/
|
|
50
37
|
declare function Radio({
|
|
51
38
|
classNames,
|
|
52
39
|
children,
|
|
53
40
|
...rest
|
|
54
|
-
}: RadioProps):
|
|
41
|
+
}: RadioProps): react_jsx_runtime129.JSX.Element;
|
|
55
42
|
//#endregion
|
|
56
43
|
export { Radio };
|
|
57
44
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -21,35 +21,22 @@ import styles from "./styles.module.css";
|
|
|
21
21
|
|
|
22
22
|
//#region src/components/radio/index.tsx
|
|
23
23
|
/**
|
|
24
|
-
* Radio -
|
|
24
|
+
* Radio - Individual radio button option within a RadioGroup
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
* selected at a time within a group. Includes proper labeling, keyboard navigation,
|
|
28
|
-
* and visual feedback for selection states.
|
|
26
|
+
* Renders a selectable radio button with label. Must be used inside a RadioGroup.
|
|
29
27
|
*
|
|
30
|
-
* @
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* <Radio value="medium">Medium</Radio>
|
|
35
|
-
* <Radio value="large">Large</Radio>
|
|
36
|
-
* </RadioGroup>
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // Radio group with default selection
|
|
40
|
-
* <RadioGroup defaultValue="medium" label="Size preference">
|
|
41
|
-
* <Radio value="small">Small (S)</Radio>
|
|
42
|
-
* <Radio value="medium">Medium (M)</Radio>
|
|
43
|
-
* <Radio value="large">Large (L)</Radio>
|
|
44
|
-
* </RadioGroup>
|
|
28
|
+
* @param props - {@link RadioProps}
|
|
29
|
+
* @param props.classNames - Custom CSS class names for radio, control, and label.
|
|
30
|
+
* @param props.children - Label content for the radio button.
|
|
31
|
+
* @returns The rendered Radio component.
|
|
45
32
|
*
|
|
46
33
|
* @example
|
|
47
|
-
*
|
|
48
|
-
* <RadioGroup label="
|
|
49
|
-
* <Radio value="
|
|
50
|
-
* <Radio value="
|
|
51
|
-
* <Radio value="overnight" isDisabled>Overnight (unavailable)</Radio>
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <RadioGroup label="Favorite color">
|
|
36
|
+
* <Radio value="red">Red</Radio>
|
|
37
|
+
* <Radio value="blue">Blue</Radio>
|
|
52
38
|
* </RadioGroup>
|
|
39
|
+
* ```
|
|
53
40
|
*/
|
|
54
41
|
function Radio({ classNames, children, ...rest }) {
|
|
55
42
|
return /* @__PURE__ */ jsx(Radio$1, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["AriaRadio","children"],"sources":["../../../src/components/radio/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 { Radio as AriaRadio, composeRenderProps } from 'react-aria-components';\nimport styles from './styles.module.css';\nimport type { RadioProps } from './types';\n\n/**\n * Radio -
|
|
1
|
+
{"version":3,"file":"index.js","names":["AriaRadio","children"],"sources":["../../../src/components/radio/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 { Radio as AriaRadio, composeRenderProps } from 'react-aria-components';\nimport styles from './styles.module.css';\nimport type { RadioProps } from './types';\n\n/**\n * Radio - Individual radio button option within a RadioGroup\n *\n * Renders a selectable radio button with label. Must be used inside a RadioGroup.\n *\n * @param props - {@link RadioProps}\n * @param props.classNames - Custom CSS class names for radio, control, and label.\n * @param props.children - Label content for the radio button.\n * @returns The rendered Radio component.\n *\n * @example\n * ```tsx\n * <RadioGroup label=\"Favorite color\">\n * <Radio value=\"red\">Red</Radio>\n * <Radio value=\"blue\">Blue</Radio>\n * </RadioGroup>\n * ```\n */\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n clsx('group/radio', styles.radio, className),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={clsx(styles.control, classNames?.control)} />\n <span className={clsx(styles.label, classNames?.label)}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqCA,SAAgB,MAAM,EAAE,YAAY,UAAU,GAAG,QAAoB;AACnE,QACE,oBAACA;EACC,GAAI;EACJ,WAAW,mBAAmB,YAAY,QAAQ,cAChD,KAAK,eAAe,OAAO,OAAO,UAAU,CAC7C;YAEA,mBAAmB,WAAW,eAC7B,4CACE,oBAAC,UAAK,WAAW,KAAK,OAAO,SAAS,YAAY,QAAQ,GAAI,EAC9D,oBAAC;GAAK,WAAW,KAAK,OAAO,OAAO,YAAY,MAAM;aACnDC;IACI,IACN,CACH;GACQ"}
|
|
@@ -15,6 +15,14 @@ import { RefAttributes } from "react";
|
|
|
15
15
|
import { RadioGroupProps as RadioGroupProps$1, RadioProps as RadioProps$1 } from "react-aria-components";
|
|
16
16
|
|
|
17
17
|
//#region src/components/radio/types.d.ts
|
|
18
|
+
/**
|
|
19
|
+
* Props for RadioGroup component.
|
|
20
|
+
*
|
|
21
|
+
* Extends AriaRadioGroupProps with custom classNames and label support.
|
|
22
|
+
* - `classNames.group` - CSS class for the radio group container.
|
|
23
|
+
* - `classNames.label` - CSS class for the group label.
|
|
24
|
+
* - `label` - Optional text label for the group.
|
|
25
|
+
*/
|
|
18
26
|
type RadioGroupProps = Omit<RadioGroupProps$1, 'className'> & RefAttributes<HTMLDivElement> & {
|
|
19
27
|
classNames?: {
|
|
20
28
|
group?: RadioGroupProps$1['className'];
|
|
@@ -22,6 +30,14 @@ type RadioGroupProps = Omit<RadioGroupProps$1, 'className'> & RefAttributes<HTML
|
|
|
22
30
|
};
|
|
23
31
|
label?: string;
|
|
24
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Props for Radio component.
|
|
35
|
+
*
|
|
36
|
+
* Extends AriaRadioProps with custom classNames support.
|
|
37
|
+
* - `classNames.radio` - CSS class for the radio label wrapper.
|
|
38
|
+
* - `classNames.control` - CSS class for the radio button control.
|
|
39
|
+
* - `classNames.label` - CSS class for the radio label text.
|
|
40
|
+
*/
|
|
25
41
|
type RadioProps = Omit<RadioProps$1, 'className'> & RefAttributes<HTMLLabelElement> & {
|
|
26
42
|
classNames?: {
|
|
27
43
|
radio?: RadioProps$1['className'];
|