export more stuff, replace button component with actual button and move the old one to ButtonItem

This commit is contained in:
AAGaming
2022-05-25 20:26:30 -04:00
parent 3c627269c1
commit 0303724794
5 changed files with 72 additions and 9 deletions

View File

@@ -3,14 +3,25 @@ import { FC } from 'react';
import { CommonUIModule } from '../webpack';
interface ButtonProps {
label?: string;
description?: string;
layout?: 'below';
onClick?(e: MouseEvent): void;
className?: string;
noFocusRing?: boolean;
disabled?: boolean;
bottomSeparator?: boolean;
onClick?(e: MouseEvent): void;
onPointerDown?(e: PointerEvent): void;
onPointerUp?(e: PointerEvent): void;
onPointerCancel?(e: PointerEvent): void;
onMouseDown?(e: PointerEvent): void;
onMouseUp?(e: MouseEvent): void;
onTouchStart?(e: TouchEvent): void;
onTouchEnd?(e: TouchEvent): void;
onTouchCancel?(e: TouchEvent): void;
onSubmit?(e: SubmitEvent): void;
}
export const Button = Object.values(CommonUIModule).find((mod: any) =>
mod?.render?.toString()?.includes('childrenContainerWidth:"min"'),
) as FC<ButtonProps>;
const DialogButton = Object.values(CommonUIModule).find((mod: any) =>
mod?.render?.toString()?.includes('Object.assign({type:"button"') && mod?.render?.toString()?.includes('DialogButton')
) as any;
// Button isn't exported, so call DialogButton to grab it
export const Button = DialogButton!.render({}).type as FC<ButtonProps> // its actually a forwarded ref but that doesn't really matter in usage