
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@reportportal/ui-kit
Advanced tools
This library is designed to reflect ReportPortal Design System components as React components.
alpha versions available
Install the package into your project using your favourite package manager:
Using npm
npm install @reportportal/ui-kit
or using yarn
yarn add @reportportal/ui-kit
or using pnpm
pnpm add @reportportal/ui-kit
import '@reportportal/ui-kit/dist/style.css';
import { Button } from '@reportportal/ui-kit';
const MyComponent = () => (
<Button>Button</Button>
);
Note: In the future we plan to calibrate the build process to prebuild styles individually for each component and enable tree-shaking.
All components are provided with the light
theme by default.
To use the dark
theme, you need to wrap your application with the ThemeProvider
component and pass the dark
theme as a prop:
import { ThemeProvider, Button } from '@reportportal/ui-kit';
const MyComponent = () => (
<ThemeProvider theme="dark">
<Button>Dark theme button</Button>
</ThemeProvider>
);
ThemeProvider
can be nested to provide different themes for different parts of the application if needed.
import { ThemeProvider, Button } from '@reportportal/ui-kit';
const MyComponent = () => (
<ThemeProvider theme="light">
<Button>Light theme button</Button>
<ThemeProvider theme="dark">
<Button>Dark theme button override</Button>
</ThemeProvider>
</ThemeProvider>
);
The ThemeProvider
component provides the ability to pass custom themes to the application.
To use a custom theme, you need to pass an object with the custom theme name as a key and the custom theme class name as a value to the customThemes
prop of the ThemeProvider
component:
import { ThemeProvider, Button } from '@reportportal/ui-kit';
const MyComponent = () => (
<ThemeProvider customThemes={{ 'my-theme': 'my-custom-theme' }} theme="my-theme">
<Button>Custom theme button</Button>
<ThemeProvider theme="dark">
<Button>Dark theme button override</Button>
</ThemeProvider>
</ThemeProvider>
);
Then just override the ui-kit CSS custom properties in your custom theme class:
.my-custom-theme {
--rp-ui-base-font-family: OpenSans, Segoe UI, Tahoma, sans-serif;
--rp-ui-color-primary: green;
--rp-ui-color-primary-hover: #69e569;
--rp-ui-color-primary-focused: var(--rp-ui-color-primary-hover);
--rp-ui-color-primary-pressed: var(--rp-ui-color-primary-hover);
}
CSS custom properties and their default values can be found in the themes.
The number of custom themes is not limited and actual theme can be easily switched by changing the theme
prop.
To see a published showcase of the latest components released with its API and use cases, follow the link.
The library provides a set of SVG icons and the BaseIconButton
component to apply basic styles for hover, disabled and other states to them.
The list of available icons can be found in the icons folder.
The icons exported as React components:
import { PlusIcon } from '@reportportal/ui-kit';
const MyComponent = () => (
<PlusIcon />
);
To use the BaseIconButton
component, you need to pass the icon component as a child:
import { BaseIconButton, PlusIcon } from '@reportportal/ui-kit';
const MyComponent = () => {
const handleIconClick = () => {
console.log('Icon clicked');
};
return (
<BaseIconButton
className={cx('my-icon')}
disabled={false}
onClick={handleIconClick}
>
<PlusIcon />
</BaseIconButton>
);
}
BaseIconButton
supports all the props of the button
HTML element.
Note: To support styling via BaseIconButton
, it is recommended to use path-based, single-color SVG icons.
The library is developed using React and TypeScript.
The Storybook used as a main development environment and a showcase for components.
To run it locally use
npm run start
To create a ready-to-deploy version of the Storybook, run
npm run build:storybook
We use vite as a build tool.
To build the library run
npm run build
While the library is in alpha, the showcase hosted on GitHub Pages should be updated based on changes from the develop
branch.
develop
branch.That's it! If you encounter any issues during the deployment process, please consult the documentation or reach out to the project maintainers for assistance.
While the library is in alpha, the NPM package should be built and published from the develop
branch with alpha
tag.
develop
branch.That's it! If you encounter any issues during the release process, please consult the documentation or reach out to the project maintainers for assistance.
We follow the Airbnb JavaScript Style Guide and use ESLint to enforce it.
We use SCSS as a CSS preprocessor.
The project uses CSS Custom Properties to provide colors/fonts/etc. values for different themes via theme-specific CSS classes. All components get the appropriate theme values at runtime based on the cascading nature of CSS.
This approach was chosen because it is easy to implement and maintain, and CSS Custom Properties are part of WEB standards and supported by all major browsers.
The CSS custom properties that come from DS are prefixed with rp-ui-base
to avoid conflicts with other CSS properties and can be found in the base.scss.
Each new component/hook/utility must be covered by unit/component tests. All existing uncovered stuff will be tested gradually in the scope of tech-debt elimination activities.
The project uses the following testing tools:
Available npm scripts for testing:
npm run test
- Run tests in watch modenpm run test:coverage
- Run tests with coverage reportnpm run test:ci
- Run tests once (for CI environments)npm run test:ui
- Run tests with UI interfaceThe project maintains a minimum of 80% test coverage threshold for:
FAQs
To be updated
The npm package @reportportal/ui-kit receives a total of 128 weekly downloads. As such, @reportportal/ui-kit popularity was classified as not popular.
We found that @reportportal/ui-kit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.