@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
|
@@ -25,7 +25,7 @@ const TableHeaderRow = TableRow;
|
|
|
25
25
|
function TableHead({ className, ...props }) {
|
|
26
26
|
return /* @__PURE__ */ jsx("th", {
|
|
27
27
|
"data-slot": "table-head",
|
|
28
|
-
className: cn("
|
|
28
|
+
className: cn("h-10 whitespace-nowrap bg-muted/70 px-2 text-left align-middle font-medium text-muted-foreground", className),
|
|
29
29
|
...props
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/header.tsx"],"sourcesContent":["import { flexRender, type Header, type Table } from \"@tanstack/react-table\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { Allowed } from \"@/modules/auth/components/allowed.client\";\nimport { TableRow } from \"@/modules/data-tables/components/table\";\nimport type { TableColumnDef } from \"../lib/types\";\n\n/**\n * TableHeaderProps\n */\nexport type TableHeaderProps<TData> = {\n table: Table<TData>;\n};\n\n/**\n * DataTableHeader\n */\nexport function TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />;\n}\n\n/**\n * DataTableHeaderRow\n */\nexport const TableHeaderRow = TableRow;\n\n/**\n * TableHead\n */\nexport function TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"
|
|
1
|
+
{"version":3,"file":"header.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/header.tsx"],"sourcesContent":["import { flexRender, type Header, type Table } from \"@tanstack/react-table\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { Allowed } from \"@/modules/auth/components/allowed.client\";\nimport { TableRow } from \"@/modules/data-tables/components/table\";\nimport type { TableColumnDef } from \"../lib/types\";\n\n/**\n * TableHeaderProps\n */\nexport type TableHeaderProps<TData> = {\n table: Table<TData>;\n};\n\n/**\n * DataTableHeader\n */\nexport function TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />;\n}\n\n/**\n * DataTableHeaderRow\n */\nexport const TableHeaderRow = TableRow;\n\n/**\n * TableHead\n */\nexport function TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"h-10 whitespace-nowrap bg-muted/70 px-2 text-left align-middle font-medium text-muted-foreground\", //[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * DataTableHeaderCell\n */\ntype DataTableHeaderCellProps<TData> = {\n header: Header<TData, unknown>;\n};\n\nexport function TableHeaderCell<TData>({ header }: DataTableHeaderCellProps<TData>) {\n const columnDef = header.column.columnDef as TableColumnDef<TData>;\n\n const children = (\n <TableHead key={header.id}>\n {header.isPlaceholder\n ? null\n : flexRender(header.column.columnDef.header, header.getContext())}\n </TableHead>\n );\n\n if (!columnDef.permissions) return children;\n\n return (\n <Allowed key={header.id} permission={columnDef.permissions}>\n {children}\n </Allowed>\n );\n}\n"],"mappings":";;;;;;;;;;AAgBA,SAAgB,YAAY,EAAE,WAAW,GAAG,SAAwC;AAClF,QAAO,oBAAC;EAAM,aAAU;EAAe,WAAW,GAAG,mBAAmB,UAAU;EAAE,GAAI;GAAS;;;;;AAMnG,MAAa,iBAAiB;;;;AAK9B,SAAgB,UAAU,EAAE,WAAW,GAAG,SAAqC;AAC7E,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,oGACA,UACD;EACD,GAAI;GACJ;;AAWN,SAAgB,gBAAuB,EAAE,UAA2C;CAClF,MAAM,YAAY,OAAO,OAAO;CAEhC,MAAM,WACJ,oBAAC,uBACE,OAAO,gBACJ,OACA,WAAW,OAAO,OAAO,UAAU,QAAQ,OAAO,YAAY,CAAC,IAHrD,OAAO,GAIX;AAGd,KAAI,CAAC,UAAU,YAAa,QAAO;AAEnC,QACE,oBAAC;EAAwB,YAAY,UAAU;EAC5C;IADW,OAAO,GAEX"}
|
|
@@ -8,8 +8,8 @@ function TableSkeleton() {
|
|
|
8
8
|
return /* @__PURE__ */ jsx("div", {
|
|
9
9
|
className: "rounded-md border",
|
|
10
10
|
children: /* @__PURE__ */ jsxs(Table, { children: [/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsx(TableRow, {
|
|
11
|
-
className: "bg-muted
|
|
12
|
-
children: Array.from({ length: 15 }).map((_, index) => /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(Skeleton, { className: "
|
|
11
|
+
className: "relative bg-muted",
|
|
12
|
+
children: Array.from({ length: 15 }).map((_, index) => /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsx(Skeleton, { className: "my-2 h-2 w-full rounded-full bg-background" }) }, index))
|
|
13
13
|
}) }), /* @__PURE__ */ jsx(TableBody, { children: Array.from({ length: 15 }).map((_, index) => /* @__PURE__ */ jsx(TableRow, {
|
|
14
14
|
className: "relative",
|
|
15
15
|
children: Array.from({ length: 15 }).map((_, index) => /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Skeleton, { className: "my-2 h-2 w-full rounded-full" }) }, index))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/skeleton.tsx"],"sourcesContent":["import { Skeleton } from \"@/components/ui/skeleton\";\nimport { Table, TableBody, TableCell, TableRow } from \"@/modules/data-tables/components/table\";\nimport { TableHead, TableHeader } from \"./header\";\n\nexport function TableSkeleton() {\n return (\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n <TableRow className=\"bg-muted
|
|
1
|
+
{"version":3,"file":"skeleton.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/skeleton.tsx"],"sourcesContent":["import { Skeleton } from \"@/components/ui/skeleton\";\nimport { Table, TableBody, TableCell, TableRow } from \"@/modules/data-tables/components/table\";\nimport { TableHead, TableHeader } from \"./header\";\n\nexport function TableSkeleton() {\n return (\n <div className=\"rounded-md border\">\n <Table>\n <TableHeader>\n <TableRow className=\"relative bg-muted\">\n {Array.from({ length: 15 }).map((_, index) => (\n <TableHead key={index}>\n <Skeleton className=\"my-2 h-2 w-full rounded-full bg-background\" />\n </TableHead>\n ))}\n </TableRow>\n </TableHeader>\n <TableBody>\n {Array.from({ length: 15 }).map((_, index) => (\n <TableRow key={index} className=\"relative\">\n {Array.from({ length: 15 }).map((_, index) => (\n <TableCell key={index}>\n <Skeleton className=\"my-2 h-2 w-full rounded-full\" />\n </TableCell>\n ))}\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </div>\n );\n}\n"],"mappings":";;;;;;AAIA,SAAgB,gBAAgB;AAC9B,QACE,oBAAC;EAAI,WAAU;YACb,qBAAC,oBACC,oBAAC,yBACC,oBAAC;GAAS,WAAU;aACjB,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC,uBACC,oBAAC,YAAS,WAAU,+CAA+C,IADrD,MAEJ,CACZ;IACO,GACC,EACd,oBAAC,uBACE,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC;GAAqB,WAAU;aAC7B,MAAM,KAAK,EAAE,QAAQ,IAAI,CAAC,CAAC,KAAK,GAAG,UAClC,oBAAC,uBACC,oBAAC,YAAS,WAAU,iCAAiC,IADvC,MAEJ,CACZ;KALW,MAMJ,CACX,GACQ,IACN;GACJ"}
|
|
@@ -25,14 +25,14 @@ function TableBody({ className, ...props }) {
|
|
|
25
25
|
function TableFooter({ className, ...props }) {
|
|
26
26
|
return /* @__PURE__ */ jsx("tfoot", {
|
|
27
27
|
"data-slot": "table-footer",
|
|
28
|
-
className: cn("bg-muted/50
|
|
28
|
+
className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className),
|
|
29
29
|
...props
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
function TableRow({ className, ...props }) {
|
|
33
33
|
return /* @__PURE__ */ jsx("tr", {
|
|
34
34
|
"data-slot": "table-row",
|
|
35
|
-
className: cn("hover:bg-muted/50 data-[state=selected]:bg-muted
|
|
35
|
+
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className),
|
|
36
36
|
...props
|
|
37
37
|
});
|
|
38
38
|
}
|
|
@@ -46,7 +46,7 @@ function TableCell({ readonly, className, ...props }) {
|
|
|
46
46
|
function TableCaption({ className, ...props }) {
|
|
47
47
|
return /* @__PURE__ */ jsx("caption", {
|
|
48
48
|
"data-slot": "table-caption",
|
|
49
|
-
className: cn("text-muted-foreground
|
|
49
|
+
className: cn("mt-4 text-muted-foreground text-sm", className),
|
|
50
50
|
...props
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils/cn\";\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div data-slot=\"table-container\" className=\"relative w-full overflow-x-auto\">\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\"bg-muted/50
|
|
1
|
+
{"version":3,"file":"table.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/table.tsx"],"sourcesContent":["\"use client\";\n\nimport type * as React from \"react\";\n\nimport { cn } from \"@/lib/utils/cn\";\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div data-slot=\"table-container\" className=\"relative w-full overflow-x-auto\">\n <table\n data-slot=\"table\"\n className={cn(\"w-full caption-bottom text-sm\", className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return (\n <tbody\n data-slot=\"table-body\"\n className={cn(\"[&_tr:last-child]:border-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0\", className)}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n \"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({\n readonly,\n className,\n ...props\n}: React.ComponentProps<\"td\"> & { readonly?: boolean }) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"whitespace-nowrap p-2 align-middle\", //[&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\n readonly && \"bg-muted/50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn(\"mt-4 text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport { Table, TableBody, TableCaption, TableCell, TableFooter, TableRow };\n"],"mappings":";;;;;;AAMA,SAAS,MAAM,EAAE,WAAW,GAAG,SAAwC;AACrE,QACE,oBAAC;EAAI,aAAU;EAAkB,WAAU;YACzC,oBAAC;GACC,aAAU;GACV,WAAW,GAAG,iCAAiC,UAAU;GACzD,GAAI;IACJ;GACE;;AAIV,SAAS,UAAU,EAAE,WAAW,GAAG,SAAwC;AACzE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GAAG,8BAA8B,UAAU;EACtD,GAAI;GACJ;;AAIN,SAAS,YAAY,EAAE,WAAW,GAAG,SAAwC;AAC3E,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GAAG,2DAA2D,UAAU;EACnF,GAAI;GACJ;;AAIN,SAAS,SAAS,EAAE,WAAW,GAAG,SAAqC;AACrE,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,+EACA,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,UAAU,EACjB,UACA,WACA,GAAG,SACmD;AACtD,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GACT,sCACA,YAAY,eACZ,UACD;EACD,GAAI;GACJ;;AAIN,SAAS,aAAa,EAAE,WAAW,GAAG,SAA0C;AAC9E,QACE,oBAAC;EACC,aAAU;EACV,WAAW,GAAG,sCAAsC,UAAU;EAC9D,GAAI;GACJ"}
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function TableToolbar({ children, className, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx("div", {
|
|
7
7
|
...props,
|
|
8
|
-
className: cn("flex max-w-full justify-between gap-5 overflow-x-auto
|
|
8
|
+
className: cn("flex max-w-full justify-between gap-5 overflow-x-auto py-1", className),
|
|
9
9
|
children
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolbar.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/toolbar.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\ntype TableToolbarProps = HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode;\n};\n\nexport function TableToolbar({ children, className, ...props }: TableToolbarProps) {\n return (\n <div\n {...props}\n className={cn(\"flex max-w-full justify-between gap-5 overflow-x-auto
|
|
1
|
+
{"version":3,"file":"toolbar.mjs","names":[],"sources":["../../../../src/modules/data-tables/components/toolbar.tsx"],"sourcesContent":["import type { HTMLAttributes } from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\ntype TableToolbarProps = HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode;\n};\n\nexport function TableToolbar({ children, className, ...props }: TableToolbarProps) {\n return (\n <div\n {...props}\n className={cn(\"flex max-w-full justify-between gap-5 overflow-x-auto py-1\", className)}\n >\n {children}\n </div>\n );\n}\n\ntype TableToolbarListProps = HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode;\n};\n\nexport function TableToolbarList({ children, className, ...props }: TableToolbarListProps) {\n return (\n <div {...props} className={cn(\"flex flex-row gap-5\", className)}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;;AAOA,SAAgB,aAAa,EAAE,UAAU,WAAW,GAAG,SAA4B;AACjF,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,8DAA8D,UAAU;EAErF;GACG;;AAQV,SAAgB,iBAAiB,EAAE,UAAU,WAAW,GAAG,SAAgC;AACzF,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,uBAAuB,UAAU;EAC5D;GACG"}
|
|
@@ -21,7 +21,7 @@ function PaginationTableFooter({ table }) {
|
|
|
21
21
|
onClick: () => table.resetRowSelection(),
|
|
22
22
|
children: /* @__PURE__ */ jsx(XIcon, { className: "h-2 w-2" })
|
|
23
23
|
}), /* @__PURE__ */ jsxs("div", {
|
|
24
|
-
className: "text-muted-foreground
|
|
24
|
+
className: "flex-1 text-muted-foreground text-sm",
|
|
25
25
|
children: [
|
|
26
26
|
selected ?? table.getFilteredSelectedRowModel().rows.length,
|
|
27
27
|
" of",
|
|
@@ -36,7 +36,7 @@ function PaginationTableFooter({ table }) {
|
|
|
36
36
|
/* @__PURE__ */ jsxs("div", {
|
|
37
37
|
className: "hidden items-center space-x-2 md:flex",
|
|
38
38
|
children: [/* @__PURE__ */ jsx("p", {
|
|
39
|
-
className: "text-sm
|
|
39
|
+
className: "font-medium text-sm",
|
|
40
40
|
children: "Rows per page"
|
|
41
41
|
}), /* @__PURE__ */ jsxs(Select, {
|
|
42
42
|
value: `${table.getState().pagination.pageSize}`,
|
|
@@ -65,7 +65,7 @@ function PaginationTableFooter({ table }) {
|
|
|
65
65
|
})]
|
|
66
66
|
}),
|
|
67
67
|
/* @__PURE__ */ jsxs("div", {
|
|
68
|
-
className: "flex items-center justify-center text-sm
|
|
68
|
+
className: "flex items-center justify-center font-medium text-sm",
|
|
69
69
|
children: [
|
|
70
70
|
"Page ",
|
|
71
71
|
table.getState().pagination.pageIndex + 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.mjs","names":[],"sources":["../../../../../src/modules/data-tables/strategies/pagination/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Table } from \"@tanstack/react-table\";\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, XIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\n\nexport function PaginationTableFooter<TData extends { id: string }>({\n table,\n}: {\n table: Table<TData>;\n}) {\n const selected = Object.keys(table.getState().rowSelection).length;\n const total = table.getRowCount();\n\n return (\n <div className=\"flex flex-col gap-y-4 px-2 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-2\">\n {selected > 0 && (\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"h-4 w-4 rounded-full\"\n onClick={() => table.resetRowSelection()}\n >\n <XIcon className=\"h-2 w-2\" />\n </Button>\n )}\n\n <div className=\"text-muted-foreground
|
|
1
|
+
{"version":3,"file":"components.mjs","names":[],"sources":["../../../../../src/modules/data-tables/strategies/pagination/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type { Table } from \"@tanstack/react-table\";\nimport { ChevronLeft, ChevronRight, ChevronsLeft, ChevronsRight, XIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\n\nexport function PaginationTableFooter<TData extends { id: string }>({\n table,\n}: {\n table: Table<TData>;\n}) {\n const selected = Object.keys(table.getState().rowSelection).length;\n const total = table.getRowCount();\n\n return (\n <div className=\"flex flex-col gap-y-4 px-2 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-2\">\n {selected > 0 && (\n <Button\n type=\"button\"\n size=\"icon\"\n variant=\"ghost\"\n className=\"h-4 w-4 rounded-full\"\n onClick={() => table.resetRowSelection()}\n >\n <XIcon className=\"h-2 w-2\" />\n </Button>\n )}\n\n <div className=\"flex-1 text-muted-foreground text-sm\">\n {selected ?? table.getFilteredSelectedRowModel().rows.length} of{\" \"}\n {total ?? table.getFilteredRowModel().rows.length} row(s) selected.\n </div>\n </div>\n\n <div className=\"flex items-center justify-between gap-x-6 md:justify-start lg:space-x-8\">\n <div className=\"hidden items-center space-x-2 md:flex\">\n <p className=\"font-medium text-sm\">Rows per page</p>\n <Select\n value={`${table.getState().pagination.pageSize}`}\n onValueChange={(value) => {\n table.setPageSize(Number(value));\n }}\n >\n <SelectTrigger className=\"h-8 w-[70px]\">\n <SelectValue placeholder={table.getState().pagination.pageSize} />\n </SelectTrigger>\n <SelectContent side=\"top\">\n {[10, 20, 30, 40, 50, 100, 300, 500].map((pageSize) => (\n <SelectItem key={pageSize} value={`${pageSize}`}>\n {pageSize}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n\n <div className=\"flex items-center justify-center font-medium text-sm\">\n Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()}\n </div>\n\n <div className=\"flex items-center space-x-2\">\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(0)}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to first page</span>\n <ChevronsLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.previousPage()}\n disabled={!table.getCanPreviousPage()}\n >\n <span className=\"sr-only\">Go to previous page</span>\n <ChevronLeft className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"h-8 w-8 p-0\"\n onClick={() => table.nextPage()}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to next page</span>\n <ChevronRight className=\"h-4 w-4\" />\n </Button>\n\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"hidden h-8 w-8 p-0 lg:flex\"\n onClick={() => table.setPageIndex(table.getPageCount() - 1)}\n disabled={!table.getCanNextPage()}\n >\n <span className=\"sr-only\">Go to last page</span>\n <ChevronsRight className=\"h-4 w-4\" />\n </Button>\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAaA,SAAgB,sBAAoD,EAClE,SAGC;CACD,MAAM,WAAW,OAAO,KAAK,MAAM,UAAU,CAAC,aAAa,CAAC;CAC5D,MAAM,QAAQ,MAAM,aAAa;AAEjC,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAI,WAAU;cACZ,WAAW,KACV,oBAAC;IACC,MAAK;IACL,MAAK;IACL,SAAQ;IACR,WAAU;IACV,eAAe,MAAM,mBAAmB;cAExC,oBAAC,SAAM,WAAU,YAAY;KACtB,EAGX,qBAAC;IAAI,WAAU;;KACZ,YAAY,MAAM,6BAA6B,CAAC,KAAK;KAAO;KAAI;KAChE,SAAS,MAAM,qBAAqB,CAAC,KAAK;KAAO;;KAC9C;IACF,EAEN,qBAAC;GAAI,WAAU;;IACb,qBAAC;KAAI,WAAU;gBACb,oBAAC;MAAE,WAAU;gBAAsB;OAAiB,EACpD,qBAAC;MACC,OAAO,GAAG,MAAM,UAAU,CAAC,WAAW;MACtC,gBAAgB,UAAU;AACxB,aAAM,YAAY,OAAO,MAAM,CAAC;;iBAGlC,oBAAC;OAAc,WAAU;iBACvB,oBAAC,eAAY,aAAa,MAAM,UAAU,CAAC,WAAW,WAAY;QACpD,EAChB,oBAAC;OAAc,MAAK;iBACjB;QAAC;QAAI;QAAI;QAAI;QAAI;QAAI;QAAK;QAAK;QAAI,CAAC,KAAK,aACxC,oBAAC;QAA0B,OAAO,GAAG;kBAClC;UADc,SAEJ,CACb;QACY;OACT;MACL;IAEN,qBAAC;KAAI,WAAU;;MAAuD;MAC9D,MAAM,UAAU,CAAC,WAAW,YAAY;MAAE;MAAK,MAAM,cAAc;;MACrE;IAEN,qBAAC;KAAI,WAAU;;MACb,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,aAAa,EAAE;OACpC,UAAU,CAAC,MAAM,oBAAoB;kBAErC,oBAAC;QAAK,WAAU;kBAAU;SAAuB,EACjD,oBAAC,gBAAa,WAAU,YAAY;QAC7B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,cAAc;OACnC,UAAU,CAAC,MAAM,oBAAoB;kBAErC,oBAAC;QAAK,WAAU;kBAAU;SAA0B,EACpD,oBAAC,eAAY,WAAU,YAAY;QAC5B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,UAAU;OAC/B,UAAU,CAAC,MAAM,gBAAgB;kBAEjC,oBAAC;QAAK,WAAU;kBAAU;SAAsB,EAChD,oBAAC,gBAAa,WAAU,YAAY;QAC7B;MAET,qBAAC;OACC,MAAK;OACL,SAAQ;OACR,WAAU;OACV,eAAe,MAAM,aAAa,MAAM,cAAc,GAAG,EAAE;OAC3D,UAAU,CAAC,MAAM,gBAAgB;kBAEjC,oBAAC;QAAK,WAAU;kBAAU;SAAsB,EAChD,oBAAC,iBAAc,WAAU,YAAY;QAC9B;;MACL;;IACF;GACF"}
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
//#region src/modules/data-tables/tables/inline-table/components/cells/common.tsx
|
|
6
6
|
function TableInlineCell({ className, ...props }) {
|
|
7
7
|
return /* @__PURE__ */ jsx(TableCell, {
|
|
8
|
-
className: cn("
|
|
8
|
+
className: cn("h-8 border-l p-0 align-middle first:border-0 focus-within:bg-accent focus-within:text-accent-foreground [&:has([role=checkbox])]:pr-0", className),
|
|
9
9
|
...props
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/common.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { TableCell } from \"../../../../components/table\";\n\nexport function TableInlineCell({ className, ...props }: React.ComponentProps<typeof TableCell>) {\n return (\n <TableCell\n className={cn(\n \"
|
|
1
|
+
{"version":3,"file":"common.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/common.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { TableCell } from \"../../../../components/table\";\n\nexport function TableInlineCell({ className, ...props }: React.ComponentProps<typeof TableCell>) {\n return (\n <TableCell\n className={cn(\n \"h-8 border-l p-0 align-middle first:border-0 focus-within:bg-accent focus-within:text-accent-foreground [&:has([role=checkbox])]:pr-0\",\n className,\n )}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAIA,SAAgB,gBAAgB,EAAE,WAAW,GAAG,SAAiD;AAC/F,QACE,oBAAC;EACC,WAAW,GACT,yIACA,UACD;EACD,GAAI;GACJ"}
|
package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function TableDragHandle({ row, className, disabled }) {
|
|
|
20
20
|
type: "button",
|
|
21
21
|
className: cn("h-full w-8 rounded-none border-none", className),
|
|
22
22
|
disabled,
|
|
23
|
-
children: /* @__PURE__ */ jsx(GripIcon, { className: "fill-muted
|
|
23
|
+
children: /* @__PURE__ */ jsx(GripIcon, { className: "size-4 fill-muted" })
|
|
24
24
|
})
|
|
25
25
|
});
|
|
26
26
|
}
|
package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag-handle.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport { GripIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/entry\";\nimport { createTableCell } from \"../../../../lib/helpers/create-column\";\nimport { TableInlineCell } from \"./common\";\n\n/**\n * Create a new column with the drag handle\n */\nexport type TableDragHandleProps<TData, TValue> = Pick<CellContext<TData, TValue>, \"row\"> & {\n className?: string;\n disabled?: boolean;\n};\n\nexport function TableDragHandle<TData, TValue>({\n row,\n className,\n disabled,\n}: TableDragHandleProps<TData, TValue>) {\n const rowId = (row.original as { id: string }).id;\n\n const { attributes, listeners } = useSortable({ id: rowId });\n\n return (\n <TableInlineCell className=\"w-8\">\n <Button\n {...attributes}\n {...listeners}\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n className={cn(\"h-full w-8 rounded-none border-none\", className)}\n disabled={disabled}\n >\n <GripIcon className=\"fill-muted
|
|
1
|
+
{"version":3,"file":"drag-handle.client.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.tsx"],"sourcesContent":["import { useSortable } from \"@dnd-kit/sortable\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport { GripIcon } from \"lucide-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/entry\";\nimport { createTableCell } from \"../../../../lib/helpers/create-column\";\nimport { TableInlineCell } from \"./common\";\n\n/**\n * Create a new column with the drag handle\n */\nexport type TableDragHandleProps<TData, TValue> = Pick<CellContext<TData, TValue>, \"row\"> & {\n className?: string;\n disabled?: boolean;\n};\n\nexport function TableDragHandle<TData, TValue>({\n row,\n className,\n disabled,\n}: TableDragHandleProps<TData, TValue>) {\n const rowId = (row.original as { id: string }).id;\n\n const { attributes, listeners } = useSortable({ id: rowId });\n\n return (\n <TableInlineCell className=\"w-8\">\n <Button\n {...attributes}\n {...listeners}\n variant=\"ghost\"\n size=\"icon\"\n type=\"button\"\n className={cn(\"h-full w-8 rounded-none border-none\", className)}\n disabled={disabled}\n >\n <GripIcon className=\"size-4 fill-muted\" />\n </Button>\n </TableInlineCell>\n );\n}\n\n/**\n * Create a new column with the drag handle\n */\nexport const createTableDragHandleCell = createTableCell({\n id: \"dragHandle\",\n cell: TableDragHandle,\n enableHiding: false,\n enableSorting: false,\n});\n"],"mappings":";;;;;;;;;AAgBA,SAAgB,gBAA+B,EAC7C,KACA,WACA,YACsC;CACtC,MAAM,QAAS,IAAI,SAA4B;CAE/C,MAAM,EAAE,YAAY,cAAc,YAAY,EAAE,IAAI,OAAO,CAAC;AAE5D,QACE,oBAAC;EAAgB,WAAU;YACzB,oBAAC;GACC,GAAI;GACJ,GAAI;GACJ,SAAQ;GACR,MAAK;GACL,MAAK;GACL,WAAW,GAAG,uCAAuC,UAAU;GACrD;aAEV,oBAAC,YAAS,WAAU,sBAAsB;IACnC;GACO;;;;;AAOtB,MAAa,4BAA4B,gBAAgB;CACvD,IAAI;CACJ,MAAM;CACN,cAAc;CACd,eAAe;CAChB,CAAC"}
|
|
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
function InlineDataTableReadOnly({ className, children, ...props }) {
|
|
6
6
|
return /* @__PURE__ */ jsx("span", {
|
|
7
7
|
...props,
|
|
8
|
-
className: cn("
|
|
8
|
+
className: cn("flex h-full w-full items-center truncate bg-muted/50 px-3", className),
|
|
9
9
|
children
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-only.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx"],"sourcesContent":["import type React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport function InlineDataTableReadOnly({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n {...props}\n className={cn(\"
|
|
1
|
+
{"version":3,"file":"read-only.mjs","names":[],"sources":["../../../../../../../src/modules/data-tables/tables/inline-table/components/cells/read-only.tsx"],"sourcesContent":["import type React from \"react\";\nimport { cn } from \"@/lib/utils/cn\";\n\nexport function InlineDataTableReadOnly({\n className,\n children,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n {...props}\n className={cn(\"flex h-full w-full items-center truncate bg-muted/50 px-3\", className)}\n >\n {children}\n </span>\n );\n}\n"],"mappings":";;;;AAGA,SAAgB,wBAAwB,EACtC,WACA,UACA,GAAG,SACqC;AACxC,QACE,oBAAC;EACC,GAAI;EACJ,WAAW,GAAG,6DAA6D,UAAU;EAEpF;GACI"}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.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
|
-
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.mjs";
|
|
7
|
+
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.client.mjs";
|
|
8
8
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
9
9
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
10
10
|
import { CalendarIcon } from "lucide-react";
|
|
@@ -69,7 +69,7 @@ function InlineDateInput({ initialValue, action, permission, variant, className,
|
|
|
69
69
|
variant: "ghost",
|
|
70
70
|
tabIndex: -1,
|
|
71
71
|
disabled: !isAllowed,
|
|
72
|
-
className: cn("absolute
|
|
72
|
+
className: cn("absolute top-0 right-0 bottom-0 opacity-50", !value && "text-muted-foreground"),
|
|
73
73
|
children: /* @__PURE__ */ jsx(CalendarIcon, { className: "h-4 w-4" })
|
|
74
74
|
})
|
|
75
75
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute
|
|
1
|
+
{"version":3,"file":"date-input.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Input } from \"@/components/ui/input\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nconst formatDate = (value: Date) => format(value, \"dd/MM/yyyy\");\nconst parseDate = (value: string) => new Date(value.split(\"/\").reverse().join(\"-\"));\nconst isValidDate = (date: Date) => date instanceof Date && date.toString() !== \"Invalid Date\";\n\nexport function InlineDateInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n ...props\n}: ComponentProps<\"div\"> & useInlineEditOptions<Date, Required> & InlineEditVariantsProps) {\n const [inValid, setInValid] = React.useState<boolean>(false);\n\n const { value, setValue, handleChange, handleBlur, status, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n const [stringDate, setStringDate] = React.useState<string>(\n initialValue ? formatDate(initialValue) : \"\",\n );\n\n /**\n * Update string date when value changes\n */\n React.useEffect(() => {\n if (value) setStringDate(formatDate(value));\n }, [value]);\n\n return (\n <Popover>\n <div {...props} className={cn(\"relative h-full\", className)}>\n <Input\n data-input\n type=\"string\"\n value={stringDate}\n className={cn(inlineEditVariants({ variant, status }), inValid && \"text-destructive\")}\n disabled={!isAllowed}\n onChange={(e) => {\n setStringDate(e.target.value);\n const parsedDate = parseDate(e.target.value);\n\n if (!isValidDate(parsedDate)) {\n setInValid(true);\n setValue(undefined);\n } else {\n setInValid(false);\n setValue(parsedDate);\n }\n }}\n onBlur={(e) => {\n const parsedDate = parseDate(e.target.value);\n handleBlur(isValidDate(parsedDate) ? parsedDate : null);\n }}\n />\n\n <PopoverTrigger asChild>\n <Button\n variant=\"ghost\"\n tabIndex={-1}\n disabled={!isAllowed}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n <CalendarIcon className=\"h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </div>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ?? undefined}\n defaultMonth={value ?? undefined}\n disabled={!isAllowed}\n onSelect={(selectedDate) => {\n if (!selectedDate) return;\n\n setStringDate(formatDate(selectedDate));\n\n handleChange(selectedDate ?? null);\n handleBlur(selectedDate ?? null);\n\n setInValid(false);\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAM,cAAc,UAAgB,OAAO,OAAO,aAAa;AAC/D,MAAM,aAAa,UAAkB,IAAI,KAAK,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;AACnF,MAAM,eAAe,SAAe,gBAAgB,QAAQ,KAAK,UAAU,KAAK;AAEhF,SAAgB,gBAAkD,EAChE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,GAAG,SACsF;CACzF,MAAM,CAAC,SAAS,cAAc,MAAM,SAAkB,MAAM;CAE5D,MAAM,EAAE,OAAO,UAAU,cAAc,YAAY,QAAQ,cAAc,cAAc;EACrF;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,MAAM,CAAC,YAAY,iBAAiB,MAAM,SACxC,eAAe,WAAW,aAAa,GAAG,GAC3C;;;;AAKD,OAAM,gBAAgB;AACpB,MAAI,MAAO,eAAc,WAAW,MAAM,CAAC;IAC1C,CAAC,MAAM,CAAC;AAEX,QACE,qBAAC,sBACC,qBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mBAAmB,UAAU;aACzD,oBAAC;GACC;GACA,MAAK;GACL,OAAO;GACP,WAAW,GAAG,mBAAmB;IAAE;IAAS;IAAQ,CAAC,EAAE,WAAW,mBAAmB;GACrF,UAAU,CAAC;GACX,WAAW,MAAM;AACf,kBAAc,EAAE,OAAO,MAAM;IAC7B,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAE5C,QAAI,CAAC,YAAY,WAAW,EAAE;AAC5B,gBAAW,KAAK;AAChB,cAAS,OAAU;WACd;AACL,gBAAW,MAAM;AACjB,cAAS,WAAW;;;GAGxB,SAAS,MAAM;IACb,MAAM,aAAa,UAAU,EAAE,OAAO,MAAM;AAC5C,eAAW,YAAY,WAAW,GAAG,aAAa,KAAK;;IAEzD,EAEF,oBAAC;GAAe;aACd,oBAAC;IACC,SAAQ;IACR,UAAU;IACV,UAAU,CAAC;IACX,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;cAED,oBAAC,gBAAa,WAAU,YAAY;KAC7B;IACM;GACb,EAEN,oBAAC;EAAe,WAAU;YACxB,oBAACA;GACC,MAAK;GACL;GACA,UAAU,SAAS;GACnB,cAAc,SAAS;GACvB,UAAU,CAAC;GACX,WAAW,iBAAiB;AAC1B,QAAI,CAAC,aAAc;AAEnB,kBAAc,WAAW,aAAa,CAAC;AAEvC,iBAAa,gBAAgB,KAAK;AAClC,eAAW,gBAAgB,KAAK;AAEhC,eAAW,MAAM;;IAEnB;GACa,IACT"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
4
|
import { Button } from "../../../components/ui/button.mjs";
|
|
5
5
|
import { formatDate } from "../../../lib/utils/format.mjs";
|
|
6
|
-
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.mjs";
|
|
7
|
-
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.mjs";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.client.mjs";
|
|
7
|
+
import { Calendar as Calendar$1 } from "../../../components/ui/calendar.client.mjs";
|
|
8
8
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
9
9
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
10
10
|
import { CalendarIcon } from "lucide-react";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,SAAS;AACtB,WAAQ,KAAK;AACb,OAAI,CAAC,QAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACA;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
1
|
+
{"version":3,"file":"date-picker.client.mjs","names":["Calendar"],"sources":["../../../../src/modules/inline-edit/components/date-picker.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CalendarIcon } from \"lucide-react\";\nimport React, { type ComponentProps } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Calendar } from \"@/components/ui/calendar.client\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/ui/popover.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { formatDate } from \"@/lib/utils/format\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditDatePickerProps<Required extends boolean> = ComponentProps<typeof Button> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps;\n\nexport function InlineDatePicker<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n disabled,\n updateStrategy,\n isRequired,\n ...props\n}: InlineEditDatePickerProps<Required>) {\n const [open, setOpen] = React.useState(false);\n\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Popover\n open={open}\n onOpenChange={(open) => {\n setOpen(open);\n if (!open && value) handleBlur(value);\n }}\n >\n <PopoverTrigger asChild>\n <Button\n {...props}\n type=\"button\"\n variant=\"outline\"\n className={cn(\"w-full\", inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n >\n <CalendarIcon className=\"mr-2 h-4 w-4\" />\n {value ? formatDate(value) : <span>Kies een datum</span>}\n </Button>\n </PopoverTrigger>\n\n <PopoverContent className=\"w-auto p-0\">\n <Calendar\n mode=\"single\"\n autoFocus\n selected={value ? new Date(value) : undefined}\n onSelect={(date) => handleChange(date ?? null)}\n />\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,SAAgB,iBAAmD,EACjE,cACA,QACA,YACA,SACA,WACA,UACA,gBACA,YACA,GAAG,SACmC;CACtC,MAAM,CAAC,MAAM,WAAW,MAAM,SAAS,MAAM;CAE7C,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,qBAAC;EACO;EACN,eAAe,SAAS;AACtB,WAAQ,KAAK;AACb,OAAI,CAAC,QAAQ,MAAO,YAAW,MAAM;;aAGvC,oBAAC;GAAe;aACd,qBAAC;IACC,GAAI;IACJ,MAAK;IACL,SAAQ;IACR,WAAW,GAAG,UAAU,mBAAmB;KAAE;KAAS;KAAQ,CAAC,EAAE,UAAU;IAC3E,UAAU,YAAY,CAAC;eAEvB,oBAAC,gBAAa,WAAU,iBAAiB,EACxC,QAAQ,WAAW,MAAM,GAAG,oBAAC,oBAAK,mBAAqB;KACjD;IACM,EAEjB,oBAAC;GAAe,WAAU;aACxB,oBAACA;IACC,MAAK;IACL;IACA,UAAU,QAAQ,IAAI,KAAK,MAAM,GAAG;IACpC,WAAW,SAAS,aAAa,QAAQ,KAAK;KAC9C;IACa;GACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DateTimeInput } from "../../../components/ui/input-date-time.mjs";
|
|
1
|
+
import { DateTimeInput } from "../../../components/ui/input-date-time.client.mjs";
|
|
2
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
3
3
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { DateTimeInput } from "../../../components/ui/input-date-time.mjs";
|
|
4
|
+
import { DateTimeInput } from "../../../components/ui/input-date-time.client.mjs";
|
|
5
5
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
6
6
|
import { inlineEditVariants } from "../lib/variants.mjs";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit<\n string,\n Date,\n Required\n >({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) =>\n (value instanceof Date\n ? format(value, \"yyyy-MM-dd'T'HH:mm\")\n : typeof value === \"string\"\n ? value\n : undefined) as string,\n encode: (value) => (value ? new Date(value) : null) as Date,\n },\n });\n\n return (\n <DateTimeInput\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,oBAAsD,EACpE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,cAAc,YAAY,QAAQ,cAAc,cAI7D;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UACN,iBAAiB,OACd,OAAO,OAAO,qBAAqB,GACnC,OAAO,UAAU,WACf,QACA;GACR,SAAS,UAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;GAC/C;EACF,CAAC;AAEF,QACE,oBAAC;EACC,OAAO,SAAS;EAChB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS,aAAa,QAAQ,KAAK;EACnD,cAAc,SAAS,WAAW,QAAQ,KAAK;EAC/C,GAAI;GACJ"}
|
|
1
|
+
{"version":3,"file":"date-time.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/date-time.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { format } from \"date-fns\";\nimport type { ComponentProps } from \"react\";\nimport { DateTimeInput } from \"@/components/ui/input-date-time.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineDateTimeInput<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n variant,\n className,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof DateTimeInput> &\n useInlineEditOptions<Date, Required> &\n InlineEditVariantsProps) {\n const { value, handleChange, handleBlur, status, isAllowed } = useInlineEdit<\n string,\n Date,\n Required\n >({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) =>\n (value instanceof Date\n ? format(value, \"yyyy-MM-dd'T'HH:mm\")\n : typeof value === \"string\"\n ? value\n : undefined) as string,\n encode: (value) => (value ? new Date(value) : null) as Date,\n },\n });\n\n return (\n <DateTimeInput\n value={value ?? undefined}\n className={cn(inlineEditVariants({ variant, status }), className)}\n disabled={disabled || !isAllowed}\n onValueChange={(date) => handleChange(date ?? null)}\n onValueBlur={(date) => handleBlur(date ?? null)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AASA,SAAgB,oBAAsD,EACpE,cACA,QACA,YACA,SACA,WACA,gBACA,YACA,UACA,GAAG,SAGsB;CACzB,MAAM,EAAE,OAAO,cAAc,YAAY,QAAQ,cAAc,cAI7D;EACA;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UACN,iBAAiB,OACd,OAAO,OAAO,qBAAqB,GACnC,OAAO,UAAU,WACf,QACA;GACR,SAAS,UAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;GAC/C;EACF,CAAC;AAEF,QACE,oBAAC;EACC,OAAO,SAAS;EAChB,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;EACjE,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS,aAAa,QAAQ,KAAK;EACnD,cAAc,SAAS,WAAW,QAAQ,KAAK;EAC/C,GAAI;GACJ"}
|
|
@@ -37,12 +37,12 @@ function InlineStringInputToggle({ initialValue, action, disabled, permission, u
|
|
|
37
37
|
disabled: isDisabled,
|
|
38
38
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
39
39
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
40
|
-
className: cn("border-border/70 hover:border-border
|
|
40
|
+
className: cn("w-full border-border/70 hover:border-border", className)
|
|
41
41
|
}), /* @__PURE__ */ jsx(Button, {
|
|
42
42
|
variant: "ghost",
|
|
43
43
|
onClick: handleToggle,
|
|
44
44
|
tabIndex: -1,
|
|
45
|
-
className: cn("absolute
|
|
45
|
+
className: cn("absolute top-0 right-0 bottom-0 opacity-50", !value && "text-muted-foreground"),
|
|
46
46
|
children: enabled ? /* @__PURE__ */ jsx(CheckIcon, {}) : /* @__PURE__ */ jsx(XIcon, {})
|
|
47
47
|
})]
|
|
48
48
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"border-border/70 hover:border-border
|
|
1
|
+
{"version":3,"file":"input-toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input-toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport { CheckIcon, XIcon } from \"lucide-react\";\nimport { type ComponentProps, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/entry\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\ntype InlineStringInputToggleProps<Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<string, Required>;\n\nexport function InlineStringInputToggle<Required extends boolean>({\n initialValue,\n action,\n disabled,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineStringInputToggleProps<Required>) {\n const [enabled, setEnabled] = useState(!!initialValue);\n\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n function handleToggle() {\n setEnabled(!enabled);\n if (!enabled) return;\n\n handleBlur(null);\n }\n\n const isDisabled = !enabled || disabled || !isAllowed;\n\n return (\n <div className=\"relative\">\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={isDisabled}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\"w-full border-border/70 hover:border-border\", className)}\n />\n\n <Button\n variant=\"ghost\"\n onClick={handleToggle}\n tabIndex={-1}\n className={cn(\n \"absolute top-0 right-0 bottom-0 opacity-50\",\n !value && \"text-muted-foreground\",\n )}\n >\n {enabled ? <CheckIcon /> : <XIcon />}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,wBAAkD,EAChE,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SACsC;CACzC,MAAM,CAAC,SAAS,cAAc,SAAS,CAAC,CAAC,aAAa;CAEtD,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;CAEF,SAAS,eAAe;AACtB,aAAW,CAAC,QAAQ;AACpB,MAAI,CAAC,QAAS;AAEd,aAAW,KAAK;;CAGlB,MAAM,aAAa,CAAC,WAAW,YAAY,CAAC;AAE5C,QACE,qBAAC;EAAI,WAAU;aACb,oBAAC;GACC,GAAI;GACJ,MAAK;GACL,OAAO,SAAS;GAChB,UAAU;GACV,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;GACjE,WAAW,GAAG,+CAA+C,UAAU;IACvE,EAEF,oBAAC;GACC,SAAQ;GACR,SAAS;GACT,UAAU;GACV,WAAW,GACT,8CACA,CAAC,SAAS,wBACX;aAEA,UAAU,oBAAC,cAAY,GAAG,oBAAC,UAAQ;IAC7B;GACL"}
|
|
@@ -29,7 +29,7 @@ function InlineStringInput({ initialValue, action, variant, className, permissio
|
|
|
29
29
|
disabled: disabled || !isAllowed,
|
|
30
30
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
31
31
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
32
|
-
className: cn("border-border/70 hover:border-border
|
|
32
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
33
33
|
variant,
|
|
34
34
|
status
|
|
35
35
|
}), className)
|
|
@@ -58,7 +58,7 @@ function InlineNumberInput({ initialValue, action, variant, className, permissio
|
|
|
58
58
|
disabled: disabled || !isAllowed,
|
|
59
59
|
onChange: (e) => handleChange(parseValueAsNumber(e.target.valueAsNumber)),
|
|
60
60
|
onBlur: (e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber)),
|
|
61
|
-
className: cn("border-border/70 hover:border-border
|
|
61
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
62
62
|
variant,
|
|
63
63
|
status
|
|
64
64
|
}), className)
|
|
@@ -86,7 +86,7 @@ function InlineDecimalInput({ initialValue, action, variant, className, permissi
|
|
|
86
86
|
disabled: disabled || !isAllowed,
|
|
87
87
|
onChange: (e) => handleChange(e.target.value ? e.target.value : null),
|
|
88
88
|
onBlur: (e) => handleBlur(e.target.value ? e.target.value : null),
|
|
89
|
-
className: cn("border-border/70 hover:border-border
|
|
89
|
+
className: cn("w-full border-border/70 hover:border-border", inlineEditVariants({
|
|
90
90
|
variant,
|
|
91
91
|
status
|
|
92
92
|
}), className)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"border-border/70 hover:border-border
|
|
1
|
+
{"version":3,"file":"input.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/input.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\ntype InlineEditInputProps<TValue, Required extends boolean = false> = Omit<\n ComponentProps<typeof Input>,\n \"type\"\n> &\n useInlineEditOptions<TValue, Required> &\n InlineEditVariantsProps;\n\n/**\n * The inline edit string input component.\n */\nexport function InlineStringInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"text\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit number input component.\n */\nconst parseValueAsNumber = (valueAsNumber: number): number | null =>\n !Number.isNaN(Number(valueAsNumber)) ? valueAsNumber : null;\n\nexport function InlineNumberInput<Required extends boolean = false>({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<number, Required>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(parseValueAsNumber(e.target.valueAsNumber))}\n onBlur={(e) => handleBlur(parseValueAsNumber(e.target.valueAsNumber))}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n\n/**\n * The inline edit decimal input component.\n */\nexport function InlineDecimalInput({\n initialValue,\n action,\n variant,\n className,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: InlineEditInputProps<string>) {\n const { value, handleChange, handleBlur, isAllowed, status } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Input\n {...props}\n type=\"number\"\n value={value ?? undefined}\n disabled={disabled || !isAllowed}\n onChange={(e) => handleChange(e.target.value ? e.target.value : null)}\n onBlur={(e) => handleBlur(e.target.value ? e.target.value : null)}\n className={cn(\n \"w-full border-border/70 hover:border-border\",\n inlineEditVariants({ variant, status }),\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,MAAM,sBAAsB,kBAC1B,CAAC,OAAO,MAAM,OAAO,cAAc,CAAC,GAAG,gBAAgB;AAEzD,SAAgB,kBAAoD,EAClE,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SACsC;CACzC,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACzE,SAAS,MAAM,WAAW,mBAAmB,EAAE,OAAO,cAAc,CAAC;EACrE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD;;;;;AAON,SAAgB,mBAAmB,EACjC,cACA,QACA,SACA,WACA,YACA,gBACA,YACA,UACA,GAAG,SAC4B;CAC/B,MAAM,EAAE,OAAO,cAAc,YAAY,WAAW,WAAW,cAAc;EAC3E;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,MAAK;EACL,OAAO,SAAS;EAChB,UAAU,YAAY,CAAC;EACvB,WAAW,MAAM,aAAa,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACrE,SAAS,MAAM,WAAW,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAAK;EACjE,WAAW,GACT,+CACA,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EACvC,UACD;GACD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../../components/ui/select.client.mjs";
|
|
1
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
2
3
|
import { InlineEditVariantsProps } from "../lib/variants.mjs";
|
|
3
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
+
import { ComponentProps } from "react";
|
|
5
6
|
|
|
6
7
|
//#region src/modules/inline-edit/components/select.client.d.ts
|
|
7
8
|
declare function InlineSelect<Required extends boolean = false>({
|
|
@@ -12,19 +13,15 @@ declare function InlineSelect<Required extends boolean = false>({
|
|
|
12
13
|
isRequired,
|
|
13
14
|
disabled,
|
|
14
15
|
...props
|
|
15
|
-
}:
|
|
16
|
-
type InlineSelectTriggerProps = SelectTriggerProps;
|
|
16
|
+
}: ComponentProps<typeof Select> & useInlineEditOptions<string, Required>): react_jsx_runtime0.JSX.Element;
|
|
17
17
|
declare function InlineSelectTrigger({
|
|
18
18
|
variant,
|
|
19
19
|
className,
|
|
20
20
|
...props
|
|
21
|
-
}:
|
|
22
|
-
|
|
23
|
-
declare function
|
|
24
|
-
|
|
25
|
-
declare function InlineSelectValue(props: InlineSelectValueProps): react_jsx_runtime0.JSX.Element;
|
|
26
|
-
type InlineSelectItenProps = SelectItemProps;
|
|
27
|
-
declare function InlineSelectItem(props: InlineSelectItenProps): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
}: ComponentProps<typeof SelectTrigger> & InlineEditVariantsProps): react_jsx_runtime0.JSX.Element;
|
|
22
|
+
declare function InlineSelectContent(props: ComponentProps<typeof SelectContent>): react_jsx_runtime0.JSX.Element;
|
|
23
|
+
declare function InlineSelectValue(props: ComponentProps<typeof SelectValue>): react_jsx_runtime0.JSX.Element;
|
|
24
|
+
declare function InlineSelectItem(props: ComponentProps<typeof SelectItem>): react_jsx_runtime0.JSX.Element;
|
|
28
25
|
//#endregion
|
|
29
|
-
export { InlineSelect, InlineSelectContent,
|
|
26
|
+
export { InlineSelect, InlineSelectContent, InlineSelectItem, InlineSelectTrigger, InlineSelectValue };
|
|
30
27
|
//# sourceMappingURL=select.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"mappings":";;;;;;;iBAegB,YAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,MAAA,IAAU,oBAAA,SAA6B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBA0BzD,mBAAA,CAAA;EACd,OAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,aAAA,IAAiB,uBAAA,GAAuB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAQjD,mBAAA,CAAoB,KAAA,EAAO,cAAA,QAAsB,aAAA,IAAc,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAI/D,iBAAA,CAAkB,KAAA,EAAO,cAAA,QAAsB,WAAA,IAAY,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAI3D,gBAAA,CAAiB,KAAA,EAAO,cAAA,QAAsB,UAAA,IAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type {
|
|
1
|
+
{"version":3,"file":"select.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/select.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport {\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@/components/ui/select.client\";\nimport { useIndicator } from \"@/lib/entry.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\nimport { type InlineEditVariantsProps, inlineEditVariants } from \"../lib/variants\";\n\nexport function InlineSelect<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Select> & useInlineEditOptions<string, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Select\n {...props}\n disabled={disabled || !isAllowed}\n defaultValue={value ?? undefined}\n onValueChange={(value) => {\n handleChange(value ? value : null);\n handleBlur(value ? value : null);\n }}\n />\n );\n}\n\nexport function InlineSelectTrigger({\n variant,\n className,\n ...props\n}: ComponentProps<typeof SelectTrigger> & InlineEditVariantsProps) {\n const { status } = useIndicator();\n\n return (\n <SelectTrigger {...props} className={cn(inlineEditVariants({ variant, status }), className)} />\n );\n}\n\nexport function InlineSelectContent(props: ComponentProps<typeof SelectContent>) {\n return <SelectContent {...props} />;\n}\n\nexport function InlineSelectValue(props: ComponentProps<typeof SelectValue>) {\n return <SelectValue {...props} />;\n}\n\nexport function InlineSelectItem(props: ComponentProps<typeof SelectItem>) {\n return <SelectItem {...props} />;\n}\n"],"mappings":";;;;;;;;;;AAeA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACsE;CACzE,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,UAAU,YAAY,CAAC;EACvB,cAAc,SAAS;EACvB,gBAAgB,UAAU;AACxB,gBAAa,QAAQ,QAAQ,KAAK;AAClC,cAAW,QAAQ,QAAQ,KAAK;;GAElC;;AAIN,SAAgB,oBAAoB,EAClC,SACA,WACA,GAAG,SAC8D;CACjE,MAAM,EAAE,WAAW,cAAc;AAEjC,QACE,oBAAC;EAAc,GAAI;EAAO,WAAW,GAAG,mBAAmB;GAAE;GAAS;GAAQ,CAAC,EAAE,UAAU;GAAI;;AAInG,SAAgB,oBAAoB,OAA6C;AAC/E,QAAO,oBAAC,iBAAc,GAAI,QAAS;;AAGrC,SAAgB,kBAAkB,OAA2C;AAC3E,QAAO,oBAAC,eAAY,GAAI,QAAS;;AAGnC,SAAgB,iBAAiB,OAA0C;AACzE,QAAO,oBAAC,cAAW,GAAI,QAAS"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { Switch } from "../../../components/ui/switch.client.mjs";
|
|
1
2
|
import { useInlineEditOptions } from "../hooks/use-inline.client.mjs";
|
|
2
3
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
+
import { ComponentProps } from "react";
|
|
4
5
|
|
|
5
6
|
//#region src/modules/inline-edit/components/switch.client.d.ts
|
|
6
7
|
declare function InlineSwitch<Required extends boolean = false>({
|
|
@@ -11,7 +12,7 @@ declare function InlineSwitch<Required extends boolean = false>({
|
|
|
11
12
|
isRequired,
|
|
12
13
|
disabled,
|
|
13
14
|
...props
|
|
14
|
-
}:
|
|
15
|
+
}: ComponentProps<typeof Switch> & useInlineEditOptions<boolean, Required>): react_jsx_runtime0.JSX.Element;
|
|
15
16
|
//#endregion
|
|
16
17
|
export { InlineSwitch };
|
|
17
18
|
//# sourceMappingURL=switch.client.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"switch.client.d.mts","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"mappings":";;;;;;iBAMgB,YAAA,kCAAA,CAAA;EACd,YAAA;EACA,MAAA;EACA,UAAA;EACA,cAAA;EACA,UAAA;EACA,QAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,MAAA,IAAU,oBAAA,UAA8B,QAAA,IAAS,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type {
|
|
1
|
+
{"version":3,"file":"switch.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/switch.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { Switch } from \"@/components/ui/switch.client\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport function InlineSwitch<Required extends boolean = false>({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n disabled,\n ...props\n}: ComponentProps<typeof Switch> & useInlineEditOptions<boolean, Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <Switch\n {...props}\n disabled={disabled || !isAllowed}\n defaultChecked={value ?? undefined}\n onCheckedChange={(checked) => {\n handleChange(checked ?? null);\n handleBlur(checked ?? null);\n }}\n />\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,aAA+C,EAC7D,cACA,QACA,YACA,gBACA,YACA,UACA,GAAG,SACuE;CAC1E,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EACC,GAAI;EACJ,UAAU,YAAY,CAAC;EACvB,gBAAgB,SAAS;EACzB,kBAAkB,YAAY;AAC5B,gBAAa,WAAW,KAAK;AAC7B,cAAW,WAAW,KAAK;;GAE7B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "../../../lib/utils/cn.mjs";
|
|
4
|
-
import { Toggle } from "../../../components/ui/toggle.mjs";
|
|
4
|
+
import { Toggle } from "../../../components/ui/toggle.client.mjs";
|
|
5
5
|
import { useInlineEdit } from "../hooks/use-inline.client.mjs";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type React from \"react\";\nimport { Toggle } from \"@/components/ui/toggle\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineEditToggleProps<Required extends boolean = false> =\n React.HTMLAttributes<HTMLDivElement> & useInlineEditOptions<boolean, Required>;\n\nexport function InlineToggle<Required extends boolean = false>({\n initialValue,\n action,\n children,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineEditToggleProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <div {...props} className={cn(\"flex flex-wrap items-center justify-start gap-1\", className)}>\n <Toggle\n disabled={!isAllowed}\n variant=\"outline\"\n pressed={value ?? undefined}\n defaultChecked={initialValue ?? undefined}\n onPressedChange={(value) => {\n handleChange(value);\n handleBlur(value);\n }}\n >\n {children}\n </Toggle>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,aAA+C,EAC7D,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SAC+B;CAClC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mDAAmD,UAAU;YACzF,oBAAC;GACC,UAAU,CAAC;GACX,SAAQ;GACR,SAAS,SAAS;GAClB,gBAAgB,gBAAgB;GAChC,kBAAkB,UAAU;AAC1B,iBAAa,MAAM;AACnB,eAAW,MAAM;;GAGlB;IACM;GACL"}
|
|
1
|
+
{"version":3,"file":"toggle.client.mjs","names":[],"sources":["../../../../src/modules/inline-edit/components/toggle.client.tsx"],"sourcesContent":["\"use client\";\n\nimport type React from \"react\";\nimport { Toggle } from \"@/components/ui/toggle.client\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { useInlineEdit, type useInlineEditOptions } from \"../hooks/use-inline.client\";\n\nexport type InlineEditToggleProps<Required extends boolean = false> =\n React.HTMLAttributes<HTMLDivElement> & useInlineEditOptions<boolean, Required>;\n\nexport function InlineToggle<Required extends boolean = false>({\n initialValue,\n action,\n children,\n permission,\n updateStrategy,\n isRequired,\n className,\n ...props\n}: InlineEditToggleProps<Required>) {\n const { value, handleChange, handleBlur, isAllowed } = useInlineEdit({\n initialValue,\n action,\n permission,\n updateStrategy,\n isRequired,\n parser: {\n decode: (value) => value,\n encode: (value) => value,\n },\n });\n\n return (\n <div {...props} className={cn(\"flex flex-wrap items-center justify-start gap-1\", className)}>\n <Toggle\n disabled={!isAllowed}\n variant=\"outline\"\n pressed={value ?? undefined}\n defaultChecked={initialValue ?? undefined}\n onPressedChange={(value) => {\n handleChange(value);\n handleBlur(value);\n }}\n >\n {children}\n </Toggle>\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAUA,SAAgB,aAA+C,EAC7D,cACA,QACA,UACA,YACA,gBACA,YACA,WACA,GAAG,SAC+B;CAClC,MAAM,EAAE,OAAO,cAAc,YAAY,cAAc,cAAc;EACnE;EACA;EACA;EACA;EACA;EACA,QAAQ;GACN,SAAS,UAAU;GACnB,SAAS,UAAU;GACpB;EACF,CAAC;AAEF,QACE,oBAAC;EAAI,GAAI;EAAO,WAAW,GAAG,mDAAmD,UAAU;YACzF,oBAAC;GACC,UAAU,CAAC;GACX,SAAQ;GACR,SAAS,SAAS;GAClB,gBAAgB,gBAAgB;GAChC,kBAAkB,UAAU;AAC1B,iBAAa,MAAM;AACnB,eAAW,MAAM;;GAGlB;IACM;GACL"}
|