Skip to content

Commit

Permalink
Merge pull request #203 from compassion-global-experience/exportProps2
Browse files Browse the repository at this point in the history
Export props & add 'use client' directive
  • Loading branch information
janiekyu authored Nov 15, 2023
2 parents e7a0f8a + fb6a797 commit 9ae0423
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/react/src/components/Box/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Box';
export { default, BoxProps } from './Box';
2 changes: 1 addition & 1 deletion packages/react/src/components/Card/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Card';
export { default, CardProps } from './Card';
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/ChoiceInput.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef, InputHTMLAttributes } from 'react';
import styles from '@compassion-design-system/core/src/components/Form/radio-checkbox.module.css';
import common from '@compassion-design-system/core/src/components/Form/form-common.module.css';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/InputGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef } from 'react';

import Input from './Input';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/PinField.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import {
ChangeEvent,
KeyboardEvent,
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef, InputHTMLAttributes, ReactElement } from 'react';
import styles from '@compassion-design-system/core/src/components/Form/input-group.module.css';
import common from '@compassion-design-system/core/src/components/Form/form-common.module.css';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/SelectField.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef } from 'react';

import { FieldContainer } from './Helpers';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/SelectGroup.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef } from 'react';

import { SelectFieldProps } from './SelectField';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/TextArea.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef, InputHTMLAttributes, useCallback, useState } from 'react';
import styles from '@compassion-design-system/core/src/components/Form/textarea.module.css';
import common from '@compassion-design-system/core/src/components/Form/form-common.module.css';
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/Form/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef } from 'react';
import '@compassion-design-system/core/src/components/Form/form-common.module.css';

Expand Down
18 changes: 9 additions & 9 deletions packages/react/src/components/Form/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export { default as Input } from './Input';
export { default as TextField } from './TextField';
export { default as InputGroup } from './InputGroup';
export { default as TextArea } from './TextArea';
export { default as Select } from './Select';
export { default as SelectField } from './SelectField';
export { default as SelectGroup } from './SelectGroup';
export { default as ChoiceInput } from './ChoiceInput';
export { default as PinField } from './PinField';
export { default as Input, InputProps } from './Input';
export { default as TextField, TextFieldProps } from './TextField';
export { default as InputGroup, InputGroupProps } from './InputGroup';
export { default as TextArea, TextAreaFieldProps } from './TextArea';
export { default as Select, SelectProps } from './Select';
export { default as SelectField, SelectFieldProps } from './SelectField';
export { default as SelectGroup, SelectGroupProps } from './SelectGroup';
export { default as ChoiceInput, ChoiceInputProps } from './ChoiceInput';
export { default as PinField, PinFieldProps } from './PinField';
2 changes: 2 additions & 0 deletions packages/react/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use client';

import { forwardRef, MouseEvent, ReactNode, HTMLProps } from 'react';
import styles from '@compassion-design-system/core/src/components/Modal/modal.module.css';
import { X } from '../icons';
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Modal/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Modal';
export { default, ModalProps } from './Modal';
2 changes: 1 addition & 1 deletion packages/react/src/components/Table/Table.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { render } from '@testing-library/react';
import Table from './Table';
import Table, { Column } from './Table';

describe('Table', () => {
it('should render 3 columns and 3 rows', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function TableInner<Row>(

const TableWithRef = forwardRef(TableInner);

type TableWithRefProps<T> = TableProps<T> & {
export type TableWithRefProps<T> = TableProps<T> & {
mRef?: Ref<HTMLTableElement>;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Table/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './Table';
export { default, Column, TableWithRefProps } from './Table';
2 changes: 1 addition & 1 deletion packages/react/src/components/TextBox/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from './TextBox';
export { default, TextBoxProps } from './TextBox';
23 changes: 18 additions & 5 deletions packages/react/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
export { default as Button, ButtonProps } from './Button';
export { default as Modal } from './Modal';
export { default as Modal, ModalProps } from './Modal';
export { default as Icon, IconProps } from './Icon';
export { default as Table } from './Table';
export {
default as Table,
Column as TableColumn,
TableWithRefProps as TableProps,
} from './Table';
export { NavItem, NavItemProps } from './Nav';
export { default as Card } from './Card';
export { default as TextBox } from './TextBox';
export { default as Box } from './Box';
export { default as Card, CardProps } from './Card';
export { default as TextBox, TextBoxProps } from './TextBox';
export { default as Box, BoxProps } from './Box';
export {
Input,
InputProps,
InputGroup,
InputGroupProps,
TextField,
TextFieldProps,
TextArea,
TextAreaFieldProps,
Select,
SelectProps,
SelectField,
SelectFieldProps,
SelectGroup,
SelectGroupProps,
ChoiceInput,
ChoiceInputProps,
PinField,
PinFieldProps,
} from './Form';

0 comments on commit 9ae0423

Please sign in to comment.