@tulip-systems/core 0.6.1 → 0.7.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/LICENSE +662 -0
- package/dist/components/client.d.mts +19 -3
- package/dist/components/client.mjs +18 -2
- package/dist/components/editor/components/menu-nodes.client.mjs +1 -1
- package/dist/components/editor/components/menu-nodes.client.mjs.map +1 -1
- package/dist/components/editor/components/menu.client.mjs +3 -3
- package/dist/components/editor/components/menu.client.mjs.map +1 -1
- package/dist/components/emails/forget-password-email.mjs +6 -6
- package/dist/components/emails/forget-password-email.mjs.map +1 -1
- package/dist/components/header/back-button.client.mjs +2 -2
- package/dist/components/header/back-button.client.mjs.map +1 -1
- package/dist/components/header/bottom-bar.client.mjs +2 -2
- package/dist/components/header/bottom-bar.client.mjs.map +1 -1
- package/dist/components/header/breadcrumbs.client.mjs +1 -1
- package/dist/components/header/breadcrumbs.client.mjs.map +1 -1
- package/dist/components/header/header.client.mjs +1 -1
- package/dist/components/header/header.client.mjs.map +1 -1
- package/dist/components/layouts/empty-page.mjs +2 -2
- package/dist/components/layouts/empty-page.mjs.map +1 -1
- package/dist/components/layouts/error-page.mjs +3 -3
- package/dist/components/layouts/error-page.mjs.map +1 -1
- package/dist/components/layouts/providers.client.d.mts.map +1 -1
- package/dist/components/layouts/providers.client.mjs +3 -2
- package/dist/components/layouts/providers.client.mjs.map +1 -1
- package/dist/components/layouts/root-loading.mjs +2 -2
- package/dist/components/layouts/root-loading.mjs.map +1 -1
- package/dist/components/layouts/tab-layout.mjs +1 -1
- package/dist/components/layouts/tab-layout.mjs.map +1 -1
- package/dist/components/lists/data-list.mjs +1 -1
- package/dist/components/lists/data-list.mjs.map +1 -1
- package/dist/components/lists/data-stack.mjs +1 -1
- package/dist/components/lists/data-stack.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -3
- package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
- package/dist/components/navigation/admin-sidebar-skeleton.mjs.map +1 -1
- package/dist/components/ui/accordion.client.d.mts +26 -0
- package/dist/components/ui/accordion.client.d.mts.map +1 -0
- package/dist/components/ui/accordion.client.mjs +58 -0
- package/dist/components/ui/accordion.client.mjs.map +1 -0
- package/dist/components/ui/alert-dialog.client.d.mts +61 -0
- package/dist/components/ui/alert-dialog.client.d.mts.map +1 -0
- package/dist/components/ui/alert-dialog.client.mjs +104 -0
- package/dist/components/ui/alert-dialog.client.mjs.map +1 -0
- package/dist/components/ui/alert.d.mts +5 -1
- package/dist/components/ui/alert.d.mts.map +1 -1
- package/dist/components/ui/alert.mjs +13 -6
- package/dist/components/ui/alert.mjs.map +1 -1
- package/dist/components/ui/aspect-ratio.client.d.mts +10 -0
- package/dist/components/ui/aspect-ratio.client.d.mts.map +1 -0
- package/dist/components/ui/aspect-ratio.client.mjs +16 -0
- package/dist/components/ui/aspect-ratio.client.mjs.map +1 -0
- package/dist/components/ui/avatar.client.d.mts +21 -6
- package/dist/components/ui/avatar.client.d.mts.map +1 -1
- package/dist/components/ui/avatar.client.mjs +31 -9
- package/dist/components/ui/avatar.client.mjs.map +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/badge.d.mts.map +1 -1
- package/dist/components/ui/badge.mjs +11 -8
- package/dist/components/ui/badge.mjs.map +1 -1
- package/dist/components/ui/breadcrumb.d.mts +3 -1
- package/dist/components/ui/breadcrumb.d.mts.map +1 -1
- package/dist/components/ui/breadcrumb.mjs +7 -7
- package/dist/components/ui/breadcrumb.mjs.map +1 -1
- package/dist/components/ui/button-group.d.mts +29 -0
- package/dist/components/ui/button-group.d.mts.map +1 -0
- package/dist/components/ui/button-group.mjs +41 -0
- package/dist/components/ui/button-group.mjs.map +1 -0
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/button.d.mts.map +1 -1
- package/dist/components/ui/button.mjs +19 -13
- package/dist/components/ui/button.mjs.map +1 -1
- package/dist/components/ui/{calendar.d.mts → calendar.client.d.mts} +7 -4
- package/dist/components/ui/calendar.client.d.mts.map +1 -0
- package/dist/components/ui/{calendar.mjs → calendar.client.mjs} +22 -19
- package/dist/components/ui/calendar.client.mjs.map +1 -0
- package/dist/components/ui/card.d.mts +9 -2
- package/dist/components/ui/card.d.mts.map +1 -1
- package/dist/components/ui/card.mjs +15 -7
- package/dist/components/ui/card.mjs.map +1 -1
- package/dist/components/ui/{carousel.d.mts → carousel.client.d.mts} +12 -3
- package/dist/components/ui/carousel.client.d.mts.map +1 -0
- package/dist/components/ui/{carousel.mjs → carousel.client.mjs} +10 -10
- package/dist/components/ui/carousel.client.mjs.map +1 -0
- package/dist/components/ui/chart.client.d.mts.map +1 -1
- package/dist/components/ui/chart.client.mjs +11 -11
- package/dist/components/ui/chart.client.mjs.map +1 -1
- package/dist/components/ui/checkbox.client.d.mts +12 -0
- package/dist/components/ui/checkbox.client.d.mts.map +1 -0
- package/dist/components/ui/checkbox.client.mjs +24 -0
- package/dist/components/ui/checkbox.client.mjs.map +1 -0
- package/dist/components/ui/collapsible.client.d.mts +6 -6
- package/dist/components/ui/collapsible.client.d.mts.map +1 -1
- package/dist/components/ui/collapsible.client.mjs +6 -6
- package/dist/components/ui/collapsible.client.mjs.map +1 -1
- package/dist/components/ui/combobox-dropdown.client.d.mts +1 -1
- package/dist/components/ui/combobox-dropdown.client.mjs +2 -2
- package/dist/components/ui/combobox-dropdown.client.mjs.map +1 -1
- package/dist/components/ui/combobox.client.mjs +4 -4
- package/dist/components/ui/combobox.client.mjs.map +1 -1
- package/dist/components/ui/{command.d.mts → command.client.d.mts} +8 -2
- package/dist/components/ui/command.client.d.mts.map +1 -0
- package/dist/components/ui/command.client.mjs +91 -0
- package/dist/components/ui/command.client.mjs.map +1 -0
- package/dist/components/ui/context-menu.client.d.mts +86 -0
- package/dist/components/ui/context-menu.client.d.mts.map +1 -0
- package/dist/components/ui/context-menu.client.mjs +128 -0
- package/dist/components/ui/context-menu.client.mjs.map +1 -0
- package/dist/components/ui/date-picker.client.mjs +2 -2
- package/dist/components/ui/date-picker.client.mjs.map +1 -1
- package/dist/components/ui/dialog.client.d.mts +19 -12
- package/dist/components/ui/dialog.client.d.mts.map +1 -1
- package/dist/components/ui/dialog.client.mjs +40 -29
- package/dist/components/ui/dialog.client.mjs.map +1 -1
- package/dist/components/ui/drawer.client.d.mts.map +1 -1
- package/dist/components/ui/drawer.client.mjs +5 -5
- package/dist/components/ui/drawer.client.mjs.map +1 -1
- package/dist/components/ui/dropdown-menu.client.d.mts +85 -0
- package/dist/components/ui/dropdown-menu.client.d.mts.map +1 -0
- package/dist/components/ui/dropdown-menu.client.mjs +131 -0
- package/dist/components/ui/dropdown-menu.client.mjs.map +1 -0
- package/dist/components/ui/empty.d.mts +36 -0
- package/dist/components/ui/empty.d.mts.map +1 -0
- package/dist/components/ui/empty.mjs +62 -0
- package/dist/components/ui/empty.mjs.map +1 -0
- package/dist/components/ui/field.client.d.mts +65 -0
- package/dist/components/ui/field.client.d.mts.map +1 -0
- package/dist/components/ui/field.client.mjs +114 -0
- package/dist/components/ui/field.client.mjs.map +1 -0
- package/dist/components/ui/form.client.d.mts +3 -4
- package/dist/components/ui/form.client.d.mts.map +1 -1
- package/dist/components/ui/form.client.mjs +4 -4
- package/dist/components/ui/form.client.mjs.map +1 -1
- package/dist/components/ui/hover-card.client.d.mts +6 -6
- package/dist/components/ui/hover-card.client.d.mts.map +1 -1
- package/dist/components/ui/hover-card.client.mjs +14 -11
- package/dist/components/ui/hover-card.client.mjs.map +1 -1
- package/dist/components/ui/{input-date-time.d.mts → input-date-time.client.d.mts} +3 -3
- package/dist/components/ui/input-date-time.client.d.mts.map +1 -0
- package/dist/components/ui/{input-date-time.mjs → input-date-time.client.mjs} +4 -2
- package/dist/components/ui/input-date-time.client.mjs.map +1 -0
- package/dist/components/ui/input-date.d.mts +1 -1
- package/dist/components/ui/input-date.d.mts.map +1 -1
- package/dist/components/ui/input-date.mjs.map +1 -1
- package/dist/components/ui/input-group.client.d.mts +59 -0
- package/dist/components/ui/input-group.client.d.mts.map +1 -0
- package/dist/components/ui/input-group.client.mjs +106 -0
- package/dist/components/ui/input-group.client.mjs.map +1 -0
- package/dist/components/ui/input-recipient.mjs +11 -11
- package/dist/components/ui/input-recipient.mjs.map +1 -1
- package/dist/components/ui/input-time.d.mts +1 -1
- package/dist/components/ui/input-time.d.mts.map +1 -1
- package/dist/components/ui/input-time.mjs.map +1 -1
- package/dist/components/ui/input.d.mts.map +1 -1
- package/dist/components/ui/input.mjs +1 -1
- package/dist/components/ui/input.mjs.map +1 -1
- package/dist/components/ui/item.d.mts +63 -0
- package/dist/components/ui/item.d.mts.map +1 -0
- package/dist/components/ui/item.mjs +119 -0
- package/dist/components/ui/item.mjs.map +1 -0
- package/dist/components/ui/kbd.d.mts +14 -0
- package/dist/components/ui/kbd.d.mts.map +1 -0
- package/dist/components/ui/kbd.mjs +22 -0
- package/dist/components/ui/kbd.mjs.map +1 -0
- package/dist/components/ui/label.d.mts +4 -4
- package/dist/components/ui/label.d.mts.map +1 -1
- package/dist/components/ui/label.mjs +5 -5
- package/dist/components/ui/label.mjs.map +1 -1
- package/dist/components/ui/loader.d.mts +7 -0
- package/dist/components/ui/loader.d.mts.map +1 -0
- package/dist/components/ui/loader.mjs +63 -0
- package/dist/components/ui/loader.mjs.map +1 -0
- package/dist/components/ui/navigation-menu.d.mts +11 -11
- package/dist/components/ui/navigation-menu.d.mts.map +1 -1
- package/dist/components/ui/navigation-menu.mjs +18 -20
- package/dist/components/ui/navigation-menu.mjs.map +1 -1
- package/dist/components/ui/pagination.d.mts +8 -2
- package/dist/components/ui/pagination.d.mts.map +1 -1
- package/dist/components/ui/pagination.mjs +29 -21
- package/dist/components/ui/pagination.mjs.map +1 -1
- package/dist/components/ui/popover.client.d.mts +35 -0
- package/dist/components/ui/popover.client.d.mts.map +1 -0
- package/dist/components/ui/popover.client.mjs +59 -0
- package/dist/components/ui/popover.client.mjs.map +1 -0
- package/dist/components/ui/progress.client.d.mts +4 -4
- package/dist/components/ui/progress.client.d.mts.map +1 -1
- package/dist/components/ui/progress.client.mjs +7 -7
- package/dist/components/ui/progress.client.mjs.map +1 -1
- package/dist/components/ui/radio-group.d.mts +5 -5
- package/dist/components/ui/radio-group.d.mts.map +1 -1
- package/dist/components/ui/radio-group.mjs +10 -11
- package/dist/components/ui/radio-group.mjs.map +1 -1
- package/dist/components/ui/resizable.client.d.mts +3 -4
- package/dist/components/ui/resizable.client.d.mts.map +1 -1
- package/dist/components/ui/resizable.client.mjs +5 -9
- package/dist/components/ui/resizable.client.mjs.map +1 -1
- package/dist/components/ui/scroll-area.d.mts +5 -5
- package/dist/components/ui/scroll-area.d.mts.map +1 -1
- package/dist/components/ui/scroll-area.mjs +12 -11
- package/dist/components/ui/scroll-area.mjs.map +1 -1
- package/dist/components/ui/select.client.d.mts +18 -13
- package/dist/components/ui/select.client.d.mts.map +1 -1
- package/dist/components/ui/select.client.mjs +37 -32
- package/dist/components/ui/select.client.mjs.map +1 -1
- package/dist/components/ui/separator.d.mts +4 -4
- package/dist/components/ui/separator.d.mts.map +1 -1
- package/dist/components/ui/separator.mjs +6 -6
- package/dist/components/ui/separator.mjs.map +1 -1
- package/dist/components/ui/sheet.client.d.mts +9 -7
- package/dist/components/ui/sheet.client.d.mts.map +1 -1
- package/dist/components/ui/sheet.client.mjs +30 -20
- package/dist/components/ui/sheet.client.mjs.map +1 -1
- package/dist/components/ui/sidebar.client.mjs +28 -28
- package/dist/components/ui/sidebar.client.mjs.map +1 -1
- package/dist/components/ui/skeleton.mjs +1 -1
- package/dist/components/ui/skeleton.mjs.map +1 -1
- package/dist/components/ui/slider.d.mts +4 -4
- package/dist/components/ui/slider.d.mts.map +1 -1
- package/dist/components/ui/slider.mjs +11 -11
- package/dist/components/ui/slider.mjs.map +1 -1
- package/dist/components/ui/spinner.d.mts +10 -0
- package/dist/components/ui/spinner.d.mts.map +1 -0
- package/dist/components/ui/spinner.mjs +9 -55
- package/dist/components/ui/spinner.mjs.map +1 -1
- package/dist/components/ui/switch.client.d.mts +15 -0
- package/dist/components/ui/switch.client.d.mts.map +1 -0
- package/dist/components/ui/switch.client.mjs +23 -0
- package/dist/components/ui/switch.client.mjs.map +1 -0
- package/dist/components/ui/tabs.client.d.mts +31 -0
- package/dist/components/ui/tabs.client.d.mts.map +1 -0
- package/dist/components/ui/tabs.client.mjs +49 -0
- package/dist/components/ui/tabs.client.mjs.map +1 -0
- package/dist/components/ui/textarea.d.mts.map +1 -1
- package/dist/components/ui/textarea.mjs +1 -1
- package/dist/components/ui/textarea.mjs.map +1 -1
- package/dist/components/ui/toggle-group.client.d.mts +11 -6
- package/dist/components/ui/toggle-group.client.d.mts.map +1 -1
- package/dist/components/ui/toggle-group.client.mjs +20 -12
- package/dist/components/ui/toggle-group.client.mjs.map +1 -1
- package/dist/components/ui/{toggle.d.mts → toggle.client.d.mts} +6 -6
- package/dist/components/ui/toggle.client.d.mts.map +1 -0
- package/dist/components/ui/toggle.client.mjs +40 -0
- package/dist/components/ui/toggle.client.mjs.map +1 -0
- package/dist/components/ui/tooltip.client.d.mts +7 -7
- package/dist/components/ui/tooltip.client.d.mts.map +1 -1
- package/dist/components/ui/tooltip.client.mjs +10 -10
- package/dist/components/ui/tooltip.client.mjs.map +1 -1
- package/dist/components.d.mts +12 -20
- package/dist/components.mjs +12 -20
- package/dist/inline-edit/client.d.mts +2 -2
- package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
- package/dist/lib/hooks/use-indicator.mjs.map +1 -1
- package/dist/modules/auth/components/auth-layout.server.mjs +2 -2
- package/dist/modules/auth/components/auth-layout.server.mjs.map +1 -1
- package/dist/modules/auth/components/create-first-user-page.client.mjs +3 -3
- package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs +1 -1
- package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/login-page.client.mjs +5 -5
- package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
- package/dist/modules/auth/components/reset-password-page.client.mjs +5 -5
- package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts +9 -9
- package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/alert-dialog-command.client.mjs +3 -3
- package/dist/modules/commands/components/alert-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/click-command.client.mjs +2 -2
- package/dist/modules/commands/components/click-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
- package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/dialog-command.client.mjs +2 -2
- package/dist/modules/commands/components/dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/dropdown-command.client.mjs +2 -2
- package/dist/modules/commands/components/dropdown-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/empty-command.client.mjs +2 -2
- package/dist/modules/commands/components/empty-command.client.mjs.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -9
- package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
- package/dist/modules/commands/components/form-dialog-command.client.mjs +8 -6
- package/dist/modules/commands/components/form-dialog-command.client.mjs.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.d.mts +3 -3
- package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs +1 -1
- package/dist/modules/commands/menus/context-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/dropdown-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/dropdown-menu.client.mjs.map +1 -1
- package/dist/modules/commands/menus/floating-menu.client.mjs +2 -2
- package/dist/modules/commands/menus/floating-menu.client.mjs.map +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs +1 -1
- package/dist/modules/commands/utils/archive-command.client.mjs.map +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs +1 -1
- package/dist/modules/commands/utils/delete-command.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs +1 -1
- package/dist/modules/data-tables/components/cell/select.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/column-header.mjs +5 -5
- package/dist/modules/data-tables/components/column-header.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/combobox.client.mjs +6 -6
- package/dist/modules/data-tables/components/filters/combobox.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/filters/slider.client.mjs +2 -2
- package/dist/modules/data-tables/components/filters/slider.client.mjs.map +1 -1
- package/dist/modules/data-tables/components/header.mjs +1 -1
- package/dist/modules/data-tables/components/header.mjs.map +1 -1
- package/dist/modules/data-tables/components/skeleton.mjs +2 -2
- package/dist/modules/data-tables/components/skeleton.mjs.map +1 -1
- package/dist/modules/data-tables/components/table.mjs +3 -3
- package/dist/modules/data-tables/components/table.mjs.map +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs +1 -1
- package/dist/modules/data-tables/components/toolbar.mjs.map +1 -1
- package/dist/modules/data-tables/strategies/pagination/components.mjs +3 -3
- package/dist/modules/data-tables/strategies/pagination/components.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/common.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs +1 -1
- package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-input.client.mjs +3 -3
- package/dist/modules/inline-edit/components/date-input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-picker.client.mjs +2 -2
- package/dist/modules/inline-edit/components/date-picker.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/date-time.client.d.mts +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs +1 -1
- package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input-toggle.client.mjs +2 -2
- package/dist/modules/inline-edit/components/input-toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/input.client.mjs +3 -3
- package/dist/modules/inline-edit/components/input.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/select.client.d.mts +8 -11
- package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/select.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.d.mts +3 -2
- package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs +1 -1
- package/dist/modules/inline-edit/components/switch.client.mjs.map +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs +1 -1
- package/dist/modules/inline-edit/components/toggle.client.mjs.map +1 -1
- package/dist/modules/inline-edit/lib/variants.d.mts +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs +1 -1
- package/dist/modules/inline-edit/lib/variants.mjs.map +1 -1
- package/dist/modules/storage/components/dropzone.client.mjs +8 -8
- package/dist/modules/storage/components/dropzone.client.mjs.map +1 -1
- package/dist/modules/storage/components/image-grid.client.mjs +5 -5
- package/dist/modules/storage/components/image-grid.client.mjs.map +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs +1 -1
- package/dist/modules/storage/components/upload-zone.client.mjs.map +1 -1
- package/dist/modules/storage/lib/router.server.d.mts +11 -11
- package/dist/modules/storage/lib/service.server.d.mts +9 -9
- package/dist/modules/storage/lib/validators.d.mts +7 -7
- package/package.json +6 -31
- package/src/components/editor/components/menu-nodes.client.tsx +1 -1
- package/src/components/editor/components/menu.client.tsx +3 -3
- package/src/components/emails/forget-password-email.tsx +6 -6
- package/src/components/entry.client.ts +16 -0
- package/src/components/entry.ts +6 -14
- package/src/components/header/back-button.client.tsx +2 -2
- package/src/components/header/bottom-bar.client.tsx +2 -2
- package/src/components/header/breadcrumbs.client.tsx +1 -1
- package/src/components/header/header.client.tsx +1 -1
- package/src/components/layouts/empty-page.tsx +2 -2
- package/src/components/layouts/error-page.tsx +3 -3
- package/src/components/layouts/providers.client.tsx +8 -5
- package/src/components/layouts/root-loading.tsx +2 -2
- package/src/components/layouts/tab-layout.tsx +1 -1
- package/src/components/lists/data-list.tsx +1 -1
- package/src/components/lists/data-stack.tsx +1 -1
- package/src/components/navigation/admin-sidebar-header.client.tsx +3 -3
- package/src/components/navigation/admin-sidebar-skeleton.tsx +1 -1
- package/src/components/ui/accordion.client.tsx +83 -0
- package/src/components/ui/alert-dialog.client.tsx +181 -0
- package/src/components/ui/alert.tsx +15 -7
- package/src/components/ui/aspect-ratio.client.tsx +9 -0
- package/src/components/ui/avatar.client.tsx +61 -6
- package/src/components/ui/badge.tsx +17 -11
- package/src/components/ui/breadcrumb.tsx +9 -10
- package/src/components/ui/button-group.tsx +78 -0
- package/src/components/ui/button.tsx +26 -16
- package/src/components/ui/{calendar.tsx → calendar.client.tsx} +27 -20
- package/src/components/ui/card.tsx +41 -8
- package/src/components/ui/{carousel.tsx → carousel.client.tsx} +12 -12
- package/src/components/ui/chart.client.tsx +105 -103
- package/src/components/ui/checkbox.client.tsx +28 -0
- package/src/components/ui/collapsible.client.tsx +2 -2
- package/src/components/ui/combobox-dropdown.client.tsx +2 -2
- package/src/components/ui/combobox.client.tsx +6 -6
- package/src/components/ui/command.client.tsx +179 -0
- package/src/components/ui/{context-menu.tsx → context-menu.client.tsx} +86 -64
- package/src/components/ui/date-picker.client.tsx +2 -2
- package/src/components/ui/dialog.client.tsx +43 -20
- package/src/components/ui/drawer.client.tsx +13 -15
- package/src/components/ui/{dropdown-menu.tsx → dropdown-menu.client.tsx} +45 -24
- package/src/components/ui/empty.tsx +93 -0
- package/src/components/ui/field.client.tsx +224 -0
- package/src/components/ui/form.client.tsx +4 -4
- package/src/components/ui/hover-card.client.tsx +14 -13
- package/src/components/ui/{input-date-time.tsx → input-date-time.client.tsx} +6 -1
- package/src/components/ui/input-date.tsx +1 -1
- package/src/components/ui/input-group.client.tsx +191 -0
- package/src/components/ui/input-recipient.tsx +12 -12
- package/src/components/ui/input-time.tsx +1 -1
- package/src/components/ui/input.tsx +2 -4
- package/src/components/ui/item.tsx +182 -0
- package/src/components/ui/kbd.tsx +26 -0
- package/src/components/ui/label.tsx +2 -3
- package/src/components/ui/loader.tsx +51 -0
- package/src/components/ui/navigation-menu.tsx +14 -17
- package/src/components/ui/pagination.tsx +31 -26
- package/src/components/ui/popover.client.tsx +73 -0
- package/src/components/ui/progress.client.tsx +6 -4
- package/src/components/ui/radio-group.tsx +5 -7
- package/src/components/ui/resizable.client.tsx +9 -19
- package/src/components/ui/scroll-area.tsx +5 -7
- package/src/components/ui/select.client.tsx +40 -22
- package/src/components/ui/separator.tsx +3 -4
- package/src/components/ui/sheet.client.tsx +19 -18
- package/src/components/ui/sidebar.client.tsx +27 -27
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +5 -10
- package/src/components/ui/spinner.tsx +12 -48
- package/src/components/ui/switch.client.tsx +32 -0
- package/src/components/ui/tabs.client.tsx +79 -0
- package/src/components/ui/textarea.tsx +1 -2
- package/src/components/ui/toggle-group.client.tsx +26 -10
- package/src/components/ui/toggle.client.tsx +44 -0
- package/src/components/ui/tooltip.client.tsx +4 -9
- package/src/lib/hooks/use-indicator.tsx +4 -7
- package/src/modules/auth/components/auth-layout.server.tsx +2 -2
- package/src/modules/auth/components/create-first-user-page.client.tsx +4 -4
- package/src/modules/auth/components/forget-password-page.client.tsx +1 -1
- package/src/modules/auth/components/login-page.client.tsx +6 -6
- package/src/modules/auth/components/reset-password-page.client.tsx +7 -7
- package/src/modules/commands/components/alert-dialog-command.client.tsx +20 -16
- package/src/modules/commands/components/click-command.client.tsx +2 -2
- package/src/modules/commands/components/dialog-command.client.tsx +11 -10
- package/src/modules/commands/components/dropdown-command.client.tsx +2 -2
- package/src/modules/commands/components/empty-command.client.tsx +2 -2
- package/src/modules/commands/components/form-dialog-command.client.tsx +29 -13
- package/src/modules/commands/menus/context-menu.client.tsx +3 -4
- package/src/modules/commands/menus/dropdown-menu.client.tsx +2 -2
- package/src/modules/commands/menus/floating-menu.client.tsx +2 -2
- package/src/modules/commands/utils/archive-command.client.tsx +1 -1
- package/src/modules/commands/utils/delete-command.client.tsx +1 -1
- package/src/modules/data-tables/components/cell/select.client.tsx +1 -1
- package/src/modules/data-tables/components/column-header.tsx +5 -5
- package/src/modules/data-tables/components/filters/combobox.client.tsx +6 -6
- package/src/modules/data-tables/components/filters/slider.client.tsx +2 -2
- package/src/modules/data-tables/components/header.tsx +1 -1
- package/src/modules/data-tables/components/skeleton.tsx +2 -2
- package/src/modules/data-tables/components/table.tsx +3 -3
- package/src/modules/data-tables/components/toolbar.tsx +1 -1
- package/src/modules/data-tables/strategies/pagination/components.tsx +3 -3
- package/src/modules/data-tables/tables/inline-table/components/cells/common.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx +1 -1
- package/src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx +1 -1
- package/src/modules/inline-edit/components/date-input.client.tsx +3 -3
- package/src/modules/inline-edit/components/date-picker.client.tsx +2 -2
- package/src/modules/inline-edit/components/date-time.client.tsx +1 -1
- package/src/modules/inline-edit/components/input-toggle.client.tsx +2 -2
- package/src/modules/inline-edit/components/input.client.tsx +3 -3
- package/src/modules/inline-edit/components/select.client.tsx +6 -20
- package/src/modules/inline-edit/components/switch.client.tsx +3 -3
- package/src/modules/inline-edit/components/toggle.client.tsx +1 -1
- package/src/modules/inline-edit/lib/variants.ts +1 -1
- package/src/modules/storage/components/dropzone.client.tsx +8 -8
- package/src/modules/storage/components/image-grid.client.tsx +5 -5
- package/src/modules/storage/components/upload-zone.client.tsx +1 -1
- package/src/styles.css +1 -3
- package/dist/components/ui/accordion.d.mts +0 -25
- package/dist/components/ui/accordion.d.mts.map +0 -1
- package/dist/components/ui/accordion.mjs +0 -46
- package/dist/components/ui/accordion.mjs.map +0 -1
- package/dist/components/ui/alert-dialog.d.mts +0 -43
- package/dist/components/ui/alert-dialog.d.mts.map +0 -1
- package/dist/components/ui/alert-dialog.mjs +0 -84
- package/dist/components/ui/alert-dialog.mjs.map +0 -1
- package/dist/components/ui/aspect-ratio.d.mts +0 -8
- package/dist/components/ui/aspect-ratio.d.mts.map +0 -1
- package/dist/components/ui/aspect-ratio.mjs +0 -16
- package/dist/components/ui/aspect-ratio.mjs.map +0 -1
- package/dist/components/ui/calendar.d.mts.map +0 -1
- package/dist/components/ui/calendar.mjs.map +0 -1
- package/dist/components/ui/carousel.d.mts.map +0 -1
- package/dist/components/ui/carousel.mjs.map +0 -1
- package/dist/components/ui/checkbox.d.mts +0 -12
- package/dist/components/ui/checkbox.d.mts.map +0 -1
- package/dist/components/ui/checkbox.mjs +0 -24
- package/dist/components/ui/checkbox.mjs.map +0 -1
- package/dist/components/ui/command.d.mts.map +0 -1
- package/dist/components/ui/command.mjs +0 -88
- package/dist/components/ui/command.mjs.map +0 -1
- package/dist/components/ui/context-menu.d.mts +0 -77
- package/dist/components/ui/context-menu.d.mts.map +0 -1
- package/dist/components/ui/context-menu.mjs +0 -125
- package/dist/components/ui/context-menu.mjs.map +0 -1
- package/dist/components/ui/dropdown-menu.d.mts +0 -78
- package/dist/components/ui/dropdown-menu.d.mts.map +0 -1
- package/dist/components/ui/dropdown-menu.mjs +0 -126
- package/dist/components/ui/dropdown-menu.mjs.map +0 -1
- package/dist/components/ui/input-date-time.d.mts.map +0 -1
- package/dist/components/ui/input-date-time.mjs.map +0 -1
- package/dist/components/ui/popover.d.mts +0 -23
- package/dist/components/ui/popover.d.mts.map +0 -1
- package/dist/components/ui/popover.mjs +0 -38
- package/dist/components/ui/popover.mjs.map +0 -1
- package/dist/components/ui/switch.d.mts +0 -12
- package/dist/components/ui/switch.d.mts.map +0 -1
- package/dist/components/ui/switch.mjs +0 -22
- package/dist/components/ui/switch.mjs.map +0 -1
- package/dist/components/ui/tabs.d.mts +0 -24
- package/dist/components/ui/tabs.d.mts.map +0 -1
- package/dist/components/ui/tabs.mjs +0 -39
- package/dist/components/ui/tabs.mjs.map +0 -1
- package/dist/components/ui/toggle.d.mts.map +0 -1
- package/dist/components/ui/toggle.mjs +0 -40
- package/dist/components/ui/toggle.mjs.map +0 -1
- package/src/components/ui/accordion.tsx +0 -63
- package/src/components/ui/alert-dialog.tsx +0 -133
- package/src/components/ui/aspect-ratio.tsx +0 -9
- package/src/components/ui/checkbox.tsx +0 -29
- package/src/components/ui/command.tsx +0 -154
- package/src/components/ui/popover.tsx +0 -42
- package/src/components/ui/switch.tsx +0 -28
- package/src/components/ui/tabs.tsx +0 -54
- package/src/components/ui/toggle.tsx +0 -46
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle } from "../../../components/ui/dialog.client.mjs";
|
|
1
2
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
3
|
import React, { ComponentProps } from "react";
|
|
3
4
|
import { DefaultError, MutationOptions } from "@tanstack/react-query";
|
|
4
|
-
import { DialogContentProps, DialogProps } from "@radix-ui/react-dialog";
|
|
5
5
|
import { FieldValues, Form } from "react-hook-form";
|
|
6
6
|
import { Keys } from "react-hotkeys-hook";
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import { Keys } from "react-hotkeys-hook";
|
|
|
12
12
|
declare function CommandFormDialog({
|
|
13
13
|
children,
|
|
14
14
|
...props
|
|
15
|
-
}:
|
|
15
|
+
}: ComponentProps<typeof Dialog>): react_jsx_runtime0.JSX.Element;
|
|
16
16
|
/**
|
|
17
17
|
* CommandFormDialogTrigger
|
|
18
18
|
*/
|
|
@@ -36,26 +36,26 @@ declare function CommandFormDialogTrigger({
|
|
|
36
36
|
declare function CommandFormDialogHeader({
|
|
37
37
|
children,
|
|
38
38
|
...props
|
|
39
|
-
}:
|
|
39
|
+
}: ComponentProps<typeof DialogHeader>): react_jsx_runtime0.JSX.Element;
|
|
40
40
|
/**
|
|
41
41
|
* CommandFormDialogTitle
|
|
42
42
|
*/
|
|
43
43
|
declare function CommandFormDialogTitle({
|
|
44
44
|
children,
|
|
45
45
|
...props
|
|
46
|
-
}:
|
|
46
|
+
}: ComponentProps<typeof DialogTitle>): react_jsx_runtime0.JSX.Element;
|
|
47
47
|
/**
|
|
48
48
|
* CommandFormDialogDescription
|
|
49
49
|
*/
|
|
50
50
|
declare function CommandFormDialogDescription({
|
|
51
51
|
children,
|
|
52
52
|
...props
|
|
53
|
-
}:
|
|
53
|
+
}: ComponentProps<typeof DialogDescription>): react_jsx_runtime0.JSX.Element;
|
|
54
54
|
declare const CommandFormDialogContentProvider: typeof Form;
|
|
55
55
|
/**
|
|
56
56
|
* CommandFormDialogContent
|
|
57
57
|
*/
|
|
58
|
-
type CommandFormDialogContentProps<TValues extends FieldValues, TData = unknown, TError = DefaultError, TVariables = undefined, TOnMutateResult = unknown> =
|
|
58
|
+
type CommandFormDialogContentProps<TValues extends FieldValues, TData = unknown, TError = DefaultError, TVariables = undefined, TOnMutateResult = unknown> = ComponentProps<typeof DialogContent> & {
|
|
59
59
|
variables: (values: TValues) => TVariables;
|
|
60
60
|
mutation?: MutationOptions<TData, TError, TVariables, TOnMutateResult>;
|
|
61
61
|
children: React.ReactNode;
|
|
@@ -80,21 +80,23 @@ declare function CommandFormDialogFields({
|
|
|
80
80
|
declare function CommandFormDialogFooter({
|
|
81
81
|
children,
|
|
82
82
|
...props
|
|
83
|
-
}:
|
|
83
|
+
}: ComponentProps<typeof DialogFooter>): react_jsx_runtime0.JSX.Element;
|
|
84
84
|
/**
|
|
85
85
|
* CommandFormDialogCancel
|
|
86
86
|
*/
|
|
87
87
|
declare function CommandFormDialogCancel({
|
|
88
88
|
children,
|
|
89
|
+
onClick,
|
|
89
90
|
...props
|
|
90
|
-
}:
|
|
91
|
+
}: Omit<ComponentProps<"button">, "type">): react_jsx_runtime0.JSX.Element;
|
|
91
92
|
/**
|
|
92
93
|
* CommandFormDialogSubmit
|
|
93
94
|
*/
|
|
94
95
|
declare function CommandFormDialogSubmit({
|
|
95
96
|
children,
|
|
97
|
+
disabled,
|
|
96
98
|
...props
|
|
97
|
-
}:
|
|
99
|
+
}: Omit<ComponentProps<"button">, "type">): react_jsx_runtime0.JSX.Element;
|
|
98
100
|
//#endregion
|
|
99
101
|
export { CommandFormDialog, CommandFormDialogCancel, CommandFormDialogContent, CommandFormDialogContentProps, CommandFormDialogContentProvider, CommandFormDialogDescription, CommandFormDialogFields, CommandFormDialogFooter, CommandFormDialogHeader, CommandFormDialogSubmit, CommandFormDialogTitle, CommandFormDialogTrigger };
|
|
100
102
|
//# sourceMappingURL=form-dialog-command.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/form-dialog-command.client.tsx"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"form-dialog-command.client.d.mts","names":[],"sources":["../../../../src/modules/commands/components/form-dialog-command.client.tsx"],"mappings":";;;;;;;;;;;iBAqCgB,iBAAA,CAAA;EAAoB,QAAA;EAAA,GAAa;AAAA,GAAS,cAAA,QAAsB,MAAA,IAAO,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;KAelF,6BAAA;EACH,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,SAAA;EACA,KAAA;EACA,QAAA;EACA,MAAA,GAAS,IAAA;AAAA;AAAA,iBAGK,wBAAA,CAAA;EACd,KAAA;EACA,MAAA;EACA,QAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,6BAAA,GAA6B,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAgEhB,uBAAA,CAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,YAAA,IAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;AAtFrC;iBA6Fe,sBAAA,CAAA;EAAyB,QAAA;EAAA,GAAa;AAAA,GAAS,cAAA,QAAsB,WAAA,IAAY,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAOjF,4BAAA,CAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,iBAAA,IAAkB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAI9B,gCAAA,SAAgC,IAAA;;;;KAKjC,6BAAA,iBACM,WAAA,4BAEP,YAAA,uDAGP,cAAA,QAAsB,aAAA;EACxB,SAAA,GAAY,MAAA,EAAQ,OAAA,KAAY,UAAA;EAChC,QAAA,GAAW,eAAA,CAAgB,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,eAAA;EACtD,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,iBASF,wBAAA,iBACE,WAAA,4BAEP,YAAA,oDAAA,CAAA;EAIT,SAAA;EACA,QAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,6BAAA,CAA8B,OAAA,EAAS,KAAA,EAAO,MAAA,EAAQ,UAAA,EAAY,eAAA,IAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAmCrE,uBAAA,CAAA;EAA0B,QAAA;EAAU,SAAA;EAAA,GAAc;AAAA,GAAS,cAAA,UAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAWhF,uBAAA,CAAA;EACd,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,YAAA,IAAa,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAOtB,uBAAA,CAAA;EACd,QAAA;EACA,OAAA;EAAA,GACG;AAAA,GACF,IAAA,CAAK,cAAA,sBAAiC,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;iBAuBzB,uBAAA,CAAA;EACd,QAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,IAAA,CAAK,cAAA,sBAAiC,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { Icons } from "../../../components/common/icons.mjs";
|
|
4
4
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
5
5
|
import { Button, buttonVariants } from "../../../components/ui/button.mjs";
|
|
6
|
-
import { ContextMenuItem } from "../../../components/ui/context-menu.mjs";
|
|
7
|
-
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.mjs";
|
|
6
|
+
import { ContextMenuItem } from "../../../components/ui/context-menu.client.mjs";
|
|
7
|
+
import { DropdownMenuItem } from "../../../components/ui/dropdown-menu.client.mjs";
|
|
8
8
|
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "../../../components/ui/dialog.client.mjs";
|
|
9
9
|
import { useCommand } from "../hooks/context.client.mjs";
|
|
10
10
|
import { useCommandMutation } from "../hooks/use-command-mutation.client.mjs";
|
|
@@ -154,16 +154,17 @@ function CommandFormDialogFooter({ children, ...props }) {
|
|
|
154
154
|
/**
|
|
155
155
|
* CommandFormDialogCancel
|
|
156
156
|
*/
|
|
157
|
-
function CommandFormDialogCancel({ children, ...props }) {
|
|
157
|
+
function CommandFormDialogCancel({ children, onClick, ...props }) {
|
|
158
158
|
const { setOpen } = React.useContext(CommandFormDialogContext);
|
|
159
159
|
const form = useFormContext();
|
|
160
160
|
return /* @__PURE__ */ jsx(Button, {
|
|
161
161
|
...props,
|
|
162
162
|
variant: "ghost",
|
|
163
163
|
type: "button",
|
|
164
|
-
onClick: () => {
|
|
164
|
+
onClick: (e) => {
|
|
165
165
|
form.reset();
|
|
166
166
|
setOpen(false);
|
|
167
|
+
onClick?.(e);
|
|
167
168
|
},
|
|
168
169
|
children
|
|
169
170
|
});
|
|
@@ -171,12 +172,13 @@ function CommandFormDialogCancel({ children, ...props }) {
|
|
|
171
172
|
/**
|
|
172
173
|
* CommandFormDialogSubmit
|
|
173
174
|
*/
|
|
174
|
-
function CommandFormDialogSubmit({ children, ...props }) {
|
|
175
|
+
function CommandFormDialogSubmit({ children, disabled, ...props }) {
|
|
175
176
|
const { status } = useCommand();
|
|
177
|
+
const isDisabled = disabled || status === "pending";
|
|
176
178
|
return /* @__PURE__ */ jsxs(Button, {
|
|
177
179
|
...props,
|
|
178
|
-
disabled: status === "pending",
|
|
179
180
|
type: "submit",
|
|
181
|
+
disabled: isDisabled,
|
|
180
182
|
children: [status === "pending" && /* @__PURE__ */ jsx(Icons.spinner, { className: "mr-2 h-4 w-4 animate-spin" }), children]
|
|
181
183
|
});
|
|
182
184
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/form-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type {
|
|
1
|
+
{"version":3,"file":"form-dialog-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/components/form-dialog-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport React, { type ComponentProps } from \"react\";\nimport { type FieldValues, Form, useFormContext } from \"react-hook-form\";\nimport { type Keys, useHotkeys } from \"react-hotkeys-hook\";\nimport { Icons } from \"@/components/common/icons\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\nimport { ContextMenuItem } from \"@/components/ui/context-menu.client\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n} from \"@/components/ui/dialog.client\";\nimport { DropdownMenuItem } from \"@/components/ui/dropdown-menu.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useCommandMutation } from \"../entry.client\";\nimport { useCommand } from \"../hooks/context.client\";\nimport { CommandTrigger } from \"./command-trigger.client\";\n\n/**\n * CommandFormDialogContext\n */\ntype CommandFormDialogContextValue = {\n open: boolean;\n setOpen: React.Dispatch<React.SetStateAction<boolean>>;\n};\n\nconst CommandFormDialogContext = React.createContext({} as CommandFormDialogContextValue);\n\n/**\n * CommandFormDialog\n */\nexport function CommandFormDialog({ children, ...props }: ComponentProps<typeof Dialog>) {\n const [open, setOpen] = React.useState(false);\n\n return (\n <Dialog {...props} open={open} onOpenChange={setOpen}>\n <CommandFormDialogContext.Provider value={{ open, setOpen }}>\n {children}\n </CommandFormDialogContext.Provider>\n </Dialog>\n );\n}\n\n/**\n * CommandFormDialogTrigger\n */\ntype CommandFormDialogTriggerProps = {\n children: React.ReactNode;\n className?: string;\n label?: string;\n disabled?: boolean;\n hotkey?: Keys;\n};\n\nexport function CommandFormDialogTrigger({\n label,\n hotkey,\n children,\n disabled,\n ...props\n}: CommandFormDialogTriggerProps) {\n const { menu, status } = useCommand();\n const { setOpen } = React.useContext(CommandFormDialogContext);\n\n const isDisabled = disabled || status === \"pending\";\n\n useHotkeys(hotkey ?? \"\", () => setOpen(true), { enabled: !isDisabled && hotkey !== undefined });\n\n if (menu === \"inline\" || menu === \"table\") {\n return (\n <CommandTrigger label={label}>\n <DialogTrigger\n {...props}\n disabled={isDisabled}\n className={cn(buttonVariants({ variant: \"outline\", size: \"sm\" }), props.className)}\n >\n {children}\n </DialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"dropdown\") {\n return (\n <CommandTrigger label={label}>\n <DialogTrigger asChild>\n <DropdownMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </DropdownMenuItem>\n </DialogTrigger>\n </CommandTrigger>\n );\n }\n\n if (menu === \"context\") {\n return (\n <CommandTrigger label={label}>\n <DialogTrigger asChild>\n <ContextMenuItem\n {...props}\n disabled={isDisabled}\n onClick={(e) => {\n e.preventDefault();\n setOpen(true);\n }}\n >\n {children}\n </ContextMenuItem>\n </DialogTrigger>\n </CommandTrigger>\n );\n }\n}\n\n/**\n * CommandFormDialogHeader\n */\nexport function CommandFormDialogHeader({\n children,\n ...props\n}: ComponentProps<typeof DialogHeader>) {\n return <DialogHeader {...props}>{children}</DialogHeader>;\n}\n\n/**\n * CommandFormDialogTitle\n */\nexport function CommandFormDialogTitle({ children, ...props }: ComponentProps<typeof DialogTitle>) {\n return <DialogTitle {...props}>{children}</DialogTitle>;\n}\n\n/**\n * CommandFormDialogDescription\n */\nexport function CommandFormDialogDescription({\n children,\n ...props\n}: ComponentProps<typeof DialogDescription>) {\n return <DialogDescription {...props}>{children}</DialogDescription>;\n}\n\nexport const CommandFormDialogContentProvider = Form;\n\n/**\n * CommandFormDialogContent\n */\nexport type CommandFormDialogContentProps<\n TValues extends FieldValues,\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n> = ComponentProps<typeof DialogContent> & {\n variables: (values: TValues) => TVariables;\n mutation?: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n children: React.ReactNode;\n};\n// export type CommandFormDialogContentProps<TSchema extends FieldValues> = DialogContentProps & {\n// action: CommandAction<TSchema>;\n// mutation?: MutationOptions<TSchema>;\n// message?: string;\n// children: React.ReactNode;\n// };\n\nexport function CommandFormDialogContent<\n TValues extends FieldValues,\n TData = unknown,\n TError = DefaultError,\n TVariables = undefined,\n TOnMutateResult = unknown,\n>({\n variables,\n mutation,\n children,\n ...props\n}: CommandFormDialogContentProps<TValues, TData, TError, TVariables, TOnMutateResult>) {\n const { setOpen } = React.useContext(CommandFormDialogContext);\n const form = useFormContext<TValues>();\n\n const { mutateAsync } = useCommandMutation({\n ...mutation,\n onSuccess: async (...params) => {\n form.reset();\n setOpen(false);\n\n return await mutation?.onSuccess?.(...params);\n },\n });\n\n if (Object.keys(form?.formState?.errors || {})?.length > 0) {\n console.error(form.formState.errors);\n }\n\n return (\n <DialogContent {...props}>\n <form\n onSubmit={form.handleSubmit((data) => {\n const params = variables(data);\n mutateAsync(params);\n })}\n >\n {children}\n </form>\n </DialogContent>\n );\n}\n\n/**\n * FormDialogFields\n */\nexport function CommandFormDialogFields({ children, className, ...props }: ComponentProps<\"div\">) {\n return (\n <div {...props} className={cn(\"space-y-5 py-10\", className)}>\n {children}\n </div>\n );\n}\n\n/**\n * CommandFormDialogFooter\n */\nexport function CommandFormDialogFooter({\n children,\n ...props\n}: ComponentProps<typeof DialogFooter>) {\n return <DialogFooter {...props}>{children}</DialogFooter>;\n}\n\n/**\n * CommandFormDialogCancel\n */\nexport function CommandFormDialogCancel({\n children,\n onClick,\n ...props\n}: Omit<ComponentProps<\"button\">, \"type\">) {\n const { setOpen } = React.useContext(CommandFormDialogContext);\n const form = useFormContext();\n\n return (\n <Button\n {...props}\n variant=\"ghost\"\n type=\"button\"\n onClick={(e) => {\n form.reset();\n setOpen(false);\n onClick?.(e);\n }}\n >\n {children}\n </Button>\n );\n}\n\n/**\n * CommandFormDialogSubmit\n */\nexport function CommandFormDialogSubmit({\n children,\n disabled,\n ...props\n}: Omit<ComponentProps<\"button\">, \"type\">) {\n const { status } = useCommand();\n\n const isDisabled = disabled || status === \"pending\";\n\n return (\n <Button {...props} type=\"submit\" disabled={isDisabled}>\n {status === \"pending\" && <Icons.spinner className=\"mr-2 h-4 w-4 animate-spin\" />}\n {children}\n </Button>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAM,2BAA2B,MAAM,cAAc,EAAE,CAAkC;;;;AAKzF,SAAgB,kBAAkB,EAAE,UAAU,GAAG,SAAwC;CACvF,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;AAE7C,QACE,oBAAC;EAAO,GAAI;EAAa;EAAM,cAAc;YAC3C,oBAAC,yBAAyB;GAAS,OAAO;IAAE;IAAM;IAAS;GACxD;IACiC;GAC7B;;AAeb,SAAgB,yBAAyB,EACvC,OACA,QACA,UACA,UACA,GAAG,SAC6B;CAChC,MAAM,EAAE,MAAM,WAAW,YAAY;CACrC,MAAM,EAAE,YAAY,MAAM,WAAW,yBAAyB;CAE9D,MAAM,aAAa,YAAY,WAAW;AAE1C,YAAW,UAAU,UAAU,QAAQ,KAAK,EAAE,EAAE,SAAS,CAAC,cAAc,WAAW,QAAW,CAAC;AAE/F,KAAI,SAAS,YAAY,SAAS,QAChC,QACE,oBAAC;EAAsB;YACrB,oBAAC;GACC,GAAI;GACJ,UAAU;GACV,WAAW,GAAG,eAAe;IAAE,SAAS;IAAW,MAAM;IAAM,CAAC,EAAE,MAAM,UAAU;GAEjF;IACa;GACD;AAIrB,KAAI,SAAS,WACX,QACE,oBAAC;EAAsB;YACrB,oBAAC;GAAc;aACb,oBAAC;IACC,GAAI;IACJ,UAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,aAAQ,KAAK;;IAGd;KACgB;IACL;GACD;AAIrB,KAAI,SAAS,UACX,QACE,oBAAC;EAAsB;YACrB,oBAAC;GAAc;aACb,oBAAC;IACC,GAAI;IACJ,UAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,aAAQ,KAAK;;IAGd;KACe;IACJ;GACD;;;;;AAQvB,SAAgB,wBAAwB,EACtC,UACA,GAAG,SACmC;AACtC,QAAO,oBAAC;EAAa,GAAI;EAAQ;GAAwB;;;;;AAM3D,SAAgB,uBAAuB,EAAE,UAAU,GAAG,SAA6C;AACjG,QAAO,oBAAC;EAAY,GAAI;EAAQ;GAAuB;;;;;AAMzD,SAAgB,6BAA6B,EAC3C,UACA,GAAG,SACwC;AAC3C,QAAO,oBAAC;EAAkB,GAAI;EAAQ;GAA6B;;AAGrE,MAAa,mCAAmC;AAuBhD,SAAgB,yBAMd,EACA,WACA,UACA,UACA,GAAG,SACkF;CACrF,MAAM,EAAE,YAAY,MAAM,WAAW,yBAAyB;CAC9D,MAAM,OAAO,gBAAyB;CAEtC,MAAM,EAAE,gBAAgB,mBAAmB;EACzC,GAAG;EACH,WAAW,OAAO,GAAG,WAAW;AAC9B,QAAK,OAAO;AACZ,WAAQ,MAAM;AAEd,UAAO,MAAM,UAAU,YAAY,GAAG,OAAO;;EAEhD,CAAC;AAEF,KAAI,OAAO,KAAK,MAAM,WAAW,UAAU,EAAE,CAAC,EAAE,SAAS,EACvD,SAAQ,MAAM,KAAK,UAAU,OAAO;AAGtC,QACE,oBAAC;EAAc,GAAI;YACjB,oBAAC;GACC,UAAU,KAAK,cAAc,SAAS;AAEpC,gBADe,UAAU,KAAK,CACX;KACnB;GAED;IACI;GACO;;;;;AAOpB,SAAgB,wBAAwB,EAAE,UAAU,WAAW,GAAG,SAAgC;AAChG,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;EACxD;GACG;;;;;AAOV,SAAgB,wBAAwB,EACtC,UACA,GAAG,SACmC;AACtC,QAAO,oBAAC;EAAa,GAAI;EAAQ;GAAwB;;;;;AAM3D,SAAgB,wBAAwB,EACtC,UACA,SACA,GAAG,SACsC;CACzC,MAAM,EAAE,YAAY,MAAM,WAAW,yBAAyB;CAC9D,MAAM,OAAO,gBAAgB;AAE7B,QACE,oBAAC;EACC,GAAI;EACJ,SAAQ;EACR,MAAK;EACL,UAAU,MAAM;AACd,QAAK,OAAO;AACZ,WAAQ,MAAM;AACd,aAAU,EAAE;;EAGb;GACM;;;;;AAOb,SAAgB,wBAAwB,EACtC,UACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,WAAW,YAAY;CAE/B,MAAM,aAAa,YAAY,WAAW;AAE1C,QACE,qBAAC;EAAO,GAAI;EAAO,MAAK;EAAS,UAAU;aACxC,WAAW,aAAa,oBAAC,MAAM,WAAQ,WAAU,8BAA8B,EAC/E;GACM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ContextMenu, ContextMenuTrigger } from "../../../components/ui/context-menu.mjs";
|
|
1
|
+
import { ContextMenu, ContextMenuContent, ContextMenuTrigger } from "../../../components/ui/context-menu.client.mjs";
|
|
2
2
|
import { SingleCommandMenuProps } from "../hooks/use-command-menu.client.mjs";
|
|
3
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/commands/menus/context-menu.client.d.ts
|
|
7
7
|
/**
|
|
@@ -21,7 +21,7 @@ declare function ContextCommandMenuContent<TData, TMeta>({
|
|
|
21
21
|
meta,
|
|
22
22
|
className,
|
|
23
23
|
...props
|
|
24
|
-
}: SingleCommandMenuProps<TData, TMeta> &
|
|
24
|
+
}: SingleCommandMenuProps<TData, TMeta> & ComponentProps<typeof ContextMenuContent>): react_jsx_runtime0.JSX.Element;
|
|
25
25
|
//#endregion
|
|
26
26
|
export { ContextCommandMenu, ContextCommandMenuContent, ContextCommandMenuTrigger };
|
|
27
27
|
//# sourceMappingURL=context-menu.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.client.d.mts","names":[],"sources":["../../../../src/modules/commands/menus/context-menu.client.tsx"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"context-menu.client.d.mts","names":[],"sources":["../../../../src/modules/commands/menus/context-menu.client.tsx"],"mappings":";;;;;;;;;cAoBa,kBAAA,SAAkB,WAAA;;;;cAKlB,yBAAA,SAAyB,kBAAA;AAAtC;;;AAAA,iBAKgB,yBAAA,cAAA,CAAA;EACd,IAAA;EACA,QAAA;EACA,IAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,sBAAA,CAAuB,KAAA,EAAO,KAAA,IAAS,cAAA,QAAsB,kBAAA,IAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "../../../components/ui/context-menu.mjs";
|
|
4
|
+
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "../../../components/ui/context-menu.client.mjs";
|
|
5
5
|
import { CommandContextProvider } from "../hooks/context.client.mjs";
|
|
6
6
|
import { RenderCommand } from "../components/render-command.mjs";
|
|
7
7
|
import { useSingleCommandMenu } from "../hooks/use-command-menu.client.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/context-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport
|
|
1
|
+
{"version":3,"file":"context-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/context-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ComponentProps, useState } from \"react\";\nimport {\n ContextMenu,\n ContextMenuContent,\n ContextMenuItem,\n ContextMenuTrigger,\n} from \"@/components/ui/context-menu.client\";\nimport { cn } from \"@/lib/entry\";\nimport { RenderCommand } from \"../components/render-command\";\nimport { CommandContextProvider } from \"../hooks/context.client\";\nimport {\n type SingleCommandMenuProps,\n useSingleCommandMenu,\n} from \"../hooks/use-command-menu.client\";\n\n/**\n * ContextCommandMenu\n */\nexport const ContextCommandMenu = ContextMenu;\n\n/**\n * ContextCommandMenuTrigger\n */\nexport const ContextCommandMenuTrigger = ContextMenuTrigger;\n\n/**\n * ContextCommandMenuContent\n */\nexport function ContextCommandMenuContent<TData, TMeta>({\n data,\n commands,\n meta,\n className,\n ...props\n}: SingleCommandMenuProps<TData, TMeta> & ComponentProps<typeof ContextMenuContent>) {\n const [hasCommands, setHasCommands] = useState(true);\n\n const [validCommands, renderCommand] = useSingleCommandMenu({ data, commands, meta });\n\n if (!hasCommands) {\n return (\n <CommandContextProvider value={{ menu: \"context\" }}>\n <ContextMenuContent {...props} className={cn(\"min-w-40\", className)}>\n <ContextMenuItem className=\"font-medium\" disabled>\n Geen acties beschikbaar\n </ContextMenuItem>\n </ContextMenuContent>\n </CommandContextProvider>\n );\n }\n\n return (\n <CommandContextProvider value={{ menu: \"context\" }}>\n <ContextMenuContent\n {...props}\n className={cn(\"min-w-40\", className)}\n ref={(ref) => {\n if (ref?.childNodes.length === 0) setHasCommands(false);\n }}\n >\n {validCommands.map((command) => (\n <RenderCommand key={command.name} command={command} render={renderCommand} />\n ))}\n </ContextMenuContent>\n </CommandContextProvider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAa,qBAAqB;;;;AAKlC,MAAa,4BAA4B;;;;AAKzC,SAAgB,0BAAwC,EACtD,MACA,UACA,MACA,WACA,GAAG,SACgF;CACnF,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CAEpD,MAAM,CAAC,eAAe,iBAAiB,qBAAqB;EAAE;EAAM;EAAU;EAAM,CAAC;AAErF,KAAI,CAAC,YACH,QACE,oBAAC;EAAuB,OAAO,EAAE,MAAM,WAAW;YAChD,oBAAC;GAAmB,GAAI;GAAO,WAAW,GAAG,YAAY,UAAU;aACjE,oBAAC;IAAgB,WAAU;IAAc;cAAS;KAEhC;IACC;GACE;AAI7B,QACE,oBAAC;EAAuB,OAAO,EAAE,MAAM,WAAW;YAChD,oBAAC;GACC,GAAI;GACJ,WAAW,GAAG,YAAY,UAAU;GACpC,MAAM,QAAQ;AACZ,QAAI,KAAK,WAAW,WAAW,EAAG,gBAAe,MAAM;;aAGxD,cAAc,KAAK,YAClB,oBAAC;IAA0C;IAAS,QAAQ;MAAxC,QAAQ,KAAiD,CAC7E;IACiB;GACE"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
4
|
import { Button } from "../../../components/ui/button.mjs";
|
|
5
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.mjs";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.client.mjs";
|
|
6
6
|
import { Skeleton } from "../../../components/ui/skeleton.mjs";
|
|
7
7
|
import { CommandContextProvider } from "../hooks/context.client.mjs";
|
|
8
8
|
import { RenderCommand } from "../components/render-command.mjs";
|
|
@@ -28,7 +28,7 @@ function DropdownCommandMenu({ data, commands, meta, className, ...props }) {
|
|
|
28
28
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
29
29
|
...props,
|
|
30
30
|
variant: "ghost",
|
|
31
|
-
className: cn("data-[state=open]:bg-secondary
|
|
31
|
+
className: cn("size-8 p-0 data-[state=open]:bg-secondary", className),
|
|
32
32
|
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
|
|
33
33
|
className: "sr-only",
|
|
34
34
|
children: "Open menu"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/dropdown-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { MoreHorizontal } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Skeleton } from \"@/components/entry\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { RenderCommand } from \"../components/render-command\";\nimport { CommandContextProvider } from \"../hooks/context.client\";\nimport {\n type SingleCommandMenuProps,\n useSingleCommandMenu,\n} from \"../hooks/use-command-menu.client\";\n\nexport function DropdownCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n className,\n ...props\n}: SingleCommandMenuProps<TData, TMeta> & React.HTMLAttributes<HTMLElement>) {\n const [open, setOpen] = React.useState(false);\n const [validCommands, renderCommand] = useSingleCommandMenu({ data, commands, meta });\n\n if (!validCommands.length) return null;\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n <Button\n {...props}\n variant=\"ghost\"\n className={cn(\"data-[state=open]:bg-secondary
|
|
1
|
+
{"version":3,"file":"dropdown-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/dropdown-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { MoreHorizontal } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Skeleton } from \"@/components/entry\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { RenderCommand } from \"../components/render-command\";\nimport { CommandContextProvider } from \"../hooks/context.client\";\nimport {\n type SingleCommandMenuProps,\n useSingleCommandMenu,\n} from \"../hooks/use-command-menu.client\";\n\nexport function DropdownCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n className,\n ...props\n}: SingleCommandMenuProps<TData, TMeta> & React.HTMLAttributes<HTMLElement>) {\n const [open, setOpen] = React.useState(false);\n const [validCommands, renderCommand] = useSingleCommandMenu({ data, commands, meta });\n\n if (!validCommands.length) return null;\n\n return (\n <DropdownMenu open={open} onOpenChange={setOpen}>\n <DropdownMenuTrigger asChild>\n <Button\n {...props}\n variant=\"ghost\"\n className={cn(\"size-8 p-0 data-[state=open]:bg-secondary\", className)}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">Open menu</span>\n </Button>\n </DropdownMenuTrigger>\n\n <DropdownMenuContent align=\"end\" className=\"min-w-[10rem]\">\n <CommandContextProvider value={{ menu: \"dropdown\", onSuccess: () => setOpen(false) }}>\n {validCommands.map((command) => (\n <RenderCommand key={command.name} command={command} render={renderCommand} />\n ))}\n </CommandContextProvider>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n\nexport function DropdownCommandMenuLoading({ className, ...props }: ComponentProps<\"div\">) {\n return (\n <div {...props} className={cn(\"flex w-fit items-center\", className)}>\n <Skeleton className=\"h-8 w-8\" />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,oBAAkC,EAChD,MACA,UACA,MACA,WACA,GAAG,SACwE;CAC3E,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAC7C,MAAM,CAAC,eAAe,iBAAiB,qBAAqB;EAAE;EAAM;EAAU;EAAM,CAAC;AAErF,KAAI,CAAC,cAAc,OAAQ,QAAO;AAElC,QACE,qBAAC;EAAmB;EAAM,cAAc;aACtC,oBAAC;GAAoB;aACnB,qBAAC;IACC,GAAI;IACJ,SAAQ;IACR,WAAW,GAAG,6CAA6C,UAAU;eAErE,oBAAC,kBAAe,WAAU,YAAY,EACtC,oBAAC;KAAK,WAAU;eAAU;MAAgB;KACnC;IACW,EAEtB,oBAAC;GAAoB,OAAM;GAAM,WAAU;aACzC,oBAAC;IAAuB,OAAO;KAAE,MAAM;KAAY,iBAAiB,QAAQ,MAAM;KAAE;cACjF,cAAc,KAAK,YAClB,oBAAC;KAA0C;KAAS,QAAQ;OAAxC,QAAQ,KAAiD,CAC7E;KACqB;IACL;GACT;;AAInB,SAAgB,2BAA2B,EAAE,WAAW,GAAG,SAAgC;AACzF,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,2BAA2B,UAAU;YACjE,oBAAC,YAAS,WAAU,YAAY;GAC5B"}
|
|
@@ -18,7 +18,7 @@ function FloatingCommandMenu({ data, commands, meta, state, onSuccess, className
|
|
|
18
18
|
return /* @__PURE__ */ jsx("div", {
|
|
19
19
|
...props,
|
|
20
20
|
"data-state": state,
|
|
21
|
-
className: cn("
|
|
21
|
+
className: cn("fixed right-0 bottom-12 left-0 z-50 mx-auto flex w-fit items-center rounded-xl border bg-muted/80 px-3 py-2 shadow-xl backdrop-blur-2xl data-[state=open]:flex data-[state=closed]:hidden", className),
|
|
22
22
|
children: /* @__PURE__ */ jsxs(CommandContextProvider, {
|
|
23
23
|
value: {
|
|
24
24
|
menu: "table",
|
|
@@ -34,7 +34,7 @@ function FloatingCommandMenu({ data, commands, meta, state, onSuccess, className
|
|
|
34
34
|
render: renderCommand
|
|
35
35
|
}, command.name))
|
|
36
36
|
}), !hasCommands.current && /* @__PURE__ */ jsx("span", {
|
|
37
|
-
className: "text-sm
|
|
37
|
+
className: "font-medium text-sm",
|
|
38
38
|
children: "Geen acties beschikbaar"
|
|
39
39
|
})]
|
|
40
40
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/floating-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRef } from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { RenderCommand } from \"../components/render-command\";\nimport { CommandContextProvider } from \"../hooks/context.client\";\nimport { type BulkCommandMenuProps, useBulkCommandMenu } from \"../hooks/use-command-menu.client\";\n\ntype FloatingCommandMenuProps<TData, TMeta> = BulkCommandMenuProps<TData, TMeta> &\n React.HTMLAttributes<HTMLElement> & {\n state: \"open\" | \"closed\";\n };\n\nexport function FloatingCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n state,\n onSuccess,\n className,\n ...props\n}: FloatingCommandMenuProps<TData, TMeta>) {\n const hasCommands = useRef(true);\n\n const [validCommands, renderCommand] = useBulkCommandMenu({ data, commands, meta });\n\n return (\n <div\n {...props}\n data-state={state}\n className={cn(\n \"
|
|
1
|
+
{"version":3,"file":"floating-menu.client.mjs","names":[],"sources":["../../../../src/modules/commands/menus/floating-menu.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRef } from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { RenderCommand } from \"../components/render-command\";\nimport { CommandContextProvider } from \"../hooks/context.client\";\nimport { type BulkCommandMenuProps, useBulkCommandMenu } from \"../hooks/use-command-menu.client\";\n\ntype FloatingCommandMenuProps<TData, TMeta> = BulkCommandMenuProps<TData, TMeta> &\n React.HTMLAttributes<HTMLElement> & {\n state: \"open\" | \"closed\";\n };\n\nexport function FloatingCommandMenu<TData, TMeta>({\n data,\n commands,\n meta,\n state,\n onSuccess,\n className,\n ...props\n}: FloatingCommandMenuProps<TData, TMeta>) {\n const hasCommands = useRef(true);\n\n const [validCommands, renderCommand] = useBulkCommandMenu({ data, commands, meta });\n\n return (\n <div\n {...props}\n data-state={state}\n className={cn(\n \"fixed right-0 bottom-12 left-0 z-50 mx-auto flex w-fit items-center rounded-xl border bg-muted/80 px-3 py-2 shadow-xl backdrop-blur-2xl data-[state=open]:flex data-[state=closed]:hidden\",\n className,\n )}\n >\n <CommandContextProvider value={{ menu: \"table\", onSuccess }}>\n <div\n className=\"flex gap-2\"\n ref={(ref) => {\n if (ref?.childNodes.length === 0) hasCommands.current = false;\n }}\n >\n {validCommands.map((command) => (\n <RenderCommand key={command.name} command={command} render={renderCommand} />\n ))}\n </div>\n\n {!hasCommands.current && (\n <span className=\"font-medium text-sm\">Geen acties beschikbaar</span>\n )}\n </CommandContextProvider>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAaA,SAAgB,oBAAkC,EAChD,MACA,UACA,MACA,OACA,WACA,WACA,GAAG,SACsC;CACzC,MAAM,cAAc,OAAO,KAAK;CAEhC,MAAM,CAAC,eAAe,iBAAiB,mBAAmB;EAAE;EAAM;EAAU;EAAM,CAAC;AAEnF,QACE,oBAAC;EACC,GAAI;EACJ,cAAY;EACZ,WAAW,GACT,6LACA,UACD;YAED,qBAAC;GAAuB,OAAO;IAAE,MAAM;IAAS;IAAW;cACzD,oBAAC;IACC,WAAU;IACV,MAAM,QAAQ;AACZ,SAAI,KAAK,WAAW,WAAW,EAAG,aAAY,UAAU;;cAGzD,cAAc,KAAK,YAClB,oBAAC;KAA0C;KAAS,QAAQ;OAAxC,QAAQ,KAAiD,CAC7E;KACE,EAEL,CAAC,YAAY,WACZ,oBAAC;IAAK,WAAU;cAAsB;KAA8B;IAE/C;GACrB"}
|
|
@@ -16,7 +16,7 @@ function ArchiveCommand({ variables, mutation }) {
|
|
|
16
16
|
mutation,
|
|
17
17
|
className: "text-destructive",
|
|
18
18
|
label: "Archiveren",
|
|
19
|
-
children: [/* @__PURE__ */ jsx(Icons.archive, { className: "text-destructive
|
|
19
|
+
children: [/* @__PURE__ */ jsx(Icons.archive, { className: "w-4 text-destructive" }), /* @__PURE__ */ jsx(CommandLabel, {})]
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"archive-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/utils/archive-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport { Icons } from \"@/components/common/icons\";\nimport { CommandClick } from \"../components/click-command.client\";\nimport { CommandLabel } from \"../components/command-trigger.client\";\n\nexport type ArchiveCommandProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = { ids: string[] },\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n};\n\n/**\n * Archive command\n * @description command to archive a resource\n */\nexport function ArchiveCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = { ids: string[] },\n TOnMutateResult = unknown,\n>({ variables, mutation }: ArchiveCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return (\n <CommandClick\n variables={variables}\n mutation={mutation}\n className=\"text-destructive\"\n label=\"Archiveren\"\n >\n <Icons.archive className=\"text-destructive
|
|
1
|
+
{"version":3,"file":"archive-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/utils/archive-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport { Icons } from \"@/components/common/icons\";\nimport { CommandClick } from \"../components/click-command.client\";\nimport { CommandLabel } from \"../components/command-trigger.client\";\n\nexport type ArchiveCommandProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = { ids: string[] },\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n};\n\n/**\n * Archive command\n * @description command to archive a resource\n */\nexport function ArchiveCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = { ids: string[] },\n TOnMutateResult = unknown,\n>({ variables, mutation }: ArchiveCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return (\n <CommandClick\n variables={variables}\n mutation={mutation}\n className=\"text-destructive\"\n label=\"Archiveren\"\n >\n <Icons.archive className=\"w-4 text-destructive\" />\n <CommandLabel />\n </CommandClick>\n );\n}\n\n/**\n * Unarchive command\n * @description command to unarchive a resource\n */\nexport function RestoreCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = { ids: string[] },\n TOnMutateResult = unknown,\n>({ variables, mutation }: ArchiveCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return (\n <CommandClick\n className=\"flex gap-2\"\n variables={variables}\n mutation={mutation}\n label=\"Terugzetten\"\n >\n <Icons.restore className=\"w-4\" />\n <CommandLabel />\n </CommandClick>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,SAAgB,eAKd,EAAE,WAAW,YAA6E;AAC1F,QACE,qBAAC;EACY;EACD;EACV,WAAU;EACV,OAAM;aAEN,oBAAC,MAAM,WAAQ,WAAU,yBAAyB,EAClD,oBAAC,iBAAe;GACH;;;;;;AAQnB,SAAgB,eAKd,EAAE,WAAW,YAA6E;AAC1F,QACE,qBAAC;EACC,WAAU;EACC;EACD;EACV,OAAM;aAEN,oBAAC,MAAM,WAAQ,WAAU,QAAQ,EACjC,oBAAC,iBAAe;GACH"}
|
|
@@ -14,7 +14,7 @@ function DeleteCommand({ variables, mutation }) {
|
|
|
14
14
|
return /* @__PURE__ */ jsxs(CommandAlertDialog, { children: [/* @__PURE__ */ jsxs(CommandAlertDialogTrigger, {
|
|
15
15
|
className: "text-destructive",
|
|
16
16
|
label: "Verwijderen",
|
|
17
|
-
children: [/* @__PURE__ */ jsx(Icons.trash, { className: "text-destructive
|
|
17
|
+
children: [/* @__PURE__ */ jsx(Icons.trash, { className: "w-4 text-destructive" }), /* @__PURE__ */ jsx(CommandLabel, {})]
|
|
18
18
|
}), /* @__PURE__ */ jsxs(CommandAlertDialogContent, { children: [/* @__PURE__ */ jsxs(CommandAlertDialogHeader, { children: [/* @__PURE__ */ jsx(CommandAlertDialogTitle, { children: "Weet je zeker dat je dit wilt verwijderen?" }), /* @__PURE__ */ jsx(CommandAlertDialogDescription, { children: "Dit kan niet ongedaan gemaakt worden en alle gegevens zullen verloren gaan." })] }), /* @__PURE__ */ jsxs(CommandAlertDialogFooter, { children: [/* @__PURE__ */ jsx(CommandAlertDialogCancel, { children: "Annuleren" }), /* @__PURE__ */ jsx(CommandAlertDialogAction, {
|
|
19
19
|
mutation,
|
|
20
20
|
variables,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/utils/delete-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport { Icons } from \"@/components/common/icons\";\nimport {\n CommandAlertDialog,\n CommandAlertDialogAction,\n CommandAlertDialogCancel,\n CommandAlertDialogContent,\n CommandAlertDialogDescription,\n CommandAlertDialogFooter,\n CommandAlertDialogHeader,\n CommandAlertDialogTitle,\n CommandAlertDialogTrigger,\n} from \"../components/alert-dialog-command.client\";\nimport { CommandLabel } from \"../components/command-trigger.client\";\n\nexport type DeleteCommandProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n};\n/**\n * Delete command\n * @description command to delete a resource\n */\nexport function DeleteCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n>({ variables, mutation }: DeleteCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return (\n <CommandAlertDialog>\n <CommandAlertDialogTrigger className=\"text-destructive\" label=\"Verwijderen\">\n <Icons.trash className=\"text-destructive
|
|
1
|
+
{"version":3,"file":"delete-command.client.mjs","names":[],"sources":["../../../../src/modules/commands/utils/delete-command.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DefaultError, MutationOptions } from \"@tanstack/react-query\";\nimport { Icons } from \"@/components/common/icons\";\nimport {\n CommandAlertDialog,\n CommandAlertDialogAction,\n CommandAlertDialogCancel,\n CommandAlertDialogContent,\n CommandAlertDialogDescription,\n CommandAlertDialogFooter,\n CommandAlertDialogHeader,\n CommandAlertDialogTitle,\n CommandAlertDialogTrigger,\n} from \"../components/alert-dialog-command.client\";\nimport { CommandLabel } from \"../components/command-trigger.client\";\n\nexport type DeleteCommandProps<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n> = {\n variables: TVariables;\n mutation: MutationOptions<TData, TError, TVariables, TOnMutateResult>;\n};\n/**\n * Delete command\n * @description command to delete a resource\n */\nexport function DeleteCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = unknown,\n TOnMutateResult = unknown,\n>({ variables, mutation }: DeleteCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return (\n <CommandAlertDialog>\n <CommandAlertDialogTrigger className=\"text-destructive\" label=\"Verwijderen\">\n <Icons.trash className=\"w-4 text-destructive\" />\n <CommandLabel />\n </CommandAlertDialogTrigger>\n\n <CommandAlertDialogContent>\n <CommandAlertDialogHeader>\n <CommandAlertDialogTitle>\n Weet je zeker dat je dit wilt verwijderen?\n </CommandAlertDialogTitle>\n\n <CommandAlertDialogDescription>\n Dit kan niet ongedaan gemaakt worden en alle gegevens zullen verloren gaan.\n </CommandAlertDialogDescription>\n </CommandAlertDialogHeader>\n\n <CommandAlertDialogFooter>\n <CommandAlertDialogCancel>Annuleren</CommandAlertDialogCancel>\n <CommandAlertDialogAction mutation={mutation} variables={variables}>\n Verwijderen\n </CommandAlertDialogAction>\n </CommandAlertDialogFooter>\n </CommandAlertDialogContent>\n </CommandAlertDialog>\n );\n}\n\n/**\n * Single Delete command\n */\nexport function SingleDeleteCommand<\n TData = unknown,\n TError = DefaultError,\n TVariables = { id: string },\n TOnMutateResult = unknown,\n>({ variables, mutation }: DeleteCommandProps<TData, TError, TVariables, TOnMutateResult>) {\n return <DeleteCommand variables={variables} mutation={mutation} />;\n}\n"],"mappings":";;;;;;;;;;;;AA8BA,SAAgB,cAKd,EAAE,WAAW,YAA4E;AACzF,QACE,qBAAC,iCACC,qBAAC;EAA0B,WAAU;EAAmB,OAAM;aAC5D,oBAAC,MAAM,SAAM,WAAU,yBAAyB,EAChD,oBAAC,iBAAe;GACU,EAE5B,qBAAC,wCACC,qBAAC,uCACC,oBAAC,qCAAwB,+CAEC,EAE1B,oBAAC,2CAA8B,gFAEC,IACP,EAE3B,qBAAC,uCACC,oBAAC,sCAAyB,cAAoC,EAC9D,oBAAC;EAAmC;EAAqB;YAAW;GAEzC,IACF,IACD,IACT;;;;;AAOzB,SAAgB,oBAKd,EAAE,WAAW,YAA4E;AACzF,QAAO,oBAAC;EAAyB;EAAqB;GAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Checkbox } from "../../../../components/ui/checkbox.mjs";
|
|
1
|
+
import { Checkbox } from "../../../../components/ui/checkbox.client.mjs";
|
|
2
2
|
import { TableCell } from "../table.mjs";
|
|
3
3
|
import { createTableCell } from "../../lib/helpers/create-column.mjs";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/cell/select.client.tsx"],"sourcesContent":["import { Checkbox } from \"@/components/ui/checkbox\";\nimport { TableCell } from \"@/modules/data-tables/components/table\";\nimport { createTableCell } from \"../../lib/helpers/create-column\";\n\n/**\n * Create a new column with the select checkbox\n */\nexport const createTableSelectCell = createTableCell({\n id: \"select\",\n header: ({ table }) => (\n <div className=\"flex w-full items-center justify-center\">\n <Checkbox\n checked={table.getIsAllPageRowsSelected()}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n />\n </div>\n ),\n cell: ({ row }) => (\n <TableCell className=\"w-8\">\n <div className=\"flex w-full items-center justify-center\">\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n />\n </div>\n </TableCell>\n ),\n enableHiding: false,\n enableSorting: false,\n});\n"],"mappings":";;;;;;;;;AAOA,MAAa,wBAAwB,gBAAgB;CACnD,IAAI;CACJ,SAAS,EAAE,YACT,oBAAC;EAAI,WAAU;YACb,oBAAC;GACC,SAAS,MAAM,0BAA0B;GACzC,kBAAkB,UAAU,MAAM,0BAA0B,CAAC,CAAC,MAAM;GACpE,cAAW;IACX;GACE;CAER,OAAO,EAAE,UACP,oBAAC;EAAU,WAAU;YACnB,oBAAC;GAAI,WAAU;aACb,oBAAC;IACC,SAAS,IAAI,eAAe;IAC5B,kBAAkB,UAAU,IAAI,eAAe,CAAC,CAAC,MAAM;IACvD,cAAW;KACX;IACE;GACI;CAEd,cAAc;CACd,eAAe;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/cell/select.client.tsx"],"sourcesContent":["import { Checkbox } from \"@/components/ui/checkbox.client\";\nimport { TableCell } from \"@/modules/data-tables/components/table\";\nimport { createTableCell } from \"../../lib/helpers/create-column\";\n\n/**\n * Create a new column with the select checkbox\n */\nexport const createTableSelectCell = createTableCell({\n id: \"select\",\n header: ({ table }) => (\n <div className=\"flex w-full items-center justify-center\">\n <Checkbox\n checked={table.getIsAllPageRowsSelected()}\n onCheckedChange={(value) => table.toggleAllPageRowsSelected(!!value)}\n aria-label=\"Select all\"\n />\n </div>\n ),\n cell: ({ row }) => (\n <TableCell className=\"w-8\">\n <div className=\"flex w-full items-center justify-center\">\n <Checkbox\n checked={row.getIsSelected()}\n onCheckedChange={(value) => row.toggleSelected(!!value)}\n aria-label=\"Select row\"\n />\n </div>\n </TableCell>\n ),\n enableHiding: false,\n enableSorting: false,\n});\n"],"mappings":";;;;;;;;;AAOA,MAAa,wBAAwB,gBAAgB;CACnD,IAAI;CACJ,SAAS,EAAE,YACT,oBAAC;EAAI,WAAU;YACb,oBAAC;GACC,SAAS,MAAM,0BAA0B;GACzC,kBAAkB,UAAU,MAAM,0BAA0B,CAAC,CAAC,MAAM;GACpE,cAAW;IACX;GACE;CAER,OAAO,EAAE,UACP,oBAAC;EAAU,WAAU;YACnB,oBAAC;GAAI,WAAU;aACb,oBAAC;IACC,SAAS,IAAI,eAAe;IAC5B,kBAAkB,UAAU,IAAI,eAAe,CAAC,CAAC,MAAM;IACvD,cAAW;KACX;IACE;GACI;CAEd,cAAc;CACd,eAAe;CAChB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
2
2
|
import { Button } from "../../../components/ui/button.mjs";
|
|
3
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.mjs";
|
|
3
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../../components/ui/dropdown-menu.client.mjs";
|
|
4
4
|
import { ChevronsUpDown, RotateCcwIcon, SortAsc, SortDesc } from "lucide-react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ function TableColumnHeader({ column, title, className }) {
|
|
|
18
18
|
size: "sm",
|
|
19
19
|
type: "button",
|
|
20
20
|
variant: "ghost",
|
|
21
|
-
className: "data-[state=open]:bg-accent
|
|
21
|
+
className: "-ml-3 h-8 data-[state=open]:bg-accent",
|
|
22
22
|
children: [/* @__PURE__ */ jsx("span", { children: title }), column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(SortDesc, { className: "ml-2 h-4 w-4" }) : column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(SortAsc, { className: "ml-2 h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 h-4 w-4" })]
|
|
23
23
|
})
|
|
24
24
|
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
@@ -26,16 +26,16 @@ function TableColumnHeader({ column, title, className }) {
|
|
|
26
26
|
children: [
|
|
27
27
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
28
28
|
onClick: () => column.toggleSorting(false),
|
|
29
|
-
children: [/* @__PURE__ */ jsx(SortAsc, { className: "
|
|
29
|
+
children: [/* @__PURE__ */ jsx(SortAsc, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }), "Asc"]
|
|
30
30
|
}),
|
|
31
31
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
32
32
|
onClick: () => column.toggleSorting(true),
|
|
33
|
-
children: [/* @__PURE__ */ jsx(SortDesc, { className: "
|
|
33
|
+
children: [/* @__PURE__ */ jsx(SortDesc, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }), "Desc"]
|
|
34
34
|
}),
|
|
35
35
|
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
36
36
|
/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
37
37
|
onClick: () => column.clearSorting(),
|
|
38
|
-
children: [/* @__PURE__ */ jsx(RotateCcwIcon, { className: "
|
|
38
|
+
children: [/* @__PURE__ */ jsx(RotateCcwIcon, { className: "mr-2 h-3.5 w-3.5 text-muted-foreground/70" }), "Clear"]
|
|
39
39
|
})
|
|
40
40
|
]
|
|
41
41
|
})] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column-header.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/column-header.tsx"],"sourcesContent":["import type { Column } from \"@tanstack/react-table\";\nimport { ChevronsUpDown, RotateCcwIcon, SortAsc, SortDesc } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { cn } from \"@/lib/utils/cn\";\n\ninterface TableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: Column<TData, TValue>;\n title: string;\n}\n\nexport function TableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: TableColumnHeaderProps<TData, TValue>) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n className=\"data-[state=open]:bg-accent
|
|
1
|
+
{"version":3,"file":"column-header.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/column-header.tsx"],"sourcesContent":["import type { Column } from \"@tanstack/react-table\";\nimport { ChevronsUpDown, RotateCcwIcon, SortAsc, SortDesc } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu.client\";\nimport { cn } from \"@/lib/utils/cn\";\n\ninterface TableColumnHeaderProps<TData, TValue> extends React.HTMLAttributes<HTMLDivElement> {\n column: Column<TData, TValue>;\n title: string;\n}\n\nexport function TableColumnHeader<TData, TValue>({\n column,\n title,\n className,\n}: TableColumnHeaderProps<TData, TValue>) {\n if (!column.getCanSort()) {\n return <div className={cn(className)}>{title}</div>;\n }\n\n return (\n <div className={cn(\"flex items-center space-x-2\", className)}>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n className=\"-ml-3 h-8 data-[state=open]:bg-accent\"\n >\n <span>{title}</span>\n {column.getIsSorted() === \"desc\" ? (\n <SortDesc className=\"ml-2 h-4 w-4\" />\n ) : column.getIsSorted() === \"asc\" ? (\n <SortAsc className=\"ml-2 h-4 w-4\" />\n ) : (\n <ChevronsUpDown className=\"ml-2 h-4 w-4\" />\n )}\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n <DropdownMenuItem onClick={() => column.toggleSorting(false)}>\n <SortAsc className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n Asc\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => column.toggleSorting(true)}>\n <SortDesc className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n Desc\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem onClick={() => column.clearSorting()}>\n <RotateCcwIcon className=\"mr-2 h-3.5 w-3.5 text-muted-foreground/70\" />\n Clear\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </div>\n );\n}\n"],"mappings":";;;;;;;AAiBA,SAAgB,kBAAiC,EAC/C,QACA,OACA,aACwC;AACxC,KAAI,CAAC,OAAO,YAAY,CACtB,QAAO,oBAAC;EAAI,WAAW,GAAG,UAAU;YAAG;GAAY;AAGrD,QACE,oBAAC;EAAI,WAAW,GAAG,+BAA+B,UAAU;YAC1D,qBAAC,2BACC,oBAAC;GAAoB;aACnB,qBAAC;IACC,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;eAEV,oBAAC,oBAAM,QAAa,EACnB,OAAO,aAAa,KAAK,SACxB,oBAAC,YAAS,WAAU,iBAAiB,GACnC,OAAO,aAAa,KAAK,QAC3B,oBAAC,WAAQ,WAAU,iBAAiB,GAEpC,oBAAC,kBAAe,WAAU,iBAAiB;KAEtC;IACW,EACtB,qBAAC;GAAoB,OAAM;;IACzB,qBAAC;KAAiB,eAAe,OAAO,cAAc,MAAM;gBAC1D,oBAAC,WAAQ,WAAU,8CAA8C;MAEhD;IACnB,qBAAC;KAAiB,eAAe,OAAO,cAAc,KAAK;gBACzD,oBAAC,YAAS,WAAU,8CAA8C;MAEjD;IACnB,oBAAC,0BAAwB;IACzB,qBAAC;KAAiB,eAAe,OAAO,cAAc;gBACpD,oBAAC,iBAAc,WAAU,8CAA8C;MAEtD;;IACC,IACT;GACX"}
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
import { cn } from "../../../../lib/utils/cn.mjs";
|
|
4
4
|
import { Badge } from "../../../../components/ui/badge.mjs";
|
|
5
5
|
import { Button } from "../../../../components/ui/button.mjs";
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../../components/ui/popover.mjs";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../../components/ui/popover.client.mjs";
|
|
7
7
|
import { Separator } from "../../../../components/ui/separator.mjs";
|
|
8
|
-
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../../../../components/ui/command.mjs";
|
|
8
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "../../../../components/ui/command.client.mjs";
|
|
9
9
|
import { Check, PlusCircle } from "lucide-react";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { startTransition, useOptimistic } from "react";
|
|
@@ -23,7 +23,7 @@ function TableFilterCombobox({ title, filter, options }) {
|
|
|
23
23
|
size: "sm",
|
|
24
24
|
className: "h-8 border-dashed",
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ jsx(PlusCircle, { className: "
|
|
26
|
+
/* @__PURE__ */ jsx(PlusCircle, { className: "h-4 w-4" }),
|
|
27
27
|
title,
|
|
28
28
|
selectedValues?.size > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
29
|
/* @__PURE__ */ jsx(Separator, {
|
|
@@ -69,8 +69,8 @@ function TableFilterCombobox({ title, filter, options }) {
|
|
|
69
69
|
children: [
|
|
70
70
|
/* @__PURE__ */ jsx("div", {
|
|
71
71
|
"data-active": selectedValues.has(option.value),
|
|
72
|
-
className: cn("border-primary data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:[&>svg]:
|
|
73
|
-
children: /* @__PURE__ */ jsx(Check, { className: "
|
|
72
|
+
className: cn("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary opacity-50 data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:opacity-100 [&>svg]:invisible data-[active=true]:[&>svg]:visible data-[active=true]:[&>svg]:text-primary-foreground"),
|
|
73
|
+
children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4 text-foreground" })
|
|
74
74
|
}),
|
|
75
75
|
/* @__PURE__ */ jsxs("div", {
|
|
76
76
|
className: "flex flex-1 items-center gap-2",
|
|
@@ -80,7 +80,7 @@ function TableFilterCombobox({ title, filter, options }) {
|
|
|
80
80
|
})]
|
|
81
81
|
}),
|
|
82
82
|
option.total !== void 0 && /* @__PURE__ */ jsx("span", {
|
|
83
|
-
className: "
|
|
83
|
+
className: "size-4 justify-self-end font-mono text-muted-foreground/50 text-xs",
|
|
84
84
|
children: option.total
|
|
85
85
|
})
|
|
86
86
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/filters/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Check, type LucideIcon, PlusCircle } from \"lucide-react\";\nimport { type ParserBuilder, useQueryState } from \"nuqs\";\nimport { startTransition, useOptimistic } from \"react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from \"@/components/ui/command\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport type TableFilterComboboxOption = {\n label: string;\n value: string;\n className?: string;\n icon?: LucideIcon;\n total?: number;\n};\n\nexport type TableFilterComboboxProps<TValue extends string = string> = {\n title?: string;\n filter: { name: string; parser: ParserBuilder<TValue[] | null> };\n options: TableFilterComboboxOption[];\n};\n\nexport function TableFilterCombobox<TValue extends string>({\n title,\n filter,\n options,\n}: TableFilterComboboxProps<TValue>) {\n const [query, setQuery] = useQueryState(filter.name, filter.parser);\n\n const [selectedValues, setSelectedValues] = useOptimistic(\n new Set<string>(Array.isArray(query) ? query : []),\n );\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-8 border-dashed\">\n <PlusCircle className=\"
|
|
1
|
+
{"version":3,"file":"combobox.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/filters/combobox.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { Check, type LucideIcon, PlusCircle } from \"lucide-react\";\nimport { type ParserBuilder, useQueryState } from \"nuqs\";\nimport { startTransition, useOptimistic } from \"react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n} from \"@/components/ui/command.client\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport type TableFilterComboboxOption = {\n label: string;\n value: string;\n className?: string;\n icon?: LucideIcon;\n total?: number;\n};\n\nexport type TableFilterComboboxProps<TValue extends string = string> = {\n title?: string;\n filter: { name: string; parser: ParserBuilder<TValue[] | null> };\n options: TableFilterComboboxOption[];\n};\n\nexport function TableFilterCombobox<TValue extends string>({\n title,\n filter,\n options,\n}: TableFilterComboboxProps<TValue>) {\n const [query, setQuery] = useQueryState(filter.name, filter.parser);\n\n const [selectedValues, setSelectedValues] = useOptimistic(\n new Set<string>(Array.isArray(query) ? query : []),\n );\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-8 border-dashed\">\n <PlusCircle className=\"h-4 w-4\" />\n {title}\n {selectedValues?.size > 0 && (\n <>\n <Separator orientation=\"vertical\" className=\"mx-2 h-4\" />\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal lg:hidden\">\n {selectedValues.size}\n </Badge>\n <div className=\"hidden space-x-1 lg:flex\">\n {selectedValues.size > 2 ? (\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal\">\n {selectedValues.size} selected\n </Badge>\n ) : (\n options\n .filter((option) => selectedValues.has(option.value))\n .map((option) => (\n <Badge\n variant=\"secondary\"\n key={option.value}\n className=\"rounded-sm px-1 font-normal\"\n >\n {option.label}\n </Badge>\n ))\n )}\n </div>\n </>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[20rem] p-0\" align=\"start\">\n <Command>\n <CommandInput placeholder={title} />\n <CommandList>\n <CommandEmpty>No results found.</CommandEmpty>\n <CommandGroup>\n {options.map((option) => {\n const Icon = option.icon;\n\n return (\n <CommandItem\n key={option.value}\n onSelect={() =>\n startTransition(() => {\n const newSelectedValues = new Set(selectedValues);\n\n const isSelected = newSelectedValues.has(option.value);\n\n if (isSelected) newSelectedValues.delete(option.value);\n else newSelectedValues.add(option.value);\n setSelectedValues(newSelectedValues);\n\n const filterValues = Array.from(newSelectedValues) as TValue[];\n setQuery(filterValues.length ? filterValues : null);\n })\n }\n >\n <div\n data-active={selectedValues.has(option.value)}\n className={cn(\n \"mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary opacity-50 data-[active=true]:bg-primary data-[active=true]:text-primary-foreground data-[active=true]:opacity-100 [&>svg]:invisible data-[active=true]:[&>svg]:visible data-[active=true]:[&>svg]:text-primary-foreground\",\n )}\n >\n <Check className=\"h-4 w-4 text-foreground\" />\n </div>\n\n <div className=\"flex flex-1 items-center gap-2\">\n {Icon && <Icon className={cn(\"size-4\", option.className)} />}\n <span className={cn(option.className)}>{option.label}</span>\n </div>\n\n {option.total !== undefined && (\n <span className=\"size-4 justify-self-end font-mono text-muted-foreground/50 text-xs\">\n {option.total}\n </span>\n )}\n </CommandItem>\n );\n })}\n </CommandGroup>\n\n {selectedValues.size > 0 && (\n <>\n <CommandSeparator />\n <CommandGroup>\n <CommandItem\n onSelect={() => setQuery(null)}\n className=\"justify-center text-center\"\n >\n Clear filters\n </CommandItem>\n </CommandGroup>\n </>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAkCA,SAAgB,oBAA2C,EACzD,OACA,QACA,WACmC;CACnC,MAAM,CAAC,OAAO,YAAY,cAAc,OAAO,MAAM,OAAO,OAAO;CAEnE,MAAM,CAAC,gBAAgB,qBAAqB,cAC1C,IAAI,IAAY,MAAM,QAAQ,MAAM,GAAG,QAAQ,EAAE,CAAC,CACnD;AAED,QACE,qBAAC,sBACC,oBAAC;EAAe;YACd,qBAAC;GAAO,MAAK;GAAS,SAAQ;GAAU,MAAK;GAAK,WAAU;;IAC1D,oBAAC,cAAW,WAAU,YAAY;IACjC;IACA,gBAAgB,OAAO,KACtB;KACE,oBAAC;MAAU,aAAY;MAAW,WAAU;OAAa;KACzD,oBAAC;MAAM,SAAQ;MAAY,WAAU;gBAClC,eAAe;OACV;KACR,oBAAC;MAAI,WAAU;gBACZ,eAAe,OAAO,IACrB,qBAAC;OAAM,SAAQ;OAAY,WAAU;kBAClC,eAAe,MAAK;QACf,GAER,QACG,QAAQ,WAAW,eAAe,IAAI,OAAO,MAAM,CAAC,CACpD,KAAK,WACJ,oBAAC;OACC,SAAQ;OAER,WAAU;iBAET,OAAO;SAHH,OAAO,MAIN,CACR;OAEF;QACL;;IAEE;GACM,EACjB,oBAAC;EAAe,WAAU;EAAgB,OAAM;YAC9C,qBAAC,sBACC,oBAAC,gBAAa,aAAa,QAAS,EACpC,qBAAC;GACC,oBAAC,0BAAa,sBAAgC;GAC9C,oBAAC,0BACE,QAAQ,KAAK,WAAW;IACvB,MAAM,OAAO,OAAO;AAEpB,WACE,qBAAC;KAEC,gBACE,sBAAsB;MACpB,MAAM,oBAAoB,IAAI,IAAI,eAAe;AAIjD,UAFmB,kBAAkB,IAAI,OAAO,MAAM,CAEtC,mBAAkB,OAAO,OAAO,MAAM;UACjD,mBAAkB,IAAI,OAAO,MAAM;AACxC,wBAAkB,kBAAkB;MAEpC,MAAM,eAAe,MAAM,KAAK,kBAAkB;AAClD,eAAS,aAAa,SAAS,eAAe,KAAK;OACnD;;MAGJ,oBAAC;OACC,eAAa,eAAe,IAAI,OAAO,MAAM;OAC7C,WAAW,GACT,4SACD;iBAED,oBAAC,SAAM,WAAU,4BAA4B;QACzC;MAEN,qBAAC;OAAI,WAAU;kBACZ,QAAQ,oBAAC,QAAK,WAAW,GAAG,UAAU,OAAO,UAAU,GAAI,EAC5D,oBAAC;QAAK,WAAW,GAAG,OAAO,UAAU;kBAAG,OAAO;SAAa;QACxD;MAEL,OAAO,UAAU,UAChB,oBAAC;OAAK,WAAU;iBACb,OAAO;QACH;;OAjCJ,OAAO,MAmCA;KAEhB,GACW;GAEd,eAAe,OAAO,KACrB,4CACE,oBAAC,qBAAmB,EACpB,oBAAC,0BACC,oBAAC;IACC,gBAAgB,SAAS,KAAK;IAC9B,WAAU;cACX;KAEa,GACD,IACd;MAEO,IACN;GACK,IACT"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Badge } from "../../../../components/ui/badge.mjs";
|
|
4
4
|
import { Button } from "../../../../components/ui/button.mjs";
|
|
5
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../../components/ui/popover.mjs";
|
|
5
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../../components/ui/popover.client.mjs";
|
|
6
6
|
import { Input } from "../../../../components/ui/input.mjs";
|
|
7
7
|
import { Separator } from "../../../../components/ui/separator.mjs";
|
|
8
8
|
import { Slider } from "../../../../components/ui/slider.mjs";
|
|
@@ -101,7 +101,7 @@ function TableFilterSlider({ title, filter, options = {
|
|
|
101
101
|
min,
|
|
102
102
|
max
|
|
103
103
|
}), /* @__PURE__ */ jsxs("div", {
|
|
104
|
-
className: "
|
|
104
|
+
className: "flex justify-between text-muted-foreground text-xs",
|
|
105
105
|
children: [/* @__PURE__ */ jsx("span", { children: min }), /* @__PURE__ */ jsx("span", { children: max })]
|
|
106
106
|
})]
|
|
107
107
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slider.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/filters/slider.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { PlusCircle } from \"lucide-react\";\nimport { type ParserBuilder, useQueryState } from \"nuqs\";\nimport { startTransition, useState } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { Slider } from \"@/components/ui/slider\";\n\nexport type TableFilterSliderProps = {\n title?: string;\n filter: { name: string; parser: ParserBuilder<[number, number] | null> };\n options?: { min: number; max: number };\n};\n\nexport function TableFilterSlider({\n title,\n filter,\n options = { min: 0, max: 100 },\n}: TableFilterSliderProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useQueryState(filter.name, filter.parser);\n\n const [selectedValues, setSelectedValues] = useState(query);\n\n const handleSliderChange = useDebouncedCallback(\n (values: [number, number] | null) => setQuery(values, { startTransition }),\n 300,\n );\n\n const { min, max } = options;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-8 border-dashed\">\n <PlusCircle className=\"mr-2 h-4 w-4\" />\n {title}\n {selectedValues && selectedValues?.length > 0 && (\n <>\n <Separator orientation=\"vertical\" className=\"mx-2 h-4\" />\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal lg:hidden\">\n {selectedValues?.length}\n </Badge>\n\n <div className=\"hidden space-x-1 lg:flex\">\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal\">\n {query?.[0]} tot {query?.[1]}\n </Badge>\n </div>\n </>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[20rem] p-0\" align=\"start\">\n <div className=\"space-y-8 p-4\">\n <div className=\"flex items-center gap-2\">\n <Input\n type=\"number\"\n value={selectedValues?.[0] ?? undefined}\n placeholder=\"Min\"\n onChange={(e) => {\n startTransition(() => {\n const newValues = e.target.value\n ? ([Number(e.target.value), selectedValues?.[1] ?? max] as [number, number])\n : null;\n\n setSelectedValues(newValues);\n });\n }}\n onBlur={() => handleSliderChange(selectedValues)}\n />\n <Input\n type=\"number\"\n value={selectedValues?.[1] ?? undefined}\n placeholder=\"Max\"\n max={max}\n onChange={(e) => {\n startTransition(() => {\n const newValues = e.target.value\n ? ([selectedValues?.[0] ?? min, Number(e.target.value)] as [number, number])\n : null;\n\n setSelectedValues(newValues);\n });\n }}\n onBlur={() => handleSliderChange(selectedValues)}\n />\n </div>\n\n <div className=\"space-y-3\">\n <Slider\n value={selectedValues ?? [min, max]}\n onValueChange={(values: [number, number]) =>\n startTransition(() => {\n setSelectedValues(values);\n handleSliderChange(values);\n })\n }\n step={1}\n min={min}\n max={max}\n />\n\n <div className=\"
|
|
1
|
+
{"version":3,"file":"slider.client.mjs","names":[],"sources":["../../../../../src/modules/data-tables/components/filters/slider.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { PlusCircle } from \"lucide-react\";\nimport { type ParserBuilder, useQueryState } from \"nuqs\";\nimport { startTransition, useState } from \"react\";\nimport { useDebouncedCallback } from \"use-debounce\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { Slider } from \"@/components/ui/slider\";\n\nexport type TableFilterSliderProps = {\n title?: string;\n filter: { name: string; parser: ParserBuilder<[number, number] | null> };\n options?: { min: number; max: number };\n};\n\nexport function TableFilterSlider({\n title,\n filter,\n options = { min: 0, max: 100 },\n}: TableFilterSliderProps) {\n const [open, setOpen] = useState(false);\n const [query, setQuery] = useQueryState(filter.name, filter.parser);\n\n const [selectedValues, setSelectedValues] = useState(query);\n\n const handleSliderChange = useDebouncedCallback(\n (values: [number, number] | null) => setQuery(values, { startTransition }),\n 300,\n );\n\n const { min, max } = options;\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button type=\"button\" variant=\"outline\" size=\"sm\" className=\"h-8 border-dashed\">\n <PlusCircle className=\"mr-2 h-4 w-4\" />\n {title}\n {selectedValues && selectedValues?.length > 0 && (\n <>\n <Separator orientation=\"vertical\" className=\"mx-2 h-4\" />\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal lg:hidden\">\n {selectedValues?.length}\n </Badge>\n\n <div className=\"hidden space-x-1 lg:flex\">\n <Badge variant=\"secondary\" className=\"rounded-sm px-1 font-normal\">\n {query?.[0]} tot {query?.[1]}\n </Badge>\n </div>\n </>\n )}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-[20rem] p-0\" align=\"start\">\n <div className=\"space-y-8 p-4\">\n <div className=\"flex items-center gap-2\">\n <Input\n type=\"number\"\n value={selectedValues?.[0] ?? undefined}\n placeholder=\"Min\"\n onChange={(e) => {\n startTransition(() => {\n const newValues = e.target.value\n ? ([Number(e.target.value), selectedValues?.[1] ?? max] as [number, number])\n : null;\n\n setSelectedValues(newValues);\n });\n }}\n onBlur={() => handleSliderChange(selectedValues)}\n />\n <Input\n type=\"number\"\n value={selectedValues?.[1] ?? undefined}\n placeholder=\"Max\"\n max={max}\n onChange={(e) => {\n startTransition(() => {\n const newValues = e.target.value\n ? ([selectedValues?.[0] ?? min, Number(e.target.value)] as [number, number])\n : null;\n\n setSelectedValues(newValues);\n });\n }}\n onBlur={() => handleSliderChange(selectedValues)}\n />\n </div>\n\n <div className=\"space-y-3\">\n <Slider\n value={selectedValues ?? [min, max]}\n onValueChange={(values: [number, number]) =>\n startTransition(() => {\n setSelectedValues(values);\n handleSliderChange(values);\n })\n }\n step={1}\n min={min}\n max={max}\n />\n\n <div className=\"flex justify-between text-muted-foreground text-xs\">\n <span>{min}</span>\n <span>{max}</span>\n </div>\n </div>\n </div>\n\n {selectedValues && selectedValues.length > 0 && (\n <div className=\"w-full space-y-2 p-1.5\">\n <Separator />\n\n <Button\n size=\"sm\"\n type=\"button\"\n variant=\"ghost\"\n onClick={() => {\n setOpen(false);\n setSelectedValues(null);\n handleSliderChange(null);\n }}\n className=\"w-full text-center\"\n >\n Clear filters\n </Button>\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,kBAAkB,EAChC,OACA,QACA,UAAU;CAAE,KAAK;CAAG,KAAK;CAAK,IACL;CACzB,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CACvC,MAAM,CAAC,OAAO,YAAY,cAAc,OAAO,MAAM,OAAO,OAAO;CAEnE,MAAM,CAAC,gBAAgB,qBAAqB,SAAS,MAAM;CAE3D,MAAM,qBAAqB,sBACxB,WAAoC,SAAS,QAAQ,EAAE,iBAAiB,CAAC,EAC1E,IACD;CAED,MAAM,EAAE,KAAK,QAAQ;AAErB,QACE,qBAAC;EAAc;EAAM,cAAc;aACjC,oBAAC;GAAe;aACd,qBAAC;IAAO,MAAK;IAAS,SAAQ;IAAU,MAAK;IAAK,WAAU;;KAC1D,oBAAC,cAAW,WAAU,iBAAiB;KACtC;KACA,kBAAkB,gBAAgB,SAAS,KAC1C;MACE,oBAAC;OAAU,aAAY;OAAW,WAAU;QAAa;MACzD,oBAAC;OAAM,SAAQ;OAAY,WAAU;iBAClC,gBAAgB;QACX;MAER,oBAAC;OAAI,WAAU;iBACb,qBAAC;QAAM,SAAQ;QAAY,WAAU;;SAClC,QAAQ;SAAG;SAAM,QAAQ;;SACpB;QACJ;SACL;;KAEE;IACM,EACjB,qBAAC;GAAe,WAAU;GAAgB,OAAM;cAC9C,qBAAC;IAAI,WAAU;eACb,qBAAC;KAAI,WAAU;gBACb,oBAAC;MACC,MAAK;MACL,OAAO,iBAAiB,MAAM;MAC9B,aAAY;MACZ,WAAW,MAAM;AACf,6BAAsB;AAKpB,0BAJkB,EAAE,OAAO,QACtB,CAAC,OAAO,EAAE,OAAO,MAAM,EAAE,iBAAiB,MAAM,IAAI,GACrD,KAEwB;SAC5B;;MAEJ,cAAc,mBAAmB,eAAe;OAChD,EACF,oBAAC;MACC,MAAK;MACL,OAAO,iBAAiB,MAAM;MAC9B,aAAY;MACP;MACL,WAAW,MAAM;AACf,6BAAsB;AAKpB,0BAJkB,EAAE,OAAO,QACtB,CAAC,iBAAiB,MAAM,KAAK,OAAO,EAAE,OAAO,MAAM,CAAC,GACrD,KAEwB;SAC5B;;MAEJ,cAAc,mBAAmB,eAAe;OAChD;MACE,EAEN,qBAAC;KAAI,WAAU;gBACb,oBAAC;MACC,OAAO,kBAAkB,CAAC,KAAK,IAAI;MACnC,gBAAgB,WACd,sBAAsB;AACpB,yBAAkB,OAAO;AACzB,0BAAmB,OAAO;QAC1B;MAEJ,MAAM;MACD;MACA;OACL,EAEF,qBAAC;MAAI,WAAU;iBACb,oBAAC,oBAAM,MAAW,EAClB,oBAAC,oBAAM,MAAW;OACd;MACF;KACF,EAEL,kBAAkB,eAAe,SAAS,KACzC,qBAAC;IAAI,WAAU;eACb,oBAAC,cAAY,EAEb,oBAAC;KACC,MAAK;KACL,MAAK;KACL,SAAQ;KACR,eAAe;AACb,cAAQ,MAAM;AACd,wBAAkB,KAAK;AACvB,yBAAmB,KAAK;;KAE1B,WAAU;eACX;MAEQ;KACL;IAEO;GACT"}
|