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.
@clds/common-definitions
Advanced tools
Common interfaces/types for other packages.
Install the package using Yarn:
pnpm install @clds/common-definitions
Interface for props of all UI components.
Interface for props of all form field components (requires implementation of mixed field control).
Interface for props of components that can be wrapped with styled() from styled-components.
Mixed control mode refers to how the component deals with specific state that is required by the component. There are two types of components:
useState()
call)useState()
call) is defined higher in the component hierarchy.Mixed control mode is about making the component to support both cases:
Design system components should expose useful API that supports both use cases at the same time.
For example, when creating <DropdownMenu items={...}/>
we don't want control the opened state, we just expect that the dropdown opens on click and closes when menu item is selected.
But there could be something special, like "in-app onboarding", when we want to open this menu programatically.
Then we need something like <DropdownMenu isOpened={stateWeControl} onOpenedChange={ourOwnLogic} items={...}/>
.
MixedControlProps
is a group of types that will help to create those props in the conventional way.
The goal is to support type-level API consistency of components.
We cover all naming conventions and forbid impossible state like having defaultValue and value at the same time. There are 3 main types:
ExplicitMixedControlProps
ImplicitMixedControlProps
ExplicitMixedControlProps
can be problematic, for example some props are additional, so forcing ie. <DropdownMenu defaultOpened={false}
seems an overkill since
for DropdownMenu defaultOpened should be just false and passing it explicitly isn't convenient.value
is also provided)ImplicitTraceableMixedControlProps
<DropdownMenu onFocusedIdChange={analytics.track('focused')} ... />
but please use it carefully to not encourage trying to use this prop as a source of truth.Import one of the interfaces and extend.
This library follows Semantic Versioning.
See LICENSE
FAQs
Common Design System TypeScript definitions
The npm package @clds/common-definitions receives a total of 1,193 weekly downloads. As such, @clds/common-definitions popularity was classified as popular.
We found that @clds/common-definitions 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.