@digigov/ui 0.32.0 → 0.32.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 (181) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/admin/AccessibilityMenu/index.d.ts +6 -0
  3. package/admin/AccessibilityMenu/index.js +85 -30
  4. package/admin/AutoComplete/index.mdx +8 -30
  5. package/admin/CopyToClipboard/index.mdx +1 -5
  6. package/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
  7. package/admin/Dropdown/__stories__/AlignRight.js +1 -2
  8. package/admin/Dropdown/__stories__/Default.js +1 -3
  9. package/admin/Dropdown/__stories__/PlacementTop.js +1 -2
  10. package/admin/Dropdown/index.mdx +3 -15
  11. package/admin/Modal/Modal.stories.playwright.json +37 -0
  12. package/admin/Modal/__stories__/AlertDialog.js +36 -12
  13. package/admin/Modal/__stories__/Default.js +34 -10
  14. package/admin/Modal/index.mdx +1 -5
  15. package/app/Footer/Footer.mdx +3 -14
  16. package/app/Header/index.mdx +3 -16
  17. package/app/QrCodeViewer/index.mdx +1 -5
  18. package/core/Accordion/index.d.ts +5 -1
  19. package/core/Accordion/index.js +46 -13
  20. package/core/Accordion/index.mdx +2 -10
  21. package/core/Button/__stories__/GroupingButtons.d.ts +1 -0
  22. package/core/Button/__stories__/GroupingButtons.js +4 -2
  23. package/core/Button/__stories__/GroupingButtonsAndLinks.d.ts +1 -0
  24. package/core/Button/__stories__/GroupingButtonsAndLinks.js +4 -2
  25. package/core/Button/__stories__/Warning.d.ts +1 -0
  26. package/core/Button/__stories__/Warning.js +4 -2
  27. package/core/Button/index.mdx +4 -20
  28. package/core/Card/card.mdx +7 -35
  29. package/core/Checkbox/checkbox.mdx +6 -30
  30. package/core/DateInputContainer/index.mdx +4 -20
  31. package/core/ErrorSummary/index.mdx +3 -15
  32. package/core/FileUpload/index.mdx +1 -5
  33. package/core/Link/link.mdx +4 -20
  34. package/core/List/index.mdx +1 -5
  35. package/core/NavList/index.mdx +1 -5
  36. package/core/NotificationBanner/index.mdx +1 -5
  37. package/core/PhaseBanner/index.mdx +1 -4
  38. package/core/RadioContainer/index.mdx +6 -30
  39. package/core/SelectContainer/index.mdx +3 -15
  40. package/core/SingleCharacterInputContainer/index.mdx +7 -10
  41. package/core/SummaryList/index.mdx +2 -10
  42. package/core/Table/index.mdx +6 -30
  43. package/core/TextArea/index.mdx +6 -30
  44. package/core/TextInput/index.mdx +6 -30
  45. package/core/index.d.ts +1 -0
  46. package/core/index.js +13 -0
  47. package/es/admin/AccessibilityMenu/index.js +49 -0
  48. package/es/admin/AutoComplete/index.mdx +8 -30
  49. package/es/admin/CopyToClipboard/index.mdx +1 -5
  50. package/es/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
  51. package/es/admin/Dropdown/__stories__/AlignRight.js +1 -2
  52. package/es/admin/Dropdown/__stories__/Default.js +1 -3
  53. package/es/admin/Dropdown/__stories__/PlacementTop.js +1 -2
  54. package/es/admin/Dropdown/index.mdx +3 -15
  55. package/es/admin/Modal/Modal.stories.playwright.json +37 -0
  56. package/es/admin/Modal/__stories__/AlertDialog.js +29 -12
  57. package/es/admin/Modal/__stories__/Default.js +27 -10
  58. package/es/admin/Modal/index.mdx +1 -5
  59. package/es/app/Footer/Footer.mdx +3 -14
  60. package/es/app/Header/index.mdx +3 -16
  61. package/es/app/QrCodeViewer/index.mdx +1 -5
  62. package/es/core/Accordion/index.js +40 -6
  63. package/es/core/Accordion/index.mdx +2 -10
  64. package/es/core/Button/__stories__/GroupingButtons.js +2 -1
  65. package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
  66. package/es/core/Button/__stories__/Warning.js +2 -1
  67. package/es/core/Button/index.mdx +4 -20
  68. package/es/core/Card/card.mdx +7 -35
  69. package/es/core/Checkbox/checkbox.mdx +6 -30
  70. package/es/core/DateInputContainer/index.mdx +4 -20
  71. package/es/core/ErrorSummary/index.mdx +3 -15
  72. package/es/core/FileUpload/index.mdx +1 -5
  73. package/es/core/Link/link.mdx +4 -20
  74. package/es/core/List/index.mdx +1 -5
  75. package/es/core/NavList/index.mdx +1 -5
  76. package/es/core/NotificationBanner/index.mdx +1 -5
  77. package/es/core/PhaseBanner/index.mdx +1 -4
  78. package/es/core/RadioContainer/index.mdx +6 -30
  79. package/es/core/SelectContainer/index.mdx +3 -15
  80. package/es/core/SingleCharacterInputContainer/index.mdx +7 -10
  81. package/es/core/SummaryList/index.mdx +2 -10
  82. package/es/core/Table/index.mdx +6 -30
  83. package/es/core/TextArea/index.mdx +6 -30
  84. package/es/core/TextInput/index.mdx +6 -30
  85. package/es/core/index.js +1 -0
  86. package/es/typography/HeadingCaption/index.mdx +1 -5
  87. package/es/typography/Hint/index.mdx +1 -5
  88. package/es/typography/NormalText/index.mdx +3 -15
  89. package/es/typography/Paragraph/index.mdx +3 -15
  90. package/esm/admin/AccessibilityMenu/index.js +49 -0
  91. package/esm/admin/AutoComplete/index.mdx +8 -30
  92. package/esm/admin/CopyToClipboard/index.mdx +1 -5
  93. package/esm/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
  94. package/esm/admin/Dropdown/__stories__/AlignRight.js +1 -2
  95. package/esm/admin/Dropdown/__stories__/Default.js +1 -3
  96. package/esm/admin/Dropdown/__stories__/PlacementTop.js +1 -2
  97. package/esm/admin/Dropdown/index.mdx +3 -15
  98. package/esm/admin/Modal/Modal.stories.playwright.json +37 -0
  99. package/esm/admin/Modal/__stories__/AlertDialog.js +29 -12
  100. package/esm/admin/Modal/__stories__/Default.js +27 -10
  101. package/esm/admin/Modal/index.mdx +1 -5
  102. package/esm/app/Footer/Footer.mdx +3 -14
  103. package/esm/app/Header/index.mdx +3 -16
  104. package/esm/app/QrCodeViewer/index.mdx +1 -5
  105. package/esm/core/Accordion/index.js +40 -6
  106. package/esm/core/Accordion/index.mdx +2 -10
  107. package/esm/core/Button/__stories__/GroupingButtons.js +2 -1
  108. package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
  109. package/esm/core/Button/__stories__/Warning.js +2 -1
  110. package/esm/core/Button/index.mdx +4 -20
  111. package/esm/core/Card/card.mdx +7 -35
  112. package/esm/core/Checkbox/checkbox.mdx +6 -30
  113. package/esm/core/DateInputContainer/index.mdx +4 -20
  114. package/esm/core/ErrorSummary/index.mdx +3 -15
  115. package/esm/core/FileUpload/index.mdx +1 -5
  116. package/esm/core/Link/link.mdx +4 -20
  117. package/esm/core/List/index.mdx +1 -5
  118. package/esm/core/NavList/index.mdx +1 -5
  119. package/esm/core/NotificationBanner/index.mdx +1 -5
  120. package/esm/core/PhaseBanner/index.mdx +1 -4
  121. package/esm/core/RadioContainer/index.mdx +6 -30
  122. package/esm/core/SelectContainer/index.mdx +3 -15
  123. package/esm/core/SingleCharacterInputContainer/index.mdx +7 -10
  124. package/esm/core/SummaryList/index.mdx +2 -10
  125. package/esm/core/Table/index.mdx +6 -30
  126. package/esm/core/TextArea/index.mdx +6 -30
  127. package/esm/core/TextInput/index.mdx +6 -30
  128. package/esm/core/index.js +1 -0
  129. package/esm/index.js +1 -1
  130. package/esm/typography/HeadingCaption/index.mdx +1 -5
  131. package/esm/typography/Hint/index.mdx +1 -5
  132. package/esm/typography/NormalText/index.mdx +3 -15
  133. package/esm/typography/Paragraph/index.mdx +3 -15
  134. package/package.json +3 -3
  135. package/src/admin/AccessibilityMenu/index.tsx +52 -0
  136. package/src/admin/AutoComplete/index.mdx +8 -30
  137. package/src/admin/CopyToClipboard/index.mdx +1 -5
  138. package/src/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
  139. package/src/admin/Dropdown/__stories__/AlignRight.tsx +1 -1
  140. package/src/admin/Dropdown/__stories__/Default.tsx +1 -1
  141. package/src/admin/Dropdown/__stories__/PlacementTop.tsx +1 -1
  142. package/src/admin/Dropdown/index.mdx +3 -15
  143. package/src/admin/Modal/Modal.stories.playwright.json +37 -0
  144. package/src/admin/Modal/__stories__/AlertDialog.tsx +18 -3
  145. package/src/admin/Modal/__stories__/Default.tsx +18 -3
  146. package/src/admin/Modal/index.mdx +1 -5
  147. package/src/app/Footer/Footer.mdx +3 -14
  148. package/src/app/Header/index.mdx +3 -16
  149. package/src/app/QrCodeViewer/index.mdx +1 -5
  150. package/src/core/Accordion/index.mdx +2 -10
  151. package/src/core/Accordion/index.tsx +38 -4
  152. package/src/core/Button/__stories__/GroupingButtons.tsx +1 -0
  153. package/src/core/Button/__stories__/GroupingButtonsAndLinks.tsx +1 -0
  154. package/src/core/Button/__stories__/Warning.tsx +1 -0
  155. package/src/core/Button/index.mdx +4 -20
  156. package/src/core/Card/card.mdx +7 -35
  157. package/src/core/Checkbox/checkbox.mdx +6 -30
  158. package/src/core/DateInputContainer/index.mdx +4 -20
  159. package/src/core/ErrorSummary/index.mdx +3 -15
  160. package/src/core/FileUpload/index.mdx +1 -5
  161. package/src/core/Link/link.mdx +4 -20
  162. package/src/core/List/index.mdx +1 -5
  163. package/src/core/NavList/index.mdx +1 -5
  164. package/src/core/NotificationBanner/index.mdx +1 -5
  165. package/src/core/PhaseBanner/index.mdx +1 -4
  166. package/src/core/RadioContainer/index.mdx +6 -30
  167. package/src/core/SelectContainer/index.mdx +3 -15
  168. package/src/core/SingleCharacterInputContainer/index.mdx +7 -10
  169. package/src/core/SummaryList/index.mdx +2 -10
  170. package/src/core/Table/index.mdx +6 -30
  171. package/src/core/TextArea/index.mdx +6 -30
  172. package/src/core/TextInput/index.mdx +6 -30
  173. package/src/core/index.ts +1 -0
  174. package/src/typography/HeadingCaption/index.mdx +1 -5
  175. package/src/typography/Hint/index.mdx +1 -5
  176. package/src/typography/NormalText/index.mdx +3 -15
  177. package/src/typography/Paragraph/index.mdx +3 -15
  178. package/typography/HeadingCaption/index.mdx +1 -5
  179. package/typography/Hint/index.mdx +1 -5
  180. package/typography/NormalText/index.mdx +3 -15
  181. package/typography/Paragraph/index.mdx +3 -15
@@ -0,0 +1,37 @@
1
+ {
2
+ "version": "4",
3
+ "stories": {
4
+ "digigov-ui-admin-modal--alert-dialog": {
5
+ "actionSets": [
6
+ {
7
+ "actions": [
8
+ {
9
+ "name": "click",
10
+ "args": {
11
+ "selector": "html>body>div:nth-child(5)>div>button"
12
+ }
13
+ }
14
+ ],
15
+ "id": "Dk4oIFwRzm6e",
16
+ "title": "Alert dialog action"
17
+ }
18
+ ]
19
+ },
20
+ "digigov-ui-admin-modal--default": {
21
+ "actionSets": [
22
+ {
23
+ "actions": [
24
+ {
25
+ "name": "click",
26
+ "args": {
27
+ "selector": "html>body>div:nth-child(5)>div>button"
28
+ }
29
+ }
30
+ ],
31
+ "id": "YyIZkcmdBlRP",
32
+ "title": "Open modal action"
33
+ }
34
+ ]
35
+ }
36
+ }
37
+ }
@@ -1,22 +1,39 @@
1
- import React from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useState } from 'react';
2
3
  import { Modal, ModalHeading, ModalContent, ModalAction } from '@digigov/ui/admin/Modal';
3
4
  import { Button } from '@digigov/ui/core/Button';
4
5
  import { Paragraph } from '@digigov/ui/typography/Paragraph';
5
6
 
6
- var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Modal, {
7
- open: true,
8
- role: "alertdialog",
9
- "aria-labelledby": "modal-label",
10
- "aria-describedby": "modal-content"
11
- }, /*#__PURE__*/React.createElement(ModalHeading, {
7
+ var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
12
8
  id: "modal-label"
13
- }, "\u0395\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03AF\u03C9\u03C3\u03B7"), /*#__PURE__*/React.createElement(ModalContent, {
9
+ }, "\u0395\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03AF\u03C9\u03C3\u03B7");
10
+
11
+ var _ref2 = /*#__PURE__*/React.createElement(ModalContent, {
14
12
  id: "modal-content"
15
- }, /*#__PURE__*/React.createElement(Paragraph, null, "\u0395\u03AF\u03C3\u03C4\u03B5 \u03C3\u03AF\u03B3\u03BF\u03C5\u03C1\u03BF\u03B9 \u03CC\u03C4\u03B9 \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03B4\u03B9\u03B1\u03B3\u03C1\u03AC\u03C8\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AE;")), /*#__PURE__*/React.createElement(ModalAction, null, /*#__PURE__*/React.createElement(Button, null, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"), /*#__PURE__*/React.createElement(Button, {
16
- variant: "link"
17
- }, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
13
+ }, /*#__PURE__*/React.createElement(Paragraph, null, "\u0395\u03AF\u03C3\u03C4\u03B5 \u03C3\u03AF\u03B3\u03BF\u03C5\u03C1\u03BF\u03B9 \u03CC\u03C4\u03B9 \u03B8\u03AD\u03BB\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03B4\u03B9\u03B1\u03B3\u03C1\u03AC\u03C8\u03B5\u03C4\u03B5 \u03C4\u03B7\u03BD \u03B5\u03B3\u03B3\u03C1\u03B1\u03C6\u03AE;"));
14
+
15
+ var _ref3 = /*#__PURE__*/React.createElement(Button, null, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE");
18
16
 
19
17
  export var AlertDialog = function AlertDialog() {
20
- return _ref;
18
+ var _useState = useState(false),
19
+ _useState2 = _slicedToArray(_useState, 2),
20
+ open = _useState2[0],
21
+ setOpen = _useState2[1];
22
+
23
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
24
+ onClick: function onClick() {
25
+ setOpen(!open);
26
+ }
27
+ }, "\u0386\u03BD\u03BF\u03B9\u03BE\u03B5 Modal"), /*#__PURE__*/React.createElement(Modal, {
28
+ open: open,
29
+ role: "alertdialog",
30
+ "aria-labelledby": "modal-label",
31
+ "aria-describedby": "modal-content"
32
+ }, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, _ref3, /*#__PURE__*/React.createElement(Button, {
33
+ variant: "link",
34
+ onClick: function onClick() {
35
+ setOpen(!open);
36
+ }
37
+ }, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
21
38
  };
22
39
  export default AlertDialog;
@@ -1,23 +1,40 @@
1
- import React from 'react';
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
+ import React, { useState } from 'react';
2
3
  import { Modal, ModalHeading, ModalContent, ModalAction } from '@digigov/ui/admin/Modal';
3
4
  import { Button } from '@digigov/ui/core/Button';
4
5
  import { TextInput } from '@digigov/ui/core/TextInput';
5
6
  import { FieldContainer } from '@digigov/ui/core/FieldContainer';
6
7
  import { LabelContainer } from '@digigov/ui/core/LabelContainer';
7
8
 
8
- var _ref = /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Modal, {
9
- open: true,
10
- "aria-labelledby": "modal-label"
11
- }, /*#__PURE__*/React.createElement(ModalHeading, {
9
+ var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
12
10
  id: "modal-label"
13
- }, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5"), /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(LabelContainer, null, "\u03A3\u03C5\u03BC\u03C0\u03BB\u03B7\u03C1\u03CE\u03C3\u03C4\u03B5 \u03C4\u03BF \u03C4\u03B7\u03BB\u03AD\u03C6\u03C9\u03BD\u03BF \u03B5\u03C0\u03B9\u03BA\u03BF\u03B9\u03BD\u03C9\u03BD\u03AF\u03B1\u03C2", /*#__PURE__*/React.createElement(TextInput, {
11
+ }, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5");
12
+
13
+ var _ref2 = /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(LabelContainer, null, "\u03A3\u03C5\u03BC\u03C0\u03BB\u03B7\u03C1\u03CE\u03C3\u03C4\u03B5 \u03C4\u03BF \u03C4\u03B7\u03BB\u03AD\u03C6\u03C9\u03BD\u03BF \u03B5\u03C0\u03B9\u03BA\u03BF\u03B9\u03BD\u03C9\u03BD\u03AF\u03B1\u03C2", /*#__PURE__*/React.createElement(TextInput, {
14
14
  name: "inputext",
15
15
  characterWidth: 10
16
- })))), /*#__PURE__*/React.createElement(ModalAction, null, /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE"), /*#__PURE__*/React.createElement(Button, {
17
- variant: "link"
18
- }, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
16
+ }))));
17
+
18
+ var _ref3 = /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE");
19
19
 
20
20
  export var Default = function Default() {
21
- return _ref;
21
+ var _useState = useState(false),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ open = _useState2[0],
24
+ setOpen = _useState2[1];
25
+
26
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
27
+ onClick: function onClick() {
28
+ setOpen(!open);
29
+ }
30
+ }, "\u0386\u03BD\u03BF\u03B9\u03BE\u03B5 Modal"), /*#__PURE__*/React.createElement(Modal, {
31
+ open: open,
32
+ "aria-labelledby": "modal-label"
33
+ }, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, _ref3, /*#__PURE__*/React.createElement(Button, {
34
+ variant: "link",
35
+ onClick: function onClick() {
36
+ setOpen(!open);
37
+ }
38
+ }, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
22
39
  };
23
40
  export default Default;
@@ -15,11 +15,7 @@ import Modal, {ModalHeading, ModalContent, ModalAction} from "@digigov/ui/admin/
15
15
 
16
16
  ### As an Alert Dialog
17
17
 
18
- <Story
19
- packageName="@digigov/ui"
20
- component="admin/Modal"
21
- story="AlertDialog.tsx"
22
- />
18
+ <Story packageName="@digigov/ui" component="admin/Modal" story="AlertDialog.tsx" />
23
19
 
24
20
  ## Accessibility
25
21
 
@@ -15,26 +15,15 @@ import Footer from '@digigov/ui/app/Footer';
15
15
 
16
16
  ### Footer with logos
17
17
 
18
- <Story
19
- packageName="@digigov/ui"
20
- component="app/Footer"
21
- story="FooterWithLogo.tsx"
22
- />
18
+ <Story packageName="@digigov/ui" component="app/Footer" story="FooterWithLogo.tsx" />
23
19
 
24
20
  ### Footer with secondary navigation
25
21
 
26
- <Story
27
- packageName="@digigov/ui"
28
- component="app/Footer"
29
- story="FooterWithSecondaryNavigation.tsx"
30
- />
22
+ <Story packageName="@digigov/ui" component="app/Footer" story="FooterWithSecondaryNavigation.tsx" />
31
23
 
32
24
  ### Footer with links to meta information
33
25
 
34
- <Story
35
- packageName="@digigov/ui"
36
- component="app/Footer"
37
- story="FooterWithLink.tsx"
26
+ <Story packageName="@digigov/ui" component="app/Footer" story="FooterWithLink.tsx"
38
27
  />
39
28
 
40
29
  ### All inclusive footer
@@ -11,28 +11,15 @@ import Header from '@digigov/ui/app/Header';
11
11
 
12
12
  ### Default header
13
13
 
14
- <Story
15
- title="### Default"
16
- packageName="@digigov/ui"
17
- component="app/Header"
18
- story="Default.tsx"
19
- />
14
+ <Story title="### Default" packageName="@digigov/ui" component="app/Header" story="Default.tsx" />
20
15
 
21
16
  ### Header with service name
22
17
 
23
- <Story
24
- packageName="@digigov/ui"
25
- component="app/Header"
26
- story="WithServiceName.tsx"
27
- />
18
+ <Story packageName="@digigov/ui" component="app/Header" story="WithServiceName.tsx" />
28
19
 
29
20
  ### Header with service logo and service name
30
21
 
31
- <Story
32
- packageName="@digigov/ui"
33
- component="app/Header"
34
- story="WithServiceNameAndLogo.tsx"
35
- />
22
+ <Story packageName="@digigov/ui" component="app/Header" story="WithServiceNameAndLogo.tsx" />
36
23
 
37
24
  ### Default header with navigation
38
25
 
@@ -11,11 +11,7 @@ import QrCodeViewer from '@digigov/ui/app/QrCodeViewer';
11
11
 
12
12
  ### Default QrCodeViewer
13
13
 
14
- <Story
15
- packageName="@digigov/ui"
16
- component="app/QrCodeViewer"
17
- story="Default.tsx"
18
- />
14
+ <Story packageName="@digigov/ui" component="app/QrCodeViewer" story="Default.tsx" />
19
15
 
20
16
  ### Custom QrCodeViewer
21
17
 
@@ -1,14 +1,16 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
4
  var _excluded = ["children"],
4
- _excluded2 = ["register", "setOpened", "opened", "registered"];
5
+ _excluded2 = ["children"],
6
+ _excluded3 = ["register", "setOpened", "opened", "registered"];
5
7
 
6
8
  /* eslint-disable react-hooks/exhaustive-deps */
7
- import React from 'react';
9
+ import React, { useState } from 'react';
8
10
  import Accordion from '@digigov/react-core/Accordion';
9
11
  import AccordionSection from '@digigov/react-core/AccordionSection';
10
12
  import AccordionSectionContent from '@digigov/react-core/AccordionSectionContent';
11
- import AccordionSectionSummaryHeading from '@digigov/react-core/AccordionSectionSummaryHeading';
13
+ import AccordionSectionSummaryHeadingBase from '@digigov/react-core/AccordionSectionSummaryHeading';
12
14
  import AccordionSectionSummary from '@digigov/react-core/AccordionSectionSummary';
13
15
  import AccordionControls from '@digigov/react-core/AccordionControls';
14
16
  import withDeprecation from '@digigov/ui/utils/withDeprecation';
@@ -17,11 +19,43 @@ export var AccordionItemDetails = withDeprecation(AccordionSectionContent, {
17
19
  name: 'AccordionItemDetails',
18
20
  rename: 'AccordionSectionContent'
19
21
  });
20
- export var AccordionItemSummary = withDeprecation(function (_ref) {
22
+ var AccordionSectionSummaryHeading = /*#__PURE__*/React.forwardRef(function AccordionSectionSummaryHeading(_ref, ref) {
21
23
  var children = _ref.children,
22
24
  props = _objectWithoutProperties(_ref, _excluded);
23
25
 
24
- return /*#__PURE__*/React.createElement(AccordionSectionSummary, props, /*#__PURE__*/React.createElement(AccordionSectionSummaryHeading, null, children));
26
+ var toggleExpanded = function toggleExpanded() {
27
+ setExpanded(!isExpanded);
28
+ };
29
+
30
+ var _useState = useState(false),
31
+ _useState2 = _slicedToArray(_useState, 2),
32
+ isExpanded = _useState2[0],
33
+ setExpanded = _useState2[1];
34
+
35
+ return /*#__PURE__*/React.createElement(AccordionSectionSummaryHeadingBase, _extends({
36
+ ref: ref
37
+ }, props, {
38
+ onClick: toggleExpanded,
39
+ "aria-expanded": isExpanded
40
+ }), children);
41
+ });
42
+ export var AccordionItemSummary = withDeprecation(function (_ref2) {
43
+ var children = _ref2.children,
44
+ props = _objectWithoutProperties(_ref2, _excluded2);
45
+
46
+ var toggleExpanded = function toggleExpanded() {
47
+ setExpanded(!isExpanded);
48
+ };
49
+
50
+ var _useState3 = useState(false),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ isExpanded = _useState4[0],
53
+ setExpanded = _useState4[1];
54
+
55
+ return /*#__PURE__*/React.createElement(AccordionSectionSummary, props, /*#__PURE__*/React.createElement(AccordionSectionSummaryHeadingBase, {
56
+ onClick: toggleExpanded,
57
+ "aria-expanded": isExpanded
58
+ }, children));
25
59
  }, {
26
60
  name: 'AccordionItemSummary',
27
61
  warning: 'There is no need to use AccordionSectionHeader components anymore. It will be removed in a later version and impelented using AccordionSectionSummary and AccordionSectionSummaryHeading'
@@ -43,7 +77,7 @@ var useAccordion = function useAccordion(props) {
43
77
  setOpened = _useTogglableTab.setOpened,
44
78
  opened = _useTogglableTab.opened,
45
79
  registered = _useTogglableTab.registered,
46
- rest = _objectWithoutProperties(_useTogglableTab, _excluded2);
80
+ rest = _objectWithoutProperties(_useTogglableTab, _excluded3);
47
81
 
48
82
  return _extends({
49
83
  register: register,
@@ -15,21 +15,13 @@ import Accordion from '@digigov/ui/core/Accordion';
15
15
 
16
16
  ## How to use
17
17
 
18
- <Story
19
- packageName="@digigov/ui"
20
- component="core/Accordion"
21
- story="Default.tsx"
22
- />
18
+ <Story packageName="@digigov/ui" component="core/Accordion" story="Default.tsx" />
23
19
 
24
20
  ### Accordion with Hints
25
21
 
26
22
  Accordions hide content, so the labels need to be clear. If necessary, you can add a summary line to help users understand what is in the section.
27
23
 
28
- <Story
29
- packageName="@digigov/ui"
30
- component="core/Accordion"
31
- story="WithHints.tsx"
32
- />
24
+ <Story packageName="@digigov/ui" component="core/Accordion" story="WithHints.tsx" />
33
25
 
34
26
  ## Accessibility
35
27
 
@@ -10,4 +10,5 @@ var _ref = /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/Reac
10
10
 
11
11
  export var GroupingButtons = function GroupingButtons() {
12
12
  return _ref;
13
- };
13
+ };
14
+ export default GroupingButtons;
@@ -11,4 +11,5 @@ var _ref = /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/Reac
11
11
 
12
12
  export var GroupingButtonsAndLinks = function GroupingButtonsAndLinks() {
13
13
  return _ref;
14
- };
14
+ };
15
+ export default GroupingButtonsAndLinks;
@@ -8,4 +8,5 @@ var _ref = /*#__PURE__*/React.createElement(Button, {
8
8
 
9
9
  export var Warning = function Warning() {
10
10
  return _ref;
11
- };
11
+ };
12
+ export default Warning;
@@ -24,21 +24,13 @@ Use a default button for the main call to action on a page.
24
24
 
25
25
  Use a start button for the main call to action on your service’s start page. Start buttons do not submit form data, so they use a link tag rather than a button tag.
26
26
 
27
- <Story
28
- packageName="@digigov/ui"
29
- component="core/Button"
30
- story="CallToActionButton.tsx"
31
- />
27
+ <Story packageName="@digigov/ui" component="core/Button" story="CallToActionButton.tsx" />
32
28
 
33
29
  ### Secondary buttons
34
30
 
35
31
  Use secondary buttons for secondary calls to action on a page.
36
32
 
37
- <Story
38
- packageName="@digigov/ui"
39
- component="core/Button"
40
- story="Secondary.tsx"
41
- />
33
+ <Story packageName="@digigov/ui" component="core/Button" story="Secondary.tsx" />
42
34
 
43
35
  ### Warning buttons
44
36
 
@@ -56,19 +48,11 @@ Disabled buttons have poor contrast and can confuse some users, so avoid them if
56
48
 
57
49
  Use a button group when two or more buttons are placed together.
58
50
 
59
- <Story
60
- packageName="@digigov/ui"
61
- component="core/Button"
62
- story="GroupingButtons.tsx"
63
- />
51
+ <Story packageName="@digigov/ui"component="core/Button" story="GroupingButtons.tsx" />
64
52
 
65
53
  Any links within a button group will automatically align with the buttons.
66
54
 
67
- <Story
68
- packageName="@digigov/ui"
69
- component="core/Button"
70
- story="GroupingButtonsAndLinks.tsx"
71
- />
55
+ <Story packageName="@digigov/ui" component="core/Button" story="GroupingButtonsAndLinks.tsx" />
72
56
 
73
57
  Write button text in sentence case, describing the action it performs. For
74
58
  example:'
@@ -22,19 +22,11 @@ You can set the color of the Card's border. You can choose between `dark` and `g
22
22
 
23
23
  #### Card with gray border color
24
24
 
25
- <Story
26
- packageName="@digigov/ui"
27
- component="core/Card"
28
- story="WithGrayBorder.tsx"
29
- />
25
+ <Story packageName="@digigov/ui" component="core/Card" story="WithGrayBorder.tsx" />
30
26
 
31
27
  #### Card with dark border color
32
28
 
33
- <Story
34
- packageName="@digigov/ui"
35
- component="core/Card"
36
- story="WithDarkBorder.tsx"
37
- />
29
+ <Story packageName="@digigov/ui" component="core/Card" story="WithDarkBorder.tsx" />
38
30
 
39
31
  ### Card with top border
40
32
 
@@ -42,27 +34,15 @@ You can set the color of the Card's top border. You can choose between dark and
42
34
 
43
35
  #### Card with grey top border
44
36
 
45
- <Story
46
- packageName="@digigov/ui"
47
- component="core/Card"
48
- story="WithGrayTopBorder.tsx"
49
- />
37
+ <Story packageName="@digigov/ui" component="core/Card" story="WithGrayTopBorder.tsx" />
50
38
 
51
39
  #### Card with dark top border
52
40
 
53
- <Story
54
- packageName="@digigov/ui"
55
- component="core/Card"
56
- story="WithDarkTopBorder.tsx"
57
- />
41
+ <Story packageName="@digigov/ui" component="core/Card" story="WithDarkTopBorder.tsx" />
58
42
 
59
43
  ### Card with divider
60
44
 
61
- <Story
62
- packageName="@digigov/ui"
63
- component="core/Card"
64
- story="WithDivider.tsx"
65
- />
45
+ <Story packageName="@digigov/ui" component="core/Card" story="WithDivider.tsx" />
66
46
 
67
47
  ### Card with actions
68
48
 
@@ -70,21 +50,13 @@ You can set the color of the Card's top border. You can choose between dark and
70
50
 
71
51
  Cards can be used without an action button, but with a clickable title.
72
52
 
73
- <Story
74
- packageName="@digigov/ui"
75
- component="core/Card"
76
- story="WithClickableLink.tsx"
77
- />
53
+ <Story packageName="@digigov/ui" component="core/Card" story="WithClickableLink.tsx" />
78
54
 
79
55
  #### Card with clickable content
80
56
 
81
57
  You can expand the clickable area of the link to fill Card's content.
82
58
 
83
- <Story
84
- packageName="@digigov/ui"
85
- component="core/Card"
86
- story="WithClickableContent.tsx"
87
- />
59
+ <Story packageName="@digigov/ui" component="core/Card" story="WithClickableContent.tsx" />
88
60
 
89
61
  Cards also provides styles for actionable elements such as Buttons or Links.
90
62
 
@@ -11,57 +11,33 @@ import Checkbox from '@digigov/ui/core/Checkbox';
11
11
 
12
12
  ## How to use
13
13
 
14
- <Story
15
- packageName="@digigov/ui"
16
- component="core/Checkbox"
17
- story="Default.tsx"
18
- />
14
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="Default.tsx" />
19
15
 
20
16
  ### If you’re asking more than one question on the page
21
17
 
22
- <Story
23
- packageName="@digigov/ui"
24
- component="core/Checkbox"
25
- story="MultipleQuestions.tsx"
26
- />
18
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="MultipleQuestions.tsx" />
27
19
 
28
20
  ### Checkbox items with hints
29
21
 
30
22
  You can add hints to checkbox items to provide additional information about the options.
31
23
 
32
- <Story
33
- packageName="@digigov/ui"
34
- component="core/Checkbox"
35
- story="WithHint.tsx"
36
- />
24
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="WithHint.tsx" />
37
25
 
38
26
  ### Add an option for ‘none’
39
27
 
40
28
  When ‘none’ would be a valid answer, give users the option to check a box to say none of the other options apply to them — without this option, users would have to leave all of the boxes unchecked. Giving users this option also makes sure they do not skip the question by accident.
41
29
 
42
- <Story
43
- packageName="@digigov/ui"
44
- component="core/Checkbox"
45
- story="NoneAnswer.tsx"
46
- />
30
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="NoneAnswer.tsx" />
47
31
 
48
32
  If JavaScript is unavailable, and a user selects both the ‘none’ checkbox and another checkbox, display an error message.
49
33
 
50
- <Story
51
- packageName="@digigov/ui"
52
- component="core/Checkbox"
53
- story="NoneAnswerWithError.tsx"
54
- />
34
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="NoneAnswerWithError.tsx" />
55
35
 
56
36
  ### Error messages
57
37
 
58
38
  Error messages should be styled like this:
59
39
 
60
- <Story
61
- packageName="@digigov/ui"
62
- component="core/Checkbox"
63
- story="WithErrorMessage.tsx"
64
- />
40
+ <Story packageName="@digigov/ui" component="core/Checkbox" story="WithErrorMessage.tsx" />
65
41
 
66
42
  ## Conditionally revealing a related question
67
43
 
@@ -11,34 +11,18 @@ import DateInputContainer from '@digigov/ui/core/DateInputContainer';
11
11
 
12
12
  ## How to use
13
13
 
14
- <Story
15
- packageName="@digigov/ui"
16
- component="core/DateInputContainer"
17
- story="Default.tsx"
18
- />
14
+ <Story packageName="@digigov/ui" component="core/DateInputContainer" story="Default.tsx" />
19
15
 
20
16
  ### If you’re asking more than one question on the page
21
17
 
22
- <Story
23
- packageName="@digigov/ui"
24
- component="core/DateInputContainer"
25
- story="MultipleQuestions.tsx"
26
- />
18
+ <Story packageName="@digigov/ui" component="core/DateInputContainer" story="MultipleQuestions.tsx" />
27
19
 
28
20
  ### Error message
29
21
 
30
22
  If you’re highlighting the whole date, style all the fields like this:
31
23
 
32
- <Story
33
- packageName="@digigov/ui"
34
- component="core/DateInputContainer"
35
- story="WithErrorMessage.tsx"
36
- />
24
+ <Story packageName="@digigov/ui" component="core/DateInputContainer" story="WithErrorMessage.tsx" />
37
25
 
38
26
  If you’re highlighting just one field - either the day, month or year - only style the field that has an error. The error message must say which field has an error, like this:
39
27
 
40
- <Story
41
- packageName="@digigov/ui"
42
- component="core/DateInputContainer"
43
- story="WithErrorMessageForSingleField.tsx"
44
- />
28
+ <Story packageName="@digigov/ui" component="core/DateInputContainer" story="WithErrorMessageForSingleField.tsx" />
@@ -15,11 +15,7 @@ import ErrorSummary from '@digigov/ui/core/ErrorSummary';
15
15
 
16
16
  ## How to use
17
17
 
18
- <Story
19
- packageName="@digigov/ui"
20
- component="core/ErrorSummary"
21
- story="Default.tsx"
22
- />
18
+ <Story packageName="@digigov/ui" component="core/ErrorSummary" story="Default.tsx" />
23
19
 
24
20
  ### Linking from the error summary to each answer
25
21
 
@@ -27,21 +23,13 @@ You must link the errors in the error summary to the answer they relate to.
27
23
 
28
24
  For questions that require a user to answer using a single field, like a file upload, select, textarea, text input or character count, link to the field.
29
25
 
30
- <Story
31
- packageName="@digigov/ui"
32
- component="core/ErrorSummary"
33
- story="LinkedToInput.tsx"
34
- />
26
+ <Story packageName="@digigov/ui" component="core/ErrorSummary" story="LinkedToInput.tsx" />
35
27
 
36
28
  When a user has to enter their answer into multiple fields, such as the day, month and year fields in the date input component, link to the first field that contains an error.
37
29
 
38
30
  If you do not know which field contains an error, link to the first field.
39
31
 
40
- <Story
41
- packageName="@digigov/ui"
42
- component="core/ErrorSummary"
43
- story="LinkedToField.tsx"
44
- />
32
+ <Story packageName="@digigov/ui" component="core/ErrorSummary" story="LinkedToField.tsx" />
45
33
 
46
34
  For questions that require a user to select one or more options from a list using radios or checkboxes, link to the first radio or checkbox.
47
35
 
@@ -11,11 +11,7 @@ import FileUpload from '@digigov/ui/core/FileUpload';
11
11
 
12
12
  ## How to use
13
13
 
14
- <Story
15
- packageName="@digigov/ui"
16
- component="core/FileUpload"
17
- story="Default.tsx"
18
- />
14
+ <Story packageName="@digigov/ui" component="core/FileUpload" story="Default.tsx" />
19
15
 
20
16
  ### Error message
21
17