@lssm-tech/lib.ui-kit-web 3.13.4
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 +233 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/ui/accordion.js +1 -0
- package/dist/browser/ui/alert-dialog.js +1 -0
- package/dist/browser/ui/alert.js +1 -0
- package/dist/browser/ui/aspect-ratio.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/FilterSelect.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/index.js +1 -0
- package/dist/browser/ui/atoms/FilterSelect/types.js +0 -0
- package/dist/browser/ui/atoms/LoadingSpinner/LoadingSpinner.js +1 -0
- package/dist/browser/ui/atoms/LoadingSpinner/index.js +1 -0
- package/dist/browser/ui/atoms/Pagination/Pagination.js +1 -0
- package/dist/browser/ui/atoms/Pagination/index.js +1 -0
- package/dist/browser/ui/atoms/Pagination/types.js +0 -0
- package/dist/browser/ui/atoms/SearchInput/SearchInput.js +1 -0
- package/dist/browser/ui/atoms/SearchInput/index.js +1 -0
- package/dist/browser/ui/atoms/SearchInput/types.js +0 -0
- package/dist/browser/ui/avatar.js +1 -0
- package/dist/browser/ui/badge.js +1 -0
- package/dist/browser/ui/breadcrumb.js +1 -0
- package/dist/browser/ui/button-group.js +1 -0
- package/dist/browser/ui/button.js +1 -0
- package/dist/browser/ui/calendar.js +1 -0
- package/dist/browser/ui/card.js +1 -0
- package/dist/browser/ui/carousel.js +1 -0
- package/dist/browser/ui/chart.js +1 -0
- package/dist/browser/ui/checkbox.js +1 -0
- package/dist/browser/ui/collapsible.js +1 -0
- package/dist/browser/ui/combobox.js +1 -0
- package/dist/browser/ui/command.js +1 -0
- package/dist/browser/ui/confirm-dialog.js +1 -0
- package/dist/browser/ui/context-menu.js +1 -0
- package/dist/browser/ui/contracts.typecheck.js +0 -0
- package/dist/browser/ui/cta.js +1 -0
- package/dist/browser/ui/data-table.js +1 -0
- package/dist/browser/ui/data-table.parts.js +1 -0
- package/dist/browser/ui/date-picker.js +1 -0
- package/dist/browser/ui/date-range-picker.js +1 -0
- package/dist/browser/ui/datetime-picker.js +1 -0
- package/dist/browser/ui/dialog.js +1 -0
- package/dist/browser/ui/direction.js +1 -0
- package/dist/browser/ui/drawer.js +1 -0
- package/dist/browser/ui/dropdown-menu.js +1 -0
- package/dist/browser/ui/empty-state.js +1 -0
- package/dist/browser/ui/empty.js +1 -0
- package/dist/browser/ui/field.js +1 -0
- package/dist/browser/ui/focus-on-route-change.js +1 -0
- package/dist/browser/ui/form.js +1 -0
- package/dist/browser/ui/hover-card.js +1 -0
- package/dist/browser/ui/input-group.js +1 -0
- package/dist/browser/ui/input-otp.js +1 -0
- package/dist/browser/ui/input-password.js +1 -0
- package/dist/browser/ui/input.js +1 -0
- package/dist/browser/ui/item.js +1 -0
- package/dist/browser/ui/kbd.js +1 -0
- package/dist/browser/ui/label.js +1 -0
- package/dist/browser/ui/link.js +1 -0
- package/dist/browser/ui/list.js +1 -0
- package/dist/browser/ui/live-region.js +1 -0
- package/dist/browser/ui/loading-button.js +1 -0
- package/dist/browser/ui/map/MapBase.js +1 -0
- package/dist/browser/ui/map/MapGeoJsonOverlay.js +1 -0
- package/dist/browser/ui/map/MapHeatmapH3.js +1 -0
- package/dist/browser/ui/map/MapMarkers.js +1 -0
- package/dist/browser/ui/map/index.js +1 -0
- package/dist/browser/ui/marketing/FeatureGrid.js +1 -0
- package/dist/browser/ui/marketing/Hero.js +1 -0
- package/dist/browser/ui/marketing/PricingTable.js +1 -0
- package/dist/browser/ui/marketing/index.js +1 -0
- package/dist/browser/ui/menubar.js +1 -0
- package/dist/browser/ui/molecules/Autocomplete/index.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/SearchAndFilter.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/index.js +1 -0
- package/dist/browser/ui/molecules/SearchAndFilter/types.js +0 -0
- package/dist/browser/ui/molecules/SkeletonList.js +1 -0
- package/dist/browser/ui/native-select.js +1 -0
- package/dist/browser/ui/nav-layout.js +1 -0
- package/dist/browser/ui/navigation-menu.js +1 -0
- package/dist/browser/ui/organisms/ErrorBoundary/ErrorBoundary.js +1 -0
- package/dist/browser/ui/organisms/ErrorBoundary/index.js +1 -0
- package/dist/browser/ui/organisms/ListPage/ListPage.js +1 -0
- package/dist/browser/ui/organisms/ListPage/index.js +1 -0
- package/dist/browser/ui/organisms/ListPage/types.js +0 -0
- package/dist/browser/ui/page-header.js +1 -0
- package/dist/browser/ui/pagination.js +1 -0
- package/dist/browser/ui/popover.js +1 -0
- package/dist/browser/ui/progress.js +1 -0
- package/dist/browser/ui/radio-group.js +1 -0
- package/dist/browser/ui/resizable.js +1 -0
- package/dist/browser/ui/route-announcer.js +1 -0
- package/dist/browser/ui/scroll-area.js +1 -0
- package/dist/browser/ui/section.js +1 -0
- package/dist/browser/ui/select.js +1 -0
- package/dist/browser/ui/separator.js +1 -0
- package/dist/browser/ui/sheet.js +1 -0
- package/dist/browser/ui/sidebar.js +1 -0
- package/dist/browser/ui/skeleton.js +1 -0
- package/dist/browser/ui/skip-link.js +1 -0
- package/dist/browser/ui/slider.js +1 -0
- package/dist/browser/ui/sonner.js +1 -0
- package/dist/browser/ui/spinner.js +1 -0
- package/dist/browser/ui/stack.js +1 -0
- package/dist/browser/ui/stat-card-group.js +1 -0
- package/dist/browser/ui/stepper.js +1 -0
- package/dist/browser/ui/switch.js +1 -0
- package/dist/browser/ui/table.js +1 -0
- package/dist/browser/ui/tabs.js +1 -0
- package/dist/browser/ui/text.js +1 -0
- package/dist/browser/ui/textarea.js +1 -0
- package/dist/browser/ui/time-picker.js +1 -0
- package/dist/browser/ui/toast.js +1 -0
- package/dist/browser/ui/toaster.js +1 -0
- package/dist/browser/ui/toggle-group.js +1 -0
- package/dist/browser/ui/toggle.js +1 -0
- package/dist/browser/ui/tooltip.js +1 -0
- package/dist/browser/ui/typography.js +1 -0
- package/dist/browser/ui/use-media-query.js +1 -0
- package/dist/browser/ui/use-mobile.js +1 -0
- package/dist/browser/ui/use-reduced-motion.js +1 -0
- package/dist/browser/ui/use-toast.js +1 -0
- package/dist/browser/ui/useListState.js +1 -0
- package/dist/browser/ui/usecases/UseCaseCard.js +1 -0
- package/dist/browser/ui/usecases/UserStoryCard.js +1 -0
- package/dist/browser/ui/usecases/index.js +1 -0
- package/dist/browser/ui/utils.js +1 -0
- package/dist/browser/ui/visualization/Visualization.js +1 -0
- package/dist/browser/ui/visualization/Visualization.support.js +1 -0
- package/dist/browser/ui/visualization/index.js +1 -0
- package/dist/browser/ui/visually-hidden.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/ui/accordion.d.ts +7 -0
- package/dist/ui/accordion.js +2 -0
- package/dist/ui/alert-dialog.d.ts +14 -0
- package/dist/ui/alert-dialog.js +2 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.js +2 -0
- package/dist/ui/aspect-ratio.d.ts +3 -0
- package/dist/ui/aspect-ratio.js +2 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.d.ts +3 -0
- package/dist/ui/atoms/FilterSelect/FilterSelect.js +2 -0
- package/dist/ui/atoms/FilterSelect/index.d.ts +2 -0
- package/dist/ui/atoms/FilterSelect/index.js +2 -0
- package/dist/ui/atoms/FilterSelect/types.d.ts +5 -0
- package/dist/ui/atoms/FilterSelect/types.js +1 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.d.ts +19 -0
- package/dist/ui/atoms/LoadingSpinner/LoadingSpinner.js +2 -0
- package/dist/ui/atoms/LoadingSpinner/index.d.ts +1 -0
- package/dist/ui/atoms/LoadingSpinner/index.js +2 -0
- package/dist/ui/atoms/Pagination/Pagination.d.ts +3 -0
- package/dist/ui/atoms/Pagination/Pagination.js +2 -0
- package/dist/ui/atoms/Pagination/index.d.ts +2 -0
- package/dist/ui/atoms/Pagination/index.js +2 -0
- package/dist/ui/atoms/Pagination/types.d.ts +3 -0
- package/dist/ui/atoms/Pagination/types.js +1 -0
- package/dist/ui/atoms/SearchInput/SearchInput.d.ts +3 -0
- package/dist/ui/atoms/SearchInput/SearchInput.js +2 -0
- package/dist/ui/atoms/SearchInput/index.d.ts +2 -0
- package/dist/ui/atoms/SearchInput/index.js +2 -0
- package/dist/ui/atoms/SearchInput/types.d.ts +3 -0
- package/dist/ui/atoms/SearchInput/types.js +1 -0
- package/dist/ui/avatar.d.ts +6 -0
- package/dist/ui/avatar.js +2 -0
- package/dist/ui/badge.d.ts +9 -0
- package/dist/ui/badge.js +2 -0
- package/dist/ui/breadcrumb.d.ts +11 -0
- package/dist/ui/breadcrumb.js +2 -0
- package/dist/ui/button-group.d.ts +5 -0
- package/dist/ui/button-group.js +2 -0
- package/dist/ui/button.d.ts +17 -0
- package/dist/ui/button.js +2 -0
- package/dist/ui/calendar.d.ts +8 -0
- package/dist/ui/calendar.js +2 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.js +2 -0
- package/dist/ui/carousel.d.ts +19 -0
- package/dist/ui/carousel.js +2 -0
- package/dist/ui/chart.d.ts +45 -0
- package/dist/ui/chart.js +2 -0
- package/dist/ui/checkbox.d.ts +4 -0
- package/dist/ui/checkbox.js +2 -0
- package/dist/ui/collapsible.d.ts +5 -0
- package/dist/ui/collapsible.js +2 -0
- package/dist/ui/combobox.d.ts +32 -0
- package/dist/ui/combobox.js +2 -0
- package/dist/ui/combobox.test.d.ts +1 -0
- package/dist/ui/command.d.ts +18 -0
- package/dist/ui/command.js +2 -0
- package/dist/ui/confirm-dialog.d.ts +14 -0
- package/dist/ui/confirm-dialog.js +2 -0
- package/dist/ui/context-menu.d.ts +31 -0
- package/dist/ui/context-menu.js +2 -0
- package/dist/ui/contracts.typecheck.d.ts +1 -0
- package/dist/ui/contracts.typecheck.js +1 -0
- package/dist/ui/cta.d.ts +12 -0
- package/dist/ui/cta.js +2 -0
- package/dist/ui/data-table.d.ts +8 -0
- package/dist/ui/data-table.js +2 -0
- package/dist/ui/data-table.parts.d.ts +19 -0
- package/dist/ui/data-table.parts.js +2 -0
- package/dist/ui/data-table.test.d.ts +1 -0
- package/dist/ui/date-picker.d.ts +5 -0
- package/dist/ui/date-picker.js +2 -0
- package/dist/ui/date-range-picker.d.ts +6 -0
- package/dist/ui/date-range-picker.js +2 -0
- package/dist/ui/datetime-picker.d.ts +6 -0
- package/dist/ui/datetime-picker.js +2 -0
- package/dist/ui/dialog.d.ts +15 -0
- package/dist/ui/dialog.js +2 -0
- package/dist/ui/direction.d.ts +9 -0
- package/dist/ui/direction.js +2 -0
- package/dist/ui/drawer.d.ts +13 -0
- package/dist/ui/drawer.js +2 -0
- package/dist/ui/dropdown-menu.d.ts +25 -0
- package/dist/ui/dropdown-menu.js +2 -0
- package/dist/ui/empty-state.d.ts +9 -0
- package/dist/ui/empty-state.js +2 -0
- package/dist/ui/empty.d.ts +12 -0
- package/dist/ui/empty.js +2 -0
- package/dist/ui/field.d.ts +20 -0
- package/dist/ui/field.js +2 -0
- package/dist/ui/focus-on-route-change.d.ts +3 -0
- package/dist/ui/focus-on-route-change.js +2 -0
- package/dist/ui/form.d.ts +26 -0
- package/dist/ui/form.js +2 -0
- package/dist/ui/hover-card.d.ts +6 -0
- package/dist/ui/hover-card.js +2 -0
- package/dist/ui/input-group.d.ts +18 -0
- package/dist/ui/input-group.js +2 -0
- package/dist/ui/input-otp.d.ts +16 -0
- package/dist/ui/input-otp.js +2 -0
- package/dist/ui/input-password.d.ts +11 -0
- package/dist/ui/input-password.js +2 -0
- package/dist/ui/input-password.test.d.ts +1 -0
- package/dist/ui/input.d.ts +7 -0
- package/dist/ui/input.js +2 -0
- package/dist/ui/item.d.ts +23 -0
- package/dist/ui/item.js +2 -0
- package/dist/ui/kbd.d.ts +3 -0
- package/dist/ui/kbd.js +2 -0
- package/dist/ui/label.d.ts +4 -0
- package/dist/ui/label.js +2 -0
- package/dist/ui/link.d.ts +6 -0
- package/dist/ui/link.js +2 -0
- package/dist/ui/list.d.ts +20 -0
- package/dist/ui/list.js +2 -0
- package/dist/ui/live-region.d.ts +10 -0
- package/dist/ui/live-region.js +2 -0
- package/dist/ui/loading-button.d.ts +9 -0
- package/dist/ui/loading-button.js +2 -0
- package/dist/ui/map/MapBase.d.ts +22 -0
- package/dist/ui/map/MapBase.js +2 -0
- package/dist/ui/map/MapGeoJsonOverlay.d.ts +10 -0
- package/dist/ui/map/MapGeoJsonOverlay.js +2 -0
- package/dist/ui/map/MapHeatmapH3.d.ts +12 -0
- package/dist/ui/map/MapHeatmapH3.js +2 -0
- package/dist/ui/map/MapMarkers.d.ts +12 -0
- package/dist/ui/map/MapMarkers.js +2 -0
- package/dist/ui/map/index.d.ts +4 -0
- package/dist/ui/map/index.js +2 -0
- package/dist/ui/marketing/FeatureGrid.d.ts +4 -0
- package/dist/ui/marketing/FeatureGrid.js +2 -0
- package/dist/ui/marketing/Hero.d.ts +16 -0
- package/dist/ui/marketing/Hero.js +2 -0
- package/dist/ui/marketing/PricingTable.d.ts +4 -0
- package/dist/ui/marketing/PricingTable.js +2 -0
- package/dist/ui/marketing/index.d.ts +3 -0
- package/dist/ui/marketing/index.js +2 -0
- package/dist/ui/menubar.d.ts +26 -0
- package/dist/ui/menubar.js +2 -0
- package/dist/ui/molecules/Autocomplete/index.d.ts +1 -0
- package/dist/ui/molecules/Autocomplete/index.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.d.ts +3 -0
- package/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/index.d.ts +2 -0
- package/dist/ui/molecules/SearchAndFilter/index.js +2 -0
- package/dist/ui/molecules/SearchAndFilter/types.d.ts +3 -0
- package/dist/ui/molecules/SearchAndFilter/types.js +1 -0
- package/dist/ui/molecules/SkeletonList.d.ts +7 -0
- package/dist/ui/molecules/SkeletonList.js +2 -0
- package/dist/ui/native-select.d.ts +4 -0
- package/dist/ui/native-select.js +2 -0
- package/dist/ui/nav-layout.d.ts +47 -0
- package/dist/ui/nav-layout.js +2 -0
- package/dist/ui/navigation-menu.d.ts +14 -0
- package/dist/ui/navigation-menu.js +2 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.d.ts +25 -0
- package/dist/ui/organisms/ErrorBoundary/ErrorBoundary.js +2 -0
- package/dist/ui/organisms/ErrorBoundary/index.d.ts +2 -0
- package/dist/ui/organisms/ErrorBoundary/index.js +2 -0
- package/dist/ui/organisms/ListPage/ListPage.d.ts +2 -0
- package/dist/ui/organisms/ListPage/ListPage.js +2 -0
- package/dist/ui/organisms/ListPage/index.d.ts +2 -0
- package/dist/ui/organisms/ListPage/index.js +2 -0
- package/dist/ui/organisms/ListPage/types.d.ts +37 -0
- package/dist/ui/organisms/ListPage/types.js +1 -0
- package/dist/ui/page-header.d.ts +9 -0
- package/dist/ui/page-header.js +2 -0
- package/dist/ui/pagination.d.ts +17 -0
- package/dist/ui/pagination.js +2 -0
- package/dist/ui/popover.d.ts +7 -0
- package/dist/ui/popover.js +2 -0
- package/dist/ui/progress.d.ts +4 -0
- package/dist/ui/progress.js +2 -0
- package/dist/ui/radio-group.d.ts +5 -0
- package/dist/ui/radio-group.js +2 -0
- package/dist/ui/resizable.d.ts +8 -0
- package/dist/ui/resizable.js +2 -0
- package/dist/ui/route-announcer.d.ts +3 -0
- package/dist/ui/route-announcer.js +2 -0
- package/dist/ui/scroll-area.d.ts +5 -0
- package/dist/ui/scroll-area.js +2 -0
- package/dist/ui/section.d.ts +15 -0
- package/dist/ui/section.js +2 -0
- package/dist/ui/select.d.ts +15 -0
- package/dist/ui/select.js +2 -0
- package/dist/ui/select.test.d.ts +1 -0
- package/dist/ui/separator.d.ts +4 -0
- package/dist/ui/separator.js +2 -0
- package/dist/ui/sheet.d.ts +13 -0
- package/dist/ui/sheet.js +2 -0
- package/dist/ui/sidebar.d.ts +69 -0
- package/dist/ui/sidebar.js +2 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.js +2 -0
- package/dist/ui/skip-link.d.ts +7 -0
- package/dist/ui/skip-link.js +2 -0
- package/dist/ui/slider.d.ts +4 -0
- package/dist/ui/slider.js +2 -0
- package/dist/ui/sonner.d.ts +3 -0
- package/dist/ui/sonner.js +2 -0
- package/dist/ui/spinner.d.ts +5 -0
- package/dist/ui/spinner.js +2 -0
- package/dist/ui/stack.d.ts +35 -0
- package/dist/ui/stack.js +2 -0
- package/dist/ui/stat-card-group.d.ts +10 -0
- package/dist/ui/stat-card-group.js +2 -0
- package/dist/ui/stepper.d.ts +10 -0
- package/dist/ui/stepper.js +2 -0
- package/dist/ui/switch.d.ts +6 -0
- package/dist/ui/switch.js +2 -0
- package/dist/ui/table.d.ts +10 -0
- package/dist/ui/table.js +2 -0
- package/dist/ui/tabs.d.ts +7 -0
- package/dist/ui/tabs.js +2 -0
- package/dist/ui/text.d.ts +6 -0
- package/dist/ui/text.js +2 -0
- package/dist/ui/textarea.d.ts +5 -0
- package/dist/ui/textarea.js +2 -0
- package/dist/ui/time-picker.d.ts +4 -0
- package/dist/ui/time-picker.js +2 -0
- package/dist/ui/toast.d.ts +28 -0
- package/dist/ui/toast.js +2 -0
- package/dist/ui/toaster.d.ts +1 -0
- package/dist/ui/toaster.js +2 -0
- package/dist/ui/toggle-group.d.ts +7 -0
- package/dist/ui/toggle-group.js +2 -0
- package/dist/ui/toggle.d.ts +9 -0
- package/dist/ui/toggle.js +2 -0
- package/dist/ui/tooltip.d.ts +7 -0
- package/dist/ui/tooltip.js +2 -0
- package/dist/ui/typography.d.ts +16 -0
- package/dist/ui/typography.js +2 -0
- package/dist/ui/use-media-query.d.ts +1 -0
- package/dist/ui/use-media-query.js +2 -0
- package/dist/ui/use-mobile.d.ts +1 -0
- package/dist/ui/use-mobile.js +2 -0
- package/dist/ui/use-reduced-motion.d.ts +1 -0
- package/dist/ui/use-reduced-motion.js +2 -0
- package/dist/ui/use-toast.d.ts +44 -0
- package/dist/ui/use-toast.js +2 -0
- package/dist/ui/useListState.d.ts +6 -0
- package/dist/ui/useListState.js +2 -0
- package/dist/ui/usecases/UseCaseCard.d.ts +7 -0
- package/dist/ui/usecases/UseCaseCard.js +2 -0
- package/dist/ui/usecases/UserStoryCard.d.ts +5 -0
- package/dist/ui/usecases/UserStoryCard.js +2 -0
- package/dist/ui/usecases/index.d.ts +2 -0
- package/dist/ui/usecases/index.js +2 -0
- package/dist/ui/utils.d.ts +2 -0
- package/dist/ui/utils.js +2 -0
- package/dist/ui/visualization/Visualization.d.ts +7 -0
- package/dist/ui/visualization/Visualization.js +2 -0
- package/dist/ui/visualization/Visualization.support.d.ts +15 -0
- package/dist/ui/visualization/Visualization.support.js +2 -0
- package/dist/ui/visualization/index.d.ts +1 -0
- package/dist/ui/visualization/index.js +2 -0
- package/dist/ui/visually-hidden.d.ts +8 -0
- package/dist/ui/visually-hidden.js +2 -0
- package/package.json +1691 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var e=import.meta.require;import*as l from"@radix-ui/react-collapsible";import{jsx as o}from"react/jsx-runtime";function p({...i}){return o(l.Root,{"data-slot":"collapsible",...i})}function a({...i}){return o(l.CollapsibleTrigger,{"data-slot":"collapsible-trigger",...i})}function r({...i}){return o(l.CollapsibleContent,{"data-slot":"collapsible-content",...i})}export{a as CollapsibleTrigger,r as CollapsibleContent,p as Collapsible};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface ComboboxOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
keywords?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ComboboxProps {
|
|
9
|
+
options: ComboboxOption[];
|
|
10
|
+
value?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
selectedValues?: string[];
|
|
13
|
+
onRemoveValue?: (value: string) => void;
|
|
14
|
+
query?: string;
|
|
15
|
+
onQueryChange?: (query: string) => void;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
searchPlaceholder?: string;
|
|
18
|
+
emptyText?: string;
|
|
19
|
+
loadingText?: string;
|
|
20
|
+
errorText?: string;
|
|
21
|
+
error?: string | null;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
multiple?: boolean;
|
|
24
|
+
readOnly?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
id?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
'aria-invalid'?: boolean;
|
|
29
|
+
'aria-describedby'?: string;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function Combobox({ options, value, onValueChange, selectedValues, onRemoveValue, query, onQueryChange, placeholder, searchPlaceholder, emptyText, loadingText, errorText, error, loading, multiple, readOnly, disabled, id, name, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, className, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var xJ=import.meta.require;import{cn as DJ}from"@contractspec/lib.ui-kit-core/utils";import{Slot as IJ}from"@radix-ui/react-slot";import{cva as bJ}from"class-variance-authority";import*as o from"react";import{jsx as VJ}from"react/jsx-runtime";var OJ=bJ("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),x=o.forwardRef(({className:J,variant:K,size:U,asChild:$=!1,...X},w)=>{return VJ($?IJ:"button",{ref:w,"data-slot":"button",className:DJ(OJ({variant:K,size:U,className:J})),...X})});x.displayName="Button";import{cn as A}from"@contractspec/lib.ui-kit-core/utils";import*as _ from"@radix-ui/react-dialog";import{XIcon as yJ}from"lucide-react";import{jsx as z,jsxs as m}from"react/jsx-runtime";function e({...J}){return z(_.Root,{"data-slot":"dialog",...J})}function aJ({...J}){return z(_.Trigger,{"data-slot":"dialog-trigger",...J})}function NJ({...J}){return z(_.Portal,{"data-slot":"dialog-portal",...J})}function nJ({...J}){return z(_.Close,{"data-slot":"dialog-close",...J})}function hJ({className:J,...K}){return z(_.Overlay,{"data-slot":"dialog-overlay",className:A("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",J),...K})}function JJ({className:J,children:K,showCloseButton:U=!0,...$}){return m(NJ,{"data-slot":"dialog-portal",children:[z(hJ,{}),m(_.Content,{"data-slot":"dialog-content",className:A("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",J),...$,children:[K,U&&m(_.Close,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[z(yJ,{}),z("span",{className:"sr-only",children:"Close"})]})]})]})}function KJ({className:J,...K}){return z("div",{"data-slot":"dialog-header",className:A("flex flex-col gap-2 text-center sm:text-left",J),...K})}function sJ({className:J,...K}){return z("div",{"data-slot":"dialog-footer",className:A("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",J),...K})}function WJ({className:J,...K}){return z(_.Title,{"data-slot":"dialog-title",className:A("font-semibold text-lg leading-none",J),...K})}function YJ({className:J,...K}){return z(_.Description,{"data-slot":"dialog-description",className:A("text-muted-foreground text-sm",J),...K})}import{cn as S}from"@contractspec/lib.ui-kit-core/utils";import{Command as q}from"cmdk";import{SearchIcon as PJ}from"lucide-react";import{jsx as F,jsxs as u}from"react/jsx-runtime";function d({className:J,...K}){return F(q,{"data-slot":"command",className:S("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",J),...K})}function YK({title:J="Command Palette",description:K="Search for a command to run...",children:U,className:$,showCloseButton:X=!0,...w}){return u(e,{...w,children:[u(KJ,{className:"sr-only",children:[F(WJ,{children:J}),F(YJ,{children:K})]}),F(JJ,{className:S("overflow-hidden p-0",$),showCloseButton:X,children:F(d,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:U})})]})}function ZJ({className:J,...K}){return u("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[F(PJ,{className:"size-4 shrink-0 opacity-50"}),F(q.Input,{"data-slot":"command-input",className:S("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",J),...K})]})}function _J({className:J,...K}){return F(q.List,{"data-slot":"command-list",className:S("max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",J),...K})}function $J({...J}){return F(q.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...J})}function FJ({className:J,...K}){return F(q.Group,{"data-slot":"command-group",className:S("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",J),...K})}function ZK({className:J,...K}){return F(q.Separator,{"data-slot":"command-separator",className:S("-mx-1 h-px bg-border",J),...K})}function UJ({className:J,...K}){return F(q.Item,{"data-slot":"command-item",className:S("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",J),...K})}function _K({className:J,...K}){return F("span",{"data-slot":"command-shortcut",className:S("ml-auto text-muted-foreground text-xs tracking-widest",J),...K})}import{cn as CJ}from"@contractspec/lib.ui-kit-core/utils";import*as L from"@radix-ui/react-popover";import{jsx as I}from"react/jsx-runtime";function zJ({...J}){return I(L.Root,{"data-slot":"popover",...J})}function GJ({...J}){return I(L.Trigger,{"data-slot":"popover-trigger",...J})}function HJ({className:J,align:K="center",sideOffset:U=4,...$}){return I(L.Portal,{children:I(L.Content,{"data-slot":"popover-content",align:K,sideOffset:U,className:CJ("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",J),...$})})}function zK({...J}){return I(L.Anchor,{"data-slot":"popover-anchor",...J})}import{cn as B}from"@contractspec/lib.ui-kit-core/utils";import{Check as LJ,ChevronsUpDown as gJ,X as vJ}from"lucide-react";import*as G from"react";import{createPortal as jJ}from"react-dom";import{jsx as Z,jsxs as Q}from"react/jsx-runtime";function h(J){return String(J.value)}function P(J,K,U){if(!J.length)return-1;for(let $=1;$<=J.length;$+=1){let X=(K+U*$+J.length)%J.length;if(!J[X]?.disabled)return X}return-1}function RK({options:J,value:K,onValueChange:U,selectedValues:$,onRemoveValue:X,query:w,onQueryChange:C,placeholder:c="Select option",searchPlaceholder:r="Search option...",emptyText:l="No option found.",loadingText:XJ="Loading options...",errorText:MJ="Unable to load options.",error:b,loading:O,multiple:V,readOnly:y,disabled:k,id:QJ,name:wJ,"aria-invalid":EJ,"aria-describedby":RJ,className:p}){let[E,R]=G.useState(!1),[i,f]=G.useState(-1),[SJ,qJ]=G.useState(),a=G.useRef(null),AJ=G.useId().replace(/:/g,""),n=QJ??`combobox-${AJ}`,N=`${n}-listbox`,g=J.find((W)=>W.value===K),BJ=new Set($??(K?[String(K)]:[])),kJ=w!==void 0&&w.length>0?w:g?.label??"",v=w!==void 0||C!==void 0||V!==void 0||$!==void 0||X!==void 0||O!==void 0||b!==void 0,M=G.useCallback(()=>{let W=a.current;if(!W)return;let T=W.getBoundingClientRect();qJ({left:T.left,position:"fixed",top:T.bottom+4,width:T.width,zIndex:50})},[]);G.useEffect(()=>{if(!E||!v)return;return M(),window.addEventListener("resize",M),window.addEventListener("scroll",M,!0),()=>{window.removeEventListener("resize",M),window.removeEventListener("scroll",M,!0)}},[v,E,M]);let s=()=>{if(k||y)return;M(),R(!0),f((W)=>W>=0?W:P(J,-1,1))},t=(W)=>{if(k||y||W.disabled)return;if(U?.(h(W)),!V)R(!1)};if(v){let W=J[i],T=O?XJ:b?b??MJ:l,fJ=Z("div",{id:N,role:"listbox","aria-busy":O||void 0,"aria-multiselectable":V||void 0,className:"max-h-[300px] w-full overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",children:J.length&&!O&&!b?J.map((Y,H)=>{let D=h(Y),j=BJ.has(D);return Q("div",{id:`${N}-${D}`,role:"option","aria-selected":j,"aria-disabled":Y.disabled||void 0,"data-active":i===H||void 0,"data-selected":j||void 0,className:B("flex cursor-default select-none items-start gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden","data-[active=true]:bg-accent data-[active=true]:text-accent-foreground",Y.disabled&&"pointer-events-none opacity-50"),onMouseDown:(TJ)=>TJ.preventDefault(),onMouseEnter:()=>f(H),onClick:()=>t(Y),children:[Z(LJ,{className:B("mt-0.5 size-4 shrink-0",j?"opacity-100":"opacity-0")}),Q("span",{className:"min-w-0",children:[Z("span",{className:"block truncate",children:Y.label}),Y.description?Z("span",{className:"block truncate text-muted-foreground text-xs",children:Y.description}):null]})]},D)}):Z("div",{className:"px-2 py-6 text-center text-muted-foreground text-sm",children:T})});return Q("div",{className:B("relative w-full min-w-0 space-y-2",p),children:[Z("input",{ref:a,id:n,name:wJ,type:"text",role:"combobox","aria-autocomplete":"list","aria-controls":N,"aria-expanded":E,"aria-activedescendant":E&&W?`${N}-${h(W)}`:void 0,"aria-invalid":EJ,"aria-describedby":RJ,value:kJ,placeholder:r??c,readOnly:y,disabled:k,className:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm outline-hidden ring-offset-background placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",onFocus:s,onBlur:()=>{globalThis.setTimeout(()=>R(!1),0)},onChange:(Y)=>{C?.(Y.currentTarget.value),s(),f(P(J,-1,1))},onKeyDown:(Y)=>{if(Y.key==="Escape"){R(!1);return}if(Y.key==="ArrowDown"){Y.preventDefault(),M(),R(!0),f((H)=>P(J,H,1));return}if(Y.key==="ArrowUp"){Y.preventDefault(),M(),R(!0),f((H)=>P(J,H<0?J.length:H,-1));return}if(Y.key==="Enter"&&E&&W)Y.preventDefault(),t(W)}}),E?jJ(Z("div",{"data-slot":"popover-content",className:"z-50 w-(--radix-popover-trigger-width) p-0",style:SJ,children:fJ}),document.body):null,V&&$?.length?Z("div",{className:"flex flex-wrap gap-2",children:$.map((Y)=>{let H=J.find((D)=>h(D)===Y);return Q("button",{type:"button",className:"inline-flex h-8 max-w-full items-center rounded-md border border-input px-2 text-sm disabled:opacity-50","aria-label":`Remove ${H?.label??Y}`,disabled:k||y,onClick:()=>X?.(Y),children:[Z("span",{className:"truncate",children:H?.label??Y}),Z(vJ,{className:"ml-1 size-3 shrink-0","aria-hidden":"true"})]},`selected-${Y}`)})}):null]})}return Q(zJ,{open:E,onOpenChange:R,children:[Z(GJ,{asChild:!0,children:Q(x,{type:"button",variant:"outline",role:"combobox","aria-expanded":E,disabled:k,className:B("w-full justify-between",p),children:[Z("span",{className:B(!g&&"text-muted-foreground"),children:g?.label??c}),Z(gJ,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),Z(HJ,{className:"w-(--radix-popover-trigger-width) p-0",children:Q(d,{children:[Z(ZJ,{placeholder:r}),Q(_J,{children:[Z($J,{children:l}),Z(FJ,{children:J.map((W)=>Q(UJ,{value:[W.value,W.label,...W.keywords??[]].join(" "),disabled:W.disabled,onSelect:()=>{U?.(W.value),R(!1)},children:[Z(LJ,{className:B("mr-2 size-4",K===W.value?"opacity-100":"opacity-0")}),W.label]},W.value))})]})]})})]})}export{RK as Combobox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Command as CommandPrimitive } from 'cmdk';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Dialog } from './dialog';
|
|
4
|
+
declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
declare function CommandShortcut({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var k=import.meta.require;import{cn as Q}from"@contractspec/lib.ui-kit-core/utils";import*as z from"@radix-ui/react-dialog";import{XIcon as L}from"lucide-react";import{jsx as J,jsxs as V}from"react/jsx-runtime";function Y({...f}){return J(z.Root,{"data-slot":"dialog",...f})}function w({...f}){return J(z.Trigger,{"data-slot":"dialog-trigger",...f})}function X({...f}){return J(z.Portal,{"data-slot":"dialog-portal",...f})}function B({...f}){return J(z.Close,{"data-slot":"dialog-close",...f})}function b({className:f,...q}){return J(z.Overlay,{"data-slot":"dialog-overlay",className:Q("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",f),...q})}function Z({className:f,children:q,showCloseButton:R=!0,...U}){return V(X,{"data-slot":"dialog-portal",children:[J(b,{}),V(z.Content,{"data-slot":"dialog-content",className:Q("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",f),...U,children:[q,R&&V(z.Close,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[J(L,{}),J("span",{className:"sr-only",children:"Close"})]})]})]})}function _({className:f,...q}){return J("div",{"data-slot":"dialog-header",className:Q("flex flex-col gap-2 text-center sm:text-left",f),...q})}function I({className:f,...q}){return J("div",{"data-slot":"dialog-footer",className:Q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",f),...q})}function $({className:f,...q}){return J(z.Title,{"data-slot":"dialog-title",className:Q("font-semibold text-lg leading-none",f),...q})}function E({className:f,...q}){return J(z.Description,{"data-slot":"dialog-description",className:Q("text-muted-foreground text-sm",f),...q})}import{cn as K}from"@contractspec/lib.ui-kit-core/utils";import{Command as M}from"cmdk";import{SearchIcon as H}from"lucide-react";import{jsx as A,jsxs as W}from"react/jsx-runtime";function O({className:f,...q}){return A(M,{"data-slot":"command",className:K("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",f),...q})}function C({title:f="Command Palette",description:q="Search for a command to run...",children:R,className:U,showCloseButton:F=!0,...G}){return W(Y,{...G,children:[W(_,{className:"sr-only",children:[A($,{children:f}),A(E,{children:q})]}),A(Z,{className:K("overflow-hidden p-0",U),showCloseButton:F,children:A(O,{className:"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:R})})]})}function N({className:f,...q}){return W("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[A(H,{className:"size-4 shrink-0 opacity-50"}),A(M.Input,{"data-slot":"command-input",className:K("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",f),...q})]})}function d({className:f,...q}){return A(M.List,{"data-slot":"command-list",className:K("max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden",f),...q})}function j({...f}){return A(M.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...f})}function x({className:f,...q}){return A(M.Group,{"data-slot":"command-group",className:K("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs",f),...q})}function n({className:f,...q}){return A(M.Separator,{"data-slot":"command-separator",className:K("-mx-1 h-px bg-border",f),...q})}function t({className:f,...q}){return A(M.Item,{"data-slot":"command-item",className:K("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",f),...q})}function l({className:f,...q}){return A("span",{"data-slot":"command-shortcut",className:K("ml-auto text-muted-foreground text-xs tracking-widest",f),...q})}export{l as CommandShortcut,n as CommandSeparator,d as CommandList,t as CommandItem,N as CommandInput,x as CommandGroup,j as CommandEmpty,C as CommandDialog,O as Command};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface ConfirmDialogProps {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
variant?: 'default' | 'destructive';
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
onConfirm: () => Promise<void> | void;
|
|
12
|
+
trigger?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare function ConfirmDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, variant, isLoading, onConfirm, trigger, }: ConfirmDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var Y=import.meta.require;import{cn as J}from"@contractspec/lib.ui-kit-core/utils";import{Slot as K}from"@radix-ui/react-slot";import{cva as M}from"class-variance-authority";import*as T from"react";import{jsx as O}from"react/jsx-runtime";var C=M("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),l=T.forwardRef(({className:e,variant:d,size:A,asChild:g=!1,...R},t)=>{return O(g?K:"button",{ref:t,"data-slot":"button",className:J(C({variant:d,size:A,className:e})),...R})});l.displayName="Button";import{cn as o}from"@contractspec/lib.ui-kit-core/utils";import*as n from"@radix-ui/react-alert-dialog";import{jsx as i,jsxs as W}from"react/jsx-runtime";function w({...e}){return i(n.Root,{"data-slot":"alert-dialog",...e})}function F({...e}){return i(n.Trigger,{"data-slot":"alert-dialog-trigger",...e})}function Q({...e}){return i(n.Portal,{"data-slot":"alert-dialog-portal",...e})}function U({className:e,...d}){return i(n.Overlay,{"data-slot":"alert-dialog-overlay",className:o("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",e),...d})}function H({className:e,...d}){return W(Q,{children:[i(U,{}),i(n.Content,{"data-slot":"alert-dialog-content",className:o("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",e),...d})]})}function L({className:e,...d}){return i("div",{"data-slot":"alert-dialog-header",className:o("flex flex-col gap-2 text-center sm:text-left",e),...d})}function P({className:e,...d}){return i("div",{"data-slot":"alert-dialog-footer",className:o("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...d})}function q({className:e,...d}){return i(n.Title,{"data-slot":"alert-dialog-title",className:o("font-semibold text-lg",e),...d})}function B({className:e,...d}){return i(n.Description,{"data-slot":"alert-dialog-description",className:o("text-muted-foreground text-sm",e),...d})}function E({className:e,...d}){return i(n.Action,{className:o(C(),e),...d})}function G({className:e,...d}){return i(n.Cancel,{className:o(C({variant:"outline"}),e),...d})}import{jsx as f,jsxs as D}from"react/jsx-runtime";function c({open:e,onOpenChange:d,title:A,description:g,confirmLabel:R="Confirmer",cancelLabel:t="Annuler",variant:v="default",isLoading:h,onConfirm:I,trigger:b}){return D(w,{open:e,onOpenChange:d,children:[b?f(F,{asChild:!0,children:b}):null,D(H,{children:[D(L,{children:[f(q,{children:A}),g?f(B,{children:g}):null]}),D(P,{children:[f(G,{disabled:h,children:t}),f(E,{asChild:!0,children:f(l,{onClick:async()=>{await I()},disabled:h,className:v==="destructive"?"bg-destructive text-destructive-foreground hover:bg-destructive/90":void 0,children:h?"...":R})})]})]})]})}export{c as ConfirmDialog};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ContextMenuTrigger({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content> & {
|
|
10
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function ContextMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
13
|
+
inset?: boolean;
|
|
14
|
+
variant?: 'default' | 'destructive';
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function ContextMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function ContextMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem> & {
|
|
21
|
+
inset?: boolean;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function ContextMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem> & {
|
|
24
|
+
inset?: boolean;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function ContextMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
27
|
+
inset?: boolean;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export { ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var l=import.meta.require;import{clsx as c}from"clsx";import{twMerge as m}from"tailwind-merge";function i(...e){return m(c(e))}import*as t from"@radix-ui/react-context-menu";import{CheckIcon as s,ChevronRightIcon as p}from"lucide-react";import{jsx as n,jsxs as u}from"react/jsx-runtime";function M({...e}){return n(t.Root,{"data-slot":"context-menu",...e})}function b({className:e,...o}){return n(t.Trigger,{"data-slot":"context-menu-trigger",className:i("select-none",e),...o})}function h({...e}){return n(t.Group,{"data-slot":"context-menu-group",...e})}function R({...e}){return n(t.Portal,{"data-slot":"context-menu-portal",...e})}function y({...e}){return n(t.Sub,{"data-slot":"context-menu-sub",...e})}function I({...e}){return n(t.RadioGroup,{"data-slot":"context-menu-radio-group",...e})}function z({className:e,...o}){return n(t.Portal,{children:n(t.Content,{"data-slot":"context-menu-content",className:i("data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-closed:animate-out data-open:animate-in",e),...o})})}function S({className:e,inset:o,variant:a="default",...r}){return n(t.Item,{"data-slot":"context-menu-item","data-inset":o,"data-variant":a,className:i("group/context-menu-item relative flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function k({className:e,inset:o,children:a,...r}){return u(t.SubTrigger,{"data-slot":"context-menu-sub-trigger","data-inset":o,className:i("flex cursor-default select-none items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-inset:pl-7 data-open:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[a,n(p,{className:"cn-rtl-flip ml-auto"})]})}function N({className:e,...o}){return n(t.SubContent,{"data-slot":"context-menu-sub-content",className:i("data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg duration-100 data-closed:animate-out data-open:animate-in",e),...o})}function _({className:e,children:o,checked:a,inset:r,...d}){return u(t.CheckboxItem,{"data-slot":"context-menu-checkbox-item","data-inset":r,className:i("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),checked:a,...d,children:[n("span",{className:"pointer-events-none absolute right-2",children:n(t.ItemIndicator,{children:n(s,{})})}),o]})}function w({className:e,children:o,inset:a,...r}){return u(t.RadioItem,{"data-slot":"context-menu-radio-item","data-inset":a,className:i("relative flex cursor-default select-none items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-7 data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n("span",{className:"pointer-events-none absolute right-2",children:n(t.ItemIndicator,{children:n(s,{})})}),o]})}function T({className:e,inset:o,...a}){return n(t.Label,{"data-slot":"context-menu-label","data-inset":o,className:i("px-1.5 py-1 font-medium text-muted-foreground text-xs data-inset:pl-7",e),...a})}function G({className:e,...o}){return n(t.Separator,{"data-slot":"context-menu-separator",className:i("-mx-1 my-1 h-px bg-border",e),...o})}function L({className:e,...o}){return n("span",{"data-slot":"context-menu-shortcut",className:i("ml-auto text-muted-foreground text-xs tracking-widest group-focus/context-menu-item:text-accent-foreground",e),...o})}export{b as ContextMenuTrigger,k as ContextMenuSubTrigger,N as ContextMenuSubContent,y as ContextMenuSub,L as ContextMenuShortcut,G as ContextMenuSeparator,w as ContextMenuRadioItem,I as ContextMenuRadioGroup,R as ContextMenuPortal,T as ContextMenuLabel,S as ContextMenuItem,h as ContextMenuGroup,z as ContextMenuContent,_ as ContextMenuCheckboxItem,M as ContextMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
package/dist/ui/cta.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type ButtonProps } from './button';
|
|
3
|
+
export type CtaProps = Omit<ButtonProps, 'onClick'> & {
|
|
4
|
+
capture?: (cta: string) => void;
|
|
5
|
+
ctaName?: string;
|
|
6
|
+
as?: 'button' | 'a';
|
|
7
|
+
href?: string;
|
|
8
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
ref?: React.Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
11
|
+
};
|
|
12
|
+
export declare function Cta({ capture, ctaName, className, as, href, onClick, size, children, ref, ...props }: CtaProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/ui/cta.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var X=import.meta.require;import{cn as Q}from"@contractspec/lib.ui-kit-core/utils";import{Slot as R}from"@radix-ui/react-slot";import{cva as T}from"class-variance-authority";import*as M from"react";import{jsx as W}from"react/jsx-runtime";var U=T("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),A=M.forwardRef(({className:g,variant:q,size:w,asChild:D=!1,...E},F)=>{return W(D?R:"button",{ref:F,"data-slot":"button",className:Q(U({variant:q,size:w,className:g})),...E})});A.displayName="Button";import{cn as O}from"@contractspec/lib.ui-kit-core/utils";import{jsx as H}from"react/jsx-runtime";function B({capture:g,ctaName:q,className:w,as:D="button",href:E,onClick:F,size:G="lg",children:I,ref:J,...K}){let L=(P)=>{if(q&&g)try{g(q)}catch{}F?.(P)};if(D==="a")return H(A,{asChild:!0,size:G,className:O("min-h-[44px]",w),...K,children:H("a",{href:E,onClick:L,ref:J,children:I})});return H(A,{size:G,className:O("min-h-[44px]",w),onClick:L,ref:J,...K,children:I})}export{B as Cta};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ContractTableController, ContractTableRowRenderModel } from '@contractspec/lib.presentation-runtime-core';
|
|
2
|
+
import type { SharedDataTableProps } from '@contractspec/lib.ui-kit-core/interfaces';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface DataTableProps<TItem = unknown> extends SharedDataTableProps<TItem> {
|
|
5
|
+
controller: ContractTableController<TItem, React.ReactNode>;
|
|
6
|
+
onRowPress?: (row: ContractTableRowRenderModel<TItem, React.ReactNode>) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function DataTable<TItem>({ controller, className, toolbar, footer, emptyState, loading, onRowPress, }: DataTableProps<TItem>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var e1=import.meta.require;import{cn as L1}from"@contractspec/lib.ui-kit-core/utils";import{Slot as H1}from"@radix-ui/react-slot";import{cva as E1}from"class-variance-authority";import*as l from"react";import{jsx as k1}from"react/jsx-runtime";var z1=E1("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),H=l.forwardRef(({className:f,variant:y,size:A,asChild:_=!1,...U},J)=>{return k1(_?H1:"button",{ref:J,"data-slot":"button",className:L1(z1({variant:y,size:A,className:f})),...U})});H.displayName="Button";import{cn as T}from"@contractspec/lib.ui-kit-core/utils";import*as q from"@radix-ui/react-select";import{CheckIcon as I1,ChevronDownIcon as n,ChevronUpIcon as S1}from"lucide-react";import{jsx as K,jsxs as x}from"react/jsx-runtime";function o({...f}){return K(q.Root,{"data-slot":"select",...f})}function Q8({...f}){return K(q.Group,{"data-slot":"select-group",...f})}function e({...f}){return K(q.Value,{"data-slot":"select-value",...f})}function f1({className:f,size:y="default",children:A,..._}){return x(q.Trigger,{"data-slot":"select-trigger","data-size":y,className:T("flex w-fit items-center justify-between gap-2 whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-2xs outline-hidden transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[size=default]:h-9 data-[size=sm]:h-8 data-placeholder:text-muted-foreground *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0",f),..._,children:[A,K(q.Icon,{asChild:!0,children:K(n,{className:"size-4 opacity-50"})})]})}function y1({className:f,children:y,position:A="popper",..._}){return K(q.Portal,{children:x(q.Content,{"data-slot":"select-content",className:T("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",A==="popper"&&"data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",f),position:A,..._,children:[K(T1,{}),K(q.Viewport,{className:T("p-1",A==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),children:y}),K(M1,{})]})})}function Y8({className:f,...y}){return K(q.Label,{"data-slot":"select-label",className:T("px-2 py-1.5 text-muted-foreground text-xs",f),...y})}function A1({className:f,children:y,...A}){return x(q.Item,{"data-slot":"select-item",className:T("relative flex w-full cursor-default select-none items-center gap-2 rounded-xs py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",f),...A,children:[K("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:K(q.ItemIndicator,{children:K(I1,{className:"size-4"})})}),K(q.ItemText,{children:y})]})}function Z8({className:f,...y}){return K(q.Separator,{"data-slot":"select-separator",className:T("pointer-events-none -mx-1 my-1 h-px bg-border",f),...y})}function T1({className:f,...y}){return K(q.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:T("flex cursor-default items-center justify-center py-1",f),...y,children:K(S1,{className:"size-4"})})}function M1({className:f,...y}){return K(q.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:T("flex cursor-default items-center justify-center py-1",f),...y,children:K(n,{className:"size-4"})})}import{clsx as h1}from"clsx";import{twMerge as R1}from"tailwind-merge";function $1(...f){return R1(h1(f))}import{ChevronLeft as P1,ChevronRight as g1,ChevronsLeft as N1,ChevronsRight as C1}from"lucide-react";import{jsx as O,jsxs as k}from"react/jsx-runtime";var j=({currentPage:f,totalPages:y,totalItems:A,itemsPerPage:_,onPageChange:U,onItemsPerPageChange:J,disabled:Z=!1,className:L="",showItemsPerPage:$=!0,itemsPerPageOptions:E=[10,25,50,100]})=>{let B=(f-1)*_+1,G=Math.min(f*_,A),g=f>1&&!Z,N=f<y&&!Z,b=()=>{if(y<=7)return Array.from({length:y},(V,C)=>C+1);if(f<=3)return[1,2,3,4,5,-1,y];if(f>=y-2)return[1,-1,y-4,y-3,y-2,y-1,y];return[1,-1,f-1,f,f+1,-1,y]};if(y===0)return null;return k("div",{className:`flex flex-col items-center justify-between gap-4 sm:flex-row ${L}`,children:[k("div",{className:"order-2 text-base text-muted-foreground sm:order-1",children:["Affichage de ",B," \xE0 ",G," sur ",A," r\xE9sultats"]}),k("div",{className:"order-1 flex items-center gap-2 sm:order-2",children:[k(H,{variant:"outline",size:"sm",onClick:()=>U(1),disabled:!g,className:"hidden h-8 w-8 p-0 sm:flex",children:[O(N1,{className:"h-4 w-4"}),O("span",{className:"sr-only",children:"Premi\xE8re page"})]}),k(H,{variant:"outline",size:"sm",onClick:()=>U(f-1),disabled:!g,className:"h-8 w-8 p-0",children:[O(P1,{className:"h-4 w-4"}),O("span",{className:"sr-only",children:"Page pr\xE9c\xE9dente"})]}),O("div",{className:"flex items-center gap-1",children:b().map((V,C)=>{if(V===-1)return O("span",{className:"px-2 py-1 text-muted-foreground",children:"..."},`ellipsis-${C}`);return O(H,{variant:V===f?"default":"outline",size:"sm",onClick:()=>U(V),disabled:Z,className:"h-8 min-w-8 px-2",children:V},V)})}),k(H,{variant:"outline",size:"sm",onClick:()=>U(f+1),disabled:!N,className:"h-8 w-8 p-0",children:[O(g1,{className:"h-4 w-4"}),O("span",{className:"sr-only",children:"Page suivante"})]}),k(H,{variant:"outline",size:"sm",onClick:()=>U(y),disabled:!N,className:"hidden h-8 w-8 p-0 sm:flex",children:[O(C1,{className:"h-4 w-4"}),O("span",{className:"sr-only",children:"Derni\xE8re page"})]})]}),$&&J&&k("div",{className:"order-3 flex items-center gap-2 text-base",children:[O("span",{className:"text-muted-foreground",children:"Afficher:"}),k(o,{value:_.toString(),onValueChange:(V)=>J(parseInt(V)),disabled:Z,children:[O(f1,{className:"h-8 w-16",children:O(e,{})}),O(y1,{className:"bg-background",children:E.map((V)=>O(A1,{value:V.toString(),children:V},V))})]})]})]})};import{cn as D1}from"@contractspec/lib.ui-kit-core/utils";import*as v from"@radix-ui/react-checkbox";import{CheckIcon as b1}from"lucide-react";import{jsx as p}from"react/jsx-runtime";function m({className:f,...y}){return p(v.Root,{"data-slot":"checkbox",className:D1("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",f),...y,children:p(v.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:p(b1,{className:"size-3.5"})})})}import{cn as I}from"@contractspec/lib.ui-kit-core/utils";import*as W from"@radix-ui/react-dropdown-menu";import{CheckIcon as v1,ChevronRightIcon as w1,CircleIcon as d1}from"lucide-react";import{jsx as Y,jsxs as c}from"react/jsx-runtime";function u({...f}){return Y(W.Root,{"data-slot":"dropdown-menu",...f})}function R8({...f}){return Y(W.Portal,{"data-slot":"dropdown-menu-portal",...f})}function t({...f}){return Y(W.Trigger,{"data-slot":"dropdown-menu-trigger",...f})}function a({className:f,sideOffset:y=4,...A}){return Y(W.Portal,{children:Y(W.Content,{"data-slot":"dropdown-menu-content",sideOffset:y,className:I("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",f),...A})})}function P8({...f}){return Y(W.Group,{"data-slot":"dropdown-menu-group",...f})}function P({className:f,inset:y,variant:A="default",..._}){return Y(W.Item,{"data-slot":"dropdown-menu-item","data-inset":y,"data-variant":A,className:I("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!",f),..._})}function W1({className:f,children:y,checked:A,..._}){return c(W.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:I("relative flex cursor-default select-none items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",f),checked:A,..._,children:[Y("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:Y(W.ItemIndicator,{children:Y(v1,{className:"size-4"})})}),y]})}function g8({...f}){return Y(W.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...f})}function N8({className:f,children:y,...A}){return c(W.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:I("relative flex cursor-default select-none items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",f),...A,children:[Y("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:Y(W.ItemIndicator,{children:Y(d1,{className:"size-2 fill-current"})})}),y]})}function _1({className:f,inset:y,...A}){return Y(W.Label,{"data-slot":"dropdown-menu-label","data-inset":y,className:I("px-2 py-1.5 font-medium text-sm data-inset:pl-8",f),...A})}function r({className:f,...y}){return Y(W.Separator,{"data-slot":"dropdown-menu-separator",className:I("-mx-1 my-1 h-px bg-border",f),...y})}function C8({className:f,...y}){return Y("span",{"data-slot":"dropdown-menu-shortcut",className:I("ml-auto text-muted-foreground text-xs tracking-widest",f),...y})}function D8({...f}){return Y(W.Sub,{"data-slot":"dropdown-menu-sub",...f})}function b8({className:f,inset:y,children:A,..._}){return c(W.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":y,className:I("flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-inset:pl-8 data-[state=open]:text-accent-foreground",f),..._,children:[A,Y(w1,{className:"ml-auto size-4"})]})}function v8({className:f,...y}){return Y(W.SubContent,{"data-slot":"dropdown-menu-sub-content",className:I("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",f),...y})}import{cn as i1}from"@contractspec/lib.ui-kit-core/utils";import{ChevronDown as x1,ChevronRight as j1,Columns3 as q1,GripVertical as p1,PanelLeft as m1,PanelRight as u1,PinOff as t1}from"lucide-react";import*as X from"react";import{jsx as Q,jsxs as z,Fragment as l1}from"react/jsx-runtime";function a1(f){f.forEach((y)=>y.toggleVisibility?.(!0))}function r1(f,y){if(y.kind!=="data"||!y.visible)return!0;return f.filter((A)=>A.kind==="data"&&A.visible).length>1}function J1({columns:f}){let y=f.filter((J)=>J.kind==="data"),A=y.filter((J)=>J.canHide),_=A.filter((J)=>!J.visible),U=y.some((J)=>J.pinState);if(!A.length)return null;return z(u,{children:[Q(t,{asChild:!0,children:z(H,{variant:"outline",size:"sm",children:[Q(q1,{className:"h-4 w-4"}),"Columns"]})}),z(a,{align:"end",children:[Q(_1,{children:"Visible Columns"}),Q(r,{}),A.map((J)=>{let Z=!r1(f,J);return Q(W1,{checked:J.visible,disabled:Z,onCheckedChange:(L)=>{let $=Boolean(L);if(!$&&Z)return;J.toggleVisibility?.($)},children:z("div",{className:"flex w-full items-center justify-between gap-3",children:[Q("span",{children:J.label}),Z?Q("span",{className:"text-muted-foreground text-xs",children:"Required"}):null]})},J.id)}),_.length||U?z(l1,{children:[Q(r,{}),_.length?Q(P,{onClick:()=>a1(A),children:"Show All Columns"}):null,U?Q(P,{onClick:()=>y.forEach((J)=>J.pin?.(!1)),children:"Reset Pins"}):null]}):null]})]})}function Q1({column:f}){if(!f.canPin)return null;return z(u,{children:[Q(t,{asChild:!0,children:Q(H,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:(y)=>y.stopPropagation(),children:Q(q1,{className:"h-3.5 w-3.5"})})}),z(a,{align:"start",children:[z(P,{onClick:()=>f.pin?.("left"),children:[Q(m1,{className:"h-4 w-4"}),"Pin Left"]}),z(P,{onClick:()=>f.pin?.("right"),children:[Q(u1,{className:"h-4 w-4"}),"Pin Right"]}),z(P,{onClick:()=>f.pin?.(!1),children:[Q(t1,{className:"h-4 w-4"}),"Unpin"]})]})]})}function Y1({column:f}){let y=X.useRef(null),A=X.useRef(0),_=X.useRef(null),U=X.useRef(null),J=X.useCallback(()=>{if(_.current=null,!A.current)return;f.resizeBy?.(A.current),A.current=0},[f]),Z=X.useCallback((G)=>{if(!Number.isFinite(G)||G===0)return;if(A.current+=G,_.current!=null)return;_.current=window.requestAnimationFrame(J)},[J]),L=X.useCallback(()=>{if(y.current=null,U.current?.(),U.current=null,_.current!=null)window.cancelAnimationFrame(_.current),_.current=null;if(!A.current)return;f.resizeBy?.(A.current),A.current=0},[f]);X.useEffect(()=>{return L},[L]);let $=X.useCallback((G,g,N)=>{L(),y.current=G;let b=(R)=>{if(y.current==null)return;let X1=R.clientX-y.current;y.current=R.clientX,Z(X1)},V=()=>L(),C=()=>{window.removeEventListener(g,b);for(let R of N)window.removeEventListener(R,V)};U.current=C,window.addEventListener(g,b);for(let R of N)window.addEventListener(R,V)},[L,Z]),E=X.useCallback((G)=>{G.preventDefault(),G.stopPropagation(),G.currentTarget.setPointerCapture?.(G.pointerId),$(G.clientX,"pointermove",["pointerup","pointercancel"])},[$]),B=X.useCallback((G)=>{if(typeof window.PointerEvent==="function")return;G.preventDefault(),G.stopPropagation(),$(G.clientX,"mousemove",["mouseup"])},[$]);return Q("span",{role:"separator","aria-label":`Resize ${f.label} column`,"aria-orientation":"vertical",tabIndex:-1,className:"absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",onPointerDown:E,onMouseDown:B,children:Q(p1,{className:"h-3.5 w-3.5 text-muted-foreground"})})}function s(f,y){if(y.kind==="selection"&&f.selectionMode==="multiple")return Q(m,{"aria-label":"Select all rows",checked:f.allRowsSelected||(f.someRowsSelected?"indeterminate":!1),onCheckedChange:(A)=>f.toggleAllRowsSelected?.(Boolean(A)),onClick:(A)=>A.stopPropagation()});if(y.kind==="expansion")return null;return y.header}function c1(f,y){if(!y)return null;if(y.kind==="selection")return Q(m,{"aria-label":`Select row ${f.id}`,checked:f.isSelected,onCheckedChange:(A)=>f.toggleSelected?.(Boolean(A)),onClick:(A)=>A.stopPropagation()});if(y.kind==="expansion")return f.canExpand?Q(H,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":f.isExpanded?`Collapse row ${f.id}`:`Expand row ${f.id}`,onClick:(A)=>{A.stopPropagation(),f.toggleExpanded?.()},children:f.isExpanded?Q(x1,{className:"h-4 w-4"}):Q(j1,{className:"h-4 w-4"})}):null;return y.content}function s1(f){if(!f||f.kind!=="data")return;switch(f.overflow){case"truncate":case"expand":return"max-w-full truncate whitespace-nowrap";case"wrap":return"max-w-full whitespace-normal break-words";case"none":default:return}}function Z1(f,y){let A=c1(f,y),_=s1(y);if(!_)return A;return Q("div",{className:i1("min-w-0",_),children:A})}function w(f,y=!1){return{width:f.size,minWidth:f.size,maxWidth:f.size,left:f.pinState==="left"?f.stickyOffset:void 0,right:f.pinState==="right"?f.stickyOffset:void 0,position:f.pinState?"sticky":"relative",zIndex:f.pinState?y?30:20:void 0}}function K1(f){if(f.kind!=="data"||!f.canSort)return;if(f.sortDirection==="asc")return"ascending";if(f.sortDirection==="desc")return"descending";return"none"}import{jsx as n1}from"react/jsx-runtime";function F1({className:f,...y}){return n1("div",{"data-slot":"skeleton",className:$1("animate-pulse rounded-md bg-accent",f),...y})}import{cn as M}from"@contractspec/lib.ui-kit-core/utils";import{jsx as S}from"react/jsx-runtime";function G1({className:f,...y}){return S("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:S("table",{"data-slot":"table",className:M("w-full caption-bottom text-sm",f),...y})})}function U1({className:f,...y}){return S("thead",{"data-slot":"table-header",className:M("[&_tr]:border-b",f),...y})}function O1({className:f,...y}){return S("tbody",{"data-slot":"table-body",className:M("[&_tr:last-child]:border-0",f),...y})}function l8({className:f,...y}){return S("tfoot",{"data-slot":"table-footer",className:M("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",f),...y})}function D({className:f,...y}){return S("tr",{"data-slot":"table-row",className:M("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",f),...y})}function B1({className:f,...y}){return S("th",{"data-slot":"table-head",className:M("h-10 whitespace-nowrap px-2 text-left align-middle font-medium text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",f),...y})}function d({className:f,...y}){return S("td",{"data-slot":"table-cell",className:M("whitespace-nowrap p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",f),...y})}function n8({className:f,...y}){return S("caption",{"data-slot":"table-caption",className:M("mt-4 text-muted-foreground text-sm",f),...y})}import{cn as V1}from"@contractspec/lib.ui-kit-core/utils";import*as i from"react";import{jsx as F,jsxs as h,Fragment as o1}from"react/jsx-runtime";function _0({controller:f,className:y,toolbar:A,footer:_,emptyState:U,loading:J,onRowPress:Z}){let L=i.useCallback(($,E)=>{if(!Z||$.key!=="Enter"&&$.key!==" ")return;if($.target instanceof HTMLElement&&$.target.closest('button, a, input, select, textarea, [role="checkbox"], [role="separator"]'))return;$.preventDefault(),Z(E)},[Z]);return h("div",{className:V1("space-y-3",y),children:[h("div",{className:V1("flex items-center gap-3",A?"justify-between":"justify-end"),children:[F("div",{children:A}),F(J1,{columns:f.columns})]}),h(G1,{children:[F(U1,{children:F(D,{children:f.visibleColumns.map(($)=>h(B1,{"aria-sort":K1($),className:"relative bg-background",style:w($,!0),children:[h("div",{className:"flex items-center gap-2",children:[$.kind==="data"&&$.canSort?h("button",{type:"button",className:"inline-flex items-center gap-2 text-left font-medium text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/50",onClick:$.toggleSorting,children:[s(f,$),$.sortDirection?F("span",{className:"text-muted-foreground text-xs uppercase",children:$.sortDirection}):null]}):h(o1,{children:[s(f,$),$.kind==="data"&&$.sortDirection?F("span",{className:"text-muted-foreground text-xs uppercase",children:$.sortDirection}):null]}),$.kind==="data"?F(Q1,{column:$}):null]}),$.canResize?F(Y1,{column:$}):null]},$.id))})}),F(O1,{children:J?Array.from({length:5}).map(($,E)=>F(D,{children:f.visibleColumns.map((B)=>F(d,{style:w(B),children:F(F1,{className:"h-4 w-full"})},`${B.id}-${E}`))},`loading-${E}`)):f.rows.map(($)=>(()=>{let E=new Map($.cells.map((B)=>[B.columnId,B]));return h(i.Fragment,{children:[F(D,{"data-state":$.isSelected?"selected":void 0,className:Z?"cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50":void 0,onClick:()=>Z?.($),onKeyDown:(B)=>L(B,$),tabIndex:Z?0:void 0,children:f.visibleColumns.map((B)=>F(d,{style:w(B),children:Z1($,E.get(B.id))},B.id))}),$.isExpanded&&$.expandedContent?F(D,{children:F(d,{className:"bg-muted/20 text-muted-foreground text-sm",colSpan:f.visibleColumns.length,children:$.expandedContent})}):null]},$.id)})())})]}),!J&&f.rows.length===0?U??F("div",{className:"rounded-md border border-dashed p-8 text-center text-muted-foreground text-sm",children:"No rows available."}):null,f.pageCount>0?F(j,{currentPage:f.pageIndex+1,totalPages:f.pageCount,totalItems:f.totalItems,itemsPerPage:f.pageSize,onPageChange:($)=>f.setPageIndex($-1),onItemsPerPageChange:($)=>f.setPageSize($)}):null,_]})}export{_0 as DataTable};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ContractTableCellRenderModel, ContractTableColumnRenderModel, ContractTableController, ContractTableRowRenderModel } from '@contractspec/lib.presentation-runtime-core';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare function showAllColumns(columns: ContractTableController<unknown, React.ReactNode>['columns']): void;
|
|
4
|
+
export declare function canHideDataColumn(columns: ContractTableController<unknown, React.ReactNode>['columns'], column: ContractTableColumnRenderModel<React.ReactNode>): boolean;
|
|
5
|
+
export declare function ColumnVisibilityMenu({ columns, }: {
|
|
6
|
+
columns: ContractTableController<unknown, React.ReactNode>['columns'];
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export declare function PinMenu({ column, }: {
|
|
9
|
+
column: ContractTableColumnRenderModel<React.ReactNode>;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export declare function ResizeHandle({ column, }: {
|
|
12
|
+
column: ContractTableColumnRenderModel<React.ReactNode>;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function renderHeaderContent<TItem>(controller: ContractTableController<TItem, React.ReactNode>, column: ContractTableColumnRenderModel<React.ReactNode>): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
15
|
+
export declare function renderCellContent<TItem>(row: ContractTableRowRenderModel<TItem, React.ReactNode>, cell: ContractTableRowRenderModel<TItem, React.ReactNode>['cells'][number] | undefined): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
16
|
+
export declare function cellOverflowClassName(cell: ContractTableCellRenderModel<React.ReactNode> | undefined): "max-w-full truncate whitespace-nowrap" | "max-w-full whitespace-normal break-words" | undefined;
|
|
17
|
+
export declare function renderOverflowCellContent<TItem>(row: ContractTableRowRenderModel<TItem, React.ReactNode>, cell: ContractTableRowRenderModel<TItem, React.ReactNode>['cells'][number] | undefined): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
18
|
+
export declare function stickyStyle(column: ContractTableColumnRenderModel<React.ReactNode>, isHeader?: boolean): React.CSSProperties;
|
|
19
|
+
export declare function ariaSortValue(column: ContractTableColumnRenderModel<React.ReactNode>): "none" | "ascending" | "descending" | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var Zq=import.meta.require;import{cn as x}from"@contractspec/lib.ui-kit-core/utils";import{Slot as d}from"@radix-ui/react-slot";import{cva as p}from"class-variance-authority";import*as M from"react";import{jsx as m}from"react/jsx-runtime";var i=p("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),P=M.forwardRef(({className:q,variant:J,size:K,asChild:W=!1,...F},Y)=>{return m(W?d:"button",{ref:Y,"data-slot":"button",className:x(i({variant:J,size:K,className:q})),...F})});P.displayName="Button";import{cn as a}from"@contractspec/lib.ui-kit-core/utils";import*as X from"@radix-ui/react-checkbox";import{CheckIcon as u}from"lucide-react";import{jsx as S}from"react/jsx-runtime";function V({className:q,...J}){return S(X.Root,{"data-slot":"checkbox",className:a("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs outline-none transition-shadow focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:data-[state=checked]:bg-primary dark:aria-invalid:ring-destructive/40",q),...J,children:S(X.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:S(u,{className:"size-3.5"})})})}import{cn as A}from"@contractspec/lib.ui-kit-core/utils";import*as Q from"@radix-ui/react-dropdown-menu";import{CheckIcon as t,ChevronRightIcon as r,CircleIcon as c}from"lucide-react";import{jsx as Z,jsxs as k}from"react/jsx-runtime";function L({...q}){return Z(Q.Root,{"data-slot":"dropdown-menu",...q})}function Sq({...q}){return Z(Q.Portal,{"data-slot":"dropdown-menu-portal",...q})}function I({...q}){return Z(Q.Trigger,{"data-slot":"dropdown-menu-trigger",...q})}function E({className:q,sideOffset:J=4,...K}){return Z(Q.Portal,{children:Z(Q.Content,{"data-slot":"dropdown-menu-content",sideOffset:J,className:A("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=closed]:animate-out data-[state=open]:animate-in",q),...K})})}function Vq({...q}){return Z(Q.Group,{"data-slot":"dropdown-menu-group",...q})}function B({className:q,inset:J,variant:K="default",...W}){return Z(Q.Item,{"data-slot":"dropdown-menu-item","data-inset":J,"data-variant":K,className:A("relative flex cursor-default select-none items-center gap-2 rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-inset:pl-8 data-[variant=destructive]:text-destructive data-disabled:opacity-50 data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:*:[svg]:text-destructive!",q),...W})}function N({className:q,children:J,checked:K,...W}){return k(Q.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:A("relative flex cursor-default select-none items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",q),checked:K,...W,children:[Z("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:Z(Q.ItemIndicator,{children:Z(t,{className:"size-4"})})}),J]})}function Lq({...q}){return Z(Q.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...q})}function Iq({className:q,children:J,...K}){return k(Q.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:A("relative flex cursor-default select-none items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",q),...K,children:[Z("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:Z(Q.ItemIndicator,{children:Z(c,{className:"size-2 fill-current"})})}),J]})}function C({className:q,inset:J,...K}){return Z(Q.Label,{"data-slot":"dropdown-menu-label","data-inset":J,className:A("px-2 py-1.5 font-medium text-sm data-inset:pl-8",q),...K})}function z({className:q,...J}){return Z(Q.Separator,{"data-slot":"dropdown-menu-separator",className:A("-mx-1 my-1 h-px bg-border",q),...J})}function Eq({className:q,...J}){return Z("span",{"data-slot":"dropdown-menu-shortcut",className:A("ml-auto text-muted-foreground text-xs tracking-widest",q),...J})}function zq({...q}){return Z(Q.Sub,{"data-slot":"dropdown-menu-sub",...q})}function kq({className:q,inset:J,children:K,...W}){return k(Q.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":J,className:A("flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-inset:pl-8 data-[state=open]:text-accent-foreground",q),...W,children:[K,Z(r,{className:"ml-auto size-4"})]})}function gq({className:q,...J}){return Z(Q.SubContent,{"data-slot":"dropdown-menu-sub-content",className:A("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=closed]:animate-out data-[state=open]:animate-in",q),...J})}import{cn as l}from"@contractspec/lib.ui-kit-core/utils";import{ChevronDown as s,ChevronRight as o,Columns3 as D,GripVertical as n,PanelLeft as e,PanelRight as qq,PinOff as Jq}from"lucide-react";import*as $ from"react";import{jsx as U,jsxs as y,Fragment as Yq}from"react/jsx-runtime";function Kq(q){q.forEach((J)=>J.toggleVisibility?.(!0))}function Qq(q,J){if(J.kind!=="data"||!J.visible)return!0;return q.filter((K)=>K.kind==="data"&&K.visible).length>1}function hq({columns:q}){let J=q.filter((Y)=>Y.kind==="data"),K=J.filter((Y)=>Y.canHide),W=K.filter((Y)=>!Y.visible),F=J.some((Y)=>Y.pinState);if(!K.length)return null;return y(L,{children:[U(I,{asChild:!0,children:y(P,{variant:"outline",size:"sm",children:[U(D,{className:"h-4 w-4"}),"Columns"]})}),y(E,{align:"end",children:[U(C,{children:"Visible Columns"}),U(z,{}),K.map((Y)=>{let G=!Qq(q,Y);return U(N,{checked:Y.visible,disabled:G,onCheckedChange:(H)=>{let O=Boolean(H);if(!O&&G)return;Y.toggleVisibility?.(O)},children:y("div",{className:"flex w-full items-center justify-between gap-3",children:[U("span",{children:Y.label}),G?U("span",{className:"text-muted-foreground text-xs",children:"Required"}):null]})},Y.id)}),W.length||F?y(Yq,{children:[U(z,{}),W.length?U(B,{onClick:()=>Kq(K),children:"Show All Columns"}):null,F?U(B,{onClick:()=>J.forEach((Y)=>Y.pin?.(!1)),children:"Reset Pins"}):null]}):null]})]})}function wq({column:q}){if(!q.canPin)return null;return y(L,{children:[U(I,{asChild:!0,children:U(P,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:(J)=>J.stopPropagation(),children:U(D,{className:"h-3.5 w-3.5"})})}),y(E,{align:"start",children:[y(B,{onClick:()=>q.pin?.("left"),children:[U(e,{className:"h-4 w-4"}),"Pin Left"]}),y(B,{onClick:()=>q.pin?.("right"),children:[U(qq,{className:"h-4 w-4"}),"Pin Right"]}),y(B,{onClick:()=>q.pin?.(!1),children:[U(Jq,{className:"h-4 w-4"}),"Unpin"]})]})]})}function vq({column:q}){let J=$.useRef(null),K=$.useRef(0),W=$.useRef(null),F=$.useRef(null),Y=$.useCallback(()=>{if(W.current=null,!K.current)return;q.resizeBy?.(K.current),K.current=0},[q]),G=$.useCallback((_)=>{if(!Number.isFinite(_)||_===0)return;if(K.current+=_,W.current!=null)return;W.current=window.requestAnimationFrame(Y)},[Y]),H=$.useCallback(()=>{if(J.current=null,F.current?.(),F.current=null,W.current!=null)window.cancelAnimationFrame(W.current),W.current=null;if(!K.current)return;q.resizeBy?.(K.current),K.current=0},[q]);$.useEffect(()=>{return H},[H]);let O=$.useCallback((_,g,R)=>{H(),J.current=_;let f=(T)=>{if(J.current==null)return;let j=T.clientX-J.current;J.current=T.clientX,G(j)},b=()=>H(),v=()=>{window.removeEventListener(g,f);for(let T of R)window.removeEventListener(T,b)};F.current=v,window.addEventListener(g,f);for(let T of R)window.addEventListener(T,b)},[H,G]),h=$.useCallback((_)=>{_.preventDefault(),_.stopPropagation(),_.currentTarget.setPointerCapture?.(_.pointerId),O(_.clientX,"pointermove",["pointerup","pointercancel"])},[O]),w=$.useCallback((_)=>{if(typeof window.PointerEvent==="function")return;_.preventDefault(),_.stopPropagation(),O(_.clientX,"mousemove",["mouseup"])},[O]);return U("span",{role:"separator","aria-label":`Resize ${q.label} column`,"aria-orientation":"vertical",tabIndex:-1,className:"absolute inset-y-0 right-0 flex w-3 cursor-col-resize items-center justify-center",onPointerDown:h,onMouseDown:w,children:U(n,{className:"h-3.5 w-3.5 text-muted-foreground"})})}function jq(q,J){if(J.kind==="selection"&&q.selectionMode==="multiple")return U(V,{"aria-label":"Select all rows",checked:q.allRowsSelected||(q.someRowsSelected?"indeterminate":!1),onCheckedChange:(K)=>q.toggleAllRowsSelected?.(Boolean(K)),onClick:(K)=>K.stopPropagation()});if(J.kind==="expansion")return null;return J.header}function Uq(q,J){if(!J)return null;if(J.kind==="selection")return U(V,{"aria-label":`Select row ${q.id}`,checked:q.isSelected,onCheckedChange:(K)=>q.toggleSelected?.(Boolean(K)),onClick:(K)=>K.stopPropagation()});if(J.kind==="expansion")return q.canExpand?U(P,{variant:"ghost",size:"icon",className:"h-7 w-7","aria-label":q.isExpanded?`Collapse row ${q.id}`:`Expand row ${q.id}`,onClick:(K)=>{K.stopPropagation(),q.toggleExpanded?.()},children:q.isExpanded?U(s,{className:"h-4 w-4"}):U(o,{className:"h-4 w-4"})}):null;return J.content}function Wq(q){if(!q||q.kind!=="data")return;switch(q.overflow){case"truncate":case"expand":return"max-w-full truncate whitespace-nowrap";case"wrap":return"max-w-full whitespace-normal break-words";case"none":default:return}}function xq(q,J){let K=Uq(q,J),W=Wq(J);if(!W)return K;return U("div",{className:l("min-w-0",W),children:K})}function dq(q,J=!1){return{width:q.size,minWidth:q.size,maxWidth:q.size,left:q.pinState==="left"?q.stickyOffset:void 0,right:q.pinState==="right"?q.stickyOffset:void 0,position:q.pinState?"sticky":"relative",zIndex:q.pinState?J?30:20:void 0}}function pq(q){if(q.kind!=="data"||!q.canSort)return;if(q.sortDirection==="asc")return"ascending";if(q.sortDirection==="desc")return"descending";return"none"}export{dq as stickyStyle,Kq as showAllColumns,xq as renderOverflowCellContent,jq as renderHeaderContent,Uq as renderCellContent,Wq as cellOverflowClassName,Qq as canHideDataColumn,pq as ariaSortValue,vq as ResizeHandle,wq as PinMenu,hq as ColumnVisibilityMenu};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { SharedDatePickerProps } from '@contractspec/lib.ui-kit-core/interfaces';
|
|
2
|
+
export interface DatePickerProps extends SharedDatePickerProps {
|
|
3
|
+
language?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function DatePicker({ value, onChange, disabled, minDate, maxDate, placeholder, className, language, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var s=import.meta.require;import{cn as N}from"@contractspec/lib.ui-kit-core/utils";import{Slot as f}from"@radix-ui/react-slot";import{cva as p}from"class-variance-authority";import*as T from"react";import{jsx as m}from"react/jsx-runtime";var R=p("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),W=T.forwardRef(({className:F,variant:Q,size:G,asChild:J=!1,...U},Z)=>{return m(J?f:"button",{ref:Z,"data-slot":"button",className:N(R({variant:Q,size:G,className:F})),...U})});W.displayName="Button";import{cn as u}from"@contractspec/lib.ui-kit-core/utils";import{jsx as d}from"react/jsx-runtime";function P({className:F,type:Q,ref:G,...J}){return d("input",{ref:G,type:Q,"data-slot":"input",className:u("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",F),...J})}import{cn as q}from"@contractspec/lib.ui-kit-core/utils";import{ChevronDownIcon as c,ChevronLeftIcon as i,ChevronRightIcon as l}from"lucide-react";import*as L from"react";import{DayPicker as r,getDefaultClassNames as V}from"react-day-picker";import{jsx as $}from"react/jsx-runtime";function y({className:F,classNames:Q,showOutsideDays:G=!0,captionLayout:J="label",buttonVariant:U="ghost",formatters:Z,components:w,...B}){let E=V();return $(r,{showOutsideDays:G,className:q("group/calendar bg-background in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent p-3 [--cell-size:--spacing(8)]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,F),captionLayout:J,formatters:{formatMonthDropdown:(K)=>K.toLocaleString("default",{month:"short"}),...Z},classNames:{root:q("w-fit",E.root),months:q("relative flex flex-col gap-4 md:flex-row",E.months),month:q("flex w-full flex-col gap-4",E.month),nav:q("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",E.nav),button_previous:q(R({variant:U}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_previous),button_next:q(R({variant:U}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_next),month_caption:q("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",E.month_caption),dropdowns:q("flex h-(--cell-size) w-full items-center justify-center gap-1.5 font-medium text-sm",E.dropdowns),dropdown_root:q("relative rounded-md border border-input shadow-2xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",E.dropdown_root),dropdown:q("absolute inset-0 bg-popover opacity-0",E.dropdown),caption_label:q("select-none font-medium",J==="label"?"text-sm":"flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",E.caption_label),table:"w-full border-collapse",weekdays:q("flex",E.weekdays),weekday:q("flex-1 select-none rounded-md font-normal text-[0.8rem] text-muted-foreground",E.weekday),week:q("mt-2 flex w-full",E.week),week_number_header:q("w-(--cell-size) select-none",E.week_number_header),week_number:q("select-none text-[0.8rem] text-muted-foreground",E.week_number),day:q("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",E.day),range_start:q("rounded-l-md bg-accent",E.range_start),range_middle:q("rounded-none",E.range_middle),range_end:q("rounded-r-md bg-accent",E.range_end),today:q("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",E.today),outside:q("text-muted-foreground aria-selected:text-muted-foreground",E.outside),disabled:q("text-muted-foreground opacity-50",E.disabled),hidden:q("invisible",E.hidden),...Q},components:{Root:({className:K,rootRef:_,...Y})=>{return $("div",{"data-slot":"calendar",ref:_,className:q(K),...Y})},Chevron:({className:K,orientation:_,...Y})=>{if(_==="left")return $(i,{className:q("size-4",K),...Y});if(_==="right")return $(l,{className:q("size-4",K),...Y});return $(c,{className:q("size-4",K),...Y})},DayButton:n,WeekNumber:({children:K,..._})=>{return $("td",{..._,children:$("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:K})})},...w},...B})}function n({className:F,day:Q,modifiers:G,...J}){let U=V(),Z=L.useRef(null);return L.useEffect(()=>{if(G.focused)Z.current?.focus()},[G.focused]),$(W,{ref:Z,variant:"ghost",size:"icon","data-day":Q.date.toLocaleDateString(),"data-selected-single":G.selected&&!G.range_start&&!G.range_end&&!G.range_middle,"data-range-start":G.range_start,"data-range-end":G.range_end,"data-range-middle":G.range_middle,className:q("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-start=true]:rounded-l-md data-[range-end=true]:bg-primary data-[range-middle=true]:bg-accent data-[range-start=true]:bg-primary data-[selected-single=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:text-accent-foreground data-[range-start=true]:text-primary-foreground data-[selected-single=true]:text-primary-foreground group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",U.day,F),...J})}import{cn as o}from"@contractspec/lib.ui-kit-core/utils";import*as X from"@radix-ui/react-popover";import{jsx as z}from"react/jsx-runtime";function g({...F}){return z(X.Root,{"data-slot":"popover",...F})}function b({...F}){return z(X.Trigger,{"data-slot":"popover-trigger",...F})}function h({className:F,align:Q="center",sideOffset:G=4,...J}){return z(X.Portal,{children:z(X.Content,{"data-slot":"popover-content",align:Q,sideOffset:G,className:o("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",F),...J})})}function Sq({...F}){return z(X.Anchor,{"data-slot":"popover-anchor",...F})}import{cn as D}from"@contractspec/lib.ui-kit-core/utils";import{CalendarIcon as t}from"lucide-react";import*as S from"react";import{jsx as A,jsxs as j}from"react/jsx-runtime";function kq({value:F,onChange:Q,disabled:G,minDate:J,maxDate:U,placeholder:Z="Select date",className:w,language:B}){let[E,K]=S.useState(!1),[_,Y]=S.useState(F??new Date),[v,I]=S.useState(k(F));S.useEffect(()=>{if(I(k(F)),F)Y(F)},[F]);function k(H){if(!H)return"";return H.toLocaleDateString(B,{day:"2-digit",month:"long",year:"numeric"})}function C(H){if(!H)return!1;return!isNaN(H.getTime())}function x(H){if(J&&H<J)return!1;if(U&&H>U)return!1;return!0}return j(g,{open:E,onOpenChange:K,children:[j("div",{className:D("relative w-full",w),children:[A(P,{value:v,placeholder:Z,onChange:(H)=>{let O=H.currentTarget.value;I(O);let M=new Date(O);if(C(M)&&x(M))Q(M),Y(M)},onKeyDown:(H)=>{if(H.key==="ArrowDown")H.preventDefault(),K(!0)},disabled:G,className:D("pr-10")}),A(b,{asChild:!0,children:A(W,{type:"button",variant:"ghost",size:"icon",className:"absolute top-1/2 right-1 -translate-y-1/2",disabled:G,"aria-label":"Open date picker",children:A(t,{className:"size-4"})})})]}),A(h,{className:"w-auto overflow-hidden p-0",align:"end",sideOffset:10,alignOffset:-8,children:A(y,{mode:"single",selected:F??void 0,captionLayout:"dropdown",month:_,onMonthChange:Y,onSelect:(H)=>{if(Q(H??null),I(k(H??null)),H)K(!1)},fromDate:J,toDate:U,initialFocus:!0})})]})}export{kq as DatePicker};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SharedDateRange, SharedDateRangePickerProps } from '@contractspec/lib.ui-kit-core/interfaces';
|
|
2
|
+
export interface DateRange extends SharedDateRange {
|
|
3
|
+
}
|
|
4
|
+
export interface DateRangePickerProps extends SharedDateRangePickerProps {
|
|
5
|
+
}
|
|
6
|
+
export declare function DateRangePicker({ value, onChange, disabled, minDate, maxDate, className, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var f=import.meta.require;import{cn as P}from"@contractspec/lib.ui-kit-core/utils";import{Slot as V}from"@radix-ui/react-slot";import{cva as D}from"class-variance-authority";import*as w from"react";import{jsx as y}from"react/jsx-runtime";var S=D("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),Z=w.forwardRef(({className:F,variant:M,size:G,asChild:J=!1,...Q},U)=>{return y(J?V:"button",{ref:U,"data-slot":"button",className:P(S({variant:M,size:G,className:F})),...Q})});Z.displayName="Button";import{cn as q}from"@contractspec/lib.ui-kit-core/utils";import{ChevronDownIcon as h,ChevronLeftIcon as g,ChevronRightIcon as b}from"lucide-react";import*as z from"react";import{DayPicker as j,getDefaultClassNames as I}from"react-day-picker";import{jsx as X}from"react/jsx-runtime";function R({className:F,classNames:M,showOutsideDays:G=!0,captionLayout:J="label",buttonVariant:Q="ghost",formatters:U,components:A,...T}){let E=I();return X(j,{showOutsideDays:G,className:q("group/calendar bg-background in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent p-3 [--cell-size:--spacing(8)]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,F),captionLayout:J,formatters:{formatMonthDropdown:(H)=>H.toLocaleString("default",{month:"short"}),...U},classNames:{root:q("w-fit",E.root),months:q("relative flex flex-col gap-4 md:flex-row",E.months),month:q("flex w-full flex-col gap-4",E.month),nav:q("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",E.nav),button_previous:q(S({variant:Q}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_previous),button_next:q(S({variant:Q}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_next),month_caption:q("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",E.month_caption),dropdowns:q("flex h-(--cell-size) w-full items-center justify-center gap-1.5 font-medium text-sm",E.dropdowns),dropdown_root:q("relative rounded-md border border-input shadow-2xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",E.dropdown_root),dropdown:q("absolute inset-0 bg-popover opacity-0",E.dropdown),caption_label:q("select-none font-medium",J==="label"?"text-sm":"flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",E.caption_label),table:"w-full border-collapse",weekdays:q("flex",E.weekdays),weekday:q("flex-1 select-none rounded-md font-normal text-[0.8rem] text-muted-foreground",E.weekday),week:q("mt-2 flex w-full",E.week),week_number_header:q("w-(--cell-size) select-none",E.week_number_header),week_number:q("select-none text-[0.8rem] text-muted-foreground",E.week_number),day:q("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",E.day),range_start:q("rounded-l-md bg-accent",E.range_start),range_middle:q("rounded-none",E.range_middle),range_end:q("rounded-r-md bg-accent",E.range_end),today:q("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",E.today),outside:q("text-muted-foreground aria-selected:text-muted-foreground",E.outside),disabled:q("text-muted-foreground opacity-50",E.disabled),hidden:q("invisible",E.hidden),...M},components:{Root:({className:H,rootRef:W,...Y})=>{return X("div",{"data-slot":"calendar",ref:W,className:q(H),...Y})},Chevron:({className:H,orientation:W,...Y})=>{if(W==="left")return X(g,{className:q("size-4",H),...Y});if(W==="right")return X(b,{className:q("size-4",H),...Y});return X(h,{className:q("size-4",H),...Y})},DayButton:x,WeekNumber:({children:H,...W})=>{return X("td",{...W,children:X("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:H})})},...A},...T})}function x({className:F,day:M,modifiers:G,...J}){let Q=I(),U=z.useRef(null);return z.useEffect(()=>{if(G.focused)U.current?.focus()},[G.focused]),X(Z,{ref:U,variant:"ghost",size:"icon","data-day":M.date.toLocaleDateString(),"data-selected-single":G.selected&&!G.range_start&&!G.range_end&&!G.range_middle,"data-range-start":G.range_start,"data-range-end":G.range_end,"data-range-middle":G.range_middle,className:q("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-start=true]:rounded-l-md data-[range-end=true]:bg-primary data-[range-middle=true]:bg-accent data-[range-start=true]:bg-primary data-[selected-single=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:text-accent-foreground data-[range-start=true]:text-primary-foreground data-[selected-single=true]:text-primary-foreground group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",Q.day,F),...J})}import{cn as v}from"@contractspec/lib.ui-kit-core/utils";import*as K from"@radix-ui/react-popover";import{jsx as _}from"react/jsx-runtime";function L({...F}){return _(K.Root,{"data-slot":"popover",...F})}function O({...F}){return _(K.Trigger,{"data-slot":"popover-trigger",...F})}function k({className:F,align:M="center",sideOffset:G=4,...J}){return _(K.Portal,{children:_(K.Content,{"data-slot":"popover-content",align:M,sideOffset:G,className:v("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",F),...J})})}function qq({...F}){return _(K.Anchor,{"data-slot":"popover-anchor",...F})}import{cn as C}from"@contractspec/lib.ui-kit-core/utils";import*as B from"react";import{jsx as $,jsxs as N}from"react/jsx-runtime";function Mq({value:F,onChange:M,disabled:G,minDate:J,maxDate:Q,className:U}){let[A,T]=B.useState(!1);return N(L,{open:A,onOpenChange:T,children:[$(O,{asChild:!0,children:$(Z,{type:"button",variant:"outline",disabled:G,className:C("w-full justify-start text-left font-normal",U),children:F.start&&F.end?`${F.start.toLocaleDateString()} - ${F.end.toLocaleDateString()}`:$("span",{className:"opacity-50",children:"Select date range"})})}),$(k,{className:"w-auto p-0",align:"start",children:$(R,{mode:"range",selected:F.start&&F.end?{from:F.start,to:F.end}:void 0,onSelect:(E)=>{let H=E?.from??null,W=E?.to??null;M({start:H,end:W})},fromDate:J,toDate:Q,numberOfMonths:2,initialFocus:!0})})]})}export{Mq as DateRangePicker};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SharedDateTimePickerProps } from '@contractspec/lib.ui-kit-core/interfaces';
|
|
2
|
+
export interface DateTimePickerProps extends SharedDateTimePickerProps {
|
|
3
|
+
datePlaceholder?: string;
|
|
4
|
+
timePlaceholder?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function DateTimePicker({ value, onChange, disabled, minDate, maxDate, datePlaceholder, timePlaceholder, is24Hour, className, }: DateTimePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var Uq=import.meta.require;import{cn as c}from"@contractspec/lib.ui-kit-core/utils";import{Slot as i}from"@radix-ui/react-slot";import{cva as r}from"class-variance-authority";import*as j from"react";import{jsx as n}from"react/jsx-runtime";var k=r("inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md font-medium text-sm outline-hidden transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-2xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),w=j.forwardRef(({className:q,variant:J,size:G,asChild:K=!1,...Y},_)=>{return n(K?i:"button",{ref:_,"data-slot":"button",className:c(k({variant:J,size:G,className:q})),...Y})});w.displayName="Button";import{cn as l}from"@contractspec/lib.ui-kit-core/utils";import{jsx as o}from"react/jsx-runtime";function C({className:q,type:J,ref:G,...K}){return o("input",{ref:G,type:J,"data-slot":"input",className:l("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs outline-none transition-[color,box-shadow] selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-foreground file:text-sm placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",q),...K})}import{cn as F}from"@contractspec/lib.ui-kit-core/utils";import{ChevronDownIcon as t,ChevronLeftIcon as s,ChevronRightIcon as a}from"lucide-react";import*as V from"react";import{DayPicker as e,getDefaultClassNames as N}from"react-day-picker";import{jsx as M}from"react/jsx-runtime";function v({className:q,classNames:J,showOutsideDays:G=!0,captionLayout:K="label",buttonVariant:Y="ghost",formatters:_,components:W,...z}){let E=N();return M(e,{showOutsideDays:G,className:F("group/calendar bg-background in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent p-3 [--cell-size:--spacing(8)]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,q),captionLayout:K,formatters:{formatMonthDropdown:(U)=>U.toLocaleString("default",{month:"short"}),..._},classNames:{root:F("w-fit",E.root),months:F("relative flex flex-col gap-4 md:flex-row",E.months),month:F("flex w-full flex-col gap-4",E.month),nav:F("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",E.nav),button_previous:F(k({variant:Y}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_previous),button_next:F(k({variant:Y}),"size-(--cell-size) select-none p-0 aria-disabled:opacity-50",E.button_next),month_caption:F("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",E.month_caption),dropdowns:F("flex h-(--cell-size) w-full items-center justify-center gap-1.5 font-medium text-sm",E.dropdowns),dropdown_root:F("relative rounded-md border border-input shadow-2xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",E.dropdown_root),dropdown:F("absolute inset-0 bg-popover opacity-0",E.dropdown),caption_label:F("select-none font-medium",K==="label"?"text-sm":"flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",E.caption_label),table:"w-full border-collapse",weekdays:F("flex",E.weekdays),weekday:F("flex-1 select-none rounded-md font-normal text-[0.8rem] text-muted-foreground",E.weekday),week:F("mt-2 flex w-full",E.week),week_number_header:F("w-(--cell-size) select-none",E.week_number_header),week_number:F("select-none text-[0.8rem] text-muted-foreground",E.week_number),day:F("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",E.day),range_start:F("rounded-l-md bg-accent",E.range_start),range_middle:F("rounded-none",E.range_middle),range_end:F("rounded-r-md bg-accent",E.range_end),today:F("rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",E.today),outside:F("text-muted-foreground aria-selected:text-muted-foreground",E.outside),disabled:F("text-muted-foreground opacity-50",E.disabled),hidden:F("invisible",E.hidden),...J},components:{Root:({className:U,rootRef:Z,...Q})=>{return M("div",{"data-slot":"calendar",ref:Z,className:F(U),...Q})},Chevron:({className:U,orientation:Z,...Q})=>{if(Z==="left")return M(s,{className:F("size-4",U),...Q});if(Z==="right")return M(a,{className:F("size-4",U),...Q});return M(t,{className:F("size-4",U),...Q})},DayButton:qq,WeekNumber:({children:U,...Z})=>{return M("td",{...Z,children:M("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:U})})},...W},...z})}function qq({className:q,day:J,modifiers:G,...K}){let Y=N(),_=V.useRef(null);return V.useEffect(()=>{if(G.focused)_.current?.focus()},[G.focused]),M(w,{ref:_,variant:"ghost",size:"icon","data-day":J.date.toLocaleDateString(),"data-selected-single":G.selected&&!G.range_start&&!G.range_end&&!G.range_middle,"data-range-start":G.range_start,"data-range-end":G.range_end,"data-range-middle":G.range_middle,className:F("flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-start=true]:rounded-l-md data-[range-end=true]:bg-primary data-[range-middle=true]:bg-accent data-[range-start=true]:bg-primary data-[selected-single=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:text-accent-foreground data-[range-start=true]:text-primary-foreground data-[selected-single=true]:text-primary-foreground group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",Y.day,q),...K})}import{cn as Eq}from"@contractspec/lib.ui-kit-core/utils";import*as $ from"@radix-ui/react-popover";import{jsx as H}from"react/jsx-runtime";function y({...q}){return H($.Root,{"data-slot":"popover",...q})}function P({...q}){return H($.Trigger,{"data-slot":"popover-trigger",...q})}function g({className:q,align:J="center",sideOffset:G=4,...K}){return H($.Portal,{children:H($.Content,{"data-slot":"popover-content",align:J,sideOffset:G,className:Eq("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[state=closed]:animate-out data-[state=open]:animate-in",q),...K})})}function Tq({...q}){return H($.Anchor,{"data-slot":"popover-anchor",...q})}import{cn as f}from"@contractspec/lib.ui-kit-core/utils";import{CalendarIcon as Fq}from"lucide-react";import*as I from"react";import{jsx as L,jsxs as x}from"react/jsx-runtime";function p({value:q,onChange:J,disabled:G,minDate:K,maxDate:Y,placeholder:_="Select date",className:W,language:z}){let[E,U]=I.useState(!1),[Z,Q]=I.useState(q??new Date),[A,S]=I.useState(B(q));I.useEffect(()=>{if(S(B(q)),q)Q(q)},[q]);function B(X){if(!X)return"";return X.toLocaleDateString(z,{day:"2-digit",month:"long",year:"numeric"})}function D(X){if(!X)return!1;return!isNaN(X.getTime())}function O(X){if(K&&X<K)return!1;if(Y&&X>Y)return!1;return!0}return x(y,{open:E,onOpenChange:U,children:[x("div",{className:f("relative w-full",W),children:[L(C,{value:A,placeholder:_,onChange:(X)=>{let h=X.currentTarget.value;S(h);let T=new Date(h);if(D(T)&&O(T))J(T),Q(T)},onKeyDown:(X)=>{if(X.key==="ArrowDown")X.preventDefault(),U(!0)},disabled:G,className:f("pr-10")}),L(P,{asChild:!0,children:L(w,{type:"button",variant:"ghost",size:"icon",className:"absolute top-1/2 right-1 -translate-y-1/2",disabled:G,"aria-label":"Open date picker",children:L(Fq,{className:"size-4"})})})]}),L(g,{className:"w-auto overflow-hidden p-0",align:"end",sideOffset:10,alignOffset:-8,children:L(v,{mode:"single",selected:q??void 0,captionLayout:"dropdown",month:Z,onMonthChange:Q,onSelect:(X)=>{if(J(X??null),S(B(X??null)),X)U(!1)},fromDate:K,toDate:Y,initialFocus:!0})})]})}import{cn as Gq}from"@contractspec/lib.ui-kit-core/utils";import*as b from"react";import{jsx as R,jsxs as m}from"react/jsx-runtime";function Jq(q,J){if(!q)return"";return q.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!J})}function d({value:q,onChange:J,disabled:G,placeholder:K="Select time",is24Hour:Y=!0,className:_}){let[W,z]=b.useState(!1),[E,U]=b.useState(()=>q?String(q.getHours()).padStart(2,"0"):""),[Z,Q]=b.useState(()=>q?String(q.getMinutes()).padStart(2,"0"):""),A=(S,B)=>{let O=new Date(q??new Date);O.setHours(S,B,0,0),J(O),z(!1)};return m(y,{open:W,onOpenChange:z,children:[R(P,{asChild:!0,children:R(w,{type:"button",variant:"outline",disabled:G,className:Gq("w-full justify-start text-left font-normal",_),children:q?Jq(q,Y):R("span",{className:"opacity-50",children:K})})}),R(g,{className:"w-56",align:"start",children:m("div",{className:"flex items-center gap-2",children:[R("input",{type:"number",min:0,max:Y?23:12,value:E,onChange:(S)=>U(S.target.value),className:"w-16 rounded-md border border-input bg-background px-2 py-1 text-center"}),R("span",{children:":"}),R("input",{type:"number",min:0,max:59,value:Z,onChange:(S)=>Q(S.target.value),className:"w-16 rounded-md border border-input bg-background px-2 py-1 text-center"}),R(w,{type:"button",onClick:()=>A(Number(E||0),Number(Z||0)),className:"ml-auto",children:"Set"})]})})]})}import{cn as Kq}from"@contractspec/lib.ui-kit-core/utils";import{jsx as u,jsxs as Qq}from"react/jsx-runtime";function cq({value:q,onChange:J,disabled:G,minDate:K,maxDate:Y,datePlaceholder:_,timePlaceholder:W,is24Hour:z,className:E}){let U=(Q)=>{if(!Q)return;let A=new Date(Q);if(q)A.setHours(q.getHours(),q.getMinutes(),0,0);J(A)},Z=(Q)=>{if(!Q)return;let A=new Date(q??new Date);A.setHours(Q.getHours(),Q.getMinutes(),0,0),J(A)};return Qq("div",{className:Kq("flex w-full min-w-0 gap-2",E),children:[u(p,{value:q,onChange:U,disabled:G,minDate:K,maxDate:Y,placeholder:_,className:"min-w-0 flex-1 shrink"}),u(d,{value:q,onChange:Z,disabled:G,is24Hour:z,placeholder:W,className:"min-w-0 flex-1 shrink"})]})}export{cq as DateTimePicker};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var R=import.meta.require;import{cn as E}from"@contractspec/lib.ui-kit-core/utils";import*as q from"@radix-ui/react-dialog";import{XIcon as L}from"lucide-react";import{jsx as z,jsxs as G}from"react/jsx-runtime";function W({...f}){return z(q.Root,{"data-slot":"dialog",...f})}function Y({...f}){return z(q.Trigger,{"data-slot":"dialog-trigger",...f})}function M({...f}){return z(q.Portal,{"data-slot":"dialog-portal",...f})}function Z({...f}){return z(q.Close,{"data-slot":"dialog-close",...f})}function Q({className:f,...A}){return z(q.Overlay,{"data-slot":"dialog-overlay",className:E("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",f),...A})}function _({className:f,children:A,showCloseButton:J=!0,...K}){return G(M,{"data-slot":"dialog-portal",children:[z(Q,{}),G(q.Content,{"data-slot":"dialog-content",className:E("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:max-w-lg",f),...K,children:[A,J&&G(q.Close,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",children:[z(L,{}),z("span",{className:"sr-only",children:"Close"})]})]})]})}function $({className:f,...A}){return z("div",{"data-slot":"dialog-header",className:E("flex flex-col gap-2 text-center sm:text-left",f),...A})}function b({className:f,...A}){return z("div",{"data-slot":"dialog-footer",className:E("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",f),...A})}function k({className:f,...A}){return z(q.Title,{"data-slot":"dialog-title",className:E("font-semibold text-lg leading-none",f),...A})}function F({className:f,...A}){return z(q.Description,{"data-slot":"dialog-description",className:E("text-muted-foreground text-sm",f),...A})}export{Y as DialogTrigger,k as DialogTitle,M as DialogPortal,Q as DialogOverlay,$ as DialogHeader,b as DialogFooter,F as DialogDescription,_ as DialogContent,Z as DialogClose,W as Dialog};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Direction = 'ltr' | 'rtl';
|
|
3
|
+
export interface DirectionProviderProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
dir?: Direction;
|
|
6
|
+
}
|
|
7
|
+
export declare function DirectionProvider({ children, dir, }: DirectionProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function useDirection(): Direction;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var n=import.meta.require;import*as e from"react";import{jsx as o}from"react/jsx-runtime";var t=e.createContext("ltr");function D({children:r,dir:i="ltr"}){return o(t.Provider,{value:i,children:r})}function a(){return e.useContext(t)}export{a as useDirection,D as DirectionProvider};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
|
+
declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DrawerHeader({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentPropsWithoutRef<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var K=import.meta.require;import{cn as B}from"@contractspec/lib.ui-kit-core/utils";import{Drawer as A}from"vaul";import{jsx as z,jsxs as E}from"react/jsx-runtime";function R({...f}){return z(A.Root,{"data-slot":"drawer",...f})}function S({...f}){return z(A.Trigger,{"data-slot":"drawer-trigger",...f})}function I({...f}){return z(A.Portal,{"data-slot":"drawer-portal",...f})}function U({...f}){return z(A.Close,{"data-slot":"drawer-close",...f})}function J({className:f,...q}){return z(A.Overlay,{"data-slot":"drawer-overlay",className:B("data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=open]:animate-in",f),...q})}function V({className:f,children:q,...G}){return E(I,{"data-slot":"drawer-portal",children:[z(J,{}),E(A.Content,{"data-slot":"drawer-content",className:B("group/drawer-content fixed z-50 flex h-auto flex-col bg-background","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l sm:data-[vaul-drawer-direction=right]:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r sm:data-[vaul-drawer-direction=left]:max-w-sm",f),...G,children:[z("div",{className:"mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),q]})]})}function W({className:f,...q}){return z("div",{"data-slot":"drawer-header",className:B("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",f),...q})}function X({className:f,...q}){return z("div",{"data-slot":"drawer-footer",className:B("mt-auto flex flex-col gap-2 p-4",f),...q})}function Y({className:f,...q}){return z(A.Title,{"data-slot":"drawer-title",className:B("font-semibold text-foreground",f),...q})}function Z({className:f,...q}){return z(A.Description,{"data-slot":"drawer-description",className:B("text-muted-foreground text-sm",f),...q})}export{S as DrawerTrigger,Y as DrawerTitle,I as DrawerPortal,J as DrawerOverlay,W as DrawerHeader,X as DrawerFooter,Z as DrawerDescription,V as DrawerContent,U as DrawerClose,R as Drawer};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
9
|
+
inset?: boolean;
|
|
10
|
+
variant?: 'default' | 'destructive';
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
16
|
+
inset?: boolean;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentPropsWithoutRef<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
|