@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.
- package/CHANGELOG.md +16 -1
- package/admin/AccessibilityMenu/index.d.ts +6 -0
- package/admin/AccessibilityMenu/index.js +85 -30
- package/admin/AutoComplete/index.mdx +8 -30
- package/admin/CopyToClipboard/index.mdx +1 -5
- package/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/admin/Dropdown/__stories__/Default.js +1 -3
- package/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/admin/Dropdown/index.mdx +3 -15
- package/admin/Modal/Modal.stories.playwright.json +37 -0
- package/admin/Modal/__stories__/AlertDialog.js +36 -12
- package/admin/Modal/__stories__/Default.js +34 -10
- package/admin/Modal/index.mdx +1 -5
- package/app/Footer/Footer.mdx +3 -14
- package/app/Header/index.mdx +3 -16
- package/app/QrCodeViewer/index.mdx +1 -5
- package/core/Accordion/index.d.ts +5 -1
- package/core/Accordion/index.js +46 -13
- package/core/Accordion/index.mdx +2 -10
- package/core/Button/__stories__/GroupingButtons.d.ts +1 -0
- package/core/Button/__stories__/GroupingButtons.js +4 -2
- package/core/Button/__stories__/GroupingButtonsAndLinks.d.ts +1 -0
- package/core/Button/__stories__/GroupingButtonsAndLinks.js +4 -2
- package/core/Button/__stories__/Warning.d.ts +1 -0
- package/core/Button/__stories__/Warning.js +4 -2
- package/core/Button/index.mdx +4 -20
- package/core/Card/card.mdx +7 -35
- package/core/Checkbox/checkbox.mdx +6 -30
- package/core/DateInputContainer/index.mdx +4 -20
- package/core/ErrorSummary/index.mdx +3 -15
- package/core/FileUpload/index.mdx +1 -5
- package/core/Link/link.mdx +4 -20
- package/core/List/index.mdx +1 -5
- package/core/NavList/index.mdx +1 -5
- package/core/NotificationBanner/index.mdx +1 -5
- package/core/PhaseBanner/index.mdx +1 -4
- package/core/RadioContainer/index.mdx +6 -30
- package/core/SelectContainer/index.mdx +3 -15
- package/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/core/SummaryList/index.mdx +2 -10
- package/core/Table/index.mdx +6 -30
- package/core/TextArea/index.mdx +6 -30
- package/core/TextInput/index.mdx +6 -30
- package/core/index.d.ts +1 -0
- package/core/index.js +13 -0
- package/es/admin/AccessibilityMenu/index.js +49 -0
- package/es/admin/AutoComplete/index.mdx +8 -30
- package/es/admin/CopyToClipboard/index.mdx +1 -5
- package/es/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/es/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/es/admin/Dropdown/__stories__/Default.js +1 -3
- package/es/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/es/admin/Dropdown/index.mdx +3 -15
- package/es/admin/Modal/Modal.stories.playwright.json +37 -0
- package/es/admin/Modal/__stories__/AlertDialog.js +29 -12
- package/es/admin/Modal/__stories__/Default.js +27 -10
- package/es/admin/Modal/index.mdx +1 -5
- package/es/app/Footer/Footer.mdx +3 -14
- package/es/app/Header/index.mdx +3 -16
- package/es/app/QrCodeViewer/index.mdx +1 -5
- package/es/core/Accordion/index.js +40 -6
- package/es/core/Accordion/index.mdx +2 -10
- package/es/core/Button/__stories__/GroupingButtons.js +2 -1
- package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
- package/es/core/Button/__stories__/Warning.js +2 -1
- package/es/core/Button/index.mdx +4 -20
- package/es/core/Card/card.mdx +7 -35
- package/es/core/Checkbox/checkbox.mdx +6 -30
- package/es/core/DateInputContainer/index.mdx +4 -20
- package/es/core/ErrorSummary/index.mdx +3 -15
- package/es/core/FileUpload/index.mdx +1 -5
- package/es/core/Link/link.mdx +4 -20
- package/es/core/List/index.mdx +1 -5
- package/es/core/NavList/index.mdx +1 -5
- package/es/core/NotificationBanner/index.mdx +1 -5
- package/es/core/PhaseBanner/index.mdx +1 -4
- package/es/core/RadioContainer/index.mdx +6 -30
- package/es/core/SelectContainer/index.mdx +3 -15
- package/es/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/es/core/SummaryList/index.mdx +2 -10
- package/es/core/Table/index.mdx +6 -30
- package/es/core/TextArea/index.mdx +6 -30
- package/es/core/TextInput/index.mdx +6 -30
- package/es/core/index.js +1 -0
- package/es/typography/HeadingCaption/index.mdx +1 -5
- package/es/typography/Hint/index.mdx +1 -5
- package/es/typography/NormalText/index.mdx +3 -15
- package/es/typography/Paragraph/index.mdx +3 -15
- package/esm/admin/AccessibilityMenu/index.js +49 -0
- package/esm/admin/AutoComplete/index.mdx +8 -30
- package/esm/admin/CopyToClipboard/index.mdx +1 -5
- package/esm/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/esm/admin/Dropdown/__stories__/AlignRight.js +1 -2
- package/esm/admin/Dropdown/__stories__/Default.js +1 -3
- package/esm/admin/Dropdown/__stories__/PlacementTop.js +1 -2
- package/esm/admin/Dropdown/index.mdx +3 -15
- package/esm/admin/Modal/Modal.stories.playwright.json +37 -0
- package/esm/admin/Modal/__stories__/AlertDialog.js +29 -12
- package/esm/admin/Modal/__stories__/Default.js +27 -10
- package/esm/admin/Modal/index.mdx +1 -5
- package/esm/app/Footer/Footer.mdx +3 -14
- package/esm/app/Header/index.mdx +3 -16
- package/esm/app/QrCodeViewer/index.mdx +1 -5
- package/esm/core/Accordion/index.js +40 -6
- package/esm/core/Accordion/index.mdx +2 -10
- package/esm/core/Button/__stories__/GroupingButtons.js +2 -1
- package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +2 -1
- package/esm/core/Button/__stories__/Warning.js +2 -1
- package/esm/core/Button/index.mdx +4 -20
- package/esm/core/Card/card.mdx +7 -35
- package/esm/core/Checkbox/checkbox.mdx +6 -30
- package/esm/core/DateInputContainer/index.mdx +4 -20
- package/esm/core/ErrorSummary/index.mdx +3 -15
- package/esm/core/FileUpload/index.mdx +1 -5
- package/esm/core/Link/link.mdx +4 -20
- package/esm/core/List/index.mdx +1 -5
- package/esm/core/NavList/index.mdx +1 -5
- package/esm/core/NotificationBanner/index.mdx +1 -5
- package/esm/core/PhaseBanner/index.mdx +1 -4
- package/esm/core/RadioContainer/index.mdx +6 -30
- package/esm/core/SelectContainer/index.mdx +3 -15
- package/esm/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/esm/core/SummaryList/index.mdx +2 -10
- package/esm/core/Table/index.mdx +6 -30
- package/esm/core/TextArea/index.mdx +6 -30
- package/esm/core/TextInput/index.mdx +6 -30
- package/esm/core/index.js +1 -0
- package/esm/index.js +1 -1
- package/esm/typography/HeadingCaption/index.mdx +1 -5
- package/esm/typography/Hint/index.mdx +1 -5
- package/esm/typography/NormalText/index.mdx +3 -15
- package/esm/typography/Paragraph/index.mdx +3 -15
- package/package.json +3 -3
- package/src/admin/AccessibilityMenu/index.tsx +52 -0
- package/src/admin/AutoComplete/index.mdx +8 -30
- package/src/admin/CopyToClipboard/index.mdx +1 -5
- package/src/admin/Dropdown/Dropdown.stories.playwright.json +53 -0
- package/src/admin/Dropdown/__stories__/AlignRight.tsx +1 -1
- package/src/admin/Dropdown/__stories__/Default.tsx +1 -1
- package/src/admin/Dropdown/__stories__/PlacementTop.tsx +1 -1
- package/src/admin/Dropdown/index.mdx +3 -15
- package/src/admin/Modal/Modal.stories.playwright.json +37 -0
- package/src/admin/Modal/__stories__/AlertDialog.tsx +18 -3
- package/src/admin/Modal/__stories__/Default.tsx +18 -3
- package/src/admin/Modal/index.mdx +1 -5
- package/src/app/Footer/Footer.mdx +3 -14
- package/src/app/Header/index.mdx +3 -16
- package/src/app/QrCodeViewer/index.mdx +1 -5
- package/src/core/Accordion/index.mdx +2 -10
- package/src/core/Accordion/index.tsx +38 -4
- package/src/core/Button/__stories__/GroupingButtons.tsx +1 -0
- package/src/core/Button/__stories__/GroupingButtonsAndLinks.tsx +1 -0
- package/src/core/Button/__stories__/Warning.tsx +1 -0
- package/src/core/Button/index.mdx +4 -20
- package/src/core/Card/card.mdx +7 -35
- package/src/core/Checkbox/checkbox.mdx +6 -30
- package/src/core/DateInputContainer/index.mdx +4 -20
- package/src/core/ErrorSummary/index.mdx +3 -15
- package/src/core/FileUpload/index.mdx +1 -5
- package/src/core/Link/link.mdx +4 -20
- package/src/core/List/index.mdx +1 -5
- package/src/core/NavList/index.mdx +1 -5
- package/src/core/NotificationBanner/index.mdx +1 -5
- package/src/core/PhaseBanner/index.mdx +1 -4
- package/src/core/RadioContainer/index.mdx +6 -30
- package/src/core/SelectContainer/index.mdx +3 -15
- package/src/core/SingleCharacterInputContainer/index.mdx +7 -10
- package/src/core/SummaryList/index.mdx +2 -10
- package/src/core/Table/index.mdx +6 -30
- package/src/core/TextArea/index.mdx +6 -30
- package/src/core/TextInput/index.mdx +6 -30
- package/src/core/index.ts +1 -0
- package/src/typography/HeadingCaption/index.mdx +1 -5
- package/src/typography/Hint/index.mdx +1 -5
- package/src/typography/NormalText/index.mdx +3 -15
- package/src/typography/Paragraph/index.mdx +3 -15
- package/typography/HeadingCaption/index.mdx +1 -5
- package/typography/Hint/index.mdx +1 -5
- package/typography/NormalText/index.mdx +3 -15
- 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
|
|
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(
|
|
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")
|
|
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;"))
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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")
|
|
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
|
-
}))))
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
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;
|
package/es/admin/Modal/index.mdx
CHANGED
|
@@ -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
|
|
package/es/app/Footer/Footer.mdx
CHANGED
|
@@ -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
|
package/es/app/Header/index.mdx
CHANGED
|
@@ -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 = ["
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
|
package/es/core/Button/index.mdx
CHANGED
|
@@ -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:'
|
package/es/core/Card/card.mdx
CHANGED
|
@@ -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
|
|