@digigov/form 0.13.1 → 1.0.0-002c630d

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 (302) hide show
  1. package/Field/FieldBase.js +2 -2
  2. package/Field/FieldBaseContainer.js +8 -8
  3. package/Field/FieldConditional.js +2 -2
  4. package/Field/utils.js +6 -6
  5. package/FieldArray/__stories__/Default.js +2 -2
  6. package/FieldArray/__stories__/WithExactLength.js +2 -2
  7. package/FieldArray/index.js +3 -3
  8. package/FieldObject/index.d.ts +1 -1
  9. package/FieldObject/index.js +5 -5
  10. package/Fieldset/FieldsetWithContext.js +4 -4
  11. package/Fieldset/index.d.ts +1 -1
  12. package/Fieldset/index.js +2 -2
  13. package/Fieldset/types.d.ts +2 -2
  14. package/FormBuilder/FormBuilder.js +5 -5
  15. package/FormBuilder/FormBuilder.mdx +25 -37
  16. package/FormBuilder/__stories__/Default.js +2 -2
  17. package/MultiplicityField/MultiplicityField.mdx +277 -267
  18. package/MultiplicityField/__stories__/Default.js +2 -2
  19. package/MultiplicityField/__stories__/PreviewDisplay.js +8 -8
  20. package/MultiplicityField/__stories__/WithExactLength.js +2 -2
  21. package/MultiplicityField/__stories__/WithMaxLength.js +2 -2
  22. package/MultiplicityField/__stories__/WithMinAndMaxLength.js +2 -2
  23. package/MultiplicityField/__stories__/WithMinLength.js +2 -2
  24. package/MultiplicityField/add-objects.js +6 -6
  25. package/MultiplicityField/index.d.ts +2 -2
  26. package/MultiplicityField/index.js +7 -7
  27. package/Questions/Questions.js +2 -2
  28. package/Questions/Step/ReviewStep.js +8 -8
  29. package/Questions/Step/Step.js +2 -2
  30. package/Questions/Step/StepArrayReview.js +10 -10
  31. package/Questions/Step/StepDescription.js +2 -2
  32. package/Questions/Step/StepForm.d.ts +1 -1
  33. package/Questions/Step/StepForm.js +6 -6
  34. package/Questions/Step/StepTitle.js +2 -2
  35. package/Questions/Step/getAddMoreFields.d.ts +1 -1
  36. package/Questions/__snapshots__/index.spec.tsx.snap +5 -5
  37. package/Questions/__stories__/Default.js +6 -6
  38. package/Questions/index.mdx +41 -44
  39. package/Questions/index.spec.js +2 -2
  40. package/create-simple-form.mdx +258 -237
  41. package/es/Field/FieldBase.js +1 -1
  42. package/es/Field/FieldBaseContainer.js +6 -6
  43. package/es/Field/FieldConditional.js +1 -1
  44. package/es/Field/utils.js +5 -5
  45. package/es/FieldArray/__stories__/Default.js +1 -1
  46. package/es/FieldArray/__stories__/WithExactLength.js +1 -1
  47. package/es/FieldArray/index.js +2 -2
  48. package/es/FieldObject/index.js +3 -3
  49. package/es/Fieldset/FieldsetWithContext.js +2 -2
  50. package/es/Fieldset/index.js +1 -1
  51. package/es/FormBuilder/FormBuilder.js +3 -3
  52. package/es/FormBuilder/FormBuilder.mdx +25 -37
  53. package/es/FormBuilder/__stories__/Default.js +1 -1
  54. package/es/MultiplicityField/MultiplicityField.mdx +277 -267
  55. package/es/MultiplicityField/__stories__/Default.js +1 -1
  56. package/es/MultiplicityField/__stories__/PreviewDisplay.js +7 -7
  57. package/es/MultiplicityField/__stories__/WithExactLength.js +1 -1
  58. package/es/MultiplicityField/__stories__/WithMaxLength.js +1 -1
  59. package/es/MultiplicityField/__stories__/WithMinAndMaxLength.js +1 -1
  60. package/es/MultiplicityField/__stories__/WithMinLength.js +1 -1
  61. package/es/MultiplicityField/add-objects.js +3 -3
  62. package/es/MultiplicityField/index.js +5 -5
  63. package/es/Questions/Questions.js +1 -1
  64. package/es/Questions/Step/ReviewStep.js +5 -5
  65. package/es/Questions/Step/Step.js +1 -1
  66. package/es/Questions/Step/StepArrayReview.js +6 -6
  67. package/es/Questions/Step/StepDescription.js +1 -1
  68. package/es/Questions/Step/StepForm.js +5 -5
  69. package/es/Questions/Step/StepTitle.js +2 -2
  70. package/es/Questions/__snapshots__/index.spec.tsx.snap +5 -5
  71. package/es/Questions/__stories__/Default.js +4 -4
  72. package/es/Questions/index.mdx +41 -44
  73. package/es/Questions/index.spec.js +1 -1
  74. package/es/create-simple-form.mdx +258 -237
  75. package/es/index.mdx +13 -6
  76. package/es/inputs/AutoComplete/__stories__/Default.js +3 -3
  77. package/es/inputs/AutoComplete/index.js +1 -1
  78. package/es/inputs/Checkboxes/__stories__/Conditional.js +1 -1
  79. package/es/inputs/Checkboxes/__stories__/Default.js +1 -1
  80. package/es/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
  81. package/es/inputs/Checkboxes/index.js +3 -3
  82. package/es/inputs/DateInput/__stories__/Default.js +1 -1
  83. package/es/inputs/DateInput/index.js +1 -1
  84. package/es/inputs/FileInput/__stories__/Default.js +1 -1
  85. package/es/inputs/FileInput/index.js +5 -5
  86. package/es/inputs/Input/__stories__/AFM.js +1 -1
  87. package/es/inputs/Input/__stories__/Boolean.js +1 -1
  88. package/es/inputs/Input/__stories__/Default.js +1 -1
  89. package/es/inputs/Input/__stories__/IBAN.js +1 -1
  90. package/es/inputs/Input/__stories__/Integer.js +1 -1
  91. package/es/inputs/Input/__stories__/MobilePhone.js +1 -1
  92. package/es/inputs/Input/__stories__/PhoneNumber.js +1 -1
  93. package/es/inputs/Input/__stories__/PostalCode.js +1 -1
  94. package/es/inputs/Input/__stories__/TextWithCharacterLimit.js +1 -1
  95. package/es/inputs/Input/index.js +1 -1
  96. package/es/inputs/Label/__stories__/Default.js +1 -1
  97. package/es/inputs/Label/index.js +3 -3
  98. package/es/inputs/OtpInput/__stories__/Default.js +1 -1
  99. package/es/inputs/OtpInput/index.js +1 -1
  100. package/es/inputs/Radio/__stories__/Conditional.js +1 -1
  101. package/es/inputs/Radio/__stories__/Default.js +1 -1
  102. package/es/inputs/Radio/__stories__/WithDivider.js +1 -1
  103. package/es/inputs/Radio/index.js +4 -4
  104. package/es/inputs/Select/__stories__/Default.js +1 -1
  105. package/es/installation.mdx +12 -16
  106. package/es/utils.js +1 -1
  107. package/es/validators/index.js +2 -2
  108. package/esm/Field/FieldBase.js +1 -1
  109. package/esm/Field/FieldBaseContainer.js +6 -6
  110. package/esm/Field/FieldConditional.js +1 -1
  111. package/esm/Field/utils.js +5 -5
  112. package/esm/FieldArray/__stories__/Default.js +1 -1
  113. package/esm/FieldArray/__stories__/WithExactLength.js +1 -1
  114. package/esm/FieldArray/index.js +2 -2
  115. package/esm/FieldObject/index.js +3 -3
  116. package/esm/Fieldset/FieldsetWithContext.js +2 -2
  117. package/esm/Fieldset/index.js +1 -1
  118. package/esm/FormBuilder/FormBuilder.js +3 -3
  119. package/esm/FormBuilder/FormBuilder.mdx +25 -37
  120. package/esm/FormBuilder/__stories__/Default.js +1 -1
  121. package/esm/MultiplicityField/MultiplicityField.mdx +277 -267
  122. package/esm/MultiplicityField/__stories__/Default.js +1 -1
  123. package/esm/MultiplicityField/__stories__/PreviewDisplay.js +7 -7
  124. package/esm/MultiplicityField/__stories__/WithExactLength.js +1 -1
  125. package/esm/MultiplicityField/__stories__/WithMaxLength.js +1 -1
  126. package/esm/MultiplicityField/__stories__/WithMinAndMaxLength.js +1 -1
  127. package/esm/MultiplicityField/__stories__/WithMinLength.js +1 -1
  128. package/esm/MultiplicityField/add-objects.js +3 -3
  129. package/esm/MultiplicityField/index.js +5 -5
  130. package/esm/Questions/Questions.js +1 -1
  131. package/esm/Questions/Step/ReviewStep.js +5 -5
  132. package/esm/Questions/Step/Step.js +1 -1
  133. package/esm/Questions/Step/StepArrayReview.js +6 -6
  134. package/esm/Questions/Step/StepDescription.js +1 -1
  135. package/esm/Questions/Step/StepForm.js +5 -5
  136. package/esm/Questions/Step/StepTitle.js +2 -2
  137. package/esm/Questions/__snapshots__/index.spec.tsx.snap +5 -5
  138. package/esm/Questions/__stories__/Default.js +4 -4
  139. package/esm/Questions/index.mdx +41 -44
  140. package/esm/Questions/index.spec.js +1 -1
  141. package/esm/create-simple-form.mdx +258 -237
  142. package/esm/index.js +1 -1
  143. package/esm/index.mdx +13 -6
  144. package/esm/inputs/AutoComplete/__stories__/Default.js +3 -3
  145. package/esm/inputs/AutoComplete/index.js +1 -1
  146. package/esm/inputs/Checkboxes/__stories__/Conditional.js +1 -1
  147. package/esm/inputs/Checkboxes/__stories__/Default.js +1 -1
  148. package/esm/inputs/Checkboxes/__stories__/WithDivider.js +1 -1
  149. package/esm/inputs/Checkboxes/index.js +3 -3
  150. package/esm/inputs/DateInput/__stories__/Default.js +1 -1
  151. package/esm/inputs/DateInput/index.js +1 -1
  152. package/esm/inputs/FileInput/__stories__/Default.js +1 -1
  153. package/esm/inputs/FileInput/index.js +5 -5
  154. package/esm/inputs/Input/__stories__/AFM.js +1 -1
  155. package/esm/inputs/Input/__stories__/Boolean.js +1 -1
  156. package/esm/inputs/Input/__stories__/Default.js +1 -1
  157. package/esm/inputs/Input/__stories__/IBAN.js +1 -1
  158. package/esm/inputs/Input/__stories__/Integer.js +1 -1
  159. package/esm/inputs/Input/__stories__/MobilePhone.js +1 -1
  160. package/esm/inputs/Input/__stories__/PhoneNumber.js +1 -1
  161. package/esm/inputs/Input/__stories__/PostalCode.js +1 -1
  162. package/esm/inputs/Input/__stories__/TextWithCharacterLimit.js +1 -1
  163. package/esm/inputs/Input/index.js +1 -1
  164. package/esm/inputs/Label/__stories__/Default.js +1 -1
  165. package/esm/inputs/Label/index.js +3 -3
  166. package/esm/inputs/OtpInput/__stories__/Default.js +1 -1
  167. package/esm/inputs/OtpInput/index.js +1 -1
  168. package/esm/inputs/Radio/__stories__/Conditional.js +1 -1
  169. package/esm/inputs/Radio/__stories__/Default.js +1 -1
  170. package/esm/inputs/Radio/__stories__/WithDivider.js +1 -1
  171. package/esm/inputs/Radio/index.js +4 -4
  172. package/esm/inputs/Select/__stories__/Default.js +1 -1
  173. package/esm/installation.mdx +12 -16
  174. package/esm/utils.js +1 -1
  175. package/esm/validators/index.js +2 -2
  176. package/index.mdx +13 -6
  177. package/inputs/AutoComplete/__stories__/Default.js +4 -4
  178. package/inputs/AutoComplete/index.d.ts +2 -2
  179. package/inputs/AutoComplete/index.js +2 -2
  180. package/inputs/Checkboxes/__stories__/Conditional.js +2 -2
  181. package/inputs/Checkboxes/__stories__/Default.js +2 -2
  182. package/inputs/Checkboxes/__stories__/WithDivider.js +2 -2
  183. package/inputs/Checkboxes/index.d.ts +1 -1
  184. package/inputs/Checkboxes/index.js +4 -4
  185. package/inputs/DateInput/__stories__/Default.js +2 -2
  186. package/inputs/DateInput/index.js +2 -2
  187. package/inputs/FileInput/__stories__/Default.js +2 -2
  188. package/inputs/FileInput/index.js +5 -5
  189. package/inputs/Input/__stories__/AFM.js +2 -2
  190. package/inputs/Input/__stories__/Boolean.js +2 -2
  191. package/inputs/Input/__stories__/Default.js +2 -2
  192. package/inputs/Input/__stories__/IBAN.js +2 -2
  193. package/inputs/Input/__stories__/Integer.js +2 -2
  194. package/inputs/Input/__stories__/MobilePhone.js +2 -2
  195. package/inputs/Input/__stories__/PhoneNumber.js +2 -2
  196. package/inputs/Input/__stories__/PostalCode.js +2 -2
  197. package/inputs/Input/__stories__/TextWithCharacterLimit.js +2 -2
  198. package/inputs/Input/index.js +1 -1
  199. package/inputs/Label/__stories__/Default.js +2 -2
  200. package/inputs/Label/index.js +4 -4
  201. package/inputs/OtpInput/__stories__/Default.js +2 -2
  202. package/inputs/OtpInput/index.js +1 -1
  203. package/inputs/Radio/__stories__/Conditional.js +2 -2
  204. package/inputs/Radio/__stories__/Default.js +2 -2
  205. package/inputs/Radio/__stories__/WithDivider.js +2 -2
  206. package/inputs/Radio/index.d.ts +1 -1
  207. package/inputs/Radio/index.js +7 -7
  208. package/inputs/Select/__stories__/Default.js +2 -2
  209. package/inputs/Select/index.d.ts +1 -1
  210. package/installation.mdx +12 -16
  211. package/package.json +5 -5
  212. package/src/Field/FieldBase.tsx +1 -1
  213. package/src/Field/FieldBaseContainer.tsx +7 -7
  214. package/src/Field/FieldConditional.tsx +1 -1
  215. package/src/Field/index.tsx +1 -1
  216. package/src/Field/utils.ts +7 -7
  217. package/src/FieldArray/FieldArray.stories.js +1 -1
  218. package/src/FieldArray/__stories__/Default.tsx +1 -1
  219. package/src/FieldArray/__stories__/WithExactLength.tsx +1 -1
  220. package/src/FieldArray/index.tsx +3 -3
  221. package/src/FieldObject/index.tsx +6 -6
  222. package/src/Fieldset/FieldsetWithContext.tsx +3 -3
  223. package/src/Fieldset/index.tsx +5 -5
  224. package/src/Fieldset/types.tsx +3 -3
  225. package/src/FormBuilder/FormBuilder.mdx +25 -37
  226. package/src/FormBuilder/FormBuilder.stories.js +1 -1
  227. package/src/FormBuilder/FormBuilder.tsx +4 -4
  228. package/src/FormBuilder/__stories__/Default.tsx +1 -1
  229. package/src/MultiplicityField/MultiplicityField.mdx +277 -267
  230. package/src/MultiplicityField/MultiplicityField.stories.js +1 -1
  231. package/src/MultiplicityField/__stories__/Default.tsx +1 -1
  232. package/src/MultiplicityField/__stories__/PreviewDisplay.tsx +14 -14
  233. package/src/MultiplicityField/__stories__/WithExactLength.tsx +1 -1
  234. package/src/MultiplicityField/__stories__/WithMaxLength.tsx +1 -1
  235. package/src/MultiplicityField/__stories__/WithMinAndMaxLength.tsx +1 -1
  236. package/src/MultiplicityField/__stories__/WithMinLength.tsx +1 -1
  237. package/src/MultiplicityField/add-objects.tsx +3 -3
  238. package/src/MultiplicityField/index.tsx +9 -9
  239. package/src/Questions/Questions.stories.js +1 -1
  240. package/src/Questions/Questions.tsx +2 -2
  241. package/src/Questions/Step/ReviewStep.tsx +6 -6
  242. package/src/Questions/Step/Step.tsx +1 -1
  243. package/src/Questions/Step/StepArrayReview.tsx +9 -9
  244. package/src/Questions/Step/StepDescription.tsx +1 -1
  245. package/src/Questions/Step/StepForm.tsx +6 -6
  246. package/src/Questions/Step/StepTitle.tsx +8 -3
  247. package/src/Questions/Step/getAddMoreFields.tsx +1 -1
  248. package/src/Questions/__snapshots__/index.spec.tsx.snap +5 -5
  249. package/src/Questions/__stories__/Default.tsx +4 -4
  250. package/src/Questions/index.mdx +41 -44
  251. package/src/Questions/index.spec.tsx +1 -1
  252. package/src/create-simple-form.mdx +258 -237
  253. package/src/index.mdx +13 -6
  254. package/src/inputs/AutoComplete/__stories__/Default.tsx +3 -3
  255. package/src/inputs/AutoComplete/index.tsx +4 -4
  256. package/src/inputs/Checkboxes/Checkboxes.stories.js +1 -1
  257. package/src/inputs/Checkboxes/__stories__/Conditional.tsx +2 -2
  258. package/src/inputs/Checkboxes/__stories__/Default.tsx +1 -1
  259. package/src/inputs/Checkboxes/__stories__/WithDivider.tsx +2 -2
  260. package/src/inputs/Checkboxes/index.tsx +4 -4
  261. package/src/inputs/DateInput/DateInput.stories.js +1 -1
  262. package/src/inputs/DateInput/__stories__/Default.tsx +1 -1
  263. package/src/inputs/DateInput/index.tsx +2 -2
  264. package/src/inputs/FileInput/FileInput.stories.js +1 -1
  265. package/src/inputs/FileInput/__stories__/Default.tsx +1 -1
  266. package/src/inputs/FileInput/index.tsx +5 -5
  267. package/src/inputs/Input/__stories__/AFM.tsx +1 -1
  268. package/src/inputs/Input/__stories__/Boolean.tsx +1 -1
  269. package/src/inputs/Input/__stories__/Default.tsx +1 -1
  270. package/src/inputs/Input/__stories__/IBAN.tsx +1 -1
  271. package/src/inputs/Input/__stories__/Integer.tsx +1 -1
  272. package/src/inputs/Input/__stories__/MobilePhone.tsx +1 -1
  273. package/src/inputs/Input/__stories__/PhoneNumber.tsx +1 -1
  274. package/src/inputs/Input/__stories__/PostalCode.tsx +1 -1
  275. package/src/inputs/Input/__stories__/TextWithCharacterLimit.tsx +1 -1
  276. package/src/inputs/Input/index.tsx +3 -3
  277. package/src/inputs/Label/Label.stories.js +1 -1
  278. package/src/inputs/Label/__stories__/Default.tsx +1 -1
  279. package/src/inputs/Label/index.tsx +4 -4
  280. package/src/inputs/OtpInput/__stories__/Default.tsx +1 -1
  281. package/src/inputs/OtpInput/index.tsx +7 -3
  282. package/src/inputs/Radio/Radio.stories.js +1 -2
  283. package/src/inputs/Radio/__stories__/Conditional.tsx +3 -3
  284. package/src/inputs/Radio/__stories__/Default.tsx +1 -1
  285. package/src/inputs/Radio/__stories__/WithDivider.tsx +2 -2
  286. package/src/inputs/Radio/index.tsx +6 -6
  287. package/src/inputs/Select/Select.stories.js +1 -1
  288. package/src/inputs/Select/__stories__/Default.tsx +1 -1
  289. package/src/inputs/Select/index.tsx +2 -2
  290. package/src/installation.mdx +12 -16
  291. package/src/types.tsx +4 -2
  292. package/src/utils.ts +1 -1
  293. package/src/validators/index.ts +10 -10
  294. package/src/validators/utils/file.ts +1 -1
  295. package/src/validators/utils/phone.ts +1 -1
  296. package/src/validators/utils/postal_code.ts +1 -1
  297. package/types.d.ts +4 -2
  298. package/validators/index.d.ts +3 -3
  299. package/validators/index.js +4 -4
  300. package/validators/utils/file.d.ts +1 -1
  301. package/validators/utils/phone.d.ts +1 -1
  302. package/validators/utils/postal_code.d.ts +1 -1
@@ -2,7 +2,7 @@ import MultiplicityField from '@digigov/form/MultiplicityField';
2
2
  export default {
3
3
  title: 'Digigov Form/MultiplicityField',
4
4
  component: MultiplicityField,
5
- displayName: 'MultiplicityField'
5
+ displayName: 'MultiplicityField',
6
6
  };
7
7
  export * from '@digigov/form/MultiplicityField/__stories__/Default';
8
8
  export * from '@digigov/form/MultiplicityField/__stories__/WithMinLength';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
- import { Button } from '@digigov/ui/core';
3
+ import { Button } from '@digigov/ui/form/Button';
4
4
 
5
5
  const fields = [
6
6
  {
@@ -1,10 +1,4 @@
1
1
  import React from 'react';
2
- import Layout, { Content, Main } from '@digigov/ui/layouts/Basic/';
3
- import SummaryList, {
4
- SummaryListItem,
5
- SummaryListItemKey,
6
- SummaryListItemValue,
7
- } from '@digigov/ui/core/SummaryList';
8
2
  import {
9
3
  Header,
10
4
  HeaderSection,
@@ -15,12 +9,18 @@ import {
15
9
  Paragraph,
16
10
  Card,
17
11
  CardHeading,
18
- CardText,
12
+ CardContent,
19
13
  List,
20
14
  ListItem,
21
15
  } from '@digigov/ui';
16
+ import SummaryList, {
17
+ SummaryListItem,
18
+ SummaryListItemKey,
19
+ SummaryListItemValue,
20
+ } from '@digigov/ui/content/SummaryList';
22
21
  import GovGRFooter from '@digigov/ui/govgr/Footer';
23
22
  import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
23
+ import Layout, { Content, Main } from '@digigov/ui/layouts/Basic/';
24
24
 
25
25
  const fields = [
26
26
  {
@@ -82,7 +82,7 @@ export const PreviewDisplay = () => (
82
82
  </Paragraph>
83
83
  <Card variant="border" borderColor="dark">
84
84
  <CardHeading>Συνυπογράφοντας 1</CardHeading>
85
- <CardText>
85
+ <CardContent>
86
86
  <SummaryList>
87
87
  {fields &&
88
88
  fields.map((field, index) => {
@@ -94,11 +94,11 @@ export const PreviewDisplay = () => (
94
94
  );
95
95
  })}
96
96
  </SummaryList>
97
- </CardText>
97
+ </CardContent>
98
98
  </Card>
99
99
  <Card variant="border" borderColor="dark">
100
100
  <CardHeading>Συνυπογράφοντας 2</CardHeading>
101
- <CardText>
101
+ <CardContent>
102
102
  <SummaryList>
103
103
  {fields &&
104
104
  fields.map((field, index) => {
@@ -110,20 +110,20 @@ export const PreviewDisplay = () => (
110
110
  );
111
111
  })}
112
112
  </SummaryList>
113
- </CardText>
113
+ </CardContent>
114
114
  </Card>
115
115
  <Card variant="border" borderColor="dark">
116
116
  <CardHeading>Συνυπογράφοντας 3</CardHeading>
117
- <CardText>
117
+ <CardContent>
118
118
  <SummaryList>
119
119
  <SummaryListItem>
120
120
  <SummaryListItemKey>Όνομα</SummaryListItemKey>
121
121
  <SummaryListItemValue>Μάριος</SummaryListItemValue>
122
122
  </SummaryListItem>
123
123
  </SummaryList>
124
- </CardText>
124
+ </CardContent>
125
125
  </Card>
126
- <Heading size="m">Στοιχεία Δήλωσης</Heading>
126
+ <Heading size="md">Στοιχεία Δήλωσης</Heading>
127
127
  <SummaryList>
128
128
  <SummaryListItem>
129
129
  <SummaryListItemKey>Όνομα</SummaryListItemKey>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
- import { Button } from '@digigov/ui/core';
3
+ import { Button } from '@digigov/ui/form/Button';
4
4
 
5
5
  const fields = [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
- import { Button } from '@digigov/ui/core';
3
+ import { Button } from '@digigov/ui/form/Button';
4
4
 
5
5
  const fields = [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
- import { Button } from '@digigov/ui/core';
3
+ import { Button } from '@digigov/ui/form/Button';
4
4
 
5
5
  const fields = [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import FormBuilder, { Field, FieldSpec } from '@digigov/form';
3
- import { Button } from '@digigov/ui/core';
3
+ import { Button } from '@digigov/ui/form/Button';
4
4
 
5
5
  const fields = [
6
6
  {
@@ -1,9 +1,6 @@
1
1
  /* eslint-disable react/prop-types */
2
2
  import React, { useEffect, useMemo } from 'react';
3
3
  // import { FormBuilderProps } from '@digigov/form';
4
- import Button from '@digigov/ui/core/Button';
5
- import Fieldset from '@digigov/react-core/Fieldset';
6
- import RadioConditional from '@digigov/react-core/RadioConditional';
7
4
  import {
8
5
  ErrorOption,
9
6
  FieldArrayWithId,
@@ -19,6 +16,9 @@ import {
19
16
  StashedObject,
20
17
  } from '@digigov/form/MultiplicityField';
21
18
  import { FieldSpec } from '@digigov/form/types';
19
+ import Fieldset from '@digigov/react-core/Fieldset';
20
+ import RadioConditional from '@digigov/react-core/RadioConditional';
21
+ import Button from '@digigov/ui/form/Button';
22
22
  export interface AddObjectsProps
23
23
  extends Omit<MultiplicityProps, 'key' | 'component'> {
24
24
  fields: FieldArrayWithId[];
@@ -1,18 +1,18 @@
1
1
  import React, { useState } from 'react';
2
+ import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
3
+ import { FieldSpec } from '@digigov/form';
4
+ import FieldContainer from '@digigov/form/Field/FieldBaseContainer';
2
5
  import { ControlledFieldProps } from '@digigov/form/Field/types';
6
+ import FieldObject from '@digigov/form/FieldObject';
7
+ import AddObjects from '@digigov/form/MultiplicityField/add-objects';
3
8
  import {
4
9
  Card,
5
- CardText,
10
+ CardContent,
6
11
  CardAction,
7
12
  Button,
8
13
  Heading,
9
14
  CardHeading,
10
15
  } from '@digigov/react-core';
11
- import { FieldSpec } from '@digigov/form';
12
- import AddObjects from '@digigov/form/MultiplicityField/add-objects';
13
- import { ErrorOption, useFieldArray, UseFormReturn } from 'react-hook-form';
14
- import FieldObject from '@digigov/form/FieldObject';
15
- import FieldContainer from '@digigov/form/Field/FieldBaseContainer';
16
16
 
17
17
  export interface MultiplicityProps
18
18
  extends Omit<ControlledFieldProps, 'value' | 'onChange' | 'error' | 'extra'> {
@@ -78,7 +78,7 @@ export const Multiplicity: React.FC<MultiplicityProps> = ({
78
78
  >
79
79
  {stashedObjects.length > 0 ? (
80
80
  <div>
81
- <Heading size="m">{extra?.label.object.title_added}</Heading>
81
+ <Heading size="md">{extra?.label.object.title_added}</Heading>
82
82
  {stashedObjects.map((_Object, index) => {
83
83
  return (
84
84
  <ListObject
@@ -147,7 +147,7 @@ export const ListObject: React.FC<ListObjectProps> = ({
147
147
  <CardHeading>
148
148
  {extra?.label.object.title} #{index + 1}
149
149
  </CardHeading>
150
- <CardText>
150
+ <CardContent>
151
151
  <FieldObject
152
152
  name={currentName}
153
153
  formState={formState}
@@ -155,7 +155,7 @@ export const ListObject: React.FC<ListObjectProps> = ({
155
155
  control={control}
156
156
  {...extra?.of}
157
157
  />
158
- </CardText>
158
+ </CardContent>
159
159
  <CardAction>
160
160
  <Button type="button" variant="link" onClick={() => onDelete(index)}>
161
161
  {extra?.label.object.delete}
@@ -2,6 +2,6 @@ import Questions from '@digigov/form/Questions';
2
2
  export default {
3
3
  title: 'Digigov Form/Questions',
4
4
  component: Questions,
5
- displayName: 'Questions'
5
+ displayName: 'Questions',
6
6
  };
7
7
  export * from '@digigov/form/Questions/__stories__/Default';
@@ -1,8 +1,8 @@
1
1
  import React, { useState, useEffect } from 'react';
2
+ import { getNextStep } from '@digigov/form/Questions/getNextStep';
3
+ import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
2
4
  import { StepInterface } from '@digigov/form/Questions/Step/types';
3
5
  import { QuestionsInterface } from '@digigov/form/Questions/types';
4
- import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
5
- import { getNextStep } from '@digigov/form/Questions/getNextStep';
6
6
 
7
7
  const isBrowser = typeof window !== 'undefined';
8
8
 
@@ -1,17 +1,17 @@
1
1
  import React, { useContext } from 'react';
2
+ import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
3
+ import { StepContext } from '@digigov/form/Questions/Step/StepContext';
4
+ import { StepTitleBase } from '@digigov/form/Questions/Step/StepTitle';
2
5
  import {
3
6
  SummaryList,
4
7
  SummaryListItem,
5
8
  SummaryListItemKey,
6
9
  SummaryListItemValue,
7
10
  SummaryListItemAction,
8
- } from '@digigov/ui/core/SummaryList';
11
+ } from '@digigov/ui/content/SummaryList';
12
+ import { Button } from '@digigov/ui/form/Button';
13
+ import { useTranslation } from '@digigov/ui/i18n';
9
14
  import Title from '@digigov/ui/typography/Title';
10
- import { Button } from '@digigov/ui/core';
11
- import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
12
- import { StepTitleBase } from '@digigov/form/Questions/Step/StepTitle';
13
- import { StepContext } from '@digigov/form/Questions/Step/StepContext';
14
- import { useTranslation } from '@digigov/ui/app/i18n';
15
15
 
16
16
  export const ReviewStep = (): React.ReactElement => {
17
17
  const { t } = useTranslation();
@@ -1,7 +1,7 @@
1
1
  import React, { useContext, useState } from 'react';
2
2
  import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
3
- import { StepContext } from '@digigov/form/Questions/Step/StepContext';
4
3
  import { StepArrayReview } from '@digigov/form/Questions/Step/StepArrayReview';
4
+ import { StepContext } from '@digigov/form/Questions/Step/StepContext';
5
5
  import { StepInterface } from '@digigov/form/Questions/Step/types';
6
6
 
7
7
  /**
@@ -1,22 +1,22 @@
1
1
  import React, { useContext } from 'react';
2
- import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
3
- import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
4
- import Button from '@digigov/ui/core/Button';
5
- import FormBuilder from '@digigov/form/FormBuilder';
6
- import { FieldSpec } from '@digigov/form/types';
7
2
  import { Field } from '@digigov/form/Field';
8
3
  import { Fieldset } from '@digigov/form/Fieldset';
4
+ import FormBuilder from '@digigov/form/FormBuilder';
9
5
  import Label from '@digigov/form/inputs/Label';
6
+ import { QuestionsContext } from '@digigov/form/Questions/QuestionsContext';
7
+ import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
8
+ import { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
9
+ import { FieldSpec } from '@digigov/form/types';
10
+ import PageTitle, { PageTitleHeading } from '@digigov/ui/app/PageTitle';
10
11
  import {
11
12
  SummaryList,
12
13
  SummaryListItem,
13
14
  SummaryListItemKey,
14
15
  SummaryListItemValue,
15
16
  SummaryListItemAction,
16
- } from '@digigov/ui/core/SummaryList';
17
- import { useTranslation } from '@digigov/ui/app/i18n';
18
- import { StepArrayReviewInterface } from '@digigov/form/Questions/Step/types';
19
- import { getAddMoreFields } from '@digigov/form/Questions/Step/getAddMoreFields';
17
+ } from '@digigov/ui/content/SummaryList';
18
+ import Button from '@digigov/ui/form/Button';
19
+ import { useTranslation } from '@digigov/ui/i18n';
20
20
 
21
21
  export const StepArrayReview: React.FC<StepArrayReviewInterface> = (props) => {
22
22
  const { t } = useTranslation();
@@ -1,7 +1,7 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { StepContext } from '@digigov/form/Questions/Step/StepContext';
3
+ import { useTranslation } from '@digigov/ui/i18n';
3
4
  import Paragraph, { ParagraphProps } from '@digigov/ui/typography/Paragraph';
4
- import { useTranslation } from '@digigov/ui/app/i18n';
5
5
 
6
6
  export interface StepDescriptionInterface extends ParagraphProps {
7
7
  description?: string;
@@ -1,12 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
- import { StepContext } from '@digigov/form/Questions/Step/StepContext';
3
- import FormBuilder from '@digigov/form/FormBuilder';
4
- import Fieldset from '@digigov/form/Fieldset';
5
2
  import Field from '@digigov/form/Field';
6
- import { FormBuilderProps } from '@digigov/form/types';
7
3
  import { FieldProps } from '@digigov/form/Field/types';
8
- import Button from '@digigov/ui/core/Button';
9
- import { useTranslation } from '@digigov/ui/app/i18n';
4
+ import Fieldset from '@digigov/form/Fieldset';
5
+ import FormBuilder from '@digigov/form/FormBuilder';
6
+ import { StepContext } from '@digigov/form/Questions/Step/StepContext';
7
+ import { FormBuilderProps } from '@digigov/form/types';
8
+ import Button from '@digigov/ui/form/Button';
9
+ import { useTranslation } from '@digigov/ui/i18n';
10
10
 
11
11
  export interface StepFormProps {
12
12
  submitButton: boolean;
@@ -6,8 +6,8 @@ import PageTitle, {
6
6
  PageTitleSection,
7
7
  PageTitleCaption,
8
8
  } from '@digigov/ui/app/PageTitle';
9
- import BackButton from '@digigov/ui/core/Button/BackButton';
10
- import { useTranslation } from '@digigov/ui/app/i18n';
9
+ import BackButton from '@digigov/ui/form/Button/BackButton';
10
+ import { useTranslation } from '@digigov/ui/i18n';
11
11
 
12
12
  export interface StepTitleInterface {
13
13
  title?: string;
@@ -53,7 +53,12 @@ export const StepTitleBase: React.FC<StepTitleInterface> = ({
53
53
  export const StepTitle: React.FC<StepTitleInterface> = (props) => {
54
54
  const { caption, title, step, backButton } = useContext(StepContext);
55
55
  return (
56
- <StepTitleBase backButton={backButton} caption={caption} step={step} title={title}>
56
+ <StepTitleBase
57
+ backButton={backButton}
58
+ caption={caption}
59
+ step={step}
60
+ title={title}
61
+ >
57
62
  {props.children}
58
63
  </StepTitleBase>
59
64
  );
@@ -1,5 +1,5 @@
1
- import { FieldSpec } from '@digigov/form/types';
2
1
  import { StepInterface } from '@digigov/form/Questions/Step/types';
2
+ import { FieldSpec } from '@digigov/form/types';
3
3
 
4
4
  export const getAddMoreFields = (currentStep: StepInterface): FieldSpec[] => {
5
5
  return [
@@ -113,10 +113,10 @@ exports[`renders the Questions 1`] = `
113
113
  <ForwardRef(PageTitleCaption)>
114
114
  <ForwardRef(Base)
115
115
  as="span"
116
- className="govgr-caption-l"
116
+ className="govgr-caption-lg"
117
117
  >
118
118
  <span
119
- className="govgr-caption-l"
119
+ className="govgr-caption-lg"
120
120
  >
121
121
  intro.caption
122
122
  </span>
@@ -381,14 +381,14 @@ exports[`renders the Questions 1`] = `
381
381
  }
382
382
  >
383
383
  <ForwardRef(LabelTitle)
384
- size="s"
384
+ size="sm"
385
385
  >
386
386
  <ForwardRef(Base)
387
387
  as="span"
388
- className="govgr-heading-s"
388
+ className="govgr-heading-sm"
389
389
  >
390
390
  <span
391
- className="govgr-heading-s"
391
+ className="govgr-heading-sm"
392
392
  >
393
393
  name.field.primary
394
394
  </span>
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
- import GovGRFooter from '@digigov/ui/govgr/Footer';
2
+ import { Field } from '@digigov/form';
3
+ import Questions, { Step, StepForm, StepTitle } from '@digigov/form/Questions';
3
4
  import Header from '@digigov/ui/app/Header';
4
- import HeaderSection from '@digigov/ui/app/Header/HeaderSection';
5
5
  import HeaderContent from '@digigov/ui/app/Header/HeaderContent';
6
+ import HeaderSection from '@digigov/ui/app/Header/HeaderSection';
7
+ import GovGRFooter from '@digigov/ui/govgr/Footer';
6
8
  import GovGRLogo from '@digigov/ui/govgr/GovGRLogo';
7
9
  import BasicLayout, {
8
10
  Top,
@@ -10,8 +12,6 @@ import BasicLayout, {
10
12
  Main,
11
13
  Bottom,
12
14
  } from '@digigov/ui/layouts/Basic';
13
- import Questions, { Step, StepForm, StepTitle } from '@digigov/form/Questions';
14
- import { Field } from '@digigov/form';
15
15
 
16
16
  const steps = [
17
17
  {
@@ -14,12 +14,14 @@ import {
14
14
  TableDataCell,
15
15
  } from '@digigov/react-core';
16
16
 
17
- import LeadText from "@site/src/components/LeadText";
17
+ import LeadText from '@site/src/components/LeadText';
18
18
 
19
- <LeadText>Question pages are used to ask users meaningful questions needed by
20
- your GOV.GR service, or even gather data about their persona or their
21
- application status. Use step questions to make bigger forms less scary and
22
- easier to fill out.</LeadText>
19
+ <LeadText>
20
+ Question pages are used to ask users meaningful questions needed by your
21
+ GOV.GR service, or even gather data about their persona or their application
22
+ status. Use step questions to make bigger forms less scary and easier to fill
23
+ out.
24
+ </LeadText>
23
25
 
24
26
  ## Introduction to Question pages
25
27
 
@@ -94,10 +96,10 @@ const steps = [
94
96
  primary: 'Birthday',
95
97
  },
96
98
  type: 'date',
97
- required: true
98
- }
99
- ]
100
- }
99
+ required: true,
100
+ },
101
+ ],
102
+ },
101
103
  ];
102
104
 
103
105
  export default function Index() {
@@ -152,18 +154,13 @@ Each step can be defined using a `Step` React component and all steps should be
152
154
  place inside a `Questions` component, that will provide the steps subcomponents
153
155
  the required state.
154
156
 
155
- First, you declare an array called `steps` and then you pass it to `<Questions
156
- />` as a prop. Then for each step you can declare a `<Step />` component and
157
+ First, you declare an array called `steps` and then you pass it to `<Questions />` as a prop. Then for each step you can declare a `<Step />` component and
157
158
  its subsequent subcomponents that you customise as needed, like the step title,
158
159
  description or form. You can also add components that are not form-specific,
159
160
  adding paragraphs or other custom components.
160
161
 
161
162
  ```jsx
162
- <Questions
163
- name="example"
164
- steps={steps}
165
- onSubmit={(data) => doSomething(data)}
166
- >
163
+ <Questions name="example" steps={steps} onSubmit={(data) => doSomething(data)}>
167
164
  {/* more steps could be rendered here ... */}
168
165
  <Step name="age">
169
166
  <StepTitle />
@@ -181,21 +178,21 @@ adding paragraphs or other custom components.
181
178
  Steps can be described using `StepInterface` interface declared as a JSON
182
179
  object. The most basic properties are the following:
183
180
 
184
- * `name` - a unique identifier, must be different for each step
185
- * `title` - the main questions title that communicates to the users what this
181
+ - `name` - a unique identifier, must be different for each step
182
+ - `title` - the main questions title that communicates to the users what this
186
183
  question page is about, rendered by `StepTitle`
187
- * `fields` - an array that describes each input field that will be rendered in
184
+ - `fields` - an array that describes each input field that will be rendered in
188
185
  the `StepForm`. Each fields implements the `FieldSpec` interface as a JSON object.
189
186
 
190
187
  ```json title="step-name.json"
191
188
  {
192
- name: 'name',
193
- title: 'What is your name?',
194
- fields: [
189
+ "name": "name",
190
+ "title": "What is your name?",
191
+ "fields": [
195
192
  {
196
- key: 'name',
197
- type: 'string',
198
- required: true,
193
+ "key": "name",
194
+ "type": "string",
195
+ "required": true
199
196
  }
200
197
  ]
201
198
  }
@@ -264,7 +261,7 @@ const steps = [
264
261
 
265
262
  For example, you may use a form to determine if citizens are adults or not, and
266
263
  we want to ask users different questions according to their persona. We can use
267
- a branch between the `age` step and the other two steps.
264
+ a branch between the `age` step and the other two steps.
268
265
 
269
266
  ```jsx live
270
267
  import React from 'react';
@@ -292,11 +289,11 @@ const steps = [
292
289
  key: 'age',
293
290
  type: 'int',
294
291
  required: true,
295
- }
292
+ },
296
293
  ],
297
294
  nextStep: (data) => {
298
295
  return data.age < 18 ? 'citizen-adult' : 'citizen-underage';
299
- }
296
+ },
300
297
  },
301
298
  {
302
299
  name: 'citizen-underage',
@@ -309,17 +306,17 @@ const steps = [
309
306
  extra: {
310
307
  options: [
311
308
  {
312
- label: {primary: "Yes"},
309
+ label: { primary: 'Yes' },
313
310
  value: 'yes',
314
311
  },
315
312
  {
316
- label: {primary: "No"},
313
+ label: { primary: 'No' },
317
314
  value: 'no',
318
- }
319
- ]
320
- }
321
- }
322
- ]
315
+ },
316
+ ],
317
+ },
318
+ },
319
+ ],
323
320
  },
324
321
  {
325
322
  name: 'citizen-adult',
@@ -332,17 +329,17 @@ const steps = [
332
329
  extra: {
333
330
  options: [
334
331
  {
335
- label: {primary: "Yes"},
332
+ label: { primary: 'Yes' },
336
333
  value: 'yes',
337
334
  },
338
335
  {
339
- label: {primary: "No"},
336
+ label: { primary: 'No' },
340
337
  value: 'no',
341
- }
342
- ]
343
- }
344
- }
345
- ]
338
+ },
339
+ ],
340
+ },
341
+ },
342
+ ],
346
343
  },
347
344
  ];
348
345
 
@@ -396,7 +393,7 @@ export default function Index() {
396
393
  }
397
394
  ```
398
395
 
399
- ## Prop types
396
+ ## Prop types
400
397
 
401
398
  <TableContainer>
402
399
  <Table>
@@ -409,7 +406,7 @@ export default function Index() {
409
406
  </TableHead>
410
407
  <TableBody>
411
408
  <TableRow>
412
- <TableDataCell>Πρώτες 6 εβδομάδες </TableDataCell>
409
+ <TableDataCell>Πρώτες 6 εβδομάδες </TableDataCell>
413
410
  <TableDataCell> €109.80 / εβδομάδα</TableDataCell>
414
411
  <TableDataCell> €69.80 / εβδομάδα</TableDataCell>
415
412
  </TableRow>
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { mount } from 'enzyme';
3
3
 
4
+ import { Field } from '@digigov/form';
4
5
  import { Step, StepForm, StepQuote, StepTitle } from '@digigov/form/Questions';
5
6
  import Questions from '@digigov/form/Questions';
6
- import { Field } from '@digigov/form';
7
7
 
8
8
  const steps = [
9
9
  {