@etic-insa/ui 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +438 -37
- package/dist/components/etic/action.d.ts +16 -7
- package/dist/components/etic/action.js +25 -25
- package/dist/components/etic/action.js.map +1 -1
- package/dist/components/etic/app-shell.d.ts +16 -7
- package/dist/components/etic/app-shell.js +92 -85
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/auth-image.d.ts +29 -6
- package/dist/components/etic/auth-image.js +41 -18
- package/dist/components/etic/auth-image.js.map +1 -1
- package/dist/components/etic/button-link.d.ts +19 -0
- package/dist/components/etic/button-link.js +19 -0
- package/dist/components/etic/button-link.js.map +1 -0
- package/dist/components/etic/centered-screen.d.ts +13 -0
- package/dist/components/etic/centered-screen.js +13 -0
- package/dist/components/etic/centered-screen.js.map +1 -0
- package/dist/components/etic/confirm-dialog.d.ts +33 -3
- package/dist/components/etic/confirm-dialog.js +92 -67
- package/dist/components/etic/confirm-dialog.js.map +1 -1
- package/dist/components/etic/copy-button.d.ts +3 -2
- package/dist/components/etic/copy-button.js +3 -3
- package/dist/components/etic/copy-button.js.map +1 -1
- package/dist/components/etic/data-table-bulk-actions.d.ts +28 -4
- package/dist/components/etic/data-table-bulk-actions.js +48 -41
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -1
- package/dist/components/etic/data-table-focus.d.ts +17 -0
- package/dist/components/etic/data-table-focus.js +29 -0
- package/dist/components/etic/data-table-focus.js.map +1 -0
- package/dist/components/etic/data-table-format.d.ts +3 -10
- package/dist/components/etic/data-table-format.js +4 -3
- package/dist/components/etic/data-table-format.js.map +1 -1
- package/dist/components/etic/data-table-pagination.d.ts +20 -6
- package/dist/components/etic/data-table-pagination.js +73 -43
- package/dist/components/etic/data-table-pagination.js.map +1 -1
- package/dist/components/etic/data-table-toolbar.d.ts +34 -13
- package/dist/components/etic/data-table-toolbar.js +66 -62
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table-view-options.d.ts +44 -4
- package/dist/components/etic/data-table-view-options.js +145 -98
- package/dist/components/etic/data-table-view-options.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +173 -15
- package/dist/components/etic/data-table.js +381 -202
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/date-picker.d.ts +5 -1
- package/dist/components/etic/date-picker.js +97 -84
- package/dist/components/etic/date-picker.js.map +1 -1
- package/dist/components/etic/delete-button.d.ts +12 -4
- package/dist/components/etic/delete-button.js +21 -22
- package/dist/components/etic/delete-button.js.map +1 -1
- package/dist/components/etic/detail-list.d.ts +16 -4
- package/dist/components/etic/detail-list.js +30 -20
- package/dist/components/etic/detail-list.js.map +1 -1
- package/dist/components/etic/disclosure.d.ts +52 -0
- package/dist/components/etic/disclosure.js +70 -0
- package/dist/components/etic/disclosure.js.map +1 -0
- package/dist/components/etic/draft-resume-dialog.d.ts +42 -0
- package/dist/components/etic/draft-resume-dialog.js +60 -0
- package/dist/components/etic/draft-resume-dialog.js.map +1 -0
- package/dist/components/etic/error-banner.js +34 -38
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/error-boundary.js +4 -3
- package/dist/components/etic/error-boundary.js.map +1 -1
- package/dist/components/etic/explained-badge.d.ts +26 -0
- package/dist/components/etic/explained-badge.js +17 -0
- package/dist/components/etic/explained-badge.js.map +1 -0
- package/dist/components/etic/file-upload.js +66 -71
- package/dist/components/etic/file-upload.js.map +1 -1
- package/dist/components/etic/form-dialog.d.ts +25 -2
- package/dist/components/etic/form-dialog.js +95 -77
- package/dist/components/etic/form-dialog.js.map +1 -1
- package/dist/components/etic/icon-toggle.d.ts +27 -9
- package/dist/components/etic/icon-toggle.js +31 -19
- package/dist/components/etic/icon-toggle.js.map +1 -1
- package/dist/components/etic/lien.d.ts +34 -0
- package/dist/components/etic/lien.js +17 -0
- package/dist/components/etic/lien.js.map +1 -0
- package/dist/components/etic/loading.d.ts +0 -8
- package/dist/components/etic/loading.js +17 -25
- package/dist/components/etic/loading.js.map +1 -1
- package/dist/components/etic/page-container.d.ts +10 -0
- package/dist/components/etic/page-container.js +9 -5
- package/dist/components/etic/page-container.js.map +1 -1
- package/dist/components/etic/page-header.d.ts +10 -4
- package/dist/components/etic/page-header.js +48 -43
- package/dist/components/etic/page-header.js.map +1 -1
- package/dist/components/etic/phone-input.d.ts +16 -0
- package/dist/components/etic/phone-input.js +71 -65
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/query-boundary.d.ts +25 -2
- package/dist/components/etic/query-boundary.js +24 -12
- package/dist/components/etic/query-boundary.js.map +1 -1
- package/dist/components/etic/removable-badge.d.ts +30 -0
- package/dist/components/etic/removable-badge.js +31 -0
- package/dist/components/etic/removable-badge.js.map +1 -0
- package/dist/components/etic/save-bar.d.ts +31 -0
- package/dist/components/etic/save-bar.js +45 -0
- package/dist/components/etic/save-bar.js.map +1 -0
- package/dist/components/etic/search-select.js +1 -1
- package/dist/components/etic/search-select.js.map +1 -1
- package/dist/components/etic/segmented-control.d.ts +6 -2
- package/dist/components/etic/segmented-control.js +28 -27
- package/dist/components/etic/segmented-control.js.map +1 -1
- package/dist/components/etic/stat-grid.d.ts +15 -0
- package/dist/components/etic/stat-grid.js +17 -0
- package/dist/components/etic/stat-grid.js.map +1 -0
- package/dist/components/etic/stat-tile.d.ts +1 -1
- package/dist/components/etic/stat-tile.js +12 -18
- package/dist/components/etic/stat-tile.js.map +1 -1
- package/dist/components/etic/status-badge.d.ts +2 -4
- package/dist/components/etic/status-badge.js +13 -23
- package/dist/components/etic/status-badge.js.map +1 -1
- package/dist/components/etic/tailles-dialogue.d.ts +8 -0
- package/dist/components/etic/tailles-dialogue.js +10 -0
- package/dist/components/etic/tailles-dialogue.js.map +1 -0
- package/dist/components/etic/theme-menu.d.ts +1 -2
- package/dist/components/etic/theme-menu.js +45 -41
- package/dist/components/etic/theme-menu.js.map +1 -1
- package/dist/components/etic/toggletip.d.ts +36 -0
- package/dist/components/etic/toggletip.js +59 -0
- package/dist/components/etic/toggletip.js.map +1 -0
- package/dist/components/etic/tooltip-button.d.ts +13 -3
- package/dist/components/etic/tooltip-button.js +19 -19
- package/dist/components/etic/tooltip-button.js.map +1 -1
- package/dist/components/etic/unsaved-changes.d.ts +41 -0
- package/dist/components/etic/unsaved-changes.js +17 -0
- package/dist/components/etic/unsaved-changes.js.map +1 -0
- package/dist/components/etic/use-draft-autosave.d.ts +3 -1
- package/dist/components/etic/use-draft-autosave.js +74 -78
- package/dist/components/etic/use-draft-autosave.js.map +1 -1
- package/dist/components/etic/use-unsaved-changes-warning.d.ts +10 -0
- package/dist/components/etic/use-unsaved-changes-warning.js +20 -0
- package/dist/components/etic/use-unsaved-changes-warning.js.map +1 -0
- package/dist/components/ui/alert-dialog.js +2 -2
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/avatar.d.ts +5 -1
- package/dist/components/ui/avatar.js +20 -11
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +3 -2
- package/dist/components/ui/badge.js +27 -14
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +13 -13
- package/dist/components/ui/button.d.ts +15 -2
- package/dist/components/ui/button.js +27 -15
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +2 -2
- package/dist/components/ui/combobox.js +45 -32
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +10 -1
- package/dist/components/ui/dialog.js +12 -5
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +3 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +16 -2
- package/dist/components/ui/progress.js +34 -26
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -2
- package/dist/components/ui/select.js +70 -50
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/sidebar.d.ts +6 -1
- package/dist/components/ui/sidebar.js +92 -92
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/spinner.d.ts +7 -1
- package/dist/components/ui/spinner.js +9 -1
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +7 -2
- package/dist/components/ui/tooltip.js +27 -19
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-column-prefs.d.ts +84 -0
- package/dist/hooks/use-column-prefs.js +71 -0
- package/dist/hooks/use-column-prefs.js.map +1 -0
- package/dist/hooks/use-debounced-value.d.ts +13 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-debounced-value.js.map +1 -0
- package/dist/hooks/use-document-title.d.ts +5 -0
- package/dist/hooks/use-document-title.js +13 -0
- package/dist/hooks/use-document-title.js.map +1 -0
- package/dist/hooks/use-persisted-state.d.ts +43 -0
- package/dist/hooks/use-persisted-state.js +40 -0
- package/dist/hooks/use-persisted-state.js.map +1 -0
- package/dist/index.d.ts +40 -16
- package/dist/index.js +99 -76
- package/dist/lib/autofill.d.ts +18 -0
- package/dist/lib/autofill.js +10 -0
- package/dist/lib/autofill.js.map +1 -0
- package/dist/lib/dates.d.ts +20 -0
- package/dist/lib/dates.js +16 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/focus-rendu.d.ts +24 -0
- package/dist/lib/focus-rendu.js +14 -0
- package/dist/lib/focus-rendu.js.map +1 -0
- package/dist/lib/format.d.ts +54 -0
- package/dist/lib/format.js +80 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/normalize.d.ts +28 -0
- package/dist/lib/normalize.js +21 -0
- package/dist/lib/normalize.js.map +1 -0
- package/dist/lib/ordre-colonnes.d.ts +15 -0
- package/dist/lib/ordre-colonnes.js +14 -0
- package/dist/lib/ordre-colonnes.js.map +1 -0
- package/dist/lib/ton.d.ts +23 -0
- package/dist/lib/ton.js +51 -0
- package/dist/lib/ton.js.map +1 -0
- package/dist/styles.css +110 -63
- package/dist/theme.d.ts +34 -0
- package/dist/theme.js +45 -0
- package/dist/theme.js.map +1 -0
- package/package.json +4 -2
- package/src/theme-boot.js +22 -0
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
import { Button as ButtonPrimitive } from '@base-ui/react/button';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from "react";
|
|
3
4
|
declare const buttonVariants: (props?: ({
|
|
4
5
|
variant?: "default" | "destructive" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
-
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
size?: "default" | "inline" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
+
type ButtonProps = ButtonPrimitive.Props & VariantProps<typeof buttonVariants> & {
|
|
9
|
+
/**
|
|
10
|
+
* Action en cours (ajout ETIC) : roue muette à la place des icônes,
|
|
11
|
+
* `aria-busy`, clics ignorés. Le bouton reste focalisable
|
|
12
|
+
* (`focusableWhenDisabled`) : désactivé nativement, il rendrait le focus
|
|
13
|
+
* à la page.
|
|
14
|
+
*/
|
|
15
|
+
enCours?: boolean;
|
|
16
|
+
/** Libellé pendant l'action (« Suppression… ») ; sans lui, le contenu
|
|
17
|
+
* reste. */
|
|
18
|
+
libelleEnCours?: React.ReactNode;
|
|
19
|
+
};
|
|
20
|
+
declare function Button({ className, variant, size, enCours, libelleEnCours, disabled, focusableWhenDisabled, children, ...props }: ButtonProps): React.JSX.Element;
|
|
8
21
|
export { Button, buttonVariants };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { SpinnerDecoratif as e } from "./spinner.js";
|
|
2
|
+
import { cn as t } from "cn";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { Button as s } from "@base-ui/react/button";
|
|
5
7
|
// src/components/ui/button.tsx
|
|
6
|
-
var
|
|
8
|
+
var c = r("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 aria-disabled:not-data-en-cours:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-en-cours:cursor-progress dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
9
|
variants: {
|
|
8
10
|
variant: {
|
|
9
11
|
default: "bg-primary text-primary-foreground hover:bg-primary/80",
|
|
@@ -21,7 +23,8 @@ var i = t("group/button inline-flex shrink-0 items-center justify-center rounded
|
|
|
21
23
|
icon: "size-8",
|
|
22
24
|
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
23
25
|
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
24
|
-
"icon-lg": "size-9"
|
|
26
|
+
"icon-lg": "size-9",
|
|
27
|
+
inline: "h-auto min-h-6 gap-1 px-0"
|
|
25
28
|
}
|
|
26
29
|
},
|
|
27
30
|
defaultVariants: {
|
|
@@ -29,17 +32,26 @@ var i = t("group/button inline-flex shrink-0 items-center justify-center rounded
|
|
|
29
32
|
size: "default"
|
|
30
33
|
}
|
|
31
34
|
});
|
|
32
|
-
function
|
|
33
|
-
return
|
|
35
|
+
function l(e, t) {
|
|
36
|
+
return t ? null : n.Children.toArray(e).filter((e) => !(n.isValidElement(e) && e.props["data-icon"] !== void 0));
|
|
37
|
+
}
|
|
38
|
+
var u = /(^|:)hover:/;
|
|
39
|
+
function d({ className: n, variant: r = "default", size: d = "default", enCours: f = !1, libelleEnCours: p, disabled: m, focusableWhenDisabled: h, children: g, ..._ }) {
|
|
40
|
+
let v = t(c({
|
|
41
|
+
variant: r,
|
|
42
|
+
size: d
|
|
43
|
+
}), n), y = f ? /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a(e, { "data-icon": "inline-start" }), p ?? l(g, String(d).startsWith("icon"))] }) : g;
|
|
44
|
+
return /* @__PURE__ */ a(s, {
|
|
34
45
|
"data-slot": "button",
|
|
35
|
-
className: e(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...
|
|
46
|
+
className: f ? v.split(" ").filter((e) => !u.test(e)).join(" ") : v,
|
|
47
|
+
"data-en-cours": f || void 0,
|
|
48
|
+
disabled: m || f,
|
|
49
|
+
focusableWhenDisabled: h || f,
|
|
50
|
+
"aria-busy": f || void 0,
|
|
51
|
+
..._,
|
|
52
|
+
...y === void 0 ? {} : { children: y }
|
|
41
53
|
});
|
|
42
54
|
}
|
|
43
|
-
export {
|
|
55
|
+
export { d as Button, c as buttonVariants };
|
|
44
56
|
|
|
45
57
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":["Button","ButtonPrimitive","buttonVariants","cva","Button$1","props","
|
|
1
|
+
{"version":3,"file":"button.js","names":["Button","_Fragment","ButtonPrimitive","React","Fragment$1","buttonVariants","cva","sansIcones","iconeSeule","children","enfant","SURVOL","Button$1","props","classes","cn","className","contenu","enCours","SpinnerDecoratif","libelleEnCours","size","Button","classe","disabled","focusableWhenDisabled"],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Button as ButtonPrimitive } from \"@base-ui/react/button\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"cn\"\n\nimport { SpinnerDecoratif } from \"@etic-ui/components/ui/spinner\"\n\nconst buttonVariants = cva(\n \"group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:not-aria-disabled:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-disabled:opacity-50 aria-disabled:not-data-en-cours:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-en-cours:cursor-progress dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/80\",\n outline:\n \"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n ghost:\n \"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50\",\n destructive:\n \"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40\",\n link: \"text-primary-text underline-offset-4 hover:underline\",\n },\n size: {\n default:\n \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n xs: \"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n lg: \"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n icon: \"size-8\",\n \"icon-xs\":\n \"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\":\n \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg\",\n \"icon-lg\": \"size-9\",\n // Ajout ETIC : lien dans une phrase ou une cellule (avec\n // `variant=\"link\"`), sans hauteur ni marge de bouton ; `min-h-6`\n // garde une cible tactile de 24 px (WCAG 2.5.8).\n inline: \"h-auto min-h-6 gap-1 px-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n }\n)\n\ntype ButtonProps = ButtonPrimitive.Props &\n VariantProps<typeof buttonVariants> & {\n /**\n * Action en cours (ajout ETIC) : roue muette à la place des icônes,\n * `aria-busy`, clics ignorés. Le bouton reste focalisable\n * (`focusableWhenDisabled`) : désactivé nativement, il rendrait le focus\n * à la page.\n */\n enCours?: boolean\n /** Libellé pendant l'action (« Suppression… ») ; sans lui, le contenu\n * reste. */\n libelleEnCours?: React.ReactNode\n }\n\n/** Contenu d'un bouton en cours : ses icônes retirées (la roue prend leur\n * place, et les marges `has-data-[icon=…]` suivent), tout son contenu\n * pour un bouton à icône seule. */\nfunction sansIcones(children: React.ReactNode, iconeSeule: boolean) {\n if (iconeSeule) return null\n return React.Children.toArray(children).filter(\n (enfant) =>\n !(\n React.isValidElement<{ \"data-icon\"?: unknown }>(enfant) &&\n enfant.props[\"data-icon\"] !== undefined\n )\n )\n}\n\n/** Variante de survol (`hover:`, `dark:hover:`…) d'une classe. */\nconst SURVOL = /(^|:)hover:/\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n enCours = false,\n libelleEnCours,\n disabled,\n focusableWhenDisabled,\n children,\n ...props\n}: ButtonProps) {\n const classes = cn(buttonVariants({ variant, size }), className)\n // Sans contenu donné, rien n'est passé : les enfants d'un élément `render`\n // restent. En cours, la roue remplace l'icône de tête (ou l'icône seule) ;\n // un bouton à texte sans icône s'élargit de la roue, comme le libellé\n // d'attente le change déjà, plutôt que de cacher son texte.\n const contenu = enCours ? (\n <>\n <SpinnerDecoratif data-icon=\"inline-start\" />\n {libelleEnCours ?? sansIcones(children, String(size).startsWith(\"icon\"))}\n </>\n ) : (\n children\n )\n return (\n <ButtonPrimitive\n data-slot=\"button\"\n // En cours : curseur d'attente et pas de survol (le clic est ignoré).\n className={\n enCours\n ? classes\n .split(\" \")\n .filter((classe) => !SURVOL.test(classe))\n .join(\" \")\n : classes\n }\n data-en-cours={enCours || undefined}\n disabled={disabled || enCours}\n focusableWhenDisabled={focusableWhenDisabled || enCours}\n aria-busy={enCours || undefined}\n {...props}\n {...(contenu === undefined ? {} : { children: contenu })}\n />\n )\n}\n\nexport { Button, buttonVariants }\n"],"mappings":";;;;;;;AAOA,IAAMK,IAAiBC,EACrB,0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} from "react/jsx-runtime";
|
|
6
6
|
import { ChevronDownIcon as a, ChevronLeftIcon as o, ChevronRightIcon as s } from "lucide-react";
|
|
7
7
|
import { DayPicker as c, getDefaultClassNames as l } from "react-day-picker";
|
|
8
|
-
import { fr as u } from "react-day-picker/locale";
|
|
8
|
+
import { fr as u } from "react-day-picker/locale/fr";
|
|
9
9
|
// src/components/ui/calendar.tsx
|
|
10
10
|
function d({ className: e, classNames: r, showOutsideDays: d = !0, captionLayout: p = "label", buttonVariant: m = "ghost", locale: h = u, weekStartsOn: g = 1, formatters: _, components: v, ...y }) {
|
|
11
11
|
let b = l();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","names":["React","Calendar","fr","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","className","date","locale","formatters","buttonVariants","buttonVariant","captionLayout","classNames","rootRef","jsx","orientation","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","components","ref","modifiers","Button","day"],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"cn\"\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n type Locale,\n} from \"react-day-picker\"\nimport { fr } from \"react-day-picker/locale\"\n\nimport { Button, buttonVariants } from \"@etic-ui/components/ui/button\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronDownIcon,\n} from \"lucide-react\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n locale = fr,\n weekStartsOn = 1,\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(9)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent min-[1025px]:[--cell-size:--spacing(7)]\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n weekStartsOn={weekStartsOn}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(locale?.code, { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"relative flex flex-col gap-4 md:flex-row\",\n defaultClassNames.months\n ),\n month: cn(\"flex w-full flex-col gap-4\", defaultClassNames.month),\n nav: cn(\n \"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative rounded-(--cell-radius)\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute inset-0 bg-popover opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"font-medium select-none\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground\",\n defaultClassNames.caption_label\n ),\n month_grid: cn(\"w-full border-collapse\", defaultClassNames.month_grid),\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"mt-2 flex w-full\", defaultClassNames.week),\n week_number_header: cn(\n \"w-(--cell-size) select-none\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] text-muted-foreground select-none\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\n \"relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted\",\n defaultClassNames.range_end\n ),\n today: cn(\n \"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: ({ ...props }) => (\n <CalendarDayButton locale={locale} {...props} />\n ),\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n locale,\n ...props\n}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal 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 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],"mappings":";;;;;;;;;AAmBA,SAASC,EAAS,EAChB,cACA,eACA,qBAAkB,IAClB,mBAAgB,SAChB,mBAAgB,SAChB,YAASC,GACT,kBAAe,GACf,eACA,eACA,GAAGC,KAGF;CACD,IAAMC,IAAoBC,EAAqB;CAE/C,OACE,kBAACC,GAAD;EACmB;EACjB,WAAWC,EACT,iOACA,OAAO,GAAG,6CACV,OAAO,GAAG,iDACVC,CACF;EACe;EACP;EACM;EACd,YAAY;GACV,sBAAsB,MACpBC,EAAK,eAAeC,GAAQ,MAAM,EAAE,OAAO,QAAQ,CAAC;GACtD,GAAGC;EACL;EACA,YAAY;GACV,MAAMJ,EAAG,SAASH,EAAkB,IAAI;GACxC,QAAQG,EACN,4CACAH,EAAkB,MACpB;GACA,OAAOG,EAAG,8BAA8BH,EAAkB,KAAK;GAC/D,KAAKG,EACH,2EACAH,EAAkB,GACpB;GACA,iBAAiBG,EACfK,EAAe,EAAE,SAASC,EAAc,CAAC,GACzC,+DACAT,EAAkB,eACpB;GACA,aAAaG,EACXK,EAAe,EAAE,SAASC,EAAc,CAAC,GACzC,+DACAT,EAAkB,WACpB;GACA,eAAeG,EACb,4EACAH,EAAkB,aACpB;GACA,WAAWG,EACT,uFACAH,EAAkB,SACpB;GACA,eAAeG,EACb,oCACAH,EAAkB,aACpB;GACA,UAAUG,EACR,yCACAH,EAAkB,QACpB;GACA,eAAeG,EACb,2BACAO,MAAkB,UACd,YACA,0GACJV,EAAkB,aACpB;GACA,YAAYG,EAAG,0BAA0BH,EAAkB,UAAU;GACrE,UAAUG,EAAG,QAAQH,EAAkB,QAAQ;GAC/C,SAASG,EACP,8FACAH,EAAkB,OACpB;GACA,MAAMG,EAAG,oBAAoBH,EAAkB,IAAI;GACnD,oBAAoBG,EAClB,+BACAH,EAAkB,kBACpB;GACA,aAAaG,EACX,mDACAH,EAAkB,WACpB;GACA,KAAKG,EACH,0KACAJ,EAAM,iBACF,0EACA,wEACJC,EAAkB,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ACA,EAAU,aACX,CAACA,EAAU;EAEb,oBAAkBA,EAAU;EAC5B,kBAAgBA,EAAU;EAC1B,qBAAmBA,EAAU;EAC7B,WAAWlB,EACT,w7BACAH,EAAkB,KAClBI,CACF;EACA,GAAIL;CACL,CAAA;AAEL"}
|
|
1
|
+
{"version":3,"file":"calendar.js","names":["React","Calendar","fr","props","defaultClassNames","getDefaultClassNames","DayPicker","cn","className","date","locale","formatters","buttonVariants","buttonVariant","captionLayout","classNames","rootRef","jsx","orientation","ChevronLeftIcon","ChevronRightIcon","ChevronDownIcon","CalendarDayButton","components","ref","modifiers","Button","day"],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"cn\"\nimport {\n DayPicker,\n getDefaultClassNames,\n type DayButton,\n type Locale,\n} from \"react-day-picker\"\n// La seule locale française : `react-day-picker/locale` les charge toutes.\nimport { fr } from \"react-day-picker/locale/fr\"\n\nimport { Button, buttonVariants } from \"@etic-ui/components/ui/button\"\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n ChevronDownIcon,\n} from \"lucide-react\"\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"label\",\n buttonVariant = \"ghost\",\n locale = fr,\n weekStartsOn = 1,\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>[\"variant\"]\n}) {\n const defaultClassNames = getDefaultClassNames()\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n \"group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(9)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent min-[1025px]:[--cell-size:--spacing(7)]\",\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className\n )}\n captionLayout={captionLayout}\n locale={locale}\n weekStartsOn={weekStartsOn}\n formatters={{\n formatMonthDropdown: (date) =>\n date.toLocaleString(locale?.code, { month: \"short\" }),\n ...formatters,\n }}\n classNames={{\n root: cn(\"w-fit\", defaultClassNames.root),\n months: cn(\n \"relative flex flex-col gap-4 md:flex-row\",\n defaultClassNames.months\n ),\n month: cn(\"flex w-full flex-col gap-4\", defaultClassNames.month),\n nav: cn(\n \"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1\",\n defaultClassNames.nav\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_previous\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n \"size-(--cell-size) p-0 select-none aria-disabled:opacity-50\",\n defaultClassNames.button_next\n ),\n month_caption: cn(\n \"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)\",\n defaultClassNames.month_caption\n ),\n dropdowns: cn(\n \"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium\",\n defaultClassNames.dropdowns\n ),\n dropdown_root: cn(\n \"relative rounded-(--cell-radius)\",\n defaultClassNames.dropdown_root\n ),\n dropdown: cn(\n \"absolute inset-0 bg-popover opacity-0\",\n defaultClassNames.dropdown\n ),\n caption_label: cn(\n \"font-medium select-none\",\n captionLayout === \"label\"\n ? \"text-sm\"\n : \"flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground\",\n defaultClassNames.caption_label\n ),\n month_grid: cn(\"w-full border-collapse\", defaultClassNames.month_grid),\n weekdays: cn(\"flex\", defaultClassNames.weekdays),\n weekday: cn(\n \"flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none\",\n defaultClassNames.weekday\n ),\n week: cn(\"mt-2 flex w-full\", defaultClassNames.week),\n week_number_header: cn(\n \"w-(--cell-size) select-none\",\n defaultClassNames.week_number_header\n ),\n week_number: cn(\n \"text-[0.8rem] text-muted-foreground select-none\",\n defaultClassNames.week_number\n ),\n day: cn(\n \"group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)\",\n props.showWeekNumber\n ? \"[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)\"\n : \"[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)\",\n defaultClassNames.day\n ),\n range_start: cn(\n \"relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted\",\n defaultClassNames.range_start\n ),\n range_middle: cn(\"rounded-none\", defaultClassNames.range_middle),\n range_end: cn(\n \"relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted\",\n defaultClassNames.range_end\n ),\n today: cn(\n \"rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none\",\n defaultClassNames.today\n ),\n outside: cn(\n \"text-muted-foreground aria-selected:text-muted-foreground\",\n defaultClassNames.outside\n ),\n disabled: cn(\n \"text-muted-foreground opacity-50\",\n defaultClassNames.disabled\n ),\n hidden: cn(\"invisible\", defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return (\n <div\n data-slot=\"calendar\"\n ref={rootRef}\n className={cn(className)}\n {...props}\n />\n )\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === \"left\") {\n return (\n <ChevronLeftIcon className={cn(\"size-4\", className)} {...props} />\n )\n }\n\n if (orientation === \"right\") {\n return (\n <ChevronRightIcon\n className={cn(\"size-4\", className)}\n {...props}\n />\n )\n }\n\n return (\n <ChevronDownIcon className={cn(\"size-4\", className)} {...props} />\n )\n },\n DayButton: ({ ...props }) => (\n <CalendarDayButton locale={locale} {...props} />\n ),\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n )\n },\n ...components,\n }}\n {...props}\n />\n )\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n locale,\n ...props\n}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {\n const defaultClassNames = getDefaultClassNames()\n\n const ref = React.useRef<HTMLButtonElement>(null)\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus()\n }, [modifiers.focused])\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n \"relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal 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 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70\",\n defaultClassNames.day,\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Calendar, CalendarDayButton }\n"],"mappings":";;;;;;;;;AAoBA,SAASC,EAAS,EAChB,cACA,eACA,qBAAkB,IAClB,mBAAgB,SAChB,mBAAgB,SAChB,YAASC,GACT,kBAAe,GACf,eACA,eACA,GAAGC,KAGF;CACD,IAAMC,IAAoBC,EAAqB;CAE/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@@ import { Checkbox as a } from "@base-ui/react/checkbox";
|
|
|
6
6
|
function o({ className: o, ...s }) {
|
|
7
7
|
return /* @__PURE__ */ t(a.Root, {
|
|
8
8
|
"data-slot": "checkbox",
|
|
9
|
-
className: e("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-
|
|
9
|
+
className: e("peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-(--control-border) transition-colors outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-(--control-border) after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 in-[fieldset:disabled]:cursor-not-allowed in-[fieldset:disabled]:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-indeterminate:bg-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50", o),
|
|
10
10
|
...s,
|
|
11
11
|
children: /* @__PURE__ */ n(a.Indicator, {
|
|
12
12
|
"data-slot": "checkbox-indicator",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","names":["Checkbox","CheckboxPrimitive","Checkbox$1","props","Checkbox","cn","className","CheckIcon","MinusIcon"],"sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { cn } from \"cn\"\nimport { CheckIcon, MinusIcon } from \"lucide-react\"\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-
|
|
1
|
+
{"version":3,"file":"checkbox.js","names":["Checkbox","CheckboxPrimitive","Checkbox$1","props","Checkbox","cn","className","CheckIcon","MinusIcon"],"sources":["../../../src/components/ui/checkbox.tsx"],"sourcesContent":["import { Checkbox as CheckboxPrimitive } from \"@base-ui/react/checkbox\"\nimport { cn } from \"cn\"\nimport { CheckIcon, MinusIcon } from \"lucide-react\"\n\n// Écart avec shadcn : la case s'estompe d'après son propre état\n// (`data-disabled`, `aria-disabled`, `fieldset` désactivé) et non par\n// `group-has-disabled/field`, qui estompait toutes les cases d'un champ dès\n// qu'une seule y était figée (une `CheckboxList` dans un `FormField`). Les\n// variantes `disabled:` de shadcn sont retirées : la racine est un `<span>`,\n// qui n'est jamais `:disabled`. Dans un `<fieldset disabled>`, la case est\n// réellement inactive (Base UI la coche par son entrée cachée, que le\n// fieldset désactive : ni clic ni Espace n'y font rien) : elle en a l'air.\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-(--control-border) transition-colors outline-none group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-(--control-border) after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 in-[fieldset:disabled]:cursor-not-allowed in-[fieldset:disabled]:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary data-indeterminate:border-primary data-indeterminate:bg-primary data-indeterminate:text-primary-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:data-indeterminate:bg-primary data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"grid place-content-center text-current transition-none [&>svg]:size-3.5\"\n >\n <CheckIcon className=\"[[data-indeterminate]_&]:hidden\" />\n <MinusIcon className=\"hidden [[data-indeterminate]_&]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n}\n\nexport { Checkbox }\n"],"mappings":";;;;;AAYA,SAASA,EAAS,EAAE,cAAW,GAAGG,KAAuC;CACvE,OACE,kBAACF,EAAkB,MAAnB;EACE,aAAU;EACV,WAAWI,EACT,+mCACAC,CACF;EACA,GAAIH;EAEJ,UAAA,kBAACF,EAAkB,WAAnB;GACE,aAAU;GACV,WAAU;GAFZ,UAAA,CAIE,kBAACM,GAAD,EAAW,WAAU,kCAAmC,CAAA,GACxD,kBAACC,GAAD,EAAW,WAAU,wCAAyC,CAAA,CACnC;;CACP,CAAA;AAE5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Combobox as ComboboxPrimitive } from '@base-ui/react';
|
|
1
|
+
import { Combobox as ComboboxPrimitive } from '@base-ui/react/combobox';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
declare
|
|
3
|
+
declare function Combobox<Value, Multiple extends boolean | undefined = false, Item = Value>(props: ComboboxPrimitive.Root.Props<Value, Multiple, Item>): React.JSX.Element;
|
|
4
4
|
declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): React.JSX.Element;
|
|
5
5
|
declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): React.JSX.Element;
|
|
6
6
|
declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
|
|
@@ -4,16 +4,23 @@ import { cn as a } from "cn";
|
|
|
4
4
|
import * as o from "react";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
import { CheckIcon as l, ChevronDownIcon as u, XIcon as d } from "lucide-react";
|
|
7
|
-
import { Combobox as f } from "@base-ui/react";
|
|
7
|
+
import { Combobox as f } from "@base-ui/react/combobox";
|
|
8
8
|
// src/components/ui/combobox.tsx
|
|
9
|
-
var p =
|
|
10
|
-
function
|
|
9
|
+
var p = o.createContext(null), m = o.createContext(!1);
|
|
10
|
+
function h(e) {
|
|
11
|
+
let t = o.useRef(null);
|
|
12
|
+
return /* @__PURE__ */ s(p.Provider, {
|
|
13
|
+
value: t,
|
|
14
|
+
children: /* @__PURE__ */ s(f.Root, { ...e })
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function g({ ...e }) {
|
|
11
18
|
return /* @__PURE__ */ s(f.Value, {
|
|
12
19
|
"data-slot": "combobox-value",
|
|
13
20
|
...e
|
|
14
21
|
});
|
|
15
22
|
}
|
|
16
|
-
function
|
|
23
|
+
function _({ className: e, children: t, ...n }) {
|
|
17
24
|
return /* @__PURE__ */ c(f.Trigger, {
|
|
18
25
|
"data-slot": "combobox-trigger",
|
|
19
26
|
"aria-label": "Afficher les options",
|
|
@@ -22,7 +29,7 @@ function h({ className: e, children: t, ...n }) {
|
|
|
22
29
|
children: [t, /* @__PURE__ */ s(u, { className: "pointer-events-none size-4 text-muted-foreground" })]
|
|
23
30
|
});
|
|
24
31
|
}
|
|
25
|
-
function
|
|
32
|
+
function v({ className: e, ...t }) {
|
|
26
33
|
return /* @__PURE__ */ s(f.Clear, {
|
|
27
34
|
"data-slot": "combobox-clear",
|
|
28
35
|
"aria-label": "Effacer",
|
|
@@ -35,53 +42,59 @@ function g({ className: e, ...t }) {
|
|
|
35
42
|
children: /* @__PURE__ */ s(d, { className: "pointer-events-none" })
|
|
36
43
|
});
|
|
37
44
|
}
|
|
38
|
-
function
|
|
45
|
+
function y({ className: e, children: l, disabled: u = !1, showTrigger: d = !0, showClear: h = !1, ...g }) {
|
|
46
|
+
let y = o.useContext(m), b = o.useContext(p);
|
|
39
47
|
return /* @__PURE__ */ c(t, {
|
|
48
|
+
ref: y ? void 0 : b ?? void 0,
|
|
40
49
|
className: a("w-auto", e),
|
|
41
50
|
children: [
|
|
42
51
|
/* @__PURE__ */ s(f.Input, {
|
|
43
|
-
render: /* @__PURE__ */ s(i, { disabled:
|
|
44
|
-
...
|
|
52
|
+
render: /* @__PURE__ */ s(i, { disabled: u }),
|
|
53
|
+
...g
|
|
45
54
|
}),
|
|
46
55
|
/* @__PURE__ */ c(n, {
|
|
47
56
|
align: "inline-end",
|
|
48
|
-
children: [
|
|
57
|
+
children: [d && /* @__PURE__ */ s(r, {
|
|
49
58
|
size: "icon-xs",
|
|
50
59
|
variant: "ghost",
|
|
51
|
-
render: /* @__PURE__ */ s(
|
|
60
|
+
render: /* @__PURE__ */ s(_, {}),
|
|
52
61
|
"data-slot": "input-group-button",
|
|
53
62
|
className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",
|
|
54
|
-
disabled:
|
|
55
|
-
}),
|
|
63
|
+
disabled: u
|
|
64
|
+
}), h && /* @__PURE__ */ s(v, { disabled: u })]
|
|
56
65
|
}),
|
|
57
|
-
|
|
66
|
+
l
|
|
58
67
|
]
|
|
59
68
|
});
|
|
60
69
|
}
|
|
61
|
-
function
|
|
70
|
+
function b({ className: e, side: t = "bottom", sideOffset: n = 6, align: r = "start", alignOffset: i = 0, anchor: c, ...l }) {
|
|
71
|
+
let u = o.useContext(p);
|
|
62
72
|
return /* @__PURE__ */ s(f.Portal, { children: /* @__PURE__ */ s(f.Positioner, {
|
|
63
73
|
side: t,
|
|
64
74
|
sideOffset: n,
|
|
65
75
|
align: r,
|
|
66
76
|
alignOffset: i,
|
|
67
|
-
anchor:
|
|
77
|
+
anchor: c ?? u,
|
|
68
78
|
className: "isolate z-50",
|
|
69
|
-
children: /* @__PURE__ */ s(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
children: /* @__PURE__ */ s(m.Provider, {
|
|
80
|
+
value: !0,
|
|
81
|
+
children: /* @__PURE__ */ s(f.Popup, {
|
|
82
|
+
"data-slot": "combobox-content",
|
|
83
|
+
"data-chips": !!c,
|
|
84
|
+
className: a("group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-(--anchor-width) origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", e),
|
|
85
|
+
...l
|
|
86
|
+
})
|
|
74
87
|
})
|
|
75
88
|
}) });
|
|
76
89
|
}
|
|
77
|
-
function
|
|
90
|
+
function x({ className: e, ...t }) {
|
|
78
91
|
return /* @__PURE__ */ s(f.List, {
|
|
79
92
|
"data-slot": "combobox-list",
|
|
80
93
|
className: a("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0", e),
|
|
81
94
|
...t
|
|
82
95
|
});
|
|
83
96
|
}
|
|
84
|
-
function
|
|
97
|
+
function S({ className: e, children: t, ...n }) {
|
|
85
98
|
return /* @__PURE__ */ c(f.Item, {
|
|
86
99
|
"data-slot": "combobox-item",
|
|
87
100
|
className: a("relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", e),
|
|
@@ -92,48 +105,48 @@ function b({ className: e, children: t, ...n }) {
|
|
|
92
105
|
})]
|
|
93
106
|
});
|
|
94
107
|
}
|
|
95
|
-
function
|
|
108
|
+
function C({ className: e, ...t }) {
|
|
96
109
|
return /* @__PURE__ */ s(f.Group, {
|
|
97
110
|
"data-slot": "combobox-group",
|
|
98
111
|
className: a(e),
|
|
99
112
|
...t
|
|
100
113
|
});
|
|
101
114
|
}
|
|
102
|
-
function
|
|
115
|
+
function w({ className: e, ...t }) {
|
|
103
116
|
return /* @__PURE__ */ s(f.GroupLabel, {
|
|
104
117
|
"data-slot": "combobox-label",
|
|
105
118
|
className: a("px-2 py-1.5 text-xs text-muted-foreground", e),
|
|
106
119
|
...t
|
|
107
120
|
});
|
|
108
121
|
}
|
|
109
|
-
function
|
|
122
|
+
function T({ ...e }) {
|
|
110
123
|
return /* @__PURE__ */ s(f.Collection, {
|
|
111
124
|
"data-slot": "combobox-collection",
|
|
112
125
|
...e
|
|
113
126
|
});
|
|
114
127
|
}
|
|
115
|
-
function
|
|
128
|
+
function E({ className: e, ...t }) {
|
|
116
129
|
return /* @__PURE__ */ s(f.Empty, {
|
|
117
130
|
"data-slot": "combobox-empty",
|
|
118
131
|
className: a("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", e),
|
|
119
132
|
...t
|
|
120
133
|
});
|
|
121
134
|
}
|
|
122
|
-
function
|
|
135
|
+
function D({ className: e, ...t }) {
|
|
123
136
|
return /* @__PURE__ */ s(f.Separator, {
|
|
124
137
|
"data-slot": "combobox-separator",
|
|
125
138
|
className: a("-mx-1 my-1 h-px bg-border", e),
|
|
126
139
|
...t
|
|
127
140
|
});
|
|
128
141
|
}
|
|
129
|
-
function
|
|
142
|
+
function O({ className: e, ...t }) {
|
|
130
143
|
return /* @__PURE__ */ s(f.Chips, {
|
|
131
144
|
"data-slot": "combobox-chips",
|
|
132
145
|
className: a("flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40", e),
|
|
133
146
|
...t
|
|
134
147
|
});
|
|
135
148
|
}
|
|
136
|
-
function
|
|
149
|
+
function k({ className: t, children: n, showRemove: r = !0, ...i }) {
|
|
137
150
|
return /* @__PURE__ */ c(f.Chip, {
|
|
138
151
|
"data-slot": "combobox-chip",
|
|
139
152
|
className: a("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", t),
|
|
@@ -150,16 +163,16 @@ function D({ className: t, children: n, showRemove: r = !0, ...i }) {
|
|
|
150
163
|
})]
|
|
151
164
|
});
|
|
152
165
|
}
|
|
153
|
-
function
|
|
166
|
+
function A({ className: e, ...t }) {
|
|
154
167
|
return /* @__PURE__ */ s(f.Input, {
|
|
155
168
|
"data-slot": "combobox-chip-input",
|
|
156
169
|
className: a("min-w-16 flex-1 outline-none", e),
|
|
157
170
|
...t
|
|
158
171
|
});
|
|
159
172
|
}
|
|
160
|
-
function
|
|
173
|
+
function j() {
|
|
161
174
|
return o.useRef(null);
|
|
162
175
|
}
|
|
163
|
-
export {
|
|
176
|
+
export { h as Combobox, k as ComboboxChip, O as ComboboxChips, A as ComboboxChipsInput, T as ComboboxCollection, b as ComboboxContent, E as ComboboxEmpty, C as ComboboxGroup, y as ComboboxInput, S as ComboboxItem, w as ComboboxLabel, x as ComboboxList, D as ComboboxSeparator, _ as ComboboxTrigger, g as ComboboxValue, j as useComboboxAnchor };
|
|
164
177
|
|
|
165
178
|
//# sourceMappingURL=combobox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.js","names":["Combobox","ComboboxPrimitive","React","Combobox$1","Combobox","ComboboxValue","props","ComboboxTrigger","cn","className","children","ChevronDownIcon","ComboboxClear","InputGroupButton","XIcon","ComboboxInput","InputGroup","InputGroupInput","InputGroupAddon","showTrigger","showClear","ComboboxContent","anchor","ComboboxList","ComboboxItem","CheckIcon","ComboboxGroup","ComboboxLabel","ComboboxCollection","ComboboxEmpty","ComboboxSeparator","ComboboxChips","ComboboxChip","showRemove","Button","ComboboxChipsInput","useComboboxAnchor"],"sources":["../../../src/components/ui/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react\"\nimport { cn } from \"cn\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@etic-ui/components/ui/input-group\"\nimport { ChevronDownIcon, XIcon, CheckIcon } from \"lucide-react\"\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n aria-label=\"Afficher les options\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n aria-label=\"Effacer\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn(\"w-auto\", className)}>\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...props}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className=\"isolate z-50\"\n >\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n \"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"px-2 py-1.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n )\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0\",\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n aria-label=\"Retirer\"\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({\n className,\n ...props\n}: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"],"mappings":";;;;;;;;AAaA,IAAMA,IAAWC,EAAkB;AAEnC,SAASI,EAAc,EAAE,GAAGC,KAAwC;CAClE,OAAO,kBAACL,EAAkB,OAAnB;EAAyB,aAAU;EAAiB,GAAIK;CAAQ,CAAA;AACzE;AAEA,SAASC,EAAgB,EACvB,cACA,aACA,GAAGD,KAC+B;CAClC,OACE,kBAACL,EAAkB,SAAnB;EACE,aAAU;EACV,cAAW;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AE4B;CAC/B,OACE,kBAACL,EAAkB,OAAnB;EACE,aAAU;EACV,WAAWO,EACT,mcACAC,CACF;EACA,GAAIH;CACL,CAAA;AAEL;AAEA,SAAS0B,EAAa,EACpB,cACA,aACA,gBAAa,IACb,GAAG1B,KAGF;CACD,OACE,kBAACL,EAAkB,MAAnB;EACE,aAAU;EACV,WAAWO,EACT,8RACAC,CACF;EACA,GAAIH;EANN,UAAA,CAQGI,GACAuB,KACC,kBAAChC,EAAkB,YAAnB;GACE,QAAQ,kBAACiC,GAAD;IAAQ,SAAQ;IAAQ,MAAK;GAAW,CAAA;GAChD,WAAU;GACV,aAAU;GACV,cAAW;GAEX,UAAA,kBAACpB,GAAD,EAAO,WAAU,sBAAuB,CAAA;EACZ,CAAA,CAEV;;AAE5B;AAEA,SAASqB,EAAmB,EAC1B,cACA,GAAG7B,KAC6B;CAChC,OACE,kBAACL,EAAkB,OAAnB;EACE,aAAU;EACV,WAAWO,EAAG,gCAAgCC,CAAS;EACvD,GAAIH;CACL,CAAA;AAEL;AAEA,SAAS8B,IAAoB;CAC3B,OAAOlC,EAAM,OAA8B,IAAI;AACjD"}
|
|
1
|
+
{"version":3,"file":"combobox.js","names":["Combobox","ComboboxPrimitive","React","CadreContext","DansLaListeContext","Combobox$1","cadre","Combobox","props","ComboboxValue","ComboboxTrigger","cn","className","children","ChevronDownIcon","ComboboxClear","InputGroupButton","XIcon","ComboboxInput","dansLaListe","InputGroup","InputGroupInput","InputGroupAddon","showTrigger","showClear","ComboboxContent","anchor","ComboboxList","ComboboxItem","CheckIcon","ComboboxGroup","ComboboxLabel","ComboboxCollection","ComboboxEmpty","ComboboxSeparator","ComboboxChips","ComboboxChip","showRemove","Button","ComboboxChipsInput","useComboboxAnchor"],"sources":["../../../src/components/ui/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\n// Écart avec shadcn : import par sous-chemin, pas par la racine de Base UI\n// (qui fait charger tous ses composants aux outils sans tree-shaking).\nimport { Combobox as ComboboxPrimitive } from \"@base-ui/react/combobox\"\nimport { cn } from \"cn\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport {\n InputGroup,\n InputGroupAddon,\n InputGroupButton,\n InputGroupInput,\n} from \"@etic-ui/components/ui/input-group\"\nimport { ChevronDownIcon, XIcon, CheckIcon } from \"lucide-react\"\n\n// Écart avec shadcn : la liste s'ancre sur le cadre (`InputGroup`) du\n// `ComboboxInput`, et non sur le seul champ, que décale un addon de tête\n// (loupe…). `Combobox` porte une ref vers ce cadre, que `ComboboxInput`\n// remplit et que `ComboboxContent` passe à `anchor` : Base UI la lit à\n// l'ouverture, `defaultOpen` compris, sans rendu de plus. Une `anchor`\n// explicite (puces) l'emporte ; sans `ComboboxInput` hors de la liste, la\n// ref reste vide et Base UI ancre sur le déclencheur, comme shadcn. Un\n// `ComboboxInput` placé dans la liste (recherche d'un sélecteur ouvert par\n// un bouton) ne s'enregistre pas.\nconst CadreContext =\n React.createContext<React.RefObject<HTMLDivElement | null> | null>(null)\nconst DansLaListeContext = React.createContext(false)\n\nfunction Combobox<\n Value,\n Multiple extends boolean | undefined = false,\n Item = Value,\n>(props: ComboboxPrimitive.Root.Props<Value, Multiple, Item>) {\n const cadre = React.useRef<HTMLDivElement | null>(null)\n return (\n <CadreContext.Provider value={cadre}>\n <ComboboxPrimitive.Root {...props} />\n </CadreContext.Provider>\n )\n}\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot=\"combobox-value\" {...props} />\n}\n\nfunction ComboboxTrigger({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot=\"combobox-trigger\"\n aria-label=\"Afficher les options\"\n className={cn(\"[&_svg:not([class*='size-'])]:size-4\", className)}\n {...props}\n >\n {children}\n <ChevronDownIcon className=\"pointer-events-none size-4 text-muted-foreground\" />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot=\"combobox-clear\"\n aria-label=\"Effacer\"\n render={<InputGroupButton variant=\"ghost\" size=\"icon-xs\" />}\n className={cn(className)}\n {...props}\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n const dansLaListe = React.useContext(DansLaListeContext)\n const cadre = React.useContext(CadreContext)\n return (\n <InputGroup\n ref={dansLaListe ? undefined : (cadre ?? undefined)}\n className={cn(\"w-auto\", className)}\n >\n <ComboboxPrimitive.Input\n render={<InputGroupInput disabled={disabled} />}\n {...props}\n />\n <InputGroupAddon align=\"inline-end\">\n {showTrigger && (\n <InputGroupButton\n size=\"icon-xs\"\n variant=\"ghost\"\n render={<ComboboxTrigger />}\n data-slot=\"input-group-button\"\n className=\"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent\"\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = \"bottom\",\n sideOffset = 6,\n align = \"start\",\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n \"side\" | \"align\" | \"sideOffset\" | \"alignOffset\" | \"anchor\"\n >) {\n const cadre = React.useContext(CadreContext)\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor ?? cadre}\n className=\"isolate z-50\"\n >\n <DansLaListeContext.Provider value={true}>\n <ComboboxPrimitive.Popup\n data-slot=\"combobox-content\"\n data-chips={!!anchor}\n className={cn(\n // Écart : `min-w-(--anchor-width)` au lieu de l'ancre + 28 px\n // de shadcn, qui couvraient l'addon d'un champ seul ; ancrée\n // sur le cadre entier, la liste en prend la largeur exacte.\n \"group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-(--anchor-width) origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-8 *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95\",\n className\n )}\n {...props}\n />\n </DansLaListeContext.Provider>\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot=\"combobox-list\"\n className={cn(\n \"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot=\"combobox-item\"\n className={cn(\n \"relative flex w-full cursor-default items-center gap-2 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\" />\n }\n >\n <CheckIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return (\n <ComboboxPrimitive.Group\n data-slot=\"combobox-group\"\n className={cn(className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxLabel({\n className,\n ...props\n}: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot=\"combobox-label\"\n className={cn(\"px-2 py-1.5 text-xs text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return (\n <ComboboxPrimitive.Collection data-slot=\"combobox-collection\" {...props} />\n )\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot=\"combobox-empty\"\n className={cn(\n \"hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({\n className,\n ...props\n}: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot=\"combobox-separator\"\n className={cn(\"-mx-1 my-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &\n ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot=\"combobox-chips\"\n className={cn(\n \"flex min-h-8 flex-wrap items-center gap-1 rounded-lg border border-input bg-transparent bg-clip-padding px-2.5 py-1 text-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot=\"combobox-chip\"\n className={cn(\n \"flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0\",\n className\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant=\"ghost\" size=\"icon-xs\" />}\n className=\"-ml-1 opacity-50 hover:opacity-100\"\n data-slot=\"combobox-chip-remove\"\n aria-label=\"Retirer\"\n >\n <XIcon className=\"pointer-events-none\" />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({\n className,\n ...props\n}: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot=\"combobox-chip-input\"\n className={cn(\"min-w-16 flex-1 outline-none\", className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxInput,\n ComboboxContent,\n ComboboxList,\n ComboboxItem,\n ComboboxGroup,\n ComboboxLabel,\n ComboboxCollection,\n ComboboxEmpty,\n ComboboxSeparator,\n ComboboxChips,\n ComboboxChip,\n ComboboxChipsInput,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"],"mappings":";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EV;;AAE5B;AAEA,SAASsB,EAAmB,EAC1B,cACA,GAAG/B,KAC6B;CAChC,OACE,kBAACP,EAAkB,OAAnB;EACE,aAAU;EACV,WAAWU,EAAG,gCAAgCC,CAAS;EACvD,GAAIJ;CACL,CAAA;AAEL;AAEA,SAASgC,IAAoB;CAC3B,OAAOtC,EAAM,OAA8B,IAAI;AACjD"}
|
|
@@ -8,10 +8,19 @@ declare function DialogOverlay({ className, ...props }: DialogPrimitive.Backdrop
|
|
|
8
8
|
declare function DialogContent({ className, children, showCloseButton, ...props }: DialogPrimitive.Popup.Props & {
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): React.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* Corps d'un dialogue (absent de shadcn), entre l'en-tête et le pied : seul
|
|
13
|
+
* à défiler quand le dialogue atteint sa hauteur maximale, en-tête, croix et
|
|
14
|
+
* pied restant visibles. Il déborde dans la marge du dialogue (`-mx-4 px-4`,
|
|
15
|
+
* `-my-1 py-1`) pour que la barre de défilement soit au bord et que l'anneau
|
|
16
|
+
* de focus d'un champ ne soit pas rogné. Sans lui, tout le contenu défile.
|
|
17
|
+
* Sert aussi dans un `AlertDialogContent`.
|
|
18
|
+
*/
|
|
19
|
+
declare function DialogBody({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
11
20
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
21
|
declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
|
|
13
22
|
showCloseButton?: boolean;
|
|
14
23
|
}): React.JSX.Element;
|
|
15
24
|
declare function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props): React.JSX.Element;
|
|
16
25
|
declare function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props): React.JSX.Element;
|
|
17
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
26
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
@@ -39,7 +39,7 @@ function u({ className: e, ...r }) {
|
|
|
39
39
|
function d({ className: o, children: s, showCloseButton: l = !0, ...d }) {
|
|
40
40
|
return /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ n(u, {}), /* @__PURE__ */ r(a.Popup, {
|
|
41
41
|
"data-slot": "dialog-content",
|
|
42
|
-
className: t("fixed top-1/2 left-1/2 z-50
|
|
42
|
+
className: t("fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", o),
|
|
43
43
|
...d,
|
|
44
44
|
children: [s, l && /* @__PURE__ */ r(a.Close, {
|
|
45
45
|
"data-slot": "dialog-close",
|
|
@@ -56,13 +56,20 @@ function d({ className: o, children: s, showCloseButton: l = !0, ...d }) {
|
|
|
56
56
|
})] });
|
|
57
57
|
}
|
|
58
58
|
function f({ className: e, ...r }) {
|
|
59
|
+
return /* @__PURE__ */ n("div", {
|
|
60
|
+
"data-slot": "dialog-body",
|
|
61
|
+
className: t("-mx-4 -my-1 grid min-h-0 auto-rows-min grid-cols-1 gap-4 overflow-x-hidden overflow-y-auto px-4 py-1", e),
|
|
62
|
+
...r
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function p({ className: e, ...r }) {
|
|
59
66
|
return /* @__PURE__ */ n("div", {
|
|
60
67
|
"data-slot": "dialog-header",
|
|
61
68
|
className: t("flex flex-col gap-2", e),
|
|
62
69
|
...r
|
|
63
70
|
});
|
|
64
71
|
}
|
|
65
|
-
function
|
|
72
|
+
function m({ className: i, showCloseButton: o = !1, children: s, ...c }) {
|
|
66
73
|
return /* @__PURE__ */ r("div", {
|
|
67
74
|
"data-slot": "dialog-footer",
|
|
68
75
|
className: t("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", i),
|
|
@@ -73,20 +80,20 @@ function p({ className: i, showCloseButton: o = !1, children: s, ...c }) {
|
|
|
73
80
|
})]
|
|
74
81
|
});
|
|
75
82
|
}
|
|
76
|
-
function
|
|
83
|
+
function h({ className: e, ...r }) {
|
|
77
84
|
return /* @__PURE__ */ n(a.Title, {
|
|
78
85
|
"data-slot": "dialog-title",
|
|
79
86
|
className: t("font-heading text-base leading-none font-medium", e),
|
|
80
87
|
...r
|
|
81
88
|
});
|
|
82
89
|
}
|
|
83
|
-
function
|
|
90
|
+
function g({ className: e, ...r }) {
|
|
84
91
|
return /* @__PURE__ */ n(a.Description, {
|
|
85
92
|
"data-slot": "dialog-description",
|
|
86
93
|
className: t("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", e),
|
|
87
94
|
...r
|
|
88
95
|
});
|
|
89
96
|
}
|
|
90
|
-
export { o as Dialog, l as DialogClose, d as DialogContent,
|
|
97
|
+
export { o as Dialog, f as DialogBody, l as DialogClose, d as DialogContent, g as DialogDescription, m as DialogFooter, p as DialogHeader, u as DialogOverlay, c as DialogPortal, h as DialogTitle, s as DialogTrigger };
|
|
91
98
|
|
|
92
99
|
//# sourceMappingURL=dialog.js.map
|