Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@catastrophee/ui
Advanced tools
@catastrophee/ui is a set of React components. These componenets are currently in beta. Use at your own risk
Installing uicommon on your project
npm install --save @catastrophee/ui
or
yarn add @catastrophee/ui
import { Checkbox } from '@catastrophee/ui';
<Checkbox ...props />
Each component has its own README, please refer to those for more information.
Ideally, you shouldn't need to overwrite styles. But if you must, each component takes a prop called style. The style prop is typed.
To know the key you need to use to replace the style, right click on your component and look for data-style attribute on the html tag. For instance, if data-style="list" you can replace the background color with:
<Component style={{ list: { backgroundColor: "green"}}}>
To run examples: From project root folder:
yarn install
yarn run storybook
Note Stories are availables in the files with .stories extensions
For styling, use glamor.
Always sort your keys.
Always put styles in the same file. Usually right after imports, on top. Please don't create one file for style and one file for component. Each component should be one file, easy to use. Default styles should be called defaultStyles.
Always allow style overwrites. For instance, each component should start with const styles = merge({}, defaultStyles, style);
and components should always take a style prop.
Every HTML tag should contain a data-style attribute with the key for that style. If the style has no styles, still create the key but leave it empty
For all styles add proper typing. For instance, let say your component looks like this:
<div>
<span>{title}</span>
</div>
Once you add styles it should look like this
const defaultStyles = {
container: {},
title: {},
};
....
<div {...css(defaultStyles.container)}>
<span {...css(defaultStyles.title)}>{title}</span>
</div>
Once you allow overwrite styles it should look like this
const defaultStyles = {
container: {},
title: {},
};
const styles = merge({}, defaultStyles, props.style);
render() {
<div {...css(styles.container)}>
<span {...css(styles.title)}>{title}</span>
</div>
}
Let people know how to overwrite styles
const defaultStyles = {
container: {},
title: {},
};
interface StylesType {
container: CssPropertyType,
title: CssPropertyType,
}
....
const styles = merge({}, defaultStyles, props.style);
render() {
<div {...css(styles.container)} data-style="container">
<span {...css(styles.title)} data-style="title">{title}</span>
</div>
}
Please take a look at existing components for examples
cd packagaes/ui
yarn install
yarn publish
FAQs
Common UI Components
The npm package @catastrophee/ui receives a total of 0 weekly downloads. As such, @catastrophee/ui popularity was classified as not popular.
We found that @catastrophee/ui demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.