fhir-react 0.3.9 → 0.3.10

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.
Files changed (53) hide show
  1. package/.storybook/main.js +5 -0
  2. package/.storybook/manager.js +6 -0
  3. package/.storybook/preview.js +7 -0
  4. package/README.md +1 -1
  5. package/package.json +5 -4
  6. package/src/components/containers/Accordion/Accordion.stories.js +74 -58
  7. package/src/components/containers/ResourceContainer/ResourceContainer.stories.js +43 -41
  8. package/src/components/defaultArgTypes.js +12 -0
  9. package/src/components/resources/AdverseEvent/AdverseEvent.stories.js +17 -19
  10. package/src/components/resources/AllergyIntolerance/AllergyIntolerance.stories.js +46 -70
  11. package/src/components/resources/Appointment/Appointment.stories.js +51 -62
  12. package/src/components/resources/Binary/Binary.stories.js +27 -21
  13. package/src/components/resources/Bundle/Bundle.stories.js +59 -49
  14. package/src/components/resources/CarePlan/CarePlan.stories.js +44 -54
  15. package/src/components/resources/CareTeam/CareTeam.stories.js +22 -28
  16. package/src/components/resources/Claim/Claim.stories.js +36 -49
  17. package/src/components/resources/ClaimResponse/ClaimResponse.stories.js +42 -52
  18. package/src/components/resources/Condition/Condition.stories.js +47 -62
  19. package/src/components/resources/Coverage/Coverage.stories.js +38 -50
  20. package/src/components/resources/Device/Device.stories.js +40 -52
  21. package/src/components/resources/DiagnosticReport/DiagnosticReport.stories.js +38 -50
  22. package/src/components/resources/DocumentReference/DocumentReference.stories.js +25 -29
  23. package/src/components/resources/Encounter/Encounter.stories.js +43 -59
  24. package/src/components/resources/ExplanationOfBenefit/ExplanationOfBenefit.stories.js +53 -67
  25. package/src/components/resources/ExplanationOfBenefitGraph/ExplanationOfBenefitGraph.stories.js +74 -38
  26. package/src/components/resources/FamilyMemberHistory/FamilyMemberHistory.stories.js +22 -28
  27. package/src/components/resources/Generic/Generic.stories.js +21 -12
  28. package/src/components/resources/Goal/Goal.stories.js +35 -49
  29. package/src/components/resources/Immunization/Immunization.stories.js +38 -51
  30. package/src/components/resources/List/List.stories.js +66 -70
  31. package/src/components/resources/Location/Location.stories.js +23 -18
  32. package/src/components/resources/Medication/Medication.stories.js +42 -64
  33. package/src/components/resources/MedicationAdministration/MedicationAdministration.stories.js +32 -46
  34. package/src/components/resources/MedicationDispense/MedicationDispense.stories.js +39 -57
  35. package/src/components/resources/MedicationKnowledge/MedicationKnowledge.stories.js +49 -58
  36. package/src/components/resources/MedicationOrder/MedicationOrder.stories.js +11 -4
  37. package/src/components/resources/MedicationRequest/MedicationRequest.stories.js +27 -30
  38. package/src/components/resources/MedicationStatement/MedicationStatement.stories.js +32 -46
  39. package/src/components/resources/Observation/Observation.stories.js +39 -33
  40. package/src/components/resources/Organization/Organization.stories.js +40 -52
  41. package/src/components/resources/Patient/Patient.stories.js +36 -28
  42. package/src/components/resources/Practitioner/Practitioner.stories.js +39 -52
  43. package/src/components/resources/PractitionerRole/PractitionerRole.stories.js +43 -63
  44. package/src/components/resources/Procedure/Procedure.stories.js +33 -25
  45. package/src/components/resources/Questionnaire/Questionnaire.stories.js +47 -62
  46. package/src/components/resources/QuestionnaireResponse/QuestionnaireResponse.stories.js +43 -63
  47. package/src/components/resources/ReferralRequest/ReferralRequest.stories.js +20 -20
  48. package/src/components/resources/RelatedPerson/RelatedPerson.stories.js +26 -30
  49. package/src/components/resources/ResearchStudy/ResearchStudy.stories.js +17 -15
  50. package/src/components/resources/ResourceCategory/ResourceCategory.stories.js +40 -27
  51. package/.storybook/addons.js +0 -1
  52. package/.storybook/config.js +0 -26
  53. package/.storybook/presets.js +0 -1
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
3
 
4
4
  import Binary from './Binary';
5
5
 
@@ -13,34 +13,40 @@ import BinaryIcon from '../../../assets/containers/Binary/binary.svg';
13
13
 
14
14
  export default {
15
15
  title: 'Binary',
16
+ component: Binary,
17
+ argTypes: {
18
+ ...defaultArgTypes,
19
+ },
16
20
  };
17
21
 
18
- export const PdfDSTU2 = () => {
19
- const fhirResource = object('Resource', dstu2ExamplePdf);
20
- return (
21
- <Binary
22
- fhirResource={fhirResource}
23
- fhirIcons={require('../../../assets/containers/Binary/binary.svg')}
24
- />
25
- );
22
+ const Template = args => <Binary {...args} />;
23
+
24
+ export const PdfDSTU2 = Template.bind({});
25
+ PdfDSTU2.args = {
26
+ fhirResource: dstu2ExamplePdf,
27
+ fhirIcons: require('../../../assets/containers/Binary/binary.svg'),
26
28
  };
27
29
 
28
- export const JpegDSTU2 = () => {
29
- const fhirResource = object('Resource', dstu2ExampleJpeg);
30
- return <Binary fhirResource={fhirResource} fhirIcons={BinaryIcon} />;
30
+ export const JpegDSTU2 = Template.bind({});
31
+ JpegDSTU2.args = {
32
+ fhirResource: dstu2ExampleJpeg,
33
+ fhirIcons: BinaryIcon,
31
34
  };
32
35
 
33
- export const PdfSTU3 = () => {
34
- const fhirResource = object('Resource', stu3ExamplePdf);
35
- return <Binary fhirResource={fhirResource} fhirIcons={false} />;
36
+ export const PdfSTU3 = Template.bind({});
37
+ PdfSTU3.args = {
38
+ fhirResource: stu3ExamplePdf,
39
+ fhirIcons: false,
36
40
  };
37
41
 
38
- export const JpegSTU3 = () => {
39
- const fhirResource = object('Resource', stu3ExampleJpeg);
40
- return <Binary fhirResource={fhirResource} fhirIcons={'random text'} />;
42
+ export const JpegSTU3 = Template.bind({});
43
+ JpegSTU3.args = {
44
+ fhirResource: stu3ExampleJpeg,
45
+ fhirIcons: 'random text',
41
46
  };
42
47
 
43
- export const JsonSTU3 = () => {
44
- const fhirResource = object('Resource', stu3ExampleJson);
45
- return <Binary fhirResource={fhirResource} fhirIcons={fhirIcons} />;
48
+ export const JsonSTU3 = Template.bind({});
49
+ JsonSTU3.args = {
50
+ fhirResource: stu3ExampleJson,
51
+ fhirIcons: fhirIcons,
46
52
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
3
 
4
4
  import Bundle from './Bundle';
5
5
 
@@ -19,77 +19,87 @@ import fhirVersions from '../fhirResourceVersions';
19
19
 
20
20
  export default {
21
21
  title: 'Bundle',
22
+ component: Bundle,
23
+ argTypes: {
24
+ ...defaultArgTypes,
25
+ },
22
26
  };
23
27
 
24
- export const Example1OfDSTU2 = () => {
25
- const fhirResource = object('Resource', dstu2Example1);
26
- return (
27
- <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.DSTU2} />
28
- );
28
+ const Template = args => <Bundle {...args} />;
29
+
30
+ export const Example1OfDSTU2 = Template.bind({});
31
+ Example1OfDSTU2.args = {
32
+ fhirVersion: fhirVersions.DSTU2,
33
+ fhirResource: dstu2Example1,
29
34
  };
30
35
 
31
- export const Example2OfDSTU2 = () => {
32
- const fhirResource = object('Resource', dstu2Example2);
33
- return (
34
- <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.DSTU2} />
35
- );
36
+ export const Example2OfDSTU2 = Template.bind({});
37
+ Example2OfDSTU2.args = {
38
+ fhirVersion: fhirVersions.DSTU2,
39
+ fhirResource: dstu2Example2,
36
40
  };
37
41
 
38
- export const Example3OfDSTU2 = () => {
39
- const fhirResource = object('Resource', dstu2Example3);
40
- return (
41
- <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.DSTU2} />
42
- );
42
+ export const Example3OfDSTU2 = Template.bind({});
43
+ Example3OfDSTU2.args = {
44
+ fhirVersion: fhirVersions.DSTU2,
45
+ fhirResource: dstu2Example3,
43
46
  };
44
47
 
45
- export const Example4OfDSTU2 = () => {
46
- const fhirResource = object('Resource', dstu2Example4);
47
- return (
48
- <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.DSTU2} />
49
- );
48
+ export const Example4OfDSTU2 = Template.bind({});
49
+ Example4OfDSTU2.args = {
50
+ fhirVersion: fhirVersions.DSTU2,
51
+ fhirResource: dstu2Example4,
50
52
  };
51
53
 
52
- export const Example1OfSTU3 = () => {
53
- const fhirResource = object('Resource', stu3Example1);
54
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />;
54
+ export const Example1OfSTU3 = Template.bind({});
55
+ Example1OfSTU3.args = {
56
+ fhirVersion: fhirVersions.STU3,
57
+ fhirResource: stu3Example1,
55
58
  };
56
59
 
57
- export const Example2OfSTU3 = () => {
58
- const fhirResource = object('Resource', stu3Example2);
59
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />;
60
+ export const Example2OfSTU3 = Template.bind({});
61
+ Example2OfSTU3.args = {
62
+ fhirVersion: fhirVersions.STU3,
63
+ fhirResource: stu3Example2,
60
64
  };
61
65
 
62
- export const Example3OfSTU3 = () => {
63
- const fhirResource = object('Resource', stu3Example3);
64
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />;
66
+ export const Example3OfSTU3 = Template.bind({});
67
+ Example3OfSTU3.args = {
68
+ fhirVersion: fhirVersions.STU3,
69
+ fhirResource: stu3Example3,
65
70
  };
66
71
 
67
- export const Example4OfSTU3 = () => {
68
- const fhirResource = object('Resource', stu3Example4);
69
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.STU3} />;
72
+ export const Example4OfSTU3 = Template.bind({});
73
+ Example4OfSTU3.args = {
74
+ fhirVersion: fhirVersions.STU3,
75
+ fhirResource: stu3Example4,
70
76
  };
71
77
 
72
- export const Example1OfR4 = () => {
73
- const fhirResource = object('Resource', r4Example1);
74
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />;
78
+ export const Example1OfR4 = Template.bind({});
79
+ Example1OfR4.args = {
80
+ fhirVersion: fhirVersions.R4,
81
+ fhirResource: r4Example1,
75
82
  };
76
83
 
77
- export const Example2OfR4 = () => {
78
- const fhirResource = object('Resource', r4Example2);
79
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />;
84
+ export const Example2OfR4 = Template.bind({});
85
+ Example2OfR4.args = {
86
+ fhirVersion: fhirVersions.R4,
87
+ fhirResource: r4Example2,
80
88
  };
81
89
 
82
- export const Example3OfR4 = () => {
83
- const fhirResource = object('Resource', r4Example3);
84
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />;
90
+ export const Example3OfR4 = Template.bind({});
91
+ Example3OfR4.args = {
92
+ fhirVersion: fhirVersions.R4,
93
+ fhirResource: r4Example3,
85
94
  };
86
95
 
87
- export const Example4OfR4 = () => {
88
- const fhirResource = object('Resource', r4Example4);
89
- return <Bundle fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />;
96
+ export const Example4OfR4 = Template.bind({});
97
+ Example4OfR4.args = {
98
+ fhirVersion: fhirVersions.R4,
99
+ fhirResource: r4Example4,
90
100
  };
91
101
 
92
- // export const ExampleWithoutFHIRVersionProperty = () => {
93
- // const fhirResource = object('Resource', stu3Example2);
94
- // return <Bundle fhirResource={fhirResource} />;
95
- // };
102
+ export const ExampleWithoutFHIRVersionProperty = Template.bind({});
103
+ ExampleWithoutFHIRVersionProperty.args = {
104
+ fhirResource: stu3Example2,
105
+ };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import fhirVersions from '../fhirResourceVersions';
3
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
4
 
4
5
  import CarePlan from './CarePlan';
5
6
 
@@ -9,73 +10,62 @@ import example2CarePlanSTU3 from '../../../fixtures/stu3/resources/carePlan/exam
9
10
  import weightLossCarePlanR4 from '../../../fixtures/r4/resources/carePlan/weightLossPlan.json';
10
11
  import pregnancyCarePlanR4 from '../../../fixtures/r4/resources/carePlan/pregnancyPlan.json';
11
12
  import heartOperationCarePlanR4 from '../../../fixtures/r4/resources/carePlan/heartOperationPlan.json';
12
- import fhirVersions from '../fhirResourceVersions';
13
+
13
14
  import CarePlanIcon from '../../../assets/containers/CarePlan/care-plan.svg';
14
15
  import fhirIcons from '../../../fixtures/example-icons';
15
16
 
16
- export default { title: 'CarePlan' };
17
+ export default {
18
+ title: 'CarePlan',
19
+ component: CarePlan,
20
+ argTypes: {
21
+ ...defaultArgTypes,
22
+ },
23
+ };
24
+
25
+ const Template = args => <CarePlan {...args} />;
17
26
 
18
- export const DefaultVisualizationDSTU2 = () => {
19
- const fhirResource = object('Resource', exampleCarePlanDSTU2);
20
- return (
21
- <CarePlan
22
- fhirVersion={fhirVersions.DSTU2}
23
- fhirResource={fhirResource}
24
- fhirIcons={require('../../../assets/containers/CarePlan/care-plan.svg')}
25
- />
26
- );
27
+ export const DefaultVisualizationDSTU2 = Template.bind({});
28
+ DefaultVisualizationDSTU2.args = {
29
+ fhirVersion: fhirVersions.DSTU2,
30
+ fhirResource: exampleCarePlanDSTU2,
31
+ fhirIcons: require('../../../assets/containers/CarePlan/care-plan.svg'),
27
32
  };
28
33
 
29
- export const ExampleCarePlanSTU3 = () => {
30
- const fhirResource = object('Resource', exampleCarePlanSTU3);
31
- return (
32
- <CarePlan
33
- fhirVersion={fhirVersions.STU3}
34
- fhirResource={fhirResource}
35
- fhirIcons={CarePlanIcon}
36
- />
37
- );
34
+ export const ExampleCarePlanSTU3 = Template.bind({});
35
+ ExampleCarePlanSTU3.args = {
36
+ fhirVersion: fhirVersions.STU3,
37
+ fhirResource: exampleCarePlanSTU3,
38
+ fhirIcons: CarePlanIcon,
38
39
  };
39
40
 
40
- export const Example2CarePlanSTU3 = () => {
41
- const fhirResource = object('Resource', example2CarePlanSTU3);
42
- return (
43
- <CarePlan
44
- fhirVersion={fhirVersions.STU3}
45
- fhirResource={fhirResource}
46
- fhirIcons={fhirIcons}
47
- />
48
- );
41
+ export const Example2CarePlanSTU3 = Template.bind({});
42
+ Example2CarePlanSTU3.args = {
43
+ fhirVersion: fhirVersions.STU3,
44
+ fhirResource: example2CarePlanSTU3,
45
+ fhirIcons: fhirIcons,
49
46
  };
50
47
 
51
- export const WeightLossCarePlanR4 = () => {
52
- const fhirResource = object('Resource', weightLossCarePlanR4);
53
- return (
54
- <CarePlan
55
- fhirVersion={fhirVersions.R4}
56
- fhirResource={fhirResource}
57
- fhirIcons={false}
58
- />
59
- );
48
+ export const WeightLossCarePlanR4 = Template.bind({});
49
+ WeightLossCarePlanR4.args = {
50
+ fhirVersion: fhirVersions.R4,
51
+ fhirResource: weightLossCarePlanR4,
52
+ fhirIcons: false,
60
53
  };
61
54
 
62
- export const PregnancyCarePlanR4 = () => {
63
- const fhirResource = object('Resource', pregnancyCarePlanR4);
64
- return (
65
- <CarePlan
66
- fhirVersion={fhirVersions.R4}
67
- fhirResource={fhirResource}
68
- fhirIcons={'random text'}
69
- />
70
- );
55
+ export const PregnancyCarePlanR4 = Template.bind({});
56
+ PregnancyCarePlanR4.args = {
57
+ fhirVersion: fhirVersions.R4,
58
+ fhirResource: pregnancyCarePlanR4,
59
+ fhirIcons: 'random text',
71
60
  };
72
61
 
73
- export const HeartOperatioCarePlanR4 = () => {
74
- const fhirResource = object('Resource', heartOperationCarePlanR4);
75
- return <CarePlan fhirVersion={fhirVersions.R4} fhirResource={fhirResource} />;
62
+ export const HeartOperatioCarePlanR4 = Template.bind({});
63
+ HeartOperatioCarePlanR4.args = {
64
+ fhirVersion: fhirVersions.R4,
65
+ fhirResource: heartOperationCarePlanR4,
76
66
  };
77
67
 
78
- export const ExampleWithoutFhirVersionProperty = () => {
79
- const fhirResource = object('Resource', example2CarePlanSTU3);
80
- return <CarePlan fhirResource={fhirResource} />;
68
+ export const ExampleWithoutFhirVersionProperty = Template.bind({});
69
+ ExampleWithoutFhirVersionProperty.args = {
70
+ fhirResource: example2CarePlanSTU3,
81
71
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
3
 
4
4
  import CareTeam from './CareTeam';
5
5
  import fhirVersions from '../fhirResourceVersions';
@@ -12,37 +12,31 @@ import CareTeamIcon from '../../../assets/containers/CareTeam/care-team.svg';
12
12
 
13
13
  export default {
14
14
  title: 'CareTeam',
15
+ component: CareTeam,
16
+ argTypes: {
17
+ ...defaultArgTypes,
18
+ },
15
19
  };
16
20
 
17
- export const ExampleSTU3 = () => {
18
- const fhirResource = object('Resource', example_STU3);
19
- return (
20
- <CareTeam
21
- fhirResource={fhirResource}
22
- fhirVersion={fhirVersions.STU3}
23
- fhirIcons={CareTeamIcon}
24
- />
25
- );
21
+ const Template = args => <CareTeam {...args} />;
22
+
23
+ export const ExampleSTU3 = Template.bind({});
24
+ ExampleSTU3.args = {
25
+ fhirVersion: fhirVersions.STU3,
26
+ fhirResource: example_STU3,
27
+ fhirIcons: CareTeamIcon,
26
28
  };
27
29
 
28
- export const Example2OfSTU3 = () => {
29
- const fhirResource = object('Resource', example2_STU3);
30
- return (
31
- <CareTeam
32
- fhirResource={fhirResource}
33
- fhirVersion={fhirVersions.STU3}
34
- fhirIcons={fhirIcons}
35
- />
36
- );
30
+ export const Example2OfSTU3 = Template.bind({});
31
+ Example2OfSTU3.args = {
32
+ fhirVersion: fhirVersions.STU3,
33
+ fhirResource: example2_STU3,
34
+ fhirIcons: fhirIcons,
37
35
  };
38
36
 
39
- export const ExampleR4 = () => {
40
- const fhirResource = object('Resource', example_R4);
41
- return (
42
- <CareTeam
43
- fhirResource={fhirResource}
44
- fhirVersion={fhirVersions.R4}
45
- fhirIcons={false}
46
- />
47
- );
37
+ export const ExampleR4 = Template.bind({});
38
+ ExampleR4.args = {
39
+ fhirVersion: fhirVersions.R4,
40
+ fhirResource: example_R4,
41
+ fhirIcons: false,
48
42
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
3
 
4
4
  import Claim from './Claim';
5
5
  import fhirVersions from '../fhirResourceVersions';
@@ -16,64 +16,51 @@ import fhirIcons from '../../../fixtures/example-icons';
16
16
 
17
17
  export default {
18
18
  title: 'Claim',
19
+ component: Claim,
20
+ argTypes: {
21
+ ...defaultArgTypes,
22
+ },
19
23
  };
20
24
 
21
- export const ExampleOfDSTU2 = () => {
22
- const fhirResource = object('Resource', dstu2Example1);
23
- return (
24
- <Claim
25
- fhirVersion={fhirVersions.DSTU2}
26
- fhirResource={fhirResource}
27
- fhirIcons={require('../../../assets/containers/Claim/claim.svg')}
28
- />
29
- );
25
+ const Template = args => <Claim {...args} />;
26
+
27
+ export const ExampleOfDSTU2 = Template.bind({});
28
+ ExampleOfDSTU2.args = {
29
+ fhirVersion: fhirVersions.DSTU2,
30
+ fhirResource: dstu2Example1,
31
+ fhirIcons: require('../../../assets/containers/Claim/claim.svg'),
30
32
  };
31
33
 
32
- export const ExampleOfSTU3 = () => {
33
- const fhirResource = object('Resource', stu3Example1);
34
- return (
35
- <Claim
36
- fhirVersion={fhirVersions.STU3}
37
- fhirResource={fhirResource}
38
- fhirIcons={ClaimIcon}
39
- />
40
- );
34
+ export const ExampleOfSTU3 = Template.bind({});
35
+ ExampleOfSTU3.args = {
36
+ fhirVersion: fhirVersions.STU3,
37
+ fhirResource: stu3Example1,
38
+ fhirIcons: ClaimIcon,
41
39
  };
42
40
 
43
- export const Example2OfSTU3 = () => {
44
- const fhirResource = object('Resource', stu3Example2);
45
- return (
46
- <Claim
47
- fhirVersion={fhirVersions.STU3}
48
- fhirResource={fhirResource}
49
- fhirIcons={fhirIcons}
50
- />
51
- );
41
+ export const Example2OfSTU3 = Template.bind({});
42
+ Example2OfSTU3.args = {
43
+ fhirVersion: fhirVersions.STU3,
44
+ fhirResource: stu3Example2,
45
+ fhirIcons: fhirIcons,
52
46
  };
53
47
 
54
- export const Example3OfSTU3 = () => {
55
- const fhirResource = object('Resource', stu3Example3);
56
- return (
57
- <Claim
58
- fhirVersion={fhirVersions.STU3}
59
- fhirResource={fhirResource}
60
- fhirIcons={false}
61
- />
62
- );
48
+ export const Example3OfSTU3 = Template.bind({});
49
+ Example3OfSTU3.args = {
50
+ fhirVersion: fhirVersions.STU3,
51
+ fhirResource: stu3Example3,
52
+ fhirIcons: false,
63
53
  };
64
54
 
65
- export const Example1OfR4 = () => {
66
- const fhirResource = object('Resource', r4Example1);
67
- return (
68
- <Claim
69
- fhirVersion={fhirVersions.R4}
70
- fhirResource={fhirResource}
71
- fhirIcons={'random text'}
72
- />
73
- );
55
+ export const Example1OfR4 = Template.bind({});
56
+ Example1OfR4.args = {
57
+ fhirVersion: fhirVersions.R4,
58
+ fhirResource: r4Example1,
59
+ fhirIcons: 'random text',
74
60
  };
75
61
 
76
- export const Example2OfR4 = () => {
77
- const fhirResource = object('Resource', r4Example2);
78
- return <Claim fhirVersion={fhirVersions.R4} fhirResource={fhirResource} />;
62
+ export const Example2OfR4 = Template.bind({});
63
+ Example2OfR4.args = {
64
+ fhirVersion: fhirVersions.R4,
65
+ fhirResource: r4Example2,
79
66
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { object } from '@storybook/addon-knobs';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
3
 
4
4
  import fhirVersions from '../fhirResourceVersions';
5
5
  import ClaimResponse from './ClaimResponse';
@@ -13,63 +13,53 @@ import example3ClaimResponseR4 from '../../../fixtures/r4/resources/claimRespons
13
13
  import fhirIcons from '../../../fixtures/example-icons';
14
14
  import ClaimResponseIcon from '../../../assets/containers/ClaimResponse/claim-response.svg';
15
15
 
16
- export default { title: 'Claim Response' };
16
+ export default {
17
+ title: 'ClaimResponse',
18
+ component: ClaimResponse,
19
+ argTypes: {
20
+ ...defaultArgTypes,
21
+ },
22
+ };
23
+
24
+ const Template = args => <ClaimResponse {...args} />;
17
25
 
18
- export const ExampleDSTU2 = () => {
19
- const fhirResource = object('Resource', exampleClaimResponseDSTU2);
20
- return (
21
- <ClaimResponse
22
- fhirResource={fhirResource}
23
- fhirVersion={fhirVersions.DSTU2}
24
- fhirIcons={require('../../../assets/containers/ClaimResponse/claim-response.svg')}
25
- />
26
- );
26
+ export const ExampleDSTU2 = Template.bind({});
27
+ ExampleDSTU2.args = {
28
+ fhirVersion: fhirVersions.DSTU2,
29
+ fhirResource: exampleClaimResponseDSTU2,
30
+ fhirIcons: require('../../../assets/containers/ClaimResponse/claim-response.svg'),
27
31
  };
28
32
 
29
- export const Example1OfSTU3 = () => {
30
- const fhirResource = object('Resource', exampleClaimResponseSTU3);
31
- return (
32
- <ClaimResponse
33
- fhirResource={fhirResource}
34
- fhirVersion={fhirVersions.STU3}
35
- fhirIcons={ClaimResponseIcon}
36
- />
37
- );
33
+ export const Example1OfSTU3 = Template.bind({});
34
+ Example1OfSTU3.args = {
35
+ fhirVersion: fhirVersions.STU3,
36
+ fhirResource: exampleClaimResponseSTU3,
37
+ fhirIcons: ClaimResponseIcon,
38
38
  };
39
- export const Example2OfSTU3 = () => {
40
- const fhirResource = object('Resource', example2ClaimResponseSTU3);
41
- return (
42
- <ClaimResponse
43
- fhirResource={fhirResource}
44
- fhirVersion={fhirVersions.STU3}
45
- fhirIcons={fhirIcons}
46
- />
47
- );
39
+
40
+ export const Example2OfSTU3 = Template.bind({});
41
+ Example2OfSTU3.args = {
42
+ fhirVersion: fhirVersions.STU3,
43
+ fhirResource: example2ClaimResponseSTU3,
44
+ fhirIcons: fhirIcons,
48
45
  };
49
46
 
50
- export const Example1OfR4 = () => {
51
- const fhirResource = object('Resource', example1ClaimResponseR4);
52
- return (
53
- <ClaimResponse
54
- fhirResource={fhirResource}
55
- fhirVersion={fhirVersions.R4}
56
- fhirIcons={false}
57
- />
58
- );
47
+ export const Example1OfR4 = Template.bind({});
48
+ Example1OfR4.args = {
49
+ fhirVersion: fhirVersions.R4,
50
+ fhirResource: example1ClaimResponseR4,
51
+ fhirIcons: false,
59
52
  };
60
- export const Example2OfR4 = () => {
61
- const fhirResource = object('Resource', example2ClaimResponseR4);
62
- return (
63
- <ClaimResponse
64
- fhirResource={fhirResource}
65
- fhirVersion={fhirVersions.R4}
66
- fhirIcons={'random text'}
67
- />
68
- );
53
+
54
+ export const Example2OfR4 = Template.bind({});
55
+ Example2OfR4.args = {
56
+ fhirVersion: fhirVersions.R4,
57
+ fhirResource: example2ClaimResponseR4,
58
+ fhirIcons: 'random text',
69
59
  };
70
- export const Example3OfR4 = () => {
71
- const fhirResource = object('Resource', example3ClaimResponseR4);
72
- return (
73
- <ClaimResponse fhirResource={fhirResource} fhirVersion={fhirVersions.R4} />
74
- );
60
+
61
+ export const Example3OfR4 = Template.bind({});
62
+ Example3OfR4.args = {
63
+ fhirVersion: fhirVersions.R4,
64
+ fhirResource: example3ClaimResponseR4,
75
65
  };