@digigov/ui 0.31.0 → 0.32.0
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 +13 -1
- package/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
- package/admin/Drawer/__stories__/Default.js +2 -6
- package/core/Accordion/Accordion.stories.playwright.json +2 -2
- package/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
- package/core/NavList/NavList.stories.d.ts +1 -5
- package/core/NavList/NavList.stories.js +4 -60
- package/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
- package/core/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +0 -2
- package/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
- package/core/NavList/NavListAuto/NavListItemAuto.js +2 -7
- package/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
- package/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
- package/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
- package/core/NavList/NavListItem.js +2 -5
- package/core/NavList/NavListItemBase.js +1 -6
- package/core/NavList/NavMenuContainerContentList.js +3 -6
- package/core/NavList/__stories__/Default.js +4 -10
- package/core/NavList/__stories__/NavVerticalLayout.d.ts +2 -0
- package/core/NavList/__stories__/{NavHorizontalLayout.js → NavVerticalLayout.js} +9 -15
- package/core/NavList/index.d.ts +1 -0
- package/core/NavList/index.js +14 -0
- package/core/NavList/types.d.ts +0 -1
- package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.d.ts +13 -0
- package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +75 -0
- package/core/SingleCharacterInputContainer/__stories__/Default.d.ts +2 -0
- package/core/SingleCharacterInputContainer/__stories__/Default.js +46 -0
- package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.d.ts +2 -0
- package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +52 -0
- package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.d.ts +2 -0
- package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +58 -0
- package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.d.ts +2 -0
- package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +52 -0
- package/core/SingleCharacterInputContainer/index.d.ts +4 -0
- package/core/SingleCharacterInputContainer/index.js +44 -0
- package/core/SingleCharacterInputContainer/index.mdx +29 -0
- package/es/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
- package/es/admin/Drawer/__stories__/Default.js +2 -6
- package/es/core/Accordion/Accordion.stories.playwright.json +2 -2
- package/es/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
- package/es/core/NavList/NavList.stories.js +1 -5
- package/es/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
- package/es/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
- package/es/core/NavList/NavListAuto/NavListItemAuto.js +2 -6
- package/es/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
- package/es/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
- package/es/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
- package/es/core/NavList/NavListItem.js +2 -5
- package/es/core/NavList/NavListItemBase.js +1 -6
- package/es/core/NavList/NavMenuContainerContentList.js +3 -6
- package/es/core/NavList/__stories__/Default.js +4 -10
- package/{esm/core/NavList/__stories__/NavHorizontalLayout.js → es/core/NavList/__stories__/NavVerticalLayout.js} +7 -13
- package/es/core/NavList/index.js +1 -0
- package/es/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
- package/es/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
- package/es/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
- package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
- package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
- package/es/core/SingleCharacterInputContainer/index.js +4 -0
- package/es/core/SingleCharacterInputContainer/index.mdx +29 -0
- package/es/locales/el.js +4 -0
- package/es/registry.js +4 -0
- package/esm/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
- package/esm/admin/Drawer/__stories__/Default.js +2 -6
- package/esm/core/Accordion/Accordion.stories.playwright.json +2 -2
- package/esm/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
- package/esm/core/NavList/NavList.stories.js +1 -5
- package/esm/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
- package/esm/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
- package/esm/core/NavList/NavListAuto/NavListItemAuto.js +2 -6
- package/esm/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
- package/esm/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
- package/esm/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
- package/esm/core/NavList/NavListItem.js +2 -5
- package/esm/core/NavList/NavListItemBase.js +1 -6
- package/esm/core/NavList/NavMenuContainerContentList.js +3 -6
- package/esm/core/NavList/__stories__/Default.js +4 -10
- package/{es/core/NavList/__stories__/NavHorizontalLayout.js → esm/core/NavList/__stories__/NavVerticalLayout.js} +7 -13
- package/esm/core/NavList/index.js +1 -0
- package/esm/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
- package/esm/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
- package/esm/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
- package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
- package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
- package/esm/core/SingleCharacterInputContainer/index.js +4 -0
- package/esm/core/SingleCharacterInputContainer/index.mdx +29 -0
- package/esm/index.js +1 -1
- package/esm/locales/el.js +4 -0
- package/esm/registry.js +4 -0
- package/locales/el.d.ts +4 -0
- package/locales/el.js +4 -0
- package/package.json +3 -3
- package/registry.d.ts +3 -0
- package/registry.js +6 -0
- package/src/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
- package/src/admin/Drawer/__stories__/Default.tsx +2 -5
- package/src/core/Accordion/Accordion.stories.playwright.json +2 -2
- package/src/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
- package/src/core/NavList/NavList.stories.js +1 -5
- package/src/core/NavList/NavListAuto/NavListBaseAuto.tsx +1 -1
- package/src/core/NavList/NavListAuto/NavListItemAnchorAuto.tsx +1 -4
- package/src/core/NavList/NavListAuto/NavListItemAuto.tsx +2 -4
- package/src/core/NavList/NavListAuto/NavListItemButtonAuto.tsx +1 -1
- package/src/core/NavList/NavListAuto/NavListMenuAuto.tsx +2 -2
- package/src/core/NavList/NavListAuto/NavListSubMenuAuto.tsx +1 -1
- package/src/core/NavList/NavListItem.tsx +1 -2
- package/src/core/NavList/NavListItemBase.tsx +2 -5
- package/src/core/NavList/NavMenuContainerContentList.tsx +0 -2
- package/src/core/NavList/__stories__/Default.tsx +4 -7
- package/src/core/NavList/__stories__/{NavHorizontalLayout.tsx → NavVerticalLayout.tsx} +7 -10
- package/src/core/NavList/index.tsx +1 -0
- package/src/core/NavList/types.tsx +0 -1
- package/src/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +13 -0
- package/src/core/SingleCharacterInputContainer/__stories__/Default.tsx +35 -0
- package/src/core/SingleCharacterInputContainer/__stories__/WithDefaultError.tsx +38 -0
- package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.tsx +38 -0
- package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.tsx +38 -0
- package/src/core/SingleCharacterInputContainer/index.mdx +29 -0
- package/src/core/SingleCharacterInputContainer/index.tsx +4 -0
- package/src/locales/el.ts +4 -0
- package/src/registry.js +4 -0
- package/core/NavList/__stories__/NavHorizontalLayout.d.ts +0 -2
- package/core/NavList/__stories__/NavListEpathlaExample.d.ts +0 -2
- package/core/NavList/__stories__/NavListEpathlaExample.js +0 -153
- package/core/NavList/__stories__/NavListHorizontalAutoExample.d.ts +0 -2
- package/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -67
- package/core/NavList/__stories__/NavListSecondaryAutoExample.d.ts +0 -2
- package/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -281
- package/core/NavList/__stories__/NavListVerticalAutoExample.d.ts +0 -2
- package/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -67
- package/es/core/NavList/__stories__/NavListEpathlaExample.js +0 -135
- package/es/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -51
- package/es/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -255
- package/es/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -51
- package/esm/core/NavList/__stories__/NavListEpathlaExample.js +0 -135
- package/esm/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -51
- package/esm/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -255
- package/esm/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -51
- package/src/core/NavList/__stories__/NavListEpathlaExample.tsx +0 -195
- package/src/core/NavList/__stories__/NavListHorizontalAutoExample.tsx +0 -65
- package/src/core/NavList/__stories__/NavListSecondaryAutoExample.tsx +0 -284
- package/src/core/NavList/__stories__/NavListVerticalAutoExample.tsx +0 -65
|
@@ -34,13 +34,11 @@ const focusNavListItem = (e, nextItemIndex) => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const NavMenuContainerContentList: React.FC<NavMenuContainerContentListProps> = ({
|
|
37
|
-
layout,
|
|
38
37
|
children,
|
|
39
38
|
...props
|
|
40
39
|
}) => {
|
|
41
40
|
return (
|
|
42
41
|
<NavMenuContainerContentListWrapper
|
|
43
|
-
layout={layout}
|
|
44
42
|
{...props}
|
|
45
43
|
onKeyDown={(event) => {
|
|
46
44
|
switch (event.key) {
|
|
@@ -45,7 +45,7 @@ const links = [
|
|
|
45
45
|
];
|
|
46
46
|
|
|
47
47
|
export const Default = () => {
|
|
48
|
-
const layout = '
|
|
48
|
+
const layout = 'horizontal';
|
|
49
49
|
const border = false;
|
|
50
50
|
const { container, registerButton, registerLink } = useNavList();
|
|
51
51
|
|
|
@@ -59,11 +59,10 @@ export const Default = () => {
|
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<Nav open={true} layout={layout} border={border} aria-orientation={layout}>
|
|
62
|
-
<NavList
|
|
62
|
+
<NavList>
|
|
63
63
|
{links.map((item, key) => (
|
|
64
64
|
<React.Fragment key={key}>
|
|
65
65
|
<NavListItem
|
|
66
|
-
layout={layout}
|
|
67
66
|
link={item}
|
|
68
67
|
setRegisterButton={setRegisterButton}
|
|
69
68
|
setRegisterLink={setRegisterLink}
|
|
@@ -74,11 +73,9 @@ export const Default = () => {
|
|
|
74
73
|
paddingLeft={5}
|
|
75
74
|
paddingRight={5}
|
|
76
75
|
>
|
|
77
|
-
<NavMenuContainerTitle
|
|
78
|
-
{item.label}
|
|
79
|
-
</NavMenuContainerTitle>
|
|
76
|
+
<NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
|
|
80
77
|
<NavMenuContainerContent>
|
|
81
|
-
<NavMenuContainerContentList role="menu"
|
|
78
|
+
<NavMenuContainerContentList role="menu">
|
|
82
79
|
{item.subMenu?.map((subMenu, menuIndex) => {
|
|
83
80
|
return (
|
|
84
81
|
isNavListItemLinkInterface(subMenu) && (
|
|
@@ -40,9 +40,9 @@ const links = [
|
|
|
40
40
|
{ name: 'Nav3', href: '#', label: 'Nav list item 3' },
|
|
41
41
|
];
|
|
42
42
|
|
|
43
|
-
export const
|
|
44
|
-
const layout = '
|
|
45
|
-
const border =
|
|
43
|
+
export const NavVerticalLayout = () => {
|
|
44
|
+
const layout = 'vertical';
|
|
45
|
+
const border = false;
|
|
46
46
|
const { container, registerButton, registerLink } = useNavList();
|
|
47
47
|
|
|
48
48
|
const setRegisterButton = (name: string) => {
|
|
@@ -55,11 +55,10 @@ export const NavHorizontalLayout = () => {
|
|
|
55
55
|
|
|
56
56
|
return (
|
|
57
57
|
<Nav open={true} layout={layout} border={border}>
|
|
58
|
-
<NavList
|
|
58
|
+
<NavList>
|
|
59
59
|
{links.map((item, key) => (
|
|
60
60
|
<React.Fragment key={key}>
|
|
61
61
|
<NavListItem
|
|
62
|
-
layout={layout}
|
|
63
62
|
link={item}
|
|
64
63
|
setRegisterButton={setRegisterButton}
|
|
65
64
|
setRegisterLink={setRegisterLink}
|
|
@@ -70,11 +69,9 @@ export const NavHorizontalLayout = () => {
|
|
|
70
69
|
paddingLeft={5}
|
|
71
70
|
paddingRight={5}
|
|
72
71
|
>
|
|
73
|
-
<NavMenuContainerTitle
|
|
74
|
-
{item.label}
|
|
75
|
-
</NavMenuContainerTitle>
|
|
72
|
+
<NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
|
|
76
73
|
<NavMenuContainerContent>
|
|
77
|
-
<NavMenuContainerContentList role="menu"
|
|
74
|
+
<NavMenuContainerContentList role="menu">
|
|
78
75
|
{item.subMenu?.map((subMenu, menuIndex) => {
|
|
79
76
|
return (
|
|
80
77
|
isNavListItemLinkInterface(subMenu) && (
|
|
@@ -104,4 +101,4 @@ export const NavHorizontalLayout = () => {
|
|
|
104
101
|
);
|
|
105
102
|
};
|
|
106
103
|
|
|
107
|
-
export default
|
|
104
|
+
export default NavVerticalLayout;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export * from '@digigov/ui/core/NavList/NavListItem';
|
|
2
|
+
export * from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
|
|
2
3
|
export * from '@digigov/ui/core/NavList/NavListAuto/NavListAuto';
|
|
3
4
|
export * from '@digigov/ui/core/NavList/NavListAuto/NavListContextAuto';
|
|
4
5
|
export * from '@digigov/ui/core/NavList/Nav';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import SingleCharacterInputContainer from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Digigov UI/core/SingleCharacterInputContainer',
|
|
4
|
+
description:
|
|
5
|
+
'Use the One-time password input component to help users enter a memorable digital character for One-time password.',
|
|
6
|
+
link: 'https://guide.services.gov.gr/docs/patterns/one-time-password',
|
|
7
|
+
component: SingleCharacterInputContainer,
|
|
8
|
+
displayName: 'SingleCharacterInputContainer',
|
|
9
|
+
};
|
|
10
|
+
export * from '@digigov/ui/core/SingleCharacterInputContainer/__stories__/Default';
|
|
11
|
+
export * from '@digigov/ui/core/SingleCharacterInputContainer/__stories__/WithDefaultError';
|
|
12
|
+
export * from '@digigov/ui/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode';
|
|
13
|
+
export * from '@digigov/ui/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
SingleCharacterInputContainer,
|
|
5
|
+
SingleCharacterInputItem,
|
|
6
|
+
} from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
FieldContainer,
|
|
10
|
+
Fieldset,
|
|
11
|
+
FieldsetLegend,
|
|
12
|
+
} from '@digigov/ui/core/FieldContainer';
|
|
13
|
+
|
|
14
|
+
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
15
|
+
|
|
16
|
+
export const Default = () => (
|
|
17
|
+
<FieldContainer>
|
|
18
|
+
<Fieldset>
|
|
19
|
+
<FieldsetLegend heading>Κωδικός Επιβεβαίωσης</FieldsetLegend>
|
|
20
|
+
<Paragraph>
|
|
21
|
+
Εισάγετε τον μοναδικό κωδικό που λάβατε στο ηλεκτρονικό σας ταχυδρομείο
|
|
22
|
+
</Paragraph>
|
|
23
|
+
<SingleCharacterInputContainer>
|
|
24
|
+
<SingleCharacterInputItem name="first-digit" value={4} />
|
|
25
|
+
<SingleCharacterInputItem name="second-digit" value={4} />
|
|
26
|
+
<SingleCharacterInputItem name="third-digit" value={5} />
|
|
27
|
+
<SingleCharacterInputItem name="forth-digit" value={1} />
|
|
28
|
+
<SingleCharacterInputItem name="fifth-digit" value={2} />
|
|
29
|
+
<SingleCharacterInputItem name="sixth-digit" value={3} />
|
|
30
|
+
</SingleCharacterInputContainer>
|
|
31
|
+
</Fieldset>
|
|
32
|
+
</FieldContainer>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default Default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SingleCharacterInputContainer,
|
|
4
|
+
SingleCharacterInputItem,
|
|
5
|
+
} from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
6
|
+
import {
|
|
7
|
+
FieldContainer,
|
|
8
|
+
Fieldset,
|
|
9
|
+
FieldsetLegend,
|
|
10
|
+
} from '@digigov/ui/core/FieldContainer';
|
|
11
|
+
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
12
|
+
import { ErrorMessage } from '@digigov/ui/core/ErrorMessage';
|
|
13
|
+
import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
|
|
14
|
+
|
|
15
|
+
export const WithDefaultError = () => (
|
|
16
|
+
<FieldContainer error>
|
|
17
|
+
<Fieldset>
|
|
18
|
+
<FieldsetLegend heading>Κωδικός Επιβεβαίωσης</FieldsetLegend>
|
|
19
|
+
<Paragraph>
|
|
20
|
+
Εισάγετε τον μοναδικό κωδικό που λάβατε στο ηλεκτρονικό σας ταχυδρομείο
|
|
21
|
+
</Paragraph>
|
|
22
|
+
<ErrorMessage>
|
|
23
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
24
|
+
Το πεδίο είναι υποχρεωτικό.
|
|
25
|
+
</ErrorMessage>
|
|
26
|
+
<SingleCharacterInputContainer>
|
|
27
|
+
<SingleCharacterInputItem name="first-digit" error />
|
|
28
|
+
<SingleCharacterInputItem name="second-digit" error />
|
|
29
|
+
<SingleCharacterInputItem name="third-digit" error />
|
|
30
|
+
<SingleCharacterInputItem name="forth-digit" error />
|
|
31
|
+
<SingleCharacterInputItem name="fifth-digit" error />
|
|
32
|
+
<SingleCharacterInputItem name="sixth-digit" error />
|
|
33
|
+
</SingleCharacterInputContainer>
|
|
34
|
+
</Fieldset>
|
|
35
|
+
</FieldContainer>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default WithDefaultError;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SingleCharacterInputContainer,
|
|
4
|
+
SingleCharacterInputItem,
|
|
5
|
+
} from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
6
|
+
import {
|
|
7
|
+
FieldContainer,
|
|
8
|
+
Fieldset,
|
|
9
|
+
FieldsetLegend,
|
|
10
|
+
} from '@digigov/ui/core/FieldContainer';
|
|
11
|
+
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
12
|
+
import { ErrorMessage } from '@digigov/ui/core/ErrorMessage';
|
|
13
|
+
import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
|
|
14
|
+
|
|
15
|
+
export const WithErrorMessageInvalidCode = () => (
|
|
16
|
+
<FieldContainer error>
|
|
17
|
+
<Fieldset>
|
|
18
|
+
<FieldsetLegend heading>Κωδικός Επιβεβαίωσης</FieldsetLegend>
|
|
19
|
+
<Paragraph>
|
|
20
|
+
Εισάγετε τον μοναδικό κωδικό που λάβατε στο ηλεκτρονικό σας ταχυδρομείο
|
|
21
|
+
</Paragraph>
|
|
22
|
+
<ErrorMessage>
|
|
23
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
24
|
+
Έχετε εισάγει λάθος κωδικό.
|
|
25
|
+
</ErrorMessage>
|
|
26
|
+
<SingleCharacterInputContainer>
|
|
27
|
+
<SingleCharacterInputItem name="first-digit" value={4} error />
|
|
28
|
+
<SingleCharacterInputItem name="second-digit" value={4} error />
|
|
29
|
+
<SingleCharacterInputItem name="third-digit" value={5} error />
|
|
30
|
+
<SingleCharacterInputItem name="forth-digit" value={1} error />
|
|
31
|
+
<SingleCharacterInputItem name="fifth-digit" value={2} error />
|
|
32
|
+
<SingleCharacterInputItem name="sixth-digit" value={3} error />
|
|
33
|
+
</SingleCharacterInputContainer>
|
|
34
|
+
</Fieldset>
|
|
35
|
+
</FieldContainer>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default WithErrorMessageInvalidCode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SingleCharacterInputContainer,
|
|
4
|
+
SingleCharacterInputItem,
|
|
5
|
+
} from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
6
|
+
import {
|
|
7
|
+
FieldContainer,
|
|
8
|
+
Fieldset,
|
|
9
|
+
FieldsetLegend,
|
|
10
|
+
} from '@digigov/ui/core/FieldContainer';
|
|
11
|
+
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
12
|
+
import { ErrorMessage } from '@digigov/ui/core/ErrorMessage';
|
|
13
|
+
import { VisuallyHidden } from '@digigov/ui/core/VisuallyHidden';
|
|
14
|
+
|
|
15
|
+
export const WithErrorMessageLessDigit = () => (
|
|
16
|
+
<FieldContainer error>
|
|
17
|
+
<Fieldset>
|
|
18
|
+
<FieldsetLegend heading>Κωδικός Επιβεβαίωσης</FieldsetLegend>
|
|
19
|
+
<Paragraph>
|
|
20
|
+
Εισάγετε τον μοναδικό κωδικό που λάβατε στο ηλεκτρονικό σας ταχυδρομείο
|
|
21
|
+
</Paragraph>
|
|
22
|
+
<ErrorMessage>
|
|
23
|
+
<VisuallyHidden>Λάθος:</VisuallyHidden>
|
|
24
|
+
Έχετε συμπληρώσει λιγότερα από 6 ψηφία..
|
|
25
|
+
</ErrorMessage>
|
|
26
|
+
<SingleCharacterInputContainer>
|
|
27
|
+
<SingleCharacterInputItem name="first-digit" value="6" />
|
|
28
|
+
<SingleCharacterInputItem name="second-digit" value="4" />
|
|
29
|
+
<SingleCharacterInputItem name="third-digit" value="5" />
|
|
30
|
+
<SingleCharacterInputItem name="forth-digit" error />
|
|
31
|
+
<SingleCharacterInputItem name="fifth-digit" error />
|
|
32
|
+
<SingleCharacterInputItem name="sixth-digit" error />
|
|
33
|
+
</SingleCharacterInputContainer>
|
|
34
|
+
</Fieldset>
|
|
35
|
+
</FieldContainer>
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export default WithErrorMessageLessDigit;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: otp-input
|
|
3
|
+
title: SingleCharacterInputContainer
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SingleCharacterInputItem
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
import SingleCharacterInputContainer from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## How to use
|
|
13
|
+
|
|
14
|
+
<Story
|
|
15
|
+
packageName="@digigov/ui"
|
|
16
|
+
component="core/SingleCharacterInputContainer"
|
|
17
|
+
story="Default.tsx"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Error message
|
|
22
|
+
|
|
23
|
+
If you’re highlighting the whole date, style all the fields like this:
|
|
24
|
+
|
|
25
|
+
<Story
|
|
26
|
+
packageName="@digigov/ui"
|
|
27
|
+
component="core/SingleCharacterInputContainer"
|
|
28
|
+
story="WithDefaultError.tsx"
|
|
29
|
+
/>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from '@digigov/react-core/SingleCharacterInputContainer';
|
|
2
|
+
export * from '@digigov/react-core/SingleCharacterInputItem';
|
|
3
|
+
import SingleCharacterInputContainer from '@digigov/react-core/SingleCharacterInputContainer';
|
|
4
|
+
export default SingleCharacterInputContainer;
|
package/src/locales/el.ts
CHANGED
|
@@ -33,6 +33,10 @@ export default {
|
|
|
33
33
|
earlier_than: 'Συμπληρώστε μια ημερομηνία προγενέστερη της {{maxDate}}',
|
|
34
34
|
later_than: 'Συμπληρώστε μια ημερομηνία μεταγενέστερη της {{minDate}}',
|
|
35
35
|
},
|
|
36
|
+
otp: {
|
|
37
|
+
invalid: 'Ο κωδικός που έχετε εισάγει είναι λάθος.',
|
|
38
|
+
less_than: 'Έχετε συμπληρώσει λιγότερα από {{maxLength}} ψηφία.',
|
|
39
|
+
},
|
|
36
40
|
},
|
|
37
41
|
},
|
|
38
42
|
button: {
|
package/src/registry.js
CHANGED
|
@@ -123,6 +123,7 @@ import * as _digigov_ui_core_RadioContainer from '@digigov/ui/core/RadioContaine
|
|
|
123
123
|
import * as _digigov_ui_core_SectionBreak from '@digigov/ui/core/SectionBreak';
|
|
124
124
|
import * as _digigov_ui_core_SelectContainer from '@digigov/ui/core/SelectContainer';
|
|
125
125
|
import * as _digigov_ui_core_ServiceBadge from '@digigov/ui/core/ServiceBadge';
|
|
126
|
+
import * as _digigov_ui_core_SingleCharacterInputContainer from '@digigov/ui/core/SingleCharacterInputContainer';
|
|
126
127
|
import * as _digigov_ui_core_SkipLink from '@digigov/ui/core/SkipLink';
|
|
127
128
|
import * as _digigov_ui_core_SummaryList from '@digigov/ui/core/SummaryList';
|
|
128
129
|
import * as _digigov_ui_core_SvgIcon from '@digigov/ui/core/SvgIcon';
|
|
@@ -337,6 +338,7 @@ export default {
|
|
|
337
338
|
'@digigov/ui/core/SectionBreak': lazyImport(_digigov_ui_core_SectionBreak),
|
|
338
339
|
'@digigov/ui/core/SelectContainer': lazyImport(_digigov_ui_core_SelectContainer),
|
|
339
340
|
'@digigov/ui/core/ServiceBadge': lazyImport(_digigov_ui_core_ServiceBadge),
|
|
341
|
+
'@digigov/ui/core/SingleCharacterInputContainer': lazyImport(_digigov_ui_core_SingleCharacterInputContainer),
|
|
340
342
|
'@digigov/ui/core/SkipLink': lazyImport(_digigov_ui_core_SkipLink),
|
|
341
343
|
'@digigov/ui/core/SummaryList': lazyImport(_digigov_ui_core_SummaryList),
|
|
342
344
|
'@digigov/ui/core/SvgIcon': lazyImport(_digigov_ui_core_SvgIcon),
|
|
@@ -447,6 +449,7 @@ import * as _digigov_ui_core_NotificationBanner_NotificationBanner_stories from
|
|
|
447
449
|
import * as _digigov_ui_core_PhaseBanner_PhaseBanner_stories from '@digigov/ui/core/PhaseBanner/PhaseBanner.stories';
|
|
448
450
|
import * as _digigov_ui_core_RadioContainer_RadioContainer_stories from '@digigov/ui/core/RadioContainer/RadioContainer.stories';
|
|
449
451
|
import * as _digigov_ui_core_SelectContainer_Select_stories from '@digigov/ui/core/SelectContainer/Select.stories';
|
|
452
|
+
import * as _digigov_ui_core_SingleCharacterInputContainer_SingleCharacterInputContainer_stories from '@digigov/ui/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories';
|
|
450
453
|
import * as _digigov_ui_core_SummaryList_SummaryList_stories from '@digigov/ui/core/SummaryList/SummaryList.stories';
|
|
451
454
|
import * as _digigov_ui_core_Table_Table_stories from '@digigov/ui/core/Table/Table.stories';
|
|
452
455
|
import * as _digigov_ui_core_Tabs_Tabs_stories from '@digigov/ui/core/Tabs/Tabs.stories';
|
|
@@ -501,6 +504,7 @@ import * as _digigov_ui_typography_Paragraph_Paragraph_stories from '@digigov/ui
|
|
|
501
504
|
'@digigov/ui/core/PhaseBanner/PhaseBanner.stories': _digigov_ui_core_PhaseBanner_PhaseBanner_stories,
|
|
502
505
|
'@digigov/ui/core/RadioContainer/RadioContainer.stories': _digigov_ui_core_RadioContainer_RadioContainer_stories,
|
|
503
506
|
'@digigov/ui/core/SelectContainer/Select.stories': _digigov_ui_core_SelectContainer_Select_stories,
|
|
507
|
+
'@digigov/ui/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories': _digigov_ui_core_SingleCharacterInputContainer_SingleCharacterInputContainer_stories,
|
|
504
508
|
'@digigov/ui/core/SummaryList/SummaryList.stories': _digigov_ui_core_SummaryList_SummaryList_stories,
|
|
505
509
|
'@digigov/ui/core/Table/Table.stories': _digigov_ui_core_Table_Table_stories,
|
|
506
510
|
'@digigov/ui/core/Tabs/Tabs.stories': _digigov_ui_core_Tabs_Tabs_stories,
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.NavListEpathlaExample = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _NavList = require("@digigov/ui/core/NavList");
|
|
15
|
-
|
|
16
|
-
var _useNavList2 = require("@digigov/ui/hooks/useNavList");
|
|
17
|
-
|
|
18
|
-
var _core = require("@digigov/ui/core");
|
|
19
|
-
|
|
20
|
-
var LANG = 'el';
|
|
21
|
-
var DEFAULT_HREF_FLAG = true;
|
|
22
|
-
var epathlaLinks = [{
|
|
23
|
-
name: 'index',
|
|
24
|
-
href: DEFAULT_HREF_FLAG ? '#index' : "/".concat(LANG),
|
|
25
|
-
label: 'Αρχική'
|
|
26
|
-
}, {
|
|
27
|
-
name: 'epathla',
|
|
28
|
-
label: 'Ε.Π.ΑΘΛ.Α',
|
|
29
|
-
subMenu: [{
|
|
30
|
-
name: 'epathla/aim',
|
|
31
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/epathla/aim"),
|
|
32
|
-
label: 'Σκοπός'
|
|
33
|
-
}, {
|
|
34
|
-
name: 'epathla/structure',
|
|
35
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/epathla/structure"),
|
|
36
|
-
label: 'Δομή'
|
|
37
|
-
}, {
|
|
38
|
-
name: 'epathla/members',
|
|
39
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/epathla/members"),
|
|
40
|
-
label: 'Συγκρότηση'
|
|
41
|
-
}, {
|
|
42
|
-
name: 'epathla/wording-groups',
|
|
43
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/epathla/working-groups"),
|
|
44
|
-
label: 'Ομάδες εργασίας'
|
|
45
|
-
}]
|
|
46
|
-
}, {
|
|
47
|
-
name: 'sport-manipulation',
|
|
48
|
-
label: 'Χειραγώγηση Αγώνων',
|
|
49
|
-
subMenu: [{
|
|
50
|
-
name: 'sport-manipulation/macolin',
|
|
51
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/sport-manipulation/macolin"),
|
|
52
|
-
label: 'Σύμβαση Macolin'
|
|
53
|
-
}, {
|
|
54
|
-
name: 'sport-manipulation/terminology',
|
|
55
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/sport-manipulation/terminology"),
|
|
56
|
-
label: 'Ορολογία'
|
|
57
|
-
}, {
|
|
58
|
-
name: 'sport-manipulation/typology',
|
|
59
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/sport-manipulation/typology"),
|
|
60
|
-
label: 'Τυπολογία'
|
|
61
|
-
}, {
|
|
62
|
-
name: 'sport-manipulation/law',
|
|
63
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/sport-manipulation/law"),
|
|
64
|
-
label: 'Νομοθεσία'
|
|
65
|
-
}, {
|
|
66
|
-
name: 'sport-manipulation/documents',
|
|
67
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/sport-manipulation/documents"),
|
|
68
|
-
label: 'Κείμενα αναφοράς διεθνών οργανισμών'
|
|
69
|
-
}]
|
|
70
|
-
}, {
|
|
71
|
-
name: 'educational-material',
|
|
72
|
-
label: 'Εκπαιδευτικό υλικό',
|
|
73
|
-
subMenu: [{
|
|
74
|
-
name: 'educational-material/videos',
|
|
75
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/educational-material/videos"),
|
|
76
|
-
label: 'Βίντεο'
|
|
77
|
-
}, {
|
|
78
|
-
name: 'educational-material/presentations',
|
|
79
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/educational-material/presentations"),
|
|
80
|
-
label: 'Παρουσιάσεις'
|
|
81
|
-
}, {
|
|
82
|
-
name: 'educational-material/other-texts',
|
|
83
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/educational-material/other-texts"),
|
|
84
|
-
label: 'Άλλα κείμενα'
|
|
85
|
-
}]
|
|
86
|
-
}, {
|
|
87
|
-
name: 'news',
|
|
88
|
-
href: DEFAULT_HREF_FLAG ? '#news' : "/".concat(LANG, "/news"),
|
|
89
|
-
label: 'Νέα'
|
|
90
|
-
}, {
|
|
91
|
-
name: 'send-report',
|
|
92
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/send-report"),
|
|
93
|
-
label: 'Προστάτεψε το άθλημά σου'
|
|
94
|
-
}, {
|
|
95
|
-
name: 'links',
|
|
96
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/links"),
|
|
97
|
-
label: 'Σύνδεσμοι'
|
|
98
|
-
}, {
|
|
99
|
-
name: 'contact',
|
|
100
|
-
href: DEFAULT_HREF_FLAG ? '#' : "/".concat(LANG, "/contact"),
|
|
101
|
-
label: 'Επικοινωνία'
|
|
102
|
-
}];
|
|
103
|
-
|
|
104
|
-
var NavListEpathlaExample = function NavListEpathlaExample() {
|
|
105
|
-
var _useNavList = (0, _useNavList2.useNavList)(),
|
|
106
|
-
container = _useNavList.container,
|
|
107
|
-
registerButton = _useNavList.registerButton,
|
|
108
|
-
registerLink = _useNavList.registerLink;
|
|
109
|
-
|
|
110
|
-
var setRegisterButton = function setRegisterButton(name) {
|
|
111
|
-
return (0, _extends2["default"])({}, registerButton(name));
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
var setRegisterLink = function setRegisterLink(name) {
|
|
115
|
-
return (0, _extends2["default"])({}, registerLink(name));
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_NavList.NavListAuto, {
|
|
119
|
-
layout: 'horizontal',
|
|
120
|
-
links: epathlaLinks,
|
|
121
|
-
"aria-label": "Nav list"
|
|
122
|
-
}, epathlaLinks.map(function (item, key) {
|
|
123
|
-
var _container, _item$subMenu;
|
|
124
|
-
|
|
125
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
126
|
-
key: key
|
|
127
|
-
}, /*#__PURE__*/_react["default"].createElement(_NavList.NavListItem, {
|
|
128
|
-
link: item,
|
|
129
|
-
setRegisterButton: setRegisterButton,
|
|
130
|
-
setRegisterLink: setRegisterLink
|
|
131
|
-
}), (item === null || item === void 0 ? void 0 : item.subMenu) && /*#__PURE__*/_react["default"].createElement(_NavList.NavMenu, (0, _extends2["default"])({}, container(item.name), {
|
|
132
|
-
"aria-expanded": (_container = container(item.name)) === null || _container === void 0 ? void 0 : _container.active
|
|
133
|
-
}), /*#__PURE__*/_react["default"].createElement(_NavList.NavMenuContainer, {
|
|
134
|
-
paddingLeft: 5,
|
|
135
|
-
paddingRight: 5
|
|
136
|
-
}, /*#__PURE__*/_react["default"].createElement(_NavList.NavMenuContainerTitle, null, item.label), /*#__PURE__*/_react["default"].createElement(_NavList.NavMenuContainerContent, null, /*#__PURE__*/_react["default"].createElement(_NavList.NavMenuContainerContentList, {
|
|
137
|
-
role: "menu"
|
|
138
|
-
}, (_item$subMenu = item.subMenu) === null || _item$subMenu === void 0 ? void 0 : _item$subMenu.map(function (subMenu, menuIndex) {
|
|
139
|
-
return (0, _NavList.isNavListItemLinkInterface)(subMenu) && /*#__PURE__*/_react["default"].createElement(_NavList.NavMenuContainerContentListItem, {
|
|
140
|
-
key: menuIndex,
|
|
141
|
-
role: "presentation"
|
|
142
|
-
}, /*#__PURE__*/_react["default"].createElement(_core.Link, {
|
|
143
|
-
role: "menuitem",
|
|
144
|
-
id: "".concat(item.name, "-").concat(menuIndex),
|
|
145
|
-
href: subMenu.href
|
|
146
|
-
}, subMenu.label));
|
|
147
|
-
}))))));
|
|
148
|
-
})));
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
exports.NavListEpathlaExample = NavListEpathlaExample;
|
|
152
|
-
var _default = NavListEpathlaExample;
|
|
153
|
-
exports["default"] = _default;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports["default"] = exports.NavListHorizontalAutoExample = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _NavList = require("@digigov/ui/core/NavList");
|
|
13
|
-
|
|
14
|
-
var _NavListItemAuto = _interopRequireDefault(require("@digigov/ui/core/NavList/NavListAuto/NavListItemAuto"));
|
|
15
|
-
|
|
16
|
-
var links = [{
|
|
17
|
-
name: 'Nav1',
|
|
18
|
-
label: 'Nav list item 1',
|
|
19
|
-
href: '#'
|
|
20
|
-
}, {
|
|
21
|
-
name: 'Nav2',
|
|
22
|
-
label: 'Nav list item 2',
|
|
23
|
-
menu: {
|
|
24
|
-
title: 'This is the first Menu',
|
|
25
|
-
links: [{
|
|
26
|
-
name: 'Nav2.1',
|
|
27
|
-
label: 'link navigation',
|
|
28
|
-
href: '#'
|
|
29
|
-
}, {
|
|
30
|
-
name: 'Nav2.2',
|
|
31
|
-
label: 'link navigation',
|
|
32
|
-
href: '#'
|
|
33
|
-
}, {
|
|
34
|
-
name: 'Nav2.3',
|
|
35
|
-
label: 'link navigation',
|
|
36
|
-
href: '#'
|
|
37
|
-
}, {
|
|
38
|
-
name: 'Nav2.4',
|
|
39
|
-
label: 'link navigation',
|
|
40
|
-
href: '#'
|
|
41
|
-
}]
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
name: 'Nav3',
|
|
45
|
-
label: 'Nav list item 3',
|
|
46
|
-
href: '#'
|
|
47
|
-
}];
|
|
48
|
-
|
|
49
|
-
var NavListHorizontalAutoExample = function NavListHorizontalAutoExample() {
|
|
50
|
-
var layout = 'horizontal';
|
|
51
|
-
var border = true;
|
|
52
|
-
return /*#__PURE__*/_react["default"].createElement(_NavList.NavListAuto, {
|
|
53
|
-
layout: layout,
|
|
54
|
-
border: border,
|
|
55
|
-
links: links,
|
|
56
|
-
"aria-label": "Nav list"
|
|
57
|
-
}, links.map(function (item, key) {
|
|
58
|
-
return /*#__PURE__*/_react["default"].createElement(_NavListItemAuto["default"], {
|
|
59
|
-
key: key,
|
|
60
|
-
item: item
|
|
61
|
-
});
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
exports.NavListHorizontalAutoExample = NavListHorizontalAutoExample;
|
|
66
|
-
var _default = NavListHorizontalAutoExample;
|
|
67
|
-
exports["default"] = _default;
|