Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fintraffic/fds-coreui-components

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fintraffic/fds-coreui-components

Fintraffic Design System Core UI (Web) Components

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

coreui-components

Fintraffic Design System's Core UI Components. Work heavily in progress.

Work is being done at Fintraffic Raide to get some basic web components added to this repository in the near future. After we've achieved some good enough baseline, we'll revisit governing and contribution guidelines and processes for the Design System's technical implementation.

Storybook

https://fintraffic-design.github.io/fds-coreui-components

Install

npm i --save @fintraffic/fds-coreui-components

Usage

Import and register a specific component

import '@fintraffic/fds-coreui-components/dist/define/fds-button.js';

Import and register all components

import '@fintraffic/fds-coreui-components/dist/define/all.js';

Extend a component

import { FdsButton } from '@fintraffic/fds-coreui-components';
class MyButton extends FdsButton { /* ... */ }
customElements.define('my-button', MyButton);

Code style guide

  • Implementation should follow the component publishing guidelines from Open Web Components.

  • Web component code should be ordered as follows:

    • Imports
    • TypeScript definitions
    • Lit-component
      • Constructor (only when required)

      • Reactive properties (@property, @state)

      • Override-methods

      • Render-method

      • Helper-methods

      • CSS

    Reasoning: With this order we aim to have the most functionally essential logic of the component featured most prominently. For this reason, the CSS (static variable) has been moved to the end, contrary to common OOP-practices. Otherwise, it is generally desired to maintain the same order of structure in components, so that even unfamiliar code is a little easier to read when you know how it is structured.

  • Class properties that update the component's inner state, should have the private access modifier, or protected if there is a good reason for it.

  • Use the function keyword when declaring functions.

  • Naming practises:

    • Use underscore (_) for private and protected properties, e.g. @state() private _enabled = true
  • Prettier is used for code formatting.

    • Settings are found in .prettierc.json.
    • Usage (two options):
      • Plugin: Install and enable the Prettier VSCode/IntelliJ -plugin and ensure that the "format on save" -option is enabled for your IDE.
      • No plugin: Run at project root npx prettier -w src/
  • Always write and update the JSDocs!

Licencing

Copyright © Fintraffic 2023 Source code of this program is licensed under the EUPL v1.2

FAQs

Package last updated on 02 Apr 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc