@digigov/form 1.0.0-6b93ebf2 → 1.0.0-871b6be5

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 (57) hide show
  1. package/FormBuilder/FormBuilder.mdx +6 -8
  2. package/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
  3. package/Questions/Step/StepArrayReview.js +2 -2
  4. package/Questions/Step/StepTitle.d.ts +2 -2
  5. package/Questions/Step/StepTitle.js +8 -4
  6. package/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  7. package/Questions/__stories__/Default.js +1 -1
  8. package/Questions/index.mdx +4 -4
  9. package/es/FormBuilder/FormBuilder.mdx +6 -8
  10. package/es/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
  11. package/es/Questions/Step/StepArrayReview.js +2 -2
  12. package/es/Questions/Step/StepTitle.js +7 -4
  13. package/es/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  14. package/es/Questions/__stories__/Default.js +1 -1
  15. package/es/Questions/index.mdx +4 -4
  16. package/es/inputs/DateInput/__stories__/Default.js +0 -18
  17. package/es/inputs/FileInput/index.js +1 -1
  18. package/es/inputs/OtpInput/index.js +5 -5
  19. package/es/inputs/Radio/__stories__/Default.js +1 -1
  20. package/es/inputs/Radio/__stories__/WithDivider.js +1 -1
  21. package/es/inputs/Select/__stories__/Default.js +1 -1
  22. package/esm/FormBuilder/FormBuilder.mdx +6 -8
  23. package/esm/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
  24. package/esm/Questions/Step/StepArrayReview.js +2 -2
  25. package/esm/Questions/Step/StepTitle.js +7 -4
  26. package/esm/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  27. package/esm/Questions/__stories__/Default.js +1 -1
  28. package/esm/Questions/index.mdx +4 -4
  29. package/esm/index.js +1 -1
  30. package/esm/inputs/DateInput/__stories__/Default.js +0 -18
  31. package/esm/inputs/FileInput/index.js +1 -1
  32. package/esm/inputs/OtpInput/index.js +5 -5
  33. package/esm/inputs/Radio/__stories__/Default.js +1 -1
  34. package/esm/inputs/Radio/__stories__/WithDivider.js +1 -1
  35. package/esm/inputs/Select/__stories__/Default.js +1 -1
  36. package/inputs/DateInput/__stories__/Default.js +0 -18
  37. package/inputs/FileInput/index.js +1 -1
  38. package/inputs/OtpInput/index.js +5 -5
  39. package/inputs/Radio/__stories__/Default.js +1 -1
  40. package/inputs/Radio/__stories__/WithDivider.js +1 -1
  41. package/inputs/Select/__stories__/Default.js +1 -1
  42. package/package.json +4 -4
  43. package/src/FormBuilder/FormBuilder.mdx +6 -8
  44. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +4 -4
  45. package/src/Questions/Step/StepArrayReview.tsx +3 -3
  46. package/src/Questions/Step/StepTitle.tsx +12 -14
  47. package/src/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  48. package/src/Questions/__stories__/Default.tsx +4 -4
  49. package/src/Questions/index.mdx +4 -4
  50. package/src/inputs/DateInput/__stories__/Default.tsx +0 -16
  51. package/src/inputs/FileInput/index.tsx +1 -1
  52. package/src/inputs/OtpInput/index.tsx +8 -8
  53. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  54. package/src/inputs/Radio/__stories__/WithDivider.tsx +1 -1
  55. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  56. package/src/types.tsx +1 -1
  57. package/types.d.ts +1 -1
@@ -348,11 +348,11 @@ export default function Index() {
348
348
  <BasicLayout>
349
349
  <Top>
350
350
  <Header>
351
- <HeaderSection>
352
- <HeaderContent>
351
+ <HeaderContent>
352
+ <HeaderSection>
353
353
  <GovGRLogo href="#" />
354
- </HeaderContent>
355
- </HeaderSection>
354
+ </HeaderSection>
355
+ </HeaderContent>
356
356
  </Header>
357
357
  </Top>
358
358
  <Content>
@@ -19,24 +19,6 @@ export var Default = function Default() {
19
19
  label: {
20
20
  primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
21
21
  secondary: 'Για παράδειγμα, 05 11 2020'
22
- },
23
- extra: {
24
- options: [{
25
- label: {
26
- primary: 'Έχω συνάχι'
27
- },
28
- value: 'runny-nose'
29
- }, {
30
- label: {
31
- primary: 'Έχω πυρετό'
32
- },
33
- value: 'fever'
34
- }, {
35
- label: {
36
- primary: 'Αισθάνομαι κούραση'
37
- },
38
- value: 'fatigue'
39
- }]
40
22
  }
41
23
  }), _ref);
42
24
  };
@@ -41,7 +41,7 @@ export var FileInput = /*#__PURE__*/React.forwardRef(function FileInput(_ref, re
41
41
  };
42
42
 
43
43
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FileUploadContainer, {
44
- hasUploadedFile: files && files.length > 0
44
+ hasFiles: files && files.length > 0
45
45
  }, files !== null && files !== void 0 && files.length ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Paragraph, null, /*#__PURE__*/React.createElement("b", null, t('upload.file'), ":"), " ", "".concat(files.join(', ')))) : /*#__PURE__*/React.createElement(CoreHint, null, t('upload.no_file')), /*#__PURE__*/React.createElement(FileUpload, _extends({
46
46
  ref: ref,
47
47
  hasFiles: !!(files !== null && files !== void 0 && files.length),
@@ -4,7 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
5
  var _excluded = ["name", "maxLength"];
6
6
  import React, { useState, useCallback } from 'react';
7
- import SingleCharacterInputContainer, { SingleCharacterInputItem } from '@digigov/ui/form/SingleCharacterInputContainer';
7
+ import SingleCharacterInputs, { SingleCharacterInput } from '@digigov/ui/form/SingleCharacterInputs';
8
8
  export var RE_DIGIT = new RegExp(/^\d+$/);
9
9
  export var REMOVE_SPACES = new RegExp(/\s+/g);
10
10
 
@@ -113,10 +113,10 @@ function useOtp(onChange, maxLength) {
113
113
  };
114
114
  }
115
115
 
116
- var SingleCharacterInputItemPart = function SingleCharacterInputItemPart(_ref) {
116
+ var SingleCharacterInputPart = function SingleCharacterInputPart(_ref) {
117
117
  var props = _extends({}, _ref);
118
118
 
119
- return /*#__PURE__*/React.createElement(SingleCharacterInputItem, props);
119
+ return /*#__PURE__*/React.createElement(SingleCharacterInput, props);
120
120
  };
121
121
 
122
122
  export var OtpInput = function OtpInput(_ref2) {
@@ -126,8 +126,8 @@ export var OtpInput = function OtpInput(_ref2) {
126
126
  props = _objectWithoutProperties(_ref2, _excluded);
127
127
 
128
128
  var otp = useOtp(props.onChange, maxLength);
129
- return /*#__PURE__*/React.createElement(SingleCharacterInputContainer, null, otp.otpValues.map(function (digit, idx) {
130
- return /*#__PURE__*/React.createElement(SingleCharacterInputItemPart, {
129
+ return /*#__PURE__*/React.createElement(SingleCharacterInputs, null, otp.otpValues.map(function (digit, idx) {
130
+ return /*#__PURE__*/React.createElement(SingleCharacterInputPart, {
131
131
  name: "".concat(name, "-").concat(idx),
132
132
  type: "text",
133
133
  key: idx,
@@ -17,7 +17,7 @@ export var Default = function Default() {
17
17
  type: "choice:single",
18
18
  required: true,
19
19
  label: {
20
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
20
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
21
  },
22
22
  extra: {
23
23
  options: [{
@@ -17,7 +17,7 @@ export var WithDivider = function WithDivider() {
17
17
  type: "choice:single",
18
18
  required: true,
19
19
  label: {
20
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
20
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
21
  },
22
22
  extra: {
23
23
  options: [{
@@ -17,7 +17,7 @@ export var Default = function Default() {
17
17
  type: "choice:single",
18
18
  required: true,
19
19
  label: {
20
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
20
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
21
21
  },
22
22
  extra: {
23
23
  component: 'Select',
@@ -95,10 +95,10 @@ import Header, { HeaderTitle } from '@digigov/ui/app/Header';
95
95
  import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
96
96
  import GovGRFooter from '@digigov/ui/govgr/Footer';
97
97
  import Button from '@digigov/ui/form/Button';
98
- import Section, {
98
+ import PageTitleContainer, {
99
+ PageTitleCaption,
99
100
  PageTitleHeading,
100
- } from '@digigov/ui/app/PageTitle';
101
- import { HeadingCaption } from '@digigov/ui/typography/HeadingCaption';
101
+ } from '@digigov/ui/app/PageTitleContainer';
102
102
  import BackButton from '@digigov/ui/form/Button/BackButton';
103
103
  import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
104
104
  import { useTranslation } from '@digigov/ui/i18n';
@@ -227,12 +227,10 @@ export default function Index() {
227
227
  <Content>
228
228
  <Main className={styles.main}>
229
229
  <BackButton>{t('button.back')}</BackButton>
230
- <Section>
231
- <Section>
232
- <HeadingCaption>Before we start</HeadingCaption>
233
- </Section>
230
+ <PageTitleContainer>
231
+ <PageTitleCaption>Before we start</PageTitleCaption>
234
232
  <PageTitleHeading>Submit a form</PageTitleHeading>
235
- </Section>
233
+ </PageTitleContainer>
236
234
  <FormBuilder
237
235
  fields={FIELDS}
238
236
  onSubmit={setData}
@@ -33,7 +33,7 @@ var fields = [{
33
33
  value: 'ΚΑΡΤΑ'
34
34
  }];
35
35
 
36
- var _ref = /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(HeaderSection, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(GovGRLogo, {
36
+ var _ref = /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(HeaderContent, null, /*#__PURE__*/React.createElement(HeaderSection, null, /*#__PURE__*/React.createElement(GovGRLogo, {
37
37
  href: "#"
38
38
  }), /*#__PURE__*/React.createElement(HeaderTitle, null, "\u03A0\u03C1\u03CC\u03C4\u03C5\u03C0\u03BF-\u0391\u03BD\u03B1\u03C6\u03BF\u03C1\u03AC\u03C2"))));
39
39
 
@@ -5,7 +5,7 @@ import FormBuilder from '@digigov/form/FormBuilder';
5
5
  import Label from '@digigov/form/inputs/Label';
6
6
  import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
7
7
  import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
8
- import Section, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
8
+ import PageTitleContainer, { PageTitleHeading } from '@digigov/ui/app/PageTitleContainer';
9
9
  import { SummaryList, SummaryListItem, SummaryListItemKey, SummaryListItemValue, SummaryListItemAction } from '@digigov/ui/content/SummaryList';
10
10
  import Button from '@digigov/ui/form/Button';
11
11
  import { useTranslation } from '@digigov/ui/i18n';
@@ -24,7 +24,7 @@ export var StepArrayReview = function StepArrayReview(props) {
24
24
 
25
25
  return field.key === ((_currentStep$review = currentStep.review) === null || _currentStep$review === void 0 ? void 0 : _currentStep$review.primaryFieldKey);
26
26
  }) || {};
27
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Section, null, /*#__PURE__*/React.createElement(PageTitleHeading, null, ((_currentStep$review2 = currentStep.review) === null || _currentStep$review2 === void 0 ? void 0 : _currentStep$review2.title) && t((_currentStep$review3 = currentStep.review) === null || _currentStep$review3 === void 0 ? void 0 : _currentStep$review3.title))), /*#__PURE__*/React.createElement(SummaryList, null, props.array.map(function (item, idx) {
27
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PageTitleContainer, null, /*#__PURE__*/React.createElement(PageTitleHeading, null, ((_currentStep$review2 = currentStep.review) === null || _currentStep$review2 === void 0 ? void 0 : _currentStep$review2.title) && t((_currentStep$review3 = currentStep.review) === null || _currentStep$review3 === void 0 ? void 0 : _currentStep$review3.title))), /*#__PURE__*/React.createElement(SummaryList, null, props.array.map(function (item, idx) {
28
28
  return /*#__PURE__*/React.createElement(SummaryListItem, {
29
29
  key: idx
30
30
  }, /*#__PURE__*/React.createElement(SummaryListItemKey, null, t(primaryField.label.primary)), /*#__PURE__*/React.createElement(SummaryListItemValue, null, item[primaryField.key]), /*#__PURE__*/React.createElement(SummaryListItemAction, {
@@ -1,11 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { StepContext } from '@digigov/form/Questions/Step/StepContext';
3
- import Section, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
3
+ import PageTitleContainer, { PageTitleCaption } from '@digigov/ui/app/PageTitleContainer';
4
4
  import BackButton from '@digigov/ui/form/Button/BackButton';
5
5
  import { useTranslation } from '@digigov/ui/i18n';
6
- import { HeadingCaption } from '@digigov/ui/typography/HeadingCaption';
6
+ import HeadingCaption from '@digigov/react-core/HeadingCaption';
7
+ import Heading from '@digigov/react-core/Heading';
7
8
  export var StepTitleHeading = function StepTitleHeading(props) {
8
- return /*#__PURE__*/React.createElement(PageTitleHeading, null, props.children);
9
+ return /*#__PURE__*/React.createElement(Heading, null, props.children);
9
10
  };
10
11
  export var StepTitleBase = function StepTitleBase(_ref) {
11
12
  var caption = _ref.caption,
@@ -17,7 +18,9 @@ export var StepTitleBase = function StepTitleBase(_ref) {
17
18
  var _useTranslation = useTranslation(),
18
19
  t = _useTranslation.t;
19
20
 
20
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BackButton, null, backButton || t('back.button')), /*#__PURE__*/React.createElement(Section, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Section, null, /*#__PURE__*/React.createElement(HeadingCaption, null, caption && t(caption)), step && /*#__PURE__*/React.createElement(HeadingCaption, null, step)), /*#__PURE__*/React.createElement(StepTitleHeading, null, title && t(title)))));
21
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BackButton, null, backButton || t('button.back')), /*#__PURE__*/React.createElement(PageTitleContainer, null, children || /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeadingCaption, {
22
+ size: "xl"
23
+ }, caption && t(caption)), step && /*#__PURE__*/React.createElement(PageTitleCaption, null, step), /*#__PURE__*/React.createElement(StepTitleHeading, null, title && t(title)))));
21
24
  };
22
25
  /**
23
26
  * The StepTitle component accepts a title, a caption and a step indicator