I´ve several React components as a library in folder ux
(some itens below):
import MessageBar from "./atoms/MessageBar/MessageBar";
import Spinner from "./atoms/Spinner/Spinner";
import Button from "./atoms/Button/Button";
import AccordionHeader from "./molecules/AccordionHeader/AccordionHeader";
import AutocompleteList from "./molecules/AutocompleteList/AutocompleteList";
import ButtonGroup from "./molecules/ButtonGroup/ButtonGroup";
import LoginPanel from "./organisms/LoginPanel/LoginPanel";
import WelcomePanel from "./organisms/WelcomePanel/WelcomePanel";
I wish to export these objects so that it can be imported from its group:
import LoginPanel from "ux.organisms";
Or
import Button from "ux/atoms";
Or whatever.
The idea is that you are getting the element from an specific group inside ux
library.
What is the suggested way to export all of those components, organized into groups (atoms
, molecules
, organisms
, etc.) ?
PS:
a. I don´t wnat to change the component name (ButtomAtom
, etc...)
b. The result will be a npm library to be imported by other projects. So, this code will reside on my ux/index.js
file.