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 RelatedPerson from './RelatedPerson';
5
5
  import fhirVersions from '../fhirResourceVersions';
@@ -10,37 +10,33 @@ import exampleR4 from '../../../fixtures/r4/resources/relatedPerson/example1.jso
10
10
 
11
11
  import fhirIcons from '../../../fixtures/example-icons';
12
12
 
13
- export default { title: 'RelatedPerson' };
14
-
15
- export const ExampleDSTU2 = () => {
16
- const fhirResource = object('Resource', exampleDSTU2);
17
- return (
18
- <RelatedPerson
19
- fhirResource={fhirResource}
20
- fhirVersion={fhirVersions.DSTU2}
21
- fhirIcons={fhirIcons}
22
- />
23
- );
13
+ export default {
14
+ title: 'RelatedPerson',
15
+ component: RelatedPerson,
16
+ argTypes: {
17
+ ...defaultArgTypes,
18
+ },
24
19
  };
25
20
 
26
- export const ExampleSTU3 = () => {
27
- const fhirResource = object('Resource', exampleSTU3);
28
- return (
29
- <RelatedPerson
30
- fhirResource={fhirResource}
31
- fhirVersion={fhirVersions.STU3}
32
- fhirIcons={false}
33
- />
34
- );
21
+ const Template = args => <RelatedPerson {...args} />;
22
+
23
+ export const ExampleDSTU2 = Template.bind({});
24
+ ExampleDSTU2.args = {
25
+ fhirVersion: fhirVersions.DSTU2,
26
+ fhirResource: exampleDSTU2,
27
+ fhirIcons: fhirIcons,
28
+ };
29
+
30
+ export const ExampleSTU3 = Template.bind({});
31
+ ExampleSTU3.args = {
32
+ fhirVersion: fhirVersions.STU3,
33
+ fhirResource: exampleSTU3,
34
+ fhirIcons: false,
35
35
  };
36
36
 
37
- export const ExampleR4 = () => {
38
- const fhirResource = object('Resource', exampleR4);
39
- return (
40
- <RelatedPerson
41
- fhirResource={fhirResource}
42
- fhirVersion={fhirVersions.R4}
43
- fhirIcons={'random text'}
44
- />
45
- );
37
+ export const ExampleR4 = Template.bind({});
38
+ ExampleR4.args = {
39
+ fhirVersion: fhirVersions.R4,
40
+ fhirResource: exampleR4,
41
+ fhirIcons: 'random text',
46
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 ResearchStudy from './ResearchStudy';
5
5
  import fhirVersions from '../fhirResourceVersions';
@@ -10,22 +10,24 @@ import fhirIcons from '../../../fixtures/example-icons';
10
10
 
11
11
  export default {
12
12
  title: 'ResearchStudy',
13
+ component: ResearchStudy,
14
+ argTypes: {
15
+ ...defaultArgTypes,
16
+ },
13
17
  };
14
18
 
15
- export const ExampleOfSTU3 = () => {
16
- const fhirResource = object('Resource', stu3Example1);
17
- return (
18
- <ResearchStudy
19
- fhirVersion={fhirVersions.STU3}
20
- fhirResource={fhirResource}
21
- fhirIcons={fhirIcons}
22
- />
23
- );
19
+ const Template = args => <ResearchStudy {...args} />;
20
+
21
+ export const ExampleOfSTU3 = Template.bind({});
22
+ ExampleOfSTU3.args = {
23
+ fhirVersion: fhirVersions.STU3,
24
+ fhirResource: stu3Example1,
25
+ fhirIcons: fhirIcons,
24
26
  };
25
27
 
26
- export const ExampleOfR4 = () => {
27
- const fhirResource = object('Resource', r4Example1);
28
- return (
29
- <ResearchStudy fhirVersion={fhirVersions.R4} fhirResource={fhirResource} />
30
- );
28
+ export const ExampleOfR4 = Template.bind({});
29
+ ExampleOfR4.args = {
30
+ fhirVersion: fhirVersions.R4,
31
+ fhirResource: r4Example1,
32
+ fhirIcons: false,
31
33
  };
@@ -1,40 +1,53 @@
1
1
  import React from 'react';
2
+ import { defaultArgTypes } from '../../defaultArgTypes';
3
+
2
4
  import ResourceCategory from './ResourceCategory';
3
5
  import fhirIcons from '../../../fixtures/example-icons';
4
6
  import ResourceCategoryIcon from '../../../assets/containers/ResourceCategory/resource-category.svg';
5
7
 
6
- export default { title: 'ResourceCategory' };
8
+ export default {
9
+ title: 'ResourceCategory',
10
+ component: ResourceCategory,
11
+ argTypes: {
12
+ ...defaultArgTypes,
13
+ itemsCount: {
14
+ table: {
15
+ disable: true,
16
+ },
17
+ },
18
+ title: {
19
+ table: {
20
+ disable: true,
21
+ },
22
+ },
23
+ },
24
+ };
25
+
26
+ const Template = args => <ResourceCategory {...args} />;
7
27
 
8
- export const ExampleWithAllProperties = () => {
9
- return (
10
- <ResourceCategory
11
- itemsCount={41}
12
- title="Resource name"
13
- fhirIcons={require('../../../assets/containers/ResourceCategory/resource-category.svg')}
14
- />
15
- );
28
+ export const ExampleWithAllProperties = Template.bind({});
29
+ ExampleWithAllProperties.args = {
30
+ itemsCount: 41,
31
+ title: 'Resource name',
32
+ fhirIcons: require('../../../assets/containers/ResourceCategory/resource-category.svg'),
16
33
  };
17
34
 
18
- export const ExampleWith1Item = () => {
19
- return (
20
- <ResourceCategory
21
- itemsCount={'1'}
22
- title="Resource name"
23
- fhirIcons={ResourceCategoryIcon}
24
- />
25
- );
35
+ export const ExampleWith1Item = Template.bind({});
36
+ ExampleWith1Item.args = {
37
+ itemsCount: '1',
38
+ title: 'Resource name',
39
+ fhirIcons: ResourceCategoryIcon,
26
40
  };
27
41
 
28
- export const ExampleWithoutItemsCount = () => {
29
- return <ResourceCategory title="Resource name" fhirIcons={fhirIcons} />;
42
+ export const ExampleWithoutItemsCount = Template.bind({});
43
+ ExampleWithoutItemsCount.args = {
44
+ title: 'Resource name',
45
+ fhirIcons: fhirIcons,
30
46
  };
31
47
 
32
- export const ExampleWith1ItemAndDisableIcon = () => {
33
- return (
34
- <ResourceCategory
35
- itemsCount={'1'}
36
- title="Resource name"
37
- fhirIcons={false}
38
- />
39
- );
48
+ export const ExampleWith1ItemAndDisableIcon = Template.bind({});
49
+ ExampleWith1ItemAndDisableIcon.args = {
50
+ itemsCount: '1',
51
+ title: 'Resource name',
52
+ fhirIcons: false,
40
53
  };
@@ -1 +0,0 @@
1
- import '@storybook/addon-knobs/register';
@@ -1,26 +0,0 @@
1
- import '../src/components/ui/bootstrap-reboot.min.css';
2
- import '../src/style.css';
3
- import '../src/style.scss';
4
-
5
- import { addDecorator, addParameters, configure } from '@storybook/react';
6
-
7
- import { withKnobs } from '@storybook/addon-knobs';
8
-
9
- if (typeof document !== 'undefined') {
10
- require('bootstrap/dist/js/bootstrap.min.js');
11
- }
12
-
13
- addParameters({
14
- options: {
15
- name: 'FHIR-REACT storybook',
16
- showRoots: true,
17
- },
18
- });
19
-
20
- addDecorator(
21
- withKnobs({
22
- escapeHTML: false,
23
- }),
24
- );
25
-
26
- configure(require.context('../src', true, /\.stories\.js$/), module);
@@ -1 +0,0 @@
1
- module.exports = ['@storybook/preset-scss'];