@alepha/ui 0.25.0 → 0.25.2
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/package.json +4 -5
- package/src/components/account/__tests__/account-router.spec.ts +201 -0
- package/src/components/account/account-connections.tsx +103 -0
- package/src/components/account/account-delete-dialog.tsx +184 -0
- package/src/components/account/account-header.tsx +57 -0
- package/src/components/account/account-keys.tsx +221 -0
- package/src/components/account/account-layout.tsx +63 -0
- package/src/components/account/account-password-dialog.tsx +152 -0
- package/src/components/account/account-profile.tsx +229 -0
- package/src/components/account/account-router-options.tsx +74 -0
- package/src/components/account/account-router-page.tsx +69 -0
- package/src/components/account/account-router.tsx +214 -0
- package/src/components/account/account-security.tsx +150 -0
- package/src/components/account/account-sessions.tsx +140 -0
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
- package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
- package/src/components/admin/admin-analytics-results.tsx +95 -0
- package/src/components/admin/admin-analytics.tsx +104 -0
- package/src/components/admin/admin-audits.tsx +12 -15
- package/src/components/admin/admin-files.tsx +10 -18
- package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
- package/src/components/admin/admin-jobs.tsx +3 -1
- package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
- package/src/components/admin/admin-keys.tsx +54 -3
- package/src/components/admin/admin-layout.tsx +107 -0
- package/src/components/admin/admin-payments.tsx +4 -5
- package/src/components/admin/admin-router-options.tsx +130 -0
- package/src/components/admin/admin-router-page.tsx +74 -0
- package/src/components/admin/admin-router.tsx +379 -0
- package/src/components/admin/admin-sessions.tsx +2 -16
- package/src/components/admin/admin-user-cell.tsx +70 -0
- package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
- package/src/components/admin/admin-user-detail.tsx +76 -32
- package/src/components/admin/admin-users-status-filter.tsx +2 -0
- package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
- package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
- package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
- package/src/components/admin/admin-workflows.tsx +207 -0
- package/src/components/alepha-table/alepha-table.tsx +73 -17
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
- package/src/components/app-actions/app-actions.tsx +113 -0
- package/src/components/app-shell/app-shell.tsx +122 -0
- package/src/components/auth/auth-reset-password.tsx +81 -8
- package/src/components/button-user/button-user.tsx +58 -1
- package/src/components/control/control.tsx +14 -71
- package/src/components/control-password/control-password.tsx +87 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +126 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
- package/src/components/control-select/control-select.tsx +133 -111
- package/src/components/control-upload/control-upload.tsx +27 -1
- package/src/components/markdown-view/markdown-view.tsx +6 -0
- package/src/components/nav-shell/nav-page.tsx +3 -3
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
- package/src/components/settings/settings-danger-section.tsx +59 -0
- package/src/components/settings/settings-layout.tsx +56 -0
- package/src/components/settings/settings-nav.tsx +131 -0
- package/src/components/settings/settings-row.tsx +81 -0
- package/src/components/settings/settings-section.tsx +64 -0
- package/src/components/ui/alert-dialog.tsx +1 -1
- package/src/components/ui/avatar.tsx +2 -0
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/calendar.tsx +11 -6
- package/src/components/ui/card.tsx +5 -5
- package/src/components/ui/carousel.tsx +4 -4
- package/src/components/ui/chart.tsx +2 -0
- package/src/components/ui/collapsible.tsx +2 -0
- package/src/components/ui/combobox.tsx +3 -1
- package/src/components/ui/context-menu.tsx +3 -3
- package/src/components/ui/dialog.tsx +6 -1
- package/src/components/ui/direction.tsx +2 -0
- package/src/components/ui/drawer.tsx +134 -37
- package/src/components/ui/dropdown-menu.tsx +13 -3
- package/src/components/ui/empty.tsx +4 -1
- package/src/components/ui/input-otp.tsx +2 -0
- package/src/components/ui/menubar.tsx +2 -2
- package/src/components/ui/pagination.tsx +2 -2
- package/src/components/ui/popover.tsx +2 -0
- package/src/components/ui/radio-group.tsx +2 -0
- package/src/components/ui/scroll-area.tsx +2 -0
- package/src/components/ui/select.tsx +1 -1
- package/src/components/ui/separator.tsx +2 -0
- package/src/components/ui/sheet.tsx +4 -1
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/components/ui/spinner.tsx +1 -0
- package/src/components/ui/switch.tsx +2 -0
- package/src/components/ui/tabs.tsx +2 -0
- package/src/components/ui/toggle-group.tsx +2 -0
- package/src/components/ui/tooltip.tsx +2 -0
- package/src/lib/__tests__/rehype-safe-img.spec.ts +121 -0
- package/src/lib/i18n-fr.ts +68 -0
- package/src/lib/rehype-safe-img.ts +150 -0
- package/src/lib/resize-image.ts +135 -0
- package/src/styles.css +126 -1
- /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
2
4
|
import {
|
|
3
5
|
InputGroup,
|
|
@@ -109,7 +111,7 @@ function ComboboxContent({
|
|
|
109
111
|
data-slot="combobox-content"
|
|
110
112
|
data-chips={!!anchor}
|
|
111
113
|
className={cn(
|
|
112
|
-
"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",
|
|
114
|
+
"cn-menu-target cn-menu-translucent 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",
|
|
113
115
|
className,
|
|
114
116
|
)}
|
|
115
117
|
{...props}
|
|
@@ -52,7 +52,7 @@ function ContextMenuContent({
|
|
|
52
52
|
<ContextMenuPrimitive.Popup
|
|
53
53
|
data-slot="context-menu-content"
|
|
54
54
|
className={cn(
|
|
55
|
-
"z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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-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",
|
|
55
|
+
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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-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",
|
|
56
56
|
className,
|
|
57
57
|
)}
|
|
58
58
|
{...props}
|
|
@@ -136,7 +136,7 @@ function ContextMenuSubTrigger({
|
|
|
136
136
|
{...props}
|
|
137
137
|
>
|
|
138
138
|
{children}
|
|
139
|
-
<ChevronRightIcon className="ml-auto" />
|
|
139
|
+
<ChevronRightIcon className="cn-rtl-flip ml-auto" />
|
|
140
140
|
</ContextMenuPrimitive.SubmenuTrigger>
|
|
141
141
|
);
|
|
142
142
|
}
|
|
@@ -147,7 +147,7 @@ function ContextMenuSubContent({
|
|
|
147
147
|
return (
|
|
148
148
|
<ContextMenuContent
|
|
149
149
|
data-slot="context-menu-sub-content"
|
|
150
|
-
className="shadow-lg"
|
|
150
|
+
className="cn-menu-target cn-menu-translucent shadow-lg"
|
|
151
151
|
side="right"
|
|
152
152
|
{...props}
|
|
153
153
|
/>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
2
4
|
import { cn } from "@alepha/ui/lib/utils";
|
|
3
5
|
import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
|
|
@@ -117,7 +119,10 @@ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
|
117
119
|
return (
|
|
118
120
|
<DialogPrimitive.Title
|
|
119
121
|
data-slot="dialog-title"
|
|
120
|
-
className={cn(
|
|
122
|
+
className={cn(
|
|
123
|
+
"cn-font-heading text-base leading-none font-medium",
|
|
124
|
+
className,
|
|
125
|
+
)}
|
|
121
126
|
{...props}
|
|
122
127
|
/>
|
|
123
128
|
);
|
|
@@ -1,42 +1,94 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { cn } from "@alepha/ui/lib/utils";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
|
|
7
|
+
type DrawerContextProps = {
|
|
8
|
+
hasSnapPoints: boolean;
|
|
9
|
+
modal: DrawerPrimitive.Root.Props["modal"];
|
|
10
|
+
showSwipeHandle: boolean;
|
|
11
|
+
swipeDirection: NonNullable<DrawerPrimitive.Root.Props["swipeDirection"]>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const DrawerContext = React.createContext<DrawerContextProps | null>(null);
|
|
15
|
+
|
|
16
|
+
function useDrawer() {
|
|
17
|
+
const context = React.useContext(DrawerContext);
|
|
18
|
+
|
|
19
|
+
if (!context) {
|
|
20
|
+
throw new Error("useDrawer must be used within a Drawer.");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return context;
|
|
24
|
+
}
|
|
6
25
|
|
|
7
26
|
function Drawer({
|
|
27
|
+
modal = true,
|
|
28
|
+
showSwipeHandle = false,
|
|
29
|
+
snapPoints,
|
|
30
|
+
swipeDirection = "down",
|
|
8
31
|
...props
|
|
9
|
-
}:
|
|
10
|
-
|
|
32
|
+
}: DrawerPrimitive.Root.Props & {
|
|
33
|
+
showSwipeHandle?: boolean;
|
|
34
|
+
}) {
|
|
35
|
+
const hasSnapPoints = snapPoints != null && snapPoints.length > 0;
|
|
36
|
+
const contextValue = React.useMemo(
|
|
37
|
+
() => ({ hasSnapPoints, modal, showSwipeHandle, swipeDirection }),
|
|
38
|
+
[hasSnapPoints, modal, showSwipeHandle, swipeDirection],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<DrawerContext.Provider value={contextValue}>
|
|
43
|
+
<DrawerPrimitive.Root
|
|
44
|
+
data-slot="drawer"
|
|
45
|
+
modal={modal}
|
|
46
|
+
snapPoints={snapPoints}
|
|
47
|
+
swipeDirection={swipeDirection}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
</DrawerContext.Provider>
|
|
51
|
+
);
|
|
11
52
|
}
|
|
12
53
|
|
|
13
|
-
function DrawerTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
|
|
54
|
+
function DrawerTrigger({ ...props }: DrawerPrimitive.Trigger.Props) {
|
|
16
55
|
return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />;
|
|
17
56
|
}
|
|
18
57
|
|
|
19
|
-
function DrawerPortal({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
|
|
58
|
+
function DrawerPortal({ ...props }: DrawerPrimitive.Portal.Props) {
|
|
22
59
|
return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />;
|
|
23
60
|
}
|
|
24
61
|
|
|
25
|
-
function DrawerClose({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Close>) {
|
|
62
|
+
function DrawerClose({ ...props }: DrawerPrimitive.Close.Props) {
|
|
28
63
|
return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />;
|
|
29
64
|
}
|
|
30
65
|
|
|
31
66
|
function DrawerOverlay({
|
|
32
67
|
className,
|
|
33
68
|
...props
|
|
34
|
-
}:
|
|
69
|
+
}: DrawerPrimitive.Backdrop.Props) {
|
|
35
70
|
return (
|
|
36
|
-
<DrawerPrimitive.
|
|
71
|
+
<DrawerPrimitive.Backdrop
|
|
37
72
|
data-slot="drawer-overlay"
|
|
38
73
|
className={cn(
|
|
39
|
-
"fixed inset-0 z-50 bg-black/10
|
|
74
|
+
"fixed inset-0 z-50 min-h-dvh bg-black/10 opacity-[max(var(--drawer-overlay-min-opacity,0),calc(1-var(--drawer-swipe-progress)))] transition-opacity duration-450 ease-[cubic-bezier(0.32,0.72,0,1)] select-none data-ending-style:pointer-events-none data-ending-style:opacity-0 data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-snap-points:[--drawer-overlay-min-opacity:0.5] data-starting-style:opacity-0 data-swiping:duration-0 supports-backdrop-filter:backdrop-blur-xs supports-[-webkit-touch-callout:none]:absolute",
|
|
75
|
+
className,
|
|
76
|
+
)}
|
|
77
|
+
{...props}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function DrawerSwipeHandle({
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}: React.ComponentProps<"div">) {
|
|
86
|
+
return (
|
|
87
|
+
<div
|
|
88
|
+
data-slot="drawer-swipe-handle"
|
|
89
|
+
aria-hidden="true"
|
|
90
|
+
className={cn(
|
|
91
|
+
"relative z-10 flex shrink-0 cursor-grab transition-opacity duration-200 group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-[swipe-axis=x]/drawer-popup:h-full group-data-[swipe-axis=x]/drawer-popup:w-3 group-data-[swipe-axis=x]/drawer-popup:items-center group-data-[swipe-axis=y]/drawer-popup:h-3 group-data-[swipe-axis=y]/drawer-popup:w-full group-data-[swipe-axis=y]/drawer-popup:justify-center group-data-[swipe-direction=down]/drawer-popup:items-end group-data-[swipe-direction=left]/drawer-popup:order-last group-data-[swipe-direction=left]/drawer-popup:justify-start group-data-[swipe-direction=right]/drawer-popup:justify-end group-data-[swipe-direction=up]/drawer-popup:order-last group-data-[swipe-direction=up]/drawer-popup:items-start after:block after:shrink-0 after:rounded-full after:bg-muted group-data-[swipe-axis=x]/drawer-popup:after:h-24 group-data-[swipe-axis=x]/drawer-popup:after:w-1 group-data-[swipe-axis=y]/drawer-popup:after:h-1 group-data-[swipe-axis=y]/drawer-popup:after:w-24 active:cursor-grabbing",
|
|
40
92
|
className,
|
|
41
93
|
)}
|
|
42
94
|
{...props}
|
|
@@ -48,21 +100,65 @@ function DrawerContent({
|
|
|
48
100
|
className,
|
|
49
101
|
children,
|
|
50
102
|
...props
|
|
51
|
-
}:
|
|
103
|
+
}: DrawerPrimitive.Popup.Props) {
|
|
104
|
+
const { hasSnapPoints, modal, showSwipeHandle, swipeDirection } = useDrawer();
|
|
105
|
+
const swipeAxis =
|
|
106
|
+
swipeDirection === "down" || swipeDirection === "up" ? "y" : "x";
|
|
107
|
+
|
|
52
108
|
return (
|
|
53
109
|
<DrawerPortal data-slot="drawer-portal">
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{...props}
|
|
110
|
+
{modal === true && (
|
|
111
|
+
<DrawerOverlay data-snap-points={hasSnapPoints ? "" : undefined} />
|
|
112
|
+
)}
|
|
113
|
+
<DrawerPrimitive.Viewport
|
|
114
|
+
data-slot="drawer-viewport"
|
|
115
|
+
data-modal={modal}
|
|
116
|
+
className="pointer-events-none fixed inset-0 z-50 select-none data-[modal=true]:pointer-events-auto"
|
|
62
117
|
>
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
118
|
+
<DrawerPrimitive.Popup
|
|
119
|
+
data-slot="drawer-popup"
|
|
120
|
+
data-swipe-axis={swipeAxis}
|
|
121
|
+
data-snap-points={hasSnapPoints ? "" : undefined}
|
|
122
|
+
className={cn(
|
|
123
|
+
// Base.
|
|
124
|
+
"group/drawer-popup pointer-events-auto fixed z-50 m-(--drawer-inset,0px) flex h-(--drawer-content-height) max-h-(--drawer-content-max-height,none) min-h-0 w-(--drawer-content-width,auto) transform-[translate3d(var(--translate-x,0px),var(--translate-y,0px),0)_scale(var(--stack-scale))] flex-col bg-popover text-sm text-popover-foreground transition-[transform,height,opacity,filter] duration-450 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform outline-none select-none [interpolate-size:allow-keywords] data-[swipe-direction=down]:rounded-t-xl data-[swipe-direction=down]:border-t data-[swipe-direction=left]:rounded-r-xl data-[swipe-direction=left]:border-r data-[swipe-direction=right]:rounded-l-xl data-[swipe-direction=right]:border-l data-[swipe-direction=up]:rounded-b-xl data-[swipe-direction=up]:border-b",
|
|
125
|
+
// Nested.
|
|
126
|
+
"data-nested-drawer-open:overflow-hidden data-nested-drawer-open:brightness-95",
|
|
127
|
+
// Bleed.
|
|
128
|
+
"after:pointer-events-none after:absolute after:bg-(--drawer-bleed-background,var(--color-popover)) data-[swipe-axis=x]:after:inset-y-0 data-[swipe-axis=x]:after:w-(--bleed) data-[swipe-axis=y]:after:inset-x-0 data-[swipe-axis=y]:after:h-(--bleed) data-[swipe-direction=down]:after:top-full data-[swipe-direction=left]:after:right-full data-[swipe-direction=right]:after:left-full data-[swipe-direction=up]:after:bottom-full",
|
|
129
|
+
// Sizing.
|
|
130
|
+
"[--drawer-content-height:var(--drawer-height,auto)] data-[swipe-axis=x]:[--drawer-content-width:75%] data-[swipe-axis=y]:[--drawer-content-max-height:calc(100dvh-6rem)] data-[swipe-axis=y]:data-snap-points:[--drawer-content-height:100dvh] data-[swipe-axis=x]:sm:[--drawer-content-width:24rem]",
|
|
131
|
+
// Stack.
|
|
132
|
+
"[--bleed:3rem] [--peek:1rem] [--stack-height:var(--drawer-frontmost-height,var(--drawer-height,0px))] [--stack-peek-offset:max(0px,calc((var(--nested-drawers)-var(--stack-progress))*var(--peek)))] [--stack-progress:clamp(0,var(--drawer-swipe-progress),1)] [--stack-scale-base:max(0,calc(1-(var(--nested-drawers)*var(--stack-step))))] [--stack-scale:clamp(0,calc(var(--stack-scale-base)+(var(--stack-step)*var(--stack-progress))),1)] [--stack-shrink:calc(1-var(--stack-scale))] [--stack-step:0.05]",
|
|
133
|
+
// Transitions.
|
|
134
|
+
"data-ending-style:transform-(--closed-transform) data-ending-style:opacity-[0.9999] data-ending-style:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-nested-drawer-swiping:duration-0 data-ending-style:data-nested-drawer-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)] data-starting-style:transform-(--closed-transform) data-swiping:duration-0 data-ending-style:data-swiping:duration-[calc(var(--drawer-swipe-strength)*400ms)]",
|
|
135
|
+
// Axis: y.
|
|
136
|
+
"data-[swipe-axis=y]:inset-x-0 data-[swipe-axis=y]:data-nested-drawer-open:h-(--stack-height)",
|
|
137
|
+
// Axis: x.
|
|
138
|
+
"data-[swipe-axis=x]:inset-y-0 data-[swipe-axis=x]:flex-row",
|
|
139
|
+
// Direction: down.
|
|
140
|
+
"data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:origin-bottom data-[swipe-direction=down]:[--closed-transform:translate3d(0,calc(100%+var(--drawer-inset,0px)+2px),0)] data-[swipe-direction=down]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)-var(--stack-peek-offset)-(var(--stack-shrink)*var(--stack-height)))]",
|
|
141
|
+
// Direction: up.
|
|
142
|
+
"data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:origin-top data-[swipe-direction=up]:[--closed-transform:translate3d(0,calc(-100%-var(--drawer-inset,0px)-2px),0)] data-[swipe-direction=up]:[--translate-y:calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y)+var(--stack-peek-offset)+(var(--stack-shrink)*var(--stack-height)))]",
|
|
143
|
+
// Direction: left.
|
|
144
|
+
"data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:origin-left data-[swipe-direction=left]:[--closed-transform:translate3d(calc(-100%-var(--drawer-inset,0px)-2px),0,0)] data-[swipe-direction=left]:[--translate-x:calc(var(--drawer-swipe-movement-x)+var(--stack-peek-offset)+(var(--stack-shrink)*100%))]",
|
|
145
|
+
// Direction: right.
|
|
146
|
+
"data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:origin-right data-[swipe-direction=right]:[--closed-transform:translate3d(calc(100%+var(--drawer-inset,0px)+2px),0,0)] data-[swipe-direction=right]:[--translate-x:calc(var(--drawer-swipe-movement-x)-var(--stack-peek-offset)-(var(--stack-shrink)*100%))]",
|
|
147
|
+
className,
|
|
148
|
+
)}
|
|
149
|
+
{...props}
|
|
150
|
+
>
|
|
151
|
+
{showSwipeHandle && <DrawerSwipeHandle />}
|
|
152
|
+
<DrawerPrimitive.Content
|
|
153
|
+
data-slot="drawer-content"
|
|
154
|
+
className={cn(
|
|
155
|
+
"flex min-h-0 flex-1 flex-col overflow-hidden overscroll-contain rounded-[inherit] transition-opacity duration-300 ease-[cubic-bezier(0.45,1.005,0,1.005)] select-text group-data-nested-drawer-open/drawer-popup:opacity-0 group-data-nested-drawer-swiping/drawer-popup:opacity-100 group-data-swiping/drawer-popup:select-none",
|
|
156
|
+
)}
|
|
157
|
+
>
|
|
158
|
+
{children}
|
|
159
|
+
</DrawerPrimitive.Content>
|
|
160
|
+
</DrawerPrimitive.Popup>
|
|
161
|
+
</DrawerPrimitive.Viewport>
|
|
66
162
|
</DrawerPortal>
|
|
67
163
|
);
|
|
68
164
|
}
|
|
@@ -72,7 +168,7 @@ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
72
168
|
<div
|
|
73
169
|
data-slot="drawer-header"
|
|
74
170
|
className={cn(
|
|
75
|
-
"flex flex-col gap-0.5 p-4
|
|
171
|
+
"flex shrink-0 flex-col gap-0.5 p-4 pb-0 group-data-[swipe-axis=y]/drawer-popup:text-center md:gap-0.5 md:text-left",
|
|
76
172
|
className,
|
|
77
173
|
)}
|
|
78
174
|
{...props}
|
|
@@ -84,20 +180,20 @@ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
84
180
|
return (
|
|
85
181
|
<div
|
|
86
182
|
data-slot="drawer-footer"
|
|
87
|
-
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
183
|
+
className={cn("mt-auto flex shrink-0 flex-col gap-2 p-4 pt-0", className)}
|
|
88
184
|
{...props}
|
|
89
185
|
/>
|
|
90
186
|
);
|
|
91
187
|
}
|
|
92
188
|
|
|
93
|
-
function DrawerTitle({
|
|
94
|
-
className,
|
|
95
|
-
...props
|
|
96
|
-
}: React.ComponentProps<typeof DrawerPrimitive.Title>) {
|
|
189
|
+
function DrawerTitle({ className, ...props }: DrawerPrimitive.Title.Props) {
|
|
97
190
|
return (
|
|
98
191
|
<DrawerPrimitive.Title
|
|
99
192
|
data-slot="drawer-title"
|
|
100
|
-
className={cn(
|
|
193
|
+
className={cn(
|
|
194
|
+
"cn-font-heading text-base font-medium text-foreground",
|
|
195
|
+
className,
|
|
196
|
+
)}
|
|
101
197
|
{...props}
|
|
102
198
|
/>
|
|
103
199
|
);
|
|
@@ -106,11 +202,11 @@ function DrawerTitle({
|
|
|
106
202
|
function DrawerDescription({
|
|
107
203
|
className,
|
|
108
204
|
...props
|
|
109
|
-
}:
|
|
205
|
+
}: DrawerPrimitive.Description.Props) {
|
|
110
206
|
return (
|
|
111
207
|
<DrawerPrimitive.Description
|
|
112
208
|
data-slot="drawer-description"
|
|
113
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
209
|
+
className={cn("text-sm text-balance text-muted-foreground", className)}
|
|
114
210
|
{...props}
|
|
115
211
|
/>
|
|
116
212
|
);
|
|
@@ -125,6 +221,7 @@ export {
|
|
|
125
221
|
DrawerHeader,
|
|
126
222
|
DrawerOverlay,
|
|
127
223
|
DrawerPortal,
|
|
224
|
+
DrawerSwipeHandle,
|
|
128
225
|
DrawerTitle,
|
|
129
226
|
DrawerTrigger,
|
|
130
227
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import { cn } from "@alepha/ui/lib/utils";
|
|
2
4
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
3
5
|
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
@@ -39,7 +41,15 @@ function DropdownMenuContent({
|
|
|
39
41
|
<MenuPrimitive.Popup
|
|
40
42
|
data-slot="dropdown-menu-content"
|
|
41
43
|
className={cn(
|
|
42
|
-
|
|
44
|
+
// LOCAL PATCH — `w-(--anchor-width)` → `w-auto`. Upstream sizes a
|
|
45
|
+
// menu to its anchor, which is right for a select (the popup IS the
|
|
46
|
+
// field) and wrong for a menu, where the trigger is often a 32px
|
|
47
|
+
// icon button and the content is prose: every label past `min-w-32`
|
|
48
|
+
// wrapped. `min-w-32` stays as the floor so a lone "Edit" does not
|
|
49
|
+
// produce a sliver. Re-applied by `scripts/sync.mjs` — this file is
|
|
50
|
+
// overwritten wholesale on the next registry sync, so a comment
|
|
51
|
+
// alone would not survive.
|
|
52
|
+
"cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-auto max-w-(--available-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
43
53
|
className,
|
|
44
54
|
)}
|
|
45
55
|
{...props}
|
|
@@ -119,7 +129,7 @@ function DropdownMenuSubTrigger({
|
|
|
119
129
|
{...props}
|
|
120
130
|
>
|
|
121
131
|
{children}
|
|
122
|
-
<ChevronRightIcon className="ml-auto" />
|
|
132
|
+
<ChevronRightIcon className="cn-rtl-flip ml-auto" />
|
|
123
133
|
</MenuPrimitive.SubmenuTrigger>
|
|
124
134
|
);
|
|
125
135
|
}
|
|
@@ -136,7 +146,7 @@ function DropdownMenuSubContent({
|
|
|
136
146
|
<DropdownMenuContent
|
|
137
147
|
data-slot="dropdown-menu-sub-content"
|
|
138
148
|
className={cn(
|
|
139
|
-
"w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 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",
|
|
149
|
+
"cn-menu-target cn-menu-translucent w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 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",
|
|
140
150
|
className,
|
|
141
151
|
)}
|
|
142
152
|
align={align}
|
|
@@ -58,7 +58,10 @@ function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
58
58
|
return (
|
|
59
59
|
<div
|
|
60
60
|
data-slot="empty-title"
|
|
61
|
-
className={cn(
|
|
61
|
+
className={cn(
|
|
62
|
+
"cn-font-heading text-sm font-medium tracking-tight",
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
62
65
|
{...props}
|
|
63
66
|
/>
|
|
64
67
|
);
|
|
@@ -80,7 +80,7 @@ function MenubarContent({
|
|
|
80
80
|
alignOffset={alignOffset}
|
|
81
81
|
sideOffset={sideOffset}
|
|
82
82
|
className={cn(
|
|
83
|
-
"min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
83
|
+
"cn-menu-target cn-menu-translucent min-w-36 rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95",
|
|
84
84
|
className,
|
|
85
85
|
)}
|
|
86
86
|
{...props}
|
|
@@ -255,7 +255,7 @@ function MenubarSubContent({
|
|
|
255
255
|
<DropdownMenuSubContent
|
|
256
256
|
data-slot="menubar-sub-content"
|
|
257
257
|
className={cn(
|
|
258
|
-
"min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 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",
|
|
258
|
+
"cn-menu-target cn-menu-translucent min-w-32 rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 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 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",
|
|
259
259
|
className,
|
|
260
260
|
)}
|
|
261
261
|
{...props}
|
|
@@ -78,7 +78,7 @@ function PaginationPrevious({
|
|
|
78
78
|
className={cn("pl-1.5!", className)}
|
|
79
79
|
{...props}
|
|
80
80
|
>
|
|
81
|
-
<ChevronLeftIcon data-icon="inline-start" />
|
|
81
|
+
<ChevronLeftIcon data-icon="inline-start" className="cn-rtl-flip" />
|
|
82
82
|
<span className="hidden sm:block">{text}</span>
|
|
83
83
|
</PaginationLink>
|
|
84
84
|
);
|
|
@@ -97,7 +97,7 @@ function PaginationNext({
|
|
|
97
97
|
{...props}
|
|
98
98
|
>
|
|
99
99
|
<span className="hidden sm:block">{text}</span>
|
|
100
|
-
<ChevronRightIcon data-icon="inline-end" />
|
|
100
|
+
<ChevronRightIcon data-icon="inline-end" className="cn-rtl-flip" />
|
|
101
101
|
</PaginationLink>
|
|
102
102
|
);
|
|
103
103
|
}
|
|
@@ -83,7 +83,7 @@ function SelectContent({
|
|
|
83
83
|
data-slot="select-content"
|
|
84
84
|
data-align-trigger={alignItemWithTrigger}
|
|
85
85
|
className={cn(
|
|
86
|
-
"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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-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",
|
|
86
|
+
"cn-menu-target cn-menu-translucent relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none 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-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",
|
|
87
87
|
className,
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
@@ -102,7 +102,10 @@ function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
|
102
102
|
return (
|
|
103
103
|
<SheetPrimitive.Title
|
|
104
104
|
data-slot="sheet-title"
|
|
105
|
-
className={cn(
|
|
105
|
+
className={cn(
|
|
106
|
+
"cn-font-heading text-base font-medium text-foreground",
|
|
107
|
+
className,
|
|
108
|
+
)}
|
|
106
109
|
{...props}
|
|
107
110
|
/>
|
|
108
111
|
);
|