New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@tdcerhverv/dialog

Package Overview
Dependencies
Maintainers
29
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@tdcerhverv/dialog

Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks

unpublished
latest
Source
npmnpm
Version
1.3.3
Version published
Maintainers
29
Created
Source

Dialog Component

Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks.

Example of usage

import { Dialog, DialogButtonGroup } from '@tdcerhverv/dialog';
import { TextButton, DefaultButton } from '@tdcerhverv/button';

const DialogComponent = () => {
  const $submitButton = React.createRef();

  const [active, setActive] = React.useState(false);

  const toggle = React.useCallback(() => {
    setActive(s => !s);
  }, []);

  const handleCancel = () => {
    // Handle cancel here
    toggle();
  };
  const handleSubmit = () => {
    // Handle submit here
  };

  return (
    <Dialog
      active={active}
      closeLabel="Close"
      heading="Delete user?"
      description="This action cannot be undone."
      handleSubmit={handleSubmit}
      handleCancel={handleCancel}
      autoFocus={$submitButton}
    >
      <DialogButtonGroup>
        <TextButton type="button" onClick={handleCancel}>
          Cancel
        </TextButton>
        <DefaultButton ref={$submitButton} type="submit">
          Delete
        </DefaultButton>
      </DialogButtonGroup>
    </Dialog>
  );
};

Props

interface DialogProps extends HTMLAttributes<HTMLDivElement> {
  active: boolean;
  autoFocus?: React.RefObject<HTMLElement>;
  children: ReactElement;
  closeLabel?: string;
  description?: string;
  dialogClassName?: string;
  handleCancel?: () => void;
  handleSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
  heading?: ReactNode;
  overlayClassName?: string;
}
  • Figma / Shared Components / Dialog
  • Zeroheight

FAQs

Package last updated on 11 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts