Skip to content

Commit

Permalink
feat: APP-2893 - Update library structure to support module components (
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth authored Feb 29, 2024
1 parent afa7a3d commit 431e0b4
Show file tree
Hide file tree
Showing 443 changed files with 143 additions and 79 deletions.
1 change: 0 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const config: StorybookConfig = {
name: '@storybook/react-webpack5',
options: {},
},
staticDirs: ['../src/assets'],
webpackFinal: (webpackConfig) => {
// Remove any svg loader already set and use @svgr/webpack to load svgs on Storybook
const svgWebpackRule = webpackConfig.module?.rules?.find((rule) => {
Expand Down
11 changes: 10 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const preview: Preview = {
options: {
storySort: {
method: 'alphabetical',
order: ['Docs', ['Documentation', 'Installation', 'Changelog'], 'Design Tokens', 'Components'],
order: [
'Docs',
['Documentation', 'Installation', 'Changelog'],
'Theme',
['Documentation'],
'Core',
['Documentation'],
'Modules',
['Documentation'],
],
},
},
backgrounds: {
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

### Changed

- Update library structure to support module components
- Update documentation about how to install the library

## [1.0.18] - 2024-02-29

### Fixed
Expand Down
16 changes: 14 additions & 2 deletions docs/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@ library:

## Setup with Tailwind CSS

- (Optional) Setup `Tailwind CSS` for your project by following their
[installation guide](https://tailwindcss.com/docs/installation).
- Setup `Tailwind CSS` for your project by following their
[installation guide](https://tailwindcss.com/docs/installation)

- Install the required `TaildindCSS` plugins:

```shell
yarn add @tailwindcss/typography
```

or

```shell
npm install @tailwindcss/typography
```

- Update the `tailwind.config.js` configuration file as follows:

Expand Down
2 changes: 1 addition & 1 deletion index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./src/styles/index.css";
@import "./src/theme/index.css";

@tailwind base;
@tailwind components;
Expand Down
6 changes: 3 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
const config = {
testEnvironment: 'jsdom',
collectCoverageFrom: ['./src/**/*.{ts,tsx}'],
coveragePathIgnorePatterns: ['.d.ts', '.api.ts', 'index.ts', '.stories.tsx', './src/test/*'],
setupFilesAfterEnv: ['<rootDir>/src/test/setup.ts'],
coveragePathIgnorePatterns: ['.d.ts', '.api.ts', 'index.ts', '.stories.tsx', './src/core/test/*'],
setupFilesAfterEnv: ['<rootDir>/src/core/test/setup.ts'],
transform: {
'^.+\\.svg$': '<rootDir>/src/test/svgTransform.js',
'^.+\\.svg$': '<rootDir>/src/core/test/svgTransform.js',
'^.+\\.m?[tj]sx?$': 'ts-jest',
},
transformIgnorePatterns: ['node_modules/(?!(.*\\.mjs$|react-merge-refs))'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"index.css",
"build.css",
"src/**/*.css",
"src/assets/fonts/*",
"src/theme/fonts/*",
"tailwind.config.js"
],
"scripts": {
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { AlertCard } from './alertCard';

const meta: Meta<typeof AlertCard> = {
title: 'components/Alerts/AlertCard',
title: 'Core/Components/Alerts/AlertCard',
component: AlertCard,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { AlertInline } from './alertInline';

const meta: Meta<typeof AlertInline> = {
title: 'components/Alerts/AlertInline',
title: 'Core/Components/Alerts/AlertInline',
component: AlertInline,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { Avatar } from './avatar';

const meta: Meta<typeof Avatar> = {
title: 'components/Avatars/Avatar',
title: 'Core/Components/Avatars/Avatar',
component: Avatar,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconType } from '../../icon';
import { AvatarIcon } from './avatarIcon';

const meta: Meta<typeof AvatarIcon> = {
title: 'components/Avatars/AvatarIcon',
title: 'Core/Components/Avatars/AvatarIcon',
component: AvatarIcon,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IconType } from '../icon';
import { Button } from './button';

const meta: Meta<typeof Button> = {
title: 'components/Button',
title: 'Core/Components/Button',
component: Button,
tags: ['autodocs'],
argTypes: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { Card } from './card';

const meta: Meta<typeof Card> = {
title: 'components/Cards/Card',
title: 'Core/Components/Cards/Card',
component: Card,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type Meta, type StoryObj } from '@storybook/react';
import { CardEmptyState } from '.';

const meta: Meta<typeof CardEmptyState> = {
title: 'components/Cards/CardEmptyState',
title: 'Core/Components/Cards/CardEmptyState',
component: CardEmptyState,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { IconType } from '../../icon';
import { CardSummary } from './cardSummary';

const meta: Meta<typeof CardSummary> = {
title: 'components/Cards/CardSummary',
title: 'Core/Components/Cards/CardSummary',
component: CardSummary,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
import { Checkbox, type CheckboxState, type ICheckboxProps } from './checkbox';

const meta: Meta<typeof Checkbox> = {
title: 'components/Checkbox/Checkbox',
title: 'Core/Components/Checkbox/Checkbox',
component: Checkbox,
tags: ['autodocs'],
argTypes: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { CheckboxCard } from './checkboxCard';

const meta: Meta<typeof CheckboxCard> = {
title: 'components/Checkbox/CheckboxCard',
title: 'Core/Components/Checkbox/CheckboxCard',
component: CheckboxCard,
tags: ['autodocs'],
argTypes: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CheckboxCard } from '../checkboxCard';
import { CheckboxGroup } from './checkboxGroup';

const meta: Meta<typeof CheckboxGroup> = {
title: 'components/Checkbox/CheckboxGroup',
title: 'Core/Components/Checkbox/CheckboxGroup',
component: CheckboxGroup,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { DataList } from '..';

const meta: Meta<typeof DataList.Container> = {
title: 'components/DataList/DataList.Container',
title: 'Core/Components/DataList/DataList.Container',
component: DataList.Container,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { DataList } from '../index';

const meta: Meta<typeof DataList.Filter> = {
title: 'components/DataList/DataList.Filter',
title: 'Core/Components/DataList/DataList.Filter',
component: DataList.Filter,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { DataList } from '../index';

const meta: Meta<typeof DataList.Item> = {
title: 'components/DataList/DataList.Item',
title: 'Core/Components/DataList/DataList.Item',
component: DataList.Item,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { DataList } from '../index';

const meta: Meta<typeof DataList.Pagination> = {
title: 'components/DataList/DataList.Pagination',
title: 'Core/Components/DataList/DataList.Pagination',
component: DataList.Pagination,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DataList, type IDataListRootProps } from '../index';
import type { DataListState } from './dataListRoot';

const meta: Meta<typeof DataList.Root> = {
title: 'components/DataList/DataList.Root',
title: 'Core/Components/DataList/DataList.Root',
component: DataList.Root,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../../../button';
import { type IDialogContentProps } from './dialogContent';

const meta: Meta<typeof Dialog.Content> = {
title: 'components/Dialogs/Dialog/Dialog.Content',
title: 'Core/Components/Dialogs/Dialog/Dialog.Content',
component: Dialog.Content,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../../../button';
import { IconType } from '../../../icon';

const meta: Meta<typeof Dialog.Footer> = {
title: 'components/Dialogs/Dialog/Dialog.Footer',
title: 'Core/Components/Dialogs/Dialog/Dialog.Footer',
component: Dialog.Footer,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../../../button';
import { type IDialogHeaderProps } from './dialogHeader';

const meta: Meta<typeof Dialog.Header> = {
title: 'components/Dialogs/Dialog/Dialog.Header',
title: 'Core/Components/Dialogs/Dialog/Dialog.Header',
component: Dialog.Header,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Dialog, type IDialogRootProps } from '..';
import { Button } from '../../../button';

const meta: Meta<typeof Dialog.Root> = {
title: 'components/Dialogs/Dialog/Dialog.Root',
title: 'Core/Components/Dialogs/Dialog/Dialog.Root',
component: Dialog.Root,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DialogAlert, type IDialogAlertContentProps } from '..';
import { Button } from '../../../button';

const meta: Meta<typeof DialogAlert.Content> = {
title: 'components/Dialogs/DialogAlert/DialogAlert.Content',
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Content',
component: DialogAlert.Content,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../../../button';
import { IconType } from '../../../icon';

const meta: Meta<typeof DialogAlert.Footer> = {
title: 'components/Dialogs/DialogAlert/DialogAlert.Footer',
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Footer',
component: DialogAlert.Footer,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DialogAlert, type IDialogAlertHeaderProps } from '..';
import { Button } from '../../../button';

const meta: Meta<typeof DialogAlert.Header> = {
title: 'components/Dialogs/DialogAlert/DialogAlert.Header',
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Header',
component: DialogAlert.Header,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DialogAlert, type IDialogAlertRootProps } from '..';
import { Button } from '../../../button';

const meta: Meta<typeof DialogAlert.Root> = {
title: 'components/Dialogs/DialogAlert/DialogAlert.Root',
title: 'Core/Components/Dialogs/DialogAlert/DialogAlert.Root',
component: DialogAlert.Root,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useState } from 'react';
import { Dropdown, type IDropdownContainerProps } from './index';

const meta: Meta<typeof Dropdown.Container> = {
title: 'components/Dropdown/Dropdown.Container',
title: 'Core/Components/Dropdown/Dropdown.Container',
component: Dropdown.Container,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { Dropdown, type IDropdownItemProps } from './index';

const meta: Meta<typeof Dropdown.Item> = {
title: 'components/Dropdown/Dropdown.Item',
title: 'Core/Components/Dropdown/Dropdown.Item',
component: Dropdown.Item,
tags: ['autodocs'],
argTypes: {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { Heading } from './heading';

const meta: Meta<typeof Heading> = {
title: 'components/Heading',
title: 'Core/Components/Heading',
component: Heading,

tags: ['autodocs'],
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Icon } from './icon';
import { IconType } from './iconType';

const meta: Meta<typeof Icon> = {
title: 'components/Icon',
title: 'Core/Components/Icon',
component: Icon,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { IllustrationHuman } from './illustrationHuman';

const meta: Meta<typeof IllustrationHuman> = {
title: 'components/Illustrations/IllustrationHuman',
title: 'Core/Components/Illustrations/IllustrationHuman',
component: IllustrationHuman,
tags: ['autodocs'],
parameters: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { IllustrationObject } from './illustrationObject';

const meta: Meta<typeof IllustrationObject> = {
title: 'components/Illustrations/IllustrationObject',
title: 'Core/Components/Illustrations/IllustrationObject',
component: IllustrationObject,
tags: ['autodocs'],
parameters: {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 431e0b4

Please sign in to comment.