@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.
- package/app/Footer/__stories__/Default.d.ts +1 -1
- package/app/Loader/Loader.stories.d.ts +45 -1
- package/app/Loader/__stories__/AccessibilityLoader.d.ts +3 -0
- package/app/Loader/__stories__/FullPageLoader.d.ts +1 -0
- package/app/Loader/__stories__/Secondary.d.ts +3 -0
- package/app/Loader/__stories__/Sizes.d.ts +3 -0
- package/app/Loader/index.native.d.ts +2 -2
- package/app/Loader/index.native.js.map +2 -2
- package/app/Loader/index.web/index.js +17 -1
- package/app/Loader/index.web.d.ts +19 -1
- package/app/Loader/index.web.js.map +3 -3
- package/app/Masthead/Masthead.stories.d.ts +28 -1
- package/app/Modal/Modal.stories.d.ts +20 -1
- package/app/Modal/hooks/index.js +2 -6
- package/app/Modal/hooks.d.ts +2 -2
- package/app/Modal/hooks.js.map +2 -2
- package/app/Modal/index.web/index.js +5 -5
- package/app/Modal/index.web.js.map +2 -2
- package/app/NotFound/__stories__/Default.d.ts +1 -1
- package/app/OutdatedBrowserBanner/index.d.ts +1 -0
- package/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/app/PhaseBannerHeader/index.d.ts +1 -1
- package/app/PhaseBannerHeader/index.js.map +2 -2
- package/app/Skeleton/__stories__/Button.d.ts +1 -1
- package/app/Skeleton/__stories__/Default.d.ts +1 -1
- package/app/Skeleton/__stories__/NoAnimation.d.ts +1 -1
- package/app/hooks/useNotificationArea/index.js +76 -0
- package/app/hooks/useNotificationArea/package.json +6 -0
- package/app/hooks/useNotificationArea.d.ts +1 -0
- package/app/hooks/useNotificationArea.js.map +7 -0
- package/cjs/app/Loader/index.native.js.map +2 -2
- package/cjs/app/Loader/index.web/index.js +33 -2
- package/cjs/app/Loader/index.web.js.map +3 -3
- package/cjs/app/Modal/hooks/index.js +2 -6
- package/cjs/app/Modal/hooks.js.map +2 -2
- package/cjs/app/Modal/index.web/index.js +5 -5
- package/cjs/app/Modal/index.web.js.map +2 -2
- package/cjs/app/OutdatedBrowserBanner/index.js.map +2 -2
- package/cjs/app/PhaseBannerHeader/index.js.map +2 -2
- package/cjs/app/hooks/useNotificationArea/index.js +99 -0
- package/cjs/app/hooks/useNotificationArea.js.map +7 -0
- package/cjs/content/Accordion/hooks.js.map +1 -1
- package/cjs/form/AutoComplete/Status/index.js.map +2 -2
- package/cjs/form/AutoComplete/index.js +32 -19
- package/cjs/form/AutoComplete/index.js.map +2 -2
- package/cjs/i18n/locales/el/index.js +51 -23
- package/cjs/i18n/locales/el.js.map +2 -2
- package/cjs/i18n/locales/en/index.js +36 -8
- package/cjs/i18n/locales/en.js.map +2 -2
- package/cjs/layouts/Hidden/index.js +19 -0
- package/cjs/layouts/Hidden/index.js.map +3 -3
- package/cjs/lazy.js +1 -1
- package/cjs/lazy.js.map +2 -2
- package/cjs/navigation/Drawer/hooks/index.js +2 -6
- package/cjs/navigation/Drawer/hooks.js.map +2 -2
- package/cjs/navigation/Pagination/hooks/index.js +2 -2
- package/cjs/navigation/Pagination/hooks.js.map +2 -2
- package/cjs/navigation/Tabs/hooks.js.map +1 -1
- package/cjs/registry.js +50 -48
- package/cjs/registry.js.map +2 -2
- package/cjs/typography/CodeBlock/index.js +1 -2
- package/cjs/typography/CodeBlock/index.js.map +2 -2
- package/cjs/utils/hooks/useDebounce/index.js +1 -1
- package/cjs/utils/hooks/useDebounce.js.map +2 -2
- package/content/Accordion/Accordion.stories.d.ts +27 -16
- package/content/Accordion/hooks.js.map +1 -1
- package/content/Chip/__stories__/Default.d.ts +1 -1
- package/content/SummaryList/SummaryList.stories.d.ts +4 -1
- package/feedback/NotificationBanner/NotificationBanner.stories.d.ts +14 -13
- package/feedback/NotificationBanner/__stories__/Expanded.d.ts +3 -0
- package/feedback/PhaseBanner/PhaseBanner.stories.d.ts +1 -1
- package/form/AutoComplete/AutoComplete.stories.d.ts +57 -16
- package/form/AutoComplete/Status/index.d.ts +1 -1
- package/form/AutoComplete/Status/index.js.map +2 -2
- package/form/AutoComplete/__stories__/WithCustomValue.d.ts +3 -0
- package/form/AutoComplete/__stories__/WithHint.d.ts +3 -0
- package/form/AutoComplete/index.d.ts +4 -3
- package/form/AutoComplete/index.js +32 -18
- package/form/AutoComplete/index.js.map +2 -2
- package/form/Button/__stories__/ThemeToggle.d.ts +1 -1
- package/form/FileUpload/FileUpload.stories.d.ts +1 -0
- package/form/FileUpload/__stories__/WithVariantLink.d.ts +3 -0
- package/i18n/locales/el/index.js +51 -23
- package/i18n/locales/el.d.ts +33 -5
- package/i18n/locales/el.js.map +2 -2
- package/i18n/locales/en/index.js +36 -8
- package/i18n/locales/en.d.ts +32 -4
- package/i18n/locales/en.js.map +2 -2
- package/index.js +1 -1
- package/layouts/Grid/Grid.stories.d.ts +82 -0
- package/layouts/Hidden/Hidden.stories.d.ts +115 -0
- package/layouts/Hidden/index.d.ts +2 -0
- package/layouts/Hidden/index.js +5 -0
- package/layouts/Hidden/index.js.map +2 -2
- package/layouts/Stack/Stack.stories.d.ts +76 -0
- package/lazy/index.js +1 -1
- package/navigation/BackToTopLink/BackToTopLink.stories.d.ts +2 -0
- package/navigation/Drawer/hooks/index.js +2 -6
- package/navigation/Drawer/hooks.js.map +2 -2
- package/navigation/Dropdown/Dropdown.stories.d.ts +75 -1
- package/navigation/Pagination/hooks/index.js +2 -2
- package/navigation/Pagination/hooks.js.map +2 -2
- package/navigation/SkipLink/SkipLink.stories.d.ts +2 -0
- package/navigation/Tabs/hooks.d.ts +1 -1
- package/navigation/Tabs/hooks.js.map +1 -1
- package/package.json +7 -7
- package/registry/index.js +50 -48
- package/src/app/BannerContainer/__stories__/CookiesBanner.tsx +1 -21
- package/src/app/Footer/__stories__/Default.tsx +1 -1
- package/src/app/Header/doc.mdx +3 -3
- package/src/app/Loader/Loader.stories.jsx +54 -0
- package/src/app/Loader/__stories__/AccessibilityLoader.tsx +27 -0
- package/src/app/Loader/__stories__/FullPageLoader.tsx +9 -5
- package/src/app/Loader/__stories__/Secondary.tsx +11 -0
- package/src/app/Loader/__stories__/Sizes.tsx +18 -0
- package/src/app/Loader/doc.mdx +39 -0
- package/src/app/Loader/index.native.tsx +2 -2
- package/src/app/Loader/index.test.tsx +12 -0
- package/src/app/Loader/index.web.tsx +39 -1
- package/src/app/Masthead/Masthead.stories.jsx +66 -0
- package/src/app/Masthead/doc.mdx +3 -3
- package/src/app/Modal/Modal.stories.jsx +64 -0
- package/src/app/Modal/__stories__/AlertDialog.tsx +1 -1
- package/src/app/Modal/__stories__/Auto.tsx +1 -1
- package/src/app/Modal/__stories__/Default.tsx +1 -1
- package/src/app/Modal/__stories__/Dense.tsx +1 -1
- package/src/app/Modal/__stories__/WithHooks.tsx +1 -1
- package/src/app/Modal/__stories__/WithoutModalGaps.tsx +1 -1
- package/src/app/Modal/hooks.ts +8 -8
- package/src/app/Modal/index.web.tsx +5 -7
- package/src/app/NotFound/__stories__/Default.tsx +1 -1
- package/src/app/OutdatedBrowserBanner/index.tsx +1 -1
- package/src/app/PhaseBannerHeader/index.tsx +1 -1
- package/src/app/Skeleton/__stories__/Button.tsx +1 -1
- package/src/app/Skeleton/__stories__/Default.tsx +1 -1
- package/src/app/Skeleton/__stories__/NoAnimation.tsx +1 -1
- package/src/app/hooks/useNotificationArea.tsx +105 -0
- package/src/content/Accordion/Accordion.stories.jsx +9 -1
- package/src/content/Accordion/doc.mdx +1 -2
- package/src/content/Accordion/hooks.ts +1 -1
- package/src/content/Card/doc.mdx +11 -11
- package/src/content/Chip/__stories__/Default.tsx +1 -1
- package/src/content/Chip/doc.mdx +4 -4
- package/src/content/List/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/content/List/doc.mdx +3 -3
- package/src/content/SummaryList/SummaryList.stories.js +5 -1
- package/src/content/TaskList/doc.mdx +1 -1
- package/src/content/Timeline/doc.mdx +1 -1
- package/src/feedback/CopyToClipboard/doc.mdx +1 -1
- package/src/feedback/ErrorSummary/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/feedback/ErrorSummary/doc.mdx +1 -1
- package/src/feedback/NotificationBanner/NotificationBanner.stories.js +10 -9
- package/src/feedback/NotificationBanner/__snapshots__/index.spec.tsx.snap +24 -14
- package/src/feedback/NotificationBanner/__stories__/Expanded.tsx +27 -0
- package/src/feedback/NotificationBanner/doc.mdx +15 -6
- package/src/feedback/NotificationBanner/index.test.tsx +4 -0
- package/src/feedback/PhaseBanner/PhaseBanner.stories.jsx +1 -1
- package/src/feedback/WarningText/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/form/AutoComplete/AutoComplete.stories.jsx +19 -4
- package/src/form/AutoComplete/Status/index.tsx +1 -1
- package/src/form/AutoComplete/__stories__/WithAutoSelect.tsx +1 -17
- package/src/form/AutoComplete/__stories__/WithCustomValue.tsx +28 -0
- package/src/form/AutoComplete/__stories__/WithDefaultValue.tsx +1 -6
- package/src/form/AutoComplete/__stories__/WithHint.tsx +16 -0
- package/src/form/AutoComplete/doc.mdx +14 -13
- package/src/form/AutoComplete/index.test.tsx +8 -0
- package/src/form/AutoComplete/index.tsx +38 -25
- package/src/form/Button/__stories__/ThemeToggle.tsx +1 -1
- package/src/form/Button/doc.mdx +25 -14
- package/src/form/Checkbox/doc.mdx +1 -1
- package/src/form/FileUpload/FileUpload.stories.js +1 -0
- package/src/form/FileUpload/__stories__/WithVariantLink.tsx +24 -0
- package/src/form/FileUpload/index.test.tsx +4 -0
- package/src/form/RadioContainer/doc.mdx +4 -4
- package/src/i18n/locales/el.ts +73 -22
- package/src/i18n/locales/en.ts +43 -7
- package/src/layouts/Basic/doc.mdx +0 -2
- package/src/layouts/Grid/Grid.stories.jsx +143 -0
- package/src/layouts/Hidden/Hidden.stories.jsx +62 -0
- package/src/layouts/Hidden/index.tsx +3 -0
- package/src/layouts/Stack/Stack.stories.jsx +104 -0
- package/src/lazy.js +1 -1
- package/src/navigation/BackToTopLink/BackToTopLink.stories.js +4 -0
- package/src/navigation/BackToTopLink/doc.mdx +22 -0
- package/src/navigation/Breadcrumbs/doc.mdx +4 -0
- package/src/navigation/Drawer/hooks.ts +6 -6
- package/src/navigation/Dropdown/Dropdown.stories.jsx +118 -0
- package/src/navigation/Dropdown/doc.mdx +24 -2
- package/src/navigation/NavList/__snapshots__/index.spec.tsx.snap +13 -3
- package/src/navigation/NavList/doc.mdx +1 -1
- package/src/navigation/Pagination/doc.mdx +5 -1
- package/src/navigation/Pagination/hooks.ts +2 -2
- package/src/navigation/SkipLink/SkipLink.stories.js +4 -0
- package/src/navigation/SkipLink/doc.mdx +19 -0
- package/src/navigation/Tabs/hooks.ts +2 -2
- package/src/registry.js +50 -48
- package/src/typography/CodeBlock/CodeBlock.stories.js +24 -0
- package/src/typography/CodeBlock/index.tsx +14 -12
- package/src/typography/Heading/Heading.stories.js +12 -0
- package/src/typography/HeadingCaption/HeadingCaption.stories.js +9 -0
- package/src/typography/Hint/Hint.stories.js +11 -0
- package/src/typography/Hint/__stories__/Default.tsx +1 -1
- package/src/typography/Hint/__stories__/FontSizes.tsx +4 -4
- package/src/typography/NormalText/NormalText.stories.js +10 -0
- package/src/typography/NormalText/__stories__/Default.tsx +1 -1
- package/src/typography/Paragraph/Paragraph.stories.js +23 -0
- package/src/typography/Paragraph/__stories__/Default.tsx +1 -1
- package/src/typography/Paragraph/__stories__/LeadVariant.tsx +3 -1
- package/src/typography/Paragraph/__stories__/SmallVariant.tsx +3 -1
- package/src/utils/hooks/useDebounce.ts +1 -1
- package/stories-registry/index.js +170 -154
- package/typography/CodeBlock/CodeBlock.stories.d.ts +11 -0
- package/typography/CodeBlock/index.d.ts +1 -1
- package/typography/CodeBlock/index.js +1 -2
- package/typography/CodeBlock/index.js.map +2 -2
- package/typography/Heading/Heading.stories.d.ts +10 -0
- package/typography/HeadingCaption/HeadingCaption.stories.d.ts +8 -0
- package/typography/Hint/Hint.stories.d.ts +9 -0
- package/typography/Hint/__stories__/Default.d.ts +1 -1
- package/typography/NormalText/NormalText.stories.d.ts +8 -0
- package/typography/NormalText/__stories__/Default.d.ts +1 -1
- package/typography/Paragraph/Paragraph.stories.d.ts +37 -0
- package/typography/Paragraph/__stories__/Default.d.ts +1 -1
- package/typography/Paragraph/__stories__/LeadVariant.d.ts +1 -1
- package/typography/Paragraph/__stories__/SmallVariant.d.ts +1 -1
- package/utils/hooks/useDebounce/index.js +1 -1
- package/utils/hooks/useDebounce.js.map +2 -2
- package/utils/hooks/useLatest.d.ts +1 -1
- package/src/app/Loader/Loader.stories.js +0 -8
- package/src/app/Masthead/Masthead.stories.js +0 -17
- package/src/app/Modal/Modal.stories.js +0 -18
- package/src/layouts/Grid/Grid.stories.js +0 -12
- package/src/layouts/Stack/Stack.stories.js +0 -15
- package/src/navigation/Dropdown/Dropdown.stories.js +0 -23
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Grid from '@digigov/ui/layouts/Grid';
|
|
3
|
+
import doc from './doc.mdx?raw';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Digigov UI/layouts/Grid',
|
|
7
|
+
component: Grid,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
markdown: doc,
|
|
10
|
+
displayName: 'Grid',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const WithControls = {
|
|
14
|
+
render: (args) => {
|
|
15
|
+
return (
|
|
16
|
+
<Grid
|
|
17
|
+
role="grid"
|
|
18
|
+
aria-label="grid-example"
|
|
19
|
+
container
|
|
20
|
+
spacing={args.spacing}
|
|
21
|
+
inline={args.inline}
|
|
22
|
+
>
|
|
23
|
+
<Grid
|
|
24
|
+
role="row"
|
|
25
|
+
xs={args.xs}
|
|
26
|
+
sm={args.sm}
|
|
27
|
+
md={args.md}
|
|
28
|
+
lg={args.lg}
|
|
29
|
+
xl={args.xl}
|
|
30
|
+
>
|
|
31
|
+
grid item no.1
|
|
32
|
+
</Grid>
|
|
33
|
+
<Grid
|
|
34
|
+
role="row"
|
|
35
|
+
xs={args.xs}
|
|
36
|
+
sm={args.sm}
|
|
37
|
+
md={args.md}
|
|
38
|
+
lg={args.lg}
|
|
39
|
+
xl={args.xl}
|
|
40
|
+
>
|
|
41
|
+
grid item no.2
|
|
42
|
+
</Grid>
|
|
43
|
+
<Grid
|
|
44
|
+
role="row"
|
|
45
|
+
xs={args.xs}
|
|
46
|
+
sm={args.sm}
|
|
47
|
+
md={args.md}
|
|
48
|
+
lg={args.lg}
|
|
49
|
+
xl={args.xl}
|
|
50
|
+
>
|
|
51
|
+
grid item no.3
|
|
52
|
+
</Grid>
|
|
53
|
+
<Grid
|
|
54
|
+
role="row"
|
|
55
|
+
xs={args.xs}
|
|
56
|
+
sm={args.sm}
|
|
57
|
+
md={args.md}
|
|
58
|
+
lg={args.lg}
|
|
59
|
+
xl={args.xl}
|
|
60
|
+
>
|
|
61
|
+
grid item no.4
|
|
62
|
+
</Grid>
|
|
63
|
+
<Grid
|
|
64
|
+
role="row"
|
|
65
|
+
xs={args.xs}
|
|
66
|
+
sm={args.sm}
|
|
67
|
+
md={args.md}
|
|
68
|
+
lg={args.lg}
|
|
69
|
+
xl={args.xl}
|
|
70
|
+
>
|
|
71
|
+
grid item no.5
|
|
72
|
+
</Grid>
|
|
73
|
+
<Grid
|
|
74
|
+
role="row"
|
|
75
|
+
xs={args.xs}
|
|
76
|
+
sm={args.sm}
|
|
77
|
+
md={args.md}
|
|
78
|
+
lg={args.lg}
|
|
79
|
+
xl={args.xl}
|
|
80
|
+
>
|
|
81
|
+
grid item no.6
|
|
82
|
+
</Grid>
|
|
83
|
+
</Grid>
|
|
84
|
+
);
|
|
85
|
+
},
|
|
86
|
+
args: {
|
|
87
|
+
inline: false,
|
|
88
|
+
spacing: 4,
|
|
89
|
+
xs: 12,
|
|
90
|
+
sm: 6,
|
|
91
|
+
md: 4,
|
|
92
|
+
lg: 3,
|
|
93
|
+
xl: 2,
|
|
94
|
+
},
|
|
95
|
+
argsTypes: {
|
|
96
|
+
inline: {
|
|
97
|
+
control: 'boolean',
|
|
98
|
+
},
|
|
99
|
+
spacing: {
|
|
100
|
+
control: {
|
|
101
|
+
type: 'select',
|
|
102
|
+
},
|
|
103
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
104
|
+
},
|
|
105
|
+
xs: {
|
|
106
|
+
control: {
|
|
107
|
+
type: 'select',
|
|
108
|
+
},
|
|
109
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
110
|
+
},
|
|
111
|
+
sm: {
|
|
112
|
+
control: {
|
|
113
|
+
type: 'select',
|
|
114
|
+
},
|
|
115
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
116
|
+
},
|
|
117
|
+
md: {
|
|
118
|
+
control: {
|
|
119
|
+
type: 'select',
|
|
120
|
+
},
|
|
121
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
122
|
+
},
|
|
123
|
+
lg: {
|
|
124
|
+
control: {
|
|
125
|
+
type: 'select',
|
|
126
|
+
},
|
|
127
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
128
|
+
},
|
|
129
|
+
xl: {
|
|
130
|
+
control: {
|
|
131
|
+
type: 'select',
|
|
132
|
+
},
|
|
133
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
parameters: {
|
|
137
|
+
controls: { exclude: ['ref'] },
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
export { Default } from '@digigov/ui/layouts/Grid/__stories__/Default';
|
|
142
|
+
export { ResponsiveSpacing } from '@digigov/ui/layouts/Grid/__stories__/ResponsiveSpacing';
|
|
143
|
+
export { Inline } from '@digigov/ui/layouts/Grid/__stories__/Inline';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Hidden from '@digigov/ui/layouts/Hidden';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Digigov UI/layouts/Hidden',
|
|
6
|
+
component: Hidden,
|
|
7
|
+
displayName: 'Hidden',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const WithControls = {
|
|
11
|
+
args: {
|
|
12
|
+
children: 'Περιεχόμενο μέσα σε Hidden.',
|
|
13
|
+
xsUpHidden: false,
|
|
14
|
+
smUpHidden: false,
|
|
15
|
+
mdUpHidden: false,
|
|
16
|
+
lgUpHidden: false,
|
|
17
|
+
xlUpHidden: false,
|
|
18
|
+
xsHidden: false,
|
|
19
|
+
smHidden: false,
|
|
20
|
+
mdHidden: false,
|
|
21
|
+
lgHidden: false,
|
|
22
|
+
xlHidden: false,
|
|
23
|
+
},
|
|
24
|
+
argTypes: {
|
|
25
|
+
children: {
|
|
26
|
+
control: { type: 'text' },
|
|
27
|
+
},
|
|
28
|
+
xsUpHidden: {
|
|
29
|
+
control: { type: 'boolean' },
|
|
30
|
+
},
|
|
31
|
+
smUpHidden: {
|
|
32
|
+
control: { type: 'boolean' },
|
|
33
|
+
},
|
|
34
|
+
mdUpHidden: {
|
|
35
|
+
control: { type: 'boolean' },
|
|
36
|
+
},
|
|
37
|
+
lgUpHidden: {
|
|
38
|
+
control: { type: 'boolean' },
|
|
39
|
+
},
|
|
40
|
+
xlUpHidden: {
|
|
41
|
+
control: { type: 'boolean' },
|
|
42
|
+
},
|
|
43
|
+
xsHidden: {
|
|
44
|
+
control: { type: 'boolean' },
|
|
45
|
+
},
|
|
46
|
+
smHidden: {
|
|
47
|
+
control: { type: 'boolean' },
|
|
48
|
+
},
|
|
49
|
+
mdHidden: {
|
|
50
|
+
control: { type: 'boolean' },
|
|
51
|
+
},
|
|
52
|
+
lgHidden: {
|
|
53
|
+
control: { type: 'boolean' },
|
|
54
|
+
},
|
|
55
|
+
xlHidden: {
|
|
56
|
+
control: { type: 'boolean' },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
parameters: {
|
|
60
|
+
controls: { exclude: ['ref'] },
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Stack from '@digigov/ui/layouts/Stack';
|
|
3
|
+
import Card from '@digigov/ui/content/Card';
|
|
4
|
+
import doc from './doc.mdx?raw';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'Digigov UI/layouts/Stack',
|
|
8
|
+
component: Stack,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
markdown: doc,
|
|
11
|
+
displayName: 'Stack',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const WithControls = {
|
|
15
|
+
render: (args) => {
|
|
16
|
+
return (
|
|
17
|
+
<Stack
|
|
18
|
+
spacing={args.spacing}
|
|
19
|
+
alignItems={args.alignItems}
|
|
20
|
+
direction={args.direction}
|
|
21
|
+
justifyContent={args.justifyContent}
|
|
22
|
+
alignContent={args.alignContent}
|
|
23
|
+
flexWrap={args.flexWrap}
|
|
24
|
+
>
|
|
25
|
+
<Card variant="border"> Item 1 </Card>
|
|
26
|
+
<Card variant="border"> Item 2 </Card>
|
|
27
|
+
<Card variant="border"> Item 3 </Card>
|
|
28
|
+
<Card variant="border"> Item 4 </Card>
|
|
29
|
+
<Card variant="border"> Item 5 </Card>
|
|
30
|
+
<Card variant="border"> Item 6 </Card>
|
|
31
|
+
</Stack>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
spacing: 4,
|
|
36
|
+
direction: 'row',
|
|
37
|
+
justifyContent: 'flex-start',
|
|
38
|
+
alignItems: 'flex-start',
|
|
39
|
+
alignContent: 'center',
|
|
40
|
+
flexWrap: 'nowrap',
|
|
41
|
+
},
|
|
42
|
+
argsTypes: {
|
|
43
|
+
spacing: {
|
|
44
|
+
control: {
|
|
45
|
+
type: 'select',
|
|
46
|
+
},
|
|
47
|
+
options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
|
|
48
|
+
},
|
|
49
|
+
direction: {
|
|
50
|
+
control: {
|
|
51
|
+
type: 'select',
|
|
52
|
+
},
|
|
53
|
+
options: ['row', 'row-reverse', 'column', 'column-reverse'],
|
|
54
|
+
},
|
|
55
|
+
justifyContent: {
|
|
56
|
+
control: {
|
|
57
|
+
type: 'select',
|
|
58
|
+
},
|
|
59
|
+
options: [
|
|
60
|
+
'flex-start',
|
|
61
|
+
'flex-end',
|
|
62
|
+
'center',
|
|
63
|
+
'space-between',
|
|
64
|
+
'space-around',
|
|
65
|
+
'space-evenly',
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
alignItems: {
|
|
69
|
+
control: {
|
|
70
|
+
type: 'select',
|
|
71
|
+
},
|
|
72
|
+
options: ['stretch', 'flex-start', 'flex-end', 'center', 'baseline'],
|
|
73
|
+
},
|
|
74
|
+
alignContent: {
|
|
75
|
+
control: {
|
|
76
|
+
type: 'select',
|
|
77
|
+
},
|
|
78
|
+
options: [
|
|
79
|
+
'stretch',
|
|
80
|
+
'flex-start',
|
|
81
|
+
'flex-end',
|
|
82
|
+
'center',
|
|
83
|
+
'space-between',
|
|
84
|
+
'space-around',
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
flexWrap: {
|
|
88
|
+
control: {
|
|
89
|
+
type: 'select',
|
|
90
|
+
},
|
|
91
|
+
options: ['nowrap', 'wrap'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
parameters: {
|
|
95
|
+
controls: { exclude: ['ref'] },
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export { Default } from '@digigov/ui/layouts/Stack/__stories__/Default';
|
|
100
|
+
export { Spacing } from '@digigov/ui/layouts/Stack/__stories__/Spacing';
|
|
101
|
+
export { Row } from '@digigov/ui/layouts/Stack/__stories__/Row';
|
|
102
|
+
export { NoWrap } from '@digigov/ui/layouts/Stack/__stories__/NoWrap';
|
|
103
|
+
export { JustifyContent } from '@digigov/ui/layouts/Stack/__stories__/JustifyContent';
|
|
104
|
+
export { AlignItems } from '@digigov/ui/layouts/Stack/__stories__/AlignItems';
|
package/src/lazy.js
CHANGED
|
@@ -44,6 +44,7 @@ export default {
|
|
|
44
44
|
'LoaderContainer': lazy(() => import('@digigov/ui/app/Loader').then((module) => ({ default: module['LoaderContainer'] }))),
|
|
45
45
|
'FullPageBackground': lazy(() => import('@digigov/ui/app/Loader').then((module) => ({ default: module['FullPageBackground'] }))),
|
|
46
46
|
'CircularProgress': lazy(() => import('@digigov/ui/app/Loader/index.web').then((module) => ({ default: module['CircularProgress'] }))),
|
|
47
|
+
'CircularProgressBase': lazy(() => import('@digigov/ui/app/Loader/index.web').then((module) => ({ default: module['CircularProgressBase'] }))),
|
|
47
48
|
'Masthead': lazy(() => import('@digigov/ui/app/Masthead').then((module) => ({ default: module['Masthead'] }))),
|
|
48
49
|
'MastheadBody': lazy(() => import('@digigov/ui/app/Masthead').then((module) => ({ default: module['MastheadBody'] }))),
|
|
49
50
|
'MastheadLogo': lazy(() => import('@digigov/ui/app/Masthead').then((module) => ({ default: module['MastheadLogo'] }))),
|
|
@@ -140,7 +141,6 @@ export default {
|
|
|
140
141
|
'WarningText': lazy(() => import('@digigov/ui/feedback/WarningText').then((module) => ({ default: module['WarningText'] }))),
|
|
141
142
|
'AutoComplete': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoComplete'] }))),
|
|
142
143
|
'AutoCompleteInputBase': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoCompleteInputBase'] }))),
|
|
143
|
-
'AutoCompleteInputTypeahead': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoCompleteInputTypeahead'] }))),
|
|
144
144
|
'AutoCompleteResultList': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoCompleteResultList'] }))),
|
|
145
145
|
'AutoCompleteResultListItem': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoCompleteResultListItem'] }))),
|
|
146
146
|
'AutoCompleteContainer': lazy(() => import('@digigov/ui/form/AutoComplete').then((module) => ({ default: module['AutoCompleteContainer'] }))),
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import BackToTopLink from '@digigov/ui/navigation/BackToTopLink';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
3
|
+
|
|
2
4
|
export default {
|
|
3
5
|
title: 'Digigov UI/navigation/BackToTopLink',
|
|
4
6
|
component: BackToTopLink,
|
|
5
7
|
displayName: 'BackToTopLink',
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
markdown: doc,
|
|
6
10
|
};
|
|
7
11
|
export { Default } from '@digigov/ui/navigation/BackToTopLink/__stories__/Default';
|
|
8
12
|
export { InMain } from '@digigov/ui/navigation/BackToTopLink/__stories__/InMain';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: back-to-top
|
|
3
|
+
title: BackToTop
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# BackToTop
|
|
7
|
+
|
|
8
|
+
Use the BackToTopLink component to allow users to quickly navigate to the top of the page.
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
<code src="@digigov/ui/navigation/BackToTopLink/__stories__/Default.tsx" />
|
|
13
|
+
|
|
14
|
+
### Display in main content
|
|
15
|
+
|
|
16
|
+
<code src="@digigov/ui/navigation/BackToTopLink/__stories__/InMain.tsx" />
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
21
|
+
|
|
22
|
+
<ComponentProps componentName={["BackToTopLink", "BackToTopContainer"]} />
|
|
@@ -17,6 +17,10 @@ The Breadcrumbs component lets users show and hide sections of related content o
|
|
|
17
17
|
|
|
18
18
|
<code src="@digigov/ui/navigation/Breadcrumbs/__stories__/WithoutCurrentPage.tsx" />
|
|
19
19
|
|
|
20
|
+
### With hook
|
|
21
|
+
|
|
22
|
+
<code src="@digigov/ui/navigation/Breadcrumbs/__stories__/WithHook.tsx" />
|
|
23
|
+
|
|
20
24
|
## Accessibility
|
|
21
25
|
|
|
22
26
|
You can read more about the accessibility patterns used in our Breadcrumbs
|
|
@@ -28,12 +28,12 @@ export interface UseDrawerReturn {
|
|
|
28
28
|
|
|
29
29
|
export const useDrawer = (): UseDrawerReturn => {
|
|
30
30
|
const [currentOpen, setCurrentOpen] = useState<DrawerId | null>(null);
|
|
31
|
-
const drawersRef = useRef<
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
const buttonsRef = useRef<
|
|
35
|
-
|
|
36
|
-
);
|
|
31
|
+
const drawersRef = useRef<
|
|
32
|
+
Map<DrawerId, React.RefObject<HTMLDivElement | null>>
|
|
33
|
+
>(new Map());
|
|
34
|
+
const buttonsRef = useRef<
|
|
35
|
+
Map<DrawerId, React.RefObject<HTMLButtonElement | null>>
|
|
36
|
+
>(new Map());
|
|
37
37
|
|
|
38
38
|
const open = useCallback((id: DrawerId) => {
|
|
39
39
|
setCurrentOpen(id);
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SectionBreak } from '@digigov/ui/layouts/SectionBreak';
|
|
3
|
+
import {
|
|
4
|
+
Dropdown,
|
|
5
|
+
DropdownButton,
|
|
6
|
+
DropdownContent,
|
|
7
|
+
} from '@digigov/ui/navigation/Dropdown';
|
|
8
|
+
import { NavListItemAction, NavList } from '@digigov/ui/navigation/NavList';
|
|
9
|
+
|
|
10
|
+
import doc from './doc.mdx?raw';
|
|
11
|
+
export default {
|
|
12
|
+
title: 'Digigov UI/navigation/Dropdown',
|
|
13
|
+
description:
|
|
14
|
+
'Use the dropdown component to provide more options to users in cases where there is not enough space such as tables, navbars, etc.',
|
|
15
|
+
link: 'https://guide.services.gov.gr/docs/patterns/admin-pages/components/dropdown',
|
|
16
|
+
component: Dropdown,
|
|
17
|
+
tags: ['autodocs'],
|
|
18
|
+
markdown: doc,
|
|
19
|
+
displayName: 'Dropdown',
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const WithControls = {
|
|
23
|
+
render: (args) => {
|
|
24
|
+
return (
|
|
25
|
+
<Dropdown
|
|
26
|
+
align={args.align}
|
|
27
|
+
disabled={args.disabled}
|
|
28
|
+
dense={args.dense}
|
|
29
|
+
placement={args.placement}
|
|
30
|
+
closeBehaviour={args.closeBehaviour}
|
|
31
|
+
float={args.float}
|
|
32
|
+
>
|
|
33
|
+
<DropdownButton
|
|
34
|
+
role="button"
|
|
35
|
+
aria-haspopup="true"
|
|
36
|
+
aria-controls="menu2"
|
|
37
|
+
arrow
|
|
38
|
+
>
|
|
39
|
+
Ενέργειες
|
|
40
|
+
</DropdownButton>
|
|
41
|
+
<DropdownContent role="menu" id="menu2" scrollable={args.scrollable}>
|
|
42
|
+
<NavList layout="vertical">
|
|
43
|
+
<NavListItemAction role="menuitem" href="#">
|
|
44
|
+
Επεξεργασία
|
|
45
|
+
</NavListItemAction>
|
|
46
|
+
<NavListItemAction role="menuitem" href="#">
|
|
47
|
+
Μετακίνηση
|
|
48
|
+
</NavListItemAction>
|
|
49
|
+
<NavListItemAction role="menuitem" href="#">
|
|
50
|
+
Οριστική διαγραφή
|
|
51
|
+
</NavListItemAction>
|
|
52
|
+
</NavList>
|
|
53
|
+
</DropdownContent>
|
|
54
|
+
</Dropdown>
|
|
55
|
+
);
|
|
56
|
+
},
|
|
57
|
+
args: {
|
|
58
|
+
align: 'right',
|
|
59
|
+
placement: 'bottom',
|
|
60
|
+
disabled: false,
|
|
61
|
+
dense: false,
|
|
62
|
+
closeBehaviour: 'clickButton',
|
|
63
|
+
float: false,
|
|
64
|
+
scrollable: false,
|
|
65
|
+
},
|
|
66
|
+
argsTypes: {
|
|
67
|
+
align: {
|
|
68
|
+
control: {
|
|
69
|
+
type: 'select',
|
|
70
|
+
},
|
|
71
|
+
options: ['left', 'right'],
|
|
72
|
+
},
|
|
73
|
+
placement: {
|
|
74
|
+
control: {
|
|
75
|
+
type: 'select',
|
|
76
|
+
},
|
|
77
|
+
options: ['top', 'bottom'],
|
|
78
|
+
},
|
|
79
|
+
disabled: {
|
|
80
|
+
control: {
|
|
81
|
+
type: 'boolean',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
dense: {
|
|
85
|
+
control: {
|
|
86
|
+
type: 'boolean',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
closeBehaviour: {
|
|
90
|
+
control: {
|
|
91
|
+
type: 'select',
|
|
92
|
+
},
|
|
93
|
+
options: ['clickButton', 'clickOutside'],
|
|
94
|
+
},
|
|
95
|
+
float: {
|
|
96
|
+
control: {
|
|
97
|
+
type: 'boolean',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
scrollable: {
|
|
101
|
+
control: {
|
|
102
|
+
type: 'boolean',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export { Default } from '@digigov/ui/navigation/Dropdown/__stories__/Default';
|
|
109
|
+
export { Secondary } from '@digigov/ui/navigation/Dropdown/__stories__/Secondary';
|
|
110
|
+
export { Warning } from '@digigov/ui/navigation/Dropdown/__stories__/Warning';
|
|
111
|
+
export { Disabled } from '@digigov/ui/navigation/Dropdown/__stories__/Disabled';
|
|
112
|
+
export { VariantLink } from '@digigov/ui/navigation/Dropdown/__stories__/VariantLink';
|
|
113
|
+
export { AlignRight } from '@digigov/ui/navigation/Dropdown/__stories__/AlignRight';
|
|
114
|
+
export { PlacementTop } from '@digigov/ui/navigation/Dropdown/__stories__/PlacementTop';
|
|
115
|
+
export { WithIcons } from '@digigov/ui/navigation/Dropdown/__stories__/WithIcons';
|
|
116
|
+
export { ContentPosition } from '@digigov/ui/navigation/Dropdown/__stories__/ContentPosition';
|
|
117
|
+
export { ScrollableContent } from '@digigov/ui/navigation/Dropdown/__stories__/ScrollableContent';
|
|
118
|
+
export { Dense } from '@digigov/ui/navigation/Dropdown/__stories__/Dense';
|
|
@@ -10,14 +10,16 @@ title: Dropdown
|
|
|
10
10
|
<div className="dropdown-docs">
|
|
11
11
|
<code src="@digigov/ui/navigation/Dropdown/__stories__/Default.tsx" />
|
|
12
12
|
</div>
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
### With align right
|
|
14
15
|
|
|
15
16
|
You can display the dropdown menu to the right side of the `Dropdown` button.
|
|
16
17
|
|
|
17
18
|
<div className="dropdown-docs">
|
|
18
19
|
<code src="@digigov/ui/navigation/Dropdown/__stories__/AlignRight.tsx" />
|
|
19
20
|
</div>
|
|
20
|
-
|
|
21
|
+
|
|
22
|
+
### With placement top
|
|
21
23
|
|
|
22
24
|
You can display the dropdown menu to the top of the `Dropdown` button.
|
|
23
25
|
|
|
@@ -25,6 +27,26 @@ You can display the dropdown menu to the top of the `Dropdown` button.
|
|
|
25
27
|
<code src="@digigov/ui/navigation/Dropdown/__stories__/PlacementTop.tsx" />
|
|
26
28
|
</div>
|
|
27
29
|
|
|
30
|
+
### With icons
|
|
31
|
+
|
|
32
|
+
<div className="dropdown-docs">
|
|
33
|
+
<code src="@digigov/ui/navigation/Dropdown/__stories__/WithIcons.tsx" />
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
### With scrollable content
|
|
37
|
+
|
|
38
|
+
Use this when the content of the dropdown menu is too long to fit on the screen.
|
|
39
|
+
|
|
40
|
+
<div className="dropdown-docs">
|
|
41
|
+
<code src="@digigov/ui/navigation/Dropdown/__stories__/ScrollableContent.tsx" />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
### Dense
|
|
45
|
+
|
|
46
|
+
<div className="dropdown-docs">
|
|
47
|
+
<code src="@digigov/ui/navigation/Dropdown/__stories__/Dense.tsx" />
|
|
48
|
+
</div>
|
|
49
|
+
|
|
28
50
|
## API
|
|
29
51
|
|
|
30
52
|
See below for a complete reference to all of the props available to the components mentioned here.
|
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
`;
|
|
@@ -19,6 +19,10 @@ pagination component displays a list of page numbers, and allows the user to nav
|
|
|
19
19
|
|
|
20
20
|
<code src="@digigov/ui/navigation/Pagination/__stories__/PaginationWithSmallFont.tsx" />
|
|
21
21
|
|
|
22
|
+
### Dense
|
|
23
|
+
|
|
24
|
+
<code src="@digigov/ui/navigation/Pagination/__stories__/PaginationSmall.tsx" />
|
|
25
|
+
|
|
22
26
|
### With results per page
|
|
23
27
|
|
|
24
28
|
<code src="@digigov/ui/navigation/Pagination/__stories__/WithResultsPerPage.tsx" />
|
|
@@ -34,4 +38,4 @@ See below for a complete reference to all of the props available to the componen
|
|
|
34
38
|
'PaginationList',
|
|
35
39
|
'PaginationListItem',
|
|
36
40
|
]}
|
|
37
|
-
/>
|
|
41
|
+
/>
|
|
@@ -53,8 +53,8 @@ export const usePagination = ({
|
|
|
53
53
|
? currentPage * currentResultsPerPage
|
|
54
54
|
: total;
|
|
55
55
|
|
|
56
|
-
const labelRef = useRef<React.RefObject<HTMLDivElement>>();
|
|
57
|
-
const selectLabelRef = useRef<React.RefObject<HTMLLabelElement>>();
|
|
56
|
+
const labelRef = useRef<React.RefObject<HTMLDivElement>>(undefined);
|
|
57
|
+
const selectLabelRef = useRef<React.RefObject<HTMLLabelElement>>(undefined);
|
|
58
58
|
|
|
59
59
|
useEffect(() => {
|
|
60
60
|
setCurrentPage(totalPages < currentPage ? totalPages : currentPage);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import SkipLink from '@digigov/ui/navigation/SkipLink';
|
|
2
|
+
import doc from './doc.mdx?raw';
|
|
3
|
+
|
|
2
4
|
export default {
|
|
3
5
|
title: 'Digigov UI/navigation/SkipLink',
|
|
4
6
|
description:
|
|
5
7
|
'Use the skip link component to help keyboard-only users skip to the main content on a page.',
|
|
6
8
|
component: SkipLink,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
markdown: doc,
|
|
7
11
|
displayName: 'SkipLink',
|
|
8
12
|
};
|
|
9
13
|
export { Default } from '@digigov/ui/navigation/SkipLink/__stories__/Default';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: skip-link
|
|
3
|
+
title: SkipLink
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# SkipLink
|
|
7
|
+
|
|
8
|
+
SkipLink is a component that allows users to skip to the main content of the page.
|
|
9
|
+
|
|
10
|
+
## How to use
|
|
11
|
+
|
|
12
|
+
<code src="@digigov/ui/navigation/SkipLink/__stories__/Default.tsx" />
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## API
|
|
16
|
+
|
|
17
|
+
See below for a complete reference to all of the props available to the components mentioned here.
|
|
18
|
+
|
|
19
|
+
<ComponentProps componentName={['SkipLink',]}/>
|