@aehrc/smart-forms-renderer 0.26.1 → 0.26.2
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/.storybook/main.ts +2 -1
- package/.storybook/preview.ts +1 -1
- package/doctor-storybook.log +18 -0
- package/lib/utils/initialise.js +5 -5
- package/lib/utils/initialise.js.map +1 -1
- package/package.json +11 -11
- package/src/stories/BaseRenderer.stories.tsx +78 -0
- package/src/stories/assets/QStringItem.ts +38 -0
- package/src/utils/initialise.ts +5 -5
package/.storybook/main.ts
CHANGED
|
@@ -15,7 +15,8 @@ const config: StorybookConfig = {
|
|
|
15
15
|
getAbsolutePath('@storybook/addon-links'),
|
|
16
16
|
getAbsolutePath('@storybook/addon-essentials'),
|
|
17
17
|
getAbsolutePath('@storybook/addon-onboarding'),
|
|
18
|
-
getAbsolutePath('@storybook/addon-interactions')
|
|
18
|
+
getAbsolutePath('@storybook/addon-interactions'),
|
|
19
|
+
'@chromatic-com/storybook'
|
|
19
20
|
],
|
|
20
21
|
framework: {
|
|
21
22
|
name: getAbsolutePath('@storybook/react-vite'),
|
package/.storybook/preview.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
🩺 The doctor is checking the health of your Storybook..
|
|
2
|
+
╭ Incompatible packages found ────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
3
|
+
│ │
|
|
4
|
+
│ The following packages are incompatible with Storybook 8.0.10 as they depend on different major versions of Storybook packages: │
|
|
5
|
+
│ - @storybook/addon-styling@1.3.7 │
|
|
6
|
+
│ │
|
|
7
|
+
│ │
|
|
8
|
+
│ Please consider updating your packages or contacting the maintainers for compatibility details. │
|
|
9
|
+
│ For more on Storybook 8 compatibility, see the linked GitHub issue: │
|
|
10
|
+
│ https://github.com/storybookjs/storybook/issues/26031 │
|
|
11
|
+
│ │
|
|
12
|
+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
13
|
+
|
|
14
|
+
You can always recheck the health of your project by running:
|
|
15
|
+
npx storybook doctor
|
|
16
|
+
|
|
17
|
+
Full logs are available in /Users/fon026/IdeaProjects/smart-forms/packages/smart-forms-renderer/doctor-storybook.log
|
|
18
|
+
|
package/lib/utils/initialise.js
CHANGED
|
@@ -54,11 +54,11 @@ export function initialiseQuestionnaireResponse(questionnaire, questionnaireResp
|
|
|
54
54
|
questionnaireResponse.questionnaire = createQuestionnaireReference(questionnaire);
|
|
55
55
|
}
|
|
56
56
|
// Add "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse" profile
|
|
57
|
-
const profiles = [
|
|
58
|
-
|
|
59
|
-
];
|
|
60
|
-
questionnaireResponse.meta = questionnaireResponse.meta || {};
|
|
61
|
-
questionnaireResponse.meta.profile = profiles;
|
|
57
|
+
// const profiles: string[] = [
|
|
58
|
+
// 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse'
|
|
59
|
+
// ];
|
|
60
|
+
// questionnaireResponse.meta = questionnaireResponse.meta || {};
|
|
61
|
+
// questionnaireResponse.meta.profile = profiles;
|
|
62
62
|
return questionnaireResponse;
|
|
63
63
|
}
|
|
64
64
|
function createQuestionnaireReference(questionnaire) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialise.js","sourceRoot":"","sources":["../../src/utils/initialise.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAY5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,oCAAoC,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,kCAAkC,EAAE,MAAM,0DAA0D,CAAC;AAE9G;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAC7C,aAA4B,EAC5B,qBAA6C;;IAE7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C,CAAC,sBAAsB,CAAC;IAE3F,MAAM,0CAA0C,GAAG,oCAAoC,CAAC;QACtF,eAAe,EAAE,qBAAqB;QACtC,sBAAsB,EAAE,sBAAsB;QAC9C,qBAAqB,EAAE,qBAAqB;QAC5C,iBAAiB,EAAE,iBAAiB;QACpC,uBAAuB,EAAE,sBAAsB;KAChD,CAAC,CAAC;IACH,MAAM,EAAE,4BAA4B,EAAE,GAAG,0CAA0C,CAAC;IACpF,sBAAsB,GAAG,0CAA0C,CAAC,sBAAsB,CAAC;IAE3F,MAAM,eAAe,GACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAC1B,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,EAAE,4BAA4B,CAAC;QAC1E,CAAC,CAAC,CAAC,CAAC;IAER,OAAO;QACL,sBAAsB,EAAE,gBAAgB;QACxC,gCAAgC,EAAE,eAAe;QACjD,4BAA4B;QAC5B,4BAA4B;QAC5B,eAAe;QACf,sBAAsB;KACvB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aehrc/smart-forms-renderer",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"description": "FHIR Structured Data Captured (SDC) rendering engine for Smart Forms",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"homepage": "https://github.com/aehrc/smart-forms#readme",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@iconify/react": "^4.1.1",
|
|
28
|
+
"@storybook/test": "^8.0.10",
|
|
28
29
|
"@types/fhir": "^0.0.38",
|
|
29
30
|
"dayjs": "^1.11.10",
|
|
30
31
|
"deep-diff": "^1.0.2",
|
|
@@ -54,15 +55,14 @@
|
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@babel/core": "^7.24.4",
|
|
57
|
-
"@storybook
|
|
58
|
-
"@storybook/addon-
|
|
59
|
-
"@storybook/addon-
|
|
60
|
-
"@storybook/addon-
|
|
61
|
-
"@storybook/addon-
|
|
62
|
-
"@storybook/blocks": "^
|
|
63
|
-
"@storybook/react": "^8.0.
|
|
64
|
-
"@storybook/react-vite": "^
|
|
65
|
-
"@storybook/testing-library": "^0.2.1",
|
|
58
|
+
"@chromatic-com/storybook": "^1.3.3",
|
|
59
|
+
"@storybook/addon-essentials": "^8.0.10",
|
|
60
|
+
"@storybook/addon-interactions": "^8.0.10",
|
|
61
|
+
"@storybook/addon-links": "^8.0.10",
|
|
62
|
+
"@storybook/addon-onboarding": "^8.0.10",
|
|
63
|
+
"@storybook/blocks": "^8.0.10",
|
|
64
|
+
"@storybook/react": "^8.0.10",
|
|
65
|
+
"@storybook/react-vite": "^8.0.10",
|
|
66
66
|
"@swc/cli": "^0.1.63",
|
|
67
67
|
"@swc/core": "^1.3.99",
|
|
68
68
|
"@testing-library/jest-dom": "^6.1.2",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"chokidar": "^3.5.3",
|
|
79
79
|
"jest": "^29.7.0",
|
|
80
80
|
"jest-environment-jsdom": "^29.7.0",
|
|
81
|
-
"storybook": "^
|
|
81
|
+
"storybook": "^8.0.10",
|
|
82
82
|
"ts-jest": "^29.1.1",
|
|
83
83
|
"tslib": "^2.6.2",
|
|
84
84
|
"typescript": "^5.2.2"
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
20
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
21
|
+
*
|
|
22
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
23
|
+
* you may not use this file except in compliance with the License.
|
|
24
|
+
* You may obtain a copy of the License at
|
|
25
|
+
*
|
|
26
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27
|
+
*
|
|
28
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
29
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
30
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
31
|
+
* See the License for the specific language governing permissions and
|
|
32
|
+
* limitations under the License.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
36
|
+
import { BaseRenderer } from '../components';
|
|
37
|
+
import { QStringItem } from './assets/QStringItem';
|
|
38
|
+
import ThemeProvider from '../theme/Theme';
|
|
39
|
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
40
|
+
|
|
41
|
+
// More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
|
|
42
|
+
const meta = {
|
|
43
|
+
title: 'Component/BaseRenderer',
|
|
44
|
+
component: BaseRenderer,
|
|
45
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs
|
|
46
|
+
tags: [],
|
|
47
|
+
decorators: [
|
|
48
|
+
(Story) => {
|
|
49
|
+
// useEffect(async () => {
|
|
50
|
+
// await buildForm(questionnaire);
|
|
51
|
+
// }, []);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<ThemeProvider>
|
|
55
|
+
<QueryClientProvider client={new QueryClient()}>{Story()}</QueryClientProvider>
|
|
56
|
+
</ThemeProvider>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
} satisfies Meta<typeof BaseRenderer>;
|
|
61
|
+
|
|
62
|
+
export default meta;
|
|
63
|
+
type Story = StoryObj<typeof meta>;
|
|
64
|
+
|
|
65
|
+
// More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args
|
|
66
|
+
|
|
67
|
+
export const StringItem: Story = {
|
|
68
|
+
args: {
|
|
69
|
+
questionnaire: QStringItem
|
|
70
|
+
},
|
|
71
|
+
decorators: [
|
|
72
|
+
(Story) => (
|
|
73
|
+
<Box p={2}>
|
|
74
|
+
<Story />
|
|
75
|
+
</Box>
|
|
76
|
+
)
|
|
77
|
+
]
|
|
78
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2024 Commonwealth Scientific and Industrial Research
|
|
3
|
+
* Organisation (CSIRO) ABN 41 687 119 230.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { Questionnaire } from 'fhir/r4';
|
|
19
|
+
|
|
20
|
+
export const QStringItem: Questionnaire = {
|
|
21
|
+
resourceType: 'Questionnaire',
|
|
22
|
+
id: 'StringComponent',
|
|
23
|
+
name: 'StringComponent',
|
|
24
|
+
title: 'String Component',
|
|
25
|
+
version: '0.1.0',
|
|
26
|
+
status: 'draft',
|
|
27
|
+
publisher: 'AEHRC CSIRO',
|
|
28
|
+
date: '2024-05-01',
|
|
29
|
+
url: 'https://smartforms.csiro.au/docs/components/string',
|
|
30
|
+
item: [
|
|
31
|
+
{
|
|
32
|
+
linkId: 'name',
|
|
33
|
+
type: 'string',
|
|
34
|
+
repeats: false,
|
|
35
|
+
text: 'Name'
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
package/src/utils/initialise.ts
CHANGED
|
@@ -75,11 +75,11 @@ export function initialiseQuestionnaireResponse(
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// Add "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse" profile
|
|
78
|
-
const profiles: string[] = [
|
|
79
|
-
|
|
80
|
-
];
|
|
81
|
-
questionnaireResponse.meta = questionnaireResponse.meta || {};
|
|
82
|
-
questionnaireResponse.meta.profile = profiles;
|
|
78
|
+
// const profiles: string[] = [
|
|
79
|
+
// 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaireresponse'
|
|
80
|
+
// ];
|
|
81
|
+
// questionnaireResponse.meta = questionnaireResponse.meta || {};
|
|
82
|
+
// questionnaireResponse.meta.profile = profiles;
|
|
83
83
|
|
|
84
84
|
return questionnaireResponse;
|
|
85
85
|
}
|