Skip to content

Commit

Permalink
chore: Export all components to allow usage without dot-notation (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgero-eth authored Apr 18, 2024
1 parent d06e4f7 commit d0b5c76
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Update minor and patch dependencies
- Update `@testing-library/react` to v15
- Adjusted active and hover start styling on `AssetTransfer` module component
- Export all components to allow usage without dot-notation

## [1.0.22] - 2024-04-12

Expand Down
12 changes: 6 additions & 6 deletions src/core/components/dataList/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { DataListItem } from './dataListItem';
import { DataListPagination } from './dataListPagination';
import { DataListRoot } from './dataListRoot';

export type { IDataListContainerProps, IDataListContainerState } from './dataListContainer';
export type { IDataListFilterProps, IDataListFilterSortItem } from './dataListFilter';
export type { IDataListItemProps } from './dataListItem';
export type { IDataListPaginationProps } from './dataListPagination';
export type { DataListState, IDataListRootProps } from './dataListRoot';

export const DataList = {
Root: DataListRoot,
Filter: DataListFilter,
Container: DataListContainer,
Item: DataListItem,
Pagination: DataListPagination,
};

export * from './dataListContainer';
export * from './dataListFilter';
export * from './dataListItem';
export * from './dataListPagination';
export * from './dataListRoot';
8 changes: 4 additions & 4 deletions src/core/components/dialogs/dialog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const Dialog = {
Root: DialogRoot,
};

export { type IDialogContentProps } from './dialogContent';
export { type IDialogFooterAction, type IDialogFooterProps } from './dialogFooter';
export { type IDialogHeaderProps } from './dialogHeader';
export { type IDialogRootProps } from './dialogRoot';
export * from './dialogContent';
export * from './dialogFooter';
export * from './dialogHeader';
export * from './dialogRoot';
8 changes: 4 additions & 4 deletions src/core/components/dialogs/dialogAlert/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const DialogAlert = {
Root: DialogAlertRoot,
};

export { type IDialogAlertContentProps } from './dialogAlertContent';
export { type IDialogAlertFooterAction, type IDialogAlertFooterProps } from './dialogAlertFooter';
export { type IDialogAlertHeaderProps } from './dialogAlertHeader';
export { type DialogAlertVariant, type IDialogAlertRootProps } from './dialogAlertRoot';
export * from './dialogAlertContent';
export * from './dialogAlertFooter';
export * from './dialogAlertHeader';
export * from './dialogAlertRoot';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
import { Dropdown, type IDropdownContainerProps } from './index';
import { Dropdown, type IDropdownContainerProps } from '../index';

const meta: Meta<typeof Dropdown.Container> = {
title: 'Core/Components/Dropdown/Dropdown.Container',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, screen } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
import { IconType } from '../icon';
import { IconType } from '../../icon';
import { DropdownItem } from '../dropdownItem/dropdownItem';
import { DropdownContainer, type IDropdownContainerProps } from './dropdownContainer';
import { DropdownItem } from './dropdownItem';

describe('<Dropdown.Container /> component', () => {
const createTestComponent = (props?: Partial<IDropdownContainerProps>) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as RadixDropdown from '@radix-ui/react-dropdown-menu';
import classNames from 'classnames';
import { useEffect, useState, type ReactNode } from 'react';
import { Button, type IButtonProps } from '../button';
import { IconType } from '../icon';
import { Button, type IButtonProps } from '../../button';
import { IconType } from '../../icon';

export interface IDropdownContainerProps extends RadixDropdown.DropdownMenuProps {
/**
Expand Down
4 changes: 4 additions & 0 deletions src/core/components/dropdown/dropdownContainer/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
:root {
/* Z-index property of the content insdie the dropdown container */
--ods-dropdown-container-content-z-index: auto;
}
1 change: 1 addition & 0 deletions src/core/components/dropdown/dropdownContainer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DropdownContainer, type IDropdownContainerProps } from './dropdownContainer';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from '@storybook/react';
import { Dropdown, type IDropdownItemProps } from './index';
import { Dropdown, type IDropdownItemProps } from '../index';

const meta: Meta<typeof Dropdown.Item> = {
title: 'Core/Components/Dropdown/Dropdown.Item',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from '@testing-library/react';
import { IconType } from '../icon';
import { DropdownContainer } from './dropdownContainer';
import { IconType } from '../../icon';
import { DropdownContainer } from '../dropdownContainer/dropdownContainer';
import { DropdownItem, type IDropdownItemProps } from './dropdownItem';

describe('<Dropdown.Item /> component', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as RadixDropdown from '@radix-ui/react-dropdown-menu';
import classNames from 'classnames';
import React from 'react';
import { Icon, IconType } from '../icon';
import { Icon, IconType } from '../../icon';

export interface IDropdownItemProps extends Omit<RadixDropdown.DropdownMenuItemProps, 'asChild'> {
/**
Expand Down
1 change: 1 addition & 0 deletions src/core/components/dropdown/dropdownItem/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DropdownItem, type IDropdownItemProps } from './dropdownItem';
5 changes: 1 addition & 4 deletions src/core/components/dropdown/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
:root {
/* Z-index property of the content insdie the dropdown container */
--ods-dropdown-container-content-z-index: auto;
}
@import "./dropdownContainer";
6 changes: 3 additions & 3 deletions src/core/components/dropdown/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { DropdownContainer } from './dropdownContainer';
import { DropdownItem } from './dropdownItem';

export type { IDropdownContainerProps } from './dropdownContainer';
export type { IDropdownItemProps } from './dropdownItem';

export const Dropdown = {
Container: DropdownContainer,
Item: DropdownItem,
};

export * from './dropdownContainer';
export * from './dropdownItem';
2 changes: 1 addition & 1 deletion src/modules/components/asset/assetDataListItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const AssetDataListItem = {
Structure: AssetDataListItemStructure,
};

export type { IAssetDataListItemStructureProps } from './assetDataListItemStructure';
export * from './assetDataListItemStructure';
2 changes: 1 addition & 1 deletion src/modules/components/dao/daoDataListItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const DaoDataListItem = {
Structure: DaoDataListItemStructure,
};

export type { IDaoDataListItemStructureProps } from './daoDataListItemStructure';
export * from './daoDataListItemStructure';
2 changes: 1 addition & 1 deletion src/modules/components/member/memberDataListItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export const MemberDataListItem = {
Structure: MemberDataListItemStructure,
};

export type { IMemberDataListItemProps } from './memberDataListItemStructure';
export * from './memberDataListItemStructure';
12 changes: 3 additions & 9 deletions src/modules/components/proposal/proposalDataListItem/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { ProposalDataListItemStructure as Structure } from './proposalDataListItemStructure';
import { ProposalDataListItemStructure } from './proposalDataListItemStructure';

export const ProposalDataListItem = {
Structure,
Structure: ProposalDataListItemStructure,
};

export type {
IApprovalThresholdResult,
IMajorityVotingResult,
IProposalDataListItemStructureProps,
ProposalStatus,
ProposalType,
} from './proposalDataListItemStructure';
export * from './proposalDataListItemStructure';
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import { TransactionDataListItemStructure as Structure } from './transactionDataListItemStructure';
import { TransactionDataListItemStructure } from './transactionDataListItemStructure';

export const TransactionDataListItem = {
Structure,
Structure: TransactionDataListItemStructure,
};

export {
TransactionStatus,
TransactionType,
type ITransactionDataListItemProps,
} from './transactionDataListItemStructure';
export * from './transactionDataListItemStructure';

0 comments on commit d0b5c76

Please sign in to comment.