Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@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
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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.