@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,284 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { NavListAuto, NavListLayout } from '@digigov/ui/core/NavList';
3
- import NavListItemAuto from '@digigov/ui/core/NavList/NavListAuto/NavListItemAuto';
4
- import FieldContainer, { Fieldset } from '@digigov/ui/core/FieldContainer';
5
- import Hint from '@digigov/ui/typography/Hint';
6
- import { RadioContainer, RadioItem } from '@digigov/ui/core/RadioContainer';
7
- import { SectionBreak } from '@digigov/ui/core/SectionBreak';
8
-
9
- const links = [
10
- {
11
- name: 'Nav1',
12
- label: 'Item list 1',
13
- menu: {
14
- title: 'This is the first Menu',
15
- links: [
16
- {
17
- name: 'Nav1__Nav1.1',
18
- label: 'link navigation',
19
- href: '?q=item',
20
- },
21
- {
22
- name: 'Nav1__Nav1.2',
23
- label: 'link navigation',
24
- href: '?q=item',
25
- },
26
- ],
27
- },
28
- },
29
- {
30
- name: 'Nav2',
31
- label: 'Item list 2',
32
- menu: {
33
- title: 'This is the second Menu',
34
- links: [
35
- {
36
- name: 'Nav2__Nav2.1',
37
- label: 'link navigation',
38
- href: '?q=item',
39
- },
40
- {
41
- name: 'Nav2__Nav2.2',
42
- label: 'link navigation',
43
- href: '?q=item',
44
- },
45
- {
46
- name: 'Nav2__Nav2.3',
47
- label: 'link navigation',
48
- href: '?q=item',
49
- },
50
- {
51
- name: 'Nav2__Nav2.4',
52
- label: 'link navigation',
53
- href: '?q=item',
54
- },
55
- {
56
- name: 'Nav2__Nav2.5',
57
- label: 'link navigation',
58
- href: '?q=item',
59
- },
60
- {
61
- name: 'Nav2__Nav2.6',
62
- label: 'link navigation',
63
- href: '?q=item',
64
- },
65
- {
66
- name: 'Nav2__Nav2.7',
67
- label: 'link navigation',
68
- href: '?q=item',
69
- },
70
- ],
71
- },
72
- },
73
- {
74
- name: 'Nav3',
75
- label: 'Item list 3',
76
- subMenu: [
77
- {
78
- name: 'Nav3__Nav3.1',
79
- label: 'Item list 4',
80
- href: '?q=item4',
81
- },
82
- {
83
- name: 'Nav3__Nav3.2',
84
- label: 'Item list 5',
85
- subMenu: [
86
- {
87
- name: 'Nav3__Nav3.2__Nav3.2.1',
88
- label: 'Item list 5.2',
89
- menu: {
90
- title: 'This is the fifth Menu',
91
- links: [
92
- {
93
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.1',
94
- label: 'link navigation',
95
- href: '?q=item',
96
- },
97
- {
98
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.2',
99
- label: 'link navigation',
100
- href: '?q=item',
101
- },
102
- {
103
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.3',
104
- label: 'link navigation',
105
- href: '?q=item',
106
- },
107
- {
108
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.4',
109
- label: 'link navigation',
110
- href: '?q=item',
111
- },
112
- {
113
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.5',
114
- label: 'link navigation',
115
- href: '?q=item',
116
- },
117
- {
118
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.6',
119
- label: 'link navigation',
120
- href: '?q=item',
121
- },
122
- {
123
- name: 'Nav3__Nav3.2__Nav3.2.1__Nav3.2.1.7',
124
- label: 'link navigation',
125
- href: '?q=item',
126
- },
127
- ],
128
- },
129
- },
130
- ],
131
- },
132
- {
133
- name: 'Nav3__Nav3.3',
134
- label: 'Item list 6',
135
- menu: {
136
- title: 'This is the sixth Menu',
137
- links: [
138
- {
139
- name: 'Nav3__Nav3.3__Nav3.3.1',
140
- label: 'link navigation',
141
- href: '?q=item',
142
- },
143
- {
144
- name: 'Nav3__Nav3.3__Nav3.3.2',
145
- label: 'link navigation',
146
- href: '?q=item',
147
- },
148
- {
149
- name: 'Nav3__Nav3.3__Nav3.3.3',
150
- label: 'link navigation',
151
- href: '?q=item',
152
- },
153
- {
154
- name: 'Nav3__Nav3.3__Nav3.3.4',
155
- label: 'link navigation',
156
- href: '?q=item',
157
- },
158
- {
159
- name: 'Nav3__Nav3.3__Nav3.3.5',
160
- label: 'link navigation',
161
- href: '?q=item',
162
- },
163
- {
164
- name: 'Nav3__Nav3.3__Nav3.3.6',
165
- label: 'link navigation',
166
- href: '?q=item',
167
- },
168
- {
169
- name: 'Nav3__Nav3.3__Nav3.3.7',
170
- label: 'link navigation',
171
- href: '?q=item',
172
- },
173
- {
174
- name: 'Nav3__Nav3.3__Nav3.3.8',
175
- label: 'link navigation',
176
- href: '?q=item',
177
- },
178
- {
179
- name: 'Nav3__Nav3.3__Nav3.3.9',
180
- label: 'link navigation',
181
- href: '?q=item',
182
- },
183
- {
184
- name: 'Nav3__Nav3.3__Nav3.3.10',
185
- label: 'link navigation',
186
- href: '?q=item',
187
- },
188
- {
189
- name: 'Nav3__Nav3.3__Nav3.3.11',
190
- label: 'link navigation',
191
- href: '?q=item',
192
- },
193
- ],
194
- },
195
- },
196
- ],
197
- },
198
- ];
199
-
200
- export const NavListSecondaryAutoExample = () => {
201
- const [layout, setLayout] = useState<NavListLayout>('horizontal');
202
- const [border, setBorder] = useState<string>('no');
203
- const [fixed, setFixed] = useState<string>('no');
204
-
205
- return (
206
- <>
207
- <NavListAuto
208
- layout={layout}
209
- border={border === 'yes'}
210
- fixed={fixed === 'yes'}
211
- links={links}
212
- aria-label="Nav list"
213
- >
214
- {links.map((item, key) => (
215
- <NavListItemAuto key={key} item={item} />
216
- ))}
217
- </NavListAuto>
218
- <SectionBreak visible={false} size="l" />
219
- <FieldContainer>
220
- <Fieldset aria-describedby="name-hint">
221
- <Hint id="name-hint">Layout options:</Hint>
222
- <RadioContainer inline>
223
- <RadioItem
224
- defaultChecked={layout === 'vertical'}
225
- name="changed_display"
226
- value="vertical"
227
- onClick={() => setLayout('vertical')}
228
- >
229
- Vertical
230
- </RadioItem>
231
- <RadioItem
232
- defaultChecked={layout === 'horizontal'}
233
- name="changed_display"
234
- value="horizontal"
235
- onClick={() => setLayout('horizontal')}
236
- >
237
- Horizontal
238
- </RadioItem>
239
- </RadioContainer>
240
- <Hint id="name-hint">Bottom border:</Hint>
241
- <RadioContainer inline>
242
- <RadioItem
243
- defaultChecked={border === 'yes'}
244
- name="changed_border"
245
- value="yes"
246
- onClick={() => setBorder('yes')}
247
- >
248
- Yes
249
- </RadioItem>
250
- <RadioItem
251
- defaultChecked={border === 'no'}
252
- name="changed_border"
253
- value="no"
254
- onClick={() => setBorder('no')}
255
- >
256
- No
257
- </RadioItem>
258
- </RadioContainer>
259
- <Hint id="name-hint">Position fixed:</Hint>
260
- <RadioContainer inline>
261
- <RadioItem
262
- defaultChecked={fixed === 'yes'}
263
- name="changed_position"
264
- value="yes"
265
- onClick={() => setFixed('yes')}
266
- >
267
- Yes
268
- </RadioItem>
269
- <RadioItem
270
- defaultChecked={fixed === 'no'}
271
- name="changed_position"
272
- value="no"
273
- onClick={() => setFixed('no')}
274
- >
275
- No
276
- </RadioItem>
277
- </RadioContainer>
278
- </Fieldset>
279
- </FieldContainer>
280
- </>
281
- );
282
- };
283
-
284
- export default NavListSecondaryAutoExample;
@@ -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 NavListVerticalAutoExample = () => {
48
- const layout = 'vertical';
49
- const border = false;
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 NavListVerticalAutoExample;