Add dialog components (#22)

This commit is contained in:
Lukas Senionis
2022-10-02 04:41:47 +03:00
committed by GitHub
parent 4cbb30c21c
commit c910dbde79
3 changed files with 69 additions and 19 deletions

View File

@@ -1,22 +1,8 @@
import { CSSProperties, FC, RefAttributes } from 'react';
import { FC } from 'react';
import { DialogButton, DialogButtonProps } from "./Dialog";
import { CommonUIModule } from '../webpack';
import { FooterLegendProps } from './FooterLegend';
export interface DialogButtonProps extends RefAttributes<HTMLDivElement>, FooterLegendProps {
label?: string;
style?: CSSProperties;
className?: string;
noFocusRing?: boolean;
description?: string;
layout?: 'below';
onClick?(e: MouseEvent): void;
disabled?: boolean;
bottomSeparator?: boolean;
export interface ButtonProps extends DialogButtonProps {
}
export const DialogButton = Object.values(CommonUIModule).find(
(mod: any) =>
mod?.render?.toString()?.includes('Object.assign({type:"button"') &&
mod?.render?.toString()?.includes('DialogButton'),
) as FC<DialogButtonProps>;
// Button isn't exported, so call DialogButton to grab it
export const Button = (DialogButton as any)?.render({}).type as FC<ButtonProps>;