@digigov/ui 2.0.0-76ec20a0 → 2.0.0-7d765d3c
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/app/Footer/__stories__/Default.d.ts +1 -1
- package/app/Loader/Loader.stories.d.ts +45 -1
- package/app/Loader/__stories__/AccessibilityLoader.d.ts +3 -0
- package/app/Loader/__stories__/FullPageLoader.d.ts +1 -0
- package/app/Loader/__stories__/Secondary.d.ts +3 -0
- package/app/Loader/__stories__/Sizes.d.ts +3 -0
- package/app/Loader/index.native.d.ts +2 -2
- package/app/Loader/index.native.js.map +2 -2
- package/app/Loader/index.web/index.js +17 -1
- package/app/Loader/index.web.d.ts +19 -1
- package/app/Loader/index.web.js.map +3 -3
- package/app/Masthead/Masthead.stories.d.ts +28 -1
- package/app/Modal/Modal.stories.d.ts +20 -1
- package/app/Modal/hooks/index.js +2 -6
- package/app/Modal/hooks.d.ts +2 -2
- package/app/Modal/hooks.js.map +2 -2
- package/app/Modal/index.web/index.js +5 -5
- package/app/Modal/index.web.js.map +2 -2
- package/app/NotFound/__stories__/Default.d.ts +1 -1
- package/app/OutdatedBrowserBanner/index.d.ts +1 -0
- package/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/app/PhaseBannerHeader/index.d.ts +1 -1
- package/app/PhaseBannerHeader/index.js.map +2 -2
- package/app/Skeleton/__stories__/Button.d.ts +1 -1
- package/app/Skeleton/__stories__/Default.d.ts +1 -1
- package/app/Skeleton/__stories__/NoAnimation.d.ts +1 -1
- package/app/hooks/useNotificationArea/index.js +76 -0
- package/app/hooks/useNotificationArea/package.json +6 -0
- package/app/hooks/useNotificationArea.d.ts +1 -0
- package/app/hooks/useNotificationArea.js.map +7 -0
- package/cjs/app/Loader/index.native.js.map +2 -2
- package/cjs/app/Loader/index.web/index.js +33 -2
- package/cjs/app/Loader/index.web.js.map +3 -3
- package/cjs/app/Modal/hooks/index.js +2 -6
- package/cjs/app/Modal/hooks.js.map +2 -2
- package/cjs/app/Modal/index.web/index.js +5 -5
- package/cjs/app/Modal/index.web.js.map +2 -2
- package/cjs/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/cjs/app/PhaseBannerHeader/index.js.map +2 -2
- package/cjs/app/hooks/useNotificationArea/index.js +99 -0
- package/cjs/app/hooks/useNotificationArea.js.map +7 -0
- package/cjs/content/Accordion/hooks.js.map +1 -1
- package/cjs/form/AutoComplete/Status/index.js.map +2 -2
- package/cjs/form/AutoComplete/index.js +32 -19
- package/cjs/form/AutoComplete/index.js.map +2 -2
- package/cjs/i18n/locales/el/index.js +51 -23
- package/cjs/i18n/locales/el.js.map +2 -2
- package/cjs/i18n/locales/en/index.js +36 -8
- package/cjs/i18n/locales/en.js.map +2 -2
- package/cjs/layouts/Hidden/index.js +19 -0
- package/cjs/layouts/Hidden/index.js.map +3 -3
- package/cjs/lazy.js +1 -1
- package/cjs/lazy.js.map +2 -2
- package/cjs/navigation/Drawer/hooks/index.js +2 -6
- package/cjs/navigation/Drawer/hooks.js.map +2 -2
- package/cjs/navigation/Pagination/hooks/index.js +2 -2
- package/cjs/navigation/Pagination/hooks.js.map +2 -2
- package/cjs/navigation/Tabs/hooks.js.map +1 -1
- package/cjs/registry.js +50 -48
- package/cjs/registry.js.map +2 -2
- package/cjs/typography/CodeBlock/index.js +1 -2
- package/cjs/typography/CodeBlock/index.js.map +2 -2
- package/cjs/utils/hooks/useDebounce/index.js +1 -1
- package/cjs/utils/hooks/useDebounce.js.map +2 -2
- package/content/Accordion/Accordion.stories.d.ts +27 -16
- package/content/Accordion/hooks.js.map +1 -1
- package/content/Chip/__stories__/Default.d.ts +1 -1
- package/content/SummaryList/SummaryList.stories.d.ts +4 -1
- package/feedback/NotificationBanner/NotificationBanner.stories.d.ts +14 -13
- package/feedback/NotificationBanner/__stories__/Expanded.d.ts +3 -0
- package/feedback/PhaseBanner/PhaseBanner.stories.d.ts +1 -1
- package/form/AutoComplete/AutoComplete.stories.d.ts +57 -16
- package/form/AutoComplete/Status/index.d.ts +1 -1
- package/form/AutoComplete/Status/index.js.map +2 -2
- package/form/AutoComplete/__stories__/WithCustomValue.d.ts +3 -0
- package/form/AutoComplete/__stories__/WithHint.d.ts +3 -0
- package/form/AutoComplete/index.d.ts +4 -3
- package/form/AutoComplete/index.js +32 -18
- package/form/AutoComplete/index.js.map +2 -2
- package/form/Button/__stories__/ThemeToggle.d.ts +1 -1
- package/form/FileUpload/FileUpload.stories.d.ts +1 -0
- package/form/FileUpload/__stories__/WithVariantLink.d.ts +3 -0
- package/i18n/locales/el/index.js +51 -23
- package/i18n/locales/el.d.ts +33 -5
- package/i18n/locales/el.js.map +2 -2
- package/i18n/locales/en/index.js +36 -8
- package/i18n/locales/en.d.ts +32 -4
- package/i18n/locales/en.js.map +2 -2
- package/index.js +1 -1
- package/layouts/Grid/Grid.stories.d.ts +82 -0
- package/layouts/Hidden/Hidden.stories.d.ts +115 -0
- package/layouts/Hidden/index.d.ts +2 -0
- package/layouts/Hidden/index.js +5 -0
- package/layouts/Hidden/index.js.map +2 -2
- package/layouts/Stack/Stack.stories.d.ts +76 -0
- package/lazy/index.js +1 -1
- package/navigation/BackToTopLink/BackToTopLink.stories.d.ts +2 -0
- package/navigation/Drawer/hooks/index.js +2 -6
- package/navigation/Drawer/hooks.js.map +2 -2
- package/navigation/Dropdown/Dropdown.stories.d.ts +75 -1
- package/navigation/Pagination/hooks/index.js +2 -2
- package/navigation/Pagination/hooks.js.map +2 -2
- package/navigation/SkipLink/SkipLink.stories.d.ts +2 -0
- package/navigation/Tabs/hooks.d.ts +1 -1
- package/navigation/Tabs/hooks.js.map +1 -1
- package/package.json +7 -7
- package/registry/index.js +50 -48
- package/src/app/BannerContainer/__stories__/CookiesBanner.tsx +1 -21
- package/src/app/Footer/__stories__/Default.tsx +1 -1
- package/src/app/Header/doc.mdx +3 -3
- package/src/app/Loader/Loader.stories.jsx +54 -0
- package/src/app/Loader/__stories__/AccessibilityLoader.tsx +27 -0
- package/src/app/Loader/__stories__/FullPageLoader.tsx +9 -5
- package/src/app/Loader/__stories__/Secondary.tsx +11 -0
- package/src/app/Loader/__stories__/Sizes.tsx +18 -0
- package/src/app/Loader/doc.mdx +39 -0
- package/src/app/Loader/index.native.tsx +2 -2
- package/src/app/Loader/index.test.tsx +12 -0
- package/src/app/Loader/index.web.tsx +39 -1
- package/src/app/Masthead/Masthead.stories.jsx +66 -0
- package/src/app/Masthead/doc.mdx +3 -3
- package/src/app/Modal/Modal.stories.jsx +64 -0
- package/src/app/Modal/__stories__/AlertDialog.tsx +1 -1
- package/src/app/Modal/__stories__/Auto.tsx +1 -1
- package/src/app/Modal/__stories__/Default.tsx +1 -1
- package/src/app/Modal/__stories__/Dense.tsx +1 -1
- package/src/app/Modal/__stories__/WithHooks.tsx +1 -1
- package/src/app/Modal/__stories__/WithoutModalGaps.tsx +1 -1
- package/src/app/Modal/hooks.ts +8 -8
- package/src/app/Modal/index.web.tsx +5 -7
- package/src/app/NotFound/__stories__/Default.tsx +1 -1
- package/src/app/OutdatedBrowserBanner/index.tsx +1 -1
- package/src/app/PhaseBannerHeader/index.tsx +1 -1
- package/src/app/Skeleton/__stories__/Button.tsx +1 -1
- package/src/app/Skeleton/__stories__/Default.tsx +1 -1
- package/src/app/Skeleton/__stories__/NoAnimation.tsx +1 -1
- package/src/app/hooks/useNotificationArea.tsx +105 -0
- package/src/content/Accordion/Accordion.stories.jsx +9 -1
- package/src/content/Accordion/doc.mdx +1 -2
- package/src/content/Accordion/hooks.ts +1 -1
- package/src/content/Card/doc.mdx +11 -11
- package/src/content/Chip/__stories__/Default.tsx +1 -1
- package/src/content/Chip/doc.mdx +4 -4
- package/src/content/List/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/content/List/doc.mdx +3 -3
- package/src/content/SummaryList/SummaryList.stories.js +5 -1
- package/src/content/TaskList/doc.mdx +1 -1
- package/src/content/Timeline/doc.mdx +1 -1
- package/src/feedback/CopyToClipboard/doc.mdx +1 -1
- package/src/feedback/ErrorSummary/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/feedback/ErrorSummary/doc.mdx +1 -1
- package/src/feedback/NotificationBanner/NotificationBanner.stories.js +10 -9
- package/src/feedback/NotificationBanner/__snapshots__/index.spec.tsx.snap +24 -14
- package/src/feedback/NotificationBanner/__stories__/Expanded.tsx +27 -0
- package/src/feedback/NotificationBanner/doc.mdx +15 -6
- package/src/feedback/NotificationBanner/index.test.tsx +4 -0
- package/src/feedback/PhaseBanner/PhaseBanner.stories.jsx +1 -1
- package/src/feedback/WarningText/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/form/AutoComplete/AutoComplete.stories.jsx +19 -4
- package/src/form/AutoComplete/Status/index.tsx +1 -1
- package/src/form/AutoComplete/__stories__/WithAutoSelect.tsx +1 -17
- package/src/form/AutoComplete/__stories__/WithCustomValue.tsx +28 -0
- package/src/form/AutoComplete/__stories__/WithDefaultValue.tsx +1 -6
- package/src/form/AutoComplete/__stories__/WithHint.tsx +16 -0
- package/src/form/AutoComplete/doc.mdx +14 -13
- package/src/form/AutoComplete/index.test.tsx +8 -0
- package/src/form/AutoComplete/index.tsx +38 -25
- package/src/form/Button/__stories__/ThemeToggle.tsx +1 -1
- package/src/form/Button/doc.mdx +25 -14
- package/src/form/Checkbox/doc.mdx +1 -1
- package/src/form/FileUpload/FileUpload.stories.js +1 -0
- package/src/form/FileUpload/__stories__/WithVariantLink.tsx +24 -0
- package/src/form/FileUpload/index.test.tsx +4 -0
- package/src/form/RadioContainer/doc.mdx +4 -4
- package/src/i18n/locales/el.ts +73 -22
- package/src/i18n/locales/en.ts +43 -7
- package/src/layouts/Basic/doc.mdx +0 -2
- package/src/layouts/Grid/Grid.stories.jsx +143 -0
- package/src/layouts/Hidden/Hidden.stories.jsx +62 -0
- package/src/layouts/Hidden/index.tsx +3 -0
- package/src/layouts/Stack/Stack.stories.jsx +104 -0
- package/src/lazy.js +1 -1
- package/src/navigation/BackToTopLink/BackToTopLink.stories.js +4 -0
- package/src/navigation/BackToTopLink/doc.mdx +22 -0
- package/src/navigation/Breadcrumbs/doc.mdx +4 -0
- package/src/navigation/Drawer/hooks.ts +6 -6
- package/src/navigation/Dropdown/Dropdown.stories.jsx +118 -0
- package/src/navigation/Dropdown/doc.mdx +24 -2
- package/src/navigation/NavList/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/navigation/NavList/doc.mdx +1 -1
- package/src/navigation/Pagination/doc.mdx +5 -1
- package/src/navigation/Pagination/hooks.ts +2 -2
- package/src/navigation/SkipLink/SkipLink.stories.js +4 -0
- package/src/navigation/SkipLink/doc.mdx +19 -0
- package/src/navigation/Tabs/hooks.ts +2 -2
- package/src/registry.js +50 -48
- package/src/typography/CodeBlock/CodeBlock.stories.js +24 -0
- package/src/typography/CodeBlock/index.tsx +14 -12
- package/src/typography/Heading/Heading.stories.js +12 -0
- package/src/typography/HeadingCaption/HeadingCaption.stories.js +9 -0
- package/src/typography/Hint/Hint.stories.js +11 -0
- package/src/typography/Hint/__stories__/Default.tsx +1 -1
- package/src/typography/Hint/__stories__/FontSizes.tsx +4 -4
- package/src/typography/NormalText/NormalText.stories.js +10 -0
- package/src/typography/NormalText/__stories__/Default.tsx +1 -1
- package/src/typography/Paragraph/Paragraph.stories.js +23 -0
- package/src/typography/Paragraph/__stories__/Default.tsx +1 -1
- package/src/typography/Paragraph/__stories__/LeadVariant.tsx +3 -1
- package/src/typography/Paragraph/__stories__/SmallVariant.tsx +3 -1
- package/src/utils/hooks/useDebounce.ts +1 -1
- package/stories-registry/index.js +170 -154
- package/typography/CodeBlock/CodeBlock.stories.d.ts +11 -0
- package/typography/CodeBlock/index.d.ts +1 -1
- package/typography/CodeBlock/index.js +1 -2
- package/typography/CodeBlock/index.js.map +2 -2
- package/typography/Heading/Heading.stories.d.ts +10 -0
- package/typography/HeadingCaption/HeadingCaption.stories.d.ts +8 -0
- package/typography/Hint/Hint.stories.d.ts +9 -0
- package/typography/Hint/__stories__/Default.d.ts +1 -1
- package/typography/NormalText/NormalText.stories.d.ts +8 -0
- package/typography/NormalText/__stories__/Default.d.ts +1 -1
- package/typography/Paragraph/Paragraph.stories.d.ts +37 -0
- package/typography/Paragraph/__stories__/Default.d.ts +1 -1
- package/typography/Paragraph/__stories__/LeadVariant.d.ts +1 -1
- package/typography/Paragraph/__stories__/SmallVariant.d.ts +1 -1
- package/utils/hooks/useDebounce/index.js +1 -1
- package/utils/hooks/useDebounce.js.map +2 -2
- package/utils/hooks/useLatest.d.ts +1 -1
- package/src/app/Loader/Loader.stories.js +0 -8
- package/src/app/Masthead/Masthead.stories.js +0 -17
- package/src/app/Modal/Modal.stories.js +0 -18
- package/src/layouts/Grid/Grid.stories.js +0 -12
- package/src/layouts/Stack/Stack.stories.js +0 -15
- package/src/navigation/Dropdown/Dropdown.stories.js +0 -23
|
@@ -31,7 +31,10 @@ export const WithControls = {
|
|
|
31
31
|
>
|
|
32
32
|
<AccordionSection open>
|
|
33
33
|
<AccordionSectionSummary>
|
|
34
|
-
<AccordionSectionSummaryHeading
|
|
34
|
+
<AccordionSectionSummaryHeading
|
|
35
|
+
aria-controls="content1"
|
|
36
|
+
variant={args.variant}
|
|
37
|
+
>
|
|
35
38
|
{args.title}
|
|
36
39
|
</AccordionSectionSummaryHeading>
|
|
37
40
|
{args.hint > 0 && <Hint>{args.hintMessage}</Hint>}
|
|
@@ -45,6 +48,7 @@ export const WithControls = {
|
|
|
45
48
|
},
|
|
46
49
|
args: {
|
|
47
50
|
title: 'Διαφορές με το δημόσιο',
|
|
51
|
+
variant: 'default',
|
|
48
52
|
hint: true,
|
|
49
53
|
hintMessage:
|
|
50
54
|
'Δικαστικές και εξωδικαστικές διαφορές με το Δημόσιο, εκκαθάριση δικαστικών δαπανών κ.ά.',
|
|
@@ -58,6 +62,10 @@ export const WithControls = {
|
|
|
58
62
|
title: {
|
|
59
63
|
control: { type: 'text' },
|
|
60
64
|
},
|
|
65
|
+
variant: {
|
|
66
|
+
options: ['default', 'arrows'],
|
|
67
|
+
control: { type: 'select' },
|
|
68
|
+
},
|
|
61
69
|
hint: {
|
|
62
70
|
control: { type: 'boolean' },
|
|
63
71
|
},
|
|
@@ -11,11 +11,10 @@ The accordion component lets users show and hide sections of related content on
|
|
|
11
11
|
|
|
12
12
|
## How to use
|
|
13
13
|
|
|
14
|
-
### Default Accordion
|
|
15
14
|
|
|
16
15
|
<code src="@digigov/ui/content/Accordion/__stories__/Default.tsx" />
|
|
17
16
|
|
|
18
|
-
###
|
|
17
|
+
### With Hints
|
|
19
18
|
|
|
20
19
|
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.
|
|
21
20
|
|
|
@@ -34,7 +34,7 @@ export const useAccordion = ({
|
|
|
34
34
|
singleOpen = false,
|
|
35
35
|
}: UseAccordionProps = {}): UseAccordionReturn => {
|
|
36
36
|
const sectionsRef = useRef<
|
|
37
|
-
Map<AccordionItemId, React.RefObject<HTMLDetailsElement>>
|
|
37
|
+
Map<AccordionItemId, React.RefObject<HTMLDetailsElement | null>>
|
|
38
38
|
>(new Map());
|
|
39
39
|
const [current, setCurrentOpen] = useState(
|
|
40
40
|
defaultOpen ? { [defaultOpen]: true } : {}
|
package/src/content/Card/doc.mdx
CHANGED
|
@@ -12,55 +12,55 @@ When used correctly, Cards can help users to scan through vast amounts of inform
|
|
|
12
12
|
|
|
13
13
|
<code src="@digigov/ui/content/Card/__stories__/Default.tsx" />
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
### With gray border color
|
|
16
16
|
|
|
17
17
|
<code src="@digigov/ui/content/Card/__stories__/WithGrayBorder.tsx" />
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
### With dark border color
|
|
20
20
|
|
|
21
21
|
<code src="@digigov/ui/content/Card/__stories__/WithDarkBorder.tsx" />
|
|
22
22
|
|
|
23
|
-
###
|
|
23
|
+
### With top border
|
|
24
24
|
|
|
25
25
|
You can set the color of the Card's top border. You can choose between dark and grey color respectively. By default the top border color is grey.
|
|
26
26
|
|
|
27
27
|
<code src="@digigov/ui/content/Card/__stories__/WithDarkBorder.tsx" />
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### With grey top border
|
|
30
30
|
|
|
31
31
|
<code src="@digigov/ui/content/Card/__stories__/WithGrayTopBorder.tsx" />
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
### With dark top border
|
|
34
34
|
|
|
35
35
|
<code src="@digigov/ui/content/Card/__stories__/WithDarkTopBorder.tsx" />
|
|
36
36
|
|
|
37
|
-
###
|
|
37
|
+
### With divider
|
|
38
38
|
|
|
39
39
|
<code src="@digigov/ui/content/Card/__stories__/WithDivider.tsx" />
|
|
40
40
|
|
|
41
|
-
###
|
|
41
|
+
### With actions
|
|
42
42
|
|
|
43
43
|
<code src="@digigov/ui/content/Card/__stories__/WithGroupButton.tsx" />
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
### With title link
|
|
46
46
|
|
|
47
47
|
Cards can be used without an action button, but with a clickable title.
|
|
48
48
|
|
|
49
49
|
<code src="@digigov/ui/content/Card/__stories__/WithLink.tsx" />
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
### With clickable content
|
|
52
52
|
|
|
53
53
|
You can expand the clickable area of the link to fill Card's content.
|
|
54
54
|
|
|
55
55
|
<code src="@digigov/ui/content/Card/__stories__/WithClickableContent.tsx" />
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
### With button or link
|
|
58
58
|
|
|
59
59
|
Cards also provides styles for actionable elements such as Buttons or Links.
|
|
60
60
|
|
|
61
61
|
<code src="@digigov/ui/content/Card/__stories__/WithClickableLink.tsx" />
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
### With a group of actions
|
|
64
64
|
|
|
65
65
|
<code src="@digigov/ui/content/Card/__stories__/WithGroupButton.tsx" />
|
|
66
66
|
|
package/src/content/Chip/doc.mdx
CHANGED
|
@@ -11,19 +11,19 @@ The Chip component can be used to represent small blocks of information.
|
|
|
11
11
|
|
|
12
12
|
<code src="@digigov/ui/content/Chip/__stories__/Default.tsx" />
|
|
13
13
|
|
|
14
|
-
###
|
|
14
|
+
### Clickable Chip
|
|
15
15
|
|
|
16
16
|
<code src="@digigov/ui/content/Chip/__stories__/ClickableChip.tsx" />
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### Clickable and Deletable
|
|
19
19
|
|
|
20
20
|
<code src="@digigov/ui/content/Chip/__stories__/ClickableDeletableChip.tsx" />
|
|
21
21
|
|
|
22
|
-
###
|
|
22
|
+
### Deletable Chip
|
|
23
23
|
|
|
24
24
|
<code src="@digigov/ui/content/Chip/__stories__/DeletableChip.tsx" />
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Group of Chips
|
|
27
27
|
|
|
28
28
|
<code src="@digigov/ui/content/Chip/__stories__/GroupOfChips.tsx" />
|
|
29
29
|
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the ErrorSummary with sample data 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is some random warning text",
|
|
11
|
+
},
|
|
12
|
+
"type": Object {
|
|
13
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
14
|
+
"render": [Function],
|
|
15
|
+
},
|
|
16
|
+
}
|
|
7
17
|
`;
|
package/src/content/List/doc.mdx
CHANGED
|
@@ -9,15 +9,15 @@ title: List
|
|
|
9
9
|
|
|
10
10
|
<code src="@digigov/ui/content/List/__stories__/Default.tsx" />
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### With bullets
|
|
13
13
|
|
|
14
14
|
<code src="@digigov/ui/content/List/__stories__/BulletList.tsx" />
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### With numbers
|
|
17
17
|
|
|
18
18
|
<code src="@digigov/ui/content/List/__stories__/NumberedList.tsx" />
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### With extra space
|
|
21
21
|
|
|
22
22
|
<code src="@digigov/ui/content/List/__stories__/WithExtraSpace.tsx" />
|
|
23
23
|
|
|
@@ -10,7 +10,7 @@ export default {
|
|
|
10
10
|
import { SummaryListExample } from '@digigov/ui/content/SummaryList/__stories__/SummaryListExample';
|
|
11
11
|
import doc from './doc.mdx?raw';
|
|
12
12
|
|
|
13
|
-
export const
|
|
13
|
+
export const WithControls = {
|
|
14
14
|
args: {
|
|
15
15
|
sm: 5,
|
|
16
16
|
md: 4,
|
|
@@ -23,3 +23,7 @@ export const Default = {
|
|
|
23
23
|
showActions: true,
|
|
24
24
|
},
|
|
25
25
|
};
|
|
26
|
+
|
|
27
|
+
export { Default } from '@digigov/ui/content/SummaryList/__stories__/Default';
|
|
28
|
+
export { WithActions } from '@digigov/ui/content/SummaryList/__stories__/WithActions';
|
|
29
|
+
export { WithoutBorders } from '@digigov/ui/content/SummaryList/__stories__/WithoutBorders';
|
|
@@ -11,7 +11,7 @@ TaskList is a component that displays number of steps required to complete a pro
|
|
|
11
11
|
|
|
12
12
|
<code src="@digigov/ui/content/TaskList/__stories__/Default.tsx" />
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
### With dense style
|
|
15
15
|
|
|
16
16
|
<code src="@digigov/ui/content/TaskList/__stories__/Dense.tsx" />
|
|
17
17
|
|
|
@@ -13,7 +13,7 @@ User can better understand what has happened and also understand what the next s
|
|
|
13
13
|
|
|
14
14
|
<code src="@digigov/ui/content/Timeline/__stories__/Default.tsx" />
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
### With dense style
|
|
17
17
|
|
|
18
18
|
<code src="@digigov/ui/content/Timeline/__stories__/Dense.tsx" />
|
|
19
19
|
|
|
@@ -21,4 +21,4 @@ title: CopyToClipboard
|
|
|
21
21
|
|
|
22
22
|
See below for a complete reference to all of the props available to the components mentioned here.
|
|
23
23
|
|
|
24
|
-
<ComponentProps componentName={['CopyToClipboardContainer']} />
|
|
24
|
+
<ComponentProps componentName={['CopyToClipboardContainer']} />
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the ErrorSummary with sample data 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is some random warning text",
|
|
11
|
+
},
|
|
12
|
+
"type": Object {
|
|
13
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
14
|
+
"render": [Function],
|
|
15
|
+
},
|
|
16
|
+
}
|
|
7
17
|
`;
|
|
@@ -35,4 +35,4 @@ For questions that require a user to select one or more options from a list usin
|
|
|
35
35
|
|
|
36
36
|
See below for a complete reference to all of the props available to the components mentioned here.
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
<ComponentProps componentName={["ErrorSummary"]} />
|
|
@@ -15,16 +15,23 @@ export default {
|
|
|
15
15
|
|
|
16
16
|
export const WithControls = {
|
|
17
17
|
args: {
|
|
18
|
+
variant: 'info',
|
|
19
|
+
dense: false,
|
|
18
20
|
title: 'Ειδοποίηση',
|
|
19
21
|
children: ' Σε 7 ημέρες θα μπορείτε να υποβάλετε την αίτηση.',
|
|
20
22
|
link: {
|
|
21
23
|
label: 'Προβολή αίτησης',
|
|
22
24
|
href: '#',
|
|
23
25
|
},
|
|
24
|
-
variant: 'info',
|
|
25
|
-
dense: false,
|
|
26
26
|
},
|
|
27
27
|
argTypes: {
|
|
28
|
+
variant: {
|
|
29
|
+
options: ['info', 'success', 'error'],
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
},
|
|
32
|
+
dense: {
|
|
33
|
+
control: { type: 'boolean' },
|
|
34
|
+
},
|
|
28
35
|
title: {
|
|
29
36
|
control: { type: 'text' },
|
|
30
37
|
},
|
|
@@ -34,13 +41,6 @@ export const WithControls = {
|
|
|
34
41
|
link: {
|
|
35
42
|
control: { type: 'object' },
|
|
36
43
|
},
|
|
37
|
-
variant: {
|
|
38
|
-
options: ['info', 'success', 'error'],
|
|
39
|
-
control: { type: 'select' },
|
|
40
|
-
},
|
|
41
|
-
dense: {
|
|
42
|
-
control: { type: 'boolean' },
|
|
43
|
-
},
|
|
44
44
|
},
|
|
45
45
|
parameters: {
|
|
46
46
|
controls: { exclude: ['ref'] },
|
|
@@ -50,3 +50,4 @@ export const WithControls = {
|
|
|
50
50
|
export { Default } from '@digigov/ui/feedback/NotificationBanner/__stories__/Default';
|
|
51
51
|
export { Success } from '@digigov/ui/feedback/NotificationBanner/__stories__/Success';
|
|
52
52
|
export { Dense } from '@digigov/ui/feedback/NotificationBanner/__stories__/Dense';
|
|
53
|
+
export { Expanded } from '@digigov/ui/feedback/NotificationBanner/__stories__/Expanded';
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the notification banner 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is a notification",
|
|
11
|
+
"title": "Notification Banner Example",
|
|
12
|
+
},
|
|
13
|
+
"type": [Function],
|
|
14
|
+
}
|
|
9
15
|
`;
|
|
10
16
|
|
|
11
17
|
exports[`renders the notification banner with title and link 1`] = `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
Object {
|
|
19
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
20
|
+
"_owner": null,
|
|
21
|
+
"_store": Object {},
|
|
22
|
+
"key": null,
|
|
23
|
+
"props": Object {
|
|
24
|
+
"children": "this is a notification",
|
|
25
|
+
"link": Object {
|
|
15
26
|
"href": "/",
|
|
16
27
|
"label": "This is a label",
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</NotificationBanner>
|
|
28
|
+
},
|
|
29
|
+
"title": "Notification Banner Example",
|
|
30
|
+
},
|
|
31
|
+
"type": [Function],
|
|
32
|
+
}
|
|
23
33
|
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
NotificationBannerContainer,
|
|
4
|
+
NotificationBannerHeader,
|
|
5
|
+
NotificationBannerContent,
|
|
6
|
+
NotificationBannerHeading,
|
|
7
|
+
NotificationBannerLink,
|
|
8
|
+
} from '@digigov/ui/feedback/NotificationBanner';
|
|
9
|
+
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
10
|
+
|
|
11
|
+
export const Expanded = (_: any) => (
|
|
12
|
+
<NotificationBannerContainer>
|
|
13
|
+
<NotificationBannerHeader>Ειδοποίηση</NotificationBannerHeader>
|
|
14
|
+
<NotificationBannerContent>
|
|
15
|
+
<NotificationBannerHeading>
|
|
16
|
+
Μπορείτε να συμβάλλετε στη βελτίωση των δημοσίων υπηρεσιών.
|
|
17
|
+
</NotificationBannerHeading>
|
|
18
|
+
<Paragraph>
|
|
19
|
+
Συμπληρώστε έως 24/5 το ερωτηματολόγιο στο{' '}
|
|
20
|
+
<NotificationBannerLink> axiologisi.ypes.gov.gr</NotificationBannerLink>
|
|
21
|
+
.
|
|
22
|
+
</Paragraph>
|
|
23
|
+
</NotificationBannerContent>
|
|
24
|
+
</NotificationBannerContainer>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default Expanded;
|
|
@@ -13,9 +13,6 @@ Use a notification banner to tell the user about something they need to know abo
|
|
|
13
13
|
|
|
14
14
|
Use a ‘neutral’ blue notification banner if the user needs to know about a problem with the service as a whole.
|
|
15
15
|
|
|
16
|
-
Use a ‘neutral’ notification banner if the user needs to know about something that’s happening elsewhere in the service.
|
|
17
|
-
|
|
18
|
-
## How to use
|
|
19
16
|
|
|
20
17
|
<code src="@digigov/ui/feedback/NotificationBanner/__stories__/Default.tsx" />
|
|
21
18
|
|
|
@@ -29,8 +26,20 @@ You can also use a notification banner to tell the user about the outcome of som
|
|
|
29
26
|
|
|
30
27
|
<code src="@digigov/ui/feedback/NotificationBanner/__stories__/Dense.tsx" />
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
### Expanded
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
<code src="@digigov/ui/feedback/NotificationBanner/__stories__/Expanded.tsx" />
|
|
32
|
+
|
|
33
|
+
## API
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
36
|
+
|
|
37
|
+
<ComponentProps
|
|
38
|
+
componentName={[
|
|
39
|
+
'NotificationBannerContainer',
|
|
40
|
+
'NotificationBannerContent',
|
|
41
|
+
'NotificationBannerHeader',
|
|
42
|
+
'NotificationBannerHeading',
|
|
43
|
+
'NotificationBannerLink',
|
|
44
|
+
]}
|
|
45
|
+
/>
|
|
@@ -3,6 +3,7 @@ import { test, expect } from '@playwright/experimental-ct-react';
|
|
|
3
3
|
import TestVariant from '@digigov/ui/utils/TestVariant'
|
|
4
4
|
import { Default } from '@digigov/ui/feedback/NotificationBanner/__stories__/Default';
|
|
5
5
|
import { Dense } from '@digigov/ui/feedback/NotificationBanner/__stories__/Dense';
|
|
6
|
+
import { Expanded } from '@digigov/ui/feedback/NotificationBanner/__stories__/Expanded';
|
|
6
7
|
import { Success } from '@digigov/ui/feedback/NotificationBanner/__stories__/Success';
|
|
7
8
|
|
|
8
9
|
test('renders the All NotificationBanner variants', async ({ mount, page }) => {
|
|
@@ -15,6 +16,9 @@ test('renders the All NotificationBanner variants', async ({ mount, page }) => {
|
|
|
15
16
|
<TestVariant title="Dense">
|
|
16
17
|
<Dense />
|
|
17
18
|
</TestVariant>
|
|
19
|
+
<TestVariant title="Expanded">
|
|
20
|
+
<Expanded />
|
|
21
|
+
</TestVariant>
|
|
18
22
|
<TestVariant title="Success">
|
|
19
23
|
<Success />
|
|
20
24
|
</TestVariant>
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
2
|
|
|
3
3
|
exports[`renders the WarningText with sample data 1`] = `
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
Object {
|
|
5
|
+
"$$typeof": Symbol(react.transitional.element),
|
|
6
|
+
"_owner": null,
|
|
7
|
+
"_store": Object {},
|
|
8
|
+
"key": null,
|
|
9
|
+
"props": Object {
|
|
10
|
+
"children": "this is some random warning text",
|
|
11
|
+
},
|
|
12
|
+
"type": Object {
|
|
13
|
+
"$$typeof": Symbol(react.forward_ref),
|
|
14
|
+
"render": [Function],
|
|
15
|
+
},
|
|
16
|
+
}
|
|
7
17
|
`;
|
|
@@ -15,11 +15,14 @@ export const WithControls = {
|
|
|
15
15
|
render: (args) => {
|
|
16
16
|
return (
|
|
17
17
|
<AutoComplete
|
|
18
|
+
defaultValue={args.defaultValue}
|
|
18
19
|
key={args.multiple ? 'multiple' : 'single'}
|
|
19
20
|
id={args.id}
|
|
20
21
|
width={args.width}
|
|
21
22
|
multiple={args.multiple}
|
|
22
23
|
autoselect={args.autoselect}
|
|
24
|
+
placeholder={args.placeholder}
|
|
25
|
+
hint={args.hint}
|
|
23
26
|
minLength={args.minLength}
|
|
24
27
|
source={suggest}
|
|
25
28
|
/>
|
|
@@ -28,8 +31,10 @@ export const WithControls = {
|
|
|
28
31
|
args: {
|
|
29
32
|
width: 'full',
|
|
30
33
|
id: 'autocomplete-id',
|
|
31
|
-
multiple: false,
|
|
32
34
|
autoselect: false,
|
|
35
|
+
multiple: false,
|
|
36
|
+
hint: false,
|
|
37
|
+
placeholder: '',
|
|
33
38
|
minLength: 2,
|
|
34
39
|
numberOfSelected: 2,
|
|
35
40
|
defaultValue: '',
|
|
@@ -44,12 +49,21 @@ export const WithControls = {
|
|
|
44
49
|
id: {
|
|
45
50
|
control: { type: 'text' },
|
|
46
51
|
},
|
|
52
|
+
autoselect: {
|
|
53
|
+
control: { type: 'boolean' },
|
|
54
|
+
if: { arg: 'multiple', eq: false },
|
|
55
|
+
},
|
|
47
56
|
multiple: {
|
|
48
57
|
control: { type: 'boolean' },
|
|
58
|
+
if: { arg: 'autoselect', eq: false },
|
|
49
59
|
},
|
|
50
|
-
|
|
60
|
+
hint: {
|
|
51
61
|
control: { type: 'boolean' },
|
|
52
62
|
},
|
|
63
|
+
placeholder: {
|
|
64
|
+
control: { type: 'text' },
|
|
65
|
+
if: { arg: 'hint', eq: false },
|
|
66
|
+
},
|
|
53
67
|
minLength: {
|
|
54
68
|
control: { type: 'number' },
|
|
55
69
|
},
|
|
@@ -58,7 +72,7 @@ export const WithControls = {
|
|
|
58
72
|
if: { arg: 'multiple', eq: true },
|
|
59
73
|
},
|
|
60
74
|
defaultValue: {
|
|
61
|
-
control: { type: '
|
|
75
|
+
control: { type: 'text' },
|
|
62
76
|
},
|
|
63
77
|
},
|
|
64
78
|
parameters: {
|
|
@@ -72,7 +86,6 @@ export const WithControls = {
|
|
|
72
86
|
'tAssistiveHint',
|
|
73
87
|
'templates',
|
|
74
88
|
'name',
|
|
75
|
-
'placeholder',
|
|
76
89
|
'onConfirm',
|
|
77
90
|
'confirmOnBlur',
|
|
78
91
|
'required',
|
|
@@ -89,6 +102,8 @@ export { MultipleShowingTwoSelected } from '@digigov/ui/form/AutoComplete/__stor
|
|
|
89
102
|
export { MultipleWithMinLength } from '@digigov/ui/form/AutoComplete/__stories__/MultipleWithMinLength';
|
|
90
103
|
export { WithAutoSelect } from '@digigov/ui/form/AutoComplete/__stories__/WithAutoSelect';
|
|
91
104
|
export { WithDefaultValue } from '@digigov/ui/form/AutoComplete/__stories__/WithDefaultValue';
|
|
105
|
+
export { WithCustomValue } from '@digigov/ui/form/AutoComplete/__stories__/WithCustomValue';
|
|
106
|
+
export { WithHint } from '@digigov/ui/form/AutoComplete/__stories__/WithHint';
|
|
92
107
|
export { WithPlaceHolder } from '@digigov/ui/form/AutoComplete/__stories__/WithPlaceHolder';
|
|
93
108
|
export { WithShowAllValues } from '@digigov/ui/form/AutoComplete/__stories__/WithShowAllValues';
|
|
94
109
|
export { WithMinLength } from '@digigov/ui/form/AutoComplete/__stories__/WithMinLength';
|
|
@@ -7,23 +7,7 @@ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
|
7
7
|
export const WithAutoSelect = (_: any) => (
|
|
8
8
|
<div>
|
|
9
9
|
<FieldContainer>
|
|
10
|
-
<AutoComplete
|
|
11
|
-
source={suggest}
|
|
12
|
-
autoselect={true}
|
|
13
|
-
id="govgr"
|
|
14
|
-
// tStatusResults={(x, y) => {
|
|
15
|
-
// return `Results x: ${x} y: ${y}`;
|
|
16
|
-
// }}
|
|
17
|
-
templates={{
|
|
18
|
-
suggestion: (value) => {
|
|
19
|
-
return '--> ' + value;
|
|
20
|
-
},
|
|
21
|
-
inputValue: (value) => {
|
|
22
|
-
return value ? 'Χώρα: ' + value : '';
|
|
23
|
-
},
|
|
24
|
-
}}
|
|
25
|
-
tNoResults={() => 'Δεν υπάρχουν αποτελέσματα'}
|
|
26
|
-
/>
|
|
10
|
+
<AutoComplete source={suggest} autoselect={true} id="govgr" />
|
|
27
11
|
</FieldContainer>
|
|
28
12
|
<Button>Υποβολή</Button>
|
|
29
13
|
</div>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoComplete } from '@digigov/ui/form/AutoComplete';
|
|
3
|
+
import { suggest } from '@digigov/ui/form/AutoComplete/utils';
|
|
4
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
5
|
+
import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
6
|
+
|
|
7
|
+
export const WithCustomValue = () => (
|
|
8
|
+
<div>
|
|
9
|
+
<FieldContainer>
|
|
10
|
+
<AutoComplete
|
|
11
|
+
source={suggest}
|
|
12
|
+
id="govgr"
|
|
13
|
+
templates={{
|
|
14
|
+
suggestion: (value) => {
|
|
15
|
+
return '--> ' + value;
|
|
16
|
+
},
|
|
17
|
+
inputValue: (value) => {
|
|
18
|
+
return value ? 'Χώρα: ' + value : '';
|
|
19
|
+
},
|
|
20
|
+
}}
|
|
21
|
+
tNoResults={() => 'Δεν υπάρχουν αποτελέσματα'}
|
|
22
|
+
/>
|
|
23
|
+
</FieldContainer>
|
|
24
|
+
<Button>Υποβολή</Button>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default WithCustomValue;
|
|
@@ -7,12 +7,7 @@ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
|
7
7
|
export const WithDefaultValue = (_: any) => (
|
|
8
8
|
<div>
|
|
9
9
|
<FieldContainer>
|
|
10
|
-
<AutoComplete
|
|
11
|
-
source={suggest}
|
|
12
|
-
autoselect={true}
|
|
13
|
-
defaultValue="Γερμανία"
|
|
14
|
-
id="govgr"
|
|
15
|
-
/>
|
|
10
|
+
<AutoComplete source={suggest} defaultValue="Γερμανία" id="govgr" />
|
|
16
11
|
</FieldContainer>
|
|
17
12
|
<Button>Υποβολή</Button>
|
|
18
13
|
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AutoComplete } from '@digigov/ui/form/AutoComplete';
|
|
3
|
+
import { suggest } from '@digigov/ui/form/AutoComplete/utils';
|
|
4
|
+
import { Button } from '@digigov/ui/form/Button';
|
|
5
|
+
import { FieldContainer } from '@digigov/ui/form/FieldContainer';
|
|
6
|
+
|
|
7
|
+
export const WithHint = () => (
|
|
8
|
+
<div>
|
|
9
|
+
<FieldContainer>
|
|
10
|
+
<AutoComplete source={suggest} id="govgr" hint={true} />
|
|
11
|
+
</FieldContainer>
|
|
12
|
+
<Button>Υποβολή</Button>
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
export default WithHint;
|