@contractspec/lib.ui-kit-web 1.44.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 +21 -0
- package/README.md +109 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +0 -0
- package/dist/ui/accordion.d.ts +25 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +48 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +49 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +85 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +25 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +39 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +8 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.js +10 -0
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts +8 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts.map +1 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.js +53 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.js.map +1 -0
- package/dist/ui/atoms/FilterSelect/index.d.ts +3 -0
- package/dist/ui/atoms/FilterSelect/index.js +3 -0
- package/dist/ui/atoms/FilterSelect/types.d.ts +19 -0
- package/dist/ui/atoms/FilterSelect/types.d.ts.map +1 -0
- package/dist/ui/atoms/FilterSelect/types.js +0 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts +23 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts.map +1 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +46 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js.map +1 -0
- package/dist/ui/atoms/LoadingSpinner/index.d.ts +2 -0
- package/dist/ui/atoms/LoadingSpinner/index.js +3 -0
- package/dist/ui/atoms/Pagination/Pagination.d.ts +8 -0
- package/dist/ui/atoms/Pagination/Pagination.d.ts.map +1 -0
- package/dist/ui/atoms/Pagination/Pagination.js +157 -0
- package/dist/ui/atoms/Pagination/Pagination.js.map +1 -0
- package/dist/ui/atoms/Pagination/index.d.ts +3 -0
- package/dist/ui/atoms/Pagination/index.js +3 -0
- package/dist/ui/atoms/Pagination/types.d.ts +16 -0
- package/dist/ui/atoms/Pagination/types.d.ts.map +1 -0
- package/dist/ui/atoms/Pagination/types.js +0 -0
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts +8 -0
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/ui/atoms/SearchInput/SearchInput.js +50 -0
- package/dist/ui/atoms/SearchInput/SearchInput.js.map +1 -0
- package/dist/ui/atoms/SearchInput/index.d.ts +3 -0
- package/dist/ui/atoms/SearchInput/index.js +3 -0
- package/dist/ui/atoms/SearchInput/types.d.ts +13 -0
- package/dist/ui/atoms/SearchInput/types.d.ts.map +1 -0
- package/dist/ui/atoms/SearchInput/types.js +0 -0
- package/dist/ui/avatar.d.ts +20 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/avatar.js +33 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +20 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +27 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.d.ts +38 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/breadcrumb.js +72 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button.d.ts +21 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +55 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/calendar.d.ts +27 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +109 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.d.ts +35 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +58 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/carousel.d.ts +48 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/carousel.js +136 -0
- package/dist/ui/carousel.js.map +1 -0
- package/dist/ui/checkbox.d.ts +12 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +25 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.d.ts +16 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/collapsible.js +28 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/command.d.ts +53 -0
- package/dist/ui/command.d.ts.map +1 -0
- package/dist/ui/command.js +90 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/confirm-dialog.d.ts +31 -0
- package/dist/ui/confirm-dialog.d.ts.map +1 -0
- package/dist/ui/confirm-dialog.js +34 -0
- package/dist/ui/confirm-dialog.js.map +1 -0
- package/dist/ui/context-menu.d.ts +35 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/context-menu.js +84 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/cta.d.ts +23 -0
- package/dist/ui/cta.d.ts.map +1 -0
- package/dist/ui/cta.js +39 -0
- package/dist/ui/cta.js.map +1 -0
- package/dist/ui/date-picker.d.ts +26 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +101 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/date-range-picker.d.ts +26 -0
- package/dist/ui/date-range-picker.d.ts.map +1 -0
- package/dist/ui/date-range-picker.js +54 -0
- package/dist/ui/date-range-picker.js.map +1 -0
- package/dist/ui/datetime-picker.d.ts +28 -0
- package/dist/ui/datetime-picker.d.ts.map +1 -0
- package/dist/ui/datetime-picker.js +44 -0
- package/dist/ui/datetime-picker.js.map +1 -0
- package/dist/ui/dialog.d.ts +48 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +90 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/drawer.d.ts +45 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/drawer.js +82 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +78 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +127 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/empty-state.d.ts +29 -0
- package/dist/ui/empty-state.d.ts.map +1 -0
- package/dist/ui/empty-state.js +43 -0
- package/dist/ui/empty-state.js.map +1 -0
- package/dist/ui/empty.d.ts +37 -0
- package/dist/ui/empty.d.ts.map +1 -0
- package/dist/ui/empty.js +62 -0
- package/dist/ui/empty.js.map +1 -0
- package/dist/ui/field.d.ts +66 -0
- package/dist/ui/field.d.ts.map +1 -0
- package/dist/ui/field.js +121 -0
- package/dist/ui/field.js.map +1 -0
- package/dist/ui/focus-on-route-change.d.ts +9 -0
- package/dist/ui/focus-on-route-change.d.ts.map +1 -0
- package/dist/ui/focus-on-route-change.js +17 -0
- package/dist/ui/focus-on-route-change.js.map +1 -0
- package/dist/ui/form.d.ts +47 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +94 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.d.ts +20 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/hover-card.js +36 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/input-group.d.ts +44 -0
- package/dist/ui/input-group.d.ts.map +1 -0
- package/dist/ui/input-group.js +89 -0
- package/dist/ui/input-group.js.map +1 -0
- package/dist/ui/input-otp.d.ts +39 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/input-otp.js +46 -0
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts +13 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +17 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +12 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +19 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/link.d.ts +9 -0
- package/dist/ui/link.d.ts.map +1 -0
- package/dist/ui/link.js +18 -0
- package/dist/ui/link.js.map +1 -0
- package/dist/ui/live-region.d.ts +17 -0
- package/dist/ui/live-region.d.ts.map +1 -0
- package/dist/ui/live-region.js +47 -0
- package/dist/ui/live-region.js.map +1 -0
- package/dist/ui/loading-button.d.ts +20 -0
- package/dist/ui/loading-button.d.ts.map +1 -0
- package/dist/ui/loading-button.js +21 -0
- package/dist/ui/loading-button.js.map +1 -0
- package/dist/ui/map/MapBase.d.ts +28 -0
- package/dist/ui/map/MapBase.d.ts.map +1 -0
- package/dist/ui/map/MapBase.js +47 -0
- package/dist/ui/map/MapBase.js.map +1 -0
- package/dist/ui/map/MapGeoJsonOverlay.d.ts +16 -0
- package/dist/ui/map/MapGeoJsonOverlay.d.ts.map +1 -0
- package/dist/ui/map/MapGeoJsonOverlay.js +38 -0
- package/dist/ui/map/MapGeoJsonOverlay.js.map +1 -0
- package/dist/ui/map/MapHeatmapH3.d.ts +18 -0
- package/dist/ui/map/MapHeatmapH3.d.ts.map +1 -0
- package/dist/ui/map/MapHeatmapH3.js +51 -0
- package/dist/ui/map/MapHeatmapH3.js.map +1 -0
- package/dist/ui/map/MapMarkers.d.ts +20 -0
- package/dist/ui/map/MapMarkers.d.ts.map +1 -0
- package/dist/ui/map/MapMarkers.js +40 -0
- package/dist/ui/map/MapMarkers.js.map +1 -0
- package/dist/ui/map/index.d.ts +5 -0
- package/dist/ui/map/index.js +6 -0
- package/dist/ui/marketing/FeatureGrid.d.ts +21 -0
- package/dist/ui/marketing/FeatureGrid.d.ts.map +1 -0
- package/dist/ui/marketing/FeatureGrid.js +35 -0
- package/dist/ui/marketing/FeatureGrid.js.map +1 -0
- package/dist/ui/marketing/Hero.d.ts +28 -0
- package/dist/ui/marketing/Hero.d.ts.map +1 -0
- package/dist/ui/marketing/Hero.js +53 -0
- package/dist/ui/marketing/Hero.js.map +1 -0
- package/dist/ui/marketing/PricingTable.d.ts +25 -0
- package/dist/ui/marketing/PricingTable.d.ts.map +1 -0
- package/dist/ui/marketing/PricingTable.js +60 -0
- package/dist/ui/marketing/PricingTable.js.map +1 -0
- package/dist/ui/marketing/index.d.ts +4 -0
- package/dist/ui/marketing/index.js +5 -0
- package/dist/ui/menubar.d.ts +85 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/menubar.js +137 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/molecules/Autocomplete/index.d.ts +7 -0
- package/dist/ui/molecules/Autocomplete/index.d.ts.map +1 -0
- package/dist/ui/molecules/Autocomplete/index.js +85 -0
- package/dist/ui/molecules/Autocomplete/index.js.map +1 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts +8 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts.map +1 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +105 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js.map +1 -0
- package/dist/ui/molecules/SearchAndFilter/index.d.ts +3 -0
- package/dist/ui/molecules/SearchAndFilter/index.js +3 -0
- package/dist/ui/molecules/SearchAndFilter/types.d.ts +24 -0
- package/dist/ui/molecules/SearchAndFilter/types.d.ts.map +1 -0
- package/dist/ui/molecules/SearchAndFilter/types.js +0 -0
- package/dist/ui/molecules/SkeletonList.d.ts +16 -0
- package/dist/ui/molecules/SkeletonList.d.ts.map +1 -0
- package/dist/ui/molecules/SkeletonList.js +15 -0
- package/dist/ui/molecules/SkeletonList.js.map +1 -0
- package/dist/ui/nav-layout.d.ts +71 -0
- package/dist/ui/nav-layout.d.ts.map +1 -0
- package/dist/ui/nav-layout.js +133 -0
- package/dist/ui/nav-layout.js.map +1 -0
- package/dist/ui/navigation-menu.d.ts +47 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/navigation-menu.js +83 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +30 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts.map +1 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +107 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js.map +1 -0
- package/dist/ui/organisms/ErrorBoundary/index.d.ts +2 -0
- package/dist/ui/organisms/ErrorBoundary/index.js +3 -0
- package/dist/ui/organisms/ListPage/ListPage.d.ts +29 -0
- package/dist/ui/organisms/ListPage/ListPage.d.ts.map +1 -0
- package/dist/ui/organisms/ListPage/ListPage.js +200 -0
- package/dist/ui/organisms/ListPage/ListPage.js.map +1 -0
- package/dist/ui/organisms/ListPage/index.d.ts +3 -0
- package/dist/ui/organisms/ListPage/index.js +3 -0
- package/dist/ui/organisms/ListPage/types.d.ts +41 -0
- package/dist/ui/organisms/ListPage/types.d.ts.map +1 -0
- package/dist/ui/organisms/ListPage/types.js +0 -0
- package/dist/ui/page-header.d.ts +27 -0
- package/dist/ui/page-header.d.ts.map +1 -0
- package/dist/ui/page-header.js +40 -0
- package/dist/ui/page-header.js.map +1 -0
- package/dist/ui/pagination.d.ts +50 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/pagination.js +65 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/popover.d.ts +23 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +39 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.d.ts +13 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +24 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.d.ts +16 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +32 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.d.ts +36 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/resizable.js +25 -0
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/route-announcer.d.ts +11 -0
- package/dist/ui/route-announcer.d.ts.map +1 -0
- package/dist/ui/route-announcer.js +22 -0
- package/dist/ui/route-announcer.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +18 -0
- package/dist/ui/scroll-area.d.ts.map +1 -0
- package/dist/ui/scroll-area.js +40 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/section.d.ts +27 -0
- package/dist/ui/section.d.ts.map +1 -0
- package/dist/ui/section.js +63 -0
- package/dist/ui/section.js.map +1 -0
- package/dist/ui/select.d.ts +52 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +100 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +14 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +21 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.d.ts +41 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sheet.js +86 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.d.ts +167 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/sidebar.js +379 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.d.ts +11 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +15 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/skip-link.d.ts +17 -0
- package/dist/ui/skip-link.d.ts.map +1 -0
- package/dist/ui/skip-link.js +17 -0
- package/dist/ui/skip-link.js.map +1 -0
- package/dist/ui/slider.d.ts +16 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +40 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.d.ts +10 -0
- package/dist/ui/sonner.d.ts.map +1 -0
- package/dist/ui/sonner.js +24 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/stack.d.ts +48 -0
- package/dist/ui/stack.d.ts.map +1 -0
- package/dist/ui/stack.js +158 -0
- package/dist/ui/stack.js.map +1 -0
- package/dist/ui/stat-card-group.d.ts +19 -0
- package/dist/ui/stat-card-group.d.ts.map +1 -0
- package/dist/ui/stat-card-group.js +39 -0
- package/dist/ui/stat-card-group.js.map +1 -0
- package/dist/ui/stepper.d.ts +23 -0
- package/dist/ui/stepper.d.ts.map +1 -0
- package/dist/ui/stepper.js +37 -0
- package/dist/ui/stepper.js.map +1 -0
- package/dist/ui/switch.d.ts +15 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +23 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +39 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +71 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +24 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +40 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/text.d.ts +15 -0
- package/dist/ui/text.d.ts.map +1 -0
- package/dist/ui/text.js +16 -0
- package/dist/ui/text.js.map +1 -0
- package/dist/ui/textarea.d.ts +12 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +16 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/time-picker.d.ts +22 -0
- package/dist/ui/time-picker.d.ts.map +1 -0
- package/dist/ui/time-picker.js +81 -0
- package/dist/ui/time-picker.js.map +1 -0
- package/dist/ui/toast.d.ts +20 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +62 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts +7 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +27 -0
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +24 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle-group.js +48 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +20 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/dist/ui/toggle.js +41 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.d.ts +24 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +40 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/typography.d.ts +65 -0
- package/dist/ui/typography.d.ts.map +1 -0
- package/dist/ui/typography.js +87 -0
- package/dist/ui/typography.js.map +1 -0
- package/dist/ui/use-media-query.d.ts +5 -0
- package/dist/ui/use-media-query.d.ts.map +1 -0
- package/dist/ui/use-media-query.js +20 -0
- package/dist/ui/use-media-query.js.map +1 -0
- package/dist/ui/use-mobile.d.ts +5 -0
- package/dist/ui/use-mobile.d.ts.map +1 -0
- package/dist/ui/use-mobile.js +21 -0
- package/dist/ui/use-mobile.js.map +1 -0
- package/dist/ui/use-reduced-motion.d.ts +5 -0
- package/dist/ui/use-reduced-motion.d.ts.map +1 -0
- package/dist/ui/use-reduced-motion.js +18 -0
- package/dist/ui/use-reduced-motion.js.map +1 -0
- package/dist/ui/use-toast.d.ts +50 -0
- package/dist/ui/use-toast.d.ts.map +1 -0
- package/dist/ui/use-toast.js +122 -0
- package/dist/ui/use-toast.js.map +1 -0
- package/dist/ui/useListState.d.ts +34 -0
- package/dist/ui/useListState.d.ts.map +1 -0
- package/dist/ui/useListState.js +75 -0
- package/dist/ui/useListState.js.map +1 -0
- package/dist/ui/usecases/UseCaseCard.d.ts +19 -0
- package/dist/ui/usecases/UseCaseCard.d.ts.map +1 -0
- package/dist/ui/usecases/UseCaseCard.js +35 -0
- package/dist/ui/usecases/UseCaseCard.js.map +1 -0
- package/dist/ui/usecases/UserStoryCard.d.ts +15 -0
- package/dist/ui/usecases/UserStoryCard.d.ts.map +1 -0
- package/dist/ui/usecases/UserStoryCard.js +36 -0
- package/dist/ui/usecases/UserStoryCard.js.map +1 -0
- package/dist/ui/usecases/index.d.ts +3 -0
- package/dist/ui/usecases/index.js +4 -0
- package/dist/ui/utils.d.ts +7 -0
- package/dist/ui/utils.d.ts.map +1 -0
- package/dist/ui/utils.js +11 -0
- package/dist/ui/utils.js.map +1 -0
- package/dist/ui/visually-hidden.d.ts +10 -0
- package/dist/ui/visually-hidden.d.ts.map +1 -0
- package/dist/ui/visually-hidden.js +31 -0
- package/dist/ui/visually-hidden.js.map +1 -0
- package/package.json +338 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Button } from "../../button.js";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { AlertTriangle, Home, RefreshCw } from "lucide-react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
8
|
+
//#region ui/organisms/ErrorBoundary/ErrorBoundary.tsx
|
|
9
|
+
const DefaultErrorFallback = ({ error, errorId, resetError }) => {
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: "flex min-h-screen items-center justify-center bg-gray-50 px-4",
|
|
12
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: "w-full max-w-md rounded-lg bg-white p-6 text-center shadow-lg",
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ jsx("div", {
|
|
16
|
+
className: "mb-4 flex justify-center",
|
|
17
|
+
children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-12 w-12 text-red-500" })
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx("h1", {
|
|
20
|
+
className: "mb-2 text-2xl font-semibold text-gray-900",
|
|
21
|
+
children: "Une erreur s'est produite"
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("p", {
|
|
24
|
+
className: "mb-6 text-gray-600",
|
|
25
|
+
children: "Nous nous excusons pour ce désagrément. Notre équipe a été notifiée et travaille à résoudre le problème."
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsxs("div", {
|
|
28
|
+
className: "mb-6 rounded-md bg-red-50 p-4 text-left",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("p", {
|
|
31
|
+
className: "mb-2 text-base font-medium text-red-800",
|
|
32
|
+
children: "Erreur de développement:"
|
|
33
|
+
}),
|
|
34
|
+
/* @__PURE__ */ jsx("p", {
|
|
35
|
+
className: "font-mono text-sm break-all text-red-700",
|
|
36
|
+
children: error.message
|
|
37
|
+
}),
|
|
38
|
+
errorId && /* @__PURE__ */ jsxs("p", {
|
|
39
|
+
className: "mt-2 text-sm text-red-600",
|
|
40
|
+
children: ["ID: ", errorId]
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: "flex flex-col justify-center gap-3 sm:flex-row",
|
|
46
|
+
children: [/* @__PURE__ */ jsxs(Button, {
|
|
47
|
+
onClick: resetError,
|
|
48
|
+
className: "flex items-center gap-2",
|
|
49
|
+
children: [/* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4" }), "Réessayer"]
|
|
50
|
+
}), /* @__PURE__ */ jsxs(Button, {
|
|
51
|
+
onClick: () => window.location.href = "/",
|
|
52
|
+
variant: "secondary",
|
|
53
|
+
className: "flex items-center gap-2",
|
|
54
|
+
children: [/* @__PURE__ */ jsx(Home, { className: "h-4 w-4" }), "Accueil"]
|
|
55
|
+
})]
|
|
56
|
+
}),
|
|
57
|
+
false
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
var ErrorBoundary = class extends React.Component {
|
|
63
|
+
constructor(props) {
|
|
64
|
+
super(props);
|
|
65
|
+
this.state = {
|
|
66
|
+
hasError: false,
|
|
67
|
+
error: null,
|
|
68
|
+
errorId: null
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static getDerivedStateFromError(error) {
|
|
72
|
+
return {
|
|
73
|
+
hasError: true,
|
|
74
|
+
error
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
componentDidCatch(error, errorInfo) {
|
|
78
|
+
const errorId = `err_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
79
|
+
this.setState({ errorId });
|
|
80
|
+
this.props.onError?.(error, errorInfo);
|
|
81
|
+
console.error("ErrorBoundary caught an error:", error, errorInfo);
|
|
82
|
+
}
|
|
83
|
+
resetError = () => {
|
|
84
|
+
this.setState({
|
|
85
|
+
hasError: false,
|
|
86
|
+
error: null,
|
|
87
|
+
errorId: null
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
render() {
|
|
91
|
+
if (this.state.hasError && this.state.error) return /* @__PURE__ */ jsx(this.props.fallback || DefaultErrorFallback, {
|
|
92
|
+
error: this.state.error,
|
|
93
|
+
errorId: this.state.errorId,
|
|
94
|
+
resetError: this.resetError
|
|
95
|
+
});
|
|
96
|
+
return this.props.children;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const useErrorHandler = () => {
|
|
100
|
+
return React.useCallback((error) => {
|
|
101
|
+
throw error;
|
|
102
|
+
}, []);
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
export { ErrorBoundary, useErrorHandler };
|
|
107
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","names":["DefaultErrorFallback: React.FC<ErrorFallbackProps>"],"sources":["../../../../ui/organisms/ErrorBoundary/ErrorBoundary.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\n// import * as Sentry from '@sentry/nextjs';\nimport { AlertTriangle, RefreshCw, Home } from 'lucide-react';\nimport { Button } from '../../button';\n\ninterface ErrorBoundaryState {\n hasError: boolean;\n error: Error | null;\n errorId: string | null;\n}\n\ninterface ErrorBoundaryProps {\n children: React.ReactNode;\n fallback?: React.ComponentType<ErrorFallbackProps>;\n onError?: (error: Error, errorInfo: React.ErrorInfo) => void;\n}\n\ninterface ErrorFallbackProps {\n error: Error;\n errorId: string | null;\n resetError: () => void;\n}\n\nconst DefaultErrorFallback: React.FC<ErrorFallbackProps> = ({\n error,\n errorId,\n resetError,\n}) => {\n const isDevelopment = process.env.NODE_ENV === 'development';\n\n return (\n <div className=\"flex min-h-screen items-center justify-center bg-gray-50 px-4\">\n <div className=\"w-full max-w-md rounded-lg bg-white p-6 text-center shadow-lg\">\n <div className=\"mb-4 flex justify-center\">\n <AlertTriangle className=\"h-12 w-12 text-red-500\" />\n </div>\n\n <h1 className=\"mb-2 text-2xl font-semibold text-gray-900\">\n Une erreur s'est produite\n </h1>\n\n <p className=\"mb-6 text-gray-600\">\n Nous nous excusons pour ce désagrément. Notre équipe a été notifiée et\n travaille à résoudre le problème.\n </p>\n\n {isDevelopment && (\n <div className=\"mb-6 rounded-md bg-red-50 p-4 text-left\">\n <p className=\"mb-2 text-base font-medium text-red-800\">\n Erreur de développement:\n </p>\n <p className=\"font-mono text-sm break-all text-red-700\">\n {error.message}\n </p>\n {errorId && (\n <p className=\"mt-2 text-sm text-red-600\">ID: {errorId}</p>\n )}\n </div>\n )}\n\n <div className=\"flex flex-col justify-center gap-3 sm:flex-row\">\n <Button onClick={resetError} className=\"flex items-center gap-2\">\n <RefreshCw className=\"h-4 w-4\" />\n Réessayer\n </Button>\n\n <Button\n onClick={() => (window.location.href = '/')}\n variant=\"secondary\"\n className=\"flex items-center gap-2\"\n >\n <Home className=\"h-4 w-4\" />\n Accueil\n </Button>\n </div>\n\n {!isDevelopment && errorId && (\n <p className=\"mt-4 text-sm text-gray-500\">Code d'erreur: {errorId}</p>\n )}\n </div>\n </div>\n );\n};\n\nexport class ErrorBoundary extends React.Component<\n ErrorBoundaryProps,\n ErrorBoundaryState\n> {\n constructor(props: ErrorBoundaryProps) {\n super(props);\n this.state = {\n hasError: false,\n error: null,\n errorId: null,\n };\n }\n\n static getDerivedStateFromError(error: Error): Partial<ErrorBoundaryState> {\n return {\n hasError: true,\n error,\n };\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n // Generate unique error ID\n const errorId = `err_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n\n // Log to Sentry with additional context\n // Sentry.withScope((scope) => {\n // scope.setTag('errorBoundary', true);\n // scope.setContext('errorInfo', { ...errorInfo });\n // scope.setContext('errorId', { errorId });\n // Sentry.captureException(error);\n // });\n\n // Update state with error ID\n this.setState({ errorId });\n\n // Call custom error handler if provided\n this.props.onError?.(error, errorInfo);\n\n // Log to console in development\n if (process.env.NODE_ENV === 'development') {\n console.error('ErrorBoundary caught an error:', error, errorInfo);\n }\n }\n\n resetError = () => {\n this.setState({\n hasError: false,\n error: null,\n errorId: null,\n });\n };\n\n render() {\n if (this.state.hasError && this.state.error) {\n const FallbackComponent = this.props.fallback || DefaultErrorFallback;\n\n return (\n <FallbackComponent\n error={this.state.error}\n errorId={this.state.errorId}\n resetError={this.resetError}\n />\n );\n }\n\n return this.props.children;\n }\n}\n\n// Hook for functional components to trigger error boundary\nexport const useErrorHandler = () => {\n return React.useCallback((error: Error) => {\n // This will be caught by the nearest error boundary\n throw error;\n }, []);\n};\n\nexport type { ErrorBoundaryProps, ErrorFallbackProps };\n"],"mappings":";;;;;;;;AAyBA,MAAMA,wBAAsD,EAC1D,OACA,SACA,iBACI;AAGJ,QACE,oBAAC;EAAI,WAAU;YACb,qBAAC;GAAI,WAAU;;IACb,oBAAC;KAAI,WAAU;eACb,oBAAC,iBAAc,WAAU,2BAA2B;MAChD;IAEN,oBAAC;KAAG,WAAU;eAA4C;MAErD;IAE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
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ListPageProps } from "./types.js";
|
|
2
|
+
import * as react_jsx_runtime255 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region ui/organisms/ListPage/ListPage.d.ts
|
|
5
|
+
declare function ListPage<T>({
|
|
6
|
+
title,
|
|
7
|
+
description,
|
|
8
|
+
header,
|
|
9
|
+
items,
|
|
10
|
+
totalItems,
|
|
11
|
+
totalPages,
|
|
12
|
+
isLoading,
|
|
13
|
+
isFetching,
|
|
14
|
+
error,
|
|
15
|
+
listState,
|
|
16
|
+
searchPlaceholder,
|
|
17
|
+
filters,
|
|
18
|
+
onRefresh,
|
|
19
|
+
primaryAction,
|
|
20
|
+
toolbar,
|
|
21
|
+
renderItem,
|
|
22
|
+
renderEmpty,
|
|
23
|
+
renderStats,
|
|
24
|
+
className,
|
|
25
|
+
itemClassName
|
|
26
|
+
}: ListPageProps<T>): react_jsx_runtime255.JSX.Element;
|
|
27
|
+
//#endregion
|
|
28
|
+
export { ListPage };
|
|
29
|
+
//# sourceMappingURL=ListPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListPage.d.ts","names":[],"sources":["../../../../ui/organisms/ListPage/ListPage.tsx"],"sourcesContent":[],"mappings":";;;;iBAWgB;;;;;;;;;;;;;;;;;;;;;GAqBb,cAAc,KAAE,oBAAA,CAAA,GAAA,CAAA"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Button } from "../../button.js";
|
|
2
|
+
import { Card, CardContent } from "../../card.js";
|
|
3
|
+
import { HStack, VStack } from "../../stack.js";
|
|
4
|
+
import { Separator } from "../../separator.js";
|
|
5
|
+
import { Pagination } from "../../atoms/Pagination/Pagination.js";
|
|
6
|
+
import "../../atoms/Pagination/index.js";
|
|
7
|
+
import { SearchAndFilter } from "../../molecules/SearchAndFilter/SearchAndFilter.js";
|
|
8
|
+
import "../../molecules/SearchAndFilter/index.js";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { AlertTriangle, Loader2, Plus, RefreshCcw } from "lucide-react";
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import NextLink from "next/link";
|
|
13
|
+
|
|
14
|
+
//#region ui/organisms/ListPage/ListPage.tsx
|
|
15
|
+
function ListPage({ title, description, header, items, totalItems, totalPages, isLoading, isFetching, error, listState, searchPlaceholder, filters = [], onRefresh, primaryAction, toolbar, renderItem, renderEmpty, renderStats, className = "", itemClassName = "" }) {
|
|
16
|
+
const { searchQuery, setSearchQuery, filters: filterValues, setFilter, currentPage, itemsPerPage, setCurrentPage, setItemsPerPage } = listState;
|
|
17
|
+
if (isLoading && !items.length) return /* @__PURE__ */ jsxs(VStack, {
|
|
18
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
19
|
+
children: [header ? header : /* @__PURE__ */ jsxs(VStack, {
|
|
20
|
+
className: "gap-1",
|
|
21
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
22
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
23
|
+
children: title
|
|
24
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
25
|
+
className: "text-muted-foreground text-base",
|
|
26
|
+
children: description
|
|
27
|
+
})]
|
|
28
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: "flex min-h-[400px] items-center justify-center",
|
|
30
|
+
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
31
|
+
className: "flex items-center gap-4 p-6",
|
|
32
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "text-primary h-8 w-8 animate-spin" }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
33
|
+
className: "font-medium",
|
|
34
|
+
children: "Chargement..."
|
|
35
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
36
|
+
className: "text-muted-foreground text-base",
|
|
37
|
+
children: "Récupération des données en cours"
|
|
38
|
+
})] })]
|
|
39
|
+
}) })
|
|
40
|
+
})]
|
|
41
|
+
});
|
|
42
|
+
if (error && !items.length) return /* @__PURE__ */ jsxs(VStack, {
|
|
43
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
44
|
+
children: [header ? header : /* @__PURE__ */ jsxs(VStack, {
|
|
45
|
+
className: "gap-1",
|
|
46
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
47
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
48
|
+
children: title
|
|
49
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
50
|
+
className: "text-muted-foreground text-base",
|
|
51
|
+
children: description
|
|
52
|
+
})]
|
|
53
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
54
|
+
className: "flex min-h-[400px] items-center justify-center",
|
|
55
|
+
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
56
|
+
className: "flex flex-col items-center gap-4 p-6 text-center",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "text-destructive h-12 w-12" }),
|
|
59
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
60
|
+
className: "font-medium",
|
|
61
|
+
children: "Erreur de chargement"
|
|
62
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
63
|
+
className: "text-muted-foreground text-base",
|
|
64
|
+
children: error.message || "Une erreur est survenue"
|
|
65
|
+
})] }),
|
|
66
|
+
onRefresh && /* @__PURE__ */ jsxs(Button, {
|
|
67
|
+
onClick: onRefresh,
|
|
68
|
+
variant: "outline",
|
|
69
|
+
size: "sm",
|
|
70
|
+
children: [/* @__PURE__ */ jsx(RefreshCcw, { className: "mr-2 h-4 w-4" }), "Réessayer"]
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}) })
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
const filterConfigs = filters.map((filter) => ({
|
|
77
|
+
key: filter.key,
|
|
78
|
+
label: filter.label,
|
|
79
|
+
value: filterValues[filter.key] || "",
|
|
80
|
+
options: filter.options,
|
|
81
|
+
onChange: (value) => {
|
|
82
|
+
setFilter(filter.key, value === "all" ? "" : value);
|
|
83
|
+
},
|
|
84
|
+
showCounts: filter.showCounts
|
|
85
|
+
}));
|
|
86
|
+
return /* @__PURE__ */ jsxs(VStack, {
|
|
87
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
88
|
+
children: [
|
|
89
|
+
header ? header : /* @__PURE__ */ jsxs(HStack, {
|
|
90
|
+
className: "items-center justify-between",
|
|
91
|
+
children: [/* @__PURE__ */ jsxs(VStack, {
|
|
92
|
+
className: "gap-1",
|
|
93
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
94
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
95
|
+
children: title
|
|
96
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
97
|
+
className: "text-muted-foreground text-base",
|
|
98
|
+
children: description
|
|
99
|
+
})]
|
|
100
|
+
}), /* @__PURE__ */ jsxs(HStack, {
|
|
101
|
+
className: "items-center gap-4",
|
|
102
|
+
children: [
|
|
103
|
+
toolbar,
|
|
104
|
+
(isLoading || isFetching) && /* @__PURE__ */ jsxs("div", {
|
|
105
|
+
className: "text-muted-foreground flex items-center gap-2 text-base",
|
|
106
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
|
|
107
|
+
className: "hidden sm:inline",
|
|
108
|
+
children: "Mise à jour..."
|
|
109
|
+
})]
|
|
110
|
+
}),
|
|
111
|
+
onRefresh && /* @__PURE__ */ jsxs(Button, {
|
|
112
|
+
variant: "outline",
|
|
113
|
+
size: "sm",
|
|
114
|
+
onClick: onRefresh,
|
|
115
|
+
disabled: Boolean(isLoading),
|
|
116
|
+
"aria-label": "Rafraîchir",
|
|
117
|
+
children: [/* @__PURE__ */ jsx(RefreshCcw, { className: `mr-2 h-4 w-4 ${isLoading || isFetching ? "animate-spin" : ""}` }), /* @__PURE__ */ jsx("span", {
|
|
118
|
+
className: "hidden sm:inline",
|
|
119
|
+
children: "Rafraîchir"
|
|
120
|
+
})]
|
|
121
|
+
}),
|
|
122
|
+
primaryAction && /* @__PURE__ */ jsx(Fragment, { children: primaryAction.href ? /* @__PURE__ */ jsx(NextLink, {
|
|
123
|
+
href: primaryAction.href,
|
|
124
|
+
children: /* @__PURE__ */ jsxs(Button, { children: [
|
|
125
|
+
primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
126
|
+
/* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "hidden sm:inline",
|
|
128
|
+
children: primaryAction.label
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: "sm:hidden",
|
|
132
|
+
children: "Nouveau"
|
|
133
|
+
})
|
|
134
|
+
] })
|
|
135
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
136
|
+
onClick: primaryAction.onClick,
|
|
137
|
+
children: [
|
|
138
|
+
primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
139
|
+
/* @__PURE__ */ jsx("span", {
|
|
140
|
+
className: "hidden sm:inline",
|
|
141
|
+
children: primaryAction.label
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx("span", {
|
|
144
|
+
className: "sm:hidden",
|
|
145
|
+
children: "Nouveau"
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}) })
|
|
149
|
+
]
|
|
150
|
+
})]
|
|
151
|
+
}),
|
|
152
|
+
renderStats && /* @__PURE__ */ jsxs(Fragment, { children: [renderStats(items), /* @__PURE__ */ jsx(Separator, {})] }),
|
|
153
|
+
/* @__PURE__ */ jsx(SearchAndFilter, {
|
|
154
|
+
searchValue: searchQuery,
|
|
155
|
+
onSearchChange: setSearchQuery,
|
|
156
|
+
searchPlaceholder,
|
|
157
|
+
filters: filterConfigs,
|
|
158
|
+
isLoading
|
|
159
|
+
}),
|
|
160
|
+
items.length === 0 && !isLoading ? renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
161
|
+
className: "flex flex-col items-center gap-4 p-8 text-center",
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsx("div", {
|
|
164
|
+
className: "bg-muted flex h-12 w-12 items-center justify-center rounded-full",
|
|
165
|
+
children: /* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-6 w-6 rounded-full" })
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
168
|
+
className: "font-medium",
|
|
169
|
+
children: "Aucun élément trouvé"
|
|
170
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
171
|
+
className: "text-muted-foreground text-base",
|
|
172
|
+
children: searchQuery || Object.values(filterValues).some((v) => v) ? "Essayez de modifier vos critères de recherche" : "Commencez par créer votre premier élément"
|
|
173
|
+
})] }),
|
|
174
|
+
primaryAction && !searchQuery && !Object.values(filterValues).some((v) => v) && /* @__PURE__ */ jsx(Fragment, { children: primaryAction.href ? /* @__PURE__ */ jsx(NextLink, {
|
|
175
|
+
href: primaryAction.href,
|
|
176
|
+
children: /* @__PURE__ */ jsxs(Button, { children: [primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }), primaryAction.label] })
|
|
177
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
178
|
+
onClick: primaryAction.onClick,
|
|
179
|
+
children: [primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }), primaryAction.label]
|
|
180
|
+
}) })
|
|
181
|
+
]
|
|
182
|
+
}) }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
183
|
+
className: `space-y-4 ${itemClassName}`,
|
|
184
|
+
children: items.map((item, index) => renderItem(item, index))
|
|
185
|
+
}), totalPages > 1 && /* @__PURE__ */ jsx(Pagination, {
|
|
186
|
+
currentPage,
|
|
187
|
+
totalPages,
|
|
188
|
+
totalItems,
|
|
189
|
+
itemsPerPage,
|
|
190
|
+
onPageChange: setCurrentPage,
|
|
191
|
+
onItemsPerPageChange: setItemsPerPage,
|
|
192
|
+
disabled: isLoading
|
|
193
|
+
})] })
|
|
194
|
+
]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
export { ListPage };
|
|
200
|
+
//# sourceMappingURL=ListPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListPage.js","names":["Link"],"sources":["../../../../ui/organisms/ListPage/ListPage.tsx"],"sourcesContent":["import React from 'react';\nimport Link from 'next/link';\nimport { AlertTriangle, Loader2, Plus, RefreshCcw } from 'lucide-react';\nimport { Button } from '../../button';\nimport { Card, CardContent } from '../../card';\nimport { VStack, HStack } from '../../stack';\nimport { Separator } from '../../separator';\nimport { SearchAndFilter } from '../../molecules/SearchAndFilter';\nimport { Pagination } from '../../atoms/Pagination';\nimport type { ListPageProps } from './types';\n\nexport function ListPage<T>({\n title,\n description,\n header,\n items,\n totalItems,\n totalPages,\n isLoading,\n isFetching,\n error,\n listState,\n searchPlaceholder,\n filters = [],\n onRefresh,\n primaryAction,\n toolbar,\n renderItem,\n renderEmpty,\n renderStats,\n className = '',\n itemClassName = '',\n}: ListPageProps<T>) {\n const {\n searchQuery,\n setSearchQuery,\n filters: filterValues,\n setFilter,\n currentPage,\n itemsPerPage,\n setCurrentPage,\n setItemsPerPage,\n } = listState;\n\n // Loading state with no items\n if (isLoading && !items.length) {\n return (\n <VStack className={`space-y-4 md:space-y-6 ${className}`}>\n {header ? (\n header\n ) : (\n <VStack className=\"gap-1\">\n <h1 className=\"text-2xl font-bold md:text-3xl\">{title}</h1>\n {description && (\n <p className=\"text-muted-foreground text-base\">{description}</p>\n )}\n </VStack>\n )}\n\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Card>\n <CardContent className=\"flex items-center gap-4 p-6\">\n <Loader2 className=\"text-primary h-8 w-8 animate-spin\" />\n <div>\n <h3 className=\"font-medium\">Chargement...</h3>\n <p className=\"text-muted-foreground text-base\">\n Récupération des données en cours\n </p>\n </div>\n </CardContent>\n </Card>\n </div>\n </VStack>\n );\n }\n\n // Error state with no items\n if (error && !items.length) {\n return (\n <VStack className={`space-y-4 md:space-y-6 ${className}`}>\n {header ? (\n header\n ) : (\n <VStack className=\"gap-1\">\n <h1 className=\"text-2xl font-bold md:text-3xl\">{title}</h1>\n {description && (\n <p className=\"text-muted-foreground text-base\">{description}</p>\n )}\n </VStack>\n )}\n\n <div className=\"flex min-h-[400px] items-center justify-center\">\n <Card>\n <CardContent className=\"flex flex-col items-center gap-4 p-6 text-center\">\n <AlertTriangle className=\"text-destructive h-12 w-12\" />\n <div>\n <h3 className=\"font-medium\">Erreur de chargement</h3>\n <p className=\"text-muted-foreground text-base\">\n {error.message || 'Une erreur est survenue'}\n </p>\n </div>\n {onRefresh && (\n <Button onClick={onRefresh} variant=\"outline\" size=\"sm\">\n <RefreshCcw className=\"mr-2 h-4 w-4\" />\n Réessayer\n </Button>\n )}\n </CardContent>\n </Card>\n </div>\n </VStack>\n );\n }\n\n // Prepare filter configurations\n const filterConfigs = filters.map((filter) => ({\n key: filter.key,\n label: filter.label,\n value: filterValues[filter.key] || '',\n options: filter.options,\n onChange: (value: string) => {\n setFilter(filter.key, value === 'all' ? '' : value);\n },\n showCounts: filter.showCounts,\n }));\n\n return (\n <VStack className={`space-y-4 md:space-y-6 ${className}`}>\n {/* Header */}\n {header ? (\n header\n ) : (\n <HStack className=\"items-center justify-between\">\n <VStack className=\"gap-1\">\n <h1 className=\"text-2xl font-bold md:text-3xl\">{title}</h1>\n {description && (\n <p className=\"text-muted-foreground text-base\">{description}</p>\n )}\n </VStack>\n\n <HStack className=\"items-center gap-4\">\n {toolbar}\n {(isLoading || isFetching) && (\n <div className=\"text-muted-foreground flex items-center gap-2 text-base\">\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n <span className=\"hidden sm:inline\">Mise à jour...</span>\n </div>\n )}\n\n {onRefresh && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onRefresh}\n disabled={Boolean(isLoading)}\n aria-label=\"Rafraîchir\"\n >\n <RefreshCcw\n className={`mr-2 h-4 w-4 ${isLoading || isFetching ? 'animate-spin' : ''}`}\n />\n <span className=\"hidden sm:inline\">Rafraîchir</span>\n </Button>\n )}\n\n {primaryAction && (\n <>\n {primaryAction.href ? (\n <Link href={primaryAction.href}>\n <Button>\n {primaryAction.icon || <Plus className=\"mr-2 h-4 w-4\" />}\n <span className=\"hidden sm:inline\">\n {primaryAction.label}\n </span>\n <span className=\"sm:hidden\">Nouveau</span>\n </Button>\n </Link>\n ) : (\n <Button onClick={primaryAction.onClick}>\n {primaryAction.icon || <Plus className=\"mr-2 h-4 w-4\" />}\n <span className=\"hidden sm:inline\">\n {primaryAction.label}\n </span>\n <span className=\"sm:hidden\">Nouveau</span>\n </Button>\n )}\n </>\n )}\n </HStack>\n </HStack>\n )}\n\n {/* Stats (optional) */}\n {renderStats && (\n <>\n {renderStats(items)}\n <Separator />\n </>\n )}\n\n {/* Search and Filters */}\n <SearchAndFilter\n searchValue={searchQuery}\n onSearchChange={setSearchQuery}\n searchPlaceholder={searchPlaceholder}\n filters={filterConfigs}\n isLoading={isLoading}\n />\n\n {/* Content */}\n {items.length === 0 && !isLoading ? (\n renderEmpty ? (\n renderEmpty()\n ) : (\n <Card>\n <CardContent className=\"flex flex-col items-center gap-4 p-8 text-center\">\n <div className=\"bg-muted flex h-12 w-12 items-center justify-center rounded-full\">\n <div className=\"bg-muted-foreground/20 h-6 w-6 rounded-full\" />\n </div>\n <div>\n <h3 className=\"font-medium\">Aucun élément trouvé</h3>\n <p className=\"text-muted-foreground text-base\">\n {searchQuery || Object.values(filterValues).some((v) => v)\n ? 'Essayez de modifier vos critères de recherche'\n : 'Commencez par créer votre premier élément'}\n </p>\n </div>\n {primaryAction &&\n !searchQuery &&\n !Object.values(filterValues).some((v) => v) && (\n <>\n {primaryAction.href ? (\n <Link href={primaryAction.href}>\n <Button>\n {primaryAction.icon || (\n <Plus className=\"mr-2 h-4 w-4\" />\n )}\n {primaryAction.label}\n </Button>\n </Link>\n ) : (\n <Button onClick={primaryAction.onClick}>\n {primaryAction.icon || (\n <Plus className=\"mr-2 h-4 w-4\" />\n )}\n {primaryAction.label}\n </Button>\n )}\n </>\n )}\n </CardContent>\n </Card>\n )\n ) : (\n <>\n {/* Items List */}\n <div className={`space-y-4 ${itemClassName}`}>\n {items.map((item, index) => renderItem(item, index))}\n </div>\n\n {/* Pagination */}\n {totalPages > 1 && (\n <Pagination\n currentPage={currentPage}\n totalPages={totalPages}\n totalItems={totalItems}\n itemsPerPage={itemsPerPage}\n onPageChange={setCurrentPage}\n onItemsPerPageChange={setItemsPerPage}\n disabled={isLoading}\n />\n )}\n </>\n )}\n </VStack>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,SAAgB,SAAY,EAC1B,OACA,aACA,QACA,OACA,YACA,YACA,WACA,YACA,OACA,WACA,mBACA,UAAU,EAAE,EACZ,WACA,eACA,SACA,YACA,aACA,aACA,YAAY,IACZ,gBAAgB,MACG;CACnB,MAAM,EACJ,aACA,gBACA,SAAS,cACT,WACA,aACA,cACA,gBACA,oBACE;AAGJ,KAAI,aAAa,CAAC,MAAM,OACtB,QACE,qBAAC;EAAO,WAAW,0BAA0B;aAC1C,SACC,SAEA,qBAAC;GAAO,WAAU;cAChB,oBAAC;IAAG,WAAU;cAAkC;KAAW,EAC1D,eACC,oBAAC;IAAE,WAAU;cAAmC;KAAgB;IAE3D,EAGX,oBAAC;GAAI,WAAU;aACb,oBAAC,kBACC,qBAAC;IAAY,WAAU;eACrB,oBAAC,WAAQ,WAAU,sCAAsC,EACzD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,oBAAC,QAAK,WAAU,iBAAiB,EAElC,cAAc;OACR,GAEV;;KAEK,GACT,GAGT,4CAEE,oBAAC;IAAI,WAAW,aAAa;cAC1B,MAAM,KAAK,MAAM,UAAU,WAAW,MAAM,MAAM,CAAC;KAChD,EAGL,aAAa,KACZ,oBAAC;IACc;IACD;IACA;IACE;IACd,cAAc;IACd,sBAAsB;IACtB,UAAU;KACV,IAEH;;GAEE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { UseListStateReturn } from "../../useListState.js";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
import { FilterOption } from "@contractspec/lib.ui-kit-web/ui/atoms/FilterSelect";
|
|
4
|
+
|
|
5
|
+
//#region ui/organisms/ListPage/types.d.ts
|
|
6
|
+
interface ListPageFilter {
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
options: FilterOption[];
|
|
10
|
+
showCounts?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ListPageProps<T = unknown> {
|
|
13
|
+
title: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
header?: ReactNode;
|
|
16
|
+
items: T[];
|
|
17
|
+
totalItems: number;
|
|
18
|
+
totalPages: number;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
isFetching?: boolean;
|
|
21
|
+
error?: Error | null;
|
|
22
|
+
listState: UseListStateReturn;
|
|
23
|
+
searchPlaceholder?: string;
|
|
24
|
+
filters?: ListPageFilter[];
|
|
25
|
+
onRefresh?: () => void;
|
|
26
|
+
primaryAction?: {
|
|
27
|
+
label: string;
|
|
28
|
+
href?: string;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
icon?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
toolbar?: ReactNode;
|
|
33
|
+
renderItem: (item: T, index: number) => ReactNode;
|
|
34
|
+
renderEmpty?: () => ReactNode;
|
|
35
|
+
renderStats?: (items: T[]) => ReactNode;
|
|
36
|
+
className?: string;
|
|
37
|
+
itemClassName?: string;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ListPageFilter, ListPageProps };
|
|
41
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","names":[],"sources":["../../../../ui/organisms/ListPage/types.ts"],"sourcesContent":[],"mappings":";;;;;UAIiB,cAAA;;EAAA,KAAA,EAAA,MAAA;EAOA,OAAA,EAJN,YAImB,EAAA;EAInB,UAAA,CAAA,EAAA,OAAA;;AAQD,UAZO,aAYP,CAAA,IAAA,OAAA,CAAA,CAAA;EAGG,KAAA,EAAA,MAAA;EAID,WAAA,CAAA,EAAA,MAAA;EAQD,MAAA,CAAA,EAvBA,SAuBA;EAEC,KAAA,EAtBH,CAsBG,EAAA;EAGS,UAAA,EAAA,MAAA;EAAqB,UAAA,EAAA,MAAA;EACpB,SAAA,EAAA,OAAA;EACE,UAAA,CAAA,EAAA,OAAA;EAAQ,KAAA,CAAA,EAtBtB,KAsBsB,GAAA,IAAA;EAAS,SAAA,EAnB5B,kBAmB4B;;YAf7B;;;;;;WAQD;;YAEC;qBAGS,qBAAqB;sBACpB;wBACE,QAAQ"}
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime68 from "react/jsx-runtime";
|
|
3
|
+
import { VariantProps } from "class-variance-authority";
|
|
4
|
+
import * as class_variance_authority_types9 from "class-variance-authority/types";
|
|
5
|
+
|
|
6
|
+
//#region ui/page-header.d.ts
|
|
7
|
+
declare const headerVariants: (props?: ({
|
|
8
|
+
spacing?: "sm" | "md" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types9.ClassProp) | undefined) => string;
|
|
10
|
+
interface PageHeaderProps extends VariantProps<typeof headerVariants> {
|
|
11
|
+
breadcrumb?: React$1.ReactNode;
|
|
12
|
+
title: React$1.ReactNode;
|
|
13
|
+
subtitle?: React$1.ReactNode;
|
|
14
|
+
actions?: React$1.ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
declare function PageHeader({
|
|
18
|
+
breadcrumb,
|
|
19
|
+
title,
|
|
20
|
+
subtitle,
|
|
21
|
+
actions,
|
|
22
|
+
spacing,
|
|
23
|
+
className
|
|
24
|
+
}: PageHeaderProps): react_jsx_runtime68.JSX.Element;
|
|
25
|
+
//#endregion
|
|
26
|
+
export { PageHeader, PageHeaderProps };
|
|
27
|
+
//# sourceMappingURL=page-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.d.ts","names":[],"sources":["../../ui/page-header.tsx"],"sourcesContent":[],"mappings":";;;;;;cAKM;;IAWJ,+BAAA,CAAA;UAEe,eAAA,SAAwB,oBAAoB;EAbvD,UAAA,CAAA,EAcS,OAAA,CAAM,SAHnB;EAEe,KAAA,EAER,OAAA,CAAM,SAFkB;EAA4B,QAAA,CAAA,EAGhD,OAAA,CAAM,SAH0C;EAC9C,OAAM,CAAA,EAGT,OAAA,CAAM,SAHG;EACZ,SAAM,CAAA,EAAA,MAAA;;AAEH,iBAII,UAAA,CAJE;EAAA,UAAA;EAAA,KAAA;EAAA,QAAA;EAAA,OAAA;EAAA,OAAA;EAAA;AAAA,CAAA,EAWf,eAXe,CAAA,EAWA,mBAAA,CAAA,GAAA,CAAA,OAXA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { HStack, VStack } from "./stack.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
//#region ui/page-header.tsx
|
|
8
|
+
const headerVariants = cva("", {
|
|
9
|
+
variants: { spacing: {
|
|
10
|
+
sm: "gap-1",
|
|
11
|
+
md: "gap-2",
|
|
12
|
+
lg: "gap-3"
|
|
13
|
+
} },
|
|
14
|
+
defaultVariants: { spacing: "md" }
|
|
15
|
+
});
|
|
16
|
+
function PageHeader({ breadcrumb, title, subtitle, actions, spacing, className }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(VStack, {
|
|
18
|
+
className: cn(headerVariants({ spacing }), className),
|
|
19
|
+
children: [breadcrumb, /* @__PURE__ */ jsxs(HStack, {
|
|
20
|
+
className: "flex-col items-start justify-between md:flex-row",
|
|
21
|
+
children: [/* @__PURE__ */ jsxs(VStack, {
|
|
22
|
+
className: "gap-1",
|
|
23
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
24
|
+
className: "text-2xl font-semibold md:text-3xl",
|
|
25
|
+
children: title
|
|
26
|
+
}), subtitle ? /* @__PURE__ */ jsx("p", {
|
|
27
|
+
className: "text-muted-foreground text-base",
|
|
28
|
+
children: subtitle
|
|
29
|
+
}) : null]
|
|
30
|
+
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
31
|
+
className: "flex items-center gap-2",
|
|
32
|
+
children: actions
|
|
33
|
+
}) : null]
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PageHeader };
|
|
40
|
+
//# sourceMappingURL=page-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.js","names":[],"sources":["../../ui/page-header.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@contractspec/lib.ui-kit-core/utils';\nimport { HStack, VStack } from './stack';\n\nconst headerVariants = cva('', {\n variants: {\n spacing: {\n sm: 'gap-1',\n md: 'gap-2',\n lg: 'gap-3',\n },\n },\n defaultVariants: {\n spacing: 'md',\n },\n});\n\nexport interface PageHeaderProps extends VariantProps<typeof headerVariants> {\n breadcrumb?: React.ReactNode;\n title: React.ReactNode;\n subtitle?: React.ReactNode;\n actions?: React.ReactNode;\n className?: string;\n}\n\nexport function PageHeader({\n breadcrumb,\n title,\n subtitle,\n actions,\n spacing,\n className,\n}: PageHeaderProps) {\n return (\n <VStack className={cn(headerVariants({ spacing }), className)}>\n {breadcrumb}\n <HStack className=\"flex-col items-start justify-between md:flex-row\">\n <VStack className=\"gap-1\">\n <h1 className=\"text-2xl font-semibold md:text-3xl\">{title}</h1>\n {subtitle ? (\n <p className=\"text-muted-foreground text-base\">{subtitle}</p>\n ) : null}\n </VStack>\n {actions ? (\n <div className=\"flex items-center gap-2\">{actions}</div>\n ) : null}\n </HStack>\n </VStack>\n );\n}\n"],"mappings":";;;;;;;AAKA,MAAM,iBAAiB,IAAI,IAAI;CAC7B,UAAU,EACR,SAAS;EACP,IAAI;EACJ,IAAI;EACJ,IAAI;EACL,EACF;CACD,iBAAiB,EACf,SAAS,MACV;CACF,CAAC;AAUF,SAAgB,WAAW,EACzB,YACA,OACA,UACA,SACA,SACA,aACkB;AAClB,QACE,qBAAC;EAAO,WAAW,GAAG,eAAe,EAAE,SAAS,CAAC,EAAE,UAAU;aAC1D,YACD,qBAAC;GAAO,WAAU;cAChB,qBAAC;IAAO,WAAU;eAChB,oBAAC;KAAG,WAAU;eAAsC;MAAW,EAC9D,WACC,oBAAC;KAAE,WAAU;eAAmC;MAAa,GAC3D;KACG,EACR,UACC,oBAAC;IAAI,WAAU;cAA2B;KAAc,GACtD;IACG;GACF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ButtonProps } from "./button.js";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import * as react_jsx_runtime70 from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region ui/pagination.d.ts
|
|
6
|
+
declare const Pagination: {
|
|
7
|
+
({
|
|
8
|
+
className,
|
|
9
|
+
...props
|
|
10
|
+
}: React$1.ComponentPropsWithoutRef<"nav">): react_jsx_runtime70.JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const PaginationContent: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
14
|
+
declare const PaginationItem: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
15
|
+
type PaginationLinkProps = {
|
|
16
|
+
isActive?: boolean;
|
|
17
|
+
} & Pick<ButtonProps, 'size'> & React$1.ComponentPropsWithoutRef<'a'>;
|
|
18
|
+
declare const PaginationLink: {
|
|
19
|
+
({
|
|
20
|
+
className,
|
|
21
|
+
isActive,
|
|
22
|
+
size,
|
|
23
|
+
...props
|
|
24
|
+
}: PaginationLinkProps): react_jsx_runtime70.JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
declare const PaginationPrevious: {
|
|
28
|
+
({
|
|
29
|
+
className,
|
|
30
|
+
...props
|
|
31
|
+
}: React$1.ComponentProps<typeof PaginationLink>): react_jsx_runtime70.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
declare const PaginationNext: {
|
|
35
|
+
({
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: React$1.ComponentProps<typeof PaginationLink>): react_jsx_runtime70.JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
declare const PaginationEllipsis: {
|
|
42
|
+
({
|
|
43
|
+
className,
|
|
44
|
+
...props
|
|
45
|
+
}: React$1.ComponentPropsWithoutRef<"span">): react_jsx_runtime70.JSX.Element;
|
|
46
|
+
displayName: string;
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
50
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|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