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