JSPM

  • Created
  • Published
  • Downloads 42
  • Score
    100M100P100Q49773F
  • License MIT

Alethio React component library

Package Exports

  • @alethio/ui/lib/control/Button
  • @alethio/ui/lib/control/ExternalLink
  • @alethio/ui/lib/control/Radio
  • @alethio/ui/lib/control/SelectBox
  • @alethio/ui/lib/data/ByteSize
  • @alethio/ui/lib/data/Hash
  • @alethio/ui/lib/data/Label
  • @alethio/ui/lib/data/Number
  • @alethio/ui/lib/data/box/HashValueBox
  • @alethio/ui/lib/data/gridRenderer/HashRenderer
  • @alethio/ui/lib/data/vis/Bubble
  • @alethio/ui/lib/fx/SpinnerRegular
  • @alethio/ui/lib/icon/GridViewIcon
  • @alethio/ui/lib/icon/ListViewIcon
  • @alethio/ui/lib/icon/MoreInfoIcon
  • @alethio/ui/lib/icon/MsgCountInSmallIcon
  • @alethio/ui/lib/icon/MsgCountOutSmallIcon
  • @alethio/ui/lib/icon/QrCodeIcon
  • @alethio/ui/lib/icon/StatusOkIcon
  • @alethio/ui/lib/layout/content/box/ValueBox
  • @alethio/ui/lib/overlay/Popover
  • @alethio/ui/lib/overlay/tooltip/Tooltip
  • @alethio/ui/lib/overlay/tooltip/TooltipRegular
  • @alethio/ui/lib/styled-components
  • @alethio/ui/lib/theme/createPalette
  • @alethio/ui/lib/theme/createTheme
  • @alethio/ui/lib/util/react/DomNodeProxy
  • @alethio/ui/lib/util/react/MultiHover

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@alethio/ui) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@alethio/ui

React component library for Alethio apps

Prerequisites

  • Node 8+ for development
  • ES2015+ compliant browser for runtime

Installation

  1. npm i @alethio/ui
  2. Copy files from public/css and public/fonts into your root app folder and import CSS in your index.html.
  3. Just import any component with import { ... } from "@alethio/ui/lib/path/to/Component"

Development

  1. npm install
  2. npm run build for production or npm run watch for development.

Project structure

๐Ÿ“
โ”œโ”€๐Ÿ“lib            - target folder for application that contains deployables
โ”œโ”€๐Ÿ“public         - contains static assets that are copied to the dist folder as they are
โ””โ”€๐Ÿ“src            - source files
  โ”œโ”€๐Ÿ“control       - reusable ui controls and widgets
  โ”œโ”€๐Ÿ“data          - components for displaying and formatting various types of data
  โ”œโ”€๐Ÿ“fx            - Effects and animations
  โ”œโ”€๐Ÿ“icon          - reusable icon components (SVG or icon font wrappers)
  โ””โ”€๐Ÿ“layout        - components for layout / arrangement

Managing SVG icons

Original SVG sources should be kept in the dev/original-svg folder. To create SVG icon components from them, the following steps should be taken:

  1. Copy the SVG markup in the render method of a new React component
  2. Replace all dash (-) attributes with camelCase
  3. Remove any unneeded attributes or run the SVG through an optimizer tool
  4. The viewBox of the icon should be a square. If needed use <g transform="translate(x,y)"> to center the icon in the new viewBox. This allows proper sizing via size prop
  5. Replace the main fill/stroke color with currentColor, to ensure proper cascading, or parametrize if more than one color
  6. The resulting component should be configured with a size prop that applies to both width and height