fhir-react 2.0.0 → 2.0.1-beta.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.
package/jest.config.js CHANGED
@@ -16,7 +16,7 @@ module.exports = {
16
16
  // lines: 70,
17
17
  // },
18
18
  },
19
- moduleDirectories: ['node_modules', 'src'],
19
+ moduleDirectories: ['node_modules'],
20
20
  moduleNameMapper: {
21
21
  '.*\\.(css|less|styl|scss|sass)$': '<rootDir>/jest/mocks/cssModule.js',
22
22
  '.*\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
@@ -24,4 +24,12 @@ module.exports = {
24
24
  },
25
25
  // testRegex: 'tests/.*\\.test\\.js$',
26
26
  snapshotSerializers: [],
27
+ testEnvironment: 'jsdom',
28
+ setupFiles: ['<rootDir>/jest.setup.js'],
29
+ transform: {
30
+ "\\.[jt]sx?$": ["babel-jest", { "extends": "./.babelrc", "plugins": ["babel-plugin-transform-import-meta"] }]
31
+ },
32
+ transformIgnorePatterns: [
33
+ "/node_modules/(?!(@nivo|d3-.*)/)",
34
+ ],
27
35
  };
package/jest.setup.js ADDED
@@ -0,0 +1,3 @@
1
+ import ResizeObserver from 'resize-observer-polyfill';
2
+
3
+ global.ResizeObserver = ResizeObserver;
package/package.json CHANGED
@@ -1,25 +1,23 @@
1
1
  {
2
2
  "name": "fhir-react",
3
- "version": "2.0.0",
3
+ "version": "2.0.1-beta.10",
4
4
  "description": "React component library for displaying FHIR Resources ",
5
5
  "main": "build/index.js",
6
6
  "peerDependencies": {
7
- "react": "^18.3.1"
7
+ "react": "^18.3.1",
8
+ "react-dom": "^18.3.1"
8
9
  },
9
10
  "dependencies": {
10
- "@nivo/core": "^0.78.0",
11
- "@nivo/pie": "^0.78.0",
12
- "@popperjs/core": "^2.11.2",
13
- "@storybook/addons": "^6.5.13",
11
+ "@nivo/core": "^0.84.0",
12
+ "@nivo/pie": "^0.84.0",
13
+ "@popperjs/core": "^2.11.8",
14
14
  "bootstrap": "^5.1.3",
15
15
  "dompurify": "^2.3.6",
16
- "lodash": "^4.17.21",
16
+ "lodash": "^4.17.23",
17
17
  "marked": "^3.0.8",
18
18
  "md5": "^2.3.0",
19
19
  "pretty-bytes": "^5.6.0",
20
20
  "prop-types": "^15.8.1",
21
- "react": "^18.3.1",
22
- "react-dom": "^18.3.1",
23
21
  "svg-url-loader": "^7.1.1"
24
22
  },
25
23
  "scripts": {
@@ -61,56 +59,66 @@
61
59
  ],
62
60
  "license": "MIT",
63
61
  "devDependencies": {
64
- "@babel/cli": "^7.17.6",
65
- "@babel/core": "^7.17.5",
66
- "@babel/plugin-proposal-class-properties": "^7.16.7",
67
- "@babel/plugin-proposal-decorators": "^7.17.2",
68
- "@babel/plugin-proposal-do-expressions": "^7.16.7",
69
- "@babel/plugin-proposal-export-default-from": "^7.16.7",
70
- "@babel/plugin-proposal-export-namespace-from": "^7.16.7",
71
- "@babel/plugin-proposal-function-bind": "^7.16.7",
72
- "@babel/plugin-proposal-function-sent": "^7.16.7",
73
- "@babel/plugin-proposal-json-strings": "^7.16.7",
74
- "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7",
75
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
76
- "@babel/plugin-proposal-numeric-separator": "^7.16.7",
77
- "@babel/plugin-proposal-object-rest-spread": "^7.17.3",
78
- "@babel/plugin-proposal-optional-chaining": "^7.16.7",
79
- "@babel/plugin-proposal-pipeline-operator": "^7.17.6",
80
- "@babel/plugin-proposal-throw-expressions": "^7.16.7",
62
+ "@babel/cli": "^7.28.6",
63
+ "@babel/core": "^7.29.0",
64
+ "@babel/eslint-parser": "^7.28.6",
65
+ "@babel/plugin-proposal-decorators": "^7.29.0",
66
+ "@babel/plugin-proposal-do-expressions": "^7.28.6",
67
+ "@babel/plugin-proposal-export-default-from": "^7.27.1",
68
+ "@babel/plugin-proposal-function-bind": "^7.27.1",
69
+ "@babel/plugin-proposal-function-sent": "^7.27.1",
70
+ "@babel/plugin-proposal-pipeline-operator": "^7.28.6",
71
+ "@babel/plugin-proposal-throw-expressions": "^7.27.1",
81
72
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
82
73
  "@babel/plugin-syntax-import-meta": "^7.10.4",
83
- "@babel/plugin-transform-react-jsx": "^7.17.3",
84
- "@babel/polyfill": "^7.0.0",
85
- "@babel/preset-env": "^7.16.11",
86
- "@babel/preset-react": "^7.16.7",
74
+ "@babel/plugin-transform-class-properties": "^7.28.6",
75
+ "@babel/plugin-transform-export-namespace-from": "^7.27.1",
76
+ "@babel/plugin-transform-json-strings": "^7.28.6",
77
+ "@babel/plugin-transform-logical-assignment-operators": "^7.28.6",
78
+ "@babel/plugin-transform-modules-commonjs": "^7.28.6",
79
+ "@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6",
80
+ "@babel/plugin-transform-numeric-separator": "^7.28.6",
81
+ "@babel/plugin-transform-object-rest-spread": "^7.28.6",
82
+ "@babel/plugin-transform-optional-chaining": "^7.28.6",
83
+ "@babel/plugin-transform-react-jsx": "^7.28.6",
84
+ "@babel/polyfill": "^7.12.1",
85
+ "@babel/preset-env": "^7.29.0",
86
+ "@babel/preset-react": "^7.28.5",
87
+ "@storybook/addons": "^6.5.13",
87
88
  "@storybook/addon-controls": "^6.5.13",
88
89
  "@storybook/preset-scss": "^1.0.3",
89
90
  "@storybook/react": "^6.5.13",
90
91
  "@storybook/storybook-deployer": "^2.8.16",
91
- "@testing-library/react": "^13.4.0",
92
- "@typescript-eslint/eslint-plugin": "^5.14.0",
93
- "@typescript-eslint/parser": "^5.14.0",
94
- "babel-eslint": "^10.0.3",
95
- "babel-jest": "^24.9.0",
92
+ "@testing-library/dom": "^10.4.1",
93
+ "@testing-library/react": "^16.3.2",
94
+ "@testing-library/user-event": "^14.6.1",
95
+ "@typescript-eslint/eslint-plugin": "^8.53.1",
96
+ "@typescript-eslint/parser": "^8.53.1",
97
+ "babel-jest": "^29.7.0",
96
98
  "babel-loader": "^8.2.3",
97
99
  "babel-plugin-transform-imports": "^2.0.0",
100
+ "babel-plugin-transform-import-meta": "^2.3.3",
101
+ "babel-preset-jest": "^29.6.3",
98
102
  "copy-webpack-plugin": "^5.1.2",
99
103
  "css-loader": "^3.6.0",
100
104
  "dedent": "^0.7.0",
101
- "eslint": "^8.10.0",
105
+ "eslint": "^8.57.1",
102
106
  "eslint-config-prettier": "^8.5.0",
103
- "eslint-config-react-app": "^7.0.0",
107
+ "eslint-config-react-app": "^7.0.1",
104
108
  "eslint-plugin-flowtype": "^8.0.3",
105
109
  "eslint-plugin-import": "^2.25.4",
106
110
  "eslint-plugin-jsx-a11y": "^6.5.1",
107
111
  "eslint-plugin-prettier": "^4.0.0",
108
- "eslint-plugin-react": "^7.29.3",
109
- "eslint-plugin-react-hooks": "^4.3.0",
110
- "jest": "^24.9.0",
112
+ "eslint-plugin-react": "^7.37.5",
113
+ "eslint-plugin-react-hooks": "^7.0.1",
114
+ "jest": "^29.7.0",
115
+ "jest-environment-jsdom": "^30.2.0",
111
116
  "mini-css-extract-plugin": "^1.6.2",
112
117
  "npm-check-updates": "^16.7.9",
113
118
  "prettier": "1.19.1",
119
+ "react": "^18.3.1",
120
+ "react-dom": "^18.3.1",
121
+ "resize-observer-polyfill": "^1.5.1",
114
122
  "sass": "^1.49.9",
115
123
  "sass-loader": "^10.2.0",
116
124
  "style-loader": "^2.0.0",
@@ -118,5 +126,9 @@
118
126
  "stylelint-config-standard": "^25.0.0",
119
127
  "webpack": "^4.41.2",
120
128
  "webpack-cli": "^3.3.10"
129
+ },
130
+ "overrides": {
131
+ "react": "^18.3.1",
132
+ "react-dom": "^18.3.1"
121
133
  }
122
- }
134
+ }
@@ -18,7 +18,7 @@ import {
18
18
  } from '../../ui';
19
19
  import Reference from '../../datatypes/Reference';
20
20
  import { getResourceDate } from '../../../utils/getResourceDate';
21
- import Annotation from "../../datatypes/Annotation";
21
+ import Annotation from '../../datatypes/Annotation';
22
22
 
23
23
  const Observation = ({
24
24
  fhirResource,
@@ -132,7 +132,9 @@ describe('should render component correctly', () => {
132
132
  expect(getByTestId('issuedOn').textContent).toEqual('05/18/2016');
133
133
  expect(getByTestId('subject').textContent).toContain('Patient/infant');
134
134
  expect(queryByText(/373066001/g)).not.toBeNull();
135
- expect(getByTestId('hasNote').textContent).toContain('Was exposed to second-hand smoke.');
135
+ expect(getByTestId('hasNote').textContent).toContain(
136
+ 'Was exposed to second-hand smoke.',
137
+ );
136
138
  });
137
139
 
138
140
  test('should display not rounded value', () => {
package/webpack.config.js CHANGED
@@ -3,7 +3,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
3
3
  const CopyWebpackPlugin = require('copy-webpack-plugin');
4
4
 
5
5
  module.exports = {
6
- mode: process.env.NODE_ENV,
6
+ mode: process.env.NODE_ENV ?? 'production',
7
7
  entry: ['./src/index.js'],
8
8
  output: {
9
9
  path: path.resolve(__dirname, 'build'),
@@ -49,7 +49,18 @@ module.exports = {
49
49
  ],
50
50
  },
51
51
  externals: {
52
- react: 'commonjs react', // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
52
+ react: {
53
+ amd: 'react',
54
+ commonjs: 'react',
55
+ module: 'react',
56
+ umd: 'react'
57
+ }, // this line is just to use the React dependency of our parent-testing-project instead of using our own React.
58
+ 'react-dom': {
59
+ amd: 'react-dom',
60
+ commonjs: 'react-dom',
61
+ module: 'react-dom',
62
+ umd: 'react-dom'
63
+ },
53
64
  },
54
65
  plugins: [
55
66
  new MiniCssExtractPlugin({