@iamsaroj/smart-ui 0.2.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/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/calendar-engine/agenda-view.d.ts +8 -0
- package/dist/calendar-engine/agenda-view.d.ts.map +1 -0
- package/dist/calendar-engine/agenda-view.js +26 -0
- package/dist/calendar-engine/agenda-view.js.map +1 -0
- package/dist/calendar-engine/booking.d.ts +13 -0
- package/dist/calendar-engine/booking.d.ts.map +1 -0
- package/dist/calendar-engine/booking.js +45 -0
- package/dist/calendar-engine/booking.js.map +1 -0
- package/dist/calendar-engine/calendar-utils.d.ts +74 -0
- package/dist/calendar-engine/calendar-utils.d.ts.map +1 -0
- package/dist/calendar-engine/calendar-utils.js +221 -0
- package/dist/calendar-engine/calendar-utils.js.map +1 -0
- package/dist/calendar-engine/calendar.d.ts +62 -0
- package/dist/calendar-engine/calendar.d.ts.map +1 -0
- package/dist/calendar-engine/calendar.js +81 -0
- package/dist/calendar-engine/calendar.js.map +1 -0
- package/dist/calendar-engine/event-color.d.ts +20 -0
- package/dist/calendar-engine/event-color.d.ts.map +1 -0
- package/dist/calendar-engine/event-color.js +59 -0
- package/dist/calendar-engine/event-color.js.map +1 -0
- package/dist/calendar-engine/index.d.ts +11 -0
- package/dist/calendar-engine/index.d.ts.map +1 -0
- package/dist/calendar-engine/index.js +6 -0
- package/dist/calendar-engine/index.js.map +1 -0
- package/dist/calendar-engine/month-view.d.ts +10 -0
- package/dist/calendar-engine/month-view.d.ts.map +1 -0
- package/dist/calendar-engine/month-view.js +72 -0
- package/dist/calendar-engine/month-view.js.map +1 -0
- package/dist/calendar-engine/recurrence.d.ts +47 -0
- package/dist/calendar-engine/recurrence.d.ts.map +1 -0
- package/dist/calendar-engine/recurrence.js +209 -0
- package/dist/calendar-engine/recurrence.js.map +1 -0
- package/dist/calendar-engine/shared.d.ts +72 -0
- package/dist/calendar-engine/shared.d.ts.map +1 -0
- package/dist/calendar-engine/shared.js +34 -0
- package/dist/calendar-engine/shared.js.map +1 -0
- package/dist/calendar-engine/time-grid-view.d.ts +13 -0
- package/dist/calendar-engine/time-grid-view.d.ts.map +1 -0
- package/dist/calendar-engine/time-grid-view.js +203 -0
- package/dist/calendar-engine/time-grid-view.js.map +1 -0
- package/dist/calendar-engine/types.d.ts +138 -0
- package/dist/calendar-engine/types.d.ts.map +1 -0
- package/dist/calendar-engine/types.js +2 -0
- package/dist/calendar-engine/types.js.map +1 -0
- package/dist/calendar-engine/use-calendar.d.ts +7 -0
- package/dist/calendar-engine/use-calendar.d.ts.map +1 -0
- package/dist/calendar-engine/use-calendar.js +25 -0
- package/dist/calendar-engine/use-calendar.js.map +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +19 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +18 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +20 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +7 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +11 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +8 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +23 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +34 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +77 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +12 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +29 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +94 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +45 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +133 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +35 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +45 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +20 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +30 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +22 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +12 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +44 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +33 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +29 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +18 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +18 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +14 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +15 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +30 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +22 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +19 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +46 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +12 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +16 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +6 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +5 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.d.ts +30 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +24 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +12 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +18 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +18 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +12 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +8 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +10 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +9 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +8 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +16 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +6 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +15 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +18 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +64 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +224 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +13 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +25 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +23 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +11 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +25 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/data-grid/action-column-cell.d.ts +41 -0
- package/dist/data-grid/action-column-cell.d.ts.map +1 -0
- package/dist/data-grid/action-column-cell.js +114 -0
- package/dist/data-grid/action-column-cell.js.map +1 -0
- package/dist/data-grid/action-column.d.ts +144 -0
- package/dist/data-grid/action-column.d.ts.map +1 -0
- package/dist/data-grid/action-column.js +156 -0
- package/dist/data-grid/action-column.js.map +1 -0
- package/dist/data-grid/create-page-fetcher.d.ts +57 -0
- package/dist/data-grid/create-page-fetcher.d.ts.map +1 -0
- package/dist/data-grid/create-page-fetcher.js +41 -0
- package/dist/data-grid/create-page-fetcher.js.map +1 -0
- package/dist/data-grid/data-grid.d.ts +65 -0
- package/dist/data-grid/data-grid.d.ts.map +1 -0
- package/dist/data-grid/data-grid.js +95 -0
- package/dist/data-grid/data-grid.js.map +1 -0
- package/dist/data-grid/empty-state.d.ts +13 -0
- package/dist/data-grid/empty-state.d.ts.map +1 -0
- package/dist/data-grid/empty-state.js +6 -0
- package/dist/data-grid/empty-state.js.map +1 -0
- package/dist/data-grid/formula-guard.d.ts +22 -0
- package/dist/data-grid/formula-guard.d.ts.map +1 -0
- package/dist/data-grid/formula-guard.js +28 -0
- package/dist/data-grid/formula-guard.js.map +1 -0
- package/dist/data-grid/grid-internals.d.ts +16 -0
- package/dist/data-grid/grid-internals.d.ts.map +1 -0
- package/dist/data-grid/grid-internals.js +73 -0
- package/dist/data-grid/grid-internals.js.map +1 -0
- package/dist/data-grid/grid-theme.d.ts +8 -0
- package/dist/data-grid/grid-theme.d.ts.map +1 -0
- package/dist/data-grid/grid-theme.js +23 -0
- package/dist/data-grid/grid-theme.js.map +1 -0
- package/dist/data-grid/grid-toolbar.d.ts +40 -0
- package/dist/data-grid/grid-toolbar.d.ts.map +1 -0
- package/dist/data-grid/grid-toolbar.js +13 -0
- package/dist/data-grid/grid-toolbar.js.map +1 -0
- package/dist/data-grid/index.d.ts +10 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +9 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/data-grid/pagination.d.ts +146 -0
- package/dist/data-grid/pagination.d.ts.map +1 -0
- package/dist/data-grid/pagination.js +128 -0
- package/dist/data-grid/pagination.js.map +1 -0
- package/dist/data-grid/server-data-grid.d.ts +109 -0
- package/dist/data-grid/server-data-grid.d.ts.map +1 -0
- package/dist/data-grid/server-data-grid.js +240 -0
- package/dist/data-grid/server-data-grid.js.map +1 -0
- package/dist/data-grid/server-grid-internals.d.ts +79 -0
- package/dist/data-grid/server-grid-internals.d.ts.map +1 -0
- package/dist/data-grid/server-grid-internals.js +137 -0
- package/dist/data-grid/server-grid-internals.js.map +1 -0
- package/dist/data-grid/use-action-column.d.ts +22 -0
- package/dist/data-grid/use-action-column.d.ts.map +1 -0
- package/dist/data-grid/use-action-column.js +63 -0
- package/dist/data-grid/use-action-column.js.map +1 -0
- package/dist/data-grid/use-server-grid-selection.d.ts +35 -0
- package/dist/data-grid/use-server-grid-selection.d.ts.map +1 -0
- package/dist/data-grid/use-server-grid-selection.js +81 -0
- package/dist/data-grid/use-server-grid-selection.js.map +1 -0
- package/dist/form-engine/base.d.ts +19 -0
- package/dist/form-engine/base.d.ts.map +1 -0
- package/dist/form-engine/base.js +2 -0
- package/dist/form-engine/base.js.map +1 -0
- package/dist/form-engine/field-registry.d.ts +285 -0
- package/dist/form-engine/field-registry.d.ts.map +1 -0
- package/dist/form-engine/field-registry.js +306 -0
- package/dist/form-engine/field-registry.js.map +1 -0
- package/dist/form-engine/field-types.d.ts +201 -0
- package/dist/form-engine/field-types.d.ts.map +1 -0
- package/dist/form-engine/field-types.js +14 -0
- package/dist/form-engine/field-types.js.map +1 -0
- package/dist/form-engine/index.d.ts +20 -0
- package/dist/form-engine/index.d.ts.map +1 -0
- package/dist/form-engine/index.js +21 -0
- package/dist/form-engine/index.js.map +1 -0
- package/dist/form-engine/smart-checkbox-field.d.ts +5 -0
- package/dist/form-engine/smart-checkbox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-field.js +9 -0
- package/dist/form-engine/smart-checkbox-field.js.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts +10 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.js +5 -0
- package/dist/form-engine/smart-checkbox-group-field.js.map +1 -0
- package/dist/form-engine/smart-combobox-field.d.ts +11 -0
- package/dist/form-engine/smart-combobox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-combobox-field.js +5 -0
- package/dist/form-engine/smart-combobox-field.js.map +1 -0
- package/dist/form-engine/smart-date-field.d.ts +8 -0
- package/dist/form-engine/smart-date-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-field.js +17 -0
- package/dist/form-engine/smart-date-field.js.map +1 -0
- package/dist/form-engine/smart-date-range-field.d.ts +15 -0
- package/dist/form-engine/smart-date-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-range-field.js +25 -0
- package/dist/form-engine/smart-date-range-field.js.map +1 -0
- package/dist/form-engine/smart-datetime-field.d.ts +12 -0
- package/dist/form-engine/smart-datetime-field.d.ts.map +1 -0
- package/dist/form-engine/smart-datetime-field.js +12 -0
- package/dist/form-engine/smart-datetime-field.js.map +1 -0
- package/dist/form-engine/smart-form-internals.d.ts +14 -0
- package/dist/form-engine/smart-form-internals.d.ts.map +1 -0
- package/dist/form-engine/smart-form-internals.js +64 -0
- package/dist/form-engine/smart-form-internals.js.map +1 -0
- package/dist/form-engine/smart-form.d.ts +55 -0
- package/dist/form-engine/smart-form.d.ts.map +1 -0
- package/dist/form-engine/smart-form.js +229 -0
- package/dist/form-engine/smart-form.js.map +1 -0
- package/dist/form-engine/smart-input-field.d.ts +9 -0
- package/dist/form-engine/smart-input-field.d.ts.map +1 -0
- package/dist/form-engine/smart-input-field.js +5 -0
- package/dist/form-engine/smart-input-field.js.map +1 -0
- package/dist/form-engine/smart-month-field.d.ts +8 -0
- package/dist/form-engine/smart-month-field.d.ts.map +1 -0
- package/dist/form-engine/smart-month-field.js +12 -0
- package/dist/form-engine/smart-month-field.js.map +1 -0
- package/dist/form-engine/smart-multi-select-field.d.ts +11 -0
- package/dist/form-engine/smart-multi-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-multi-select-field.js +5 -0
- package/dist/form-engine/smart-multi-select-field.js.map +1 -0
- package/dist/form-engine/smart-number-field.d.ts +22 -0
- package/dist/form-engine/smart-number-field.d.ts.map +1 -0
- package/dist/form-engine/smart-number-field.js +115 -0
- package/dist/form-engine/smart-number-field.js.map +1 -0
- package/dist/form-engine/smart-password-field.d.ts +7 -0
- package/dist/form-engine/smart-password-field.d.ts.map +1 -0
- package/dist/form-engine/smart-password-field.js +5 -0
- package/dist/form-engine/smart-password-field.js.map +1 -0
- package/dist/form-engine/smart-radio-group-field.d.ts +10 -0
- package/dist/form-engine/smart-radio-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-radio-group-field.js +5 -0
- package/dist/form-engine/smart-radio-group-field.js.map +1 -0
- package/dist/form-engine/smart-segmented-field.d.ts +9 -0
- package/dist/form-engine/smart-segmented-field.d.ts.map +1 -0
- package/dist/form-engine/smart-segmented-field.js +5 -0
- package/dist/form-engine/smart-segmented-field.js.map +1 -0
- package/dist/form-engine/smart-select-field.d.ts +10 -0
- package/dist/form-engine/smart-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-select-field.js +5 -0
- package/dist/form-engine/smart-select-field.js.map +1 -0
- package/dist/form-engine/smart-slug-field.d.ts +12 -0
- package/dist/form-engine/smart-slug-field.d.ts.map +1 -0
- package/dist/form-engine/smart-slug-field.js +14 -0
- package/dist/form-engine/smart-slug-field.js.map +1 -0
- package/dist/form-engine/smart-switch-field.d.ts +5 -0
- package/dist/form-engine/smart-switch-field.d.ts.map +1 -0
- package/dist/form-engine/smart-switch-field.js +9 -0
- package/dist/form-engine/smart-switch-field.js.map +1 -0
- package/dist/form-engine/smart-tel-field.d.ts +7 -0
- package/dist/form-engine/smart-tel-field.d.ts.map +1 -0
- package/dist/form-engine/smart-tel-field.js +6 -0
- package/dist/form-engine/smart-tel-field.js.map +1 -0
- package/dist/form-engine/smart-text-editor-field.d.ts +15 -0
- package/dist/form-engine/smart-text-editor-field.d.ts.map +1 -0
- package/dist/form-engine/smart-text-editor-field.js +5 -0
- package/dist/form-engine/smart-text-editor-field.js.map +1 -0
- package/dist/form-engine/smart-textarea-field.d.ts +8 -0
- package/dist/form-engine/smart-textarea-field.d.ts.map +1 -0
- package/dist/form-engine/smart-textarea-field.js +5 -0
- package/dist/form-engine/smart-textarea-field.js.map +1 -0
- package/dist/form-engine/smart-time-field.d.ts +10 -0
- package/dist/form-engine/smart-time-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-field.js +5 -0
- package/dist/form-engine/smart-time-field.js.map +1 -0
- package/dist/form-engine/smart-time-range-field.d.ts +13 -0
- package/dist/form-engine/smart-time-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-range-field.js +5 -0
- package/dist/form-engine/smart-time-range-field.js.map +1 -0
- package/dist/form-engine/smart-year-field.d.ts +8 -0
- package/dist/form-engine/smart-year-field.d.ts.map +1 -0
- package/dist/form-engine/smart-year-field.js +5 -0
- package/dist/form-engine/smart-year-field.js.map +1 -0
- package/dist/form-engine/smart-yesno-field.d.ts +12 -0
- package/dist/form-engine/smart-yesno-field.d.ts.map +1 -0
- package/dist/form-engine/smart-yesno-field.js +14 -0
- package/dist/form-engine/smart-yesno-field.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +17 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts +61 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.js +145 -0
- package/dist/lexical-text-editor/SmartTextEditor.js.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts +3 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.js +25 -0
- package/dist/lexical-text-editor/editor-nodes.js.map +1 -0
- package/dist/lexical-text-editor/editor-theme.d.ts +3 -0
- package/dist/lexical-text-editor/editor-theme.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-theme.js +78 -0
- package/dist/lexical-text-editor/editor-theme.js.map +1 -0
- package/dist/lexical-text-editor/index.d.ts +8 -0
- package/dist/lexical-text-editor/index.d.ts.map +1 -0
- package/dist/lexical-text-editor/index.js +6 -0
- package/dist/lexical-text-editor/index.js.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts +41 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.js +89 -0
- package/dist/lexical-text-editor/nodes/image-node.js.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts +25 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js +84 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts +3 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js +12 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts +6 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js +14 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts +7 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts +20 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js +78 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts +36 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js +67 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts +14 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js +129 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js +87 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts +11 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts +39 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js +47 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts +9 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js +29 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts +30 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js +128 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js.map +1 -0
- package/dist/lexical-text-editor/sanitize.d.ts +24 -0
- package/dist/lexical-text-editor/sanitize.d.ts.map +1 -0
- package/dist/lexical-text-editor/sanitize.js +140 -0
- package/dist/lexical-text-editor/sanitize.js.map +1 -0
- package/dist/lib/format.d.ts +17 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +40 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/leading-space.d.ts +28 -0
- package/dist/lib/leading-space.d.ts.map +1 -0
- package/dist/lib/leading-space.js +34 -0
- package/dist/lib/leading-space.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +4 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/xlsx.d.ts +80 -0
- package/dist/lib/xlsx.d.ts.map +1 -0
- package/dist/lib/xlsx.js +377 -0
- package/dist/lib/xlsx.js.map +1 -0
- package/dist/search-engine/build-query.d.ts +29 -0
- package/dist/search-engine/build-query.d.ts.map +1 -0
- package/dist/search-engine/build-query.js +51 -0
- package/dist/search-engine/build-query.js.map +1 -0
- package/dist/search-engine/index.d.ts +15 -0
- package/dist/search-engine/index.d.ts.map +1 -0
- package/dist/search-engine/index.js +13 -0
- package/dist/search-engine/index.js.map +1 -0
- package/dist/search-engine/smart-search-form.d.ts +92 -0
- package/dist/search-engine/smart-search-form.d.ts.map +1 -0
- package/dist/search-engine/smart-search-form.js +136 -0
- package/dist/search-engine/smart-search-form.js.map +1 -0
- package/dist/search-engine/types.d.ts +40 -0
- package/dist/search-engine/types.d.ts.map +1 -0
- package/dist/search-engine/types.js +11 -0
- package/dist/search-engine/types.js.map +1 -0
- package/dist/smart-components/buttons/action-button.d.ts +66 -0
- package/dist/smart-components/buttons/action-button.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-button.js +79 -0
- package/dist/smart-components/buttons/action-button.js.map +1 -0
- package/dist/smart-components/buttons/action-buttons.d.ts +122 -0
- package/dist/smart-components/buttons/action-buttons.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-buttons.js +42 -0
- package/dist/smart-components/buttons/action-buttons.js.map +1 -0
- package/dist/smart-components/buttons/action-config.d.ts +181 -0
- package/dist/smart-components/buttons/action-config.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-config.js +128 -0
- package/dist/smart-components/buttons/action-config.js.map +1 -0
- package/dist/smart-components/buttons/index.d.ts +4 -0
- package/dist/smart-components/buttons/index.d.ts.map +1 -0
- package/dist/smart-components/buttons/index.js +7 -0
- package/dist/smart-components/buttons/index.js.map +1 -0
- package/dist/smart-components/loading-overlay.d.ts +16 -0
- package/dist/smart-components/loading-overlay.d.ts.map +1 -0
- package/dist/smart-components/loading-overlay.js +13 -0
- package/dist/smart-components/loading-overlay.js.map +1 -0
- package/dist/smart-components/page/index.d.ts +19 -0
- package/dist/smart-components/page/index.d.ts.map +1 -0
- package/dist/smart-components/page/index.js +33 -0
- package/dist/smart-components/page/index.js.map +1 -0
- package/dist/smart-components/page/layouts/page-states.d.ts +17 -0
- package/dist/smart-components/page/layouts/page-states.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/page-states.js +12 -0
- package/dist/smart-components/page/layouts/page-states.js.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts +21 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.js +2 -0
- package/dist/smart-components/page/layouts/slot-buckets.js.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts +13 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.js +14 -0
- package/dist/smart-components/page/layouts/split-layout.js.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts +18 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.js +61 -0
- package/dist/smart-components/page/layouts/standard-layout.js.map +1 -0
- package/dist/smart-components/page/page-context.d.ts +51 -0
- package/dist/smart-components/page/page-context.d.ts.map +1 -0
- package/dist/smart-components/page/page-context.js +21 -0
- package/dist/smart-components/page/page-context.js.map +1 -0
- package/dist/smart-components/page/slot.d.ts +19 -0
- package/dist/smart-components/page/slot.d.ts.map +1 -0
- package/dist/smart-components/page/slot.js +18 -0
- package/dist/smart-components/page/slot.js.map +1 -0
- package/dist/smart-components/page/smart-grid-area.d.ts +75 -0
- package/dist/smart-components/page/smart-grid-area.d.ts.map +1 -0
- package/dist/smart-components/page/smart-grid-area.js +61 -0
- package/dist/smart-components/page/smart-grid-area.js.map +1 -0
- package/dist/smart-components/page/smart-page-container.d.ts +66 -0
- package/dist/smart-components/page/smart-page-container.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-container.js +93 -0
- package/dist/smart-components/page/smart-page-container.js.map +1 -0
- package/dist/smart-components/page/smart-page-content.d.ts +70 -0
- package/dist/smart-components/page/smart-page-content.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-content.js +78 -0
- package/dist/smart-components/page/smart-page-content.js.map +1 -0
- package/dist/smart-components/page/smart-page-empty.d.ts +47 -0
- package/dist/smart-components/page/smart-page-empty.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-empty.js +37 -0
- package/dist/smart-components/page/smart-page-empty.js.map +1 -0
- package/dist/smart-components/page/smart-page-error.d.ts +59 -0
- package/dist/smart-components/page/smart-page-error.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-error.js +45 -0
- package/dist/smart-components/page/smart-page-error.js.map +1 -0
- package/dist/smart-components/page/smart-page-filters.d.ts +38 -0
- package/dist/smart-components/page/smart-page-filters.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-filters.js +33 -0
- package/dist/smart-components/page/smart-page-filters.js.map +1 -0
- package/dist/smart-components/page/smart-page-footer.d.ts +49 -0
- package/dist/smart-components/page/smart-page-footer.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-footer.js +49 -0
- package/dist/smart-components/page/smart-page-footer.js.map +1 -0
- package/dist/smart-components/page/smart-page-header.d.ts +145 -0
- package/dist/smart-components/page/smart-page-header.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-header.js +129 -0
- package/dist/smart-components/page/smart-page-header.js.map +1 -0
- package/dist/smart-components/page/smart-page-hero.d.ts +43 -0
- package/dist/smart-components/page/smart-page-hero.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-hero.js +42 -0
- package/dist/smart-components/page/smart-page-hero.js.map +1 -0
- package/dist/smart-components/page/smart-page-loading.d.ts +31 -0
- package/dist/smart-components/page/smart-page-loading.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-loading.js +29 -0
- package/dist/smart-components/page/smart-page-loading.js.map +1 -0
- package/dist/smart-components/page/smart-page-search.d.ts +39 -0
- package/dist/smart-components/page/smart-page-search.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-search.js +38 -0
- package/dist/smart-components/page/smart-page-search.js.map +1 -0
- package/dist/smart-components/page/smart-page-section.d.ts +55 -0
- package/dist/smart-components/page/smart-page-section.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-section.js +41 -0
- package/dist/smart-components/page/smart-page-section.js.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts +34 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.js +33 -0
- package/dist/smart-components/page/smart-page-status-bar.js.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts +93 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.js +87 -0
- package/dist/smart-components/page/smart-page-tabs.js.map +1 -0
- package/dist/smart-components/page/smart-page.d.ts +141 -0
- package/dist/smart-components/page/smart-page.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page.js +295 -0
- package/dist/smart-components/page/smart-page.js.map +1 -0
- package/dist/smart-components/page/smart-sidebar.d.ts +70 -0
- package/dist/smart-components/page/smart-sidebar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-sidebar.js +54 -0
- package/dist/smart-components/page/smart-sidebar.js.map +1 -0
- package/dist/smart-components/page/smart-toolbar.d.ts +40 -0
- package/dist/smart-components/page/smart-toolbar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-toolbar.js +39 -0
- package/dist/smart-components/page/smart-toolbar.js.map +1 -0
- package/dist/smart-components/search-input.d.ts +20 -0
- package/dist/smart-components/search-input.d.ts.map +1 -0
- package/dist/smart-components/search-input.js +12 -0
- package/dist/smart-components/search-input.js.map +1 -0
- package/dist/smart-components/smart-accordion.d.ts +53 -0
- package/dist/smart-components/smart-accordion.d.ts.map +1 -0
- package/dist/smart-components/smart-accordion.js +33 -0
- package/dist/smart-components/smart-accordion.js.map +1 -0
- package/dist/smart-components/smart-alert.d.ts +44 -0
- package/dist/smart-components/smart-alert.d.ts.map +1 -0
- package/dist/smart-components/smart-alert.js +27 -0
- package/dist/smart-components/smart-alert.js.map +1 -0
- package/dist/smart-components/smart-avatar.d.ts +3 -0
- package/dist/smart-components/smart-avatar.d.ts.map +1 -0
- package/dist/smart-components/smart-avatar.js +4 -0
- package/dist/smart-components/smart-avatar.js.map +1 -0
- package/dist/smart-components/smart-badge.d.ts +28 -0
- package/dist/smart-components/smart-badge.d.ts.map +1 -0
- package/dist/smart-components/smart-badge.js +24 -0
- package/dist/smart-components/smart-badge.js.map +1 -0
- package/dist/smart-components/smart-breadcrumb.d.ts +43 -0
- package/dist/smart-components/smart-breadcrumb.d.ts.map +1 -0
- package/dist/smart-components/smart-breadcrumb.js +37 -0
- package/dist/smart-components/smart-breadcrumb.js.map +1 -0
- package/dist/smart-components/smart-button.d.ts +22 -0
- package/dist/smart-components/smart-button.d.ts.map +1 -0
- package/dist/smart-components/smart-button.js +15 -0
- package/dist/smart-components/smart-button.js.map +1 -0
- package/dist/smart-components/smart-calendar.d.ts +78 -0
- package/dist/smart-components/smart-calendar.d.ts.map +1 -0
- package/dist/smart-components/smart-calendar.js +45 -0
- package/dist/smart-components/smart-calendar.js.map +1 -0
- package/dist/smart-components/smart-card.d.ts +55 -0
- package/dist/smart-components/smart-card.d.ts.map +1 -0
- package/dist/smart-components/smart-card.js +37 -0
- package/dist/smart-components/smart-card.js.map +1 -0
- package/dist/smart-components/smart-checkbox-group.d.ts +48 -0
- package/dist/smart-components/smart-checkbox-group.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox-group.js +48 -0
- package/dist/smart-components/smart-checkbox-group.js.map +1 -0
- package/dist/smart-components/smart-checkbox.d.ts +34 -0
- package/dist/smart-components/smart-checkbox.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox.js +34 -0
- package/dist/smart-components/smart-checkbox.js.map +1 -0
- package/dist/smart-components/smart-combobox.d.ts +36 -0
- package/dist/smart-components/smart-combobox.d.ts.map +1 -0
- package/dist/smart-components/smart-combobox.js +32 -0
- package/dist/smart-components/smart-combobox.js.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts +63 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.js +45 -0
- package/dist/smart-components/smart-confirm-dialog.js.map +1 -0
- package/dist/smart-components/smart-context-menu.d.ts +58 -0
- package/dist/smart-components/smart-context-menu.d.ts.map +1 -0
- package/dist/smart-components/smart-context-menu.js +38 -0
- package/dist/smart-components/smart-context-menu.js.map +1 -0
- package/dist/smart-components/smart-date-picker.d.ts +99 -0
- package/dist/smart-components/smart-date-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-picker.js +78 -0
- package/dist/smart-components/smart-date-picker.js.map +1 -0
- package/dist/smart-components/smart-date-range-picker.d.ts +37 -0
- package/dist/smart-components/smart-date-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-range-picker.js +38 -0
- package/dist/smart-components/smart-date-range-picker.js.map +1 -0
- package/dist/smart-components/smart-dialog.d.ts +75 -0
- package/dist/smart-components/smart-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-dialog.js +61 -0
- package/dist/smart-components/smart-dialog.js.map +1 -0
- package/dist/smart-components/smart-drawer.d.ts +48 -0
- package/dist/smart-components/smart-drawer.d.ts.map +1 -0
- package/dist/smart-components/smart-drawer.js +32 -0
- package/dist/smart-components/smart-drawer.js.map +1 -0
- package/dist/smart-components/smart-field.d.ts +47 -0
- package/dist/smart-components/smart-field.d.ts.map +1 -0
- package/dist/smart-components/smart-field.js +44 -0
- package/dist/smart-components/smart-field.js.map +1 -0
- package/dist/smart-components/smart-input-group.d.ts +60 -0
- package/dist/smart-components/smart-input-group.d.ts.map +1 -0
- package/dist/smart-components/smart-input-group.js +40 -0
- package/dist/smart-components/smart-input-group.js.map +1 -0
- package/dist/smart-components/smart-input.d.ts +46 -0
- package/dist/smart-components/smart-input.d.ts.map +1 -0
- package/dist/smart-components/smart-input.js +36 -0
- package/dist/smart-components/smart-input.js.map +1 -0
- package/dist/smart-components/smart-label.d.ts +22 -0
- package/dist/smart-components/smart-label.d.ts.map +1 -0
- package/dist/smart-components/smart-label.js +17 -0
- package/dist/smart-components/smart-label.js.map +1 -0
- package/dist/smart-components/smart-month-picker.d.ts +30 -0
- package/dist/smart-components/smart-month-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-month-picker.js +53 -0
- package/dist/smart-components/smart-month-picker.js.map +1 -0
- package/dist/smart-components/smart-multi-select.d.ts +38 -0
- package/dist/smart-components/smart-multi-select.d.ts.map +1 -0
- package/dist/smart-components/smart-multi-select.js +56 -0
- package/dist/smart-components/smart-multi-select.js.map +1 -0
- package/dist/smart-components/smart-native-select.d.ts +45 -0
- package/dist/smart-components/smart-native-select.d.ts.map +1 -0
- package/dist/smart-components/smart-native-select.js +33 -0
- package/dist/smart-components/smart-native-select.js.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts +47 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.js +37 -0
- package/dist/smart-components/smart-nav-sidebar.js.map +1 -0
- package/dist/smart-components/smart-password-input.d.ts +31 -0
- package/dist/smart-components/smart-password-input.d.ts.map +1 -0
- package/dist/smart-components/smart-password-input.js +30 -0
- package/dist/smart-components/smart-password-input.js.map +1 -0
- package/dist/smart-components/smart-radio-group.d.ts +58 -0
- package/dist/smart-components/smart-radio-group.d.ts.map +1 -0
- package/dist/smart-components/smart-radio-group.js +49 -0
- package/dist/smart-components/smart-radio-group.js.map +1 -0
- package/dist/smart-components/smart-segmented.d.ts +33 -0
- package/dist/smart-components/smart-segmented.d.ts.map +1 -0
- package/dist/smart-components/smart-segmented.js +25 -0
- package/dist/smart-components/smart-segmented.js.map +1 -0
- package/dist/smart-components/smart-select.d.ts +71 -0
- package/dist/smart-components/smart-select.d.ts.map +1 -0
- package/dist/smart-components/smart-select.js +44 -0
- package/dist/smart-components/smart-select.js.map +1 -0
- package/dist/smart-components/smart-separator.d.ts +3 -0
- package/dist/smart-components/smart-separator.d.ts.map +1 -0
- package/dist/smart-components/smart-separator.js +4 -0
- package/dist/smart-components/smart-separator.js.map +1 -0
- package/dist/smart-components/smart-sheet.d.ts +79 -0
- package/dist/smart-components/smart-sheet.d.ts.map +1 -0
- package/dist/smart-components/smart-sheet.js +47 -0
- package/dist/smart-components/smart-sheet.js.map +1 -0
- package/dist/smart-components/smart-stat-card.d.ts +47 -0
- package/dist/smart-components/smart-stat-card.d.ts.map +1 -0
- package/dist/smart-components/smart-stat-card.js +35 -0
- package/dist/smart-components/smart-stat-card.js.map +1 -0
- package/dist/smart-components/smart-stepper.d.ts +24 -0
- package/dist/smart-components/smart-stepper.d.ts.map +1 -0
- package/dist/smart-components/smart-stepper.js +24 -0
- package/dist/smart-components/smart-stepper.js.map +1 -0
- package/dist/smart-components/smart-switch.d.ts +34 -0
- package/dist/smart-components/smart-switch.d.ts.map +1 -0
- package/dist/smart-components/smart-switch.js +34 -0
- package/dist/smart-components/smart-switch.js.map +1 -0
- package/dist/smart-components/smart-textarea.d.ts +38 -0
- package/dist/smart-components/smart-textarea.d.ts.map +1 -0
- package/dist/smart-components/smart-textarea.js +28 -0
- package/dist/smart-components/smart-textarea.js.map +1 -0
- package/dist/smart-components/smart-time-picker.d.ts +59 -0
- package/dist/smart-components/smart-time-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-picker.js +129 -0
- package/dist/smart-components/smart-time-picker.js.map +1 -0
- package/dist/smart-components/smart-time-range-picker.d.ts +39 -0
- package/dist/smart-components/smart-time-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-range-picker.js +26 -0
- package/dist/smart-components/smart-time-range-picker.js.map +1 -0
- package/dist/smart-components/smart-toaster.d.ts +10 -0
- package/dist/smart-components/smart-toaster.d.ts.map +1 -0
- package/dist/smart-components/smart-toaster.js +21 -0
- package/dist/smart-components/smart-toaster.js.map +1 -0
- package/dist/smart-components/smart-year-picker.d.ts +29 -0
- package/dist/smart-components/smart-year-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-year-picker.js +43 -0
- package/dist/smart-components/smart-year-picker.js.map +1 -0
- package/dist/smart-components/spinner.d.ts +10 -0
- package/dist/smart-components/spinner.d.ts.map +1 -0
- package/dist/smart-components/spinner.js +5 -0
- package/dist/smart-components/spinner.js.map +1 -0
- package/dist/transfer-list-engine/index.d.ts +5 -0
- package/dist/transfer-list-engine/index.d.ts.map +1 -0
- package/dist/transfer-list-engine/index.js +3 -0
- package/dist/transfer-list-engine/index.js.map +1 -0
- package/dist/transfer-list-engine/transfer-list.d.ts +53 -0
- package/dist/transfer-list-engine/transfer-list.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-list.js +190 -0
- package/dist/transfer-list-engine/transfer-list.js.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts +30 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.js +69 -0
- package/dist/transfer-list-engine/transfer-utils.js.map +1 -0
- package/dist/transfer-list-engine/types.d.ts +51 -0
- package/dist/transfer-list-engine/types.d.ts.map +1 -0
- package/dist/transfer-list-engine/types.js +2 -0
- package/dist/transfer-list-engine/types.js.map +1 -0
- package/dist/tree-engine/index.d.ts +6 -0
- package/dist/tree-engine/index.d.ts.map +1 -0
- package/dist/tree-engine/index.js +3 -0
- package/dist/tree-engine/index.js.map +1 -0
- package/dist/tree-engine/tree-utils.d.ts +84 -0
- package/dist/tree-engine/tree-utils.d.ts.map +1 -0
- package/dist/tree-engine/tree-utils.js +271 -0
- package/dist/tree-engine/tree-utils.js.map +1 -0
- package/dist/tree-engine/tree.d.ts +98 -0
- package/dist/tree-engine/tree.d.ts.map +1 -0
- package/dist/tree-engine/tree.js +430 -0
- package/dist/tree-engine/tree.js.map +1 -0
- package/dist/tree-engine/types.d.ts +85 -0
- package/dist/tree-engine/types.d.ts.map +1 -0
- package/dist/tree-engine/types.js +2 -0
- package/dist/tree-engine/types.js.map +1 -0
- package/dist/tree-engine/use-tree.d.ts +12 -0
- package/dist/tree-engine/use-tree.d.ts.map +1 -0
- package/dist/tree-engine/use-tree.js +34 -0
- package/dist/tree-engine/use-tree.js.map +1 -0
- package/package.json +158 -0
- package/src/styles/globals.css +161 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogTitle, AlertDialogTrigger, } from "@iamsaroj/smart-ui/components/alert-dialog";
|
|
5
|
+
/**
|
|
6
|
+
* One-shot confirmation dialog for irreversible or high-stakes actions.
|
|
7
|
+
*
|
|
8
|
+
* Handles uncontrolled (trigger-driven) and controlled open state transparently.
|
|
9
|
+
* The confirm button calls `onConfirm` then closes; the cancel button closes only.
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // Delete confirmation
|
|
13
|
+
* <SmartConfirmDialog
|
|
14
|
+
* trigger={<Button variant="destructive" size="sm">Delete account</Button>}
|
|
15
|
+
* title="Delete account?"
|
|
16
|
+
* description="All data will be permanently erased. This cannot be undone."
|
|
17
|
+
* confirmLabel="Delete account"
|
|
18
|
+
* onConfirm={handleDelete}
|
|
19
|
+
* variant="destructive"
|
|
20
|
+
* />
|
|
21
|
+
*
|
|
22
|
+
* // Controlled (e.g. opened from a dropdown menu item)
|
|
23
|
+
* <SmartConfirmDialog
|
|
24
|
+
* open={confirmOpen}
|
|
25
|
+
* onOpenChange={setConfirmOpen}
|
|
26
|
+
* title="Remove member?"
|
|
27
|
+
* onConfirm={handleRemove}
|
|
28
|
+
* variant="destructive"
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const SmartConfirmDialog = ({ open: openProp, onOpenChange: onChangeProp, trigger, title = "Are you sure?", description, media, confirmLabel = "Confirm", cancelLabel = "Cancel", onConfirm, variant = "default", size = "sm", }) => {
|
|
33
|
+
const [local, setLocal] = React.useState(false);
|
|
34
|
+
// Support both controlled (openProp provided) and uncontrolled (internal state).
|
|
35
|
+
const open = openProp ?? local;
|
|
36
|
+
const setOpen = React.useCallback((val) => {
|
|
37
|
+
setLocal(val);
|
|
38
|
+
onChangeProp?.(val);
|
|
39
|
+
}, [onChangeProp]);
|
|
40
|
+
return (_jsxs(AlertDialog, { open: open, onOpenChange: setOpen, children: [trigger && _jsx(AlertDialogTrigger, { render: trigger }), _jsxs(AlertDialogContent, { size: size, children: [_jsxs(AlertDialogHeader, { children: [media && _jsx(AlertDialogMedia, { children: media }), _jsx(AlertDialogTitle, { children: title }), description && (_jsx(AlertDialogDescription, { children: description }))] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: cancelLabel }), _jsx(AlertDialogAction, { variant: variant === "destructive" ? "destructive" : "default", onClick: () => {
|
|
41
|
+
onConfirm?.();
|
|
42
|
+
setOpen(false);
|
|
43
|
+
}, children: confirmLabel })] })] })] }));
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=smart-confirm-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-confirm-dialog.js","sourceRoot":"","sources":["../../src/smart-components/smart-confirm-dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,4CAA4C,CAAA;AAoCnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,IAAI,EAAE,QAAQ,EACd,YAAY,EAAE,YAAY,EAC1B,OAAO,EACP,KAAK,GAAG,eAAe,EACvB,WAAW,EACX,KAAK,EACL,YAAY,GAAG,SAAS,EACxB,WAAW,GAAG,QAAQ,EACtB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,GACa,EAAE,EAAE;IAC5B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAE/C,iFAAiF;IACjF,MAAM,IAAI,GAAG,QAAQ,IAAI,KAAK,CAAA;IAE9B,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAC/B,CAAC,GAAY,EAAE,EAAE;QACf,QAAQ,CAAC,GAAG,CAAC,CAAA;QACb,YAAY,EAAE,CAAC,GAAG,CAAC,CAAA;IACrB,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAA;IAED,OAAO,CACL,MAAC,WAAW,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aAC3C,OAAO,IAAI,KAAC,kBAAkB,IAAC,MAAM,EAAE,OAAO,GAAI,EACnD,MAAC,kBAAkB,IAAC,IAAI,EAAE,IAAI,aAC5B,MAAC,iBAAiB,eACf,KAAK,IAAI,KAAC,gBAAgB,cAAE,KAAK,GAAoB,EACtD,KAAC,gBAAgB,cAAE,KAAK,GAAoB,EAC3C,WAAW,IAAI,CACd,KAAC,sBAAsB,cAAE,WAAW,GAA0B,CAC/D,IACiB,EACpB,MAAC,iBAAiB,eAChB,KAAC,iBAAiB,cAAE,WAAW,GAAqB,EACpD,KAAC,iBAAiB,IAChB,OAAO,EAAE,OAAO,KAAK,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAC9D,OAAO,EAAE,GAAG,EAAE;oCACZ,SAAS,EAAE,EAAE,CAAA;oCACb,OAAO,CAAC,KAAK,CAAC,CAAA;gCAChB,CAAC,YAEA,YAAY,GACK,IACF,IACD,IACT,CACf,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type SmartContextMenuSeparator = {
|
|
3
|
+
type: "separator";
|
|
4
|
+
};
|
|
5
|
+
export type SmartContextMenuLabel = {
|
|
6
|
+
type: "label";
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
export type SmartContextMenuAction = {
|
|
10
|
+
type?: "item";
|
|
11
|
+
label: string;
|
|
12
|
+
icon?: React.ReactNode;
|
|
13
|
+
shortcut?: string;
|
|
14
|
+
variant?: "default" | "destructive";
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
};
|
|
18
|
+
export type SmartContextMenuCheckbox = {
|
|
19
|
+
type: "checkbox";
|
|
20
|
+
label: string;
|
|
21
|
+
checked?: boolean;
|
|
22
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
shortcut?: string;
|
|
25
|
+
};
|
|
26
|
+
export type SmartContextMenuSub = {
|
|
27
|
+
type: "sub";
|
|
28
|
+
label: string;
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
items: SmartContextMenuItemConfig[];
|
|
32
|
+
};
|
|
33
|
+
export type SmartContextMenuItemConfig = SmartContextMenuSeparator | SmartContextMenuLabel | SmartContextMenuAction | SmartContextMenuCheckbox | SmartContextMenuSub;
|
|
34
|
+
export interface SmartContextMenuProps {
|
|
35
|
+
/** The element that the user right-clicks to open the menu. */
|
|
36
|
+
children: React.ReactNode;
|
|
37
|
+
/** Ordered list of menu items. */
|
|
38
|
+
items: SmartContextMenuItemConfig[];
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Data-driven context menu (right-click menu). Supports items, labels,
|
|
43
|
+
* separators, checkboxes, and recursive sub-menus via a typed config array.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* <SmartContextMenu
|
|
47
|
+
* items={[
|
|
48
|
+
* { label: "Edit", icon: <Pencil />, shortcut: "⌘E", onClick: onEdit },
|
|
49
|
+
* { type: "separator" },
|
|
50
|
+
* { label: "Delete", variant: "destructive", onClick: onDelete },
|
|
51
|
+
* ]}
|
|
52
|
+
* >
|
|
53
|
+
* <div className="rounded border p-4">Right-click me</div>
|
|
54
|
+
* </SmartContextMenu>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const SmartContextMenu: ({ children, items, className, }: SmartContextMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
//# sourceMappingURL=smart-context-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-context-menu.d.ts","sourceRoot":"","sources":["../../src/smart-components/smart-context-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,MAAM,MAAM,yBAAyB,GAAG;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAA;AAE7D,MAAM,MAAM,qBAAqB,GAAG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gBAAgB,GAAI,iCAI9B,qBAAqB,4CAOvB,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, } from "@iamsaroj/smart-ui/components/context-menu";
|
|
4
|
+
// ---- Renderer ----
|
|
5
|
+
const renderItem = (item, index) => {
|
|
6
|
+
if (item.type === "separator") {
|
|
7
|
+
return _jsx(ContextMenuSeparator, {}, index);
|
|
8
|
+
}
|
|
9
|
+
if (item.type === "label") {
|
|
10
|
+
return _jsx(ContextMenuLabel, { children: item.label }, index);
|
|
11
|
+
}
|
|
12
|
+
if (item.type === "checkbox") {
|
|
13
|
+
return (_jsxs(ContextMenuCheckboxItem, { checked: item.checked, onCheckedChange: item.onCheckedChange, disabled: item.disabled, children: [item.label, item.shortcut && (_jsx(ContextMenuShortcut, { children: item.shortcut }))] }, index));
|
|
14
|
+
}
|
|
15
|
+
if (item.type === "sub") {
|
|
16
|
+
return (_jsxs(ContextMenuSub, { children: [_jsxs(ContextMenuSubTrigger, { disabled: item.disabled, children: [item.icon, item.label] }), _jsx(ContextMenuSubContent, { children: item.items.map((sub, si) => renderItem(sub, si)) })] }, index));
|
|
17
|
+
}
|
|
18
|
+
// default: "item" (type is undefined or "item")
|
|
19
|
+
return (_jsxs(ContextMenuItem, { variant: item.variant, disabled: item.disabled, onClick: item.onClick, children: [item.icon, item.label, item.shortcut && (_jsx(ContextMenuShortcut, { children: item.shortcut }))] }, index));
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Data-driven context menu (right-click menu). Supports items, labels,
|
|
23
|
+
* separators, checkboxes, and recursive sub-menus via a typed config array.
|
|
24
|
+
*
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <SmartContextMenu
|
|
27
|
+
* items={[
|
|
28
|
+
* { label: "Edit", icon: <Pencil />, shortcut: "⌘E", onClick: onEdit },
|
|
29
|
+
* { type: "separator" },
|
|
30
|
+
* { label: "Delete", variant: "destructive", onClick: onDelete },
|
|
31
|
+
* ]}
|
|
32
|
+
* >
|
|
33
|
+
* <div className="rounded border p-4">Right-click me</div>
|
|
34
|
+
* </SmartContextMenu>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const SmartContextMenu = ({ children, items, className, }) => (_jsxs(ContextMenu, { children: [_jsx(ContextMenuTrigger, { className: className, children: children }), _jsx(ContextMenuContent, { children: items.map((item, idx) => renderItem(item, idx)) })] }));
|
|
38
|
+
//# sourceMappingURL=smart-context-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-context-menu.js","sourceRoot":"","sources":["../../src/smart-components/smart-context-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,4CAA4C,CAAA;AA0CnD,qBAAqB;AAErB,MAAM,UAAU,GAAG,CACjB,IAAgC,EAChC,KAAa,EACI,EAAE;IACnB,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAC9B,OAAO,KAAC,oBAAoB,MAAM,KAAK,CAAI,CAAA;IAC7C,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,OAAO,KAAC,gBAAgB,cAAc,IAAI,CAAC,KAAK,IAAlB,KAAK,CAAiC,CAAA;IACtE,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QAC7B,OAAO,CACL,MAAC,u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,cAChB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,GAC7B,IACT,CACf,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DatePicker } from "@iamsaroj/smart-ui/components/date-picker";
|
|
3
|
+
export interface SmartDatePickerProps {
|
|
4
|
+
/** Currently selected date (controlled). */
|
|
5
|
+
selected?: Date;
|
|
6
|
+
onSelect?: (date: Date | undefined) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Disables the whole trigger when `true`, or forwards a react-day-picker
|
|
10
|
+
* matcher (e.g. `(d) => d < today`) to disable specific calendar days.
|
|
11
|
+
*/
|
|
12
|
+
disabled?: React.ComponentProps<typeof DatePicker>["disabled"];
|
|
13
|
+
/** Class applied to the picker trigger button. Defaults to full-width. */
|
|
14
|
+
pickerClassName?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Day-stepper buttons flanking the picker. `"prev"` shows only the −1 day
|
|
17
|
+
* button (in front), `"next"` only the +1 day button (behind), `"both"`
|
|
18
|
+
* (or `true`) shows both. Stepping from an empty value starts at today.
|
|
19
|
+
* Defaults to `false` (no steppers).
|
|
20
|
+
*/
|
|
21
|
+
steppers?: boolean | "prev" | "next" | "both";
|
|
22
|
+
/**
|
|
23
|
+
* Show a "reset to today" button after the picker. Defaults to `false`.
|
|
24
|
+
*/
|
|
25
|
+
todayButton?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Which clock "today" is read from for the today button and steppers:
|
|
28
|
+
* `"local"` (default) uses the browser's local calendar day, `"utc"` uses
|
|
29
|
+
* the current UTC calendar day (they can differ around midnight).
|
|
30
|
+
*/
|
|
31
|
+
timeZone?: "local" | "utc";
|
|
32
|
+
/**
|
|
33
|
+
* Caption navigation style for the calendar. `"label"` (default) shows a
|
|
34
|
+
* static month/year label; `"dropdown"` turns both month and year into
|
|
35
|
+
* pickers, and `"dropdown-months"` / `"dropdown-years"` enable just one.
|
|
36
|
+
*/
|
|
37
|
+
captionLayout?: React.ComponentProps<typeof DatePicker>["captionLayout"];
|
|
38
|
+
/** Earliest month the (year) dropdown can navigate to. */
|
|
39
|
+
startMonth?: React.ComponentProps<typeof DatePicker>["startMonth"];
|
|
40
|
+
/** Latest month the (year) dropdown can navigate to. */
|
|
41
|
+
endMonth?: React.ComponentProps<typeof DatePicker>["endMonth"];
|
|
42
|
+
/**
|
|
43
|
+
* How the selected date is rendered in the trigger. Accepts a date-fns
|
|
44
|
+
* pattern; the intuitive upper-case tokens are normalized, so
|
|
45
|
+
* `"YYYY-MM-DD"`, `"DD/MM/YYYY"`, `"MM-DD-YYYY"`, `"YYYY.MM.DD"` all work.
|
|
46
|
+
* Defaults to `"PPP"` (e.g. "July 10th, 2026").
|
|
47
|
+
*/
|
|
48
|
+
dateFormat?: React.ComponentProps<typeof DatePicker>["dateFormat"];
|
|
49
|
+
/** Field label rendered above the picker. */
|
|
50
|
+
label?: React.ReactNode;
|
|
51
|
+
/** Hint rendered below. Hidden when `error` is set. */
|
|
52
|
+
description?: React.ReactNode;
|
|
53
|
+
/** Validation error shown below instead of `description`. */
|
|
54
|
+
error?: React.ReactNode;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
optional?: boolean;
|
|
57
|
+
fieldClassName?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* DatePicker (calendar popover) with optional field label, description,
|
|
61
|
+
* and error message. The trigger defaults to full-width.
|
|
62
|
+
*
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <SmartDatePicker
|
|
65
|
+
* label="Date of birth"
|
|
66
|
+
* selected={dob}
|
|
67
|
+
* onSelect={setDob}
|
|
68
|
+
* required
|
|
69
|
+
* error={dobError}
|
|
70
|
+
* />
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* Opt into the day-stepper controls with `steppers` and/or `todayButton`
|
|
74
|
+
* (reset to today). `steppers` is independently configurable — `"prev"` for
|
|
75
|
+
* just the −1 day button, `"next"` for just +1, `"both"` (or `true`) for both:
|
|
76
|
+
*
|
|
77
|
+
* ```tsx
|
|
78
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers todayButton />
|
|
79
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers="prev" />
|
|
80
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers="next" />
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* Use `timeZone="utc"` to make the today button / steppers read the current
|
|
84
|
+
* UTC calendar day instead of the browser's local day, and `captionLayout`
|
|
85
|
+
* (with optional `startMonth`/`endMonth`) to enable month/year dropdowns:
|
|
86
|
+
*
|
|
87
|
+
* ```tsx
|
|
88
|
+
* <SmartDatePicker selected={date} onSelect={setDate} todayButton timeZone="utc" />
|
|
89
|
+
* <SmartDatePicker
|
|
90
|
+
* selected={date}
|
|
91
|
+
* onSelect={setDate}
|
|
92
|
+
* captionLayout="dropdown"
|
|
93
|
+
* startMonth={new Date(1970, 0)}
|
|
94
|
+
* endMonth={new Date(2035, 11)}
|
|
95
|
+
* />
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare const SmartDatePicker: ({ label, description, error, required, optional, fieldClassName, pickerClassName, selected, onSelect, placeholder, disabled, steppers, todayButton, timeZone, captionLayout, startMonth, endMonth, dateFormat, }: SmartDatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
99
|
+
//# sourceMappingURL=smart-date-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-date-picker.d.ts","sourceRoot":"","sources":["../../src/smart-components/smart-date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,OAAO,EAAE,UAAU,EAAE,MAAM,2CAA2C,CAAA;AAGtE,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IA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CAAA;CACxB;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,eAAe,GAAI,kNAmB7B,oBAAoB,4CA6GtB,CAAA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { addDays } from "date-fns";
|
|
5
|
+
import { ChevronLeft, ChevronRight, RotateCcw } from "lucide-react";
|
|
6
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
7
|
+
import { Button } from "@iamsaroj/smart-ui/components/button";
|
|
8
|
+
import { DatePicker } from "@iamsaroj/smart-ui/components/date-picker";
|
|
9
|
+
import { Label } from "@iamsaroj/smart-ui/components/label";
|
|
10
|
+
/**
|
|
11
|
+
* Midnight-today, so today-resets/steppers don't carry a time component.
|
|
12
|
+
* `"utc"` pins to the current UTC calendar day (still represented as a local
|
|
13
|
+
* midnight `Date` so the calendar highlights the right cell).
|
|
14
|
+
*/
|
|
15
|
+
const today = (timeZone = "local") => {
|
|
16
|
+
const d = new Date();
|
|
17
|
+
if (timeZone === "utc") {
|
|
18
|
+
return new Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate());
|
|
19
|
+
}
|
|
20
|
+
d.setHours(0, 0, 0, 0);
|
|
21
|
+
return d;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* DatePicker (calendar popover) with optional field label, description,
|
|
25
|
+
* and error message. The trigger defaults to full-width.
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <SmartDatePicker
|
|
29
|
+
* label="Date of birth"
|
|
30
|
+
* selected={dob}
|
|
31
|
+
* onSelect={setDob}
|
|
32
|
+
* required
|
|
33
|
+
* error={dobError}
|
|
34
|
+
* />
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* Opt into the day-stepper controls with `steppers` and/or `todayButton`
|
|
38
|
+
* (reset to today). `steppers` is independently configurable — `"prev"` for
|
|
39
|
+
* just the −1 day button, `"next"` for just +1, `"both"` (or `true`) for both:
|
|
40
|
+
*
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers todayButton />
|
|
43
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers="prev" />
|
|
44
|
+
* <SmartDatePicker selected={date} onSelect={setDate} steppers="next" />
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Use `timeZone="utc"` to make the today button / steppers read the current
|
|
48
|
+
* UTC calendar day instead of the browser's local day, and `captionLayout`
|
|
49
|
+
* (with optional `startMonth`/`endMonth`) to enable month/year dropdowns:
|
|
50
|
+
*
|
|
51
|
+
* ```tsx
|
|
52
|
+
* <SmartDatePicker selected={date} onSelect={setDate} todayButton timeZone="utc" />
|
|
53
|
+
* <SmartDatePicker
|
|
54
|
+
* selected={date}
|
|
55
|
+
* onSelect={setDate}
|
|
56
|
+
* captionLayout="dropdown"
|
|
57
|
+
* startMonth={new Date(1970, 0)}
|
|
58
|
+
* endMonth={new Date(2035, 11)}
|
|
59
|
+
* />
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export const SmartDatePicker = ({ label, description, error, required, optional, fieldClassName, pickerClassName, selected, onSelect, placeholder, disabled, steppers, todayButton, timeZone = "local", captionLayout, startMonth, endMonth, dateFormat, }) => {
|
|
63
|
+
const id = React.useId();
|
|
64
|
+
const hasHint = error != null || description != null;
|
|
65
|
+
const hintId = hasHint ? `${id}-hint` : undefined;
|
|
66
|
+
// `disabled === true` disables the whole control; a matcher only disables
|
|
67
|
+
// calendar days, so the stepper/today buttons stay active in that case.
|
|
68
|
+
const controlsDisabled = disabled === true;
|
|
69
|
+
const showPrev = steppers === true || steppers === "both" || steppers === "prev";
|
|
70
|
+
const showNext = steppers === true || steppers === "both" || steppers === "next";
|
|
71
|
+
const hasControls = showPrev || showNext || todayButton === true;
|
|
72
|
+
const step = (delta) => {
|
|
73
|
+
onSelect?.(addDays(selected ?? today(timeZone), delta));
|
|
74
|
+
};
|
|
75
|
+
const picker = (_jsx(DatePicker, { date: selected, onDateChange: onSelect, placeholder: placeholder, disabled: disabled, dateFormat: dateFormat, captionLayout: captionLayout, startMonth: startMonth, endMonth: endMonth, className: cn("w-full", pickerClassName) }));
|
|
76
|
+
return (_jsxs("div", { "data-slot": "field", className: cn("flex flex-col gap-1.5", fieldClassName), children: [label != null && (_jsxs(Label, { children: [label, required && (_jsx("span", { className: "text-destructive", "aria-hidden": "true", children: "*" })), optional && (_jsxs("span", { className: "font-normal text-muted-foreground", children: [" ", "(optional)"] }))] })), hasControls ? (_jsxs("div", { className: "flex items-center gap-1.5", children: [showPrev && (_jsx(Button, { type: "button", variant: "outline", size: "icon", "aria-label": "Previous day", disabled: controlsDisabled, onClick: () => step(-1), children: _jsx(ChevronLeft, { className: "h-4 w-4" }) })), _jsx("div", { className: "flex-1", children: picker }), showNext && (_jsx(Button, { type: "button", variant: "outline", size: "icon", "aria-label": "Next day", disabled: controlsDisabled, onClick: () => step(1), children: _jsx(ChevronRight, { className: "h-4 w-4" }) })), todayButton && (_jsx(Button, { type: "button", variant: "outline", size: "icon", "aria-label": "Reset to today", disabled: controlsDisabled, onClick: () => onSelect?.(today(timeZone)), children: _jsx(RotateCcw, { className: "h-4 w-4" }) }))] })) : (picker), hasHint && (_jsx("p", { id: hintId, className: cn("text-xs", error != null ? "text-destructive" : "text-muted-foreground"), children: error ?? description }))] }));
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=smart-date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-date-picker.js","sourceRoot":"","sources":["../../src/smart-components/smart-date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,EAAE,MAA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
|
|
2
|
+
import type { DateRange } from "react-day-picker";
|
|
3
|
+
import { Calendar } from "@iamsaroj/smart-ui/components/calendar";
|
|
4
|
+
export type { DateRange };
|
|
5
|
+
export interface SmartDateRangePickerProps {
|
|
6
|
+
/** Selected range (controlled). */
|
|
7
|
+
value?: DateRange;
|
|
8
|
+
onValueChange?: (range: DateRange | undefined) => void;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
/** Number of months rendered side by side. @default 2 */
|
|
11
|
+
numberOfMonths?: number;
|
|
12
|
+
/** Disable the whole trigger (`true`) or specific calendar days (matcher). */
|
|
13
|
+
disabled?: React.ComponentProps<typeof Calendar>["disabled"];
|
|
14
|
+
/** Class applied to the trigger button. Defaults to full-width. */
|
|
15
|
+
className?: string;
|
|
16
|
+
label?: React.ReactNode;
|
|
17
|
+
description?: React.ReactNode;
|
|
18
|
+
error?: React.ReactNode;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
optional?: boolean;
|
|
21
|
+
fieldClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Popover date-range picker built on a range-mode `Calendar`. Produces a
|
|
25
|
+
* `{ from, to }` `DateRange`. For an always-visible range calendar use
|
|
26
|
+
* `SmartCalendar mode="range"` instead.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <SmartDateRangePicker
|
|
30
|
+
* label="Reporting period"
|
|
31
|
+
* value={range}
|
|
32
|
+
* onValueChange={setRange}
|
|
33
|
+
* />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const SmartDateRangePicker: ({ value, onValueChange, placeholder, numberOfMonths, disabled, className, label, description, error, required, optional, fieldClassName, }: SmartDateRangePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=smart-date-range-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-date-range-picker.d.ts","sourceRoot":"","sources":["../../src/smart-components/smart-date-range-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGjD,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAA;AAQjE,YAAY,EAAE,SAAS,EAAE,CAAA;AAEzB,MAAM,WAAW,yBAAyB;IACxC,mCAAmC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,KAAK,IAAI,CAAA;IACtD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC,UAAU,CAAC,CAAA;IAC5D,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAQD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,oBAAoB,GAAI,4IAalC,yBAAyB,4CAoE3B,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { format } from "date-fns";
|
|
5
|
+
import { CalendarIcon } from "lucide-react";
|
|
6
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
7
|
+
import { Button } from "@iamsaroj/smart-ui/components/button";
|
|
8
|
+
import { Calendar } from "@iamsaroj/smart-ui/components/calendar";
|
|
9
|
+
import { Label } from "@iamsaroj/smart-ui/components/label";
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger, } from "@iamsaroj/smart-ui/components/popover";
|
|
11
|
+
const formatRange = (range) => {
|
|
12
|
+
if (!range?.from)
|
|
13
|
+
return undefined;
|
|
14
|
+
if (!range.to)
|
|
15
|
+
return format(range.from, "PP");
|
|
16
|
+
return `${format(range.from, "PP")} – ${format(range.to, "PP")}`;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Popover date-range picker built on a range-mode `Calendar`. Produces a
|
|
20
|
+
* `{ from, to }` `DateRange`. For an always-visible range calendar use
|
|
21
|
+
* `SmartCalendar mode="range"` instead.
|
|
22
|
+
*
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <SmartDateRangePicker
|
|
25
|
+
* label="Reporting period"
|
|
26
|
+
* value={range}
|
|
27
|
+
* onValueChange={setRange}
|
|
28
|
+
* />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export const SmartDateRangePicker = ({ value, onValueChange, placeholder = "Pick a date range", numberOfMonths = 2, disabled, className, label, description, error, required, optional, fieldClassName, }) => {
|
|
32
|
+
const id = React.useId();
|
|
33
|
+
const hasHint = error != null || description != null;
|
|
34
|
+
const hintId = hasHint ? `${id}-hint` : undefined;
|
|
35
|
+
const display = formatRange(value);
|
|
36
|
+
return (_jsxs("div", { "data-slot": "field", className: cn("flex flex-col gap-1.5", fieldClassName), children: [label != null && (_jsxs(Label, { children: [label, required && (_jsx("span", { className: "text-destructive", "aria-hidden": "true", children: "*" })), optional && (_jsxs("span", { className: "font-normal text-muted-foreground", children: [" ", "(optional)"] }))] })), _jsxs(Popover, { children: [_jsxs(PopoverTrigger, { render: _jsx(Button, { variant: "outline", disabled: disabled === true, className: cn("w-full justify-start text-left font-normal", !display && "text-muted-foreground", className) }), children: [_jsx(CalendarIcon, { className: "mr-2 h-4 w-4" }), display ?? _jsx("span", { children: placeholder })] }), _jsx(PopoverContent, { className: "w-auto p-0", align: "start", children: _jsx(Calendar, { mode: "range", selected: value, onSelect: onValueChange, numberOfMonths: numberOfMonths, defaultMonth: value?.from, disabled: disabled }) })] }), hasHint && (_jsx("p", { id: hintId, className: cn("text-xs", error != null ? "text-destructive" : "text-muted-foreground"), children: error ?? description }))] }));
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=smart-date-range-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-date-range-picker.js","sourceRoot":"","sources":["../../src/smart-components/smart-date-range-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,qCAAqC,CAAA;AAC3D,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,GACf,MAAM,uCAAuC,CAAA;AAwB9C,MAAM,WAAW,GAAG,CAAC,KAA4B,EAAsB,EAAE;IACvE,IAAI,CAAC,KAAK,EAAE,IAAI;QAAE,OAAO,SAAS,CAAA;IAClC,IAAI,CAAC,KAAK,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IAC9C,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAA;AAClE,CAAC,CAAA;AA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AI,EAAC,OAAO,EACZ,QAAQ,EAAE,KAAK,EACf,QAAQ,EAAE,aAAa,EACvB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,KAAK,EAAE,IAAI,EACzB,QAAQ,EAAE,QAAQ,GAClB,GACa,IACT,EACT,OAAO,IAAI,CACV,YACE,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,EAAE,CACX,SAAS,EACT,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,uBAAuB,CAC7D,YAEA,KAAK,IAAI,WAAW,GACnB,CACL,IACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DialogContent, DialogDescription, DialogTitle } from "@iamsaroj/smart-ui/components/dialog";
|
|
3
|
+
export { DialogContent, DialogTitle, DialogDescription };
|
|
4
|
+
/**
|
|
5
|
+
* Dialog size presets (fixed px width × fixed vh height):
|
|
6
|
+
* xs 400px/60vh · sm 600px/70vh · md 800px/80vh · lg 1000px/85vh ·
|
|
7
|
+
* xl 1200px/90vh · 2xl 1400px/90vh · 3xl 1600px/92vh ·
|
|
8
|
+
* full calc(100vw-48px) × calc(100vh-48px).
|
|
9
|
+
*/
|
|
10
|
+
export type SmartDialogSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full";
|
|
11
|
+
export interface SmartDialogHeader {
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
subtitle?: React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface SmartDialogProps {
|
|
16
|
+
/** Controls open state (controlled mode). */
|
|
17
|
+
open?: boolean;
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Element rendered as the dialog trigger.
|
|
21
|
+
* Passed as the `render` prop to DialogTrigger — must be a single element.
|
|
22
|
+
* Omit when using controlled `open` without a built-in trigger.
|
|
23
|
+
*/
|
|
24
|
+
trigger?: React.ReactElement;
|
|
25
|
+
/** Dialog header: title and optional subtitle. */
|
|
26
|
+
header?: SmartDialogHeader;
|
|
27
|
+
/** Footer content (actions row). Maps to DialogFooter. */
|
|
28
|
+
footer?: React.ReactNode;
|
|
29
|
+
/** Show the × close button in the top-right corner. @default true */
|
|
30
|
+
showCloseButton?: boolean;
|
|
31
|
+
/** Dialog width preset. `full` fills the whole page. @default "sm" */
|
|
32
|
+
size?: SmartDialogSize;
|
|
33
|
+
/**
|
|
34
|
+
* Draw full-width separator lines under the header and above the footer,
|
|
35
|
+
* visually grouping them apart from the scrollable body (shadcn style).
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
dividers?: boolean;
|
|
39
|
+
className?: string;
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Flattened Dialog wrapper.
|
|
44
|
+
*
|
|
45
|
+
* ```tsx
|
|
46
|
+
* // Before
|
|
47
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
48
|
+
* <DialogTrigger render={<Button>Edit profile</Button>} />
|
|
49
|
+
* <DialogContent>
|
|
50
|
+
* <DialogHeader>
|
|
51
|
+
* <DialogTitle>Edit profile</DialogTitle>
|
|
52
|
+
* <DialogDescription>Make changes here.</DialogDescription>
|
|
53
|
+
* </DialogHeader>
|
|
54
|
+
* <form>…</form>
|
|
55
|
+
* <DialogFooter><Button onClick={save}>Save</Button></DialogFooter>
|
|
56
|
+
* </DialogContent>
|
|
57
|
+
* </Dialog>
|
|
58
|
+
*
|
|
59
|
+
* // After
|
|
60
|
+
* <SmartDialog
|
|
61
|
+
* open={open}
|
|
62
|
+
* onOpenChange={setOpen}
|
|
63
|
+
* trigger={<Button>Edit profile</Button>}
|
|
64
|
+
* header={{ title: "Edit profile", subtitle: "Make changes here." }}
|
|
65
|
+
* footer={<Button onClick={save}>Save</Button>}
|
|
66
|
+
* >
|
|
67
|
+
* <form>…</form>
|
|
68
|
+
* </SmartDialog>
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* Fall back to native Dialog primitives when the trigger needs conditional
|
|
72
|
+
* rendering, multiple triggers, or the header has a non-standard layout.
|
|
73
|
+
*/
|
|
74
|
+
export declare const SmartDialog: ({ open, onOpenChange, trigger, header, footer, showCloseButton, size, dividers, className, children, }: SmartDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
//# sourceMappingURL=smart-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-dialog.d.ts","sourceRoot":"","sources":["../../src/smart-components/smart-dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAEL,aAAa,EACb,iBAAiB,EAGjB,WAAW,EAEZ,MAAM,sCAAsC,CAAA;AAG7C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAExD;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GACvB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,MAAM,CAAA;AAwBV,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,YAAY,CAAA;IAC5B,kDAAkD;IAClD,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,qEAAqE;IACrE,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,sEAAsE;IACtE,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,WAAW,GAAI,wGAWzB,gBAAgB,4CA+BlB,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@iamsaroj/smart-ui/components/dialog";
|
|
4
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
5
|
+
export { DialogContent, DialogTitle, DialogDescription };
|
|
6
|
+
/**
|
|
7
|
+
* Fixed width + fixed height per size. These override the default
|
|
8
|
+
* `sm:max-w-sm` on `DialogContent` via tailwind-merge. `SIZE_CAP` keeps the
|
|
9
|
+
* fixed dimensions from overflowing small viewports (and re-overrides the
|
|
10
|
+
* default `sm:` width cap so the pixel width can grow past it). Scrolling
|
|
11
|
+
* happens on the inner body (see the component), not the popup — so the
|
|
12
|
+
* absolute close button stays pinned to the corner. The dialog stays centered.
|
|
13
|
+
*/
|
|
14
|
+
const SIZE_CAP = "max-w-[calc(100vw-2rem)] sm:max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]";
|
|
15
|
+
const SIZE_CLASSES = {
|
|
16
|
+
xs: `w-[400px] h-[60vh] ${SIZE_CAP}`,
|
|
17
|
+
sm: `w-[600px] h-[70vh] ${SIZE_CAP}`,
|
|
18
|
+
md: `w-[800px] h-[80vh] ${SIZE_CAP}`,
|
|
19
|
+
lg: `w-[1000px] h-[85vh] ${SIZE_CAP}`,
|
|
20
|
+
xl: `w-[1200px] h-[90vh] ${SIZE_CAP}`,
|
|
21
|
+
"2xl": `w-[1400px] h-[90vh] ${SIZE_CAP}`,
|
|
22
|
+
"3xl": `w-[1600px] h-[92vh] ${SIZE_CAP}`,
|
|
23
|
+
full: "h-[calc(100vh-48px)] w-[calc(100vw-48px)] max-w-[calc(100vw-48px)] sm:max-w-[calc(100vw-48px)]",
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Flattened Dialog wrapper.
|
|
27
|
+
*
|
|
28
|
+
* ```tsx
|
|
29
|
+
* // Before
|
|
30
|
+
* <Dialog open={open} onOpenChange={setOpen}>
|
|
31
|
+
* <DialogTrigger render={<Button>Edit profile</Button>} />
|
|
32
|
+
* <DialogContent>
|
|
33
|
+
* <DialogHeader>
|
|
34
|
+
* <DialogTitle>Edit profile</DialogTitle>
|
|
35
|
+
* <DialogDescription>Make changes here.</DialogDescription>
|
|
36
|
+
* </DialogHeader>
|
|
37
|
+
* <form>…</form>
|
|
38
|
+
* <DialogFooter><Button onClick={save}>Save</Button></DialogFooter>
|
|
39
|
+
* </DialogContent>
|
|
40
|
+
* </Dialog>
|
|
41
|
+
*
|
|
42
|
+
* // After
|
|
43
|
+
* <SmartDialog
|
|
44
|
+
* open={open}
|
|
45
|
+
* onOpenChange={setOpen}
|
|
46
|
+
* trigger={<Button>Edit profile</Button>}
|
|
47
|
+
* header={{ title: "Edit profile", subtitle: "Make changes here." }}
|
|
48
|
+
* footer={<Button onClick={save}>Save</Button>}
|
|
49
|
+
* >
|
|
50
|
+
* <form>…</form>
|
|
51
|
+
* </SmartDialog>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* Fall back to native Dialog primitives when the trigger needs conditional
|
|
55
|
+
* rendering, multiple triggers, or the header has a non-standard layout.
|
|
56
|
+
*/
|
|
57
|
+
export const SmartDialog = ({ open, onOpenChange, trigger, header, footer, showCloseButton = true, size = "sm", dividers = false, className, children, }) => (_jsxs(Dialog, { open: open, onOpenChange: onOpenChange, children: [trigger && _jsx(DialogTrigger, { render: trigger }), _jsxs(DialogContent, { showCloseButton: showCloseButton,
|
|
58
|
+
// Flex column so the header/footer stay fixed and only the body
|
|
59
|
+
// scrolls — keeps the absolute close button pinned to the corner.
|
|
60
|
+
className: cn("flex flex-col", SIZE_CLASSES[size], className), children: [header && (_jsxs(DialogHeader, { className: cn("shrink-0", dividers && "-mx-4 border-b px-4 pb-4"), children: [_jsx(DialogTitle, { children: header.title }), header.subtitle && (_jsx(DialogDescription, { children: header.subtitle }))] })), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: children }), footer && (_jsx(DialogFooter, { className: cn("shrink-0", dividers && "-mx-4 border-t px-4 pt-4"), children: footer }))] })] }));
|
|
61
|
+
//# sourceMappingURL=smart-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"smart-dialog.js","sourceRoot":"","sources":["../../src/smart-components/smart-dialog.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACd,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAkBxD;;;;;;;GAOG;AACH,MAAM,QAAQ,GACZ,+EAA+E,CAAA;AAEjF,MAAM,YAAY,GAAoC;IACpD,EAAE,EAAE,sBAAsB,QAAQ,EAAE;IACpC,EAAE,EAAE,sBAAsB,QAAQ,EAAE;IACpC,EAAE,EAAE,sBAAsB,QAAQ,EAAE;IACpC,EAAE,EAAE,uBAAuB,QAAQ,EAAE;IACrC,EAAE,EAAE,uBAAuB,QAAQ,EAAE;IACrC,KAAK,EAAE,uBAAuB,QAAQ,EAAE;IACxC,KAAK,EAAE,uBAAuB,QAAQ,EAAE;IACxC,IAA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