@digigov/ui 2.0.0-76ec20a0 → 2.0.0-7d765d3c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/app/Footer/__stories__/Default.d.ts +1 -1
  2. package/app/Loader/Loader.stories.d.ts +45 -1
  3. package/app/Loader/__stories__/AccessibilityLoader.d.ts +3 -0
  4. package/app/Loader/__stories__/FullPageLoader.d.ts +1 -0
  5. package/app/Loader/__stories__/Secondary.d.ts +3 -0
  6. package/app/Loader/__stories__/Sizes.d.ts +3 -0
  7. package/app/Loader/index.native.d.ts +2 -2
  8. package/app/Loader/index.native.js.map +2 -2
  9. package/app/Loader/index.web/index.js +17 -1
  10. package/app/Loader/index.web.d.ts +19 -1
  11. package/app/Loader/index.web.js.map +3 -3
  12. package/app/Masthead/Masthead.stories.d.ts +28 -1
  13. package/app/Modal/Modal.stories.d.ts +20 -1
  14. package/app/Modal/hooks/index.js +2 -6
  15. package/app/Modal/hooks.d.ts +2 -2
  16. package/app/Modal/hooks.js.map +2 -2
  17. package/app/Modal/index.web/index.js +5 -5
  18. package/app/Modal/index.web.js.map +2 -2
  19. package/app/NotFound/__stories__/Default.d.ts +1 -1
  20. package/app/OutdatedBrowserBanner/index.d.ts +1 -0
  21. package/app/OutdatedBrowserBanner/index.js.map +2 -2
  22. package/app/PhaseBannerHeader/index.d.ts +1 -1
  23. package/app/PhaseBannerHeader/index.js.map +2 -2
  24. package/app/Skeleton/__stories__/Button.d.ts +1 -1
  25. package/app/Skeleton/__stories__/Default.d.ts +1 -1
  26. package/app/Skeleton/__stories__/NoAnimation.d.ts +1 -1
  27. package/app/hooks/useNotificationArea/index.js +76 -0
  28. package/app/hooks/useNotificationArea/package.json +6 -0
  29. package/app/hooks/useNotificationArea.d.ts +1 -0
  30. package/app/hooks/useNotificationArea.js.map +7 -0
  31. package/cjs/app/Loader/index.native.js.map +2 -2
  32. package/cjs/app/Loader/index.web/index.js +33 -2
  33. package/cjs/app/Loader/index.web.js.map +3 -3
  34. package/cjs/app/Modal/hooks/index.js +2 -6
  35. package/cjs/app/Modal/hooks.js.map +2 -2
  36. package/cjs/app/Modal/index.web/index.js +5 -5
  37. package/cjs/app/Modal/index.web.js.map +2 -2
  38. package/cjs/app/OutdatedBrowserBanner/index.js.map +2 -2
  39. package/cjs/app/PhaseBannerHeader/index.js.map +2 -2
  40. package/cjs/app/hooks/useNotificationArea/index.js +99 -0
  41. package/cjs/app/hooks/useNotificationArea.js.map +7 -0
  42. package/cjs/content/Accordion/hooks.js.map +1 -1
  43. package/cjs/form/AutoComplete/Status/index.js.map +2 -2
  44. package/cjs/form/AutoComplete/index.js +32 -19
  45. package/cjs/form/AutoComplete/index.js.map +2 -2
  46. package/cjs/i18n/locales/el/index.js +51 -23
  47. package/cjs/i18n/locales/el.js.map +2 -2
  48. package/cjs/i18n/locales/en/index.js +36 -8
  49. package/cjs/i18n/locales/en.js.map +2 -2
  50. package/cjs/layouts/Hidden/index.js +19 -0
  51. package/cjs/layouts/Hidden/index.js.map +3 -3
  52. package/cjs/lazy.js +1 -1
  53. package/cjs/lazy.js.map +2 -2
  54. package/cjs/navigation/Drawer/hooks/index.js +2 -6
  55. package/cjs/navigation/Drawer/hooks.js.map +2 -2
  56. package/cjs/navigation/Pagination/hooks/index.js +2 -2
  57. package/cjs/navigation/Pagination/hooks.js.map +2 -2
  58. package/cjs/navigation/Tabs/hooks.js.map +1 -1
  59. package/cjs/registry.js +50 -48
  60. package/cjs/registry.js.map +2 -2
  61. package/cjs/typography/CodeBlock/index.js +1 -2
  62. package/cjs/typography/CodeBlock/index.js.map +2 -2
  63. package/cjs/utils/hooks/useDebounce/index.js +1 -1
  64. package/cjs/utils/hooks/useDebounce.js.map +2 -2
  65. package/content/Accordion/Accordion.stories.d.ts +27 -16
  66. package/content/Accordion/hooks.js.map +1 -1
  67. package/content/Chip/__stories__/Default.d.ts +1 -1
  68. package/content/SummaryList/SummaryList.stories.d.ts +4 -1
  69. package/feedback/NotificationBanner/NotificationBanner.stories.d.ts +14 -13
  70. package/feedback/NotificationBanner/__stories__/Expanded.d.ts +3 -0
  71. package/feedback/PhaseBanner/PhaseBanner.stories.d.ts +1 -1
  72. package/form/AutoComplete/AutoComplete.stories.d.ts +57 -16
  73. package/form/AutoComplete/Status/index.d.ts +1 -1
  74. package/form/AutoComplete/Status/index.js.map +2 -2
  75. package/form/AutoComplete/__stories__/WithCustomValue.d.ts +3 -0
  76. package/form/AutoComplete/__stories__/WithHint.d.ts +3 -0
  77. package/form/AutoComplete/index.d.ts +4 -3
  78. package/form/AutoComplete/index.js +32 -18
  79. package/form/AutoComplete/index.js.map +2 -2
  80. package/form/Button/__stories__/ThemeToggle.d.ts +1 -1
  81. package/form/FileUpload/FileUpload.stories.d.ts +1 -0
  82. package/form/FileUpload/__stories__/WithVariantLink.d.ts +3 -0
  83. package/i18n/locales/el/index.js +51 -23
  84. package/i18n/locales/el.d.ts +33 -5
  85. package/i18n/locales/el.js.map +2 -2
  86. package/i18n/locales/en/index.js +36 -8
  87. package/i18n/locales/en.d.ts +32 -4
  88. package/i18n/locales/en.js.map +2 -2
  89. package/index.js +1 -1
  90. package/layouts/Grid/Grid.stories.d.ts +82 -0
  91. package/layouts/Hidden/Hidden.stories.d.ts +115 -0
  92. package/layouts/Hidden/index.d.ts +2 -0
  93. package/layouts/Hidden/index.js +5 -0
  94. package/layouts/Hidden/index.js.map +2 -2
  95. package/layouts/Stack/Stack.stories.d.ts +76 -0
  96. package/lazy/index.js +1 -1
  97. package/navigation/BackToTopLink/BackToTopLink.stories.d.ts +2 -0
  98. package/navigation/Drawer/hooks/index.js +2 -6
  99. package/navigation/Drawer/hooks.js.map +2 -2
  100. package/navigation/Dropdown/Dropdown.stories.d.ts +75 -1
  101. package/navigation/Pagination/hooks/index.js +2 -2
  102. package/navigation/Pagination/hooks.js.map +2 -2
  103. package/navigation/SkipLink/SkipLink.stories.d.ts +2 -0
  104. package/navigation/Tabs/hooks.d.ts +1 -1
  105. package/navigation/Tabs/hooks.js.map +1 -1
  106. package/package.json +7 -7
  107. package/registry/index.js +50 -48
  108. package/src/app/BannerContainer/__stories__/CookiesBanner.tsx +1 -21
  109. package/src/app/Footer/__stories__/Default.tsx +1 -1
  110. package/src/app/Header/doc.mdx +3 -3
  111. package/src/app/Loader/Loader.stories.jsx +54 -0
  112. package/src/app/Loader/__stories__/AccessibilityLoader.tsx +27 -0
  113. package/src/app/Loader/__stories__/FullPageLoader.tsx +9 -5
  114. package/src/app/Loader/__stories__/Secondary.tsx +11 -0
  115. package/src/app/Loader/__stories__/Sizes.tsx +18 -0
  116. package/src/app/Loader/doc.mdx +39 -0
  117. package/src/app/Loader/index.native.tsx +2 -2
  118. package/src/app/Loader/index.test.tsx +12 -0
  119. package/src/app/Loader/index.web.tsx +39 -1
  120. package/src/app/Masthead/Masthead.stories.jsx +66 -0
  121. package/src/app/Masthead/doc.mdx +3 -3
  122. package/src/app/Modal/Modal.stories.jsx +64 -0
  123. package/src/app/Modal/__stories__/AlertDialog.tsx +1 -1
  124. package/src/app/Modal/__stories__/Auto.tsx +1 -1
  125. package/src/app/Modal/__stories__/Default.tsx +1 -1
  126. package/src/app/Modal/__stories__/Dense.tsx +1 -1
  127. package/src/app/Modal/__stories__/WithHooks.tsx +1 -1
  128. package/src/app/Modal/__stories__/WithoutModalGaps.tsx +1 -1
  129. package/src/app/Modal/hooks.ts +8 -8
  130. package/src/app/Modal/index.web.tsx +5 -7
  131. package/src/app/NotFound/__stories__/Default.tsx +1 -1
  132. package/src/app/OutdatedBrowserBanner/index.tsx +1 -1
  133. package/src/app/PhaseBannerHeader/index.tsx +1 -1
  134. package/src/app/Skeleton/__stories__/Button.tsx +1 -1
  135. package/src/app/Skeleton/__stories__/Default.tsx +1 -1
  136. package/src/app/Skeleton/__stories__/NoAnimation.tsx +1 -1
  137. package/src/app/hooks/useNotificationArea.tsx +105 -0
  138. package/src/content/Accordion/Accordion.stories.jsx +9 -1
  139. package/src/content/Accordion/doc.mdx +1 -2
  140. package/src/content/Accordion/hooks.ts +1 -1
  141. package/src/content/Card/doc.mdx +11 -11
  142. package/src/content/Chip/__stories__/Default.tsx +1 -1
  143. package/src/content/Chip/doc.mdx +4 -4
  144. package/src/content/List/__snapshots__/index.spec.tsx.snap +13 -3
  145. package/src/content/List/doc.mdx +3 -3
  146. package/src/content/SummaryList/SummaryList.stories.js +5 -1
  147. package/src/content/TaskList/doc.mdx +1 -1
  148. package/src/content/Timeline/doc.mdx +1 -1
  149. package/src/feedback/CopyToClipboard/doc.mdx +1 -1
  150. package/src/feedback/ErrorSummary/__snapshots__/index.spec.tsx.snap +13 -3
  151. package/src/feedback/ErrorSummary/doc.mdx +1 -1
  152. package/src/feedback/NotificationBanner/NotificationBanner.stories.js +10 -9
  153. package/src/feedback/NotificationBanner/__snapshots__/index.spec.tsx.snap +24 -14
  154. package/src/feedback/NotificationBanner/__stories__/Expanded.tsx +27 -0
  155. package/src/feedback/NotificationBanner/doc.mdx +15 -6
  156. package/src/feedback/NotificationBanner/index.test.tsx +4 -0
  157. package/src/feedback/PhaseBanner/PhaseBanner.stories.jsx +1 -1
  158. package/src/feedback/WarningText/__snapshots__/index.spec.tsx.snap +13 -3
  159. package/src/form/AutoComplete/AutoComplete.stories.jsx +19 -4
  160. package/src/form/AutoComplete/Status/index.tsx +1 -1
  161. package/src/form/AutoComplete/__stories__/WithAutoSelect.tsx +1 -17
  162. package/src/form/AutoComplete/__stories__/WithCustomValue.tsx +28 -0
  163. package/src/form/AutoComplete/__stories__/WithDefaultValue.tsx +1 -6
  164. package/src/form/AutoComplete/__stories__/WithHint.tsx +16 -0
  165. package/src/form/AutoComplete/doc.mdx +14 -13
  166. package/src/form/AutoComplete/index.test.tsx +8 -0
  167. package/src/form/AutoComplete/index.tsx +38 -25
  168. package/src/form/Button/__stories__/ThemeToggle.tsx +1 -1
  169. package/src/form/Button/doc.mdx +25 -14
  170. package/src/form/Checkbox/doc.mdx +1 -1
  171. package/src/form/FileUpload/FileUpload.stories.js +1 -0
  172. package/src/form/FileUpload/__stories__/WithVariantLink.tsx +24 -0
  173. package/src/form/FileUpload/index.test.tsx +4 -0
  174. package/src/form/RadioContainer/doc.mdx +4 -4
  175. package/src/i18n/locales/el.ts +73 -22
  176. package/src/i18n/locales/en.ts +43 -7
  177. package/src/layouts/Basic/doc.mdx +0 -2
  178. package/src/layouts/Grid/Grid.stories.jsx +143 -0
  179. package/src/layouts/Hidden/Hidden.stories.jsx +62 -0
  180. package/src/layouts/Hidden/index.tsx +3 -0
  181. package/src/layouts/Stack/Stack.stories.jsx +104 -0
  182. package/src/lazy.js +1 -1
  183. package/src/navigation/BackToTopLink/BackToTopLink.stories.js +4 -0
  184. package/src/navigation/BackToTopLink/doc.mdx +22 -0
  185. package/src/navigation/Breadcrumbs/doc.mdx +4 -0
  186. package/src/navigation/Drawer/hooks.ts +6 -6
  187. package/src/navigation/Dropdown/Dropdown.stories.jsx +118 -0
  188. package/src/navigation/Dropdown/doc.mdx +24 -2
  189. package/src/navigation/NavList/__snapshots__/index.spec.tsx.snap +13 -3
  190. package/src/navigation/NavList/doc.mdx +1 -1
  191. package/src/navigation/Pagination/doc.mdx +5 -1
  192. package/src/navigation/Pagination/hooks.ts +2 -2
  193. package/src/navigation/SkipLink/SkipLink.stories.js +4 -0
  194. package/src/navigation/SkipLink/doc.mdx +19 -0
  195. package/src/navigation/Tabs/hooks.ts +2 -2
  196. package/src/registry.js +50 -48
  197. package/src/typography/CodeBlock/CodeBlock.stories.js +24 -0
  198. package/src/typography/CodeBlock/index.tsx +14 -12
  199. package/src/typography/Heading/Heading.stories.js +12 -0
  200. package/src/typography/HeadingCaption/HeadingCaption.stories.js +9 -0
  201. package/src/typography/Hint/Hint.stories.js +11 -0
  202. package/src/typography/Hint/__stories__/Default.tsx +1 -1
  203. package/src/typography/Hint/__stories__/FontSizes.tsx +4 -4
  204. package/src/typography/NormalText/NormalText.stories.js +10 -0
  205. package/src/typography/NormalText/__stories__/Default.tsx +1 -1
  206. package/src/typography/Paragraph/Paragraph.stories.js +23 -0
  207. package/src/typography/Paragraph/__stories__/Default.tsx +1 -1
  208. package/src/typography/Paragraph/__stories__/LeadVariant.tsx +3 -1
  209. package/src/typography/Paragraph/__stories__/SmallVariant.tsx +3 -1
  210. package/src/utils/hooks/useDebounce.ts +1 -1
  211. package/stories-registry/index.js +170 -154
  212. package/typography/CodeBlock/CodeBlock.stories.d.ts +11 -0
  213. package/typography/CodeBlock/index.d.ts +1 -1
  214. package/typography/CodeBlock/index.js +1 -2
  215. package/typography/CodeBlock/index.js.map +2 -2
  216. package/typography/Heading/Heading.stories.d.ts +10 -0
  217. package/typography/HeadingCaption/HeadingCaption.stories.d.ts +8 -0
  218. package/typography/Hint/Hint.stories.d.ts +9 -0
  219. package/typography/Hint/__stories__/Default.d.ts +1 -1
  220. package/typography/NormalText/NormalText.stories.d.ts +8 -0
  221. package/typography/NormalText/__stories__/Default.d.ts +1 -1
  222. package/typography/Paragraph/Paragraph.stories.d.ts +37 -0
  223. package/typography/Paragraph/__stories__/Default.d.ts +1 -1
  224. package/typography/Paragraph/__stories__/LeadVariant.d.ts +1 -1
  225. package/typography/Paragraph/__stories__/SmallVariant.d.ts +1 -1
  226. package/utils/hooks/useDebounce/index.js +1 -1
  227. package/utils/hooks/useDebounce.js.map +2 -2
  228. package/utils/hooks/useLatest.d.ts +1 -1
  229. package/src/app/Loader/Loader.stories.js +0 -8
  230. package/src/app/Masthead/Masthead.stories.js +0 -17
  231. package/src/app/Modal/Modal.stories.js +0 -18
  232. package/src/layouts/Grid/Grid.stories.js +0 -12
  233. package/src/layouts/Stack/Stack.stories.js +0 -15
  234. package/src/navigation/Dropdown/Dropdown.stories.js +0 -23
@@ -31,7 +31,10 @@ export const WithControls = {
31
31
  >
32
32
  <AccordionSection open>
33
33
  <AccordionSectionSummary>
34
- <AccordionSectionSummaryHeading aria-controls="content1">
34
+ <AccordionSectionSummaryHeading
35
+ aria-controls="content1"
36
+ variant={args.variant}
37
+ >
35
38
  {args.title}
36
39
  </AccordionSectionSummaryHeading>
37
40
  {args.hint > 0 && <Hint>{args.hintMessage}</Hint>}
@@ -45,6 +48,7 @@ export const WithControls = {
45
48
  },
46
49
  args: {
47
50
  title: 'Διαφορές με το δημόσιο',
51
+ variant: 'default',
48
52
  hint: true,
49
53
  hintMessage:
50
54
  'Δικαστικές και εξωδικαστικές διαφορές με το Δημόσιο, εκκαθάριση δικαστικών δαπανών κ.ά.',
@@ -58,6 +62,10 @@ export const WithControls = {
58
62
  title: {
59
63
  control: { type: 'text' },
60
64
  },
65
+ variant: {
66
+ options: ['default', 'arrows'],
67
+ control: { type: 'select' },
68
+ },
61
69
  hint: {
62
70
  control: { type: 'boolean' },
63
71
  },
@@ -11,11 +11,10 @@ The accordion component lets users show and hide sections of related content on
11
11
 
12
12
  ## How to use
13
13
 
14
- ### Default Accordion
15
14
 
16
15
  <code src="@digigov/ui/content/Accordion/__stories__/Default.tsx" />
17
16
 
18
- ### Accordion with Hints
17
+ ### With Hints
19
18
 
20
19
  Accordions hide content, so the labels need to be clear. If necessary, you can add a summary line to help users understand what is in the section.
21
20
 
@@ -34,7 +34,7 @@ export const useAccordion = ({
34
34
  singleOpen = false,
35
35
  }: UseAccordionProps = {}): UseAccordionReturn => {
36
36
  const sectionsRef = useRef<
37
- Map<AccordionItemId, React.RefObject<HTMLDetailsElement>>
37
+ Map<AccordionItemId, React.RefObject<HTMLDetailsElement | null>>
38
38
  >(new Map());
39
39
  const [current, setCurrentOpen] = useState(
40
40
  defaultOpen ? { [defaultOpen]: true } : {}
@@ -12,55 +12,55 @@ When used correctly, Cards can help users to scan through vast amounts of inform
12
12
 
13
13
  <code src="@digigov/ui/content/Card/__stories__/Default.tsx" />
14
14
 
15
- #### Card with gray border color
15
+ ### With gray border color
16
16
 
17
17
  <code src="@digigov/ui/content/Card/__stories__/WithGrayBorder.tsx" />
18
18
 
19
- #### Card with dark border color
19
+ ### With dark border color
20
20
 
21
21
  <code src="@digigov/ui/content/Card/__stories__/WithDarkBorder.tsx" />
22
22
 
23
- ### Card with top border
23
+ ### With top border
24
24
 
25
25
  You can set the color of the Card's top border. You can choose between dark and grey color respectively. By default the top border color is grey.
26
26
 
27
27
  <code src="@digigov/ui/content/Card/__stories__/WithDarkBorder.tsx" />
28
28
 
29
- #### Card with grey top border
29
+ ### With grey top border
30
30
 
31
31
  <code src="@digigov/ui/content/Card/__stories__/WithGrayTopBorder.tsx" />
32
32
 
33
- #### Card with dark top border
33
+ ### With dark top border
34
34
 
35
35
  <code src="@digigov/ui/content/Card/__stories__/WithDarkTopBorder.tsx" />
36
36
 
37
- ### Card with divider
37
+ ### With divider
38
38
 
39
39
  <code src="@digigov/ui/content/Card/__stories__/WithDivider.tsx" />
40
40
 
41
- ### Card with actions
41
+ ### With actions
42
42
 
43
43
  <code src="@digigov/ui/content/Card/__stories__/WithGroupButton.tsx" />
44
44
 
45
- #### Card with title link
45
+ ### With title link
46
46
 
47
47
  Cards can be used without an action button, but with a clickable title.
48
48
 
49
49
  <code src="@digigov/ui/content/Card/__stories__/WithLink.tsx" />
50
50
 
51
- #### Card with clickable content
51
+ ### With clickable content
52
52
 
53
53
  You can expand the clickable area of the link to fill Card's content.
54
54
 
55
55
  <code src="@digigov/ui/content/Card/__stories__/WithClickableContent.tsx" />
56
56
 
57
- #### Card with button or link
57
+ ### With button or link
58
58
 
59
59
  Cards also provides styles for actionable elements such as Buttons or Links.
60
60
 
61
61
  <code src="@digigov/ui/content/Card/__stories__/WithClickableLink.tsx" />
62
62
 
63
- #### Card with a group of actions
63
+ ### With a group of actions
64
64
 
65
65
  <code src="@digigov/ui/content/Card/__stories__/WithGroupButton.tsx" />
66
66
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import Chip from '@digigov/ui/content/Chip';
3
3
 
4
- export const Default = () => <Chip>Αθήνα</Chip>;
4
+ export const Default = (_: any) => <Chip>Αθήνα</Chip>;
5
5
 
6
6
  export default Default;
@@ -11,19 +11,19 @@ The Chip component can be used to represent small blocks of information.
11
11
 
12
12
  <code src="@digigov/ui/content/Chip/__stories__/Default.tsx" />
13
13
 
14
- ### ClickableChip
14
+ ### Clickable Chip
15
15
 
16
16
  <code src="@digigov/ui/content/Chip/__stories__/ClickableChip.tsx" />
17
17
 
18
- ### ClickableDeletableChip
18
+ ### Clickable and Deletable
19
19
 
20
20
  <code src="@digigov/ui/content/Chip/__stories__/ClickableDeletableChip.tsx" />
21
21
 
22
- ### DeletableChip
22
+ ### Deletable Chip
23
23
 
24
24
  <code src="@digigov/ui/content/Chip/__stories__/DeletableChip.tsx" />
25
25
 
26
- ### GroupOfChips
26
+ ### Group of Chips
27
27
 
28
28
  <code src="@digigov/ui/content/Chip/__stories__/GroupOfChips.tsx" />
29
29
 
@@ -1,7 +1,17 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`renders the ErrorSummary with sample data 1`] = `
4
- <ForwardRef(List2)>
5
- this is some random warning text
6
- </ForwardRef(List2)>
4
+ Object {
5
+ "$$typeof": Symbol(react.transitional.element),
6
+ "_owner": null,
7
+ "_store": Object {},
8
+ "key": null,
9
+ "props": Object {
10
+ "children": "this is some random warning text",
11
+ },
12
+ "type": Object {
13
+ "$$typeof": Symbol(react.forward_ref),
14
+ "render": [Function],
15
+ },
16
+ }
7
17
  `;
@@ -9,15 +9,15 @@ title: List
9
9
 
10
10
  <code src="@digigov/ui/content/List/__stories__/Default.tsx" />
11
11
 
12
- ### List with bullets
12
+ ### With bullets
13
13
 
14
14
  <code src="@digigov/ui/content/List/__stories__/BulletList.tsx" />
15
15
 
16
- ### List with numbers
16
+ ### With numbers
17
17
 
18
18
  <code src="@digigov/ui/content/List/__stories__/NumberedList.tsx" />
19
19
 
20
- ### List with extra space
20
+ ### With extra space
21
21
 
22
22
  <code src="@digigov/ui/content/List/__stories__/WithExtraSpace.tsx" />
23
23
 
@@ -10,7 +10,7 @@ export default {
10
10
  import { SummaryListExample } from '@digigov/ui/content/SummaryList/__stories__/SummaryListExample';
11
11
  import doc from './doc.mdx?raw';
12
12
 
13
- export const Default = {
13
+ export const WithControls = {
14
14
  args: {
15
15
  sm: 5,
16
16
  md: 4,
@@ -23,3 +23,7 @@ export const Default = {
23
23
  showActions: true,
24
24
  },
25
25
  };
26
+
27
+ export { Default } from '@digigov/ui/content/SummaryList/__stories__/Default';
28
+ export { WithActions } from '@digigov/ui/content/SummaryList/__stories__/WithActions';
29
+ export { WithoutBorders } from '@digigov/ui/content/SummaryList/__stories__/WithoutBorders';
@@ -11,7 +11,7 @@ TaskList is a component that displays number of steps required to complete a pro
11
11
 
12
12
  <code src="@digigov/ui/content/TaskList/__stories__/Default.tsx" />
13
13
 
14
- ## With dense style
14
+ ### With dense style
15
15
 
16
16
  <code src="@digigov/ui/content/TaskList/__stories__/Dense.tsx" />
17
17
 
@@ -13,7 +13,7 @@ User can better understand what has happened and also understand what the next s
13
13
 
14
14
  <code src="@digigov/ui/content/Timeline/__stories__/Default.tsx" />
15
15
 
16
- ## With dense style
16
+ ### With dense style
17
17
 
18
18
  <code src="@digigov/ui/content/Timeline/__stories__/Dense.tsx" />
19
19
 
@@ -21,4 +21,4 @@ title: CopyToClipboard
21
21
 
22
22
  See below for a complete reference to all of the props available to the components mentioned here.
23
23
 
24
- <ComponentProps componentName={['CopyToClipboardContainer']} />{' '}
24
+ <ComponentProps componentName={['CopyToClipboardContainer']} />
@@ -1,7 +1,17 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`renders the ErrorSummary with sample data 1`] = `
4
- <ForwardRef(ErrorSummary2)>
5
- this is some random warning text
6
- </ForwardRef(ErrorSummary2)>
4
+ Object {
5
+ "$$typeof": Symbol(react.transitional.element),
6
+ "_owner": null,
7
+ "_store": Object {},
8
+ "key": null,
9
+ "props": Object {
10
+ "children": "this is some random warning text",
11
+ },
12
+ "type": Object {
13
+ "$$typeof": Symbol(react.forward_ref),
14
+ "render": [Function],
15
+ },
16
+ }
7
17
  `;
@@ -35,4 +35,4 @@ For questions that require a user to select one or more options from a list usin
35
35
 
36
36
  See below for a complete reference to all of the props available to the components mentioned here.
37
37
 
38
- {/* <ComponentProps componentName={["ErrorSummary"]} /> */}
38
+ <ComponentProps componentName={["ErrorSummary"]} />
@@ -15,16 +15,23 @@ export default {
15
15
 
16
16
  export const WithControls = {
17
17
  args: {
18
+ variant: 'info',
19
+ dense: false,
18
20
  title: 'Ειδοποίηση',
19
21
  children: ' Σε 7 ημέρες θα μπορείτε να υποβάλετε την αίτηση.',
20
22
  link: {
21
23
  label: 'Προβολή αίτησης',
22
24
  href: '#',
23
25
  },
24
- variant: 'info',
25
- dense: false,
26
26
  },
27
27
  argTypes: {
28
+ variant: {
29
+ options: ['info', 'success', 'error'],
30
+ control: { type: 'select' },
31
+ },
32
+ dense: {
33
+ control: { type: 'boolean' },
34
+ },
28
35
  title: {
29
36
  control: { type: 'text' },
30
37
  },
@@ -34,13 +41,6 @@ export const WithControls = {
34
41
  link: {
35
42
  control: { type: 'object' },
36
43
  },
37
- variant: {
38
- options: ['info', 'success', 'error'],
39
- control: { type: 'select' },
40
- },
41
- dense: {
42
- control: { type: 'boolean' },
43
- },
44
44
  },
45
45
  parameters: {
46
46
  controls: { exclude: ['ref'] },
@@ -50,3 +50,4 @@ export const WithControls = {
50
50
  export { Default } from '@digigov/ui/feedback/NotificationBanner/__stories__/Default';
51
51
  export { Success } from '@digigov/ui/feedback/NotificationBanner/__stories__/Success';
52
52
  export { Dense } from '@digigov/ui/feedback/NotificationBanner/__stories__/Dense';
53
+ export { Expanded } from '@digigov/ui/feedback/NotificationBanner/__stories__/Expanded';
@@ -1,23 +1,33 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`renders the notification banner 1`] = `
4
- <NotificationBanner
5
- title="Notification Banner Example"
6
- >
7
- this is a notification
8
- </NotificationBanner>
4
+ Object {
5
+ "$$typeof": Symbol(react.transitional.element),
6
+ "_owner": null,
7
+ "_store": Object {},
8
+ "key": null,
9
+ "props": Object {
10
+ "children": "this is a notification",
11
+ "title": "Notification Banner Example",
12
+ },
13
+ "type": [Function],
14
+ }
9
15
  `;
10
16
 
11
17
  exports[`renders the notification banner with title and link 1`] = `
12
- <NotificationBanner
13
- link={
14
- Object {
18
+ Object {
19
+ "$$typeof": Symbol(react.transitional.element),
20
+ "_owner": null,
21
+ "_store": Object {},
22
+ "key": null,
23
+ "props": Object {
24
+ "children": "this is a notification",
25
+ "link": Object {
15
26
  "href": "/",
16
27
  "label": "This is a label",
17
- }
18
- }
19
- title="Notification Banner Example"
20
- >
21
- this is a notification
22
- </NotificationBanner>
28
+ },
29
+ "title": "Notification Banner Example",
30
+ },
31
+ "type": [Function],
32
+ }
23
33
  `;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import {
3
+ NotificationBannerContainer,
4
+ NotificationBannerHeader,
5
+ NotificationBannerContent,
6
+ NotificationBannerHeading,
7
+ NotificationBannerLink,
8
+ } from '@digigov/ui/feedback/NotificationBanner';
9
+ import { Paragraph } from '@digigov/ui/typography/Paragraph';
10
+
11
+ export const Expanded = (_: any) => (
12
+ <NotificationBannerContainer>
13
+ <NotificationBannerHeader>Ειδοποίηση</NotificationBannerHeader>
14
+ <NotificationBannerContent>
15
+ <NotificationBannerHeading>
16
+ Μπορείτε να συμβάλλετε στη βελτίωση των δημοσίων υπηρεσιών.
17
+ </NotificationBannerHeading>
18
+ <Paragraph>
19
+ Συμπληρώστε έως 24/5 το ερωτηματολόγιο στο{' '}
20
+ <NotificationBannerLink> axiologisi.ypes.gov.gr</NotificationBannerLink>
21
+ .
22
+ </Paragraph>
23
+ </NotificationBannerContent>
24
+ </NotificationBannerContainer>
25
+ );
26
+
27
+ export default Expanded;
@@ -13,9 +13,6 @@ Use a notification banner to tell the user about something they need to know abo
13
13
 
14
14
  Use a ‘neutral’ blue notification banner if the user needs to know about a problem with the service as a whole.
15
15
 
16
- Use a ‘neutral’ notification banner if the user needs to know about something that’s happening elsewhere in the service.
17
-
18
- ## How to use
19
16
 
20
17
  <code src="@digigov/ui/feedback/NotificationBanner/__stories__/Default.tsx" />
21
18
 
@@ -29,8 +26,20 @@ You can also use a notification banner to tell the user about the outcome of som
29
26
 
30
27
  <code src="@digigov/ui/feedback/NotificationBanner/__stories__/Dense.tsx" />
31
28
 
32
- ## API
29
+ ### Expanded
33
30
 
34
- See below for a complete reference to all of the props available to the components mentioned here.
31
+ <code src="@digigov/ui/feedback/NotificationBanner/__stories__/Expanded.tsx" />
32
+
33
+ ## API
35
34
 
36
- <ComponentProps componentName={["NotificationBannerContainer","NotificationBannerContent","NotificationBannerHeader","NotificationBannerHeading","NotificationBannerLink"]} />
35
+ See below for a complete reference to all of the props available to the components mentioned here.
36
+
37
+ <ComponentProps
38
+ componentName={[
39
+ 'NotificationBannerContainer',
40
+ 'NotificationBannerContent',
41
+ 'NotificationBannerHeader',
42
+ 'NotificationBannerHeading',
43
+ 'NotificationBannerLink',
44
+ ]}
45
+ />
@@ -3,6 +3,7 @@ import { test, expect } from '@playwright/experimental-ct-react';
3
3
  import TestVariant from '@digigov/ui/utils/TestVariant'
4
4
  import { Default } from '@digigov/ui/feedback/NotificationBanner/__stories__/Default';
5
5
  import { Dense } from '@digigov/ui/feedback/NotificationBanner/__stories__/Dense';
6
+ import { Expanded } from '@digigov/ui/feedback/NotificationBanner/__stories__/Expanded';
6
7
  import { Success } from '@digigov/ui/feedback/NotificationBanner/__stories__/Success';
7
8
 
8
9
  test('renders the All NotificationBanner variants', async ({ mount, page }) => {
@@ -15,6 +16,9 @@ test('renders the All NotificationBanner variants', async ({ mount, page }) => {
15
16
  <TestVariant title="Dense">
16
17
  <Dense />
17
18
  </TestVariant>
19
+ <TestVariant title="Expanded">
20
+ <Expanded />
21
+ </TestVariant>
18
22
  <TestVariant title="Success">
19
23
  <Success />
20
24
  </TestVariant>
@@ -31,8 +31,8 @@ export const WithControls = {
31
31
  );
32
32
  },
33
33
  args: {
34
- tag: 'ALPHA',
35
34
  underline: true,
35
+ tag: 'ALPHA',
36
36
  },
37
37
  argTypes: {
38
38
  underline: {
@@ -1,7 +1,17 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
3
  exports[`renders the WarningText with sample data 1`] = `
4
- <ForwardRef(WarningText2)>
5
- this is some random warning text
6
- </ForwardRef(WarningText2)>
4
+ Object {
5
+ "$$typeof": Symbol(react.transitional.element),
6
+ "_owner": null,
7
+ "_store": Object {},
8
+ "key": null,
9
+ "props": Object {
10
+ "children": "this is some random warning text",
11
+ },
12
+ "type": Object {
13
+ "$$typeof": Symbol(react.forward_ref),
14
+ "render": [Function],
15
+ },
16
+ }
7
17
  `;
@@ -15,11 +15,14 @@ export const WithControls = {
15
15
  render: (args) => {
16
16
  return (
17
17
  <AutoComplete
18
+ defaultValue={args.defaultValue}
18
19
  key={args.multiple ? 'multiple' : 'single'}
19
20
  id={args.id}
20
21
  width={args.width}
21
22
  multiple={args.multiple}
22
23
  autoselect={args.autoselect}
24
+ placeholder={args.placeholder}
25
+ hint={args.hint}
23
26
  minLength={args.minLength}
24
27
  source={suggest}
25
28
  />
@@ -28,8 +31,10 @@ export const WithControls = {
28
31
  args: {
29
32
  width: 'full',
30
33
  id: 'autocomplete-id',
31
- multiple: false,
32
34
  autoselect: false,
35
+ multiple: false,
36
+ hint: false,
37
+ placeholder: '',
33
38
  minLength: 2,
34
39
  numberOfSelected: 2,
35
40
  defaultValue: '',
@@ -44,12 +49,21 @@ export const WithControls = {
44
49
  id: {
45
50
  control: { type: 'text' },
46
51
  },
52
+ autoselect: {
53
+ control: { type: 'boolean' },
54
+ if: { arg: 'multiple', eq: false },
55
+ },
47
56
  multiple: {
48
57
  control: { type: 'boolean' },
58
+ if: { arg: 'autoselect', eq: false },
49
59
  },
50
- autoselect: {
60
+ hint: {
51
61
  control: { type: 'boolean' },
52
62
  },
63
+ placeholder: {
64
+ control: { type: 'text' },
65
+ if: { arg: 'hint', eq: false },
66
+ },
53
67
  minLength: {
54
68
  control: { type: 'number' },
55
69
  },
@@ -58,7 +72,7 @@ export const WithControls = {
58
72
  if: { arg: 'multiple', eq: true },
59
73
  },
60
74
  defaultValue: {
61
- control: { type: 'string' },
75
+ control: { type: 'text' },
62
76
  },
63
77
  },
64
78
  parameters: {
@@ -72,7 +86,6 @@ export const WithControls = {
72
86
  'tAssistiveHint',
73
87
  'templates',
74
88
  'name',
75
- 'placeholder',
76
89
  'onConfirm',
77
90
  'confirmOnBlur',
78
91
  'required',
@@ -89,6 +102,8 @@ export { MultipleShowingTwoSelected } from '@digigov/ui/form/AutoComplete/__stor
89
102
  export { MultipleWithMinLength } from '@digigov/ui/form/AutoComplete/__stories__/MultipleWithMinLength';
90
103
  export { WithAutoSelect } from '@digigov/ui/form/AutoComplete/__stories__/WithAutoSelect';
91
104
  export { WithDefaultValue } from '@digigov/ui/form/AutoComplete/__stories__/WithDefaultValue';
105
+ export { WithCustomValue } from '@digigov/ui/form/AutoComplete/__stories__/WithCustomValue';
106
+ export { WithHint } from '@digigov/ui/form/AutoComplete/__stories__/WithHint';
92
107
  export { WithPlaceHolder } from '@digigov/ui/form/AutoComplete/__stories__/WithPlaceHolder';
93
108
  export { WithShowAllValues } from '@digigov/ui/form/AutoComplete/__stories__/WithShowAllValues';
94
109
  export { WithMinLength } from '@digigov/ui/form/AutoComplete/__stories__/WithMinLength';
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import React, { Component, type JSX } from 'react';
2
2
  import AutoCompleteStatus from '@digigov/react-core/AutoCompleteStatus';
3
3
  import AutoCompleteStatusContainer from '@digigov/react-core/AutoCompleteStatusContainer';
4
4
 
@@ -7,23 +7,7 @@ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
7
7
  export const WithAutoSelect = (_: any) => (
8
8
  <div>
9
9
  <FieldContainer>
10
- <AutoComplete
11
- source={suggest}
12
- autoselect={true}
13
- id="govgr"
14
- // tStatusResults={(x, y) => {
15
- // return `Results x: ${x} y: ${y}`;
16
- // }}
17
- templates={{
18
- suggestion: (value) => {
19
- return '--> ' + value;
20
- },
21
- inputValue: (value) => {
22
- return value ? 'Χώρα: ' + value : '';
23
- },
24
- }}
25
- tNoResults={() => 'Δεν υπάρχουν αποτελέσματα'}
26
- />
10
+ <AutoComplete source={suggest} autoselect={true} id="govgr" />
27
11
  </FieldContainer>
28
12
  <Button>Υποβολή</Button>
29
13
  </div>
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { AutoComplete } from '@digigov/ui/form/AutoComplete';
3
+ import { suggest } from '@digigov/ui/form/AutoComplete/utils';
4
+ import { Button } from '@digigov/ui/form/Button';
5
+ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
6
+
7
+ export const WithCustomValue = () => (
8
+ <div>
9
+ <FieldContainer>
10
+ <AutoComplete
11
+ source={suggest}
12
+ id="govgr"
13
+ templates={{
14
+ suggestion: (value) => {
15
+ return '--> ' + value;
16
+ },
17
+ inputValue: (value) => {
18
+ return value ? 'Χώρα: ' + value : '';
19
+ },
20
+ }}
21
+ tNoResults={() => 'Δεν υπάρχουν αποτελέσματα'}
22
+ />
23
+ </FieldContainer>
24
+ <Button>Υποβολή</Button>
25
+ </div>
26
+ );
27
+
28
+ export default WithCustomValue;
@@ -7,12 +7,7 @@ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
7
7
  export const WithDefaultValue = (_: any) => (
8
8
  <div>
9
9
  <FieldContainer>
10
- <AutoComplete
11
- source={suggest}
12
- autoselect={true}
13
- defaultValue="Γερμανία"
14
- id="govgr"
15
- />
10
+ <AutoComplete source={suggest} defaultValue="Γερμανία" id="govgr" />
16
11
  </FieldContainer>
17
12
  <Button>Υποβολή</Button>
18
13
  </div>
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { AutoComplete } from '@digigov/ui/form/AutoComplete';
3
+ import { suggest } from '@digigov/ui/form/AutoComplete/utils';
4
+ import { Button } from '@digigov/ui/form/Button';
5
+ import { FieldContainer } from '@digigov/ui/form/FieldContainer';
6
+
7
+ export const WithHint = () => (
8
+ <div>
9
+ <FieldContainer>
10
+ <AutoComplete source={suggest} id="govgr" hint={true} />
11
+ </FieldContainer>
12
+ <Button>Υποβολή</Button>
13
+ </div>
14
+ );
15
+
16
+ export default WithHint;