@digigov/form 1.0.0-002c630d → 1.0.0-00643e1d

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 (66) hide show
  1. package/FormBuilder/FormBuilder.mdx +4 -7
  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 +9 -3
  6. package/Questions/Step/index.d.ts +4 -4
  7. package/Questions/Step/index.js +53 -36
  8. package/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  9. package/Questions/__stories__/Default.js +1 -1
  10. package/Questions/index.mdx +4 -4
  11. package/es/FormBuilder/FormBuilder.mdx +4 -7
  12. package/es/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
  13. package/es/Questions/Step/StepArrayReview.js +2 -2
  14. package/es/Questions/Step/StepTitle.js +7 -3
  15. package/es/Questions/Step/index.js +4 -4
  16. package/es/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  17. package/es/Questions/__stories__/Default.js +1 -1
  18. package/es/Questions/index.mdx +4 -4
  19. package/es/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
  20. package/es/inputs/DateInput/__stories__/Default.js +0 -18
  21. package/es/inputs/FileInput/index.js +1 -1
  22. package/es/inputs/OtpInput/index.js +5 -5
  23. package/es/inputs/Radio/__stories__/Default.js +1 -1
  24. package/es/inputs/Radio/__stories__/WithDivider.js +2 -2
  25. package/es/inputs/Select/__stories__/Default.js +1 -1
  26. package/esm/FormBuilder/FormBuilder.mdx +4 -7
  27. package/esm/MultiplicityField/__stories__/PreviewDisplay.js +1 -1
  28. package/esm/Questions/Step/StepArrayReview.js +2 -2
  29. package/esm/Questions/Step/StepTitle.js +7 -3
  30. package/esm/Questions/Step/index.js +4 -4
  31. package/esm/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  32. package/esm/Questions/__stories__/Default.js +1 -1
  33. package/esm/Questions/index.mdx +4 -4
  34. package/esm/index.js +1 -1
  35. package/esm/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
  36. package/esm/inputs/DateInput/__stories__/Default.js +0 -18
  37. package/esm/inputs/FileInput/index.js +1 -1
  38. package/esm/inputs/OtpInput/index.js +5 -5
  39. package/esm/inputs/Radio/__stories__/Default.js +1 -1
  40. package/esm/inputs/Radio/__stories__/WithDivider.js +2 -2
  41. package/esm/inputs/Select/__stories__/Default.js +1 -1
  42. package/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
  43. package/inputs/DateInput/__stories__/Default.js +0 -18
  44. package/inputs/FileInput/index.js +1 -1
  45. package/inputs/OtpInput/index.js +5 -5
  46. package/inputs/Radio/__stories__/Default.js +1 -1
  47. package/inputs/Radio/__stories__/WithDivider.js +2 -2
  48. package/inputs/Select/__stories__/Default.js +1 -1
  49. package/package.json +4 -4
  50. package/src/FormBuilder/FormBuilder.mdx +4 -7
  51. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +4 -4
  52. package/src/Questions/Step/StepArrayReview.tsx +3 -3
  53. package/src/Questions/Step/StepTitle.tsx +11 -14
  54. package/src/Questions/Step/index.ts +4 -4
  55. package/src/Questions/__snapshots__/index.spec.tsx.snap +69 -356
  56. package/src/Questions/__stories__/Default.tsx +4 -4
  57. package/src/Questions/index.mdx +4 -4
  58. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +1 -1
  59. package/src/inputs/DateInput/__stories__/Default.tsx +0 -16
  60. package/src/inputs/FileInput/index.tsx +1 -1
  61. package/src/inputs/OtpInput/index.tsx +8 -8
  62. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  63. package/src/inputs/Radio/__stories__/WithDivider.tsx +2 -2
  64. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  65. package/src/types.tsx +1 -1
  66. package/types.d.ts +1 -1
@@ -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: [{
@@ -40,7 +40,7 @@ export var WithDivider = function WithDivider() {
40
40
  primary: 'Ηνωμένες Πολιτείες της Αμερικής'
41
41
  },
42
42
  value: 'usa',
43
- divider: 'ή'
43
+ dividerText: 'ή'
44
44
  }]
45
45
  }
46
46
  }), _ref);
@@ -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',
@@ -52,7 +52,7 @@ var WithDivider = function WithDivider() {
52
52
  primary: 'Αισθάνομαι κούραση'
53
53
  },
54
54
  value: 'fatigue',
55
- divider: 'ή'
55
+ dividerText: 'ή'
56
56
  }]
57
57
  }
58
58
  }), _ref);
@@ -36,24 +36,6 @@ var Default = function Default() {
36
36
  label: {
37
37
  primary: 'Πότε εκδόθηκε το διαβατήριο σας;',
38
38
  secondary: 'Για παράδειγμα, 05 11 2020'
39
- },
40
- extra: {
41
- options: [{
42
- label: {
43
- primary: 'Έχω συνάχι'
44
- },
45
- value: 'runny-nose'
46
- }, {
47
- label: {
48
- primary: 'Έχω πυρετό'
49
- },
50
- value: 'fever'
51
- }, {
52
- label: {
53
- primary: 'Αισθάνομαι κούραση'
54
- },
55
- value: 'fatigue'
56
- }]
57
39
  }
58
40
  }), _ref);
59
41
  };
@@ -68,7 +68,7 @@ var FileInput = /*#__PURE__*/_react["default"].forwardRef(function FileInput(_re
68
68
  };
69
69
 
70
70
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_FileUploadContainer["default"], {
71
- hasUploadedFile: files && files.length > 0
71
+ hasFiles: files && files.length > 0
72
72
  }, files !== null && files !== void 0 && files.length ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Paragraph["default"], null, /*#__PURE__*/_react["default"].createElement("b", null, t('upload.file'), ":"), " ", "".concat(files.join(', ')))) : /*#__PURE__*/_react["default"].createElement(_Hint["default"], null, t('upload.no_file')), /*#__PURE__*/_react["default"].createElement(_FileUpload["default"], (0, _extends2["default"])({
73
73
  ref: ref,
74
74
  hasFiles: !!(files !== null && files !== void 0 && files.length),
@@ -19,7 +19,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
19
19
 
20
20
  var _react = _interopRequireWildcard(require("react"));
21
21
 
22
- var _SingleCharacterInputContainer = _interopRequireWildcard(require("@digigov/ui/form/SingleCharacterInputContainer"));
22
+ var _SingleCharacterInputs = _interopRequireWildcard(require("@digigov/ui/form/SingleCharacterInputs"));
23
23
 
24
24
  var _excluded = ["name", "maxLength"];
25
25
 
@@ -137,9 +137,9 @@ function useOtp(onChange, maxLength) {
137
137
  };
138
138
  }
139
139
 
140
- var SingleCharacterInputItemPart = function SingleCharacterInputItemPart(_ref) {
140
+ var SingleCharacterInputPart = function SingleCharacterInputPart(_ref) {
141
141
  var props = (0, _extends2["default"])({}, _ref);
142
- return /*#__PURE__*/_react["default"].createElement(_SingleCharacterInputContainer.SingleCharacterInputItem, props);
142
+ return /*#__PURE__*/_react["default"].createElement(_SingleCharacterInputs.SingleCharacterInput, props);
143
143
  };
144
144
 
145
145
  var OtpInput = function OtpInput(_ref2) {
@@ -148,8 +148,8 @@ var OtpInput = function OtpInput(_ref2) {
148
148
  maxLength = _ref2$maxLength === void 0 ? 6 : _ref2$maxLength,
149
149
  props = (0, _objectWithoutProperties2["default"])(_ref2, _excluded);
150
150
  var otp = useOtp(props.onChange, maxLength);
151
- return /*#__PURE__*/_react["default"].createElement(_SingleCharacterInputContainer["default"], null, otp.otpValues.map(function (digit, idx) {
152
- return /*#__PURE__*/_react["default"].createElement(SingleCharacterInputItemPart, {
151
+ return /*#__PURE__*/_react["default"].createElement(_SingleCharacterInputs["default"], null, otp.otpValues.map(function (digit, idx) {
152
+ return /*#__PURE__*/_react["default"].createElement(SingleCharacterInputPart, {
153
153
  name: "".concat(name, "-").concat(idx),
154
154
  type: "text",
155
155
  key: idx,
@@ -34,7 +34,7 @@ var Default = function Default() {
34
34
  type: "choice:single",
35
35
  required: true,
36
36
  label: {
37
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
37
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
38
38
  },
39
39
  extra: {
40
40
  options: [{
@@ -34,7 +34,7 @@ var WithDivider = function WithDivider() {
34
34
  type: "choice:single",
35
35
  required: true,
36
36
  label: {
37
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
37
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
38
38
  },
39
39
  extra: {
40
40
  options: [{
@@ -57,7 +57,7 @@ var WithDivider = function WithDivider() {
57
57
  primary: 'Ηνωμένες Πολιτείες της Αμερικής'
58
58
  },
59
59
  value: 'usa',
60
- divider: 'ή'
60
+ dividerText: 'ή'
61
61
  }]
62
62
  }
63
63
  }), _ref);
@@ -34,7 +34,7 @@ var Default = function Default() {
34
34
  type: "choice:single",
35
35
  required: true,
36
36
  label: {
37
- primary: 'Ποια ειναι η χώρα της διαμονής σας;'
37
+ primary: 'Ποιά είναι η χώρα της διαμονής σας;'
38
38
  },
39
39
  extra: {
40
40
  component: 'Select',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digigov/form",
3
- "version": "1.0.0-002c630d",
3
+ "version": "1.0.0-00643e1d",
4
4
  "description": "@digigov form builder",
5
5
  "author": "GRNET Developers <devs@lists.grnet.gr>",
6
6
  "license": "BSD-2-Clause",
@@ -17,11 +17,11 @@
17
17
  "dayjs": "1.10.4",
18
18
  "@hookform/resolvers": "2.9.6",
19
19
  "publint": "0.1.8",
20
- "@digigov/react-icons": "1.0.0-002c630d"
20
+ "@digigov/react-icons": "1.0.0-00643e1d"
21
21
  },
22
22
  "peerDependencies": {
23
- "@digigov/ui": "1.0.0-002c630d",
24
- "@digigov/react-core": "1.0.0-002c630d",
23
+ "@digigov/ui": "1.0.0-00643e1d",
24
+ "@digigov/react-core": "1.0.0-00643e1d",
25
25
  "clsx": "1.1.1",
26
26
  "react": "^16.8.0 || ^17.0.0",
27
27
  "react-dom": "^16.8.0 || ^17.0.0"
@@ -95,11 +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 PageTitle, {
99
- PageTitleSection,
98
+ import PageTitleContainer, {
100
99
  PageTitleCaption,
101
100
  PageTitleHeading,
102
- } from '@digigov/ui/app/PageTitle';
101
+ } from '@digigov/ui/app/PageTitleContainer';
103
102
  import BackButton from '@digigov/ui/form/Button/BackButton';
104
103
  import FormBuilder, { Fieldset, FieldsetLabel, Field } from '@digigov/form';
105
104
  import { useTranslation } from '@digigov/ui/i18n';
@@ -228,12 +227,10 @@ export default function Index() {
228
227
  <Content>
229
228
  <Main className={styles.main}>
230
229
  <BackButton>{t('button.back')}</BackButton>
231
- <PageTitle>
232
- <PageTitleSection>
230
+ <PageTitleContainer>
233
231
  <PageTitleCaption>Before we start</PageTitleCaption>
234
- </PageTitleSection>
235
232
  <PageTitleHeading>Submit a form</PageTitleHeading>
236
- </PageTitle>
233
+ </PageTitleContainer>
237
234
  <FormBuilder
238
235
  fields={FIELDS}
239
236
  onSubmit={setData}
@@ -64,12 +64,12 @@ const fields = [
64
64
  export const PreviewDisplay = () => (
65
65
  <Layout>
66
66
  <Header>
67
- <HeaderSection>
68
- <HeaderContent>
67
+ <HeaderContent>
68
+ <HeaderSection>
69
69
  <GovGRLogo href="#" />
70
70
  <HeaderTitle>Πρότυπο-Αναφοράς</HeaderTitle>
71
- </HeaderContent>
72
- </HeaderSection>
71
+ </HeaderSection>
72
+ </HeaderContent>
73
73
  </Header>
74
74
  <Content>
75
75
  <Main>
@@ -7,7 +7,7 @@ import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
7
7
  import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
8
8
  import { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
9
9
  import { FieldSpec } from '@digigov/form/types';
10
- import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
10
+ import PageTitleContainer, { PageTitleHeading } from '@digigov/ui/app/PageTitleContainer';
11
11
  import {
12
12
  SummaryList,
13
13
  SummaryListItem,
@@ -28,11 +28,11 @@ export const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {
28
28
  ) || {};
29
29
  return (
30
30
  <>
31
- <PageTitle>
31
+ <PageTitleContainer>
32
32
  <PageTitleHeading>
33
33
  {currentStep.review?.title && t(currentStep.review?.title)}
34
34
  </PageTitleHeading>
35
- </PageTitle>
35
+ </PageTitleContainer>
36
36
  <SummaryList>
37
37
  {props.array.map(
38
38
  (item: { [x: string]: React.ReactNode }, idx: number) => (
@@ -1,13 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { StepContext } from '@digigov/form/Questions/Step/StepContext';
3
- import PageTitle, {
4
- PageTitleHeading,
5
- PageTitleHeadingProps,
6
- PageTitleSection,
3
+ import PageTitleContainer, {
7
4
  PageTitleCaption,
8
- } from '@digigov/ui/app/PageTitle';
5
+ } from '@digigov/ui/app/PageTitleContainer';
9
6
  import BackButton from '@digigov/ui/form/Button/BackButton';
10
7
  import { useTranslation } from '@digigov/ui/i18n';
8
+ import HeadingCaption from '@digigov/react-core/HeadingCaption';
9
+ import Heading, { HeadingProps } from '@digigov/react-core/Heading';
11
10
 
12
11
  export interface StepTitleInterface {
13
12
  title?: string;
@@ -16,8 +15,8 @@ export interface StepTitleInterface {
16
15
  step?: string;
17
16
  }
18
17
 
19
- export const StepTitleHeading: React.FC<PageTitleHeadingProps> = (props) => {
20
- return <PageTitleHeading>{props.children}</PageTitleHeading>;
18
+ export const StepTitleHeading: React.FC<HeadingProps> = (props) => {
19
+ return <Heading>{props.children}</Heading>;
21
20
  };
22
21
 
23
22
  export const StepTitleBase: React.FC<StepTitleInterface> = ({
@@ -30,18 +29,16 @@ export const StepTitleBase: React.FC<StepTitleInterface> = ({
30
29
  const { t } = useTranslation();
31
30
  return (
32
31
  <>
33
- <BackButton>{backButton || t('back.button')}</BackButton>
34
- <PageTitle>
32
+ <BackButton>{backButton || t('button.back')}</BackButton>
33
+ <PageTitleContainer>
35
34
  {children || (
36
35
  <>
37
- <PageTitleSection>
38
- <PageTitleCaption>{caption && t(caption)}</PageTitleCaption>
39
- {step && <PageTitleCaption>{step}</PageTitleCaption>}
40
- </PageTitleSection>
36
+ <HeadingCaption size="xl">{caption && t(caption)}</HeadingCaption>
37
+ {step && <PageTitleCaption>{step}</PageTitleCaption>}
41
38
  <StepTitleHeading>{title && t(title)}</StepTitleHeading>
42
39
  </>
43
40
  )}
44
- </PageTitle>
41
+ </PageTitleContainer>
45
42
  </>
46
43
  );
47
44
  };
@@ -2,10 +2,10 @@ export * from '@digigov/form/Questions/Step/ReviewStep';
2
2
  export * from '@digigov/form/Questions/Step/Step';
3
3
  export * from '@digigov/form/Questions/Step/StepArrayReview';
4
4
  export * from '@digigov/form/Questions/Step/StepContext';
5
- export { default as StepDescription } from '@digigov/form/Questions/Step/StepDescription';
6
- export { default as StepForm } from '@digigov/form/Questions/Step/StepForm';
7
- export { default as StepQuote } from '@digigov/form/Questions/Step/StepQuote';
8
- export { default as StepTitle } from '@digigov/form/Questions/Step/StepTitle';
5
+ export * from '@digigov/form/Questions/Step/StepDescription';
6
+ export * from '@digigov/form/Questions/Step/StepForm';
7
+ export * from '@digigov/form/Questions/Step/StepQuote';
8
+ export * from '@digigov/form/Questions/Step/StepTitle';
9
9
  export * from '@digigov/form/Questions/Step/getAddMoreFields';
10
10
  export * from '@digigov/form/Questions/Step/';
11
11
  export * from '@digigov/form/Questions/Step/types';