Infinity UI is the React component library used to build the user interface for NextBusiness Infinity and its apps.
Starting with version 0.4.0, Infinity UI is split in three different packages:
@nextbusiness/infinity-ui: Controls, Layout and Presentation Components@nextbusiness/infinity-ui-foundations: Typography Base, Styles and Internal Utilities@nextbusiness/infinity-ui-icons: Expansive Icon LibraryTo use Infinity UI, it is recommended to install all packages as dependencies:
yarn add @nextbusiness/infinity-ui-foundations @nextbusiness/infinity-ui @nextbusiness/infinity-ui-icons
To properly use Infinity UI in a new project, you'll need to:
import '@nextbusiness/infinity-ui/dist/index.css'TypographyBase component from infinity-ui-foundations to get the correct typography.ApplicationFrame component.Documentation for this package is auto-generated from the TypeScript source and TSDoc comments. To view the documentation, run the following CLI command:
yarn docs
This repository is structured as a monorepo using Yarn Workspaces, containing all infinity-ui packages along with a demo application.
To continously bulid and watch a package while developing, go to the project directory of the specific package and run yarn dev:
cd packages/infinity-ui && yarn devcd packages/infinity-ui-foundations && yarn devcd packages/infinity-ui-icons && yarn devTo run the demo application with hot module reloading, start the Build & watch script for the relevant package, as described above (most of the time, that's going to be infinity-ui).
Then run the following command from a separate terminal:
cd sites/infinity-ui-demo
yarn dev
To build the main infinity-ui package, go to the project directory of the specific package and run yarn build:
cd packages/infinity-ui && yarn buildcd packages/infinity-ui-foundations && yarn buildcd packages/infinity-ui-icons && yarn buildBuild & watch, Vite will continue to rebuild but stop emitting TypeScript declaration files. As a result, TypeScript will say that the module @nextbusiness/infinity-ui (or others) cannot be found. To fix this, terminate and restart the Build & watch script.import { MyType } from ... does not work in the packages and will result in an error at build-time. Instead, you'll need to use import type { MyType } from .... We'll add an ESLint rule for this in the future.Infinity UI is proprietary and owned by NextBusiness. Any contributions to the projects are considered work product and sole ownership of the code belongs to NextBusiness.
© NextBusiness 2020 – 2022, All Rights Reserved.