Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+38
-1
@@ -1,5 +1,10 @@
|
||||
// @subframe/sync-disable
|
||||
"use client";
|
||||
import React from "react";
|
||||
import { Drawer as DrawerComponent } from "./Drawer";
|
||||
import { MODAL_LAYER_CLASS } from "../../layers";
|
||||
import { DRAWER_CONTENT_FULL_FROM_RIGHT_MOTION_CLASS, DRAWER_CONTENT_MOTION_CLASS, DRAWER_OVERLAY_MOTION_CLASS } from "../../modal-motion";
|
||||
import * as SubframeUtils from "../../utils";
|
||||
|
||||
/**
|
||||
* Add wrapper components and business logic here.
|
||||
@@ -7,4 +12,36 @@ import { Drawer as DrawerComponent } from "./Drawer";
|
||||
* Learn more: https://docs.subframe.com/concepts/syncing-components#wrapping-components
|
||||
*/
|
||||
|
||||
export const Drawer = DrawerComponent;
|
||||
const DrawerRoot = React.forwardRef<
|
||||
React.ElementRef<typeof DrawerComponent>,
|
||||
React.ComponentProps<typeof DrawerComponent>
|
||||
>(function DrawerRoot({ className, ...otherProps }, ref) {
|
||||
return (
|
||||
<DrawerComponent
|
||||
className={SubframeUtils.twClassNames(MODAL_LAYER_CLASS, DRAWER_OVERLAY_MOTION_CLASS, className)}
|
||||
data-ui-layer="modal"
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
const DrawerContent = React.forwardRef<
|
||||
React.ElementRef<typeof DrawerComponent.Content>,
|
||||
React.ComponentProps<typeof DrawerComponent.Content> & { motionDirection?: "from-right" | "full-from-right" }
|
||||
>(function DrawerContent({ className, motionDirection = "from-right", ...otherProps }, ref) {
|
||||
return (
|
||||
<DrawerComponent.Content
|
||||
className={SubframeUtils.twClassNames(
|
||||
motionDirection === "full-from-right" ? DRAWER_CONTENT_FULL_FROM_RIGHT_MOTION_CLASS : DRAWER_CONTENT_MOTION_CLASS,
|
||||
className
|
||||
)}
|
||||
ref={ref}
|
||||
{...otherProps}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export const Drawer = Object.assign(DrawerRoot, {
|
||||
Content: DrawerContent,
|
||||
});
|
||||
Reference in new issue
Block a user