Skip to content

Commit fb88e7a

Browse files
authored
Fixed exports (#27)
1 parent 960912a commit fb88e7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+166
-22697
lines changed

Diff for: babel.config.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
module.exports = {
22
plugins: [
3-
'@babel/plugin-proposal-class-properties',
4-
['babel-plugin-root-import', {
5-
"rootPathSuffix": "src/",
6-
"rootPathPrefix": "@/"
7-
}]
3+
'@babel/plugin-proposal-class-properties'
84
],
95
presets: [
106
'@babel/typescript',

Diff for: jest.config.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"setupFilesAfterEnv": ["./setupTests.ts"],
3-
"moduleNameMapper": {
4-
"@/(.*)": "<rootDir>/src/$1"
5-
}
2+
"setupFilesAfterEnv": ["./setupTests.ts"]
63
}

Diff for: package-lock.json

+12-22,583
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"@types/react-is": "^16.7.1",
2525
"@typescript-eslint/eslint-plugin": "^4.6.1",
2626
"@typescript-eslint/parser": "^4.6.1",
27-
"babel-plugin-root-import": "^6.6.0",
2827
"dart-sass": "^1.25.0",
2928
"enzyme": "^3.11.0",
3029
"enzyme-adapter-react-16": "^1.15.3",

Diff for: src/components/Button/Button.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
33
import PropTypes from 'prop-types';
4-
import { Variant } from '@/components';
4+
import { Variant } from '../utils';
55

66
export type ButtonComponentTypes = 'button' | 'a';
77

Diff for: __tests__/Button.test.tsx renamed to src/components/Button/__tests__/Button.test.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { shallow } from 'enzyme';
22
import React from 'react';
3-
import { Button } from '@/components/Button';
4-
import { Variant } from '@/components';
3+
import { Variant } from '../../utils';
4+
import Button from '../Button';
55

66
describe('Button test', () => {
77
it('should render button', () => {

Diff for: src/components/Button/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as Button } from './Button';
2+
export type { ButtonProps, ButtonComponentTypes } from './Button';

Diff for: src/components/Card/Card.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import * as React from 'react';
22
import clsx from 'clsx';
33
import PropTypes from 'prop-types';
4-
import CardContent from '@/components/Card/Content';
5-
import { ForwardComponentWithStatics } from '@/components/utils/ForwardComponentWithStatics';
6-
import CardHeader from '@/components/Card/Header';
7-
import { Variant } from '@/components';
4+
import CardContent from './Content';
5+
import { ForwardComponentWithStatics } from '../utils/ForwardComponentWithStatics';
6+
import CardHeader from './Header';
7+
import { Variant } from '../utils';
88

99
export type CardStatics = {
1010
Content: typeof CardContent;

Diff for: src/components/Card/Content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import clsx from 'clsx';
33
import PropTypes from 'prop-types';
44

5-
type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
5+
export type CardContentProps = React.HTMLAttributes<HTMLDivElement>;
66

77
const CardContent = React.forwardRef<HTMLDivElement, CardContentProps>((
88
{

Diff for: __tests__/Card.test.tsx renamed to src/components/Card/__tests__/Card.test.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { render } from 'enzyme';
22
import React from 'react';
3-
import Card from '@/components/Card/Card';
4-
import CardContent from '@/components/Card/Content';
5-
import CardHeader from '@/components/Card/Header';
6-
import { Variant } from '@/components';
3+
import { Variant } from '../../utils';
4+
import Card from '../Card';
5+
import CardContent from '../Content';
6+
import CardHeader from '../Header';
77

88
describe('Card test', () => {
99
it('should render card', () => {

Diff for: src/components/Card/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
export { default as Card } from './Card';
2+
export type { CardProps, CardStatics } from './Card';
3+
24
export { default as CardContent } from './Content';
5+
export type { CardContentProps } from './Content';
6+
37
export { default as CardHeader } from './Header';
8+
export type { CardHeaderProps } from './Header'

Diff for: src/components/Container/Container.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
5+
export interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
66
fluid?: boolean;
77
}
88

Diff for: __tests__/Container.test.tsx renamed to src/components/Container/__tests__/Container.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from 'enzyme';
22
import React from 'react';
3-
import Container from '@/components/Container/Container';
3+
import Container from '../Container';
44

55
describe('Container test', () => {
66
it('should render container', () => {

Diff for: src/components/Container/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { default as Container } from './Container';
2+
export type { ContainerProps } from './Container';

Diff for: src/components/Field/FieldBase.tsx

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
3-
import { Icon, Variant } from '@/components';
43
import clsx from 'clsx';
54
import { ReactElement, useState } from 'react';
5+
import { Icon } from '../Icon';
66
import { FieldContext } from './FieldContext';
7+
import { Variant } from '../utils';
78

8-
interface FieldBaseProps {
9+
export interface FieldBaseProps {
910
actions?: React.ReactNode;
1011
className?: string;
1112
label?: React.ReactNode;
1213
valid?: boolean;
1314
variant?: Variant | string;
1415
value?: string | ReadonlyArray<string> | number;
16+
children?: React.ReactNode;
1517
}
1618

1719
export const getStateIcon = (valid: boolean | undefined): ReactElement | undefined => {
@@ -32,20 +34,23 @@ export const getStateIcon = (valid: boolean | undefined): ReactElement | undefin
3234
);
3335
}
3436

35-
const FieldBaseProps = ({
36-
actions,
37-
className,
38-
children,
39-
label,
40-
variant = Variant.PRIMARY,
41-
valid
42-
}: React.PropsWithChildren<FieldBaseProps>,
37+
const FieldBaseProps = React.forwardRef<HTMLDivElement, FieldBaseProps>((
38+
{
39+
actions,
40+
className,
41+
children,
42+
label,
43+
variant = Variant.PRIMARY,
44+
valid
45+
},
46+
ref
4347
): React.ReactElement => {
4448
const [hasValue, setHasValue] = useState<boolean>(false);
4549
const [hasFocus, setHasFocus] = useState<boolean>(false);
4650

4751
return (
4852
<div
53+
ref={ref}
4954
className={clsx(
5055
'form-field-base',
5156
`form-field-${variant}`,
@@ -79,10 +84,11 @@ const FieldBaseProps = ({
7984
)}
8085
</div>
8186
);
82-
};
87+
});
8388

8489
export const propTypes = {
8590
actions: PropTypes.node,
91+
className: PropTypes.string,
8692
children: PropTypes.node,
8793
label: PropTypes.node,
8894
onChange: PropTypes.func,

Diff for: src/components/Field/FieldContainer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
interface FieldContainerProps extends React.HTMLAttributes<HTMLDivElement> {
5+
export interface FieldContainerProps extends React.HTMLAttributes<HTMLDivElement> {
66
toggles?: boolean;
77
}
88

Diff for: __tests__/FieldBase.test.tsx renamed to src/components/Field/__tests__/FieldBase.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react';
22
import { mount, render } from 'enzyme';
3-
import FieldBase from '@/components/Field/FieldBase';
4-
import { Variant } from '@/components';
5-
import { FieldContext } from '@/components/Field/FieldContext';
3+
import FieldBase from '../FieldBase';
4+
import { Variant } from '../../utils';
5+
import { FieldContext } from '../FieldContext';
66

77
describe('FieldBase test', () => {
88
it('should render field base', () => {

Diff for: __tests__/FieldContainer.test.tsx renamed to src/components/Field/__tests__/FieldContainer.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from 'enzyme';
22
import React from 'react';
3-
import FieldContainer from '@/components/Field/FieldContainer';
3+
import FieldContainer from '../FieldContainer';
44

55
describe('FieldBase test', () => {
66
it('should render field container', () => {

Diff for: __tests__/FieldContext.test.tsx renamed to src/components/Field/__tests__/FieldContext.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { render } from 'enzyme';
3-
import { FieldContext } from '@/components/Field/FieldContext';
3+
import { FieldContext } from '../FieldContext';
44

55
describe('FieldContext test', () => {
66
it('should use default values when no consumer used', () => {

Diff for: src/components/Field/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export { default as FieldBase, propTypes } from './FieldBase';
2+
export type { FieldBaseProps } from './FieldBase';
3+
4+
export { default as FieldContainer } from './FieldContainer';
5+
export type { FieldContainerProps } from './FieldContainer';
6+
7+
export { FieldContext } from './FieldContext';
8+
export type { FieldContextProps } from './FieldContext';
9+

Diff for: src/components/Form/Group.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
interface FormGroupProps extends React.HTMLAttributes<HTMLDivElement> {
6-
}
5+
export type FormGroupProps = React.HTMLAttributes<HTMLDivElement>;
76

87
const FormGroup = React.forwardRef<HTMLDivElement, FormGroupProps>((
98
{

Diff for: src/components/Form/Label.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
type FormLabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
5+
export type FormLabelProps = React.LabelHTMLAttributes<HTMLLabelElement>;
66

77
const FormLabel = React.forwardRef<HTMLLabelElement, FormLabelProps>((
88
{

Diff for: src/components/Form/Message.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
interface FormMessageProps extends React.HTMLAttributes<HTMLDivElement> {
5+
export interface FormMessageProps extends React.HTMLAttributes<HTMLDivElement> {
66
className?: string;
77
valid?: boolean;
88
}

Diff for: __tests__/Form.test.tsx renamed to src/components/Form/__tests__/Form.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { render } from 'enzyme';
22
import React from 'react';
3-
import FormGroup from '@/components/Form/Group';
4-
import FormLabel from '@/components/Form/Label';
5-
import FormMessage from '@/components/Form/Message';
3+
import FormGroup from '../Group';
4+
import FormLabel from '../Label';
5+
import FormMessage from '../Message';
66

77
describe('Form test', () => {
88
it('should render form-group', () => {

Diff for: src/components/Form/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export { default as FormGroup } from './Group';
2+
export type { FormGroupProps } from './Group';
3+
4+
export { default as FormLabel } from './Label';
5+
export type { FormLabelProps } from './Label';
6+
7+
export { default as FormMessage } from './Message';
8+
export type { FormMessageProps } from './Message';

Diff for: src/components/Grid/Grid.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
5+
export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
66
columns?: string | number;
77
gap?: string | number;
88
rows?: string | number;

Diff for: src/components/Grid/Row.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44

5-
type RowProps = React.HTMLAttributes<HTMLDivElement>;
5+
export type RowProps = React.HTMLAttributes<HTMLDivElement>;
66

77
const Row = React.forwardRef<HTMLDivElement, RowProps>((
88
{

Diff for: __tests__/Grid.test.tsx renamed to src/components/Grid/__tests__/Grid.test.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { render } from 'enzyme';
22
import React from 'react';
3-
import { Col, Grid, Row } from '@/components';
3+
import Col from '../Col';
4+
import Grid from '../Grid';
5+
import Row from '../Row';
46

57
describe('Grid test', () => {
68
it('should render grid', () => {

Diff for: src/components/Grid/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
export { default as Grid } from './Grid';
2+
export type { GridProps } from './Grid';
3+
24
export { default as Row } from './Row';
5+
export type { RowProps } from './Row';
6+
37
export { default as Col } from './Col';
8+
export type { ColProps } from './Col';

Diff for: src/components/Icon/Icon.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from 'react';
22
import PropTypes from 'prop-types';
33
import clsx from 'clsx';
4-
import { IconName } from '@/components/Icon/IconName';
4+
import { IconName } from './IconName';
55

6-
interface IconProps extends React.HTMLAttributes<HTMLElement> {
6+
export interface IconProps extends React.HTMLAttributes<HTMLElement> {
77
icon: IconName | string;
88
size?: string | number;
99
}

Diff for: __tests__/Icon.test.tsx renamed to src/components/Icon/__tests__/Icon.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render } from 'enzyme';
2-
import { Icon } from '@/components';
32
import React from 'react';
3+
import Icon from '../Icon';
44

55
describe('Icon test', () => {
66
it('should render icon', () => {

Diff for: src/components/Icon/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
export { default as Icon } from './Icon';
2+
export type { IconProps } from './Icon';
3+
4+
export type { IconName } from './IconName'

Diff for: src/components/Modal/Modal.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
33
import clsx from 'clsx';
44
import { createPortal } from 'react-dom';
55
import { useEffect, useRef, useState } from 'react';
6-
import { mergeRefs } from '@/components/utils/mergeRefs';
7-
import { ModalManager } from '@/components/Modal/modalManager';
6+
import { ModalManager } from './modalManager';
7+
import { mergeRefs } from '../utils/mergeRefs';
88

99
let modalManager: ModalManager;
1010

Diff for: src/components/Modal/__tests__/Modal.test.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { mount } from 'enzyme';
3-
import { Modal } from '@/components';
4-
import { ModalProps } from '@/components/Modal/Modal';
3+
import Modal, { ModalProps } from '../Modal';
54

65
describe('Test modal', function (): void {
76
it('should render modal', (): void => {

Diff for: src/components/Modal/__tests__/modalManager.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ModalManager } from '@/components/Modal/modalManager';
21
import { createRef } from 'react';
2+
import { ModalManager } from '../modalManager';
33

44
describe('Test modalManager', function () {
55
it('should add backdrop if modal needs it', () => {

Diff for: src/components/Modal/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export { default as Modal, getManager } from './Modal';
2+
export type { ModalProps } from './Modal';
3+
4+
export type { StoredModal } from './modalManager';

Diff for: src/components/Modal/index.tsx

-1
This file was deleted.

Diff for: src/components/Overlay/index.tsx renamed to src/components/Overlay/Overlay.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import PropTypes from 'prop-types';
1111
import { Modifier } from '@popperjs/core/lib/types';
1212
import clsx from 'clsx';
1313
import { AnimationFeature, ExitFeature, HTMLMotionProps, m as motion, MotionConfig } from 'framer-motion';
14-
import { motionsMap } from '@/components/animations/motionsMap';
14+
import { motionsMap } from '../animations';
1515

16-
interface OverlayProps {
16+
export interface OverlayProps {
1717
className?: string;
1818
triggerRef: React.MutableRefObject<HTMLElement | undefined>;
1919
placement?: Placement;

0 commit comments

Comments
 (0)