Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@redpanda-data/ui
Advanced tools
React Typescript component library for Redpanda UI projects.
This library uses Chakra UI as the basis for all components.
Create a component in the src/components/
directory, then export it from src/components/index.ts
.
Component directory structure:
src/
exports.ts
assets/
styles/
components/
index.ts
Button/
Button.tsx
Button.test.tsx
Button.stories.tsx
Exporting a component in src/components/index.ts
export { default as Button } from './Button/Button';
TODO - add generator for new components with the correct directory, index, component, story, and test files.
### Overrides
To override any default components from the base library. Simply create a new component with the same name, and add it to src/components/index.ts
.
Create a custom component, and import the component you need from your package. Ensure that you use the hooks provided in Chakra for theming light and dark modes.
Custom CSS and SCSS can be used but is mostly not needed as Chakra provides all of the base styles we need. Refer to the Chakra documentation for styles and prop based styles.
this library will export a global css file with your custom css, make sure you import it from @redpanda-data/dist/index.css
.
yuor scss or sass files will be transpiled to a single css file when imported on any file, output file will be index.css
We use storybook to preview components and test them.
Run npm run build-storybook
for static assets.
Run npm run storybook
and go to http://localhost:6006
This storybook setup closely follows this approach:
We are using @testing-library/react to write the tests for UI.
Run npm run test
to see the coverage for the library.
When making changes to the UI library (components, styles, etc.), it's nice to test those changes within the context of your local-running Cloud UI. Using yalc
, you can link Cloud UI to your local ui
repo and see those changes reflected with your Cloud UI instance using the following steps:
yalc
on your machine: npm i -g yalc
ui
repo, run yalc publish
. This will publish your local ui
repo to your local yalc
store (registry).cloud-ui
(or admin-ui
) repo, add the newly-added yalc dependency: yalc add @redpanda-data/ui
cloud-ui
(or admin-ui
) repo, install the new dependency: npm i
After making any code changes within your local ui
repo, run yalc push
to update the local yalc
store and have your changes pushed to the cloud-ui
(or admin-ui
) repo.
Once you're done testing local changes, it's important to unlink the local ui
repo from cloud-ui
(or admin-ui
) by running: yalc remove @redpanda-data/ui
.
When viewing a component in storybook, check that it works with both light
and dark
modes.
Ensure that tests pass all critical accessibilty violations. If unsure about visual elements contact the design team for input.
Use the files in the directory playground/
as a scratchpad for trying out components. It uses a standard CRA setup.
Run npm run playground
to see the playground in the browser at http://localhost:3000
We are using release-please to hande the release of this library, notice it relies on conventional commits to generate semver, releases and changelog.
We use rollup for building the app, simply run npm run build
to generate the built files and types.
Every push to main will generate a release pull request, when the PR is approved and merged it will publish the new version of the package to npm.
Note: To ensure a release is auto-created, be sure to rebase/merge back into your branch before merging your PR.
Keep in mind: PRs that use the docs
or chore
commit lint prefix will not trigger a new release. It's recommended to prefix your PR title with "feat" or "fix" when releasing a new feature or fix, respectively.
You should use conventional commits for your commits, you can run npm run commit
it will prompt a helper to generate your commits.
there are some git hooks to validate your commits and some prettier style enforcement.
FAQs
React Typescript component library for Redpanda UI projects.
We found that @redpanda-data/ui 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.