@d4gger/design-system 3.0.0 → 3.0.1
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/dist/{components/controlGroup/ControlGroup.cjs → _internal/floatingLayer.cjs} +11 -26
- package/dist/_internal/floatingLayer.cjs.map +7 -0
- package/dist/_internal/floatingLayer.d.cts +28 -0
- package/dist/_internal/floatingLayer.d.cts.map +1 -0
- package/dist/_internal/floatingLayer.d.mts +28 -0
- package/dist/_internal/floatingLayer.d.mts.map +1 -0
- package/dist/_internal/floatingLayer.d.ts +28 -0
- package/dist/_internal/floatingLayer.d.ts.map +1 -0
- package/dist/_internal/floatingLayer.js +11 -0
- package/dist/_internal/floatingLayer.js.map +7 -0
- package/dist/components/banner/Banner.cjs +105 -0
- package/dist/components/banner/Banner.cjs.map +7 -0
- package/dist/components/banner/Banner.d.cts +27 -0
- package/dist/components/banner/Banner.d.cts.map +1 -0
- package/dist/components/banner/Banner.d.mts +27 -0
- package/dist/components/banner/Banner.d.mts.map +1 -0
- package/dist/components/banner/Banner.d.ts +27 -0
- package/dist/components/banner/Banner.d.ts.map +1 -0
- package/dist/components/banner/Banner.js +80 -0
- package/dist/components/banner/Banner.js.map +7 -0
- package/dist/components/{controlGroup/controlGroup.props.cjs → banner/banner.props.cjs} +23 -16
- package/dist/components/banner/banner.props.cjs.map +7 -0
- package/dist/components/banner/banner.props.d.cts +32 -0
- package/dist/components/banner/banner.props.d.cts.map +1 -0
- package/dist/components/banner/banner.props.d.mts +32 -0
- package/dist/components/banner/banner.props.d.mts.map +1 -0
- package/dist/components/banner/banner.props.d.ts +32 -0
- package/dist/components/banner/banner.props.d.ts.map +1 -0
- package/dist/components/banner/banner.props.js +27 -0
- package/dist/components/banner/banner.props.js.map +7 -0
- package/dist/components/banner.css +60 -0
- package/dist/components/button-group.css +25 -0
- package/dist/components/button.css +9 -0
- package/dist/components/card.css +3 -0
- package/dist/components/carousel/Carousel.cjs +109 -39
- package/dist/components/carousel/Carousel.cjs.map +3 -3
- package/dist/components/carousel/Carousel.d.cts.map +1 -1
- package/dist/components/carousel/Carousel.d.mts.map +1 -1
- package/dist/components/carousel/Carousel.d.ts.map +1 -1
- package/dist/components/carousel/Carousel.js +111 -41
- package/dist/components/carousel/Carousel.js.map +3 -3
- package/dist/components/carousel.css +93 -26
- package/dist/components/chart/Chart.cjs +61 -11
- package/dist/components/chart/Chart.cjs.map +2 -2
- package/dist/components/chart/Chart.d.cts.map +1 -1
- package/dist/components/chart/Chart.d.mts.map +1 -1
- package/dist/components/chart/Chart.d.ts.map +1 -1
- package/dist/components/chart/Chart.js +62 -11
- package/dist/components/chart/Chart.js.map +2 -2
- package/dist/components/chart.css +10 -1
- package/dist/components/checkbox.css +14 -0
- package/dist/components/combobox/Combobox.cjs +3 -1
- package/dist/components/combobox/Combobox.cjs.map +2 -2
- package/dist/components/combobox/Combobox.d.cts.map +1 -1
- package/dist/components/combobox/Combobox.d.mts.map +1 -1
- package/dist/components/combobox/Combobox.d.ts.map +1 -1
- package/dist/components/combobox/Combobox.js +3 -1
- package/dist/components/combobox/Combobox.js.map +2 -2
- package/dist/components/combobox.css +5 -1
- package/dist/components/command/Command.cjs +1 -1
- package/dist/components/command/Command.cjs.map +2 -2
- package/dist/components/command/Command.js +1 -1
- package/dist/components/command/Command.js.map +2 -2
- package/dist/components/context-menu.css +1 -1
- package/dist/components/copy-field.css +18 -0
- package/dist/components/copyField/CopyField.cjs +3 -3
- package/dist/components/copyField/CopyField.cjs.map +2 -2
- package/dist/components/copyField/CopyField.d.cts.map +1 -1
- package/dist/components/copyField/CopyField.d.mts.map +1 -1
- package/dist/components/copyField/CopyField.d.ts.map +1 -1
- package/dist/components/copyField/CopyField.js +3 -3
- package/dist/components/copyField/CopyField.js.map +2 -2
- package/dist/components/data-list.css +19 -4
- package/dist/components/data-table.css +190 -0
- package/dist/components/dataTable/DataTable.cjs +193 -68
- package/dist/components/dataTable/DataTable.cjs.map +3 -3
- package/dist/components/dataTable/DataTable.d.cts +29 -1
- package/dist/components/dataTable/DataTable.d.cts.map +1 -1
- package/dist/components/dataTable/DataTable.d.mts +29 -1
- package/dist/components/dataTable/DataTable.d.mts.map +1 -1
- package/dist/components/dataTable/DataTable.d.ts +29 -1
- package/dist/components/dataTable/DataTable.d.ts.map +1 -1
- package/dist/components/dataTable/DataTable.js +193 -68
- package/dist/components/dataTable/DataTable.js.map +2 -2
- package/dist/components/dataTable/DataTableContext.cjs +41 -0
- package/dist/components/dataTable/DataTableContext.cjs.map +7 -0
- package/dist/components/dataTable/DataTableContext.d.cts +23 -0
- package/dist/components/dataTable/DataTableContext.d.cts.map +1 -0
- package/dist/components/dataTable/DataTableContext.d.mts +23 -0
- package/dist/components/dataTable/DataTableContext.d.mts.map +1 -0
- package/dist/components/dataTable/DataTableContext.d.ts +23 -0
- package/dist/components/dataTable/DataTableContext.d.ts.map +1 -0
- package/dist/components/dataTable/DataTableContext.js +11 -0
- package/dist/components/dataTable/DataTableContext.js.map +7 -0
- package/dist/components/dataTable/DataTablePagination.cjs +72 -47
- package/dist/components/dataTable/DataTablePagination.cjs.map +2 -2
- package/dist/components/dataTable/DataTablePagination.d.cts +5 -1
- package/dist/components/dataTable/DataTablePagination.d.cts.map +1 -1
- package/dist/components/dataTable/DataTablePagination.d.mts +5 -1
- package/dist/components/dataTable/DataTablePagination.d.mts.map +1 -1
- package/dist/components/dataTable/DataTablePagination.d.ts +5 -1
- package/dist/components/dataTable/DataTablePagination.d.ts.map +1 -1
- package/dist/components/dataTable/DataTablePagination.js +75 -47
- package/dist/components/dataTable/DataTablePagination.js.map +2 -2
- package/dist/components/dataTable/DataTableToolbar.cjs +122 -93
- package/dist/components/dataTable/DataTableToolbar.cjs.map +2 -2
- package/dist/components/dataTable/DataTableToolbar.d.cts +6 -5
- package/dist/components/dataTable/DataTableToolbar.d.cts.map +1 -1
- package/dist/components/dataTable/DataTableToolbar.d.mts +6 -5
- package/dist/components/dataTable/DataTableToolbar.d.mts.map +1 -1
- package/dist/components/dataTable/DataTableToolbar.d.ts +6 -5
- package/dist/components/dataTable/DataTableToolbar.d.ts.map +1 -1
- package/dist/components/dataTable/DataTableToolbar.js +123 -94
- package/dist/components/dataTable/DataTableToolbar.js.map +2 -2
- package/dist/components/dataTable/dataTable.export.cjs +83 -0
- package/dist/components/dataTable/dataTable.export.cjs.map +7 -0
- package/dist/components/dataTable/dataTable.export.d.cts +11 -0
- package/dist/components/dataTable/dataTable.export.d.cts.map +1 -0
- package/dist/components/dataTable/dataTable.export.d.mts +11 -0
- package/dist/components/dataTable/dataTable.export.d.mts.map +1 -0
- package/dist/components/dataTable/dataTable.export.d.ts +11 -0
- package/dist/components/dataTable/dataTable.export.d.ts.map +1 -0
- package/dist/components/dataTable/dataTable.export.js +63 -0
- package/dist/components/dataTable/dataTable.export.js.map +7 -0
- package/dist/components/dataTable/dataTable.props.cjs +23 -1
- package/dist/components/dataTable/dataTable.props.cjs.map +2 -2
- package/dist/components/dataTable/dataTable.props.d.cts +21 -1
- package/dist/components/dataTable/dataTable.props.d.cts.map +1 -1
- package/dist/components/dataTable/dataTable.props.d.mts +21 -1
- package/dist/components/dataTable/dataTable.props.d.mts.map +1 -1
- package/dist/components/dataTable/dataTable.props.d.ts +21 -1
- package/dist/components/dataTable/dataTable.props.d.ts.map +1 -1
- package/dist/components/dataTable/dataTable.props.js +23 -1
- package/dist/components/dataTable/dataTable.props.js.map +2 -2
- package/dist/components/dialog/Dialog.cjs +2 -1
- package/dist/components/dialog/Dialog.cjs.map +2 -2
- package/dist/components/dialog/Dialog.d.cts.map +1 -1
- package/dist/components/dialog/Dialog.d.mts.map +1 -1
- package/dist/components/dialog/Dialog.d.ts.map +1 -1
- package/dist/components/dialog/Dialog.js +2 -1
- package/dist/components/dialog/Dialog.js.map +2 -2
- package/dist/components/dropdown-menu.css +1 -1
- package/dist/components/empty-state.css +5 -0
- package/dist/components/fileUpload/FileUpload.cjs +10 -1
- package/dist/components/fileUpload/FileUpload.cjs.map +2 -2
- package/dist/components/fileUpload/FileUpload.d.cts +1 -0
- package/dist/components/fileUpload/FileUpload.d.cts.map +1 -1
- package/dist/components/fileUpload/FileUpload.d.mts +1 -0
- package/dist/components/fileUpload/FileUpload.d.mts.map +1 -1
- package/dist/components/fileUpload/FileUpload.d.ts +1 -0
- package/dist/components/fileUpload/FileUpload.d.ts.map +1 -1
- package/dist/components/fileUpload/FileUpload.js +10 -1
- package/dist/components/fileUpload/FileUpload.js.map +2 -2
- package/dist/components/filter-bar.css +380 -8
- package/dist/components/filterBar/FilterBar.cjs +630 -1
- package/dist/components/filterBar/FilterBar.cjs.map +2 -2
- package/dist/components/filterBar/FilterBar.d.cts +132 -2
- package/dist/components/filterBar/FilterBar.d.cts.map +1 -1
- package/dist/components/filterBar/FilterBar.d.mts +132 -2
- package/dist/components/filterBar/FilterBar.d.mts.map +1 -1
- package/dist/components/filterBar/FilterBar.d.ts +132 -2
- package/dist/components/filterBar/FilterBar.d.ts.map +1 -1
- package/dist/components/filterBar/FilterBar.js +631 -2
- package/dist/components/filterBar/FilterBar.js.map +2 -2
- package/dist/components/floating-panel.css +1 -1
- package/dist/components/fontProvider/FontProvider.cjs +1 -1
- package/dist/components/fontProvider/FontProvider.cjs.map +1 -1
- package/dist/components/fontProvider/FontProvider.js +1 -1
- package/dist/components/fontProvider/FontProvider.js.map +1 -1
- package/dist/components/icon/Icon.cjs +25 -2
- package/dist/components/icon/Icon.cjs.map +2 -2
- package/dist/components/icon/Icon.d.cts +29 -1
- package/dist/components/icon/Icon.d.cts.map +1 -1
- package/dist/components/icon/Icon.d.mts +29 -1
- package/dist/components/icon/Icon.d.mts.map +1 -1
- package/dist/components/icon/Icon.d.ts +29 -1
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js +33 -2
- package/dist/components/icon/Icon.js.map +2 -2
- package/dist/components/icon/icons.cjs +16 -0
- package/dist/components/icon/icons.cjs.map +2 -2
- package/dist/components/icon/icons.d.cts +40 -0
- package/dist/components/icon/icons.d.cts.map +1 -1
- package/dist/components/icon/icons.d.mts +40 -0
- package/dist/components/icon/icons.d.mts.map +1 -1
- package/dist/components/icon/icons.d.ts +40 -0
- package/dist/components/icon/icons.d.ts.map +1 -1
- package/dist/components/icon/icons.js +16 -0
- package/dist/components/icon/icons.js.map +2 -2
- package/dist/components/icon-button.css +29 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.cjs.map +2 -2
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/item/Item.cjs +1 -1
- package/dist/components/item/Item.cjs.map +2 -2
- package/dist/components/item/Item.js +1 -1
- package/dist/components/item/Item.js.map +2 -2
- package/dist/components/item.css +12 -1
- package/dist/components/marquee/Marquee.cjs +1 -1
- package/dist/components/marquee/Marquee.cjs.map +2 -2
- package/dist/components/marquee/Marquee.js +1 -1
- package/dist/components/marquee/Marquee.js.map +2 -2
- package/dist/components/marquee.css +6 -0
- package/dist/components/menu/Menu.cjs +3 -1
- package/dist/components/menu/Menu.cjs.map +2 -2
- package/dist/components/menu/Menu.d.cts.map +1 -1
- package/dist/components/menu/Menu.d.mts.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +3 -1
- package/dist/components/menu/Menu.js.map +2 -2
- package/dist/components/menubar.css +1 -1
- package/dist/components/metric.css +5 -0
- package/dist/components/pagination/Pagination.cjs +143 -17
- package/dist/components/pagination/Pagination.cjs.map +2 -2
- package/dist/components/pagination/Pagination.d.cts +64 -4
- package/dist/components/pagination/Pagination.d.cts.map +1 -1
- package/dist/components/pagination/Pagination.d.mts +64 -4
- package/dist/components/pagination/Pagination.d.mts.map +1 -1
- package/dist/components/pagination/Pagination.d.ts +64 -4
- package/dist/components/pagination/Pagination.d.ts.map +1 -1
- package/dist/components/pagination/Pagination.js +143 -17
- package/dist/components/pagination/Pagination.js.map +2 -2
- package/dist/components/pagination.css +50 -8
- package/dist/components/phoneInput/PhoneInput.cjs +18 -13
- package/dist/components/phoneInput/PhoneInput.cjs.map +2 -2
- package/dist/components/phoneInput/PhoneInput.d.cts.map +1 -1
- package/dist/components/phoneInput/PhoneInput.d.mts.map +1 -1
- package/dist/components/phoneInput/PhoneInput.d.ts.map +1 -1
- package/dist/components/phoneInput/PhoneInput.js +19 -14
- package/dist/components/phoneInput/PhoneInput.js.map +2 -2
- package/dist/components/popover/Popover.cjs +2 -1
- package/dist/components/popover/Popover.cjs.map +2 -2
- package/dist/components/popover/Popover.d.cts.map +1 -1
- package/dist/components/popover/Popover.d.mts.map +1 -1
- package/dist/components/popover/Popover.d.ts.map +1 -1
- package/dist/components/popover/Popover.js +2 -1
- package/dist/components/popover/Popover.js.map +2 -2
- package/dist/components/prose.css +1 -1
- package/dist/components/qr-code.css +5 -15
- package/dist/components/radio-group.css +19 -0
- package/dist/components/radioGroup/RadioGroup.cjs +3 -2
- package/dist/components/radioGroup/RadioGroup.cjs.map +2 -2
- package/dist/components/radioGroup/RadioGroup.d.cts.map +1 -1
- package/dist/components/radioGroup/RadioGroup.d.mts.map +1 -1
- package/dist/components/radioGroup/RadioGroup.d.ts.map +1 -1
- package/dist/components/radioGroup/RadioGroup.js +3 -2
- package/dist/components/radioGroup/RadioGroup.js.map +2 -2
- package/dist/components/radioGroup/radioGroup.props.cjs +1 -1
- package/dist/components/radioGroup/radioGroup.props.cjs.map +2 -2
- package/dist/components/radioGroup/radioGroup.props.d.cts +1 -1
- package/dist/components/radioGroup/radioGroup.props.d.mts +1 -1
- package/dist/components/radioGroup/radioGroup.props.d.ts +1 -1
- package/dist/components/radioGroup/radioGroup.props.js +1 -1
- package/dist/components/radioGroup/radioGroup.props.js.map +2 -2
- package/dist/components/rating.css +12 -0
- package/dist/components/result.css +2 -1
- package/dist/components/richTextEditor/RichTextEditor.cjs +11 -3
- package/dist/components/richTextEditor/RichTextEditor.cjs.map +2 -2
- package/dist/components/richTextEditor/RichTextEditor.d.cts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.d.mts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.d.ts.map +1 -1
- package/dist/components/richTextEditor/RichTextEditor.js +11 -3
- package/dist/components/richTextEditor/RichTextEditor.js.map +2 -2
- package/dist/components/segmented-control.css +80 -4
- package/dist/components/segmentedControl/SegmentedControl.cjs +18 -5
- package/dist/components/segmentedControl/SegmentedControl.cjs.map +2 -2
- package/dist/components/segmentedControl/SegmentedControl.d.cts.map +1 -1
- package/dist/components/segmentedControl/SegmentedControl.d.mts.map +1 -1
- package/dist/components/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/dist/components/segmentedControl/SegmentedControl.js +18 -5
- package/dist/components/segmentedControl/SegmentedControl.js.map +2 -2
- package/dist/components/segmentedControl/segmentedControl.props.cjs +10 -0
- package/dist/components/segmentedControl/segmentedControl.props.cjs.map +2 -2
- package/dist/components/segmentedControl/segmentedControl.props.d.cts +9 -0
- package/dist/components/segmentedControl/segmentedControl.props.d.cts.map +1 -1
- package/dist/components/segmentedControl/segmentedControl.props.d.mts +9 -0
- package/dist/components/segmentedControl/segmentedControl.props.d.mts.map +1 -1
- package/dist/components/segmentedControl/segmentedControl.props.d.ts +9 -0
- package/dist/components/segmentedControl/segmentedControl.props.d.ts.map +1 -1
- package/dist/components/segmentedControl/segmentedControl.props.js +10 -0
- package/dist/components/segmentedControl/segmentedControl.props.js.map +2 -2
- package/dist/components/select/Select.cjs +3 -1
- package/dist/components/select/Select.cjs.map +2 -2
- package/dist/components/select/Select.d.cts.map +1 -1
- package/dist/components/select/Select.d.mts.map +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +3 -1
- package/dist/components/select/Select.js.map +2 -2
- package/dist/components/select.css +1 -1
- package/dist/components/sonner.css +1 -1
- package/dist/components/sortableList/SortableList.cjs +8 -2
- package/dist/components/sortableList/SortableList.cjs.map +2 -2
- package/dist/components/sortableList/SortableList.d.cts.map +1 -1
- package/dist/components/sortableList/SortableList.d.mts.map +1 -1
- package/dist/components/sortableList/SortableList.d.ts.map +1 -1
- package/dist/components/sortableList/SortableList.js +8 -2
- package/dist/components/sortableList/SortableList.js.map +2 -2
- package/dist/components/stat-card.css +2 -0
- package/dist/components/table/Table.cjs +3 -2
- package/dist/components/table/Table.cjs.map +2 -2
- package/dist/components/table/Table.d.cts.map +1 -1
- package/dist/components/table/Table.d.mts.map +1 -1
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/Table.js +3 -2
- package/dist/components/table/Table.js.map +2 -2
- package/dist/components/table/table.props.cjs +6 -0
- package/dist/components/table/table.props.cjs.map +2 -2
- package/dist/components/table/table.props.d.cts +5 -0
- package/dist/components/table/table.props.d.cts.map +1 -1
- package/dist/components/table/table.props.d.mts +5 -0
- package/dist/components/table/table.props.d.mts.map +1 -1
- package/dist/components/table/table.props.d.ts +5 -0
- package/dist/components/table/table.props.d.ts.map +1 -1
- package/dist/components/table/table.props.js +6 -0
- package/dist/components/table/table.props.js.map +2 -2
- package/dist/components/table.css +20 -13
- package/dist/components/tabs.css +10 -0
- package/dist/components/timeline.css +54 -18
- package/dist/components/toast.css +33 -1
- package/dist/components/toggle-group.css +5 -0
- package/dist/components.css +1 -2
- package/dist/docs/README.md +1 -1
- package/dist/docs/component-contract.md +4 -4
- package/dist/docs/component-index.json +9 -9
- package/dist/docs/components/banner.md +152 -0
- package/dist/docs/components/button-group.md +4 -3
- package/dist/docs/components/button.md +2 -2
- package/dist/docs/components/card.md +1 -0
- package/dist/docs/components/carousel.md +55 -32
- package/dist/docs/components/chart.md +25 -7
- package/dist/docs/components/checkbox.md +4 -0
- package/dist/docs/components/combobox.md +3 -1
- package/dist/docs/components/command.md +2 -2
- package/dist/docs/components/copy-field.md +2 -2
- package/dist/docs/components/data-list.md +15 -3
- package/dist/docs/components/data-table.md +98 -17
- package/dist/docs/components/dialog.md +4 -0
- package/dist/docs/components/dropdown-menu.md +2 -1
- package/dist/docs/components/empty-state.md +3 -1
- package/dist/docs/components/file-upload.md +1 -0
- package/dist/docs/components/filter-bar.md +193 -8
- package/dist/docs/components/floating-panel.md +8 -8
- package/dist/docs/components/icon-button.md +4 -1
- package/dist/docs/components/item.md +18 -13
- package/dist/docs/components/marquee.md +2 -2
- package/dist/docs/components/menu.md +4 -1
- package/dist/docs/components/metric.md +4 -1
- package/dist/docs/components/pagination.md +88 -17
- package/dist/docs/components/pills.md +1 -1
- package/dist/docs/components/popover.md +2 -0
- package/dist/docs/components/prose.md +5 -1
- package/dist/docs/components/qr-code.md +14 -13
- package/dist/docs/components/radio-group.md +5 -2
- package/dist/docs/components/rating.md +2 -0
- package/dist/docs/components/result.md +6 -0
- package/dist/docs/components/segmented-control.md +7 -2
- package/dist/docs/components/select.md +3 -2
- package/dist/docs/components/sidebar.md +3 -1
- package/dist/docs/components/sonner.md +1 -1
- package/dist/docs/components/sortable-list.md +2 -0
- package/dist/docs/components/stat-card.md +5 -4
- package/dist/docs/components/stepper.md +1 -0
- package/dist/docs/components/table.md +14 -5
- package/dist/docs/components/tag.md +4 -2
- package/dist/docs/components/timeline.md +9 -5
- package/dist/docs/components/toast.md +1 -1
- package/dist/docs/components/toggle-group.md +2 -1
- package/dist/fonts.css +1 -1
- package/dist/generated/tokens.cjs +1 -1
- package/dist/generated/tokens.cjs.map +1 -1
- package/dist/generated/tokens.js +1 -1
- package/dist/generated/tokens.js.map +1 -1
- package/dist/motion.css +18 -3
- package/dist/styles.css +1249 -292
- package/dist/tokens.css +21 -15
- package/package.json +1 -1
- package/dist/components/control-group.css +0 -142
- package/dist/components/controlGroup/ControlGroup.cjs.map +0 -7
- package/dist/components/controlGroup/ControlGroup.d.cts +0 -16
- package/dist/components/controlGroup/ControlGroup.d.cts.map +0 -1
- package/dist/components/controlGroup/ControlGroup.d.mts +0 -16
- package/dist/components/controlGroup/ControlGroup.d.mts.map +0 -1
- package/dist/components/controlGroup/ControlGroup.d.ts +0 -16
- package/dist/components/controlGroup/ControlGroup.d.ts.map +0 -1
- package/dist/components/controlGroup/ControlGroup.js +0 -26
- package/dist/components/controlGroup/ControlGroup.js.map +0 -7
- package/dist/components/controlGroup/controlGroup.props.cjs.map +0 -7
- package/dist/components/controlGroup/controlGroup.props.d.cts +0 -18
- package/dist/components/controlGroup/controlGroup.props.d.cts.map +0 -1
- package/dist/components/controlGroup/controlGroup.props.d.mts +0 -18
- package/dist/components/controlGroup/controlGroup.props.d.mts.map +0 -1
- package/dist/components/controlGroup/controlGroup.props.d.ts +0 -18
- package/dist/components/controlGroup/controlGroup.props.d.ts.map +0 -1
- package/dist/components/controlGroup/controlGroup.props.js +0 -20
- package/dist/components/controlGroup/controlGroup.props.js.map +0 -7
- package/dist/docs/components/control-group.md +0 -261
|
@@ -30,11 +30,18 @@ var FilterBar_exports = {};
|
|
|
30
30
|
__export(FilterBar_exports, {
|
|
31
31
|
FilterBar: () => FilterBar,
|
|
32
32
|
FilterBarActions: () => FilterBarActions,
|
|
33
|
+
FilterBarBuilder: () => FilterBarBuilder,
|
|
33
34
|
FilterBarClear: () => FilterBarClear,
|
|
35
|
+
FilterBarCondition: () => FilterBarCondition,
|
|
36
|
+
FilterBarConditionEditor: () => FilterBarConditionEditor,
|
|
37
|
+
FilterBarConditionGroup: () => FilterBarConditionGroup,
|
|
34
38
|
FilterBarControl: () => FilterBarControl,
|
|
35
39
|
FilterBarCount: () => FilterBarCount,
|
|
36
40
|
FilterBarGroup: () => FilterBarGroup,
|
|
37
41
|
FilterBarRoot: () => FilterBarRoot,
|
|
42
|
+
FilterBarRule: () => FilterBarRule,
|
|
43
|
+
FilterBarRules: () => FilterBarRules,
|
|
44
|
+
FilterBarSearch: () => FilterBarSearch,
|
|
38
45
|
FilterBarSummary: () => FilterBarSummary
|
|
39
46
|
});
|
|
40
47
|
module.exports = __toCommonJS(FilterBar_exports);
|
|
@@ -42,6 +49,16 @@ var React = __toESM(require("react"), 1);
|
|
|
42
49
|
var import_classnames = __toESM(require("classnames"), 1);
|
|
43
50
|
var import_extractProps = require("../../_internal/helpers/extractProps");
|
|
44
51
|
var import_Button = require("../button/Button");
|
|
52
|
+
var import_Badge = require("../badge/Badge");
|
|
53
|
+
var import_Icon = require("../icon/Icon");
|
|
54
|
+
var import_IconButton = require("../iconButton/IconButton");
|
|
55
|
+
var import_Input = require("../input/Input");
|
|
56
|
+
var import_NumberInput = require("../numberInput/NumberInput");
|
|
57
|
+
var import_Pills = require("../pills/Pills");
|
|
58
|
+
var import_Popover = require("../popover/Popover");
|
|
59
|
+
var import_Select = require("../select/Select");
|
|
60
|
+
var import_Slider = require("../slider/Slider");
|
|
61
|
+
var import_TagsInput = require("../tagsInput/TagsInput");
|
|
45
62
|
var import_filterBar = require("./filterBar.props");
|
|
46
63
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
47
64
|
const FilterBarContext = React.createContext(void 0);
|
|
@@ -109,12 +126,624 @@ const FilterBarClear = React.forwardRef(
|
|
|
109
126
|
}
|
|
110
127
|
);
|
|
111
128
|
FilterBarClear.displayName = "FilterBarClear";
|
|
129
|
+
const FilterBarSearch = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, ref, className: (0, import_classnames.default)("dsx-filter-bar__search", className) }));
|
|
130
|
+
FilterBarSearch.displayName = "FilterBarSearch";
|
|
131
|
+
const FilterBarRules = React.forwardRef(
|
|
132
|
+
({
|
|
133
|
+
children,
|
|
134
|
+
className,
|
|
135
|
+
clearAllLabel = "Clear",
|
|
136
|
+
defaultExpanded = false,
|
|
137
|
+
expanded: expandedProp,
|
|
138
|
+
maxVisible,
|
|
139
|
+
onClearAll,
|
|
140
|
+
onExpandedChange,
|
|
141
|
+
showLessLabel = "Show less",
|
|
142
|
+
showMoreLabel = (hiddenCount) => `+${hiddenCount} more`,
|
|
143
|
+
size = "md",
|
|
144
|
+
...props
|
|
145
|
+
}, forwardedRef) => {
|
|
146
|
+
const items = React.Children.toArray(children);
|
|
147
|
+
const [uncontrolledExpanded, setUncontrolledExpanded] = React.useState(defaultExpanded);
|
|
148
|
+
const expanded = expandedProp ?? uncontrolledExpanded;
|
|
149
|
+
function setExpanded(next) {
|
|
150
|
+
if (expandedProp === void 0) setUncontrolledExpanded(next);
|
|
151
|
+
onExpandedChange?.(next);
|
|
152
|
+
}
|
|
153
|
+
const collapsible = maxVisible !== void 0 && items.length > maxVisible;
|
|
154
|
+
const visibleItems = collapsible && !expanded ? items.slice(0, maxVisible) : items;
|
|
155
|
+
const hiddenCount = items.length - visibleItems.length;
|
|
156
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Pills.Pills, { ...props, ref: forwardedRef, size, className: (0, import_classnames.default)("dsx-filter-bar__rules", className), children: [
|
|
157
|
+
visibleItems,
|
|
158
|
+
collapsible || onClearAll !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "dsx-filter-bar__rules-overflow", children: [
|
|
159
|
+
collapsible && !expanded ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
160
|
+
import_Button.Button,
|
|
161
|
+
{
|
|
162
|
+
type: "button",
|
|
163
|
+
variant: "ghost",
|
|
164
|
+
size: "sm",
|
|
165
|
+
"aria-expanded": false,
|
|
166
|
+
"aria-label": `Show ${hiddenCount} more filters`,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
setExpanded(true);
|
|
169
|
+
},
|
|
170
|
+
children: showMoreLabel(hiddenCount)
|
|
171
|
+
}
|
|
172
|
+
) : null,
|
|
173
|
+
collapsible && expanded ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
174
|
+
import_Button.Button,
|
|
175
|
+
{
|
|
176
|
+
type: "button",
|
|
177
|
+
variant: "ghost",
|
|
178
|
+
size: "sm",
|
|
179
|
+
"aria-expanded": true,
|
|
180
|
+
onClick: () => {
|
|
181
|
+
setExpanded(false);
|
|
182
|
+
},
|
|
183
|
+
children: showLessLabel
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
onClearAll !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
+
import_Button.Button,
|
|
188
|
+
{
|
|
189
|
+
type: "button",
|
|
190
|
+
variant: "ghost",
|
|
191
|
+
size: "sm",
|
|
192
|
+
"aria-label": "Clear all filters",
|
|
193
|
+
onClick: onClearAll,
|
|
194
|
+
children: clearAllLabel
|
|
195
|
+
}
|
|
196
|
+
) : null
|
|
197
|
+
] }) : null
|
|
198
|
+
] });
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
FilterBarRules.displayName = "FilterBarRules";
|
|
202
|
+
function describeRulePart(part) {
|
|
203
|
+
return typeof part === "string" || typeof part === "number" ? String(part) : void 0;
|
|
204
|
+
}
|
|
205
|
+
function describeRuleEditLabel(field, operator, value) {
|
|
206
|
+
const fieldText = describeRulePart(field);
|
|
207
|
+
const operatorText = describeRulePart(operator);
|
|
208
|
+
const valueText = describeRulePart(value);
|
|
209
|
+
return fieldText !== void 0 && operatorText !== void 0 && valueText !== void 0 ? `Edit filter: ${fieldText} ${operatorText} ${valueText}` : "Edit filter";
|
|
210
|
+
}
|
|
211
|
+
const FilterBarRule = React.forwardRef(
|
|
212
|
+
({ active = false, children, className, count, field, onEdit, onRemove, operator, size = "md", value, ...props }, forwardedRef) => {
|
|
213
|
+
const editLabel = describeRuleEditLabel(field, operator, value);
|
|
214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
215
|
+
import_Pills.Pill,
|
|
216
|
+
{
|
|
217
|
+
...props,
|
|
218
|
+
ref: forwardedRef,
|
|
219
|
+
size,
|
|
220
|
+
removable: onRemove !== void 0,
|
|
221
|
+
onRemove,
|
|
222
|
+
className: (0, import_classnames.default)("dsx-filter-bar__rule", className),
|
|
223
|
+
"data-active": active ? "true" : void 0,
|
|
224
|
+
children: [
|
|
225
|
+
onEdit !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "dsx-filter-bar__rule-label", onClick: onEdit, "aria-label": editLabel, children: [
|
|
226
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-field", children: field }),
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-operator", children: operator }),
|
|
228
|
+
value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", "data-empty": "true", children: "empty" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", children: value }),
|
|
229
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-count", children: count }) : null
|
|
230
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsx-filter-bar__rule-label", "aria-hidden": false, children: [
|
|
231
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-field", children: field }),
|
|
232
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-operator", children: operator }),
|
|
233
|
+
value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", "data-empty": "true", children: "empty" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", children: value }),
|
|
234
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-count", children: count }) : null
|
|
235
|
+
] }),
|
|
236
|
+
children
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
FilterBarRule.displayName = "FilterBarRule";
|
|
243
|
+
const FILTER_BAR_BUILDER_DEFAULT_OPERATORS = ["is", "is not", "contains", "does not contain"];
|
|
244
|
+
const FILTER_BAR_BUILDER_EMPTY_RULE = { field: "", operator: "", value: "" };
|
|
245
|
+
function parseRangeValue(raw, min, max) {
|
|
246
|
+
const [lo, hi] = raw.split("..").map((part) => Number(part));
|
|
247
|
+
const safeLo = Number.isFinite(lo) ? Math.min(Math.max(lo, min), max) : min;
|
|
248
|
+
const safeHi = Number.isFinite(hi) ? Math.min(Math.max(hi, safeLo), max) : max;
|
|
249
|
+
return [safeLo, safeHi];
|
|
250
|
+
}
|
|
251
|
+
function FilterBarDraftFields({
|
|
252
|
+
compact = false,
|
|
253
|
+
draft,
|
|
254
|
+
fields,
|
|
255
|
+
fieldClassName,
|
|
256
|
+
labelClassName,
|
|
257
|
+
onPatch,
|
|
258
|
+
operators: operatorsProp,
|
|
259
|
+
operatorLabelId,
|
|
260
|
+
valueClassName,
|
|
261
|
+
valueInputId,
|
|
262
|
+
valueLabelId
|
|
263
|
+
}) {
|
|
264
|
+
const selectedField = fields.find((field) => field.value === draft.field);
|
|
265
|
+
const operatorOptions = selectedField?.operators ?? operatorsProp ?? [...FILTER_BAR_BUILDER_DEFAULT_OPERATORS];
|
|
266
|
+
const valueOptions = selectedField?.options;
|
|
267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
268
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: fieldClassName, children: [
|
|
269
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClassName, id: operatorLabelId, children: "Operator" }),
|
|
270
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Select.SelectRoot, { value: draft.operator, onValueChange: (nextOperator) => {
|
|
271
|
+
onPatch({ operator: nextOperator });
|
|
272
|
+
}, children: [
|
|
273
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-label": "Operator", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose operator" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-labelledby": operatorLabelId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose operator" }) }),
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectContent, { children: operatorOptions.map((operator) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectItem, { value: operator, children: operator }, operator)) })
|
|
275
|
+
] })
|
|
276
|
+
] }),
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: valueClassName ?? fieldClassName, children: selectedField?.renderValue !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
278
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClassName, id: valueLabelId, children: "Value" }),
|
|
279
|
+
selectedField.renderValue({
|
|
280
|
+
value: draft.value,
|
|
281
|
+
onChange: (nextValue) => {
|
|
282
|
+
onPatch({ value: nextValue });
|
|
283
|
+
},
|
|
284
|
+
id: valueInputId
|
|
285
|
+
})
|
|
286
|
+
] }) : valueOptions !== void 0 || selectedField?.type === "enum" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
287
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClassName, id: valueLabelId, children: "Value" }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Select.SelectRoot, { value: draft.value, onValueChange: (nextValue) => {
|
|
289
|
+
onPatch({ value: nextValue });
|
|
290
|
+
}, children: [
|
|
291
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-label": "Value", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose value" }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-labelledby": valueLabelId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose value" }) }),
|
|
292
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectContent, { children: (valueOptions ?? []).map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectItem, { value: option.value, children: option.label ?? option.value }, option.value)) })
|
|
293
|
+
] })
|
|
294
|
+
] }) : selectedField?.type === "number" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
295
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: labelClassName, htmlFor: valueInputId, children: "Value" }),
|
|
296
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
297
|
+
import_NumberInput.NumberInput,
|
|
298
|
+
{
|
|
299
|
+
id: valueInputId,
|
|
300
|
+
"aria-label": "Filter value",
|
|
301
|
+
value: draft.value === "" ? void 0 : Number(draft.value),
|
|
302
|
+
onChange: (nextValue) => {
|
|
303
|
+
onPatch({ value: nextValue === void 0 ? "" : String(nextValue) });
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] }) : selectedField?.type === "multi" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
308
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: labelClassName, id: valueLabelId, children: "Value" }),
|
|
309
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
310
|
+
import_TagsInput.TagsInput,
|
|
311
|
+
{
|
|
312
|
+
"aria-label": "Filter value",
|
|
313
|
+
value: draft.value === "" ? [] : draft.value.split(","),
|
|
314
|
+
onChange: (nextTags) => {
|
|
315
|
+
onPatch({ value: nextTags.join(",") });
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
319
|
+
import_TagsInput.TagsInput,
|
|
320
|
+
{
|
|
321
|
+
"aria-labelledby": valueLabelId,
|
|
322
|
+
value: draft.value === "" ? [] : draft.value.split(","),
|
|
323
|
+
onChange: (nextTags) => {
|
|
324
|
+
onPatch({ value: nextTags.join(",") });
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
)
|
|
328
|
+
] }) : selectedField?.type === "range" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
329
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: labelClassName, id: valueLabelId, children: [
|
|
330
|
+
"Value",
|
|
331
|
+
draft.value !== "" ? ` (${draft.value})` : ""
|
|
332
|
+
] }),
|
|
333
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
334
|
+
import_Slider.Slider,
|
|
335
|
+
{
|
|
336
|
+
"aria-label": "Filter value",
|
|
337
|
+
min: selectedField.min ?? 0,
|
|
338
|
+
max: selectedField.max ?? 100,
|
|
339
|
+
step: selectedField.step ?? 1,
|
|
340
|
+
value: parseRangeValue(draft.value, selectedField.min ?? 0, selectedField.max ?? 100),
|
|
341
|
+
onValueChange: (nextRange) => {
|
|
342
|
+
const lo = nextRange[0] ?? selectedField.min ?? 0;
|
|
343
|
+
const hi = nextRange[1] ?? selectedField.max ?? 100;
|
|
344
|
+
onPatch({ value: `${lo}..${hi}` });
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
348
|
+
import_Slider.Slider,
|
|
349
|
+
{
|
|
350
|
+
"aria-labelledby": valueLabelId,
|
|
351
|
+
min: selectedField.min ?? 0,
|
|
352
|
+
max: selectedField.max ?? 100,
|
|
353
|
+
step: selectedField.step ?? 1,
|
|
354
|
+
value: parseRangeValue(draft.value, selectedField.min ?? 0, selectedField.max ?? 100),
|
|
355
|
+
onValueChange: (nextRange) => {
|
|
356
|
+
const lo = nextRange[0] ?? selectedField.min ?? 0;
|
|
357
|
+
const hi = nextRange[1] ?? selectedField.max ?? 100;
|
|
358
|
+
onPatch({ value: `${lo}..${hi}` });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
)
|
|
362
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
363
|
+
compact ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: labelClassName, htmlFor: valueInputId, children: "Value" }),
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
365
|
+
import_Input.Input,
|
|
366
|
+
{
|
|
367
|
+
id: valueInputId,
|
|
368
|
+
"aria-label": "Filter value",
|
|
369
|
+
placeholder: selectedField?.type === "date" ? "YYYY-MM-DD" : selectedField?.type === "person" ? "Enter name" : "Enter value",
|
|
370
|
+
value: draft.value,
|
|
371
|
+
onChange: (event) => {
|
|
372
|
+
const nextValue = event.currentTarget.value;
|
|
373
|
+
onPatch({ value: nextValue });
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
)
|
|
377
|
+
] }) })
|
|
378
|
+
] });
|
|
379
|
+
}
|
|
380
|
+
function FilterBarBuilder({
|
|
381
|
+
cancelLabel = "Cancel",
|
|
382
|
+
className,
|
|
383
|
+
count,
|
|
384
|
+
defaultOpen = false,
|
|
385
|
+
fields,
|
|
386
|
+
initialRule = null,
|
|
387
|
+
onApply,
|
|
388
|
+
onCancel,
|
|
389
|
+
onOpenChange,
|
|
390
|
+
open: openProp,
|
|
391
|
+
operators: operatorsProp,
|
|
392
|
+
submitLabel = "Apply",
|
|
393
|
+
title = "Add filter",
|
|
394
|
+
trigger
|
|
395
|
+
}) {
|
|
396
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React.useState(defaultOpen);
|
|
397
|
+
const open = openProp ?? uncontrolledOpen;
|
|
398
|
+
const [draft, setDraft] = React.useState(initialRule ?? FILTER_BAR_BUILDER_EMPTY_RULE);
|
|
399
|
+
const wasOpenRef = React.useRef(open);
|
|
400
|
+
React.useEffect(() => {
|
|
401
|
+
if (open && !wasOpenRef.current) {
|
|
402
|
+
setDraft(initialRule ?? FILTER_BAR_BUILDER_EMPTY_RULE);
|
|
403
|
+
}
|
|
404
|
+
wasOpenRef.current = open;
|
|
405
|
+
}, [open, initialRule]);
|
|
406
|
+
const fieldLabelId = React.useId();
|
|
407
|
+
const operatorLabelId = React.useId();
|
|
408
|
+
const valueLabelId = React.useId();
|
|
409
|
+
const valueInputId = React.useId();
|
|
410
|
+
function handleOpenChange(nextOpen) {
|
|
411
|
+
if (nextOpen) {
|
|
412
|
+
setDraft(initialRule ?? FILTER_BAR_BUILDER_EMPTY_RULE);
|
|
413
|
+
}
|
|
414
|
+
if (openProp === void 0) {
|
|
415
|
+
setUncontrolledOpen(nextOpen);
|
|
416
|
+
}
|
|
417
|
+
onOpenChange?.(nextOpen);
|
|
418
|
+
}
|
|
419
|
+
function close(nextOpen) {
|
|
420
|
+
if (openProp === void 0) {
|
|
421
|
+
setUncontrolledOpen(nextOpen);
|
|
422
|
+
}
|
|
423
|
+
onOpenChange?.(nextOpen);
|
|
424
|
+
}
|
|
425
|
+
function handleFieldChange(nextField) {
|
|
426
|
+
const nextFieldDef = fields.find((field) => field.value === nextField);
|
|
427
|
+
const nextOperators = nextFieldDef?.operators ?? operatorsProp ?? [...FILTER_BAR_BUILDER_DEFAULT_OPERATORS];
|
|
428
|
+
const nextValue = nextFieldDef?.type === "range" ? `${nextFieldDef.min ?? 0}..${nextFieldDef.max ?? 100}` : "";
|
|
429
|
+
setDraft({ field: nextField, operator: nextOperators[0] ?? "", value: nextValue });
|
|
430
|
+
}
|
|
431
|
+
const canApply = draft.field !== "" && draft.operator !== "";
|
|
432
|
+
function handleApply() {
|
|
433
|
+
if (!canApply) return;
|
|
434
|
+
onApply?.({ ...draft });
|
|
435
|
+
close(false);
|
|
436
|
+
}
|
|
437
|
+
function handleCancel() {
|
|
438
|
+
onCancel?.();
|
|
439
|
+
close(false);
|
|
440
|
+
}
|
|
441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Popover.Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
442
|
+
trigger !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Trigger, { asChild: true, children: trigger ?? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Button.Button, { type: "button", variant: "outline", size: "sm", children: [
|
|
443
|
+
"+ Add filter",
|
|
444
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { size: "sm", variant: "primary", style: { marginLeft: "var(--dsx-space-xs)" }, children: count }) : null
|
|
445
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Anchor, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "dsx-filter-bar__builder-anchor" }) }),
|
|
446
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Popover.Popover.Content, { className: (0, import_classnames.default)("dsx-filter-bar__builder", className), align: "start", children: [
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Popover.Popover.Title, { children: title }),
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-filter-bar__builder-field", children: [
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__builder-label", id: fieldLabelId, children: "Field" }),
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Select.SelectRoot, { value: draft.field, onValueChange: handleFieldChange, children: [
|
|
451
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-labelledby": fieldLabelId, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose field" }) }),
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectContent, { children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectItem, { value: field.value, children: field.label ?? field.value }, field.value)) })
|
|
453
|
+
] })
|
|
454
|
+
] }),
|
|
455
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
456
|
+
FilterBarDraftFields,
|
|
457
|
+
{
|
|
458
|
+
draft,
|
|
459
|
+
fields,
|
|
460
|
+
fieldClassName: "dsx-filter-bar__builder-field",
|
|
461
|
+
labelClassName: "dsx-filter-bar__builder-label",
|
|
462
|
+
onPatch: (patch) => {
|
|
463
|
+
setDraft((prev) => ({ ...prev, ...patch }));
|
|
464
|
+
},
|
|
465
|
+
operators: operatorsProp,
|
|
466
|
+
operatorLabelId,
|
|
467
|
+
valueInputId,
|
|
468
|
+
valueLabelId
|
|
469
|
+
}
|
|
470
|
+
),
|
|
471
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-filter-bar__builder-actions", children: [
|
|
472
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "ghost", size: "sm", onClick: handleCancel, children: cancelLabel }),
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "primary", size: "sm", onClick: handleApply, disabled: !canApply, children: submitLabel })
|
|
474
|
+
] })
|
|
475
|
+
] })
|
|
476
|
+
] });
|
|
477
|
+
}
|
|
478
|
+
FilterBarBuilder.displayName = "FilterBarBuilder";
|
|
479
|
+
function FilterBarConditionEditor({
|
|
480
|
+
className,
|
|
481
|
+
draft,
|
|
482
|
+
fields,
|
|
483
|
+
newLabel = "New",
|
|
484
|
+
onApply,
|
|
485
|
+
onDraftChange,
|
|
486
|
+
onNew,
|
|
487
|
+
operators: operatorsProp,
|
|
488
|
+
submitLabel = "Apply",
|
|
489
|
+
title = "Condition editor"
|
|
490
|
+
}) {
|
|
491
|
+
const operatorLabelId = React.useId();
|
|
492
|
+
const valueInputId = React.useId();
|
|
493
|
+
const valueLabelId = React.useId();
|
|
494
|
+
const canApply = draft.field !== "" && draft.operator !== "";
|
|
495
|
+
function handleRailField(nextField) {
|
|
496
|
+
const nextFieldDef = fields.find((field) => field.value === nextField);
|
|
497
|
+
const nextOperators = nextFieldDef?.operators ?? operatorsProp ?? [...FILTER_BAR_BUILDER_DEFAULT_OPERATORS];
|
|
498
|
+
const nextValue = nextFieldDef?.type === "range" ? `${nextFieldDef.min ?? 0}..${nextFieldDef.max ?? 100}` : "";
|
|
499
|
+
onDraftChange({ field: nextField, operator: nextOperators[0] ?? "", value: nextValue });
|
|
500
|
+
}
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
502
|
+
"div",
|
|
503
|
+
{
|
|
504
|
+
className: (0, import_classnames.default)("dsx-filter-bar__condition-editor", className),
|
|
505
|
+
role: "group",
|
|
506
|
+
"aria-label": typeof title === "string" ? title : "Condition editor",
|
|
507
|
+
children: [
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-editor-title", children: title }),
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-filter-bar__condition-editor-body", children: [
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-editor-fields", role: "group", "aria-label": "Fields", children: fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
511
|
+
import_Button.Button,
|
|
512
|
+
{
|
|
513
|
+
type: "button",
|
|
514
|
+
variant: draft.field === field.value ? "primary" : "outline",
|
|
515
|
+
size: "sm",
|
|
516
|
+
"aria-pressed": draft.field === field.value,
|
|
517
|
+
onClick: () => {
|
|
518
|
+
handleRailField(field.value);
|
|
519
|
+
},
|
|
520
|
+
children: field.label ?? field.value
|
|
521
|
+
},
|
|
522
|
+
field.value
|
|
523
|
+
)) }),
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-editor-config", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
525
|
+
FilterBarDraftFields,
|
|
526
|
+
{
|
|
527
|
+
draft,
|
|
528
|
+
fields,
|
|
529
|
+
fieldClassName: "dsx-filter-bar__condition-editor-field",
|
|
530
|
+
labelClassName: "dsx-filter-bar__condition-editor-label",
|
|
531
|
+
onPatch: (patch) => {
|
|
532
|
+
onDraftChange({ ...draft, ...patch });
|
|
533
|
+
},
|
|
534
|
+
operators: operatorsProp,
|
|
535
|
+
operatorLabelId,
|
|
536
|
+
valueInputId,
|
|
537
|
+
valueLabelId
|
|
538
|
+
}
|
|
539
|
+
) })
|
|
540
|
+
] }),
|
|
541
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-filter-bar__condition-editor-actions", children: [
|
|
542
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "primary", size: "sm", onClick: onApply, disabled: !canApply, children: submitLabel }),
|
|
543
|
+
onNew !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "outline", size: "sm", onClick: onNew, children: newLabel }) : null
|
|
544
|
+
] })
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
FilterBarConditionEditor.displayName = "FilterBarConditionEditor";
|
|
550
|
+
const FILTER_BAR_COMBINATORS = ["and", "or"];
|
|
551
|
+
const FilterBarConditionGroup = React.forwardRef(
|
|
552
|
+
({
|
|
553
|
+
addConditionLabel = "Add condition",
|
|
554
|
+
addSubgroupLabel = "Add subgroup",
|
|
555
|
+
allLabel = null,
|
|
556
|
+
anyLabel = null,
|
|
557
|
+
children,
|
|
558
|
+
className,
|
|
559
|
+
clearAllLabel = "Clear all",
|
|
560
|
+
combinator = "and",
|
|
561
|
+
combinatorLabel = "Match",
|
|
562
|
+
editor = null,
|
|
563
|
+
emptyHint = "No conditions yet \u2014 add one below.",
|
|
564
|
+
rowsLabel = null,
|
|
565
|
+
gapCombinators,
|
|
566
|
+
onGapCombinatorChange,
|
|
567
|
+
onAddCondition,
|
|
568
|
+
onAddSubgroup,
|
|
569
|
+
onClearAll,
|
|
570
|
+
onCombinatorChange,
|
|
571
|
+
...props
|
|
572
|
+
}, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
573
|
+
"div",
|
|
574
|
+
{
|
|
575
|
+
...props,
|
|
576
|
+
ref: forwardedRef,
|
|
577
|
+
role: props["aria-label"] !== void 0 ? "group" : void 0,
|
|
578
|
+
className: (0, import_classnames.default)("dsx-filter-bar__condition-group", className),
|
|
579
|
+
"data-empty": React.Children.count(children) === 0 ? "true" : void 0,
|
|
580
|
+
children: [
|
|
581
|
+
onCombinatorChange !== void 0 && gapCombinators === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
582
|
+
allLabel !== null || anyLabel !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-match-label", children: combinator === "and" ? allLabel ?? "Match all" : anyLabel ?? "Match any" }) : null,
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-combinator", role: "group", "aria-label": combinatorLabel, children: FILTER_BAR_COMBINATORS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
584
|
+
import_Button.Button,
|
|
585
|
+
{
|
|
586
|
+
type: "button",
|
|
587
|
+
size: "sm",
|
|
588
|
+
variant: combinator === option ? "primary" : "ghost",
|
|
589
|
+
"aria-pressed": combinator === option,
|
|
590
|
+
onClick: () => {
|
|
591
|
+
onCombinatorChange(option);
|
|
592
|
+
},
|
|
593
|
+
children: option === "and" ? "AND" : "OR"
|
|
594
|
+
},
|
|
595
|
+
option
|
|
596
|
+
)) })
|
|
597
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
598
|
+
allLabel !== null || anyLabel !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-match-label", children: combinator === "and" ? allLabel ?? "Match all" : anyLabel ?? "Match any" }) : null,
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-combinator-label", children: combinator === "and" ? "AND" : "OR" })
|
|
600
|
+
] }),
|
|
601
|
+
editor,
|
|
602
|
+
rowsLabel !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-rows-label", children: rowsLabel }) : null,
|
|
603
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-children", children: React.Children.count(children) === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__condition-empty", children: emptyHint }) : gapCombinators !== void 0 && onGapCombinatorChange !== void 0 ? React.Children.toArray(children).map((child, index) => {
|
|
604
|
+
const key = React.isValidElement(child) && child.key !== null ? child.key : index;
|
|
605
|
+
const gap = gapCombinators[index] ?? "and";
|
|
606
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(React.Fragment, { children: [
|
|
607
|
+
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-gap", role: "group", "aria-label": `Logic before item ${index + 1}`, children: FILTER_BAR_COMBINATORS.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
608
|
+
import_Button.Button,
|
|
609
|
+
{
|
|
610
|
+
type: "button",
|
|
611
|
+
size: "sm",
|
|
612
|
+
variant: gap === option ? "primary" : "ghost",
|
|
613
|
+
"aria-pressed": gap === option,
|
|
614
|
+
onClick: () => {
|
|
615
|
+
onGapCombinatorChange(index, option);
|
|
616
|
+
},
|
|
617
|
+
children: option === "and" ? "And" : "Or"
|
|
618
|
+
},
|
|
619
|
+
option
|
|
620
|
+
)) }) : null,
|
|
621
|
+
child
|
|
622
|
+
] }, key);
|
|
623
|
+
}) : children }),
|
|
624
|
+
onAddCondition !== void 0 || onAddSubgroup !== void 0 || onClearAll !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsx-filter-bar__condition-actions", children: [
|
|
625
|
+
onAddCondition !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "outline", size: "sm", onClick: onAddCondition, children: addConditionLabel }) : null,
|
|
626
|
+
onAddSubgroup !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "outline", size: "sm", onClick: onAddSubgroup, children: addSubgroupLabel }) : null,
|
|
627
|
+
onClearAll !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Button.Button, { type: "button", variant: "ghost", size: "sm", onClick: onClearAll, children: clearAllLabel }) : null
|
|
628
|
+
] }) : null
|
|
629
|
+
]
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
);
|
|
633
|
+
FilterBarConditionGroup.displayName = "FilterBarConditionGroup";
|
|
634
|
+
function FilterBarEditableRow({
|
|
635
|
+
field,
|
|
636
|
+
fields,
|
|
637
|
+
onFieldChange,
|
|
638
|
+
onOperatorChange,
|
|
639
|
+
onValueChange,
|
|
640
|
+
operator,
|
|
641
|
+
operators,
|
|
642
|
+
value
|
|
643
|
+
}) {
|
|
644
|
+
const operatorLabelId = React.useId();
|
|
645
|
+
const valueInputId = React.useId();
|
|
646
|
+
const valueLabelId = React.useId();
|
|
647
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
648
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dsx-filter-bar__condition-field", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Select.SelectRoot, { value: field, onValueChange: (nextField) => {
|
|
649
|
+
onFieldChange?.(nextField);
|
|
650
|
+
}, children: [
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectTrigger, { "aria-label": "Field", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectValue, { placeholder: "Choose field" }) }),
|
|
652
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectContent, { children: fields.map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Select.SelectItem, { value: option.value, children: option.label ?? option.value }, option.value)) })
|
|
653
|
+
] }) }),
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
655
|
+
FilterBarDraftFields,
|
|
656
|
+
{
|
|
657
|
+
compact: true,
|
|
658
|
+
draft: { field, operator, value },
|
|
659
|
+
fields,
|
|
660
|
+
fieldClassName: "dsx-filter-bar__condition-operator",
|
|
661
|
+
valueClassName: "dsx-filter-bar__condition-value",
|
|
662
|
+
labelClassName: "dsx-filter-bar__condition-operator",
|
|
663
|
+
onPatch: (patch) => {
|
|
664
|
+
if (patch.operator !== void 0) onOperatorChange?.(patch.operator);
|
|
665
|
+
if (patch.value !== void 0) onValueChange?.(patch.value);
|
|
666
|
+
},
|
|
667
|
+
operators,
|
|
668
|
+
operatorLabelId,
|
|
669
|
+
valueInputId,
|
|
670
|
+
valueLabelId
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
] });
|
|
674
|
+
}
|
|
675
|
+
const FilterBarCondition = React.forwardRef(
|
|
676
|
+
({
|
|
677
|
+
children,
|
|
678
|
+
className,
|
|
679
|
+
count,
|
|
680
|
+
dragProps,
|
|
681
|
+
editLabel,
|
|
682
|
+
field,
|
|
683
|
+
fields,
|
|
684
|
+
onEdit,
|
|
685
|
+
onFieldChange,
|
|
686
|
+
onOperatorChange,
|
|
687
|
+
onRemove,
|
|
688
|
+
onValueChange,
|
|
689
|
+
operator,
|
|
690
|
+
operators,
|
|
691
|
+
removeLabel = "Remove condition",
|
|
692
|
+
value,
|
|
693
|
+
...props
|
|
694
|
+
}, forwardedRef) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ...props, ...dragProps, ref: forwardedRef, className: (0, import_classnames.default)("dsx-filter-bar__condition", className), children: [
|
|
695
|
+
dragProps !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { "aria-hidden": "true", className: "dsx-filter-bar__condition-grip", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "grip-vertical", size: "sm" }) }) : null,
|
|
696
|
+
fields !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
697
|
+
FilterBarEditableRow,
|
|
698
|
+
{
|
|
699
|
+
fields,
|
|
700
|
+
field: String(field),
|
|
701
|
+
operator: String(operator),
|
|
702
|
+
value: typeof value === "string" ? value : "",
|
|
703
|
+
operators,
|
|
704
|
+
onFieldChange,
|
|
705
|
+
onOperatorChange,
|
|
706
|
+
onValueChange
|
|
707
|
+
}
|
|
708
|
+
) : null,
|
|
709
|
+
fields === void 0 && onEdit !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
710
|
+
"button",
|
|
711
|
+
{
|
|
712
|
+
type: "button",
|
|
713
|
+
className: "dsx-filter-bar__condition-label",
|
|
714
|
+
onClick: onEdit,
|
|
715
|
+
"aria-label": editLabel ?? describeRuleEditLabel(field, operator, value),
|
|
716
|
+
children: [
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-field", children: field }),
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-operator", children: operator }),
|
|
719
|
+
value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", "data-empty": "true", children: "empty" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", children: value }),
|
|
720
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-count", children: count }) : null
|
|
721
|
+
]
|
|
722
|
+
}
|
|
723
|
+
) : fields === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "dsx-filter-bar__condition-label", "aria-hidden": false, children: [
|
|
724
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-field", children: field }),
|
|
725
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-operator", children: operator }),
|
|
726
|
+
value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", "data-empty": "true", children: "empty" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-value", children: value }),
|
|
727
|
+
count !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dsx-filter-bar__rule-count", children: count }) : null
|
|
728
|
+
] }) : null,
|
|
729
|
+
onRemove !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_IconButton.IconButton, { type: "button", size: "sm", variant: "ghost", "aria-label": removeLabel, onClick: onRemove, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { name: "trash", size: "sm" }) }) : null,
|
|
730
|
+
children
|
|
731
|
+
] })
|
|
732
|
+
);
|
|
733
|
+
FilterBarCondition.displayName = "FilterBarCondition";
|
|
112
734
|
const FilterBar = Object.assign(FilterBarRoot, {
|
|
113
735
|
Group: FilterBarGroup,
|
|
114
736
|
Summary: FilterBarSummary,
|
|
115
737
|
Actions: FilterBarActions,
|
|
116
738
|
Clear: FilterBarClear,
|
|
117
739
|
Control: FilterBarControl,
|
|
118
|
-
Count: FilterBarCount
|
|
740
|
+
Count: FilterBarCount,
|
|
741
|
+
Search: FilterBarSearch,
|
|
742
|
+
Rules: FilterBarRules,
|
|
743
|
+
Rule: FilterBarRule,
|
|
744
|
+
ConditionGroup: FilterBarConditionGroup,
|
|
745
|
+
Condition: FilterBarCondition,
|
|
746
|
+
ConditionEditor: FilterBarConditionEditor,
|
|
747
|
+
Builder: FilterBarBuilder
|
|
119
748
|
});
|
|
120
749
|
//# sourceMappingURL=FilterBar.cjs.map
|