@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.
Files changed (142) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  3. package/admin/Drawer/__stories__/Default.js +2 -6
  4. package/core/Accordion/Accordion.stories.playwright.json +2 -2
  5. package/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  6. package/core/NavList/NavList.stories.d.ts +1 -5
  7. package/core/NavList/NavList.stories.js +4 -60
  8. package/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
  9. package/core/NavList/NavListAuto/NavListItemAnchorAuto.d.ts +0 -2
  10. package/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
  11. package/core/NavList/NavListAuto/NavListItemAuto.js +2 -7
  12. package/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
  13. package/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
  14. package/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
  15. package/core/NavList/NavListItem.js +2 -5
  16. package/core/NavList/NavListItemBase.js +1 -6
  17. package/core/NavList/NavMenuContainerContentList.js +3 -6
  18. package/core/NavList/__stories__/Default.js +4 -10
  19. package/core/NavList/__stories__/NavVerticalLayout.d.ts +2 -0
  20. package/core/NavList/__stories__/{NavHorizontalLayout.js → NavVerticalLayout.js} +9 -15
  21. package/core/NavList/index.d.ts +1 -0
  22. package/core/NavList/index.js +14 -0
  23. package/core/NavList/types.d.ts +0 -1
  24. package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.d.ts +13 -0
  25. package/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +75 -0
  26. package/core/SingleCharacterInputContainer/__stories__/Default.d.ts +2 -0
  27. package/core/SingleCharacterInputContainer/__stories__/Default.js +46 -0
  28. package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.d.ts +2 -0
  29. package/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +52 -0
  30. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.d.ts +2 -0
  31. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +58 -0
  32. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.d.ts +2 -0
  33. package/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +52 -0
  34. package/core/SingleCharacterInputContainer/index.d.ts +4 -0
  35. package/core/SingleCharacterInputContainer/index.js +44 -0
  36. package/core/SingleCharacterInputContainer/index.mdx +29 -0
  37. package/es/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  38. package/es/admin/Drawer/__stories__/Default.js +2 -6
  39. package/es/core/Accordion/Accordion.stories.playwright.json +2 -2
  40. package/es/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  41. package/es/core/NavList/NavList.stories.js +1 -5
  42. package/es/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
  43. package/es/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
  44. package/es/core/NavList/NavListAuto/NavListItemAuto.js +2 -6
  45. package/es/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
  46. package/es/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
  47. package/es/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
  48. package/es/core/NavList/NavListItem.js +2 -5
  49. package/es/core/NavList/NavListItemBase.js +1 -6
  50. package/es/core/NavList/NavMenuContainerContentList.js +3 -6
  51. package/es/core/NavList/__stories__/Default.js +4 -10
  52. package/{esm/core/NavList/__stories__/NavHorizontalLayout.js → es/core/NavList/__stories__/NavVerticalLayout.js} +7 -13
  53. package/es/core/NavList/index.js +1 -0
  54. package/es/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
  55. package/es/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
  56. package/es/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
  57. package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
  58. package/es/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
  59. package/es/core/SingleCharacterInputContainer/index.js +4 -0
  60. package/es/core/SingleCharacterInputContainer/index.mdx +29 -0
  61. package/es/locales/el.js +4 -0
  62. package/es/registry.js +4 -0
  63. package/esm/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  64. package/esm/admin/Drawer/__stories__/Default.js +2 -6
  65. package/esm/core/Accordion/Accordion.stories.playwright.json +2 -2
  66. package/esm/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  67. package/esm/core/NavList/NavList.stories.js +1 -5
  68. package/esm/core/NavList/NavListAuto/NavListBaseAuto.js +1 -3
  69. package/esm/core/NavList/NavListAuto/NavListItemAnchorAuto.js +2 -5
  70. package/esm/core/NavList/NavListAuto/NavListItemAuto.js +2 -6
  71. package/esm/core/NavList/NavListAuto/NavListItemButtonAuto.js +1 -3
  72. package/esm/core/NavList/NavListAuto/NavListMenuAuto.js +2 -5
  73. package/esm/core/NavList/NavListAuto/NavListSubMenuAuto.js +1 -3
  74. package/esm/core/NavList/NavListItem.js +2 -5
  75. package/esm/core/NavList/NavListItemBase.js +1 -6
  76. package/esm/core/NavList/NavMenuContainerContentList.js +3 -6
  77. package/esm/core/NavList/__stories__/Default.js +4 -10
  78. package/{es/core/NavList/__stories__/NavHorizontalLayout.js → esm/core/NavList/__stories__/NavVerticalLayout.js} +7 -13
  79. package/esm/core/NavList/index.js +1 -0
  80. package/esm/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +12 -0
  81. package/esm/core/SingleCharacterInputContainer/__stories__/Default.js +31 -0
  82. package/esm/core/SingleCharacterInputContainer/__stories__/WithDefaultError.js +35 -0
  83. package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.js +41 -0
  84. package/esm/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.js +35 -0
  85. package/esm/core/SingleCharacterInputContainer/index.js +4 -0
  86. package/esm/core/SingleCharacterInputContainer/index.mdx +29 -0
  87. package/esm/index.js +1 -1
  88. package/esm/locales/el.js +4 -0
  89. package/esm/registry.js +4 -0
  90. package/locales/el.d.ts +4 -0
  91. package/locales/el.js +4 -0
  92. package/package.json +3 -3
  93. package/registry.d.ts +3 -0
  94. package/registry.js +6 -0
  95. package/src/admin/CopyToClipboard/CopyToClipboard.stories.playwright.json +2 -2
  96. package/src/admin/Drawer/__stories__/Default.tsx +2 -5
  97. package/src/core/Accordion/Accordion.stories.playwright.json +2 -2
  98. package/src/core/ErrorSummary/ErrorSummary.stories.playwright.json +1 -1
  99. package/src/core/NavList/NavList.stories.js +1 -5
  100. package/src/core/NavList/NavListAuto/NavListBaseAuto.tsx +1 -1
  101. package/src/core/NavList/NavListAuto/NavListItemAnchorAuto.tsx +1 -4
  102. package/src/core/NavList/NavListAuto/NavListItemAuto.tsx +2 -4
  103. package/src/core/NavList/NavListAuto/NavListItemButtonAuto.tsx +1 -1
  104. package/src/core/NavList/NavListAuto/NavListMenuAuto.tsx +2 -2
  105. package/src/core/NavList/NavListAuto/NavListSubMenuAuto.tsx +1 -1
  106. package/src/core/NavList/NavListItem.tsx +1 -2
  107. package/src/core/NavList/NavListItemBase.tsx +2 -5
  108. package/src/core/NavList/NavMenuContainerContentList.tsx +0 -2
  109. package/src/core/NavList/__stories__/Default.tsx +4 -7
  110. package/src/core/NavList/__stories__/{NavHorizontalLayout.tsx → NavVerticalLayout.tsx} +7 -10
  111. package/src/core/NavList/index.tsx +1 -0
  112. package/src/core/NavList/types.tsx +0 -1
  113. package/src/core/SingleCharacterInputContainer/SingleCharacterInputContainer.stories.js +13 -0
  114. package/src/core/SingleCharacterInputContainer/__stories__/Default.tsx +35 -0
  115. package/src/core/SingleCharacterInputContainer/__stories__/WithDefaultError.tsx +38 -0
  116. package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageInvalidCode.tsx +38 -0
  117. package/src/core/SingleCharacterInputContainer/__stories__/WithErrorMessageLessDigit.tsx +38 -0
  118. package/src/core/SingleCharacterInputContainer/index.mdx +29 -0
  119. package/src/core/SingleCharacterInputContainer/index.tsx +4 -0
  120. package/src/locales/el.ts +4 -0
  121. package/src/registry.js +4 -0
  122. package/core/NavList/__stories__/NavHorizontalLayout.d.ts +0 -2
  123. package/core/NavList/__stories__/NavListEpathlaExample.d.ts +0 -2
  124. package/core/NavList/__stories__/NavListEpathlaExample.js +0 -153
  125. package/core/NavList/__stories__/NavListHorizontalAutoExample.d.ts +0 -2
  126. package/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -67
  127. package/core/NavList/__stories__/NavListSecondaryAutoExample.d.ts +0 -2
  128. package/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -281
  129. package/core/NavList/__stories__/NavListVerticalAutoExample.d.ts +0 -2
  130. package/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -67
  131. package/es/core/NavList/__stories__/NavListEpathlaExample.js +0 -135
  132. package/es/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -51
  133. package/es/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -255
  134. package/es/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -51
  135. package/esm/core/NavList/__stories__/NavListEpathlaExample.js +0 -135
  136. package/esm/core/NavList/__stories__/NavListHorizontalAutoExample.js +0 -51
  137. package/esm/core/NavList/__stories__/NavListSecondaryAutoExample.js +0 -255
  138. package/esm/core/NavList/__stories__/NavListVerticalAutoExample.js +0 -51
  139. package/src/core/NavList/__stories__/NavListEpathlaExample.tsx +0 -195
  140. package/src/core/NavList/__stories__/NavListHorizontalAutoExample.tsx +0 -65
  141. package/src/core/NavList/__stories__/NavListSecondaryAutoExample.tsx +0 -284
  142. package/src/core/NavList/__stories__/NavListVerticalAutoExample.tsx +0 -65
@@ -1,255 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import React, { useState } from 'react';
3
- import { NavListAuto } from '@digigov/ui/core/NavList';
4
- import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
5
- import FieldContainer, { Fieldset } from '@digigov/ui/core/FieldContainer';
6
- import Hint from '@digigov/ui/typography/Hint';
7
- import { RadioContainer, RadioItem } from '@digigov/ui/core/RadioContainer';
8
- import { SectionBreak } from '@digigov/ui/core/SectionBreak';
9
- var links = [{
10
- name: 'Nav1',
11
- label: 'Item list 1',
12
- menu: {
13
- title: 'This is the first Menu',
14
- links: [{
15
- name: 'Nav1__Nav1.1',
16
- label: 'link navigation',
17
- href: '?q=item'
18
- }, {
19
- name: 'Nav1__Nav1.2',
20
- label: 'link navigation',
21
- href: '?q=item'
22
- }]
23
- }
24
- }, {
25
- name: 'Nav2',
26
- label: 'Item list 2',
27
- menu: {
28
- title: 'This is the second Menu',
29
- links: [{
30
- name: 'Nav2__Nav2.1',
31
- label: 'link navigation',
32
- href: '?q=item'
33
- }, {
34
- name: 'Nav2__Nav2.2',
35
- label: 'link navigation',
36
- href: '?q=item'
37
- }, {
38
- name: 'Nav2__Nav2.3',
39
- label: 'link navigation',
40
- href: '?q=item'
41
- }, {
42
- name: 'Nav2__Nav2.4',
43
- label: 'link navigation',
44
- href: '?q=item'
45
- }, {
46
- name: 'Nav2__Nav2.5',
47
- label: 'link navigation',
48
- href: '?q=item'
49
- }, {
50
- name: 'Nav2__Nav2.6',
51
- label: 'link navigation',
52
- href: '?q=item'
53
- }, {
54
- name: 'Nav2__Nav2.7',
55
- label: 'link navigation',
56
- href: '?q=item'
57
- }]
58
- }
59
- }, {
60
- name: 'Nav3',
61
- label: 'Item list 3',
62
- subMenu: [{
63
- name: 'Nav3__Nav3.1',
64
- label: 'Item list 4',
65
- href: '?q=item4'
66
- }, {
67
- name: 'Nav3__Nav3.2',
68
- label: 'Item list 5',
69
- subMenu: [{
70
- name: 'Nav3__Nav3.2__Nav3.2.1',
71
- label: 'Item list 5.2',
72
- menu: {
73
- title: 'This is the fifth Menu',
74
- links: [{
75
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.1',
76
- label: 'link navigation',
77
- href: '?q=item'
78
- }, {
79
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.2',
80
- label: 'link navigation',
81
- href: '?q=item'
82
- }, {
83
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.3',
84
- label: 'link navigation',
85
- href: '?q=item'
86
- }, {
87
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.4',
88
- label: 'link navigation',
89
- href: '?q=item'
90
- }, {
91
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.5',
92
- label: 'link navigation',
93
- href: '?q=item'
94
- }, {
95
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.6',
96
- label: 'link navigation',
97
- href: '?q=item'
98
- }, {
99
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.7',
100
- label: 'link navigation',
101
- href: '?q=item'
102
- }]
103
- }
104
- }]
105
- }, {
106
- name: 'Nav3__Nav3.3',
107
- label: 'Item list 6',
108
- menu: {
109
- title: 'This is the sixth Menu',
110
- links: [{
111
- name: 'Nav3__Nav3.3__Nav3.3.1',
112
- label: 'link navigation',
113
- href: '?q=item'
114
- }, {
115
- name: 'Nav3__Nav3.3__Nav3.3.2',
116
- label: 'link navigation',
117
- href: '?q=item'
118
- }, {
119
- name: 'Nav3__Nav3.3__Nav3.3.3',
120
- label: 'link navigation',
121
- href: '?q=item'
122
- }, {
123
- name: 'Nav3__Nav3.3__Nav3.3.4',
124
- label: 'link navigation',
125
- href: '?q=item'
126
- }, {
127
- name: 'Nav3__Nav3.3__Nav3.3.5',
128
- label: 'link navigation',
129
- href: '?q=item'
130
- }, {
131
- name: 'Nav3__Nav3.3__Nav3.3.6',
132
- label: 'link navigation',
133
- href: '?q=item'
134
- }, {
135
- name: 'Nav3__Nav3.3__Nav3.3.7',
136
- label: 'link navigation',
137
- href: '?q=item'
138
- }, {
139
- name: 'Nav3__Nav3.3__Nav3.3.8',
140
- label: 'link navigation',
141
- href: '?q=item'
142
- }, {
143
- name: 'Nav3__Nav3.3__Nav3.3.9',
144
- label: 'link navigation',
145
- href: '?q=item'
146
- }, {
147
- name: 'Nav3__Nav3.3__Nav3.3.10',
148
- label: 'link navigation',
149
- href: '?q=item'
150
- }, {
151
- name: 'Nav3__Nav3.3__Nav3.3.11',
152
- label: 'link navigation',
153
- href: '?q=item'
154
- }]
155
- }
156
- }]
157
- }];
158
-
159
- var _ref = /*#__PURE__*/React.createElement(SectionBreak, {
160
- visible: false,
161
- size: "l"
162
- });
163
-
164
- var _ref2 = /*#__PURE__*/React.createElement(Hint, {
165
- id: "name-hint"
166
- }, "Layout options:");
167
-
168
- var _ref3 = /*#__PURE__*/React.createElement(Hint, {
169
- id: "name-hint"
170
- }, "Bottom border:");
171
-
172
- var _ref4 = /*#__PURE__*/React.createElement(Hint, {
173
- id: "name-hint"
174
- }, "Position fixed:");
175
-
176
- export var NavListSecondaryAutoExample = function NavListSecondaryAutoExample() {
177
- var _useState = useState('horizontal'),
178
- _useState2 = _slicedToArray(_useState, 2),
179
- layout = _useState2[0],
180
- setLayout = _useState2[1];
181
-
182
- var _useState3 = useState('no'),
183
- _useState4 = _slicedToArray(_useState3, 2),
184
- border = _useState4[0],
185
- setBorder = _useState4[1];
186
-
187
- var _useState5 = useState('no'),
188
- _useState6 = _slicedToArray(_useState5, 2),
189
- fixed = _useState6[0],
190
- setFixed = _useState6[1];
191
-
192
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(NavListAuto, {
193
- layout: layout,
194
- border: border === 'yes',
195
- fixed: fixed === 'yes',
196
- links: links,
197
- "aria-label": "Nav list"
198
- }, links.map(function (item, key) {
199
- return /*#__PURE__*/React.createElement(NavListItemAuto, {
200
- key: key,
201
- item: item
202
- });
203
- })), _ref, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(Fieldset, {
204
- "aria-describedby": "name-hint"
205
- }, _ref2, /*#__PURE__*/React.createElement(RadioContainer, {
206
- inline: true
207
- }, /*#__PURE__*/React.createElement(RadioItem, {
208
- defaultChecked: layout === 'vertical',
209
- name: "changed_display",
210
- value: "vertical",
211
- onClick: function onClick() {
212
- return setLayout('vertical');
213
- }
214
- }, "Vertical"), /*#__PURE__*/React.createElement(RadioItem, {
215
- defaultChecked: layout === 'horizontal',
216
- name: "changed_display",
217
- value: "horizontal",
218
- onClick: function onClick() {
219
- return setLayout('horizontal');
220
- }
221
- }, "Horizontal")), _ref3, /*#__PURE__*/React.createElement(RadioContainer, {
222
- inline: true
223
- }, /*#__PURE__*/React.createElement(RadioItem, {
224
- defaultChecked: border === 'yes',
225
- name: "changed_border",
226
- value: "yes",
227
- onClick: function onClick() {
228
- return setBorder('yes');
229
- }
230
- }, "Yes"), /*#__PURE__*/React.createElement(RadioItem, {
231
- defaultChecked: border === 'no',
232
- name: "changed_border",
233
- value: "no",
234
- onClick: function onClick() {
235
- return setBorder('no');
236
- }
237
- }, "No")), _ref4, /*#__PURE__*/React.createElement(RadioContainer, {
238
- inline: true
239
- }, /*#__PURE__*/React.createElement(RadioItem, {
240
- defaultChecked: fixed === 'yes',
241
- name: "changed_position",
242
- value: "yes",
243
- onClick: function onClick() {
244
- return setFixed('yes');
245
- }
246
- }, "Yes"), /*#__PURE__*/React.createElement(RadioItem, {
247
- defaultChecked: fixed === 'no',
248
- name: "changed_position",
249
- value: "no",
250
- onClick: function onClick() {
251
- return setFixed('no');
252
- }
253
- }, "No")))));
254
- };
255
- export default NavListSecondaryAutoExample;
@@ -1,51 +0,0 @@
1
- import React from 'react';
2
- import { NavListAuto } from '@digigov/ui/core/NavList';
3
- import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
- var links = [{
5
- name: 'Nav1',
6
- label: 'Nav list item 1',
7
- href: '#'
8
- }, {
9
- name: 'Nav2',
10
- label: 'Nav list item 2',
11
- menu: {
12
- title: 'This is the first Menu',
13
- links: [{
14
- name: 'Nav2.1',
15
- label: 'link navigation',
16
- href: '#'
17
- }, {
18
- name: 'Nav2.2',
19
- label: 'link navigation',
20
- href: '#'
21
- }, {
22
- name: 'Nav2.3',
23
- label: 'link navigation',
24
- href: '#'
25
- }, {
26
- name: 'Nav2.4',
27
- label: 'link navigation',
28
- href: '#'
29
- }]
30
- }
31
- }, {
32
- name: 'Nav3',
33
- label: 'Nav list item 3',
34
- href: '#'
35
- }];
36
- export var NavListVerticalAutoExample = function NavListVerticalAutoExample() {
37
- var layout = 'vertical';
38
- var border = false;
39
- return /*#__PURE__*/React.createElement(NavListAuto, {
40
- layout: layout,
41
- border: border,
42
- links: links,
43
- "aria-label": "Nav list"
44
- }, links.map(function (item, key) {
45
- return /*#__PURE__*/React.createElement(NavListItemAuto, {
46
- key: key,
47
- item: item
48
- });
49
- }));
50
- };
51
- export default NavListVerticalAutoExample;
@@ -1,195 +0,0 @@
1
- import React from 'react';
2
- import {
3
- NavListAuto,
4
- NavListItem,
5
- NavMenu,
6
- NavMenuContainer,
7
- NavMenuContainerContent,
8
- NavMenuContainerContentList,
9
- NavMenuContainerContentListItem,
10
- NavMenuContainerTitle,
11
- isNavListItemLinkInterface,
12
- } from '@digigov/ui/core/NavList';
13
- import { useNavList } from '@digigov/ui/hooks/useNavList';
14
- import { Link } from '@digigov/ui/core';
15
-
16
- const LANG = 'el';
17
- const DEFAULT_HREF_FLAG = true;
18
-
19
- const epathlaLinks = [
20
- {
21
- name: 'index',
22
- href: DEFAULT_HREF_FLAG ? '#index' : `/${LANG}`,
23
- label: 'Αρχική',
24
- },
25
- {
26
- name: 'epathla',
27
- label: 'Ε.Π.ΑΘΛ.Α',
28
- subMenu: [
29
- {
30
- name: 'epathla/aim',
31
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/epathla/aim`,
32
- label: 'Σκοπός',
33
- },
34
- {
35
- name: 'epathla/structure',
36
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/epathla/structure`,
37
- label: 'Δομή',
38
- },
39
- {
40
- name: 'epathla/members',
41
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/epathla/members`,
42
- label: 'Συγκρότηση',
43
- },
44
- {
45
- name: 'epathla/wording-groups',
46
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/epathla/working-groups`,
47
- label: 'Ομάδες εργασίας',
48
- },
49
- ],
50
- },
51
- {
52
- name: 'sport-manipulation',
53
- label: 'Χειραγώγηση Αγώνων',
54
- subMenu: [
55
- {
56
- name: 'sport-manipulation/macolin',
57
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/sport-manipulation/macolin`,
58
- label: 'Σύμβαση Macolin',
59
- },
60
- {
61
- name: 'sport-manipulation/terminology',
62
- href: DEFAULT_HREF_FLAG
63
- ? '#'
64
- : `/${LANG}/sport-manipulation/terminology`,
65
- label: 'Ορολογία',
66
- },
67
- {
68
- name: 'sport-manipulation/typology',
69
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/sport-manipulation/typology`,
70
- label: 'Τυπολογία',
71
- },
72
- {
73
- name: 'sport-manipulation/law',
74
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/sport-manipulation/law`,
75
- label: 'Νομοθεσία',
76
- },
77
- {
78
- name: 'sport-manipulation/documents',
79
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/sport-manipulation/documents`,
80
- label: 'Κείμενα αναφοράς διεθνών οργανισμών',
81
- },
82
- ],
83
- },
84
- {
85
- name: 'educational-material',
86
- label: 'Εκπαιδευτικό υλικό',
87
- subMenu: [
88
- {
89
- name: 'educational-material/videos',
90
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/educational-material/videos`,
91
- label: 'Βίντεο',
92
- },
93
- {
94
- name: 'educational-material/presentations',
95
- href: DEFAULT_HREF_FLAG
96
- ? '#'
97
- : `/${LANG}/educational-material/presentations`,
98
- label: 'Παρουσιάσεις',
99
- },
100
- {
101
- name: 'educational-material/other-texts',
102
- href: DEFAULT_HREF_FLAG
103
- ? '#'
104
- : `/${LANG}/educational-material/other-texts`,
105
- label: 'Άλλα κείμενα',
106
- },
107
- ],
108
- },
109
- {
110
- name: 'news',
111
- href: DEFAULT_HREF_FLAG ? '#news' : `/${LANG}/news`,
112
- label: 'Νέα',
113
- },
114
- {
115
- name: 'send-report',
116
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/send-report`,
117
- label: 'Προστάτεψε το άθλημά σου',
118
- },
119
- {
120
- name: 'links',
121
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/links`,
122
- label: 'Σύνδεσμοι',
123
- },
124
- {
125
- name: 'contact',
126
- href: DEFAULT_HREF_FLAG ? '#' : `/${LANG}/contact`,
127
- label: 'Επικοινωνία',
128
- },
129
- ];
130
-
131
- export const NavListEpathlaExample = () => {
132
- const { container, registerButton, registerLink } = useNavList();
133
-
134
- const setRegisterButton = (name: string) => {
135
- return { ...registerButton(name) };
136
- };
137
-
138
- const setRegisterLink = (name: string) => {
139
- return { ...registerLink(name) };
140
- };
141
-
142
- return (
143
- <>
144
- <NavListAuto
145
- layout={'horizontal'}
146
- links={epathlaLinks}
147
- aria-label="Nav list"
148
- >
149
- {epathlaLinks.map((item, key) => (
150
- <React.Fragment key={key}>
151
- <NavListItem
152
- link={item}
153
- setRegisterButton={setRegisterButton}
154
- setRegisterLink={setRegisterLink}
155
- />
156
- {item?.subMenu && (
157
- <NavMenu
158
- {...container(item.name)}
159
- aria-expanded={container(item.name)?.active}
160
- >
161
- <NavMenuContainer paddingLeft={5} paddingRight={5}>
162
- <NavMenuContainerTitle>{item.label}</NavMenuContainerTitle>
163
- <NavMenuContainerContent>
164
- <NavMenuContainerContentList role="menu">
165
- {item.subMenu?.map((subMenu, menuIndex) => {
166
- return (
167
- isNavListItemLinkInterface(subMenu) && (
168
- <NavMenuContainerContentListItem
169
- key={menuIndex}
170
- role="presentation"
171
- >
172
- <Link
173
- role="menuitem"
174
- id={`${item.name}-${menuIndex}`}
175
- href={subMenu.href}
176
- >
177
- {subMenu.label}
178
- </Link>
179
- </NavMenuContainerContentListItem>
180
- )
181
- );
182
- })}
183
- </NavMenuContainerContentList>
184
- </NavMenuContainerContent>
185
- </NavMenuContainer>
186
- </NavMenu>
187
- )}
188
- </React.Fragment>
189
- ))}
190
- </NavListAuto>
191
- </>
192
- );
193
- };
194
-
195
- export default NavListEpathlaExample;
@@ -1,65 +0,0 @@
1
- import React from 'react';
2
- import { NavListAuto } from '@digigov/ui/core/NavList';
3
- import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
-
5
- const links = [
6
- {
7
- name: 'Nav1',
8
- label: 'Nav list item 1',
9
- href: '#',
10
- },
11
- {
12
- name: 'Nav2',
13
- label: 'Nav list item 2',
14
- menu: {
15
- title: 'This is the first Menu',
16
- links: [
17
- {
18
- name: 'Nav2.1',
19
- label: 'link navigation',
20
- href: '#',
21
- },
22
- {
23
- name: 'Nav2.2',
24
- label: 'link navigation',
25
- href: '#',
26
- },
27
- {
28
- name: 'Nav2.3',
29
- label: 'link navigation',
30
- href: '#',
31
- },
32
- {
33
- name: 'Nav2.4',
34
- label: 'link navigation',
35
- href: '#',
36
- },
37
- ],
38
- },
39
- },
40
- {
41
- name: 'Nav3',
42
- label: 'Nav list item 3',
43
- href: '#',
44
- },
45
- ];
46
-
47
- export const NavListHorizontalAutoExample = () => {
48
- const layout = 'horizontal';
49
- const border = true;
50
-
51
- return (
52
- <NavListAuto
53
- layout={layout}
54
- border={border}
55
- links={links}
56
- aria-label="Nav list"
57
- >
58
- {links.map((item, key) => (
59
- <NavListItemAuto key={key} item={item} />
60
- ))}
61
- </NavListAuto>
62
- );
63
- };
64
-
65
- export default NavListHorizontalAutoExample;