@elice/material-survey 1.240718.0-trasncript.0 → 1.240718.0-trasncript.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.
Files changed (67) hide show
  1. package/cjs/_virtual/_rollupPluginBabelHelpers.js +399 -0
  2. package/cjs/components/markdown-editor/index.d.ts +1 -2
  3. package/cjs/components/markdown-editor/index.js +19 -10
  4. package/cjs/components/material-survey/MaterialSurvey.js +82 -57
  5. package/cjs/components/material-survey/MaterialSurveyInfo.js +69 -59
  6. package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +131 -90
  7. package/cjs/components/material-survey/MaterialSurveySelectOne.js +125 -86
  8. package/cjs/components/material-survey/MaterialSurveyShimmer.js +47 -40
  9. package/cjs/components/material-survey/MaterialSurveyText.js +114 -75
  10. package/cjs/components/material-survey/SurveyResultBadge.js +17 -10
  11. package/cjs/components/material-survey/SurveySubmitStatusText.js +21 -16
  12. package/cjs/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
  13. package/cjs/components/material-survey/context/MaterialSurveyContext.js +115 -74
  14. package/cjs/components/material-survey/index.js +9 -0
  15. package/cjs/components/material-survey/locales/index.js +13 -0
  16. package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +49 -36
  17. package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +113 -91
  18. package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +100 -87
  19. package/cjs/components/material-survey-edit/context.js +8 -2
  20. package/cjs/components/material-survey-edit/index.js +7 -0
  21. package/cjs/components/material-survey-edit/locales/index.js +13 -0
  22. package/cjs/components/material-survey-edit/utils/editValue.js +17 -11
  23. package/cjs/components/shared/StyledMarkdown.js +5 -1
  24. package/cjs/components/shared/SurveyContentBox.js +85 -74
  25. package/cjs/components/shared/index.js +13 -0
  26. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
  27. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  28. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
  29. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +66 -89
  30. package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
  31. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  32. package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
  33. package/cjs/components/shared/question-radio/QuestionRadioOption.js +59 -80
  34. package/es/_virtual/_rollupPluginBabelHelpers.js +386 -0
  35. package/es/components/markdown-editor/index.d.ts +1 -2
  36. package/es/components/markdown-editor/index.js +15 -10
  37. package/es/components/material-survey/MaterialSurvey.js +77 -57
  38. package/es/components/material-survey/MaterialSurveyInfo.js +65 -59
  39. package/es/components/material-survey/MaterialSurveySelectMultiple.js +127 -90
  40. package/es/components/material-survey/MaterialSurveySelectOne.js +121 -86
  41. package/es/components/material-survey/MaterialSurveyShimmer.js +43 -40
  42. package/es/components/material-survey/MaterialSurveyText.js +109 -75
  43. package/es/components/material-survey/SurveyResultBadge.js +13 -10
  44. package/es/components/material-survey/SurveySubmitStatusText.js +17 -16
  45. package/es/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
  46. package/es/components/material-survey/context/MaterialSurveyContext.js +112 -75
  47. package/es/components/material-survey/index.js +2 -0
  48. package/es/components/material-survey/locales/index.js +4 -0
  49. package/es/components/material-survey-edit/MaterialSurveyEdit.js +45 -36
  50. package/es/components/material-survey-edit/MaterialSurveyEditContent.js +107 -90
  51. package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +96 -87
  52. package/es/components/material-survey-edit/context.js +4 -2
  53. package/es/components/material-survey-edit/index.js +1 -0
  54. package/es/components/material-survey-edit/locales/index.js +4 -0
  55. package/es/components/material-survey-edit/utils/editValue.js +17 -11
  56. package/es/components/shared/StyledMarkdown.js +1 -1
  57. package/es/components/shared/SurveyContentBox.js +81 -74
  58. package/es/components/shared/index.js +4 -0
  59. package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
  60. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  61. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
  62. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +61 -89
  63. package/es/components/shared/question-radio/QuestionRadio.js +9 -7
  64. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  65. package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
  66. package/es/components/shared/question-radio/QuestionRadioOption.js +54 -80
  67. package/package.json +9 -12
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { useFormContext, useFieldArray, Controller } from 'react-hook-form';
3
3
  import { Input, Tooltip, IconButton, Vspace, Button, Icon } from '@elice/blocks';
4
4
  import { eilMathsignMultiplyBasic, eilMathsignAddCircle } from '@elice/icons';
@@ -7,35 +7,32 @@ import styled from 'styled-components';
7
7
  import { createRandomId } from './utils/randomId.js';
8
8
  import { useMaterialSurveyEditContext } from './context.js';
9
9
 
10
- const MIN_OPTION_INFO_COUNT = 2;
11
- const MAX_OPTION_INFO_COUNT = 20;
12
- const StyledWrap = styled.div.withConfig({
10
+ var MIN_OPTION_INFO_COUNT = 2;
11
+ var MAX_OPTION_INFO_COUNT = 20;
12
+ var StyledWrap = styled.div.withConfig({
13
13
  componentId: "sc-1eiyk6z-0"
14
14
  })([""]);
15
- const StyledInputGroup = styled.div.withConfig({
15
+ var StyledInputGroup = styled.div.withConfig({
16
16
  componentId: "sc-1eiyk6z-1"
17
17
  })(["width:100%;.eb-input{margin-bottom:0.5rem;&:last-of-type{margin-bottom:0;}}"]);
18
- const OptionSelectOne = () => {
19
- const intl = useRawEliceIntl();
20
- const {
21
- disabled
22
- } = useMaterialSurveyEditContext();
23
- const {
24
- control
25
- } = useFormContext();
26
- const {
27
- fields: optionInfoFields,
28
- append: appendOptionInfoFieldItem,
29
- remove: removeOptionInfoFieldItem
30
- } = useFieldArray({
31
- name: 'questionInfoList.0.optionInfo',
32
- keyName: 'id',
33
- shouldUnregister: true
34
- });
18
+ var OptionSelectOne = function OptionSelectOne() {
19
+ var intl = useRawEliceIntl();
20
+ var _useMaterialSurveyEdi = useMaterialSurveyEditContext(),
21
+ disabled = _useMaterialSurveyEdi.disabled;
22
+ var _useFormContext = useFormContext(),
23
+ control = _useFormContext.control;
24
+ var _useFieldArray = useFieldArray({
25
+ name: 'questionInfoList.0.optionInfo',
26
+ keyName: 'id',
27
+ shouldUnregister: true
28
+ }),
29
+ optionInfoFields = _useFieldArray.fields,
30
+ appendOptionInfoFieldItem = _useFieldArray.append,
31
+ removeOptionInfoFieldItem = _useFieldArray.remove;
35
32
  /**
36
33
  * Append option info.
37
34
  */
38
- const appendOptionInfo = () => {
35
+ var appendOptionInfo = function appendOptionInfo() {
39
36
  appendOptionInfoFieldItem({
40
37
  id: createRandomId(),
41
38
  value: ''
@@ -44,76 +41,88 @@ const OptionSelectOne = () => {
44
41
  /**
45
42
  * Remove item from option info at index.
46
43
  */
47
- const removeOptionInfo = index => {
44
+ var removeOptionInfo = function removeOptionInfo(index) {
48
45
  removeOptionInfoFieldItem(index);
49
46
  };
50
47
  //
51
48
  //
52
49
  //
53
- return React.createElement(StyledWrap, null, React.createElement(StyledInputGroup, null, optionInfoFields.map(({
54
- id
55
- }, index) => React.createElement(Controller, {
56
- key: id,
57
- control: control,
58
- name: `questionInfoList.0.optionInfo.${index}.value`,
59
- rules: {
60
- required: {
61
- value: true,
62
- message: intl.formatMessage({
63
- id: 'option.common.select.errorMessage.required'
64
- })
65
- }
66
- },
67
- render: ({
68
- field,
69
- fieldState
70
- }) => {
71
- var _a;
72
- return React.createElement(Input, Object.assign({
73
- size: "small",
74
- width: "full",
75
- placeholder: intl.formatMessage({
76
- id: 'option.common.select.placeholder'
77
- }),
78
- suffix: React.createElement(Tooltip, {
79
- title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
80
- id: 'option.common.select.tooltip.minOptionInfoItem'
81
- }) : undefined,
82
- placement: "top-start"
83
- }, React.createElement("span", null, React.createElement(IconButton, {
84
- icon: eilMathsignMultiplyBasic,
85
- role: "grey9",
86
- size: "tiny",
87
- border: false,
50
+ return jsxs(StyledWrap, {
51
+ children: [jsx(StyledInputGroup, {
52
+ children: optionInfoFields.map(function (_ref, index) {
53
+ var id = _ref.id;
54
+ return jsx(Controller, {
55
+ control: control,
56
+ name: "questionInfoList.0.optionInfo.".concat(index, ".value"),
57
+ rules: {
58
+ required: {
59
+ value: true,
60
+ message: intl.formatMessage({
61
+ id: 'option.common.select.errorMessage.required'
62
+ })
63
+ }
64
+ },
65
+ render: function render(_ref2) {
66
+ var field = _ref2.field,
67
+ fieldState = _ref2.fieldState;
68
+ var _a;
69
+ return jsx(Input, Object.assign({
70
+ size: "small",
71
+ width: "full",
72
+ placeholder: intl.formatMessage({
73
+ id: 'option.common.select.placeholder'
74
+ }),
75
+ suffix: jsx(Tooltip, {
76
+ title: optionInfoFields.length <= MIN_OPTION_INFO_COUNT ? intl.formatMessage({
77
+ id: 'option.common.select.tooltip.minOptionInfoItem'
78
+ }) : undefined,
79
+ placement: "top-start",
80
+ children: jsx("span", {
81
+ children: jsx(IconButton, {
82
+ icon: eilMathsignMultiplyBasic,
83
+ role: "grey9",
84
+ size: "tiny",
85
+ border: false,
86
+ transparent: true,
87
+ disabled: optionInfoFields.length <= MIN_OPTION_INFO_COUNT || disabled,
88
+ onClick: function onClick() {
89
+ return removeOptionInfo(index);
90
+ }
91
+ })
92
+ })
93
+ }),
94
+ readOnly: disabled,
95
+ invalid: fieldState.invalid,
96
+ invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
97
+ }, field));
98
+ }
99
+ }, id);
100
+ })
101
+ }), jsx(Vspace, {
102
+ height: 0.5
103
+ }), jsx(Tooltip, {
104
+ title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl.formatMessage({
105
+ id: 'option.common.select.tooltip.maxOptionInfoItem'
106
+ }) : undefined,
107
+ placement: "bottom",
108
+ children: jsx("span", {
109
+ children: jsx(Button, {
110
+ block: true,
111
+ size: "micro",
112
+ borderDashed: true,
88
113
  transparent: true,
89
- disabled: optionInfoFields.length <= MIN_OPTION_INFO_COUNT || disabled,
90
- onClick: () => removeOptionInfo(index)
91
- }))),
92
- readOnly: disabled,
93
- invalid: fieldState.invalid,
94
- invalidText: (_a = fieldState.error) === null || _a === void 0 ? void 0 : _a.message
95
- }, field));
96
- }
97
- }))), React.createElement(Vspace, {
98
- height: 0.5
99
- }), React.createElement(Tooltip, {
100
- title: optionInfoFields.length >= MAX_OPTION_INFO_COUNT ? intl.formatMessage({
101
- id: 'option.common.select.tooltip.maxOptionInfoItem'
102
- }) : undefined,
103
- placement: "bottom"
104
- }, React.createElement("span", null, React.createElement(Button, {
105
- block: true,
106
- size: "micro",
107
- borderDashed: true,
108
- transparent: true,
109
- icon: React.createElement(Icon, {
110
- icon: eilMathsignAddCircle
111
- }),
112
- disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
113
- onClick: appendOptionInfo
114
- }, intl.formatMessage({
115
- id: 'option.common.select.addButton'
116
- })))));
114
+ icon: jsx(Icon, {
115
+ icon: eilMathsignAddCircle
116
+ }),
117
+ disabled: optionInfoFields.length >= MAX_OPTION_INFO_COUNT || disabled,
118
+ onClick: appendOptionInfo,
119
+ children: intl.formatMessage({
120
+ id: 'option.common.select.addButton'
121
+ })
122
+ })
123
+ })
124
+ })]
125
+ });
117
126
  };
118
127
 
119
128
  export { OptionSelectOne as default };
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
 
3
- const MaterialSurveyEditContext = React.createContext(null);
4
- const useMaterialSurveyEditContext = () => React.useContext(MaterialSurveyEditContext);
3
+ var MaterialSurveyEditContext = React.createContext(null);
4
+ var useMaterialSurveyEditContext = function useMaterialSurveyEditContext() {
5
+ return React.useContext(MaterialSurveyEditContext);
6
+ };
5
7
 
6
8
  export { MaterialSurveyEditContext as default, useMaterialSurveyEditContext };
@@ -0,0 +1 @@
1
+ export { default as MaterialSurveyEdit } from './MaterialSurveyEdit.js';
@@ -0,0 +1,4 @@
1
+ export { default as messageEn } from './en.json.js';
2
+ export { default as messageKo } from './ko.json.js';
3
+ export { default as messageTh } from './th.json.js';
4
+ export { default as messageJa } from './ja.json.js';
@@ -5,14 +5,18 @@ import { createRandomId } from './randomId.js';
5
5
  */
6
6
  function manipulateValue(v) {
7
7
  return Object.assign(Object.assign({}, v), {
8
- questionInfoList: v.questionInfoList.map(questionInfo => Object.assign(Object.assign({}, questionInfo), {
9
- // convert string array to object array
10
- // - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
11
- optionInfo: Array.isArray(questionInfo.optionInfo) ? questionInfo.optionInfo.map(option => ({
12
- id: createRandomId(),
13
- value: option
14
- })) : []
15
- }))
8
+ questionInfoList: v.questionInfoList.map(function (questionInfo) {
9
+ return Object.assign(Object.assign({}, questionInfo), {
10
+ // convert string array to object array
11
+ // - ref: https://github.com/react-hook-form/react-hook-form/issues/7622#issuecomment-1018893318
12
+ optionInfo: Array.isArray(questionInfo.optionInfo) ? questionInfo.optionInfo.map(function (option) {
13
+ return {
14
+ id: createRandomId(),
15
+ value: option
16
+ };
17
+ }) : []
18
+ });
19
+ })
16
20
  });
17
21
  }
18
22
  /**
@@ -20,10 +24,12 @@ function manipulateValue(v) {
20
24
  */
21
25
  function restoreValue(v) {
22
26
  return Object.assign(Object.assign({}, v), {
23
- questionInfoList: v.questionInfoList.map(questionInfo => {
27
+ questionInfoList: v.questionInfoList.map(function (questionInfo) {
24
28
  var _a;
25
- const newQuestionInfo = Object.assign(Object.assign({}, questionInfo), {
26
- optionInfo: ((_a = questionInfo.optionInfo) === null || _a === void 0 ? void 0 : _a.length) ? questionInfo.optionInfo.map(option => option.value) : null
29
+ var newQuestionInfo = Object.assign(Object.assign({}, questionInfo), {
30
+ optionInfo: ((_a = questionInfo.optionInfo) === null || _a === void 0 ? void 0 : _a.length) ? questionInfo.optionInfo.map(function (option) {
31
+ return option.value;
32
+ }) : null
27
33
  });
28
34
  if (!newQuestionInfo.optionInfo) {
29
35
  delete newQuestionInfo.optionInfo;
@@ -1,7 +1,7 @@
1
1
  import { Markdown } from '@elice/markdown';
2
2
  import styled from 'styled-components';
3
3
 
4
- const StyledMarkdown = styled(Markdown).withConfig({
4
+ var StyledMarkdown = styled(Markdown).withConfig({
5
5
  componentId: "sc-h8kc9g-0"
6
6
  })(["p{margin:0 !important;}"]);
7
7
 
@@ -1,96 +1,103 @@
1
1
  import { __rest } from 'tslib';
2
- import React from 'react';
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import { Text, Button } from '@elice/blocks';
4
4
  import { base } from '@elice/design-tokens';
5
5
  import { useRawEliceIntl } from '@elice/intl';
6
6
  import styled from 'styled-components';
7
7
  import { useMaterialSurveyState } from '../material-survey/context/MaterialSurveyContext.js';
8
8
 
9
- const StyledQuestionBox = styled.div.withConfig({
9
+ var StyledQuestionBox = styled.div.withConfig({
10
10
  componentId: "sc-h8ztvr-0"
11
- })(["display:flex;flex-direction:column;border-radius:", ";overflow:hidden;width:100%;max-height:", ";min-height:", ";"], ({
12
- vertical
13
- }) => vertical ? '0' : '8px', ({
14
- hasFooter
15
- }) => hasFooter ? '100%' : '', ({
16
- hasFooter
17
- }) => hasFooter ? '' : '100%');
18
- const StyledQuestionBoxHeader = styled.div.withConfig({
11
+ })(["display:flex;flex-direction:column;border-radius:", ";overflow:hidden;width:100%;max-height:", ";min-height:", ";"], function (_ref) {
12
+ var vertical = _ref.vertical;
13
+ return vertical ? '0' : '8px';
14
+ }, function (_ref2) {
15
+ var hasFooter = _ref2.hasFooter;
16
+ return hasFooter ? '100%' : '';
17
+ }, function (_ref3) {
18
+ var hasFooter = _ref3.hasFooter;
19
+ return hasFooter ? '' : '100%';
20
+ });
21
+ var StyledQuestionBoxHeader = styled.div.withConfig({
19
22
  componentId: "sc-h8ztvr-1"
20
23
  })(["display:flex;justify-content:space-between;background-color:", ";padding:1rem 1.5rem;flex:none;height:3.5rem;"], base.color.navy6);
21
- const StyledQuestionBoxBody = styled.div.withConfig({
24
+ var StyledQuestionBoxBody = styled.div.withConfig({
22
25
  componentId: "sc-h8ztvr-2"
23
- })(["padding:1.5rem;background-color:", ";flex:auto;", "})"], base.color.navy7, ({
24
- hasFooter
25
- }) => hasFooter ? 'height: 100%; overflow-y: auto;' : '');
26
- const StyledQuestionBoxFooter = styled.div.withConfig({
26
+ })(["padding:1.5rem;background-color:", ";flex:auto;", "})"], base.color.navy7, function (_ref4) {
27
+ var hasFooter = _ref4.hasFooter;
28
+ return hasFooter ? 'height: 100%; overflow-y: auto;' : '';
29
+ });
30
+ var StyledQuestionBoxFooter = styled.div.withConfig({
27
31
  componentId: "sc-h8ztvr-3"
28
- })(["flex:none;display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1.5rem;background-color:", ";", ""], base.color.navy8, ({
29
- vertical
30
- }) => {
31
- return vertical ? `
32
- flex-direction: column;
33
- align-items: flex-start;
34
- ` : '';
32
+ })(["flex:none;display:flex;justify-content:space-between;align-items:center;padding:0.75rem 1.5rem;background-color:", ";", ""], base.color.navy8, function (_ref5) {
33
+ var vertical = _ref5.vertical;
34
+ return vertical ? "\n flex-direction: column;\n align-items: flex-start;\n " : '';
35
35
  });
36
- const StyledQuestionBoxFooterActions = styled.div.withConfig({
36
+ var StyledQuestionBoxFooterActions = styled.div.withConfig({
37
37
  componentId: "sc-h8ztvr-4"
38
38
  })(["display:flex;> *:not(:last-child){margin-right:0.75rem;}"]);
39
- const StyledQuestionBoxFooterStatus = styled.div.withConfig({
39
+ var StyledQuestionBoxFooterStatus = styled.div.withConfig({
40
40
  componentId: "sc-h8ztvr-5"
41
- })(["margin-left:0.75rem;", ""], ({
42
- vertical
43
- }) => {
44
- return vertical ? `
45
- margin-left: 0;
46
- margin-top: 0.75rem;
47
- ` : '';
41
+ })(["margin-left:0.75rem;", ""], function (_ref6) {
42
+ var vertical = _ref6.vertical;
43
+ return vertical ? "\n margin-left: 0;\n margin-top: 0.75rem;\n " : '';
48
44
  });
49
- const SurveyContentBox = _a => {
50
- var {
51
- children,
52
- footerActions = [],
53
- title,
54
- submitResult,
55
- submitStatus,
56
- onNext
57
- } = _a,
45
+ var SurveyContentBox = function SurveyContentBox(_a) {
46
+ var children = _a.children,
47
+ _a$footerActions = _a.footerActions,
48
+ footerActions = _a$footerActions === void 0 ? [] : _a$footerActions,
49
+ title = _a.title,
50
+ submitResult = _a.submitResult,
51
+ submitStatus = _a.submitStatus,
52
+ onNext = _a.onNext,
58
53
  props = __rest(_a, ["children", "footerActions", "title", "submitResult", "submitStatus", "onNext"]);
59
- const intl = useRawEliceIntl();
60
- const {
61
- vertical
62
- } = useMaterialSurveyState();
63
- const hasFooter = footerActions.length > 0;
64
- const header = React.createElement(StyledQuestionBoxHeader, null, React.createElement(Text, {
65
- bold: true,
66
- customStyles: {
67
- color: base.color.navy0
68
- }
69
- }, title), submitResult ? submitResult : null);
70
- const body = React.createElement(StyledQuestionBoxBody, {
71
- hasFooter: hasFooter
72
- }, children);
73
- const footer = React.createElement(StyledQuestionBoxFooter, {
74
- vertical: vertical
75
- }, React.createElement(StyledQuestionBoxFooterActions, null, footerActions.map((action, index) => React.createElement(Button, Object.assign({
76
- key: index,
77
- size: "small"
78
- }, action), action.children)), typeof onNext === 'function' ? React.createElement(Button, {
79
- size: "small",
80
- border: true,
81
- tabIndex: 0,
82
- transparent: false,
83
- role: "lightpurple",
84
- onClick: onNext
85
- }, intl.formatMessage({
86
- id: 'materialSurvey.next'
87
- })) : null), React.createElement(StyledQuestionBoxFooterStatus, {
88
- vertical: vertical
89
- }, submitStatus));
90
- return React.createElement(StyledQuestionBox, Object.assign({}, props, {
54
+ var intl = useRawEliceIntl();
55
+ var _useMaterialSurveySta = useMaterialSurveyState(),
56
+ vertical = _useMaterialSurveySta.vertical;
57
+ var hasFooter = footerActions.length > 0;
58
+ var header = jsxs(StyledQuestionBoxHeader, {
59
+ children: [jsx(Text, {
60
+ bold: true,
61
+ customStyles: {
62
+ color: base.color.navy0
63
+ },
64
+ children: title
65
+ }), submitResult ? submitResult : null]
66
+ });
67
+ var body = jsx(StyledQuestionBoxBody, {
68
+ hasFooter: hasFooter,
69
+ children: children
70
+ });
71
+ var footer = jsxs(StyledQuestionBoxFooter, {
72
+ vertical: vertical,
73
+ children: [jsxs(StyledQuestionBoxFooterActions, {
74
+ children: [footerActions.map(function (action, index) {
75
+ return jsx(Button, Object.assign({
76
+ size: "small"
77
+ }, action, {
78
+ children: action.children
79
+ }), index);
80
+ }), typeof onNext === 'function' ? jsx(Button, {
81
+ size: "small",
82
+ border: true,
83
+ tabIndex: 0,
84
+ transparent: false,
85
+ role: "lightpurple",
86
+ onClick: onNext,
87
+ children: intl.formatMessage({
88
+ id: 'materialSurvey.next'
89
+ })
90
+ }) : null]
91
+ }), jsx(StyledQuestionBoxFooterStatus, {
92
+ vertical: vertical,
93
+ children: submitStatus
94
+ })]
95
+ });
96
+ return jsxs(StyledQuestionBox, Object.assign({}, props, {
91
97
  vertical: vertical,
92
- hasFooter: hasFooter
93
- }), header, body, footerActions.length > 0 ? footer : null);
98
+ hasFooter: hasFooter,
99
+ children: [header, body, footerActions.length > 0 ? footer : null]
100
+ }));
94
101
  };
95
102
 
96
103
  export { StyledQuestionBox, SurveyContentBox as default };
@@ -0,0 +1,4 @@
1
+ export { default as QuestionRadio } from './question-radio/QuestionRadio.js';
2
+ export { default as QuestionRadioOption } from './question-radio/QuestionRadioOption.js';
3
+ export { default as QuestionCheckbox } from './question-checkbox/QuestionCheckbox.js';
4
+ export { default as QuestionCheckboxOption } from './question-checkbox/QuestionCheckboxOption.js';
@@ -1,17 +1,19 @@
1
1
  import { __rest } from 'tslib';
2
- import React from 'react';
2
+ import { jsx } from 'react/jsx-runtime';
3
3
  import styled from 'styled-components';
4
4
  import { QuestionCheckboxContextProvider } from './QuestionCheckboxContext.js';
5
5
 
6
- const StyledQuestionCheckbox = styled.div.withConfig({
6
+ var StyledQuestionCheckbox = styled.div.withConfig({
7
7
  componentId: "sc-1ovh9lp-0"
8
8
  })(["display:flex;flex-direction:column;"]);
9
- const QuestionCheckbox = _a => {
10
- var {
11
- children
12
- } = _a,
9
+ var QuestionCheckbox = function QuestionCheckbox(_a) {
10
+ var children = _a.children,
13
11
  props = __rest(_a, ["children"]);
14
- return React.createElement(QuestionCheckboxContextProvider, Object.assign({}, props), React.createElement(StyledQuestionCheckbox, null, children));
12
+ return jsx(QuestionCheckboxContextProvider, Object.assign({}, props, {
13
+ children: jsx(StyledQuestionCheckbox, {
14
+ children: children
15
+ })
16
+ }));
15
17
  };
16
18
 
17
19
  export { QuestionCheckbox as default };
@@ -4,6 +4,6 @@ type Value = Pick<QuestionCheckboxProps, 'selectedOptions' | 'disabled' | 'onSel
4
4
  interface QuestionCheckboxProviderProps extends QuestionCheckboxProps {
5
5
  children: React.ReactNode;
6
6
  }
7
- declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): React.JSX.Element;
7
+ declare function QuestionCheckboxContextProvider({ selectedOptions, onSelect, disabled, children, }: QuestionCheckboxProviderProps): JSX.Element;
8
8
  declare function useQuestionCheckboxContext(): Value;
9
9
  export { QuestionCheckboxContextProvider, useQuestionCheckboxContext };
@@ -1,26 +1,29 @@
1
+ import { jsx } from 'react/jsx-runtime';
1
2
  import React from 'react';
2
3
 
3
- const QuestionCheckboxContext = React.createContext(undefined);
4
+ var QuestionCheckboxContext = React.createContext(undefined);
4
5
  QuestionCheckboxContext.displayName = 'QuestionCheckboxContext';
5
- function QuestionCheckboxContextProvider({
6
- selectedOptions,
7
- onSelect,
8
- disabled,
9
- children
10
- }) {
6
+ function QuestionCheckboxContextProvider(_ref) {
7
+ var selectedOptions = _ref.selectedOptions,
8
+ onSelect = _ref.onSelect,
9
+ disabled = _ref.disabled,
10
+ children = _ref.children;
11
11
  // eslint-disable-next-line react-hooks/exhaustive-deps
12
- const onSelectValue = React.useCallback(onSelect, []);
13
- const value = React.useMemo(() => ({
14
- selectedOptions,
15
- disabled,
16
- onSelect: onSelectValue
17
- }), [selectedOptions, disabled, onSelectValue]);
18
- return React.createElement(QuestionCheckboxContext.Provider, {
19
- value: value
20
- }, children);
12
+ var onSelectValue = React.useCallback(onSelect, []);
13
+ var value = React.useMemo(function () {
14
+ return {
15
+ selectedOptions: selectedOptions,
16
+ disabled: disabled,
17
+ onSelect: onSelectValue
18
+ };
19
+ }, [selectedOptions, disabled, onSelectValue]);
20
+ return jsx(QuestionCheckboxContext.Provider, {
21
+ value: value,
22
+ children: children
23
+ });
21
24
  }
22
25
  function useQuestionCheckboxContext() {
23
- const context = React.useContext(QuestionCheckboxContext);
26
+ var context = React.useContext(QuestionCheckboxContext);
24
27
  if (context === undefined) {
25
28
  throw new Error('useQuestionCheckboxContext must be used within a QuestionCheckboxContextProvider');
26
29
  }