@lssm/lib.design-system 0.0.0-canary-20251217060433 → 0.0.0-canary-20251217062139
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/dist/_virtual/rolldown_runtime.js +1 -12
- package/dist/components/agent/AgentMonitor.js +3 -3
- package/dist/components/agent/ApprovalQueue.d.ts +2 -2
- package/dist/components/agent/ApprovalQueue.js +4 -5
- package/dist/components/atoms/ActionButtons.d.ts +3 -3
- package/dist/components/atoms/ActionButtons.js +3 -3
- package/dist/components/atoms/Button.d.ts +6 -6
- package/dist/components/atoms/Button.js +2 -2
- package/dist/components/atoms/ButtonLink.js +2 -2
- package/dist/components/atoms/Cta.d.ts +7 -7
- package/dist/components/atoms/Cta.js +2 -2
- package/dist/components/atoms/DataChips.d.ts +2 -2
- package/dist/components/atoms/DataChips.js +1 -1
- package/dist/components/atoms/EmptyState.d.ts +2 -2
- package/dist/components/atoms/EmptyState.js +1 -1
- package/dist/components/atoms/ErrorState.d.ts +6 -6
- package/dist/components/atoms/ErrorState.js +1 -1
- package/dist/components/atoms/Input.d.ts +2 -2
- package/dist/components/atoms/Input.js +1 -1
- package/dist/components/atoms/Link.web.d.ts +3 -3
- package/dist/components/atoms/Link.web.js +4 -6
- package/dist/components/atoms/LoaderCircular.d.ts +3 -3
- package/dist/components/atoms/LoaderCircular.js +2 -2
- package/dist/components/atoms/NavBrand.d.ts +3 -3
- package/dist/components/atoms/NavBrand.js +1 -1
- package/dist/components/atoms/Stepper.d.ts +2 -2
- package/dist/components/atoms/Stepper.js +1 -1
- package/dist/components/atoms/Textarea.d.ts +2 -2
- package/dist/components/atoms/Textarea.js +4 -4
- package/dist/components/data-view/DataViewDetail.d.ts +3 -3
- package/dist/components/data-view/DataViewList.d.ts +3 -3
- package/dist/components/data-view/DataViewRenderer.d.ts +5 -5
- package/dist/components/data-view/DataViewRenderer.js +3 -3
- package/dist/components/data-view/DataViewTable.d.ts +4 -4
- package/dist/components/forms/ActionForm.d.ts +3 -3
- package/dist/components/forms/ActionForm.js +1 -1
- package/dist/components/forms/FormCardLayout.d.ts +5 -5
- package/dist/components/forms/FormCardLayout.js +2 -2
- package/dist/components/forms/FormDialog.d.ts +5 -5
- package/dist/components/forms/FormDialog.js +1 -1
- package/dist/components/forms/FormLayout.d.ts +4 -4
- package/dist/components/forms/FormLayout.js +1 -1
- package/dist/components/forms/FormOneByOneLayout.d.ts +4 -4
- package/dist/components/forms/FormOneByOneLayout.js +4 -4
- package/dist/components/forms/FormStepsLayout.d.ts +4 -4
- package/dist/components/forms/FormStepsLayout.js +5 -5
- package/dist/components/forms/ZodForm.d.ts +4 -4
- package/dist/components/forms/ZodForm.js +1 -1
- package/dist/components/legal/atoms/DefinitionList.d.ts +3 -3
- package/dist/components/legal/atoms/DefinitionList.js +1 -1
- package/dist/components/legal/atoms/KeyValueList.d.ts +3 -3
- package/dist/components/legal/atoms/KeyValueList.js +1 -1
- package/dist/components/legal/atoms/LegalCallout.d.ts +2 -2
- package/dist/components/legal/atoms/LegalCallout.js +1 -1
- package/dist/components/legal/atoms/LegalHeading.d.ts +2 -2
- package/dist/components/legal/atoms/LegalHeading.js +1 -1
- package/dist/components/legal/atoms/LegalList.d.ts +2 -2
- package/dist/components/legal/atoms/LegalList.js +1 -1
- package/dist/components/legal/atoms/LegalSection.d.ts +2 -2
- package/dist/components/legal/atoms/LegalSection.js +1 -1
- package/dist/components/legal/atoms/LegalText.d.ts +2 -2
- package/dist/components/legal/atoms/LegalText.js +1 -1
- package/dist/components/legal/molecules/Consent.d.ts +5 -5
- package/dist/components/legal/molecules/Consent.js +2 -2
- package/dist/components/legal/molecules/ContactFields.js +1 -1
- package/dist/components/legal/molecules/LegalMeta.js +1 -1
- package/dist/components/legal/molecules/LegalTOC.d.ts +3 -3
- package/dist/components/legal/molecules/LegalTOC.js +1 -1
- package/dist/components/legal/organisms/ContactForm.d.ts +2 -2
- package/dist/components/legal/organisms/ContactForm.js +3 -3
- package/dist/components/legal/organisms/GDPRDataRequest.d.ts +3 -3
- package/dist/components/legal/organisms/GDPRDataRequest.js +2 -2
- package/dist/components/legal/organisms/GDPRRights.d.ts +3 -3
- package/dist/components/legal/organisms/LegalPageLayout.d.ts +3 -3
- package/dist/components/legal/organisms/LegalPageLayout.js +1 -1
- package/dist/components/legal/templates/ContactTemplate.d.ts +2 -2
- package/dist/components/legal/templates/ContactTemplate.js +3 -3
- package/dist/components/legal/templates/CookiesTemplate.d.ts +7 -7
- package/dist/components/legal/templates/PrivacyTemplate.d.ts +7 -7
- package/dist/components/legal/templates/SalesTermsTemplate.d.ts +5 -5
- package/dist/components/legal/templates/TermsTemplate.d.ts +5 -5
- package/dist/components/marketing/MarketingCard.d.ts +4 -4
- package/dist/components/marketing/MarketingCard.js +3 -3
- package/dist/components/marketing/MarketingCardsSection.d.ts +2 -2
- package/dist/components/marketing/MarketingCardsSection.js +1 -1
- package/dist/components/marketing/MarketingComparisonSection.d.ts +5 -5
- package/dist/components/marketing/MarketingComparisonSection.js +3 -3
- package/dist/components/marketing/MarketingIconCard.d.ts +5 -5
- package/dist/components/marketing/MarketingIconCard.js +4 -3
- package/dist/components/marketing/MarketingSection.d.ts +5 -5
- package/dist/components/marketing/MarketingSection.js +3 -3
- package/dist/components/marketing/MarketingStepCard.d.ts +3 -3
- package/dist/components/marketing/MarketingStepCard.js +4 -3
- package/dist/components/molecules/AiLinkButton.js +5 -5
- package/dist/components/molecules/Breadcrumbs.d.ts +4 -4
- package/dist/components/molecules/Breadcrumbs.js +3 -3
- package/dist/components/molecules/CommandPalette.js +4 -4
- package/dist/components/molecules/CommandSearchTrigger.d.ts +4 -4
- package/dist/components/molecules/CommandSearchTrigger.js +5 -5
- package/dist/components/molecules/EntityCard.d.ts +9 -9
- package/dist/components/molecules/EntityCard.js +2 -2
- package/dist/components/molecules/FiltersToolbar.d.ts +4 -4
- package/dist/components/molecules/FiltersToolbar.js +6 -6
- package/dist/components/molecules/HoverPreview.d.ts +3 -3
- package/dist/components/molecules/HoverPreview.js +4 -2
- package/dist/components/molecules/LangSwitch.d.ts +2 -2
- package/dist/components/molecules/LangSwitchDropdown.js +4 -4
- package/dist/components/molecules/LoaderBlock.d.ts +3 -3
- package/dist/components/molecules/LoaderBlock.js +1 -1
- package/dist/components/molecules/MobileNavMenu.js +1 -1
- package/dist/components/molecules/NavItemCard.js +1 -1
- package/dist/components/molecules/NavMain.js +4 -4
- package/dist/components/molecules/NavUser.js +2 -2
- package/dist/components/molecules/OverviewCard.d.ts +2 -2
- package/dist/components/molecules/OverviewCard.js +3 -5
- package/dist/components/molecules/SkeletonBlock/index.web.js +2 -2
- package/dist/components/molecules/SkeletonCircle/index.web.js +1 -1
- package/dist/components/molecules/SkeletonList/index.web.js +1 -1
- package/dist/components/molecules/StatCard.d.ts +8 -8
- package/dist/components/molecules/StatCard.js +2 -2
- package/dist/components/molecules/StatusChip.d.ts +5 -5
- package/dist/components/molecules/StatusChip.js +1 -1
- package/dist/components/molecules/hover-previews/Doc.d.ts +6 -6
- package/dist/components/molecules/hover-previews/Media.d.ts +5 -5
- package/dist/components/molecules/hover-previews/Simple.d.ts +7 -7
- package/dist/components/molecules/hover-previews/Stats.d.ts +6 -6
- package/dist/components/molecules/hover-previews/User.d.ts +7 -7
- package/dist/components/organisms/AcademyLayout.d.ts +7 -7
- package/dist/components/organisms/AcademyLayout.js +4 -4
- package/dist/components/organisms/AppHeader.d.ts +3 -3
- package/dist/components/organisms/AppHeader.js +2 -2
- package/dist/components/organisms/AppLayout.d.ts +6 -6
- package/dist/components/organisms/AppLayout.js +5 -5
- package/dist/components/organisms/AppSidebar.d.ts +3 -3
- package/dist/components/organisms/AppSidebar.js +2 -2
- package/dist/components/organisms/EmptyDataList.js +1 -1
- package/dist/components/organisms/EmptyDataList.types.d.ts +8 -8
- package/dist/components/organisms/EmptySearchResult.d.ts +5 -5
- package/dist/components/organisms/EmptySearchResult.js +3 -3
- package/dist/components/organisms/FAQSection.d.ts +6 -6
- package/dist/components/organisms/FAQSection.js +4 -4
- package/dist/components/organisms/FeatureCarousel.d.ts +6 -6
- package/dist/components/organisms/FeatureCarousel.js +2 -2
- package/dist/components/organisms/FeaturesSection.d.ts +4 -4
- package/dist/components/organisms/FeaturesSection.js +1 -1
- package/dist/components/organisms/Footer.d.ts +7 -7
- package/dist/components/organisms/Footer.js +2 -2
- package/dist/components/organisms/Header.d.ts +5 -5
- package/dist/components/organisms/Header.js +4 -4
- package/dist/components/organisms/HeroResponsive.d.ts +2 -2
- package/dist/components/organisms/HeroSection.d.ts +3 -3
- package/dist/components/organisms/HeroSection.js +1 -1
- package/dist/components/organisms/ListCardPage.d.ts +4 -4
- package/dist/components/organisms/ListCardPage.js +2 -2
- package/dist/components/organisms/ListGridPage.d.ts +4 -4
- package/dist/components/organisms/ListGridPage.js +1 -1
- package/dist/components/organisms/ListPageResponsive.js +1 -1
- package/dist/components/organisms/ListTablePage.d.ts +6 -6
- package/dist/components/organisms/ListTablePage.js +2 -2
- package/dist/components/organisms/MarketingHeader.d.ts +4 -4
- package/dist/components/organisms/MarketingHeader.js +9 -9
- package/dist/components/organisms/MarketingHeaderDesktop.js +3 -3
- package/dist/components/organisms/MarketingHeaderMobile.js +6 -6
- package/dist/components/organisms/MarketingLayout.d.ts +4 -4
- package/dist/components/organisms/MarketingLayout.js +2 -2
- package/dist/components/organisms/PageHeaderResponsive.js +1 -1
- package/dist/components/organisms/PricingCarousel.js +2 -2
- package/dist/components/organisms/PricingSection.d.ts +3 -3
- package/dist/components/organisms/PricingSection.js +1 -1
- package/dist/components/organisms/TestimonialCarousel.d.ts +5 -5
- package/dist/components/organisms/TestimonialCarousel.js +2 -2
- package/dist/components/templates/lists/ListPageTemplate/index.web.js +5 -5
- package/dist/components/templates/lists/ListPageTemplate/types.d.ts +7 -7
- package/dist/contracts/dist/client/react/drivers/shadcn.js +7 -0
- package/dist/contracts/dist/client/react/form-render.js +261 -0
- package/dist/contracts/dist/forms.js +78 -0
- package/dist/hooks/useListUrlState.js +7 -7
- package/dist/index.js +2 -1
- package/dist/platform/useColorScheme.js +3 -3
- package/dist/platform/useReducedMotion.js +3 -3
- package/dist/platform/useResponsive.js +4 -4
- package/dist/renderers/form-contract.d.ts +1 -1
- package/dist/renderers/form-contract.js +13 -13
- package/dist/types/navigation.d.ts +10 -10
- package/dist/ui-kit-web/dist/ui/accordion.js +48 -0
- package/dist/ui-kit-web/dist/ui/atoms/FilterSelect/FilterSelect.js +52 -0
- package/dist/ui-kit-web/dist/ui/atoms/Pagination/Pagination.js +156 -0
- package/dist/ui-kit-web/dist/ui/atoms/SearchInput/SearchInput.js +49 -0
- package/dist/ui-kit-web/dist/ui/avatar.js +32 -0
- package/dist/ui-kit-web/dist/ui/badge.js +27 -0
- package/dist/ui-kit-web/dist/ui/breadcrumb.js +59 -0
- package/dist/ui-kit-web/dist/ui/button.js +55 -0
- package/dist/ui-kit-web/dist/ui/card.js +44 -0
- package/dist/ui-kit-web/dist/ui/carousel.js +135 -0
- package/dist/ui-kit-web/dist/ui/checkbox.js +25 -0
- package/dist/ui-kit-web/dist/ui/collapsible.js +27 -0
- package/dist/ui-kit-web/dist/ui/command.js +90 -0
- package/dist/ui-kit-web/dist/ui/dialog.js +84 -0
- package/dist/ui-kit-web/dist/ui/dropdown-menu.js +57 -0
- package/dist/ui-kit-web/dist/ui/empty-state.js +43 -0
- package/dist/ui-kit-web/dist/ui/empty.js +62 -0
- package/dist/ui-kit-web/dist/ui/field.js +78 -0
- package/dist/ui-kit-web/dist/ui/form.js +16 -0
- package/dist/ui-kit-web/dist/ui/hover-card.js +40 -0
- package/dist/ui-kit-web/dist/ui/input.js +17 -0
- package/dist/ui-kit-web/dist/ui/label.js +19 -0
- package/dist/ui-kit-web/dist/ui/marketing/Hero.js +52 -0
- package/dist/ui-kit-web/dist/ui/marketing/PricingTable.js +59 -0
- package/dist/ui-kit-web/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js +102 -0
- package/dist/ui-kit-web/dist/ui/molecules/SkeletonList.js +14 -0
- package/dist/ui-kit-web/dist/ui/navigation-menu.js +75 -0
- package/dist/ui-kit-web/dist/ui/organisms/ListPage/ListPage.js +197 -0
- package/dist/ui-kit-web/dist/ui/page-header.js +40 -0
- package/dist/ui-kit-web/dist/ui/pagination.js +65 -0
- package/dist/ui-kit-web/dist/ui/radio-group.js +32 -0
- package/dist/ui-kit-web/dist/ui/select.js +86 -0
- package/dist/ui-kit-web/dist/ui/separator.js +21 -0
- package/dist/ui-kit-web/dist/ui/sheet.js +80 -0
- package/dist/ui-kit-web/dist/ui/sidebar.js +281 -0
- package/dist/ui-kit-web/dist/ui/skeleton.js +14 -0
- package/dist/ui-kit-web/dist/ui/stack.js +158 -0
- package/dist/ui-kit-web/dist/ui/stepper.js +37 -0
- package/dist/ui-kit-web/dist/ui/switch.js +24 -0
- package/dist/ui-kit-web/dist/ui/table.js +57 -0
- package/dist/ui-kit-web/dist/ui/text.js +16 -0
- package/dist/ui-kit-web/dist/ui/textarea.js +16 -0
- package/dist/ui-kit-web/dist/ui/tooltip.js +40 -0
- package/dist/ui-kit-web/dist/ui/typography.js +23 -0
- package/dist/ui-kit-web/dist/ui/use-mobile.js +20 -0
- package/dist/ui-kit-web/dist/ui/utils.js +10 -0
- package/dist/ui-kit-web/dist/ui-kit-core/dist/utils.js +13 -0
- package/package.json +7 -7
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Button } from "../../button.js";
|
|
2
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../collapsible.js";
|
|
3
|
+
import { FilterSelect } from "../../atoms/FilterSelect/FilterSelect.js";
|
|
4
|
+
import { SearchInput } from "../../atoms/SearchInput/SearchInput.js";
|
|
5
|
+
import React, { useState } from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { ChevronDown, ChevronUp, Filter } from "lucide-react";
|
|
8
|
+
|
|
9
|
+
//#region ../ui-kit-web/dist/ui/molecules/SearchAndFilter/SearchAndFilter.js
|
|
10
|
+
const SearchAndFilter = ({ searchValue, onSearchChange, searchPlaceholder, filters = [], isLoading = false, disabled = false, className = "", collapsible = true, defaultCollapsed = false }) => {
|
|
11
|
+
const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
|
|
12
|
+
const hasFilters = filters.length > 0;
|
|
13
|
+
const activeFiltersCount = filters.filter((f) => f.value).length;
|
|
14
|
+
const shouldUseCollapsible = collapsible && hasFilters;
|
|
15
|
+
console.log("SearchAndFilter", { filters });
|
|
16
|
+
const FilterComponents = () => /* @__PURE__ */ jsx("div", {
|
|
17
|
+
className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",
|
|
18
|
+
children: filters.map((filter) => /* @__PURE__ */ jsx(FilterSelect, {
|
|
19
|
+
value: filter.value,
|
|
20
|
+
options: filter.options,
|
|
21
|
+
onChange: filter.onChange,
|
|
22
|
+
label: filter.label,
|
|
23
|
+
disabled: disabled || isLoading,
|
|
24
|
+
showCounts: filter.showCounts,
|
|
25
|
+
className: "min-w-0"
|
|
26
|
+
}, filter.key))
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: `space-y-4 ${className}`,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: "flex flex-col gap-4 sm:flex-row",
|
|
33
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
34
|
+
className: "flex-1",
|
|
35
|
+
children: /* @__PURE__ */ jsx(SearchInput, {
|
|
36
|
+
value: searchValue,
|
|
37
|
+
onChange: onSearchChange,
|
|
38
|
+
placeholder: searchPlaceholder,
|
|
39
|
+
disabled: disabled || isLoading,
|
|
40
|
+
className: "w-full"
|
|
41
|
+
})
|
|
42
|
+
}), shouldUseCollapsible && /* @__PURE__ */ jsxs(Collapsible, {
|
|
43
|
+
open: !isCollapsed,
|
|
44
|
+
onOpenChange: setIsCollapsed,
|
|
45
|
+
className: "sm:hidden",
|
|
46
|
+
children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
|
|
47
|
+
asChild: true,
|
|
48
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
49
|
+
variant: "outline",
|
|
50
|
+
className: "sm:hidden",
|
|
51
|
+
disabled: disabled || isLoading,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx(Filter, { className: "mr-2 h-4 w-4" }),
|
|
54
|
+
"Filtres",
|
|
55
|
+
activeFiltersCount > 0 && /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "bg-primary text-primary-foreground ml-2 flex h-5 w-5 items-center justify-center rounded-full text-sm",
|
|
57
|
+
children: activeFiltersCount
|
|
58
|
+
}),
|
|
59
|
+
isCollapsed ? /* @__PURE__ */ jsx(ChevronDown, { className: "ml-2 h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronUp, { className: "ml-2 h-4 w-4" })
|
|
60
|
+
]
|
|
61
|
+
})
|
|
62
|
+
}), /* @__PURE__ */ jsx(CollapsibleContent, {
|
|
63
|
+
className: "mt-4 space-y-4",
|
|
64
|
+
children: /* @__PURE__ */ jsx(FilterComponents, {})
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
}),
|
|
68
|
+
hasFilters && /* @__PURE__ */ jsx("div", {
|
|
69
|
+
className: "hidden sm:block",
|
|
70
|
+
children: /* @__PURE__ */ jsx(FilterComponents, {})
|
|
71
|
+
}),
|
|
72
|
+
activeFiltersCount > 0 && /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: "flex flex-wrap items-center gap-2",
|
|
74
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
75
|
+
className: "text-muted-foreground text-base",
|
|
76
|
+
children: "Filtres actifs:"
|
|
77
|
+
}), filters.filter((f) => f.value).map((filter) => {
|
|
78
|
+
const selectedOption = filter.options.find((opt) => opt.value === filter.value);
|
|
79
|
+
return /* @__PURE__ */ jsxs(Button, {
|
|
80
|
+
variant: "secondary",
|
|
81
|
+
size: "sm",
|
|
82
|
+
onClick: () => filter.onChange(""),
|
|
83
|
+
disabled: disabled || isLoading,
|
|
84
|
+
className: "h-7 px-2 text-sm",
|
|
85
|
+
children: [
|
|
86
|
+
filter.label,
|
|
87
|
+
": ",
|
|
88
|
+
selectedOption?.label,
|
|
89
|
+
/* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: "ml-1",
|
|
91
|
+
children: "×"
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
}, filter.key);
|
|
95
|
+
})]
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
export { SearchAndFilter };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Skeleton } from "../skeleton.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region ../ui-kit-web/dist/ui/molecules/SkeletonList.js
|
|
6
|
+
function SkeletonList({ count = 6, className = "", itemClassName = "" }) {
|
|
7
|
+
return /* @__PURE__ */ jsx("div", {
|
|
8
|
+
className: `space-y-3 ${className}`,
|
|
9
|
+
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsx(Skeleton, { className: `h-20 rounded-md ${itemClassName}` }, i))
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SkeletonList };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { ChevronDownIcon } from "lucide-react";
|
|
6
|
+
import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
|
|
7
|
+
|
|
8
|
+
//#region ../ui-kit-web/dist/ui/navigation-menu.js
|
|
9
|
+
init_utils();
|
|
10
|
+
function NavigationMenu({ className, children, viewport = true, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Root, {
|
|
12
|
+
"data-slot": "navigation-menu",
|
|
13
|
+
"data-viewport": viewport,
|
|
14
|
+
className: cn("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center", className),
|
|
15
|
+
...props,
|
|
16
|
+
children: [children, viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})]
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function NavigationMenuList({ className, ...props }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.List, {
|
|
21
|
+
"data-slot": "navigation-menu-list",
|
|
22
|
+
className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
27
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Item, {
|
|
28
|
+
"data-slot": "navigation-menu-item",
|
|
29
|
+
className: cn("relative", className),
|
|
30
|
+
...props
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const navigationMenuTriggerStyle = cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");
|
|
34
|
+
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsxs(NavigationMenuPrimitive.Trigger, {
|
|
36
|
+
"data-slot": "navigation-menu-trigger",
|
|
37
|
+
className: cn(navigationMenuTriggerStyle(), "group", className),
|
|
38
|
+
...props,
|
|
39
|
+
children: [
|
|
40
|
+
children,
|
|
41
|
+
" ",
|
|
42
|
+
/* @__PURE__ */ jsx(ChevronDownIcon, {
|
|
43
|
+
className: "relative top-px ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180",
|
|
44
|
+
"aria-hidden": "true"
|
|
45
|
+
})
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Content, {
|
|
51
|
+
"data-slot": "navigation-menu-content",
|
|
52
|
+
className: cn("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto", "bg-background group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground data-[state=open]:group-data-[viewport=false]/navigation-menu:animate-in data-[state=closed]:group-data-[viewport=false]/navigation-menu:animate-out data-[state=closed]:group-data-[viewport=false]/navigation-menu:fade-out-0 data-[state=open]:group-data-[viewport=false]/navigation-menu:fade-in-0 data-[state=closed]:group-data-[viewport=false]/navigation-menu:zoom-out-95 data-[state=open]:group-data-[viewport=false]/navigation-menu:zoom-in-95 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow-2xs group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-hidden", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function NavigationMenuViewport({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx("div", {
|
|
58
|
+
className: cn("absolute top-full left-0 isolate z-50 flex justify-center"),
|
|
59
|
+
children: /* @__PURE__ */ jsx(NavigationMenuPrimitive.Viewport, {
|
|
60
|
+
"data-slot": "navigation-menu-viewport",
|
|
61
|
+
className: cn("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-(--radix-navigation-menu-viewport-height) w-full overflow-hidden rounded-md border shadow-2xs md:w-(--radix-navigation-menu-viewport-width)", className),
|
|
62
|
+
...props
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function NavigationMenuLink({ className, ...props }) {
|
|
67
|
+
return /* @__PURE__ */ jsx(NavigationMenuPrimitive.Link, {
|
|
68
|
+
"data-slot": "navigation-menu-link",
|
|
69
|
+
className: cn("hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground data-[active=true]:hover:bg-accent data-[active=true]:focus:bg-accent [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-xs p-2 text-sm outline-hidden transition-all focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className),
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
//#endregion
|
|
75
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { Separator } from "../../separator.js";
|
|
2
|
+
import { Button } from "../../button.js";
|
|
3
|
+
import { HStack, VStack } from "../../stack.js";
|
|
4
|
+
import { Card, CardContent } from "../../card.js";
|
|
5
|
+
import { Pagination } from "../../atoms/Pagination/Pagination.js";
|
|
6
|
+
import { SearchAndFilter } from "../../molecules/SearchAndFilter/SearchAndFilter.js";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { AlertTriangle, Loader2, Plus, RefreshCcw } from "lucide-react";
|
|
10
|
+
import Link from "next/link";
|
|
11
|
+
|
|
12
|
+
//#region ../ui-kit-web/dist/ui/organisms/ListPage/ListPage.js
|
|
13
|
+
function ListPage({ title, description, header, items, totalItems, totalPages, isLoading, isFetching, error, listState, searchPlaceholder, filters = [], onRefresh, primaryAction, toolbar, renderItem, renderEmpty, renderStats, className = "", itemClassName = "" }) {
|
|
14
|
+
const { searchQuery, setSearchQuery, filters: filterValues, setFilter, currentPage, itemsPerPage, setCurrentPage, setItemsPerPage } = listState;
|
|
15
|
+
if (isLoading && !items.length) return /* @__PURE__ */ jsxs(VStack, {
|
|
16
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
17
|
+
children: [header ? header : /* @__PURE__ */ jsxs(VStack, {
|
|
18
|
+
className: "gap-1",
|
|
19
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
20
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
21
|
+
children: title
|
|
22
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
23
|
+
className: "text-muted-foreground text-base",
|
|
24
|
+
children: description
|
|
25
|
+
})]
|
|
26
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
27
|
+
className: "flex min-h-[400px] items-center justify-center",
|
|
28
|
+
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
29
|
+
className: "flex items-center gap-4 p-6",
|
|
30
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "text-primary h-8 w-8 animate-spin" }), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
31
|
+
className: "font-medium",
|
|
32
|
+
children: "Chargement..."
|
|
33
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
34
|
+
className: "text-muted-foreground text-base",
|
|
35
|
+
children: "Récupération des données en cours"
|
|
36
|
+
})] })]
|
|
37
|
+
}) })
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
if (error && !items.length) return /* @__PURE__ */ jsxs(VStack, {
|
|
41
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
42
|
+
children: [header ? header : /* @__PURE__ */ jsxs(VStack, {
|
|
43
|
+
className: "gap-1",
|
|
44
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
45
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
46
|
+
children: title
|
|
47
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
48
|
+
className: "text-muted-foreground text-base",
|
|
49
|
+
children: description
|
|
50
|
+
})]
|
|
51
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: "flex min-h-[400px] items-center justify-center",
|
|
53
|
+
children: /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
54
|
+
className: "flex flex-col items-center gap-4 p-6 text-center",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsx(AlertTriangle, { className: "text-destructive h-12 w-12" }),
|
|
57
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
58
|
+
className: "font-medium",
|
|
59
|
+
children: "Erreur de chargement"
|
|
60
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
61
|
+
className: "text-muted-foreground text-base",
|
|
62
|
+
children: error.message || "Une erreur est survenue"
|
|
63
|
+
})] }),
|
|
64
|
+
onRefresh && /* @__PURE__ */ jsxs(Button, {
|
|
65
|
+
onClick: onRefresh,
|
|
66
|
+
variant: "outline",
|
|
67
|
+
size: "sm",
|
|
68
|
+
children: [/* @__PURE__ */ jsx(RefreshCcw, { className: "mr-2 h-4 w-4" }), "Réessayer"]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
}) })
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
const filterConfigs = filters.map((filter) => ({
|
|
75
|
+
key: filter.key,
|
|
76
|
+
label: filter.label,
|
|
77
|
+
value: filterValues[filter.key] || "",
|
|
78
|
+
options: filter.options,
|
|
79
|
+
onChange: (value) => {
|
|
80
|
+
setFilter(filter.key, value === "all" ? "" : value);
|
|
81
|
+
},
|
|
82
|
+
showCounts: filter.showCounts
|
|
83
|
+
}));
|
|
84
|
+
return /* @__PURE__ */ jsxs(VStack, {
|
|
85
|
+
className: `space-y-4 md:space-y-6 ${className}`,
|
|
86
|
+
children: [
|
|
87
|
+
header ? header : /* @__PURE__ */ jsxs(HStack, {
|
|
88
|
+
className: "items-center justify-between",
|
|
89
|
+
children: [/* @__PURE__ */ jsxs(VStack, {
|
|
90
|
+
className: "gap-1",
|
|
91
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
92
|
+
className: "text-2xl font-bold md:text-3xl",
|
|
93
|
+
children: title
|
|
94
|
+
}), description && /* @__PURE__ */ jsx("p", {
|
|
95
|
+
className: "text-muted-foreground text-base",
|
|
96
|
+
children: description
|
|
97
|
+
})]
|
|
98
|
+
}), /* @__PURE__ */ jsxs(HStack, {
|
|
99
|
+
className: "items-center gap-4",
|
|
100
|
+
children: [
|
|
101
|
+
toolbar,
|
|
102
|
+
(isLoading || isFetching) && /* @__PURE__ */ jsxs("div", {
|
|
103
|
+
className: "text-muted-foreground flex items-center gap-2 text-base",
|
|
104
|
+
children: [/* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }), /* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: "hidden sm:inline",
|
|
106
|
+
children: "Mise à jour..."
|
|
107
|
+
})]
|
|
108
|
+
}),
|
|
109
|
+
onRefresh && /* @__PURE__ */ jsxs(Button, {
|
|
110
|
+
variant: "outline",
|
|
111
|
+
size: "sm",
|
|
112
|
+
onClick: onRefresh,
|
|
113
|
+
disabled: Boolean(isLoading),
|
|
114
|
+
"aria-label": "Rafraîchir",
|
|
115
|
+
children: [/* @__PURE__ */ jsx(RefreshCcw, { className: `mr-2 h-4 w-4 ${isLoading || isFetching ? "animate-spin" : ""}` }), /* @__PURE__ */ jsx("span", {
|
|
116
|
+
className: "hidden sm:inline",
|
|
117
|
+
children: "Rafraîchir"
|
|
118
|
+
})]
|
|
119
|
+
}),
|
|
120
|
+
primaryAction && /* @__PURE__ */ jsx(Fragment, { children: primaryAction.href ? /* @__PURE__ */ jsx(Link, {
|
|
121
|
+
href: primaryAction.href,
|
|
122
|
+
children: /* @__PURE__ */ jsxs(Button, { children: [
|
|
123
|
+
primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
124
|
+
/* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: "hidden sm:inline",
|
|
126
|
+
children: primaryAction.label
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ jsx("span", {
|
|
129
|
+
className: "sm:hidden",
|
|
130
|
+
children: "Nouveau"
|
|
131
|
+
})
|
|
132
|
+
] })
|
|
133
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
134
|
+
onClick: primaryAction.onClick,
|
|
135
|
+
children: [
|
|
136
|
+
primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }),
|
|
137
|
+
/* @__PURE__ */ jsx("span", {
|
|
138
|
+
className: "hidden sm:inline",
|
|
139
|
+
children: primaryAction.label
|
|
140
|
+
}),
|
|
141
|
+
/* @__PURE__ */ jsx("span", {
|
|
142
|
+
className: "sm:hidden",
|
|
143
|
+
children: "Nouveau"
|
|
144
|
+
})
|
|
145
|
+
]
|
|
146
|
+
}) })
|
|
147
|
+
]
|
|
148
|
+
})]
|
|
149
|
+
}),
|
|
150
|
+
renderStats && /* @__PURE__ */ jsxs(Fragment, { children: [renderStats(items), /* @__PURE__ */ jsx(Separator, {})] }),
|
|
151
|
+
/* @__PURE__ */ jsx(SearchAndFilter, {
|
|
152
|
+
searchValue: searchQuery,
|
|
153
|
+
onSearchChange: setSearchQuery,
|
|
154
|
+
searchPlaceholder,
|
|
155
|
+
filters: filterConfigs,
|
|
156
|
+
isLoading
|
|
157
|
+
}),
|
|
158
|
+
items.length === 0 && !isLoading ? renderEmpty ? renderEmpty() : /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs(CardContent, {
|
|
159
|
+
className: "flex flex-col items-center gap-4 p-8 text-center",
|
|
160
|
+
children: [
|
|
161
|
+
/* @__PURE__ */ jsx("div", {
|
|
162
|
+
className: "bg-muted flex h-12 w-12 items-center justify-center rounded-full",
|
|
163
|
+
children: /* @__PURE__ */ jsx("div", { className: "bg-muted-foreground/20 h-6 w-6 rounded-full" })
|
|
164
|
+
}),
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("h3", {
|
|
166
|
+
className: "font-medium",
|
|
167
|
+
children: "Aucun élément trouvé"
|
|
168
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
169
|
+
className: "text-muted-foreground text-base",
|
|
170
|
+
children: searchQuery || Object.values(filterValues).some((v) => v) ? "Essayez de modifier vos critères de recherche" : "Commencez par créer votre premier élément"
|
|
171
|
+
})] }),
|
|
172
|
+
primaryAction && !searchQuery && !Object.values(filterValues).some((v) => v) && /* @__PURE__ */ jsx(Fragment, { children: primaryAction.href ? /* @__PURE__ */ jsx(Link, {
|
|
173
|
+
href: primaryAction.href,
|
|
174
|
+
children: /* @__PURE__ */ jsxs(Button, { children: [primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }), primaryAction.label] })
|
|
175
|
+
}) : /* @__PURE__ */ jsxs(Button, {
|
|
176
|
+
onClick: primaryAction.onClick,
|
|
177
|
+
children: [primaryAction.icon || /* @__PURE__ */ jsx(Plus, { className: "mr-2 h-4 w-4" }), primaryAction.label]
|
|
178
|
+
}) })
|
|
179
|
+
]
|
|
180
|
+
}) }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
181
|
+
className: `space-y-4 ${itemClassName}`,
|
|
182
|
+
children: items.map((item, index) => renderItem(item, index))
|
|
183
|
+
}), totalPages > 1 && /* @__PURE__ */ jsx(Pagination, {
|
|
184
|
+
currentPage,
|
|
185
|
+
totalPages,
|
|
186
|
+
totalItems,
|
|
187
|
+
itemsPerPage,
|
|
188
|
+
onPageChange: setCurrentPage,
|
|
189
|
+
onItemsPerPageChange: setItemsPerPage,
|
|
190
|
+
disabled: isLoading
|
|
191
|
+
})] })
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
//#endregion
|
|
197
|
+
export { ListPage };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
+
import { HStack, VStack } from "./stack.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
|
|
7
|
+
//#region ../ui-kit-web/dist/ui/page-header.js
|
|
8
|
+
init_utils();
|
|
9
|
+
const headerVariants = cva("", {
|
|
10
|
+
variants: { spacing: {
|
|
11
|
+
sm: "gap-1",
|
|
12
|
+
md: "gap-2",
|
|
13
|
+
lg: "gap-3"
|
|
14
|
+
} },
|
|
15
|
+
defaultVariants: { spacing: "md" }
|
|
16
|
+
});
|
|
17
|
+
function PageHeader({ breadcrumb, title, subtitle, actions, spacing, className }) {
|
|
18
|
+
return /* @__PURE__ */ jsxs(VStack, {
|
|
19
|
+
className: cn(headerVariants({ spacing }), className),
|
|
20
|
+
children: [breadcrumb, /* @__PURE__ */ jsxs(HStack, {
|
|
21
|
+
className: "flex-col items-start justify-between md:flex-row",
|
|
22
|
+
children: [/* @__PURE__ */ jsxs(VStack, {
|
|
23
|
+
className: "gap-1",
|
|
24
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
25
|
+
className: "text-2xl font-semibold md:text-3xl",
|
|
26
|
+
children: title
|
|
27
|
+
}), subtitle ? /* @__PURE__ */ jsx("p", {
|
|
28
|
+
className: "text-muted-foreground text-base",
|
|
29
|
+
children: subtitle
|
|
30
|
+
}) : null]
|
|
31
|
+
}), actions ? /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: "flex items-center gap-2",
|
|
33
|
+
children: actions
|
|
34
|
+
}) : null]
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { PageHeader };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
2
|
+
import { buttonVariants } from "./button.js";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react";
|
|
6
|
+
|
|
7
|
+
//#region ../ui-kit-web/dist/ui/pagination.js
|
|
8
|
+
init_utils();
|
|
9
|
+
const Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx("nav", {
|
|
10
|
+
role: "navigation",
|
|
11
|
+
"aria-label": "pagination",
|
|
12
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
Pagination.displayName = "Pagination";
|
|
16
|
+
const PaginationContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("ul", {
|
|
17
|
+
ref,
|
|
18
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
19
|
+
...props
|
|
20
|
+
}));
|
|
21
|
+
PaginationContent.displayName = "PaginationContent";
|
|
22
|
+
const PaginationItem = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", {
|
|
23
|
+
ref,
|
|
24
|
+
className: cn("", className),
|
|
25
|
+
...props
|
|
26
|
+
}));
|
|
27
|
+
PaginationItem.displayName = "PaginationItem";
|
|
28
|
+
const PaginationLink = ({ className, isActive, size = "icon", ...props }) => /* @__PURE__ */ jsx("a", {
|
|
29
|
+
"aria-current": isActive ? "page" : void 0,
|
|
30
|
+
className: cn(buttonVariants({
|
|
31
|
+
variant: isActive ? "outline" : "ghost",
|
|
32
|
+
size
|
|
33
|
+
}), className),
|
|
34
|
+
...props
|
|
35
|
+
});
|
|
36
|
+
PaginationLink.displayName = "PaginationLink";
|
|
37
|
+
const PaginationPrevious = ({ className, ...props }) => /* @__PURE__ */ jsxs(PaginationLink, {
|
|
38
|
+
"aria-label": "Go to previous page",
|
|
39
|
+
size: "default",
|
|
40
|
+
className: cn("gap-1 pl-2.5", className),
|
|
41
|
+
...props,
|
|
42
|
+
children: [/* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", { children: "Previous" })]
|
|
43
|
+
});
|
|
44
|
+
PaginationPrevious.displayName = "PaginationPrevious";
|
|
45
|
+
const PaginationNext = ({ className, ...props }) => /* @__PURE__ */ jsxs(PaginationLink, {
|
|
46
|
+
"aria-label": "Go to next page",
|
|
47
|
+
size: "default",
|
|
48
|
+
className: cn("gap-1 pr-2.5", className),
|
|
49
|
+
...props,
|
|
50
|
+
children: [/* @__PURE__ */ jsx("span", { children: "Next" }), /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })]
|
|
51
|
+
});
|
|
52
|
+
PaginationNext.displayName = "PaginationNext";
|
|
53
|
+
const PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsxs("span", {
|
|
54
|
+
"aria-hidden": true,
|
|
55
|
+
className: cn("flex h-9 w-9 items-center justify-center", className),
|
|
56
|
+
...props,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" }), /* @__PURE__ */ jsx("span", {
|
|
58
|
+
className: "sr-only",
|
|
59
|
+
children: "More pages"
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { CircleIcon } from "lucide-react";
|
|
7
|
+
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
8
|
+
|
|
9
|
+
//#region ../ui-kit-web/dist/ui/radio-group.js
|
|
10
|
+
init_utils();
|
|
11
|
+
function RadioGroup({ className, ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, {
|
|
13
|
+
"data-slot": "radio-group",
|
|
14
|
+
className: cn("grid gap-3", className),
|
|
15
|
+
...props
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function RadioGroupItem({ className, ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, {
|
|
20
|
+
"data-slot": "radio-group-item",
|
|
21
|
+
className: cn("aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-2xs outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
22
|
+
...props,
|
|
23
|
+
children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, {
|
|
24
|
+
"data-slot": "radio-group-indicator",
|
|
25
|
+
className: "relative flex items-center justify-center",
|
|
26
|
+
children: /* @__PURE__ */ jsx(CircleIcon, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
7
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
8
|
+
|
|
9
|
+
//#region ../ui-kit-web/dist/ui/select.js
|
|
10
|
+
init_utils();
|
|
11
|
+
function Select({ ...props }) {
|
|
12
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
13
|
+
"data-slot": "select",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function SelectGroup({ ...props }) {
|
|
18
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
19
|
+
"data-slot": "select-group",
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function SelectValue({ ...props }) {
|
|
24
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
25
|
+
"data-slot": "select-value",
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
31
|
+
"data-slot": "select-trigger",
|
|
32
|
+
"data-size": size,
|
|
33
|
+
className: cn("aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive border-input focus-visible:border-ring focus-visible:ring-ring/50 data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-2xs outline-hidden transition-[color,box-shadow] focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
|
|
34
|
+
...props,
|
|
35
|
+
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
36
|
+
asChild: true,
|
|
37
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function SelectContent({ className, children, position = "popper", ...props }) {
|
|
42
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
43
|
+
"data-slot": "select-content",
|
|
44
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out 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-x-hidden overflow-y-auto rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
|
|
45
|
+
position,
|
|
46
|
+
...props,
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
49
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
50
|
+
className: cn("p-1", position === "popper" && "h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),
|
|
51
|
+
children
|
|
52
|
+
}),
|
|
53
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
54
|
+
]
|
|
55
|
+
}) });
|
|
56
|
+
}
|
|
57
|
+
function SelectItem({ className, children, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
59
|
+
"data-slot": "select-item",
|
|
60
|
+
className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-xs py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
61
|
+
...props,
|
|
62
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
64
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
65
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
function SelectScrollUpButton({ className, ...props }) {
|
|
69
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
70
|
+
"data-slot": "select-scroll-up-button",
|
|
71
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
72
|
+
...props,
|
|
73
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
function SelectScrollDownButton({ className, ...props }) {
|
|
77
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
78
|
+
"data-slot": "select-scroll-down-button",
|
|
79
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
80
|
+
...props,
|
|
81
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { cn, init_utils } from "../ui-kit-core/dist/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
7
|
+
|
|
8
|
+
//#region ../ui-kit-web/dist/ui/separator.js
|
|
9
|
+
init_utils();
|
|
10
|
+
function Separator({ className, orientation = "horizontal", decorative = true, ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(SeparatorPrimitive.Root, {
|
|
12
|
+
"data-slot": "separator",
|
|
13
|
+
decorative,
|
|
14
|
+
orientation,
|
|
15
|
+
className: cn("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", className),
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Separator };
|