@innovaccer/design-system 2.3.0 → 2.4.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/core/components/atoms/backdrop/Backdrop.tsx +11 -1
- package/core/components/atoms/button/Button.tsx +60 -44
- package/core/components/atoms/button/__stories__/IconButtonGroup.story.tsx +4 -4
- package/core/components/atoms/button/__stories__/IconButtonSecondary.story.tsx +1 -1
- package/core/components/atoms/button/__tests__/Button.test.tsx +36 -1
- package/core/components/atoms/dropdown/DropdownList.tsx +1 -0
- package/core/components/atoms/dropdown/Loading.tsx +9 -9
- package/core/components/atoms/dropdown/__stories__/Options.tsx +2 -0
- package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +12 -1
- package/core/components/atoms/dropdown/__tests__/Loading.test.tsx +66 -0
- package/core/components/atoms/dropdown/__tests__/Option.test.tsx +204 -0
- package/core/components/atoms/dropdown/option/CheckboxOption.tsx +1 -0
- package/core/components/atoms/dropdown/option/IconOption.tsx +3 -1
- package/core/components/atoms/dropdown/option/IconWithMetaOption.tsx +3 -1
- package/core/components/atoms/dropdown/option/index.tsx +7 -1
- package/core/components/molecules/dialog/__tests__/__snapshots__/Dialog.test.tsx.snap +13 -0
- package/core/components/molecules/emptyState/__stories__/assets/pageNotLoaded.png +0 -0
- package/core/components/molecules/emptyState/__stories__/variants/noContentAvailable.story.tsx +26 -0
- package/core/components/molecules/emptyState/__stories__/variants/{smallSizeWithButton.story.tsx → noSearchResults.story.tsx} +2 -2
- package/core/components/molecules/emptyState/__stories__/variants/{largeSize.story.tsx → pageNotLoaded.story.tsx} +3 -3
- package/core/components/molecules/fileList/FileIcon.tsx +10 -2
- package/core/components/molecules/fileList/FileListItem.tsx +7 -3
- package/core/components/molecules/fileList/__stories__/__common__/fileListExample.tsx +1 -0
- package/core/components/molecules/fileList/__tests__/FileList.test.tsx +115 -0
- package/core/components/molecules/fileList/__tests__/__snapshots__/FileList.test.tsx.snap +232 -0
- package/core/components/molecules/inputMask/InputMask.tsx +2 -5
- package/core/components/molecules/inputMask/__tests__/InputMask.test.tsx +128 -0
- package/core/components/molecules/inputMask/__tests__/__snapshots__/InputMask.test.tsx.snap +39 -0
- package/core/components/molecules/modal/Modal.tsx +7 -5
- package/core/components/molecules/modal/__tests__/__snapshots__/Modal.test.tsx.snap +18 -0
- package/core/components/molecules/sidesheet/Sidesheet.tsx +5 -3
- package/core/components/molecules/sidesheet/__tests__/__snapshots__/Sidesheet.test.tsx.snap +2 -0
- package/core/components/organisms/calendar/Calendar.tsx +66 -22
- package/core/components/organisms/calendar/__stories__/variants/withEvents.story.tsx +45 -0
- package/core/components/organisms/calendar/__tests__/Calendar.test.tsx +10 -0
- package/core/components/organisms/calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +1096 -1096
- package/core/components/organisms/calendar/config.ts +2 -2
- package/core/components/organisms/calendar/types.ts +1 -0
- package/core/components/organisms/datePicker/DatePicker.tsx +23 -9
- package/core/components/organisms/datePicker/__tests__/{DatePicker.tsx → DatePicker.test.tsx} +16 -1
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +2257 -0
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +2552 -2550
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +75 -0
- package/core/components/organisms/inlineMessage/__stories__/Default.story.tsx +18 -0
- package/core/components/organisms/inlineMessage/__stories__/Error.story.tsx +19 -0
- package/core/components/organisms/inlineMessage/__stories__/Info.story.tsx +19 -0
- package/core/components/organisms/inlineMessage/__stories__/Success.story.tsx +19 -0
- package/core/components/organisms/inlineMessage/__stories__/Warning.story.tsx +18 -0
- package/core/components/organisms/inlineMessage/__stories__/variants/InlineMessageWithinTable.story.tsx +139 -0
- package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +91 -0
- package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap +139 -0
- package/core/components/organisms/inlineMessage/index.tsx +1 -0
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePicker.test.tsx.snap +8 -0
- package/core/index.tsx +2 -0
- package/core/index.type.tsx +1 -0
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +485 -466
- package/css/dist/index.css +72 -8
- package/css/dist/index.css.map +1 -1
- package/css/src/components/calendar.css +37 -5
- package/css/src/components/card.css +1 -1
- package/css/src/components/chipInput.css +2 -2
- package/css/src/components/editableChipInput.css +2 -1
- package/css/src/components/inlineMessage.css +29 -0
- package/dist/core/components/atoms/backdrop/Backdrop.d.ts +1 -0
- package/dist/core/components/atoms/button/Button.d.ts +1 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +28 -27
- package/dist/core/components/organisms/calendar/Calendar.d.ts +6 -1
- package/dist/core/components/organisms/calendar/types.d.ts +3 -0
- package/dist/core/components/organisms/inlineMessage/InlineMessage.d.ts +15 -0
- package/dist/core/components/organisms/inlineMessage/index.d.ts +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- package/dist/index.esm.js +189 -66
- package/dist/index.js +201 -80
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/dts.config.js +13 -0
- package/package.json +4 -2
- package/types/innovaccer-design-system/index.d.ts +39 -0
- package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
- package/types/innovaccer-design-system/tsconfig.json +23 -0
- package/types/innovaccer-design-system/tslint.json +1 -0
- package/core/components/molecules/emptyState/__stories__/variants/smallSizeWithoutButton.story.tsx +0 -21
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.tsx.snap +0 -2164
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { Icon, Text } from '@/index';
|
|
4
|
+
import { BaseProps, extractBaseProps } from '@/utils/types';
|
|
5
|
+
|
|
6
|
+
export type Appearance = 'default' | 'alert' | 'info' | 'success' | 'warning';
|
|
7
|
+
const IconMapping = {
|
|
8
|
+
success: 'check_circle',
|
|
9
|
+
info: 'info',
|
|
10
|
+
warning: 'warning',
|
|
11
|
+
alert: 'error',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export interface InlineMessageProps extends BaseProps {
|
|
15
|
+
/**
|
|
16
|
+
* Color of `Inline Message`
|
|
17
|
+
*/
|
|
18
|
+
appearance: Appearance;
|
|
19
|
+
/**
|
|
20
|
+
* Description of `Inline Message`
|
|
21
|
+
*/
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const InlineMessage = (props: InlineMessageProps) => {
|
|
26
|
+
const {
|
|
27
|
+
appearance,
|
|
28
|
+
className,
|
|
29
|
+
description
|
|
30
|
+
} = props;
|
|
31
|
+
|
|
32
|
+
const baseProps = extractBaseProps(props);
|
|
33
|
+
|
|
34
|
+
const InlineMessageClass = classNames({
|
|
35
|
+
['InlineMessage']: true
|
|
36
|
+
}, className);
|
|
37
|
+
|
|
38
|
+
const IconClass = classNames({
|
|
39
|
+
['InlineMessage-icon']: true,
|
|
40
|
+
['InlineMessage-icon--warning']: appearance === 'warning',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const DescriptionClass = classNames({
|
|
44
|
+
[`InlineMessage-text--${appearance}`]: appearance
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div data-test="DesignSystem-InlineMessage" {...baseProps} className={InlineMessageClass}>
|
|
49
|
+
{appearance !== 'default' && (
|
|
50
|
+
<Icon
|
|
51
|
+
data-test="DesignSystem-InlineMessage--Icon"
|
|
52
|
+
name={IconMapping[appearance]}
|
|
53
|
+
appearance={appearance}
|
|
54
|
+
className={IconClass}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
<div>
|
|
58
|
+
<Text
|
|
59
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
60
|
+
className={DescriptionClass}
|
|
61
|
+
>
|
|
62
|
+
{description}
|
|
63
|
+
</Text>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
InlineMessage.displayName = 'InlineMessage';
|
|
70
|
+
InlineMessage.defaultProps = {
|
|
71
|
+
appearance: 'default',
|
|
72
|
+
description: ''
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default InlineMessage;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InlineMessage, Row, Column } from '@/index';
|
|
3
|
+
|
|
4
|
+
// CSF format story
|
|
5
|
+
export const defaultMessage = () => (
|
|
6
|
+
<Row>
|
|
7
|
+
<Column size="4">
|
|
8
|
+
<InlineMessage
|
|
9
|
+
description="Create a strong, unique password."
|
|
10
|
+
/>
|
|
11
|
+
</Column>
|
|
12
|
+
</Row>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Components/InlineMessage/Default Message',
|
|
17
|
+
component: InlineMessage
|
|
18
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InlineMessage, Row, Column } from '@/index';
|
|
3
|
+
|
|
4
|
+
// CSF format story
|
|
5
|
+
export const alertMessage = () => (
|
|
6
|
+
<Row>
|
|
7
|
+
<Column size="4">
|
|
8
|
+
<InlineMessage
|
|
9
|
+
appearance="alert"
|
|
10
|
+
description="Inline message goes here."
|
|
11
|
+
/>
|
|
12
|
+
</Column>
|
|
13
|
+
</Row>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Components/InlineMessage/Alert Message',
|
|
18
|
+
component: InlineMessage
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InlineMessage, Row, Column } from '@/index';
|
|
3
|
+
|
|
4
|
+
// CSF format story
|
|
5
|
+
export const infoMessage = () => (
|
|
6
|
+
<Row>
|
|
7
|
+
<Column size="4">
|
|
8
|
+
<InlineMessage
|
|
9
|
+
appearance="info"
|
|
10
|
+
description="There are two new referral requests."
|
|
11
|
+
/>
|
|
12
|
+
</Column>
|
|
13
|
+
</Row>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Components/InlineMessage/Info Message',
|
|
18
|
+
component: InlineMessage
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InlineMessage, Row, Column } from '@/index';
|
|
3
|
+
|
|
4
|
+
// CSF format story
|
|
5
|
+
export const successMessage = () => (
|
|
6
|
+
<Row>
|
|
7
|
+
<Column size="4">
|
|
8
|
+
<InlineMessage
|
|
9
|
+
appearance="success"
|
|
10
|
+
description="Inline message goes here."
|
|
11
|
+
/>
|
|
12
|
+
</Column>
|
|
13
|
+
</Row>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Components/InlineMessage/Success Message',
|
|
18
|
+
component: InlineMessage
|
|
19
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { InlineMessage, Row, Column } from '@/index';
|
|
3
|
+
// CSF format story
|
|
4
|
+
export const warningMessage = () => (
|
|
5
|
+
<Row>
|
|
6
|
+
<Column size="4">
|
|
7
|
+
<InlineMessage
|
|
8
|
+
appearance="warning"
|
|
9
|
+
description="Inline message goes here."
|
|
10
|
+
/>
|
|
11
|
+
</Column>
|
|
12
|
+
</Row>
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Components/InlineMessage/Warning Message',
|
|
17
|
+
component: InlineMessage
|
|
18
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TableProps } from '@/index.type';
|
|
3
|
+
import { Card, Table, InlineMessage } from '@/index';
|
|
4
|
+
|
|
5
|
+
const data = [
|
|
6
|
+
{
|
|
7
|
+
name: 'Asthma Outreach',
|
|
8
|
+
firstName: 'Brooke',
|
|
9
|
+
lastName: 'Heeran',
|
|
10
|
+
lastUpdated: 'June 20, 2020',
|
|
11
|
+
recipients: 11846,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
firstName: 'Frazer',
|
|
15
|
+
lastName: 'Cathro',
|
|
16
|
+
lastUpdated: 'June 19, 2020',
|
|
17
|
+
name: 'HbA1c Test due',
|
|
18
|
+
recipients: 12846,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
firstName: 'Lemmie',
|
|
22
|
+
name: 'ER Education',
|
|
23
|
+
lastName: 'Ciric',
|
|
24
|
+
lastUpdated: 'May 19, 2020',
|
|
25
|
+
recipients: 118467,
|
|
26
|
+
}
|
|
27
|
+
];
|
|
28
|
+
|
|
29
|
+
export const InlineMessageWithinTable = () => {
|
|
30
|
+
|
|
31
|
+
const schema: TableProps['schema'] = [
|
|
32
|
+
{
|
|
33
|
+
name: 'name',
|
|
34
|
+
displayName: 'Name',
|
|
35
|
+
width: '30%',
|
|
36
|
+
cellType: 'WITH_META_LIST',
|
|
37
|
+
translate: (a) => ({
|
|
38
|
+
title: a.name,
|
|
39
|
+
metaList: [`${a.recipients} recipients`]
|
|
40
|
+
}),
|
|
41
|
+
sorting: false
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'lastUpdated',
|
|
45
|
+
displayName: 'Last Updated on',
|
|
46
|
+
width: '30%',
|
|
47
|
+
sorting: false,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'user',
|
|
51
|
+
displayName: 'Message',
|
|
52
|
+
sorting: false,
|
|
53
|
+
width: '40%',
|
|
54
|
+
cellRenderer: () => (
|
|
55
|
+
<InlineMessage appearance="info" description="Patient profile updated." />
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<Card>
|
|
62
|
+
<Table
|
|
63
|
+
showMenu={false}
|
|
64
|
+
type="data"
|
|
65
|
+
data={data}
|
|
66
|
+
schema={schema}
|
|
67
|
+
withHeader={false}
|
|
68
|
+
headerOptions={{
|
|
69
|
+
withSearch: false
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
</Card>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const customCode = `
|
|
77
|
+
() => {
|
|
78
|
+
const data = ${JSON.stringify(data.slice(0, 10), null, 4)};
|
|
79
|
+
|
|
80
|
+
const schema = [
|
|
81
|
+
{
|
|
82
|
+
name: 'name',
|
|
83
|
+
displayName: 'Name',
|
|
84
|
+
width: '30%',
|
|
85
|
+
cellType: 'WITH_META_LIST',
|
|
86
|
+
sorting: false,
|
|
87
|
+
translate: (a) => ({
|
|
88
|
+
title: a.name,
|
|
89
|
+
metaList: [\`\${a.recipients} recipients\`]
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'lastUpdated',
|
|
94
|
+
displayName: 'Last Updated on',
|
|
95
|
+
width: '30%',
|
|
96
|
+
sorting: false,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'user',
|
|
100
|
+
displayName: 'Message',
|
|
101
|
+
sorting: false,
|
|
102
|
+
width: '40%',
|
|
103
|
+
cellRenderer: (props) => {
|
|
104
|
+
const { data } = props;
|
|
105
|
+
return (
|
|
106
|
+
<InlineMessage appearance='info' description='Patient profile updated.' />
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<Card>
|
|
114
|
+
<Table
|
|
115
|
+
showMenu={false}
|
|
116
|
+
type="data"
|
|
117
|
+
data={data}
|
|
118
|
+
schema={schema}
|
|
119
|
+
withHeader={false}
|
|
120
|
+
headerOptions={{
|
|
121
|
+
withSearch: false
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
</Card>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
`;
|
|
128
|
+
|
|
129
|
+
export default {
|
|
130
|
+
title: 'Components/InlineMessage/Variants/Inline Message Within Table',
|
|
131
|
+
component: InlineMessage,
|
|
132
|
+
parameters: {
|
|
133
|
+
docs: {
|
|
134
|
+
docPage: {
|
|
135
|
+
customCode,
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
|
+
import { testHelper, filterUndefined, valueHelper, testMessageHelper } from '@/utils/testHelper';
|
|
4
|
+
import { Appearance, InlineMessage } from '../InlineMessage';
|
|
5
|
+
import { InlineMessageProps as Props } from '@/index.type';
|
|
6
|
+
|
|
7
|
+
const appearance: Appearance[] = [
|
|
8
|
+
'default',
|
|
9
|
+
'alert',
|
|
10
|
+
'info',
|
|
11
|
+
'success',
|
|
12
|
+
'warning'
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
const description = 'Inline Message here.';
|
|
16
|
+
|
|
17
|
+
describe('InlineMessage component', () => {
|
|
18
|
+
const mapper: Record<string, any> = {
|
|
19
|
+
appearance: valueHelper(appearance, { required: true, iterate: true }),
|
|
20
|
+
description: valueHelper(description, { required: true })
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const testFunc = (props: Record<string, any>): void => {
|
|
24
|
+
const attr = filterUndefined(props) as Props;
|
|
25
|
+
|
|
26
|
+
it(testMessageHelper(attr), () => {
|
|
27
|
+
const { baseElement } = render(
|
|
28
|
+
<InlineMessage
|
|
29
|
+
{...attr}
|
|
30
|
+
/>
|
|
31
|
+
);
|
|
32
|
+
expect(baseElement).toMatchSnapshot();
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
testHelper(mapper, testFunc);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('InlineMessage Component with overwrite class', () => {
|
|
40
|
+
it('overwrite InlineMessage class', () => {
|
|
41
|
+
const { getByTestId } = render(<InlineMessage className="CustomClass" />);
|
|
42
|
+
expect(getByTestId('DesignSystem-InlineMessage')).toHaveClass('CustomClass');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
describe('InlineMessage component with prop:appearance', () => {
|
|
47
|
+
appearance.forEach((color) => {
|
|
48
|
+
it(`should have the InlineMessage-text--${color} class when appearance=${color} `, () => {
|
|
49
|
+
const { getByTestId } = render(<InlineMessage appearance={color} />);
|
|
50
|
+
expect(getByTestId('DesignSystem-InlineMessage--Description')).toHaveClass(`InlineMessage-text--${color}`);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
describe('InlineMessage component ', () => {
|
|
56
|
+
|
|
57
|
+
it('check for icon when appearance:default', () => {
|
|
58
|
+
render(<InlineMessage appearance="default" description={description} />);
|
|
59
|
+
const IconComponent = screen.queryByText('DesignSystem-InlineMessage--Icon');
|
|
60
|
+
expect(IconComponent).not.toBeInTheDocument();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('render component when appearance is not default', () => {
|
|
64
|
+
const { getByTestId } = render(
|
|
65
|
+
<InlineMessage
|
|
66
|
+
appearance="info"
|
|
67
|
+
description={description}
|
|
68
|
+
/>
|
|
69
|
+
);
|
|
70
|
+
const descriptionID = getByTestId('DesignSystem-InlineMessage--Description');
|
|
71
|
+
expect(descriptionID).toBeInTheDocument();
|
|
72
|
+
expect(descriptionID.textContent).toMatch(description);
|
|
73
|
+
expect(getByTestId('DesignSystem-InlineMessage--Icon')).toBeInTheDocument();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('check for icon in case of default props', () => {
|
|
77
|
+
render(<InlineMessage />);
|
|
78
|
+
|
|
79
|
+
const IconComponent = screen.queryByText('DesignSystem-InlineMessage--Icon');
|
|
80
|
+
expect(IconComponent).not.toBeInTheDocument();
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('check for description in case of default props', () => {
|
|
84
|
+
const { getByTestId } = render(<InlineMessage />);
|
|
85
|
+
|
|
86
|
+
const descriptionID = getByTestId('DesignSystem-InlineMessage--Description');
|
|
87
|
+
expect(descriptionID).toBeInTheDocument();
|
|
88
|
+
expect(descriptionID).toHaveClass('InlineMessage-text--default');
|
|
89
|
+
expect(descriptionID.textContent).toMatch('');
|
|
90
|
+
});
|
|
91
|
+
});
|
package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InlineMessage component
|
|
4
|
+
appearance: "alert", description: "Inline Message here."
|
|
5
|
+
1`] = `
|
|
6
|
+
<body>
|
|
7
|
+
<div>
|
|
8
|
+
<div
|
|
9
|
+
class="InlineMessage"
|
|
10
|
+
data-test="DesignSystem-InlineMessage"
|
|
11
|
+
>
|
|
12
|
+
<i
|
|
13
|
+
class="material-icons material-icons-round Icon Icon--alert InlineMessage-icon"
|
|
14
|
+
data-test="DesignSystem-InlineMessage--Icon"
|
|
15
|
+
style="font-size: 16px; width: 16px;"
|
|
16
|
+
>
|
|
17
|
+
error_round
|
|
18
|
+
</i>
|
|
19
|
+
<div>
|
|
20
|
+
<span
|
|
21
|
+
class="Text Text--default Text--regular InlineMessage-text--alert"
|
|
22
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
23
|
+
>
|
|
24
|
+
Inline Message here.
|
|
25
|
+
</span>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</body>
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
exports[`InlineMessage component
|
|
33
|
+
appearance: "default", description: "Inline Message here."
|
|
34
|
+
1`] = `
|
|
35
|
+
<body>
|
|
36
|
+
<div>
|
|
37
|
+
<div
|
|
38
|
+
class="InlineMessage"
|
|
39
|
+
data-test="DesignSystem-InlineMessage"
|
|
40
|
+
>
|
|
41
|
+
<div>
|
|
42
|
+
<span
|
|
43
|
+
class="Text Text--default Text--regular InlineMessage-text--default"
|
|
44
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
45
|
+
>
|
|
46
|
+
Inline Message here.
|
|
47
|
+
</span>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</body>
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
exports[`InlineMessage component
|
|
55
|
+
appearance: "info", description: "Inline Message here."
|
|
56
|
+
1`] = `
|
|
57
|
+
<body>
|
|
58
|
+
<div>
|
|
59
|
+
<div
|
|
60
|
+
class="InlineMessage"
|
|
61
|
+
data-test="DesignSystem-InlineMessage"
|
|
62
|
+
>
|
|
63
|
+
<i
|
|
64
|
+
class="material-icons material-icons-round Icon Icon--info InlineMessage-icon"
|
|
65
|
+
data-test="DesignSystem-InlineMessage--Icon"
|
|
66
|
+
style="font-size: 16px; width: 16px;"
|
|
67
|
+
>
|
|
68
|
+
info_round
|
|
69
|
+
</i>
|
|
70
|
+
<div>
|
|
71
|
+
<span
|
|
72
|
+
class="Text Text--default Text--regular InlineMessage-text--info"
|
|
73
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
74
|
+
>
|
|
75
|
+
Inline Message here.
|
|
76
|
+
</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</body>
|
|
81
|
+
`;
|
|
82
|
+
|
|
83
|
+
exports[`InlineMessage component
|
|
84
|
+
appearance: "success", description: "Inline Message here."
|
|
85
|
+
1`] = `
|
|
86
|
+
<body>
|
|
87
|
+
<div>
|
|
88
|
+
<div
|
|
89
|
+
class="InlineMessage"
|
|
90
|
+
data-test="DesignSystem-InlineMessage"
|
|
91
|
+
>
|
|
92
|
+
<i
|
|
93
|
+
class="material-icons material-icons-round Icon Icon--success InlineMessage-icon"
|
|
94
|
+
data-test="DesignSystem-InlineMessage--Icon"
|
|
95
|
+
style="font-size: 16px; width: 16px;"
|
|
96
|
+
>
|
|
97
|
+
check_circle_round
|
|
98
|
+
</i>
|
|
99
|
+
<div>
|
|
100
|
+
<span
|
|
101
|
+
class="Text Text--default Text--regular InlineMessage-text--success"
|
|
102
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
103
|
+
>
|
|
104
|
+
Inline Message here.
|
|
105
|
+
</span>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
</body>
|
|
110
|
+
`;
|
|
111
|
+
|
|
112
|
+
exports[`InlineMessage component
|
|
113
|
+
appearance: "warning", description: "Inline Message here."
|
|
114
|
+
1`] = `
|
|
115
|
+
<body>
|
|
116
|
+
<div>
|
|
117
|
+
<div
|
|
118
|
+
class="InlineMessage"
|
|
119
|
+
data-test="DesignSystem-InlineMessage"
|
|
120
|
+
>
|
|
121
|
+
<i
|
|
122
|
+
class="material-icons material-icons-round Icon Icon--warning InlineMessage-icon InlineMessage-icon--warning"
|
|
123
|
+
data-test="DesignSystem-InlineMessage--Icon"
|
|
124
|
+
style="font-size: 16px; width: 16px;"
|
|
125
|
+
>
|
|
126
|
+
warning_round
|
|
127
|
+
</i>
|
|
128
|
+
<div>
|
|
129
|
+
<span
|
|
130
|
+
class="Text Text--default Text--regular InlineMessage-text--warning"
|
|
131
|
+
data-test="DesignSystem-InlineMessage--Description"
|
|
132
|
+
>
|
|
133
|
+
Inline Message here.
|
|
134
|
+
</span>
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</body>
|
|
139
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InlineMessage';
|
package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePicker.test.tsx.snap
CHANGED
|
@@ -7,6 +7,7 @@ exports[`TimePicker component prop:inputFormat snapshot
|
|
|
7
7
|
<div>
|
|
8
8
|
<div
|
|
9
9
|
class="d-flex flex-column flex-grow-1"
|
|
10
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
10
11
|
>
|
|
11
12
|
<div
|
|
12
13
|
class="Input Input--regular"
|
|
@@ -45,6 +46,7 @@ exports[`TimePicker component prop:inputFormat snapshot
|
|
|
45
46
|
<div>
|
|
46
47
|
<div
|
|
47
48
|
class="d-flex flex-column flex-grow-1"
|
|
49
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
48
50
|
>
|
|
49
51
|
<div
|
|
50
52
|
class="Input Input--regular"
|
|
@@ -83,6 +85,7 @@ exports[`TimePicker component prop:outputFormat snapshot
|
|
|
83
85
|
<div>
|
|
84
86
|
<div
|
|
85
87
|
class="d-flex flex-column flex-grow-1"
|
|
88
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
86
89
|
>
|
|
87
90
|
<div
|
|
88
91
|
class="Input Input--regular"
|
|
@@ -121,6 +124,7 @@ exports[`TimePicker component prop:outputFormat snapshot
|
|
|
121
124
|
<div>
|
|
122
125
|
<div
|
|
123
126
|
class="d-flex flex-column flex-grow-1"
|
|
127
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
124
128
|
>
|
|
125
129
|
<div
|
|
126
130
|
class="Input Input--regular"
|
|
@@ -159,6 +163,7 @@ exports[`TimePicker component prop:time snapshot
|
|
|
159
163
|
<div>
|
|
160
164
|
<div
|
|
161
165
|
class="d-flex flex-column flex-grow-1"
|
|
166
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
162
167
|
>
|
|
163
168
|
<div
|
|
164
169
|
class="Input Input--regular"
|
|
@@ -208,6 +213,7 @@ exports[`TimePicker component prop:time snapshot
|
|
|
208
213
|
<div>
|
|
209
214
|
<div
|
|
210
215
|
class="d-flex flex-column flex-grow-1"
|
|
216
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
211
217
|
>
|
|
212
218
|
<div
|
|
213
219
|
class="Input Input--regular"
|
|
@@ -257,6 +263,7 @@ exports[`TimePicker component prop:validators snapshot
|
|
|
257
263
|
<div>
|
|
258
264
|
<div
|
|
259
265
|
class="d-flex flex-column flex-grow-1"
|
|
266
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
260
267
|
>
|
|
261
268
|
<div
|
|
262
269
|
class="Input Input--regular"
|
|
@@ -295,6 +302,7 @@ exports[`TimePicker component prop:validators snapshot
|
|
|
295
302
|
<div>
|
|
296
303
|
<div
|
|
297
304
|
class="d-flex flex-column flex-grow-1"
|
|
305
|
+
data-test="DesignSystem-InputMask--Wrapper"
|
|
298
306
|
>
|
|
299
307
|
<div
|
|
300
308
|
class="Input Input--regular"
|
package/core/index.tsx
CHANGED
|
@@ -79,5 +79,7 @@ export { Navigation } from './components/organisms/navigation';
|
|
|
79
79
|
export { PageHeader } from './components/organisms/pageHeader';
|
|
80
80
|
export { FileList } from './components/molecules/fileList';
|
|
81
81
|
export { VerificationCodeInput } from './components/molecules/verificationCodeInput';
|
|
82
|
+
export { InlineMessage } from './components/organisms/inlineMessage';
|
|
83
|
+
|
|
82
84
|
// @ts-ignore
|
|
83
85
|
export { version } from '../package.json';
|
package/core/index.type.tsx
CHANGED
|
@@ -77,3 +77,4 @@ export { NavigationProps } from './components/organisms/navigation';
|
|
|
77
77
|
export { PageHeaderProps } from './components/organisms/pageHeader';
|
|
78
78
|
export { FileListProps } from './components/molecules/fileList';
|
|
79
79
|
export { VerificationCodeInputProps } from './components/molecules/verificationCodeInput';
|
|
80
|
+
export { InlineMessageProps } from './components/organisms/inlineMessage';
|