Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@zendeskgarden/container-modal
Advanced tools
Containers relating to modal in the Garden Design System
This package includes containers relating to modals in the Garden Design System.
npm install @zendeskgarden/container-modal
This container implements the dialog design pattern and can be used to build a modal component. Check out storybook for live examples.
import { useRef } from 'react';
import { useModal } from '@zendeskgarden/container-modal';
const Modal = () => {
const [isModalVisible, setModalVisibility] = useState(false);
const modalRef = useRef(null);
const { getBackdropProps, getModalProps, getTitleProps, getContentProps, getCloseProps } =
useModal({ onClose: () => setModalVisibility(false), modalRef });
return (
<>
<button onClick={() => setModalVisibility(!isModalVisible)}>Open Modal</button>
{isModalVisible && (
<div
{...getBackdropProps({
style: {
background: 'rgba(0,0,0,0.2)',
position: 'fixed',
top: '0',
right: '0',
bottom: '0',
left: '0',
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}
})}
>
<div
{...getModalProps({
ref: modalRef,
style: {
padding: '20px',
background: '#fff',
minWidth: '500px',
minHeight: '400px',
position: 'relative'
}
})}
>
<h1 {...getTitleProps()}>Example header</h1>
<section {...getContentProps()}>
<p>Modal contents</p>
<input placeholder="focusable content" />
<button>Submit</button>
</section>
<button
{...getCloseProps({
'aria-label': 'Schließen Sie Modal',
style: { position: 'absolute', top: '20px', right: '20px', cursor: 'pointer' }
})}
>
X
</button>
</div>
</div>
)}
</>
);
};
import { useRef } from 'react';
import { ModalContainer } from '@zendeskgarden/container-modal';
const Modal = () => {
const [isModalVisible, setModalVisibility] = useState(false);
const modalRef = useRef(null);
return (
<>
<button onClick={() => setModalVisibility(!isModalVisible)}>Open Modal</button>
<ModalContainer modalRef={modalRef} onClose={() => setModalVisibility(false)}>
{({ getBackdropProps, getModalProps, getTitleProps, getContentProps, getCloseProps }) => {
return (
isModalVisible && (
<div
{...getBackdropProps({
style: {
background: 'rgba(0,0,0,0.2)',
position: 'fixed',
top: '0',
right: '0',
bottom: '0',
left: '0',
display: 'flex',
justifyContent: 'center',
alignItems: 'center'
}
})}
>
<div
{...getModalProps({
ref: modalRef,
style: {
padding: '20px',
background: '#fff',
minWidth: '500px',
minHeight: '400px',
position: 'relative'
}
})}
>
<h1 {...getTitleProps()}>Example header</h1>
<section {...getContentProps()}>
<p>Modal contents</p>
<input placeholder="focusable content" />
<button>Submit</button>
</section>
<button
{...getCloseProps({
'aria-label': 'Schließen Sie Modal',
style: {
position: 'absolute',
top: '20px',
right: '20px',
cursor: 'pointer'
}
})}
>
X
</button>
</div>
</div>
)
);
}}
</ModalContainer>
</>
);
};
FAQs
Containers relating to modal in the Garden Design System
The npm package @zendeskgarden/container-modal receives a total of 133,931 weekly downloads. As such, @zendeskgarden/container-modal popularity was classified as popular.
We found that @zendeskgarden/container-modal demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.