@digigov/ui 0.22.0 → 0.24.1
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 +34 -1
- package/admin/CopyToClipboard/CopyToClipboard.stories.d.ts +9 -0
- package/{app → admin}/CopyToClipboard/CopyToClipboard.stories.js +5 -5
- package/{app → admin}/CopyToClipboard/__stories__/Banner.d.ts +0 -0
- package/{app → admin}/CopyToClipboard/__stories__/Banner.js +2 -2
- package/{app → admin}/CopyToClipboard/__stories__/Default.d.ts +0 -0
- package/{app → admin}/CopyToClipboard/__stories__/Default.js +7 -5
- package/{app → admin}/CopyToClipboard/__stories__/MultipleCopies.d.ts +0 -0
- package/{app → admin}/CopyToClipboard/__stories__/MultipleCopies.js +15 -15
- package/admin/CopyToClipboard/index.d.ts +1 -1
- package/admin/CopyToClipboard/index.js +3 -2
- package/admin/CopyToClipboard/index.mdx +22 -0
- package/admin/Dropdown/Dropdown.stories.d.ts +9 -0
- package/admin/Dropdown/Dropdown.stories.js +60 -0
- package/admin/Dropdown/__stories__/AlignRight.d.ts +3 -0
- package/admin/Dropdown/__stories__/AlignRight.js +83 -0
- package/admin/Dropdown/__stories__/Default.d.ts +3 -0
- package/admin/Dropdown/__stories__/Default.js +75 -0
- package/admin/Dropdown/__stories__/PlacementTop.d.ts +3 -0
- package/admin/Dropdown/__stories__/PlacementTop.js +83 -0
- package/admin/Dropdown/index.js +21 -10
- package/admin/Dropdown/index.mdx +29 -0
- package/admin/Modal/Modal.stories.d.ts +8 -0
- package/admin/Modal/Modal.stories.js +44 -0
- package/admin/Modal/__stories__/AlertDialog.d.ts +3 -0
- package/admin/Modal/__stories__/AlertDialog.js +80 -0
- package/admin/Modal/__stories__/Default.d.ts +3 -0
- package/admin/Modal/__stories__/Default.js +79 -0
- package/admin/Modal/index.mdx +26 -0
- package/admin/TaskList/TaskList.stories.d.ts +7 -0
- package/admin/TaskList/TaskList.stories.js +30 -0
- package/admin/TaskList/__stories__/Default.d.ts +3 -0
- package/admin/TaskList/__stories__/Default.js +97 -0
- package/admin/TaskList/index.d.ts +7 -0
- package/admin/TaskList/index.js +86 -0
- package/admin/Timeline/Timeline.stories.d.ts +7 -0
- package/admin/Timeline/Timeline.stories.js +30 -0
- package/admin/Timeline/__stories__/Default.d.ts +3 -0
- package/admin/Timeline/__stories__/Default.js +87 -0
- package/admin/Timeline/index.d.ts +7 -0
- package/admin/Timeline/index.js +86 -0
- package/admin/index.d.ts +3 -1
- package/admin/index.js +30 -4
- package/api/fetchAPI.js +6 -4
- package/api/index.spec.js +18 -19
- package/api/useResource.js +6 -4
- package/api/useResourceAction.js +6 -4
- package/api/useResourceQuery.js +7 -4
- package/api/utils.js +8 -6
- package/core/Accordion/__stories__/Default.js +17 -1
- package/core/Accordion/__stories__/WithHints.js +17 -1
- package/core/Accordion/index.mdx +6 -1
- package/core/Breadcrumbs/__stories__/Default.js +6 -2
- package/core/Button/Button.stories.d.ts +3 -0
- package/core/Button/Button.stories.js +44 -0
- package/core/Button/__stories__/Back.d.ts +4 -0
- package/core/Button/__stories__/Back.js +26 -0
- package/core/Button/__stories__/ButtonLinkButton.d.ts +6 -0
- package/core/Button/__stories__/ButtonLinkButton.js +30 -0
- package/core/Button/__stories__/CallToActionButton.d.ts +3 -0
- package/core/Button/__stories__/CallToActionButton.js +9 -1
- package/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/core/Button/__stories__/Primary.js +3 -1
- package/core/Button/__stories__/Secondary.js +3 -2
- package/core/Button/__stories__/Warning.d.ts +0 -1
- package/core/Button/__stories__/Warning.js +4 -5
- package/core/Button/__stories__/WithVariantLink.d.ts +6 -0
- package/core/Button/__stories__/WithVariantLink.js +29 -0
- package/{es/core/Button/Button.mdx → core/Button/index.mdx} +9 -2
- package/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/core/Checkboxes/__stories__/Default.js +5 -1
- package/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/core/Checkboxes/__stories__/NoneAnswerWithError.js +7 -1
- package/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/core/Link/__stories__/DarkBackground.js +3 -1
- package/core/Link/__stories__/DarkBackgroundNoUnderline.js +3 -1
- package/core/Link/__stories__/Default.js +3 -1
- package/core/Link/__stories__/NoUnderline.js +3 -1
- package/core/Link/link.mdx +4 -0
- package/core/NavList/NavList.js +4 -2
- package/core/NavList/NavList.stories.d.ts +8 -0
- package/core/NavList/NavList.stories.js +44 -0
- package/core/NavList/NavListBase.js +3 -1
- package/core/NavList/NavListItem.d.ts +1 -0
- package/core/NavList/NavListItem.js +3 -1
- package/core/NavList/NavListItemBase.d.ts +1 -0
- package/core/NavList/NavListItemBase.js +7 -3
- package/core/NavList/__stories__/Default.d.ts +3 -0
- package/core/NavList/__stories__/Default.js +69 -0
- package/core/NavList/__stories__/NavHorizontalLayout.d.ts +3 -0
- package/core/NavList/__stories__/NavHorizontalLayout.js +67 -0
- package/core/NavList/index.mdx +22 -1
- package/core/NavList/types.d.ts +1 -0
- package/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/core/Radios/__stories__/Inline.js +5 -1
- package/core/Radios/__stories__/MultipleQuestions.js +6 -2
- package/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/core/Radios/__stories__/WithHints.js +17 -7
- package/core/Select/__stories__/Default.js +2 -2
- package/core/Select/__stories__/DisabledInput.js +3 -1
- package/core/Select/__stories__/WithHint.d.ts +2 -2
- package/core/Select/__stories__/WithHint.js +6 -6
- package/core/Select/index.mdx +6 -0
- package/core/Table/Table.stories.d.ts +1 -0
- package/core/Table/Table.stories.js +14 -0
- package/core/Table/TableFloatingScroll.js +6 -4
- package/core/Table/__stories__/NoData.js +3 -1
- package/core/Table/__stories__/WithFloatingScroll.d.ts +3 -0
- package/core/Table/__stories__/WithFloatingScroll.js +111 -0
- package/core/Table/__stories__/WithLoader.js +17 -16
- package/core/Table/index.mdx +8 -1
- package/es/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
- package/{esm/app → es/admin}/CopyToClipboard/__stories__/Banner.js +1 -1
- package/{esm/app → es/admin}/CopyToClipboard/__stories__/Default.js +6 -4
- package/es/{app → admin}/CopyToClipboard/__stories__/MultipleCopies.js +4 -4
- package/es/admin/CopyToClipboard/index.js +3 -2
- package/es/admin/CopyToClipboard/index.mdx +22 -0
- package/es/admin/Dropdown/Dropdown.stories.js +9 -0
- package/es/admin/Dropdown/__stories__/AlignRight.js +56 -0
- package/es/admin/Dropdown/__stories__/Default.js +48 -0
- package/es/admin/Dropdown/__stories__/PlacementTop.js +56 -0
- package/es/admin/Dropdown/index.js +21 -10
- package/es/admin/Dropdown/index.mdx +29 -0
- package/es/admin/Modal/Modal.stories.js +7 -0
- package/es/admin/Modal/__stories__/AlertDialog.js +58 -0
- package/es/admin/Modal/__stories__/Default.js +56 -0
- package/es/admin/Modal/index.mdx +26 -0
- package/es/admin/TaskList/TaskList.stories.js +6 -0
- package/es/admin/TaskList/__stories__/Default.js +74 -0
- package/es/admin/TaskList/index.js +7 -0
- package/es/admin/Timeline/Timeline.stories.js +6 -0
- package/es/admin/Timeline/__stories__/Default.js +64 -0
- package/es/admin/Timeline/index.js +7 -0
- package/es/admin/index.js +4 -2
- package/es/api/fetchAPI.js +6 -3
- package/es/api/index.spec.js +19 -17
- package/es/api/useResource.js +6 -3
- package/es/api/useResourceAction.js +6 -3
- package/es/api/useResourceQuery.js +6 -3
- package/es/api/utils.js +8 -5
- package/es/core/Accordion/__stories__/Default.js +17 -1
- package/es/core/Accordion/__stories__/WithHints.js +17 -1
- package/es/core/Accordion/index.mdx +6 -1
- package/es/core/Breadcrumbs/__stories__/Default.js +6 -2
- package/es/core/Button/Button.stories.js +5 -1
- package/es/core/Button/__stories__/Back.js +13 -0
- package/es/core/Button/__stories__/ButtonLinkButton.js +17 -0
- package/es/core/Button/__stories__/CallToActionButton.js +9 -1
- package/es/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/es/core/Button/__stories__/Primary.js +3 -1
- package/es/core/Button/__stories__/Secondary.js +3 -2
- package/es/core/Button/__stories__/Warning.js +3 -3
- package/es/core/Button/__stories__/WithVariantLink.js +16 -0
- package/{core/Button/Button.mdx → es/core/Button/index.mdx} +9 -2
- package/es/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/es/core/Checkboxes/__stories__/Default.js +5 -1
- package/es/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/es/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/es/core/Checkboxes/__stories__/NoneAnswerWithError.js +7 -1
- package/es/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/es/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/es/core/Link/__stories__/DarkBackground.js +7 -5
- package/es/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
- package/es/core/Link/__stories__/Default.js +5 -3
- package/es/core/Link/__stories__/NoUnderline.js +5 -3
- package/es/core/Link/link.mdx +4 -0
- package/es/core/NavList/NavList.js +4 -2
- package/es/core/NavList/NavList.stories.js +7 -0
- package/es/core/NavList/NavListBase.js +3 -1
- package/es/core/NavList/NavListItem.js +3 -1
- package/es/core/NavList/NavListItemBase.js +7 -3
- package/es/core/NavList/__stories__/Default.js +48 -0
- package/es/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
- package/es/core/NavList/index.mdx +22 -1
- package/es/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/es/core/Radios/__stories__/Inline.js +5 -1
- package/es/core/Radios/__stories__/MultipleQuestions.js +6 -2
- package/es/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/es/core/Radios/__stories__/WithHints.js +17 -7
- package/es/core/Select/__stories__/Default.js +5 -4
- package/es/core/Select/__stories__/DisabledInput.js +5 -3
- package/es/core/Select/__stories__/WithHint.js +7 -6
- package/es/core/Select/index.mdx +6 -0
- package/es/core/Table/Table.stories.js +2 -1
- package/es/core/Table/TableFloatingScroll.js +6 -4
- package/es/core/Table/__stories__/NoData.js +3 -1
- package/es/core/Table/__stories__/WithFloatingScroll.js +95 -0
- package/es/core/Table/__stories__/WithLoader.js +13 -14
- package/es/core/Table/index.mdx +8 -1
- package/es/layouts/Basic/Content/index.mdx +0 -12
- package/es/layouts/Basic/Main/index.mdx +0 -10
- package/es/layouts/Basic/Masthead/index.mdx +0 -12
- package/es/layouts/Basic/Side/index.mdx +0 -12
- package/es/layouts/Basic/Top/index.mdx +0 -12
- package/es/layouts/Basic/index.mdx +1 -15
- package/es/layouts/Grid/__stories__/Default.js +26 -6
- package/es/layouts/Grid/__stories__/Inline.js +26 -6
- package/es/registry.js +17 -21
- package/es/test-utils/delay.js +6 -3
- package/esm/admin/CopyToClipboard/CopyToClipboard.stories.js +8 -0
- package/{es/app → esm/admin}/CopyToClipboard/__stories__/Banner.js +1 -1
- package/{es/app → esm/admin}/CopyToClipboard/__stories__/Default.js +6 -4
- package/esm/{app → admin}/CopyToClipboard/__stories__/MultipleCopies.js +4 -4
- package/esm/admin/CopyToClipboard/index.js +3 -2
- package/esm/admin/CopyToClipboard/index.mdx +22 -0
- package/esm/admin/Dropdown/Dropdown.stories.js +9 -0
- package/esm/admin/Dropdown/__stories__/AlignRight.js +56 -0
- package/esm/admin/Dropdown/__stories__/Default.js +48 -0
- package/esm/admin/Dropdown/__stories__/PlacementTop.js +56 -0
- package/esm/admin/Dropdown/index.js +21 -10
- package/esm/admin/Dropdown/index.mdx +29 -0
- package/esm/admin/Modal/Modal.stories.js +7 -0
- package/esm/admin/Modal/__stories__/AlertDialog.js +58 -0
- package/esm/admin/Modal/__stories__/Default.js +56 -0
- package/esm/admin/Modal/index.mdx +26 -0
- package/esm/admin/TaskList/TaskList.stories.js +6 -0
- package/esm/admin/TaskList/__stories__/Default.js +74 -0
- package/esm/admin/TaskList/index.js +7 -0
- package/esm/admin/Timeline/Timeline.stories.js +6 -0
- package/esm/admin/Timeline/__stories__/Default.js +64 -0
- package/esm/admin/Timeline/index.js +7 -0
- package/esm/admin/index.js +4 -2
- package/esm/api/fetchAPI.js +6 -3
- package/esm/api/index.spec.js +19 -17
- package/esm/api/useResource.js +6 -3
- package/esm/api/useResourceAction.js +6 -3
- package/esm/api/useResourceQuery.js +6 -3
- package/esm/api/utils.js +8 -5
- package/esm/core/Accordion/__stories__/Default.js +17 -1
- package/esm/core/Accordion/__stories__/WithHints.js +17 -1
- package/esm/core/Accordion/index.mdx +6 -1
- package/esm/core/Breadcrumbs/__stories__/Default.js +6 -2
- package/esm/core/Button/Button.stories.js +5 -1
- package/esm/core/Button/__stories__/Back.js +13 -0
- package/esm/core/Button/__stories__/ButtonLinkButton.js +17 -0
- package/esm/core/Button/__stories__/CallToActionButton.js +9 -1
- package/esm/core/Button/__stories__/GroupingButtonsAndLinks.js +3 -1
- package/esm/core/Button/__stories__/Primary.js +3 -1
- package/esm/core/Button/__stories__/Secondary.js +3 -2
- package/esm/core/Button/__stories__/Warning.js +3 -3
- package/esm/core/Button/__stories__/WithVariantLink.js +16 -0
- package/esm/core/Button/{Button.mdx → index.mdx} +9 -2
- package/esm/core/Checkboxes/__stories__/ConditionalReveal.js +5 -1
- package/esm/core/Checkboxes/__stories__/Default.js +5 -1
- package/esm/core/Checkboxes/__stories__/MultipleQuestions.js +6 -2
- package/esm/core/Checkboxes/__stories__/NoneAnswer.js +5 -1
- package/esm/core/Checkboxes/__stories__/NoneAnswerWithError.js +7 -1
- package/esm/core/Checkboxes/__stories__/WithErrorMessage.js +7 -1
- package/esm/core/Checkboxes/__stories__/WithHint.js +5 -1
- package/esm/core/Link/__stories__/DarkBackground.js +7 -5
- package/esm/core/Link/__stories__/DarkBackgroundNoUnderline.js +7 -5
- package/esm/core/Link/__stories__/Default.js +5 -3
- package/esm/core/Link/__stories__/NoUnderline.js +5 -3
- package/esm/core/Link/link.mdx +4 -0
- package/esm/core/NavList/NavList.js +4 -2
- package/esm/core/NavList/NavList.stories.js +7 -0
- package/esm/core/NavList/NavListBase.js +3 -1
- package/esm/core/NavList/NavListItem.js +3 -1
- package/esm/core/NavList/NavListItemBase.js +7 -3
- package/esm/core/NavList/__stories__/Default.js +48 -0
- package/esm/core/NavList/__stories__/NavHorizontalLayout.js +46 -0
- package/esm/core/NavList/index.mdx +22 -1
- package/esm/core/Radios/__stories__/ConditionalReveal.js +5 -1
- package/esm/core/Radios/__stories__/Inline.js +5 -1
- package/esm/core/Radios/__stories__/MultipleQuestions.js +6 -2
- package/esm/core/Radios/__stories__/WithErrorMessage.js +7 -1
- package/esm/core/Radios/__stories__/WithHints.js +17 -7
- package/esm/core/Select/__stories__/Default.js +5 -4
- package/esm/core/Select/__stories__/DisabledInput.js +5 -3
- package/esm/core/Select/__stories__/WithHint.js +7 -6
- package/esm/core/Select/index.mdx +6 -0
- package/esm/core/Table/Table.stories.js +2 -1
- package/esm/core/Table/TableFloatingScroll.js +6 -4
- package/esm/core/Table/__stories__/NoData.js +3 -1
- package/esm/core/Table/__stories__/WithFloatingScroll.js +95 -0
- package/esm/core/Table/__stories__/WithLoader.js +13 -14
- package/esm/core/Table/index.mdx +8 -1
- package/esm/index.js +1 -1
- package/esm/layouts/Basic/Content/index.mdx +0 -12
- package/esm/layouts/Basic/Main/index.mdx +0 -10
- package/esm/layouts/Basic/Masthead/index.mdx +0 -12
- package/esm/layouts/Basic/Side/index.mdx +0 -12
- package/esm/layouts/Basic/Top/index.mdx +0 -12
- package/esm/layouts/Basic/index.mdx +1 -15
- package/esm/layouts/Grid/__stories__/Default.js +26 -6
- package/esm/layouts/Grid/__stories__/Inline.js +26 -6
- package/esm/registry.js +17 -21
- package/esm/test-utils/delay.js +6 -3
- package/layouts/Basic/Content/index.mdx +0 -12
- package/layouts/Basic/Main/index.mdx +0 -10
- package/layouts/Basic/Masthead/index.mdx +0 -12
- package/layouts/Basic/Side/index.mdx +0 -12
- package/layouts/Basic/Top/index.mdx +0 -12
- package/layouts/Basic/index.mdx +1 -15
- package/layouts/Grid/__stories__/Default.js +26 -6
- package/layouts/Grid/__stories__/Inline.js +26 -6
- package/package.json +3 -3
- package/registry.d.ts +8 -10
- package/registry.js +25 -31
- package/test-utils/delay.js +5 -3
- package/admin/CopyToClipboardMessage/index.d.ts +0 -3
- package/admin/CopyToClipboardMessage/index.js +0 -30
- package/app/CopyToClipboard/CopyToClipboard.stories.d.ts +0 -9
- package/app/CopyToClipboard/index.d.ts +0 -9
- package/app/CopyToClipboard/index.js +0 -69
- package/app/CopyToClipboard/index.mdx +0 -22
- package/es/admin/CopyToClipboardMessage/index.js +0 -3
- package/es/app/CopyToClipboard/CopyToClipboard.stories.js +0 -8
- package/es/app/CopyToClipboard/index.js +0 -45
- package/es/app/CopyToClipboard/index.mdx +0 -22
- package/esm/admin/CopyToClipboardMessage/index.js +0 -3
- package/esm/app/CopyToClipboard/CopyToClipboard.stories.js +0 -8
- package/esm/app/CopyToClipboard/index.js +0 -45
- package/esm/app/CopyToClipboard/index.mdx +0 -22
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
+
align: "right"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
15
|
+
role: "button",
|
|
16
|
+
"aria-haspopup": "true",
|
|
17
|
+
"aria-controls": "menu2",
|
|
18
|
+
arrow: true
|
|
19
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
20
|
+
role: "menu",
|
|
21
|
+
id: "menu2"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
23
|
+
role: "menuitem"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
25
|
+
name: "input-name"
|
|
26
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
27
|
+
visible: true,
|
|
28
|
+
role: "separator"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
30
|
+
role: "menu"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
32
|
+
role: "menuitem",
|
|
33
|
+
href: "#"
|
|
34
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
35
|
+
role: "menuitem",
|
|
36
|
+
href: "#"
|
|
37
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
38
|
+
role: "menuitem",
|
|
39
|
+
href: "#"
|
|
40
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
41
|
+
visible: true,
|
|
42
|
+
role: "separator"
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
role: "menuitem"
|
|
45
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
46
|
+
|
|
47
|
+
export var AlignRight = function AlignRight() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center'
|
|
53
|
+
}
|
|
54
|
+
}, _ref);
|
|
55
|
+
};
|
|
56
|
+
export default AlignRight;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, null, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
13
|
+
role: "button",
|
|
14
|
+
"aria-haspopup": "true",
|
|
15
|
+
"aria-controls": "menu2",
|
|
16
|
+
arrow: true
|
|
17
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
18
|
+
role: "menu",
|
|
19
|
+
id: "menu2"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
21
|
+
role: "menuitem"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
23
|
+
name: "input-name"
|
|
24
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
25
|
+
visible: true,
|
|
26
|
+
role: "separator"
|
|
27
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
28
|
+
role: "menu"
|
|
29
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
30
|
+
role: "menuitem",
|
|
31
|
+
href: "#"
|
|
32
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
33
|
+
role: "menuitem",
|
|
34
|
+
href: "#"
|
|
35
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
36
|
+
role: "menuitem",
|
|
37
|
+
href: "#"
|
|
38
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
39
|
+
visible: true,
|
|
40
|
+
role: "separator"
|
|
41
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
42
|
+
role: "menuitem"
|
|
43
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
44
|
+
|
|
45
|
+
export var Default = function Default() {
|
|
46
|
+
return _ref;
|
|
47
|
+
};
|
|
48
|
+
export default Default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Dropdown, { DropdownButton, DropdownContent } from '@digigov/ui/admin/Dropdown';
|
|
3
|
+
import Field from '@digigov/ui/core/Field';
|
|
4
|
+
import Label from '@digigov/react-core/Label';
|
|
5
|
+
import { SectionBreak } from '@digigov/ui/core/Divider';
|
|
6
|
+
import NavVertical from '@digigov/react-core/NavVertical';
|
|
7
|
+
import { LabelTitle } from '@digigov/react-core/LabelTitle';
|
|
8
|
+
import TextInput from '@digigov/ui/core/TextInput';
|
|
9
|
+
import NavVerticalItem from '@digigov/react-core/NavVerticalItem';
|
|
10
|
+
import Button from '@digigov/ui/core/Button';
|
|
11
|
+
|
|
12
|
+
var _ref = /*#__PURE__*/React.createElement(Dropdown, {
|
|
13
|
+
placement: "top"
|
|
14
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
15
|
+
role: "button",
|
|
16
|
+
"aria-haspopup": "true",
|
|
17
|
+
"aria-controls": "menu2",
|
|
18
|
+
arrow: true
|
|
19
|
+
}, "\u0391\u03BD\u03B1\u03B6\u03B7\u03C4\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(DropdownContent, {
|
|
20
|
+
role: "menu",
|
|
21
|
+
id: "menu2"
|
|
22
|
+
}, /*#__PURE__*/React.createElement(Field, {
|
|
23
|
+
role: "menuitem"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(Label, null, /*#__PURE__*/React.createElement(LabelTitle, null, "\u038C\u03BD\u03BF\u03BC\u03B1 \u03C0\u03B5\u03B4\u03AF\u03BF\u03C5"), /*#__PURE__*/React.createElement(TextInput, {
|
|
25
|
+
name: "input-name"
|
|
26
|
+
}))), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
27
|
+
visible: true,
|
|
28
|
+
role: "separator"
|
|
29
|
+
}), /*#__PURE__*/React.createElement(NavVertical, {
|
|
30
|
+
role: "menu"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
32
|
+
role: "menuitem",
|
|
33
|
+
href: "#"
|
|
34
|
+
}, "\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
35
|
+
role: "menuitem",
|
|
36
|
+
href: "#"
|
|
37
|
+
}, "\u039C\u03B5\u03C4\u03B1\u03BA\u03AF\u03BD\u03B7\u03C3\u03B7"), /*#__PURE__*/React.createElement(NavVerticalItem, {
|
|
38
|
+
role: "menuitem",
|
|
39
|
+
href: "#"
|
|
40
|
+
}, "\u039F\u03C1\u03B9\u03C3\u03C4\u03B9\u03BA\u03AE \u03B4\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE")), /*#__PURE__*/React.createElement(SectionBreak, {
|
|
41
|
+
visible: true,
|
|
42
|
+
role: "separator"
|
|
43
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
role: "menuitem"
|
|
45
|
+
}, "\u0395\u03BD\u03AD\u03C1\u03B3\u03B5\u03B9\u03B1")));
|
|
46
|
+
|
|
47
|
+
export var PlacementTop = function PlacementTop() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
style: {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
justifyContent: 'center',
|
|
52
|
+
alignItems: 'center'
|
|
53
|
+
}
|
|
54
|
+
}, _ref);
|
|
55
|
+
};
|
|
56
|
+
export default PlacementTop;
|
|
@@ -29,19 +29,30 @@ export var Dropdown = function Dropdown(_ref) {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
var toggleFloat = function toggleFloat() {
|
|
32
|
+
var _innerRef$current;
|
|
33
|
+
|
|
34
|
+
var tbody = innerRef.current.closest('tbody');
|
|
35
|
+
var parentElement = (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.parentElement;
|
|
36
|
+
|
|
32
37
|
if (innerRef.current.open) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
tbody.style.position = 'static';
|
|
39
|
+
var rect = parentElement.getBoundingClientRect();
|
|
40
|
+
innerRef.current.style.position = 'static'; // arbitrary spacing of 12 pixels because CSS
|
|
41
|
+
|
|
42
|
+
var top = rect.top + window.pageYOffset + 12;
|
|
36
43
|
var left = rect.left + window.pageXOffset;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
44
|
+
parentElement.style.top = "".concat(top, "px");
|
|
45
|
+
parentElement.style.left = "".concat(left, "px");
|
|
46
|
+
parentElement.style.position = "absolute";
|
|
47
|
+
parentElement.style.display = "block";
|
|
48
|
+
parentElement.style.background = 'white';
|
|
41
49
|
} else {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
tbody.style.position = 'relative';
|
|
51
|
+
parentElement.style.top = "0";
|
|
52
|
+
parentElement.style.left = "0";
|
|
53
|
+
parentElement.style.position = "relative";
|
|
54
|
+
parentElement.style.display = "table-cell";
|
|
55
|
+
parentElement.style.background = 'transparent';
|
|
45
56
|
}
|
|
46
57
|
};
|
|
47
58
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: dropdown
|
|
3
|
+
title: Dropdown
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Dropdown
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
import Dropdown from '@digigov/ui/admin/Dropdown';
|
|
10
|
+
```
|
|
11
|
+
## How to use
|
|
12
|
+
|
|
13
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="Default.tsx" />
|
|
14
|
+
|
|
15
|
+
### Dropdown with align right
|
|
16
|
+
|
|
17
|
+
You can display the dropdown menu to the right side of the `Dropdown` button.
|
|
18
|
+
|
|
19
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="AlignRight.tsx" />
|
|
20
|
+
|
|
21
|
+
### Dropdown with placement top
|
|
22
|
+
|
|
23
|
+
You can display the dropdown menu to the top of the `Dropdown` button.
|
|
24
|
+
|
|
25
|
+
<Story packageName="@digigov/ui" component="admin/Dropdown" story="PlacementTop.tsx" />
|
|
26
|
+
|
|
27
|
+
You can read more about the accessibility patterns used in our Dropdown
|
|
28
|
+
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
29
|
+
[Menu Button](https://www.w3.org/WAI/ARIA/apg/patterns/menubutton/) section.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import Modal, { ModalHeading, ModalContent, ModalAction } from "@digigov/ui/admin/Modal";
|
|
4
|
+
import { Button } from "@digigov/ui/core";
|
|
5
|
+
import { Paragraph } from "@digigov/ui/typography";
|
|
6
|
+
|
|
7
|
+
function useModal() {
|
|
8
|
+
var _useState = useState(false),
|
|
9
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10
|
+
open = _useState2[0],
|
|
11
|
+
setOpen = _useState2[1];
|
|
12
|
+
|
|
13
|
+
function toggleModal() {
|
|
14
|
+
setOpen(!open);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
open: open,
|
|
19
|
+
toggleModal: toggleModal
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
|
|
24
|
+
id: "modal-label"
|
|
25
|
+
}, "\u0395\u03C0\u03B9\u03B2\u03B5\u03B2\u03B1\u03AF\u03C9\u03C3\u03B7");
|
|
26
|
+
|
|
27
|
+
var _ref2 = /*#__PURE__*/React.createElement(ModalContent, {
|
|
28
|
+
id: "modal-content"
|
|
29
|
+
}, /*#__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;"));
|
|
30
|
+
|
|
31
|
+
export var AlertDialog = function AlertDialog() {
|
|
32
|
+
var _useModal = useModal(),
|
|
33
|
+
open = _useModal.open,
|
|
34
|
+
toggleModal = _useModal.toggleModal;
|
|
35
|
+
|
|
36
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
color: "warning",
|
|
38
|
+
onClick: function onClick() {
|
|
39
|
+
return toggleModal();
|
|
40
|
+
}
|
|
41
|
+
}, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"), /*#__PURE__*/React.createElement(Modal, {
|
|
42
|
+
open: open,
|
|
43
|
+
role: "alertdialog",
|
|
44
|
+
"aria-modal": "true",
|
|
45
|
+
"aria-labelledby": "modal-label",
|
|
46
|
+
"aria-describedby": "modal-content"
|
|
47
|
+
}, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, /*#__PURE__*/React.createElement(Button, {
|
|
48
|
+
onClick: function onClick() {
|
|
49
|
+
return toggleModal();
|
|
50
|
+
}
|
|
51
|
+
}, "\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE"), /*#__PURE__*/React.createElement(Button, {
|
|
52
|
+
variant: "link",
|
|
53
|
+
onClick: function onClick() {
|
|
54
|
+
return toggleModal();
|
|
55
|
+
}
|
|
56
|
+
}, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
|
|
57
|
+
};
|
|
58
|
+
export default AlertDialog;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import Modal, { ModalHeading, ModalContent, ModalAction } from "@digigov/ui/admin/Modal";
|
|
4
|
+
import { Button, TextInput } from "@digigov/ui/core";
|
|
5
|
+
import Field from "@digigov/ui/core/Field";
|
|
6
|
+
import Label from "@digigov/react-core/Label";
|
|
7
|
+
|
|
8
|
+
function useModal() {
|
|
9
|
+
var _useState = useState(false),
|
|
10
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11
|
+
open = _useState2[0],
|
|
12
|
+
setOpen = _useState2[1];
|
|
13
|
+
|
|
14
|
+
function toggleModal() {
|
|
15
|
+
setOpen(!open);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
open: open,
|
|
20
|
+
toggleModal: toggleModal
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var _ref = /*#__PURE__*/React.createElement(ModalHeading, {
|
|
25
|
+
id: "modal-label"
|
|
26
|
+
}, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5");
|
|
27
|
+
|
|
28
|
+
var _ref2 = /*#__PURE__*/React.createElement(ModalContent, null, /*#__PURE__*/React.createElement(Field, null, /*#__PURE__*/React.createElement(Label, 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, {
|
|
29
|
+
name: "inputext",
|
|
30
|
+
characterWidth: 10
|
|
31
|
+
}))));
|
|
32
|
+
|
|
33
|
+
var _ref3 = /*#__PURE__*/React.createElement(Button, null, "\u03A5\u03C0\u03BF\u03B2\u03BF\u03BB\u03AE");
|
|
34
|
+
|
|
35
|
+
export var Default = function Default() {
|
|
36
|
+
var _useModal = useModal(),
|
|
37
|
+
open = _useModal.open,
|
|
38
|
+
toggleModal = _useModal.toggleModal;
|
|
39
|
+
|
|
40
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
return toggleModal();
|
|
43
|
+
}
|
|
44
|
+
}, "\u03A0\u03C1\u03BF\u03C3\u03B8\u03AE\u03BA\u03B7 \u03C4\u03B7\u03BB\u03B5\u03C6\u03CE\u03BD\u03BF\u03C5"), /*#__PURE__*/React.createElement(Modal, {
|
|
45
|
+
open: open,
|
|
46
|
+
role: "dialog",
|
|
47
|
+
"aria-modal": "true",
|
|
48
|
+
"aria-labelledby": "modal-label"
|
|
49
|
+
}, _ref, _ref2, /*#__PURE__*/React.createElement(ModalAction, null, _ref3, /*#__PURE__*/React.createElement(Button, {
|
|
50
|
+
variant: "link",
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
return toggleModal();
|
|
53
|
+
}
|
|
54
|
+
}, "\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7"))));
|
|
55
|
+
};
|
|
56
|
+
export default Default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: modal
|
|
3
|
+
title: Modal
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
```bash
|
|
7
|
+
import Modal, {ModalHeading, ModalContent, ModalAction} from "@digigov/ui/admin/Modal";
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
### As a Dialog
|
|
13
|
+
|
|
14
|
+
<Story packageName="@digigov/ui" component="admin/Modal" story="Default.tsx" />
|
|
15
|
+
|
|
16
|
+
### As an Alert Dialog
|
|
17
|
+
|
|
18
|
+
<Story packageName="@digigov/ui" component="admin/Modal" story="AlertDialog.tsx" />
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## Accessibility
|
|
22
|
+
|
|
23
|
+
You can read more about the accessibility patterns used in our Modal
|
|
24
|
+
implementation in the ARIA Authoring Practices Guide (APG) at
|
|
25
|
+
[Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialogmodal/) and
|
|
26
|
+
[Alert Dialog](https://www.w3.org/WAI/ARIA/apg/patterns/alertdialog/) sections.
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Link } from '@digigov/react-core';
|
|
3
|
+
import SummaryList, { SummaryListItem, SummaryListItemAction, SummaryListItemKey } from '@digigov/ui/core/SummaryList';
|
|
4
|
+
import { TaskList, TaskListItem, TaskListItemHeading, TaskListItemContent, TaskListItemTag } from '@digigov/ui/admin';
|
|
5
|
+
var fields = [{
|
|
6
|
+
title: 'Check before you start',
|
|
7
|
+
tasks: [{
|
|
8
|
+
text: 'Check eligibility',
|
|
9
|
+
status: 'Completed'
|
|
10
|
+
}, {
|
|
11
|
+
text: 'Read declaration',
|
|
12
|
+
status: 'Completed'
|
|
13
|
+
}]
|
|
14
|
+
}, {
|
|
15
|
+
title: 'Prepare application',
|
|
16
|
+
tasks: [{
|
|
17
|
+
text: 'Company information',
|
|
18
|
+
status: 'Completed'
|
|
19
|
+
}, {
|
|
20
|
+
text: 'Your contact details',
|
|
21
|
+
status: 'In progress'
|
|
22
|
+
}, {
|
|
23
|
+
text: 'List convictions',
|
|
24
|
+
status: 'Not started'
|
|
25
|
+
}, {
|
|
26
|
+
text: 'Provide financial evidence',
|
|
27
|
+
status: 'Cannot start yet'
|
|
28
|
+
}, {
|
|
29
|
+
text: 'Give medical information',
|
|
30
|
+
status: 'Cannot start yet'
|
|
31
|
+
}]
|
|
32
|
+
}, {
|
|
33
|
+
title: 'Apply',
|
|
34
|
+
tasks: [{
|
|
35
|
+
text: 'Submit and pay',
|
|
36
|
+
status: 'Cannot start yet'
|
|
37
|
+
}]
|
|
38
|
+
}];
|
|
39
|
+
export var Default = function Default() {
|
|
40
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TaskList, null, fields && fields.map(function (field, index) {
|
|
41
|
+
return /*#__PURE__*/React.createElement(TaskListItem, {
|
|
42
|
+
key: index
|
|
43
|
+
}, /*#__PURE__*/React.createElement(TaskListItemHeading, {
|
|
44
|
+
size: "m"
|
|
45
|
+
}, "".concat(index + 1, ". ").concat(field.title)), /*#__PURE__*/React.createElement(TaskListItemContent, null, /*#__PURE__*/React.createElement(SummaryList, null, field.tasks.map(function (task, key) {
|
|
46
|
+
var tagColor;
|
|
47
|
+
|
|
48
|
+
switch (task.status) {
|
|
49
|
+
case 'Completed':
|
|
50
|
+
tagColor = 'completed';
|
|
51
|
+
break;
|
|
52
|
+
|
|
53
|
+
case 'In progress':
|
|
54
|
+
tagColor = 'in-progress';
|
|
55
|
+
break;
|
|
56
|
+
|
|
57
|
+
case 'Not started':
|
|
58
|
+
tagColor = 'not-started';
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case 'Cannot start yet':
|
|
62
|
+
tagColor = 'not-started';
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return /*#__PURE__*/React.createElement(SummaryListItem, {
|
|
67
|
+
key: key
|
|
68
|
+
}, /*#__PURE__*/React.createElement(SummaryListItemKey, null, /*#__PURE__*/React.createElement(Link, null, task.text)), /*#__PURE__*/React.createElement(SummaryListItemAction, null, /*#__PURE__*/React.createElement(TaskListItemTag, {
|
|
69
|
+
status: tagColor
|
|
70
|
+
}, task.status)));
|
|
71
|
+
}))));
|
|
72
|
+
})));
|
|
73
|
+
};
|
|
74
|
+
export default Default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@digigov/react-extensions/admin/TaskList';
|
|
2
|
+
export * from '@digigov/react-extensions/admin/TaskListItem';
|
|
3
|
+
export * from '@digigov/react-extensions/admin/TaskListItemContent';
|
|
4
|
+
export * from '@digigov/react-extensions/admin/TaskListItemHeading';
|
|
5
|
+
export * from '@digigov/react-extensions/admin/TaskListItemTag';
|
|
6
|
+
import TaskList from '@digigov/react-extensions/admin/TaskList';
|
|
7
|
+
export default TaskList;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button, Hint, Link, Paragraph } from '@digigov/react-core';
|
|
3
|
+
import { Timeline, TimelineItem, TimelineHeading, TimelineContent, TimelineActions } from '@digigov/ui/admin';
|
|
4
|
+
import Details, { DetailsSummary, DetailsContent } from '@digigov/ui/core/Details';
|
|
5
|
+
var data = [{
|
|
6
|
+
title: 'Application requires confirmation',
|
|
7
|
+
date: '14 June 2019 at 2:01pm',
|
|
8
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras non felis risus. Curabitur nec ante vitae felis ullamcorper tincidunt.',
|
|
9
|
+
links: [{
|
|
10
|
+
text: 'See application',
|
|
11
|
+
href: '#'
|
|
12
|
+
}]
|
|
13
|
+
}, {
|
|
14
|
+
title: 'Application review in progress ',
|
|
15
|
+
date: '7 June 2019 at 12:32pm',
|
|
16
|
+
text: 'Your application is being reviewed by one of our case workers.',
|
|
17
|
+
buttons: [{
|
|
18
|
+
text: 'Continue'
|
|
19
|
+
}, {
|
|
20
|
+
text: 'Cancel',
|
|
21
|
+
color: 'warning'
|
|
22
|
+
}]
|
|
23
|
+
}, {
|
|
24
|
+
title: 'Application received ',
|
|
25
|
+
date: '6 June 2019 at 9:12am ',
|
|
26
|
+
text: 'Your application has been received – reference MOJ-1234-5678'
|
|
27
|
+
}, {
|
|
28
|
+
title: 'Application details ',
|
|
29
|
+
date: '6 June 2019 at 9:12am ',
|
|
30
|
+
detailsSummary: 'More info regarding your application',
|
|
31
|
+
detailsContent: 'Your application has been received – reference MOJ-1234-5678'
|
|
32
|
+
}, {
|
|
33
|
+
title: 'Application submitted',
|
|
34
|
+
date: '28 May 2019 at 10:45am',
|
|
35
|
+
text: 'Your application is being reviewed by one of our case workers.',
|
|
36
|
+
buttons: [{
|
|
37
|
+
text: 'Continue'
|
|
38
|
+
}],
|
|
39
|
+
links: [{
|
|
40
|
+
text: 'Details',
|
|
41
|
+
href: '#'
|
|
42
|
+
}, {
|
|
43
|
+
text: 'Something else',
|
|
44
|
+
href: '#'
|
|
45
|
+
}]
|
|
46
|
+
}];
|
|
47
|
+
export var Default = function Default() {
|
|
48
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Timeline, null, data && data.map(function (field, index) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(TimelineItem, {
|
|
50
|
+
key: index
|
|
51
|
+
}, /*#__PURE__*/React.createElement(TimelineHeading, null, field.title), /*#__PURE__*/React.createElement(TimelineContent, null, /*#__PURE__*/React.createElement(Hint, null, field.date), field.text && /*#__PURE__*/React.createElement(Paragraph, null, field.text), field.detailsSummary && /*#__PURE__*/React.createElement(Details, null, /*#__PURE__*/React.createElement(DetailsSummary, null, field.detailsSummary), /*#__PURE__*/React.createElement(DetailsContent, null, field.detailsContent))), (field.links || field.buttons) && /*#__PURE__*/React.createElement(TimelineActions, null, field.buttons && field.buttons.map(function (button, index) {
|
|
52
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
53
|
+
key: index,
|
|
54
|
+
color: button.color || 'secondary'
|
|
55
|
+
}, button.text);
|
|
56
|
+
}), field.links && field.links.map(function (link, index) {
|
|
57
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
58
|
+
key: index,
|
|
59
|
+
href: link.href
|
|
60
|
+
}, link.text);
|
|
61
|
+
})));
|
|
62
|
+
})));
|
|
63
|
+
};
|
|
64
|
+
export default Default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from '@digigov/react-extensions/admin/Timeline';
|
|
2
|
+
export * from '@digigov/react-extensions/admin/TimelineContent';
|
|
3
|
+
export * from '@digigov/react-extensions/admin/TimelineHeading';
|
|
4
|
+
export * from '@digigov/react-extensions/admin/TimelineItem';
|
|
5
|
+
export * from '@digigov/react-extensions/admin/TimelineActions';
|
|
6
|
+
import Timeline from '@digigov/react-extensions/admin/Timeline';
|
|
7
|
+
export default Timeline;
|
package/es/admin/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@digigov/ui/admin/Dropdown';
|
|
2
2
|
export * from '@digigov/ui/admin/Chip';
|
|
3
|
-
export * from '@digigov/ui/admin/
|
|
3
|
+
export * from '@digigov/ui/admin/CopyToClipboard';
|
|
4
4
|
export * from '@digigov/ui/admin/FillableText';
|
|
5
5
|
export * from '@digigov/ui/admin/Drawer';
|
|
6
6
|
export * from '@digigov/ui/admin/Modal';
|
|
@@ -14,4 +14,6 @@ export * from '@digigov/ui/admin/AdminLayout';
|
|
|
14
14
|
export * from '@digigov/ui/admin/ResultsHeading';
|
|
15
15
|
export * from '@digigov/ui/admin/SearchSection';
|
|
16
16
|
export * from '@digigov/ui/admin/FilterSection';
|
|
17
|
-
export * from '@digigov/ui/admin/AutoComplete';
|
|
17
|
+
export * from '@digigov/ui/admin/AutoComplete';
|
|
18
|
+
export * from '@digigov/ui/admin/Timeline';
|
|
19
|
+
export * from '@digigov/ui/admin/TaskList';
|
package/es/api/fetchAPI.js
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
|
|
5
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
6
|
+
|
|
4
7
|
import { getArgs, processResponse } from '@digigov/ui/api/utils';
|
|
5
8
|
export function fetchAPI(_x, _x2, _x3) {
|
|
6
9
|
return _fetchAPI.apply(this, arguments);
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
function _fetchAPI() {
|
|
10
|
-
_fetchAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resource, _ref, apiConfig) {
|
|
13
|
+
_fetchAPI = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(resource, _ref, apiConfig) {
|
|
11
14
|
var _ref$query, query, _ref$path, path, _ref$method, method, _ref$body, body, baseURL, token, _getArgs, _getArgs2, url, options, response, _yield$processRespons, data, error, status;
|
|
12
15
|
|
|
13
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
16
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14
17
|
while (1) {
|
|
15
18
|
switch (_context.prev = _context.next) {
|
|
16
19
|
case 0:
|