@vuer-ai/vuer-uikit 0.0.96 → 0.0.98
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 +106 -7
- package/cli/dial-cli.js +49 -7
- package/dist/SyncScroll/SyncScroll.cjs +10 -10
- package/dist/SyncScroll/SyncScroll.mjs +3 -3
- package/dist/SyncScroll/index.cjs +10 -10
- package/dist/SyncScroll/index.mjs +3 -3
- package/dist/chunk-3HEZVWRW.mjs +62 -0
- package/dist/chunk-4KWGGESI.cjs +494 -0
- package/dist/{chunk-CCMKL2OA.cjs → chunk-7GWDO25E.cjs} +2 -2
- package/dist/chunk-A5LCX2UQ.cjs +208 -0
- package/dist/chunk-BEJIZ56L.mjs +300 -0
- package/dist/chunk-C7VGRU3O.mjs +283 -0
- package/dist/{chunk-LONOMMFA.cjs → chunk-LJMNHTTG.cjs} +21 -21
- package/dist/chunk-O66RESRR.cjs +285 -0
- package/dist/{chunk-RINTUFYQ.cjs → chunk-RMK6W774.cjs} +24 -19
- package/dist/{chunk-BFQ2WL5U.mjs → chunk-TTYSYGVE.mjs} +2 -2
- package/dist/chunk-VA3PEYFM.mjs +489 -0
- package/dist/chunk-VBBJSIY7.cjs +308 -0
- package/dist/{chunk-AIINOWEH.mjs → chunk-W4JCKCW7.mjs} +5 -5
- package/dist/chunk-WWGF6TBZ.mjs +206 -0
- package/dist/chunk-ZGN4UEJR.cjs +679 -0
- package/dist/chunk-ZQLRMOUW.mjs +661 -0
- package/dist/dial/DialPanel.cjs +24 -24
- package/dist/dial/DialPanel.mjs +23 -23
- package/dist/dial/DialProvider.cjs +3 -3
- package/dist/dial/DialProvider.d.cts +1 -0
- package/dist/dial/DialProvider.d.ts +1 -0
- package/dist/dial/DialProvider.example.cjs +72 -0
- package/dist/dial/DialProvider.example.d.cts +7 -0
- package/dist/dial/DialProvider.example.d.ts +7 -0
- package/dist/dial/DialProvider.example.mjs +68 -0
- package/dist/dial/DialProvider.mjs +1 -1
- package/dist/dial/index.cjs +42 -42
- package/dist/dial/index.mjs +23 -23
- package/dist/dial/wrapped-inputs/ControlledInputs.cjs +27 -27
- package/dist/dial/wrapped-inputs/ControlledInputs.mjs +23 -23
- package/dist/dial/wrapped-inputs/DialInputs.cjs +34 -34
- package/dist/dial/wrapped-inputs/DialInputs.mjs +23 -23
- package/dist/dial/wrapped-inputs/DialVectorInput.cjs +24 -24
- package/dist/dial/wrapped-inputs/DialVectorInput.mjs +23 -23
- package/dist/dial/wrapped-inputs/index.cjs +39 -39
- package/dist/dial/wrapped-inputs/index.mjs +23 -23
- package/dist/highlight-cursor/cursor-provider.cjs +3 -3
- package/dist/highlight-cursor/cursor-provider.mjs +2 -2
- package/dist/highlight-cursor/enhanced-components.cjs +10 -10
- package/dist/highlight-cursor/enhanced-components.mjs +5 -5
- package/dist/highlight-cursor/index.cjs +16 -16
- package/dist/highlight-cursor/index.mjs +6 -6
- package/dist/hooks/index.cjs +5 -5
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.cjs +190 -190
- package/dist/index.mjs +23 -23
- package/dist/ui/UIKitBadge.cjs +6 -6
- package/dist/ui/UIKitBadge.mjs +2 -2
- package/dist/ui/avatar.cjs +1 -1
- package/dist/ui/avatar.mjs +1 -1
- package/dist/ui/badge.cjs +1 -1
- package/dist/ui/badge.d.cts +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.mjs +1 -1
- package/dist/ui/button.cjs +1 -1
- package/dist/ui/button.mjs +1 -1
- package/dist/ui/card.cjs +1 -1
- package/dist/ui/card.mjs +1 -1
- package/dist/ui/checkbox.cjs +1 -1
- package/dist/ui/checkbox.mjs +1 -1
- package/dist/ui/collapsible.cjs +1 -1
- package/dist/ui/collapsible.mjs +1 -1
- package/dist/ui/drawer.cjs +1 -1
- package/dist/ui/drawer.mjs +1 -1
- package/dist/ui/dropdown.cjs +1 -1
- package/dist/ui/dropdown.mjs +1 -1
- package/dist/ui/index.cjs +107 -107
- package/dist/ui/index.mjs +17 -17
- package/dist/ui/inputs/color-input.cjs +1 -1
- package/dist/ui/inputs/color-input.mjs +1 -1
- package/dist/ui/inputs/index.cjs +11 -11
- package/dist/ui/inputs/index.mjs +3 -3
- package/dist/ui/inputs/input-numbers.cjs +1 -1
- package/dist/ui/inputs/input-numbers.mjs +1 -1
- package/dist/ui/inputs/input.cjs +1 -1
- package/dist/ui/inputs/input.d.cts +1 -1
- package/dist/ui/inputs/input.d.ts +1 -1
- package/dist/ui/inputs/input.mjs +1 -1
- package/dist/ui/inputs/number-inputs/CmInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/CmInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/DegInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/DegInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerDegInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerDegInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerRadInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/EulerRadInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/InchInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/InchInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/IntInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/IntInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/KVectorInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/KVectorInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/QuaternionInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/QuaternionInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/RadInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/RadInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/TimeInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/TimeInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/Vec3Input.cjs +1 -1
- package/dist/ui/inputs/number-inputs/Vec3Input.mjs +1 -1
- package/dist/ui/inputs/number-inputs/VectorInput.cjs +1 -1
- package/dist/ui/inputs/number-inputs/VectorInput.mjs +1 -1
- package/dist/ui/inputs/number-inputs/index.cjs +11 -11
- package/dist/ui/inputs/number-inputs/index.mjs +3 -3
- package/dist/ui/inputs/presets-input.cjs +1 -1
- package/dist/ui/inputs/presets-input.mjs +1 -1
- package/dist/ui/label.cjs +1 -1
- package/dist/ui/label.mjs +1 -1
- package/dist/ui/layout.cjs +1 -1
- package/dist/ui/layout.mjs +1 -1
- package/dist/ui/layouts/dock-layout/DockLayoutView.cjs +1 -1
- package/dist/ui/layouts/dock-layout/DockLayoutView.mjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/dock-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/dock-layout/index.cjs +1 -1
- package/dist/ui/layouts/dock-layout/index.mjs +1 -1
- package/dist/ui/layouts/index.cjs +2 -2
- package/dist/ui/layouts/index.mjs +2 -2
- package/dist/ui/layouts/liquid-layout/LayoutSlots.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LayoutSlots.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/LiquidLayoutView.mjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.cjs +1 -1
- package/dist/ui/layouts/liquid-layout/index.mjs +1 -1
- package/dist/ui/modal.cjs +1 -1
- package/dist/ui/modal.mjs +1 -1
- package/dist/ui/navigation.cjs +1 -1
- package/dist/ui/navigation.mjs +1 -1
- package/dist/ui/pagination.cjs +1 -1
- package/dist/ui/pagination.mjs +1 -1
- package/dist/ui/panel.cjs +1 -1
- package/dist/ui/panel.mjs +1 -1
- package/dist/ui/popover.cjs +1 -1
- package/dist/ui/popover.mjs +1 -1
- package/dist/ui/radio-group.cjs +1 -1
- package/dist/ui/radio-group.mjs +1 -1
- package/dist/ui/resizable.cjs +1 -1
- package/dist/ui/resizable.mjs +1 -1
- package/dist/ui/select.cjs +1 -1
- package/dist/ui/select.d.cts +1 -1
- package/dist/ui/select.d.ts +1 -1
- package/dist/ui/select.mjs +1 -1
- package/dist/ui/separator.cjs +1 -1
- package/dist/ui/separator.mjs +1 -1
- package/dist/ui/sheet.cjs +1 -1
- package/dist/ui/sheet.mjs +1 -1
- package/dist/ui/sidebar.cjs +26 -26
- package/dist/ui/sidebar.mjs +2 -2
- package/dist/ui/simple-tree-view.cjs +1 -1
- package/dist/ui/simple-tree-view.mjs +1 -1
- package/dist/ui/skeleton.cjs +1 -1
- package/dist/ui/skeleton.mjs +1 -1
- package/dist/ui/slider.cjs +1 -1
- package/dist/ui/slider.mjs +1 -1
- package/dist/ui/switch.cjs +1 -1
- package/dist/ui/switch.mjs +1 -1
- package/dist/ui/table.cjs +1 -1
- package/dist/ui/table.mjs +1 -1
- package/dist/ui/tabs.cjs +1 -1
- package/dist/ui/tabs.mjs +1 -1
- package/dist/ui/textarea.cjs +1 -1
- package/dist/ui/textarea.d.cts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/dist/ui/textarea.mjs +1 -1
- package/dist/ui/theme/ThemeToggles.cjs +1 -1
- package/dist/ui/theme/ThemeToggles.mjs +1 -1
- package/dist/ui/theme/index.cjs +1 -1
- package/dist/ui/theme/index.mjs +1 -1
- package/dist/ui/toggle-buttons.cjs +1 -1
- package/dist/ui/toggle-buttons.mjs +1 -1
- package/dist/ui/toggle-group.cjs +1 -1
- package/dist/ui/toggle-group.mjs +1 -1
- package/dist/ui/toggle.cjs +1 -1
- package/dist/ui/toggle.mjs +1 -1
- package/dist/ui/toolbar.cjs +1 -1
- package/dist/ui/toolbar.mjs +1 -1
- package/dist/ui/tooltip.cjs +1 -1
- package/dist/ui/tooltip.mjs +1 -1
- package/dist/ui/tree-view/TreeSearchBar.cjs +1 -1
- package/dist/ui/tree-view/TreeSearchBar.mjs +1 -1
- package/dist/ui/tree-view/TreeView.cjs +1 -1
- package/dist/ui/tree-view/TreeView.mjs +1 -1
- package/dist/ui/tree-view/index.cjs +6 -6
- package/dist/ui/tree-view/index.mjs +2 -2
- package/dist/ui/tree-view-legacy.cjs +9 -9
- package/dist/ui/tree-view-legacy.mjs +5 -5
- package/dist/ui/waterfall/CursorOverlay.cjs +1 -1
- package/dist/ui/waterfall/CursorOverlay.mjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.cjs +1 -1
- package/dist/ui/waterfall/TimelineEvent.mjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.cjs +1 -1
- package/dist/ui/waterfall/TimelineProcessBar.mjs +1 -1
- package/dist/ui/waterfall/Wedges.cjs +1 -1
- package/dist/ui/waterfall/Wedges.mjs +1 -1
- package/dist/ui/waterfall/index.cjs +8 -8
- package/dist/ui/waterfall/index.mjs +7 -7
- package/package.json +28 -2
- package/src/SyncScroll/README.md +283 -0
- package/src/SyncScroll/SyncScroll.tsx +361 -0
- package/src/SyncScroll/index.ts +22 -0
- package/src/SyncScroll/useSyncScroll.tsx +226 -0
- package/src/cli/dial-cli.ts +1133 -0
- package/src/dial/DialPanel.tsx +208 -0
- package/src/dial/DialProvider.example.tsx +80 -0
- package/src/dial/DialProvider.tsx +138 -0
- package/src/dial/index.ts +26 -0
- package/src/dial/wrapped-inputs/ControlledInputs.tsx +176 -0
- package/src/dial/wrapped-inputs/DialInputs.tsx +401 -0
- package/src/dial/wrapped-inputs/DialVectorInput.tsx +125 -0
- package/src/dial/wrapped-inputs/index.ts +25 -0
- package/src/highlight-cursor/cursor-context.tsx +23 -0
- package/src/highlight-cursor/cursor-provider.tsx +264 -0
- package/src/highlight-cursor/enhanced-components.tsx +16 -0
- package/src/highlight-cursor/index.ts +21 -0
- package/src/highlight-cursor/tabs-cursor-context.tsx +121 -0
- package/src/highlight-cursor/types.ts +40 -0
- package/src/highlight-cursor/with-cursor.tsx +144 -0
- package/src/hooks/clientOnly.tsx +54 -0
- package/src/hooks/cn.ts +33 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useDocument.tsx +18 -0
- package/src/hooks/useDragSelect.ts +116 -0
- package/src/hooks/useIsMobile.ts +35 -0
- package/src/hooks/useLocalStorage.ts +122 -0
- package/src/hooks/useLocation.tsx +95 -0
- package/src/hooks/useQueryParams.tsx +31 -0
- package/src/hooks/useWindow.tsx +18 -0
- package/src/index.css +5 -0
- package/src/index.ts +5 -0
- package/src/styles/.editorconfig +0 -0
- package/src/styles/theme.css +152 -0
- package/src/styles/toast.css +67 -0
- package/src/styles/variables.css +229 -0
- package/src/ui/UIKitBadge.tsx +171 -0
- package/src/ui/avatar.tsx +221 -0
- package/src/ui/badge.tsx +74 -0
- package/src/ui/button.tsx +143 -0
- package/src/ui/card.tsx +146 -0
- package/src/ui/checkbox.tsx +78 -0
- package/src/ui/collapsible.tsx +43 -0
- package/src/ui/drag-selectable/DragSelectProvider.tsx +178 -0
- package/src/ui/drag-selectable/createSelectable.tsx +43 -0
- package/src/ui/drag-selectable/index.ts +2 -0
- package/src/ui/drawer.tsx +137 -0
- package/src/ui/dropdown.tsx +707 -0
- package/src/ui/icons/MouseCursorIcons.tsx +39 -0
- package/src/ui/icons/cursor.tsx +38 -0
- package/src/ui/icons/index.ts +2 -0
- package/src/ui/index.ts +45 -0
- package/src/ui/inputs/color-input.tsx +61 -0
- package/src/ui/inputs/index.tsx +5 -0
- package/src/ui/inputs/input-numbers.tsx +394 -0
- package/src/ui/inputs/input.tsx +155 -0
- package/src/ui/inputs/number-inputs/CmInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/DegInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/EulerDegInput.tsx +14 -0
- package/src/ui/inputs/number-inputs/EulerInput.tsx +30 -0
- package/src/ui/inputs/number-inputs/EulerRadInput.tsx +14 -0
- package/src/ui/inputs/number-inputs/InchInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/IntInput.tsx +46 -0
- package/src/ui/inputs/number-inputs/KVectorInput.tsx +20 -0
- package/src/ui/inputs/number-inputs/QuaternionInput.tsx +27 -0
- package/src/ui/inputs/number-inputs/RadInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/TimeInput.tsx +26 -0
- package/src/ui/inputs/number-inputs/Vec3Input.tsx +26 -0
- package/src/ui/inputs/number-inputs/VectorInput.tsx +38 -0
- package/src/ui/inputs/number-inputs/index.ts +38 -0
- package/src/ui/inputs/presets-input.tsx +59 -0
- package/src/ui/label.tsx +35 -0
- package/src/ui/layout.tsx +43 -0
- package/src/ui/layouts/dock-layout/DockLayoutView.tsx +128 -0
- package/src/ui/layouts/dock-layout/LayoutSlots.tsx +85 -0
- package/src/ui/layouts/dock-layout/index.tsx +2 -0
- package/src/ui/layouts/index.ts +2 -0
- package/src/ui/layouts/liquid-layout/LayoutSlots.tsx +82 -0
- package/src/ui/layouts/liquid-layout/LiquidLayoutView.tsx +76 -0
- package/src/ui/layouts/liquid-layout/index.ts +1 -0
- package/src/ui/modal.tsx +211 -0
- package/src/ui/navigation.tsx +86 -0
- package/src/ui/pagination.tsx +129 -0
- package/src/ui/panel.tsx +146 -0
- package/src/ui/popover.tsx +112 -0
- package/src/ui/radio-group.tsx +63 -0
- package/src/ui/resizable.tsx +52 -0
- package/src/ui/select.tsx +365 -0
- package/src/ui/separator.tsx +26 -0
- package/src/ui/sheet.tsx +257 -0
- package/src/ui/sidebar.tsx +695 -0
- package/src/ui/simple-tree-view.tsx +604 -0
- package/src/ui/skeleton.tsx +15 -0
- package/src/ui/slider.tsx +204 -0
- package/src/ui/switch.tsx +45 -0
- package/src/ui/table.tsx +99 -0
- package/src/ui/tabs.tsx +192 -0
- package/src/ui/textarea.tsx +55 -0
- package/src/ui/theme/ThemeProvider.tsx +319 -0
- package/src/ui/theme/ThemeToggles.tsx +84 -0
- package/src/ui/theme/index.ts +21 -0
- package/src/ui/theme/themeScript.tsx +179 -0
- package/src/ui/theme/types.ts +61 -0
- package/src/ui/toast.tsx +30 -0
- package/src/ui/toggle-buttons.tsx +290 -0
- package/src/ui/toggle-group.tsx +236 -0
- package/src/ui/toggle.tsx +94 -0
- package/src/ui/toolbar.tsx +54 -0
- package/src/ui/tooltip.tsx +171 -0
- package/src/ui/tree-view/TreeSearchBar.tsx +88 -0
- package/src/ui/tree-view/TreeView.tsx +232 -0
- package/src/ui/tree-view/hooks.tsx +289 -0
- package/src/ui/tree-view/index.ts +4 -0
- package/src/ui/tree-view/types.ts +23 -0
- package/src/ui/tree-view-legacy.tsx +644 -0
- package/src/ui/version-badge.tsx +0 -0
- package/src/ui/waterfall/CursorOverlay.tsx +96 -0
- package/src/ui/waterfall/NavigationControls.tsx +42 -0
- package/src/ui/waterfall/Tick.tsx +51 -0
- package/src/ui/waterfall/TimeRuleEventDot.tsx +19 -0
- package/src/ui/waterfall/TimelineEvent.tsx +60 -0
- package/src/ui/waterfall/TimelineProcessBar.tsx +207 -0
- package/src/ui/waterfall/Wedges.tsx +67 -0
- package/src/ui/waterfall/WheelZoomContext.tsx +128 -0
- package/src/ui/waterfall/hooks/useTimelineState.tsx +134 -0
- package/src/ui/waterfall/hooks/useViewport.tsx +293 -0
- package/src/ui/waterfall/index.tsx +326 -0
- package/src/ui/waterfall/types.ts +20 -0
- package/src/ui/waterfall/utils.ts +91 -0
- package/dist/chunk-W2YAQV5N.mjs +0 -57
- package/dist/{chunk-QLCEHV4Q.mjs → chunk-2OZK5DY5.mjs} +2 -2
- package/dist/{chunk-Z35DNFRZ.cjs → chunk-7IS37C3P.cjs} +2 -2
- package/dist/{chunk-4AOAH77D.mjs → chunk-A2PCEL5S.mjs} +2 -2
- package/dist/{chunk-K4VD5PPY.mjs → chunk-BIUDC66P.mjs} +1 -1
- package/dist/{chunk-RKJR6RZU.cjs → chunk-OYNLQTHW.cjs} +1 -1
- package/dist/{chunk-VE3XLQLO.cjs → chunk-QUFZWF4E.cjs} +2 -2
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import { PropsWithChildren, ReactElement } from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../hooks";
|
|
5
|
+
|
|
6
|
+
export interface FormLayoutProps extends PropsWithChildren {
|
|
7
|
+
align?: "start" | "center" | "end" | "baseline";
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
orientation?: "label-left" | "label-top";
|
|
11
|
+
children: [ReactElement, ReactElement];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Convenience layout wrapper for demos and description/content pairs.
|
|
16
|
+
*/
|
|
17
|
+
export function FormLayout({
|
|
18
|
+
asChild,
|
|
19
|
+
className,
|
|
20
|
+
align = "center",
|
|
21
|
+
orientation = "label-top",
|
|
22
|
+
children,
|
|
23
|
+
}: FormLayoutProps) {
|
|
24
|
+
const Com = asChild ? Slot : "div";
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Com
|
|
28
|
+
className={cn(
|
|
29
|
+
{
|
|
30
|
+
"items-baseline": align === "baseline",
|
|
31
|
+
"items-center": align === "center",
|
|
32
|
+
"items-start": align === "start",
|
|
33
|
+
"items-end": align === "end",
|
|
34
|
+
"gap-xs flex flex-col items-stretch": orientation === "label-top",
|
|
35
|
+
"gap-xs grid grid-cols-[1fr_2fr] text-center": orientation === "label-left",
|
|
36
|
+
},
|
|
37
|
+
className,
|
|
38
|
+
)}
|
|
39
|
+
>
|
|
40
|
+
{children}
|
|
41
|
+
</Com>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
DockLayout,
|
|
5
|
+
DockLayoutBottom,
|
|
6
|
+
DockLayoutContent,
|
|
7
|
+
DockLayoutLeft,
|
|
8
|
+
DockLayoutRight,
|
|
9
|
+
DockLayoutTop,
|
|
10
|
+
} from "./LayoutSlots";
|
|
11
|
+
|
|
12
|
+
interface DockLayoutViewProps {
|
|
13
|
+
left?: ReactNode;
|
|
14
|
+
right?: ReactNode;
|
|
15
|
+
top?: ReactNode;
|
|
16
|
+
bottom?: ReactNode;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
leftClassName?: string;
|
|
20
|
+
rightClassName?: string;
|
|
21
|
+
topClassName?: string;
|
|
22
|
+
bottomClassName?: string;
|
|
23
|
+
contentClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const DockLayoutView = ({
|
|
27
|
+
left,
|
|
28
|
+
right,
|
|
29
|
+
top,
|
|
30
|
+
bottom,
|
|
31
|
+
children,
|
|
32
|
+
className,
|
|
33
|
+
leftClassName,
|
|
34
|
+
rightClassName,
|
|
35
|
+
topClassName,
|
|
36
|
+
bottomClassName,
|
|
37
|
+
contentClassName,
|
|
38
|
+
}: DockLayoutViewProps) => {
|
|
39
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
40
|
+
const leftRef = useRef<HTMLDivElement>(null);
|
|
41
|
+
const rightRef = useRef<HTMLDivElement>(null);
|
|
42
|
+
const bottomRef = useRef<HTMLDivElement>(null);
|
|
43
|
+
const measureRef = useRef<HTMLDivElement>(null);
|
|
44
|
+
const [isBottomFullWidth, setIsBottomFullWidth] = useState(false);
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const checkBottomWidth = () => {
|
|
48
|
+
if (!containerRef.current || !bottom || !measureRef.current) return;
|
|
49
|
+
|
|
50
|
+
const containerWidth = containerRef.current.offsetWidth;
|
|
51
|
+
const leftWidth = leftRef.current?.offsetWidth || 0;
|
|
52
|
+
const rightWidth = rightRef.current?.offsetWidth || 0;
|
|
53
|
+
const availableWidth = containerWidth - leftWidth - rightWidth;
|
|
54
|
+
|
|
55
|
+
const bottomActualWidth = measureRef.current.scrollWidth;
|
|
56
|
+
|
|
57
|
+
setIsBottomFullWidth(bottomActualWidth > 0 && availableWidth < bottomActualWidth);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const resizeObserver = new ResizeObserver(checkBottomWidth);
|
|
61
|
+
|
|
62
|
+
if (containerRef.current) {
|
|
63
|
+
resizeObserver.observe(containerRef.current);
|
|
64
|
+
}
|
|
65
|
+
if (leftRef.current) {
|
|
66
|
+
resizeObserver.observe(leftRef.current);
|
|
67
|
+
}
|
|
68
|
+
if (rightRef.current) {
|
|
69
|
+
resizeObserver.observe(rightRef.current);
|
|
70
|
+
}
|
|
71
|
+
if (measureRef.current) {
|
|
72
|
+
resizeObserver.observe(measureRef.current);
|
|
73
|
+
checkBottomWidth();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return () => {
|
|
77
|
+
resizeObserver.disconnect();
|
|
78
|
+
};
|
|
79
|
+
}, [bottom, left, right]);
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<DockLayout ref={containerRef} className={className}>
|
|
83
|
+
{bottom && (
|
|
84
|
+
<div
|
|
85
|
+
ref={measureRef}
|
|
86
|
+
className="pointer-events-none absolute -top-[9999px] left-0 opacity-0"
|
|
87
|
+
style={{ width: "max-content" }}
|
|
88
|
+
>
|
|
89
|
+
<DockLayoutBottom className={bottomClassName}>{bottom}</DockLayoutBottom>
|
|
90
|
+
</div>
|
|
91
|
+
)}
|
|
92
|
+
|
|
93
|
+
{top && <DockLayoutTop className={topClassName}>{top}</DockLayoutTop>}
|
|
94
|
+
|
|
95
|
+
<div className="flex flex-1 overflow-hidden">
|
|
96
|
+
{left && (
|
|
97
|
+
<div ref={leftRef}>
|
|
98
|
+
<DockLayoutLeft className={leftClassName}>{left}</DockLayoutLeft>
|
|
99
|
+
</div>
|
|
100
|
+
)}
|
|
101
|
+
|
|
102
|
+
<div className="flex flex-1 flex-col overflow-hidden">
|
|
103
|
+
<DockLayoutContent className={contentClassName}>{children}</DockLayoutContent>
|
|
104
|
+
|
|
105
|
+
{bottom && !isBottomFullWidth && (
|
|
106
|
+
<div className="flex justify-center">
|
|
107
|
+
<DockLayoutBottom ref={bottomRef} className={bottomClassName}>
|
|
108
|
+
{bottom}
|
|
109
|
+
</DockLayoutBottom>
|
|
110
|
+
</div>
|
|
111
|
+
)}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
{right && (
|
|
115
|
+
<div ref={rightRef}>
|
|
116
|
+
<DockLayoutRight className={rightClassName}>{right}</DockLayoutRight>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
</div>
|
|
120
|
+
|
|
121
|
+
{bottom && isBottomFullWidth && (
|
|
122
|
+
<DockLayoutBottom ref={bottomRef} className={bottomClassName}>
|
|
123
|
+
{bottom}
|
|
124
|
+
</DockLayoutBottom>
|
|
125
|
+
)}
|
|
126
|
+
</DockLayout>
|
|
127
|
+
);
|
|
128
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../../../hooks";
|
|
6
|
+
|
|
7
|
+
export const DockLayout = forwardRef<HTMLDivElement, ComponentProps<"div">>(
|
|
8
|
+
({ className, ...props }, ref) => {
|
|
9
|
+
return (
|
|
10
|
+
<div
|
|
11
|
+
ref={ref}
|
|
12
|
+
{...props}
|
|
13
|
+
className={cn("relative flex h-full w-full flex-col overflow-hidden", className)}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
DockLayout.displayName = "DockLayout";
|
|
20
|
+
|
|
21
|
+
interface DockLayoutChildProps extends ComponentProps<"div"> {
|
|
22
|
+
asChild?: boolean;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function DockLayoutContent({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
26
|
+
return (
|
|
27
|
+
<div
|
|
28
|
+
{...props}
|
|
29
|
+
className={cn(
|
|
30
|
+
"relative flex flex-1 flex-col items-center justify-center overflow-auto",
|
|
31
|
+
className,
|
|
32
|
+
)}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function DockLayoutLeft({ className, asChild, ...props }: Readonly<DockLayoutChildProps>) {
|
|
38
|
+
const Comp = asChild ? Slot : "div";
|
|
39
|
+
return (
|
|
40
|
+
<Comp
|
|
41
|
+
{...props}
|
|
42
|
+
className={cn(
|
|
43
|
+
"bg-bg-primary flex h-full flex-shrink-0 flex-col items-start gap-4",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function DockLayoutTop({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
51
|
+
return (
|
|
52
|
+
<div
|
|
53
|
+
{...props}
|
|
54
|
+
className={cn(
|
|
55
|
+
"absolute top-4 left-1/2 z-20 flex -translate-x-1/2 transform items-start justify-center",
|
|
56
|
+
className,
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function DockLayoutRight({ className, asChild, ...props }: Readonly<DockLayoutChildProps>) {
|
|
63
|
+
const Comp = asChild ? Slot : "div";
|
|
64
|
+
return (
|
|
65
|
+
<Comp
|
|
66
|
+
{...props}
|
|
67
|
+
className={cn("bg-bg-primary flex h-full flex-shrink-0 flex-col items-end gap-4", className)}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const DockLayoutBottom = forwardRef<HTMLDivElement, DockLayoutChildProps>(
|
|
73
|
+
({ className, asChild, ...props }, ref) => {
|
|
74
|
+
const Comp = asChild ? Slot : "div";
|
|
75
|
+
return (
|
|
76
|
+
<Comp
|
|
77
|
+
ref={ref}
|
|
78
|
+
{...props}
|
|
79
|
+
className={cn("bg-bg-primary inline-flex w-full flex-shrink-0 justify-center", className)}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
DockLayoutBottom.displayName = "DockLayoutBottom";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../../../hooks";
|
|
5
|
+
|
|
6
|
+
export function LiquidLayout({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
7
|
+
return (
|
|
8
|
+
<div
|
|
9
|
+
{...props}
|
|
10
|
+
className={cn(
|
|
11
|
+
"pointer-events-none relative z-1 grid h-full w-full grid-cols-3 grid-rows-[1fr_auto] flex-col justify-between overflow-hidden p-4",
|
|
12
|
+
className,
|
|
13
|
+
)}
|
|
14
|
+
/>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface LiquidLayoutChildProps extends ComponentProps<"div"> {
|
|
19
|
+
asChild?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function LiquidLayoutContent({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
23
|
+
return <div {...props} className={cn("pointer-events-auto absolute inset-0 -z-1", className)} />;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function LiquidLayoutLeft({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
27
|
+
return (
|
|
28
|
+
<div
|
|
29
|
+
{...props}
|
|
30
|
+
className={cn(
|
|
31
|
+
"order-2 col-start-1 flex flex-col items-start gap-4 [&>*]:pointer-events-auto",
|
|
32
|
+
className,
|
|
33
|
+
)}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function LiquidLayoutTop({ className, ...props }: Readonly<ComponentProps<"div">>) {
|
|
39
|
+
return (
|
|
40
|
+
<div
|
|
41
|
+
{...props}
|
|
42
|
+
className={cn(
|
|
43
|
+
"order-3 col-start-2 flex items-start justify-center [&>*]:pointer-events-auto",
|
|
44
|
+
className,
|
|
45
|
+
)}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function LiquidLayoutRight({
|
|
51
|
+
className,
|
|
52
|
+
asChild,
|
|
53
|
+
...props
|
|
54
|
+
}: Readonly<LiquidLayoutChildProps>) {
|
|
55
|
+
const Comp = asChild ? Slot : "div";
|
|
56
|
+
return (
|
|
57
|
+
<Comp
|
|
58
|
+
{...props}
|
|
59
|
+
className={cn(
|
|
60
|
+
"order-4 col-start-3 flex flex-col items-end gap-4 [&>*]:pointer-events-auto",
|
|
61
|
+
className,
|
|
62
|
+
)}
|
|
63
|
+
/>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function LiquidLayoutBottom({
|
|
68
|
+
className,
|
|
69
|
+
asChild,
|
|
70
|
+
...props
|
|
71
|
+
}: Readonly<LiquidLayoutChildProps>) {
|
|
72
|
+
const Comp = asChild ? Slot : "div";
|
|
73
|
+
return (
|
|
74
|
+
<Comp
|
|
75
|
+
{...props}
|
|
76
|
+
className={cn(
|
|
77
|
+
"order-5 col-span-3 col-start-1 flex justify-center [&>*]:pointer-events-auto",
|
|
78
|
+
className,
|
|
79
|
+
)}
|
|
80
|
+
/>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
LiquidLayout,
|
|
5
|
+
LiquidLayoutBottom,
|
|
6
|
+
LiquidLayoutContent,
|
|
7
|
+
LiquidLayoutLeft,
|
|
8
|
+
LiquidLayoutRight,
|
|
9
|
+
LiquidLayoutTop,
|
|
10
|
+
} from "./LayoutSlots";
|
|
11
|
+
import { cn } from "../../../hooks";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for the LiquidLayoutView component
|
|
15
|
+
*/
|
|
16
|
+
interface LiquidLayoutViewProps {
|
|
17
|
+
/** Content to display in the left slot */
|
|
18
|
+
left?: ReactNode;
|
|
19
|
+
/** Content to display in the right slot */
|
|
20
|
+
right?: ReactNode;
|
|
21
|
+
/** Content to display in the top slot */
|
|
22
|
+
top?: ReactNode;
|
|
23
|
+
/** Content to display in the bottom slot */
|
|
24
|
+
bottom?: ReactNode;
|
|
25
|
+
/** Main content to display in the center */
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
/** Additional CSS classes to apply to the root element */
|
|
28
|
+
className?: string;
|
|
29
|
+
/** CSS classes to apply to the left slot */
|
|
30
|
+
leftClassName?: string;
|
|
31
|
+
/** CSS classes to apply to the right slot */
|
|
32
|
+
rightClassName?: string;
|
|
33
|
+
/** CSS classes to apply to the top slot */
|
|
34
|
+
topClassName?: string;
|
|
35
|
+
/** CSS classes to apply to the bottom slot */
|
|
36
|
+
bottomClassName?: string;
|
|
37
|
+
/** CSS classes to apply to the content slot */
|
|
38
|
+
contentClassName?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A flexible liquid layout component with slots for left, right, top, bottom, and center content.
|
|
43
|
+
* The layout adapts to different content and screen sizes while maintaining proper positioning.
|
|
44
|
+
*
|
|
45
|
+
* @param props - The component props
|
|
46
|
+
* @returns A liquid layout with positioned content slots
|
|
47
|
+
*/
|
|
48
|
+
export const LiquidLayoutView = ({
|
|
49
|
+
left,
|
|
50
|
+
right,
|
|
51
|
+
top,
|
|
52
|
+
bottom,
|
|
53
|
+
children,
|
|
54
|
+
className,
|
|
55
|
+
leftClassName,
|
|
56
|
+
rightClassName,
|
|
57
|
+
topClassName,
|
|
58
|
+
bottomClassName,
|
|
59
|
+
contentClassName,
|
|
60
|
+
}: LiquidLayoutViewProps) => {
|
|
61
|
+
return (
|
|
62
|
+
<LiquidLayout className={className}>
|
|
63
|
+
<LiquidLayoutContent
|
|
64
|
+
className={cn("absolute flex flex-col items-center justify-center", contentClassName)}
|
|
65
|
+
>
|
|
66
|
+
{children}
|
|
67
|
+
</LiquidLayoutContent>
|
|
68
|
+
{bottom && (
|
|
69
|
+
<LiquidLayoutBottom className={cn("mt-4", bottomClassName)}>{bottom}</LiquidLayoutBottom>
|
|
70
|
+
)}
|
|
71
|
+
{right && <LiquidLayoutRight className={rightClassName}>{right}</LiquidLayoutRight>}
|
|
72
|
+
{left && <LiquidLayoutLeft className={leftClassName}>{left}</LiquidLayoutLeft>}
|
|
73
|
+
{top && <LiquidLayoutTop className={topClassName}>{top}</LiquidLayoutTop>}
|
|
74
|
+
</LiquidLayout>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LiquidLayoutView";
|
package/src/ui/modal.tsx
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { XIcon } from "lucide-react";
|
|
4
|
+
import { type ComponentProps } from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../hooks";
|
|
7
|
+
|
|
8
|
+
type ModalProps = ComponentProps<typeof DialogPrimitive.Root>;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Modal root based on Radix Dialog.
|
|
12
|
+
*/
|
|
13
|
+
function Modal({ ...props }: ModalProps) {
|
|
14
|
+
return <DialogPrimitive.Root data-slot="modal" {...props} />;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type ModalTriggerProps = ComponentProps<typeof DialogPrimitive.Trigger>;
|
|
18
|
+
|
|
19
|
+
/** Trigger element that opens the modal. */
|
|
20
|
+
function ModalTrigger({ ...props }: ModalTriggerProps) {
|
|
21
|
+
return <DialogPrimitive.Trigger data-slot="modal-trigger" {...props} />;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type ModalPortalProps = ComponentProps<typeof DialogPrimitive.Portal>;
|
|
25
|
+
|
|
26
|
+
/** Portal for modal content/overlay. */
|
|
27
|
+
function ModalPortal({ ...props }: ModalPortalProps) {
|
|
28
|
+
return <DialogPrimitive.Portal data-slot="modal-portal" {...props} />;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type ModalCloseProps = ComponentProps<typeof DialogPrimitive.Close>;
|
|
32
|
+
|
|
33
|
+
/** Close control for the modal. */
|
|
34
|
+
function ModalClose({ ...props }: ModalCloseProps) {
|
|
35
|
+
return <DialogPrimitive.Close data-slot="modal-close" {...props} />;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const modalOverlayVariants = cva([
|
|
39
|
+
"fixed",
|
|
40
|
+
"inset-0",
|
|
41
|
+
"z-10",
|
|
42
|
+
"bg-bg-mask",
|
|
43
|
+
"transition-all",
|
|
44
|
+
"duration-200",
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
type ModalOverlayProps = ComponentProps<typeof DialogPrimitive.Overlay>;
|
|
48
|
+
|
|
49
|
+
/** Fullscreen overlay displayed behind the modal. */
|
|
50
|
+
function ModalOverlay({ className, ...props }: ModalOverlayProps) {
|
|
51
|
+
return (
|
|
52
|
+
<DialogPrimitive.Overlay
|
|
53
|
+
data-slot="modal-overlay"
|
|
54
|
+
className={cn(modalOverlayVariants(), className)}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const modalContentVariants = cva([
|
|
61
|
+
"pb-xl",
|
|
62
|
+
"px-xl",
|
|
63
|
+
"bg-bg-primary",
|
|
64
|
+
"rounded-uk-xl",
|
|
65
|
+
"shadow-[0_4px_16px_0_var(--color-shadow-secondary)]",
|
|
66
|
+
"duration-200",
|
|
67
|
+
"transition-all",
|
|
68
|
+
"fixed",
|
|
69
|
+
"translate-x-[-50%]",
|
|
70
|
+
"translate-y-[-50%]",
|
|
71
|
+
"z-11",
|
|
72
|
+
"left-1/2",
|
|
73
|
+
"top-1/2",
|
|
74
|
+
"data-[state=open]:animate-in",
|
|
75
|
+
"data-[state=closed]:animate-out",
|
|
76
|
+
"data-[state=closed]:fade-out-0",
|
|
77
|
+
"data-[state=open]:fade-in-0",
|
|
78
|
+
"data-[state=closed]:zoom-out-95",
|
|
79
|
+
"data-[state=open]:zoom-in-95",
|
|
80
|
+
"liquid:liquid-bg",
|
|
81
|
+
]);
|
|
82
|
+
|
|
83
|
+
interface ModalContentProps extends ComponentProps<typeof DialogPrimitive.Content> {
|
|
84
|
+
showCloseButton?: boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Modal content panel with optional close button.
|
|
89
|
+
*/
|
|
90
|
+
function ModalContent({
|
|
91
|
+
className,
|
|
92
|
+
children,
|
|
93
|
+
showCloseButton = true,
|
|
94
|
+
...props
|
|
95
|
+
}: ModalContentProps) {
|
|
96
|
+
return (
|
|
97
|
+
<ModalPortal>
|
|
98
|
+
<ModalOverlay />
|
|
99
|
+
<DialogPrimitive.Content
|
|
100
|
+
data-slot="modal-content"
|
|
101
|
+
className={cn(modalContentVariants(), className)}
|
|
102
|
+
{...props}
|
|
103
|
+
>
|
|
104
|
+
{children}
|
|
105
|
+
{showCloseButton && (
|
|
106
|
+
<DialogPrimitive.Close
|
|
107
|
+
data-slot="modal-close"
|
|
108
|
+
className={cn(
|
|
109
|
+
"absolute",
|
|
110
|
+
"right-[16px]",
|
|
111
|
+
"top-[16px]",
|
|
112
|
+
"w-[16px]",
|
|
113
|
+
"h-[16px]",
|
|
114
|
+
"rounded-uk-sm",
|
|
115
|
+
"cursor-pointer",
|
|
116
|
+
"hover:text-icon-highlight",
|
|
117
|
+
"text-icon-primary",
|
|
118
|
+
"flex",
|
|
119
|
+
"items-center",
|
|
120
|
+
"justify-center",
|
|
121
|
+
)}
|
|
122
|
+
>
|
|
123
|
+
<XIcon />
|
|
124
|
+
<span className="sr-only">Close</span>
|
|
125
|
+
</DialogPrimitive.Close>
|
|
126
|
+
)}
|
|
127
|
+
</DialogPrimitive.Content>
|
|
128
|
+
</ModalPortal>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
type ModalHeaderProps = ComponentProps<"div">;
|
|
133
|
+
|
|
134
|
+
/** Header container inside modal. */
|
|
135
|
+
function ModalHeader({ className, ...props }: ModalHeaderProps) {
|
|
136
|
+
return <div data-slot="modal-header" className={cn("flex flex-col", className)} {...props} />;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
type ModalTitleProps = ComponentProps<typeof DialogPrimitive.Title>;
|
|
140
|
+
|
|
141
|
+
/** Title element for the modal. */
|
|
142
|
+
function ModalTitle({ className, ...props }: ModalTitleProps) {
|
|
143
|
+
return (
|
|
144
|
+
<DialogPrimitive.Title
|
|
145
|
+
data-slot="modal-title"
|
|
146
|
+
className={cn(
|
|
147
|
+
"text-text-highlight",
|
|
148
|
+
"text-uk-lg",
|
|
149
|
+
"leading-uk-lg",
|
|
150
|
+
"font-medium",
|
|
151
|
+
"py-lg",
|
|
152
|
+
"px-xl",
|
|
153
|
+
"text-center",
|
|
154
|
+
className,
|
|
155
|
+
)}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
type ModalDescriptionProps = ComponentProps<typeof DialogPrimitive.Description>;
|
|
162
|
+
|
|
163
|
+
/** Secondary descriptive text within the modal. */
|
|
164
|
+
function ModalDescription({ className, ...props }: ModalDescriptionProps) {
|
|
165
|
+
return (
|
|
166
|
+
<DialogPrimitive.Description
|
|
167
|
+
data-slot="modal-description"
|
|
168
|
+
className={cn("text-text-primary", "text-uk-md", "leading-uk-md", "text-start", className)}
|
|
169
|
+
{...props}
|
|
170
|
+
/>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
type ModalFooterProps = ComponentProps<"div">;
|
|
175
|
+
|
|
176
|
+
/** Footer row aligning actions to the end. */
|
|
177
|
+
function ModalFooter({ className, ...props }: ModalFooterProps) {
|
|
178
|
+
return (
|
|
179
|
+
<div
|
|
180
|
+
data-slot="modal-footer"
|
|
181
|
+
className={cn("w-full", "flex", "justify-end", "gap-xs", className)}
|
|
182
|
+
{...props}
|
|
183
|
+
/>
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {
|
|
188
|
+
Modal,
|
|
189
|
+
ModalTrigger,
|
|
190
|
+
ModalPortal,
|
|
191
|
+
ModalOverlay,
|
|
192
|
+
ModalContent,
|
|
193
|
+
ModalHeader,
|
|
194
|
+
ModalTitle,
|
|
195
|
+
ModalDescription,
|
|
196
|
+
ModalFooter,
|
|
197
|
+
ModalClose,
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export type {
|
|
201
|
+
ModalProps,
|
|
202
|
+
ModalTriggerProps,
|
|
203
|
+
ModalPortalProps,
|
|
204
|
+
ModalOverlayProps,
|
|
205
|
+
ModalContentProps,
|
|
206
|
+
ModalHeaderProps,
|
|
207
|
+
ModalTitleProps,
|
|
208
|
+
ModalDescriptionProps,
|
|
209
|
+
ModalFooterProps,
|
|
210
|
+
ModalCloseProps,
|
|
211
|
+
};
|