@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
package/lazy/index.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'] }))),
|
|
@@ -2,6 +2,8 @@ declare namespace _default {
|
|
|
2
2
|
export let title: string;
|
|
3
3
|
export { BackToTopLink as component };
|
|
4
4
|
export let displayName: string;
|
|
5
|
+
export let tags: string[];
|
|
6
|
+
export { doc as markdown };
|
|
5
7
|
}
|
|
6
8
|
export default _default;
|
|
7
9
|
export { Default } from "@digigov/ui/navigation/BackToTopLink/__stories__/Default";
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import React, { useState, useRef, useCallback } from "react";
|
|
2
2
|
const useDrawer = () => {
|
|
3
3
|
const [currentOpen, setCurrentOpen] = useState(null);
|
|
4
|
-
const drawersRef = useRef(
|
|
5
|
-
|
|
6
|
-
);
|
|
7
|
-
const buttonsRef = useRef(
|
|
8
|
-
/* @__PURE__ */ new Map()
|
|
9
|
-
);
|
|
4
|
+
const drawersRef = useRef(/* @__PURE__ */ new Map());
|
|
5
|
+
const buttonsRef = useRef(/* @__PURE__ */ new Map());
|
|
10
6
|
const open = useCallback((id) => {
|
|
11
7
|
setCurrentOpen(id);
|
|
12
8
|
}, []);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/navigation/Drawer/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useRef, useCallback } from 'react';\n\nexport type DrawerId = string | number;\n\nexport interface UseDrawerReturn {\n open: (id: DrawerId) => void;\n close: () => void;\n currentOpen: DrawerId | null;\n registerDrawer: (\n id: DrawerId,\n options?: {\n upRelative?: string;\n direction?: string;\n }\n ) => {\n open: boolean;\n id: string;\n ref?: React.RefObject<HTMLDivElement>;\n };\n registerAction: (\n id: DrawerId,\n type: 'open' | 'close'\n ) => {\n onClick: () => void;\n ref?: React.RefObject<any>;\n };\n}\n\nexport const useDrawer = (): UseDrawerReturn => {\n const [currentOpen, setCurrentOpen] = useState<DrawerId | null>(null);\n const drawersRef = useRef
|
|
5
|
-
"mappings": "AAAA,OAAO,SAAS,UAAU,QAAQ,mBAAmB;AA4B9C,MAAM,YAAY,MAAuB;AAC9C,QAAM,CAAC,aAAa,cAAc,IAAI,SAA0B,IAAI;AACpE,QAAM,aAAa
|
|
4
|
+
"sourcesContent": ["import React, { useState, useRef, useCallback } from 'react';\n\nexport type DrawerId = string | number;\n\nexport interface UseDrawerReturn {\n open: (id: DrawerId) => void;\n close: () => void;\n currentOpen: DrawerId | null;\n registerDrawer: (\n id: DrawerId,\n options?: {\n upRelative?: string;\n direction?: string;\n }\n ) => {\n open: boolean;\n id: string;\n ref?: React.RefObject<HTMLDivElement>;\n };\n registerAction: (\n id: DrawerId,\n type: 'open' | 'close'\n ) => {\n onClick: () => void;\n ref?: React.RefObject<any>;\n };\n}\n\nexport const useDrawer = (): UseDrawerReturn => {\n const [currentOpen, setCurrentOpen] = useState<DrawerId | null>(null);\n const drawersRef = useRef<\n Map<DrawerId, React.RefObject<HTMLDivElement | null>>\n >(new Map());\n const buttonsRef = useRef<\n Map<DrawerId, React.RefObject<HTMLButtonElement | null>>\n >(new Map());\n\n const open = useCallback((id: DrawerId) => {\n setCurrentOpen(id);\n }, []);\n\n const close = useCallback(() => {\n setCurrentOpen(null);\n }, []);\n\n const registerDrawer = useCallback(\n (id, options) => {\n const drawerId = `drawer-${id}`;\n if (!drawersRef.current.get(id)?.current) {\n drawersRef.current.set(id, React.createRef());\n }\n return {\n open: currentOpen === id,\n id: drawerId,\n ref: drawersRef.current.get(id as string),\n ...options,\n };\n },\n [currentOpen]\n );\n\n const registerAction = useCallback(\n (id: DrawerId, type: 'open' | 'close') => {\n if (!buttonsRef.current.has(id)) {\n buttonsRef.current.set(id, React.createRef());\n }\n return {\n onClick: () => (type === 'open' ? open(id) : close()),\n ref: buttonsRef.current.get(id),\n };\n },\n [currentOpen]\n );\n\n return {\n open,\n close,\n currentOpen,\n registerAction,\n registerDrawer,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAS,UAAU,QAAQ,mBAAmB;AA4B9C,MAAM,YAAY,MAAuB;AAC9C,QAAM,CAAC,aAAa,cAAc,IAAI,SAA0B,IAAI;AACpE,QAAM,aAAa,OAEjB,oBAAI,IAAI,CAAC;AACX,QAAM,aAAa,OAEjB,oBAAI,IAAI,CAAC;AAEX,QAAM,OAAO,YAAY,CAAC,OAAiB;AACzC,mBAAe,EAAE;AAAA,EACnB,GAAG,CAAC,CAAC;AAEL,QAAM,QAAQ,YAAY,MAAM;AAC9B,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,CAAC;AAEL,QAAM,iBAAiB;AAAA,IACrB,CAAC,IAAI,YAAY;AACf,YAAM,WAAW,UAAU,EAAE;AAC7B,UAAI,CAAC,WAAW,QAAQ,IAAI,EAAE,GAAG,SAAS;AACxC,mBAAW,QAAQ,IAAI,IAAI,MAAM,UAAU,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,QACL,MAAM,gBAAgB;AAAA,QACtB,IAAI;AAAA,QACJ,KAAK,WAAW,QAAQ,IAAI,EAAY;AAAA,QACxC,GAAG;AAAA,MACL;AAAA,IACF;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,QAAM,iBAAiB;AAAA,IACrB,CAAC,IAAc,SAA2B;AACxC,UAAI,CAAC,WAAW,QAAQ,IAAI,EAAE,GAAG;AAC/B,mBAAW,QAAQ,IAAI,IAAI,MAAM,UAAU,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,QACL,SAAS,MAAO,SAAS,SAAS,KAAK,EAAE,IAAI,MAAM;AAAA,QACnD,KAAK,WAAW,QAAQ,IAAI,EAAE;AAAA,MAChC;AAAA,IACF;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,6 +8,79 @@ declare namespace _default {
|
|
|
8
8
|
export let displayName: string;
|
|
9
9
|
}
|
|
10
10
|
export default _default;
|
|
11
|
+
export namespace WithControls {
|
|
12
|
+
function render(args: any): React.JSX.Element;
|
|
13
|
+
namespace args {
|
|
14
|
+
let align: string;
|
|
15
|
+
let placement: string;
|
|
16
|
+
let disabled: boolean;
|
|
17
|
+
let dense: boolean;
|
|
18
|
+
let closeBehaviour: string;
|
|
19
|
+
let float: boolean;
|
|
20
|
+
let scrollable: boolean;
|
|
21
|
+
}
|
|
22
|
+
namespace argsTypes {
|
|
23
|
+
export namespace align_1 {
|
|
24
|
+
namespace control {
|
|
25
|
+
let type: string;
|
|
26
|
+
}
|
|
27
|
+
let options: string[];
|
|
28
|
+
}
|
|
29
|
+
export { align_1 as align };
|
|
30
|
+
export namespace placement_1 {
|
|
31
|
+
export namespace control_1 {
|
|
32
|
+
let type_1: string;
|
|
33
|
+
export { type_1 as type };
|
|
34
|
+
}
|
|
35
|
+
export { control_1 as control };
|
|
36
|
+
let options_1: string[];
|
|
37
|
+
export { options_1 as options };
|
|
38
|
+
}
|
|
39
|
+
export { placement_1 as placement };
|
|
40
|
+
export namespace disabled_1 {
|
|
41
|
+
export namespace control_2 {
|
|
42
|
+
let type_2: string;
|
|
43
|
+
export { type_2 as type };
|
|
44
|
+
}
|
|
45
|
+
export { control_2 as control };
|
|
46
|
+
}
|
|
47
|
+
export { disabled_1 as disabled };
|
|
48
|
+
export namespace dense_1 {
|
|
49
|
+
export namespace control_3 {
|
|
50
|
+
let type_3: string;
|
|
51
|
+
export { type_3 as type };
|
|
52
|
+
}
|
|
53
|
+
export { control_3 as control };
|
|
54
|
+
}
|
|
55
|
+
export { dense_1 as dense };
|
|
56
|
+
export namespace closeBehaviour_1 {
|
|
57
|
+
export namespace control_4 {
|
|
58
|
+
let type_4: string;
|
|
59
|
+
export { type_4 as type };
|
|
60
|
+
}
|
|
61
|
+
export { control_4 as control };
|
|
62
|
+
let options_2: string[];
|
|
63
|
+
export { options_2 as options };
|
|
64
|
+
}
|
|
65
|
+
export { closeBehaviour_1 as closeBehaviour };
|
|
66
|
+
export namespace float_1 {
|
|
67
|
+
export namespace control_5 {
|
|
68
|
+
let type_5: string;
|
|
69
|
+
export { type_5 as type };
|
|
70
|
+
}
|
|
71
|
+
export { control_5 as control };
|
|
72
|
+
}
|
|
73
|
+
export { float_1 as float };
|
|
74
|
+
export namespace scrollable_1 {
|
|
75
|
+
export namespace control_6 {
|
|
76
|
+
let type_6: string;
|
|
77
|
+
export { type_6 as type };
|
|
78
|
+
}
|
|
79
|
+
export { control_6 as control };
|
|
80
|
+
}
|
|
81
|
+
export { scrollable_1 as scrollable };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
11
84
|
export { Default } from "@digigov/ui/navigation/Dropdown/__stories__/Default";
|
|
12
85
|
export { Secondary } from "@digigov/ui/navigation/Dropdown/__stories__/Secondary";
|
|
13
86
|
export { Warning } from "@digigov/ui/navigation/Dropdown/__stories__/Warning";
|
|
@@ -19,4 +92,5 @@ export { WithIcons } from "@digigov/ui/navigation/Dropdown/__stories__/WithIcons
|
|
|
19
92
|
export { ContentPosition } from "@digigov/ui/navigation/Dropdown/__stories__/ContentPosition";
|
|
20
93
|
export { ScrollableContent } from "@digigov/ui/navigation/Dropdown/__stories__/ScrollableContent";
|
|
21
94
|
export { Dense } from "@digigov/ui/navigation/Dropdown/__stories__/Dense";
|
|
22
|
-
import Dropdown from '@digigov/ui/navigation/Dropdown';
|
|
95
|
+
import { Dropdown } from '@digigov/ui/navigation/Dropdown';
|
|
96
|
+
import React from 'react';
|
|
@@ -16,8 +16,8 @@ const usePagination = ({
|
|
|
16
16
|
const totalPages = Math.ceil(total / currentResultsPerPage) - 1;
|
|
17
17
|
const currentPageResultsStart = (currentPage - 1) * currentResultsPerPage + 1;
|
|
18
18
|
const currentPageResultsEnd = currentPage * currentResultsPerPage < total ? currentPage * currentResultsPerPage : total;
|
|
19
|
-
const labelRef = useRef();
|
|
20
|
-
const selectLabelRef = useRef();
|
|
19
|
+
const labelRef = useRef(void 0);
|
|
20
|
+
const selectLabelRef = useRef(void 0);
|
|
21
21
|
useEffect(() => {
|
|
22
22
|
setCurrentPage(totalPages < currentPage ? totalPages : currentPage);
|
|
23
23
|
}, [currentPage, totalPages]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/navigation/Pagination/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { PaginationListItemButtonProps } from '@digigov/ui/navigation/Pagination/Pagination';\n\nexport interface usePaginationProps {\n total: number;\n resultsPerPageOptions: number[];\n previousLabel?: string;\n nextLabel?: string;\n}\n\nexport interface usePaginationReturn {\n registerPaginationLabel: () => {\n start: number;\n end: number;\n total: number;\n ref: React.RefObject<HTMLDivElement> | undefined;\n };\n registerPaginationResultsPerPageSelect: () => {\n resultsPerPageOptions: number[];\n currentResultsPerPage: number;\n handleOnChange: React.Dispatch<React.SetStateAction<number>>;\n ref: React.RefObject<HTMLLabelElement> | undefined;\n };\n setTotal: (total: number) => void;\n setCurrentPage: (page: number) => void;\n items: PaginationListItemButtonProps[];\n currentPage: number;\n offset: number;\n limit: number;\n}\n\nexport const usePagination = ({\n total: totalLength,\n resultsPerPageOptions,\n previousLabel,\n nextLabel,\n}: usePaginationProps): usePaginationReturn => {\n const [total, setTotal] = useState(totalLength);\n useEffect(() => {\n setTotal(totalLength);\n }, [totalLength]);\n\n const [currentPage, setCurrentPage] = useState(1);\n const [currentResultsPerPage, setCurrentResultsPerPage] = useState(\n resultsPerPageOptions[0]\n );\n const totalPages = Math.ceil(total / currentResultsPerPage) - 1;\n\n const currentPageResultsStart = (currentPage - 1) * currentResultsPerPage + 1;\n\n const currentPageResultsEnd =\n currentPage * currentResultsPerPage < total\n ? currentPage * currentResultsPerPage\n : total;\n\n const labelRef = useRef<React.RefObject<HTMLDivElement>>();\n const selectLabelRef = useRef<React.RefObject<HTMLLabelElement>>();\n\n useEffect(() => {\n setCurrentPage(totalPages < currentPage ? totalPages : currentPage);\n }, [currentPage, totalPages]);\n\n const registerPaginationLabel = () => {\n return {\n start: currentPageResultsStart,\n end: currentPageResultsEnd,\n total: total,\n ref: labelRef.current,\n };\n };\n const registerPaginationResultsPerPageSelect = () => {\n return {\n resultsPerPageOptions: resultsPerPageOptions,\n currentResultsPerPage: currentResultsPerPage,\n handleOnChange: setCurrentResultsPerPage,\n ref: selectLabelRef.current,\n };\n };\n\n const items = useMemo(() => {\n const content: PaginationListItemButtonProps[] = [];\n let countingDots = false;\n content.push({\n children: previousLabel,\n arrow: 'left',\n onClick: () => currentPage !== 1 && setCurrentPage(currentPage - 1),\n active: currentPage !== 1,\n });\n for (let page = 1; page <= totalPages; page++) {\n if (\n page <= 1 ||\n page >= totalPages ||\n (page <= currentPage + 1 && page >= currentPage - 1)\n ) {\n if (countingDots) {\n countingDots = false;\n }\n console.log(page, currentPage);\n\n content.push({\n children: page,\n variant: 'number',\n onClick: () => setCurrentPage(page),\n isCurrentPage: currentPage === page,\n });\n } else {\n if (!countingDots) {\n countingDots = true;\n content.push({\n variant: 'dots',\n });\n }\n }\n }\n content.push({\n children: nextLabel,\n arrow: 'right',\n onClick: () =>\n currentPage !== totalPages && setCurrentPage(currentPage + 1),\n active: currentPage !== totalPages,\n });\n return content;\n }, [currentPage, totalPages]);\n\n return {\n registerPaginationLabel,\n registerPaginationResultsPerPageSelect,\n items,\n currentPage,\n setCurrentPage,\n offset: (currentPage - 1) * currentResultsPerPage,\n limit: currentResultsPerPage + 1,\n setTotal,\n };\n};\n\nexport default usePagination;\n"],
|
|
5
|
-
"mappings": "AAAA,SAAgB,WAAW,SAAS,QAAQ,gBAAgB;AA+BrD,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,WAAW;AAC9C,YAAU,MAAM;AACd,aAAS,WAAW;AAAA,EACtB,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAChD,QAAM,CAAC,uBAAuB,wBAAwB,IAAI;AAAA,IACxD,sBAAsB,CAAC;AAAA,EACzB;AACA,QAAM,aAAa,KAAK,KAAK,QAAQ,qBAAqB,IAAI;AAE9D,QAAM,2BAA2B,cAAc,KAAK,wBAAwB;AAE5E,QAAM,wBACJ,cAAc,wBAAwB,QAClC,cAAc,wBACd;AAEN,QAAM,WAAW,OAAwC;
|
|
4
|
+
"sourcesContent": ["import React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { PaginationListItemButtonProps } from '@digigov/ui/navigation/Pagination/Pagination';\n\nexport interface usePaginationProps {\n total: number;\n resultsPerPageOptions: number[];\n previousLabel?: string;\n nextLabel?: string;\n}\n\nexport interface usePaginationReturn {\n registerPaginationLabel: () => {\n start: number;\n end: number;\n total: number;\n ref: React.RefObject<HTMLDivElement> | undefined;\n };\n registerPaginationResultsPerPageSelect: () => {\n resultsPerPageOptions: number[];\n currentResultsPerPage: number;\n handleOnChange: React.Dispatch<React.SetStateAction<number>>;\n ref: React.RefObject<HTMLLabelElement> | undefined;\n };\n setTotal: (total: number) => void;\n setCurrentPage: (page: number) => void;\n items: PaginationListItemButtonProps[];\n currentPage: number;\n offset: number;\n limit: number;\n}\n\nexport const usePagination = ({\n total: totalLength,\n resultsPerPageOptions,\n previousLabel,\n nextLabel,\n}: usePaginationProps): usePaginationReturn => {\n const [total, setTotal] = useState(totalLength);\n useEffect(() => {\n setTotal(totalLength);\n }, [totalLength]);\n\n const [currentPage, setCurrentPage] = useState(1);\n const [currentResultsPerPage, setCurrentResultsPerPage] = useState(\n resultsPerPageOptions[0]\n );\n const totalPages = Math.ceil(total / currentResultsPerPage) - 1;\n\n const currentPageResultsStart = (currentPage - 1) * currentResultsPerPage + 1;\n\n const currentPageResultsEnd =\n currentPage * currentResultsPerPage < total\n ? currentPage * currentResultsPerPage\n : total;\n\n const labelRef = useRef<React.RefObject<HTMLDivElement>>(undefined);\n const selectLabelRef = useRef<React.RefObject<HTMLLabelElement>>(undefined);\n\n useEffect(() => {\n setCurrentPage(totalPages < currentPage ? totalPages : currentPage);\n }, [currentPage, totalPages]);\n\n const registerPaginationLabel = () => {\n return {\n start: currentPageResultsStart,\n end: currentPageResultsEnd,\n total: total,\n ref: labelRef.current,\n };\n };\n const registerPaginationResultsPerPageSelect = () => {\n return {\n resultsPerPageOptions: resultsPerPageOptions,\n currentResultsPerPage: currentResultsPerPage,\n handleOnChange: setCurrentResultsPerPage,\n ref: selectLabelRef.current,\n };\n };\n\n const items = useMemo(() => {\n const content: PaginationListItemButtonProps[] = [];\n let countingDots = false;\n content.push({\n children: previousLabel,\n arrow: 'left',\n onClick: () => currentPage !== 1 && setCurrentPage(currentPage - 1),\n active: currentPage !== 1,\n });\n for (let page = 1; page <= totalPages; page++) {\n if (\n page <= 1 ||\n page >= totalPages ||\n (page <= currentPage + 1 && page >= currentPage - 1)\n ) {\n if (countingDots) {\n countingDots = false;\n }\n console.log(page, currentPage);\n\n content.push({\n children: page,\n variant: 'number',\n onClick: () => setCurrentPage(page),\n isCurrentPage: currentPage === page,\n });\n } else {\n if (!countingDots) {\n countingDots = true;\n content.push({\n variant: 'dots',\n });\n }\n }\n }\n content.push({\n children: nextLabel,\n arrow: 'right',\n onClick: () =>\n currentPage !== totalPages && setCurrentPage(currentPage + 1),\n active: currentPage !== totalPages,\n });\n return content;\n }, [currentPage, totalPages]);\n\n return {\n registerPaginationLabel,\n registerPaginationResultsPerPageSelect,\n items,\n currentPage,\n setCurrentPage,\n offset: (currentPage - 1) * currentResultsPerPage,\n limit: currentResultsPerPage + 1,\n setTotal,\n };\n};\n\nexport default usePagination;\n"],
|
|
5
|
+
"mappings": "AAAA,SAAgB,WAAW,SAAS,QAAQ,gBAAgB;AA+BrD,MAAM,gBAAgB,CAAC;AAAA,EAC5B,OAAO;AAAA,EACP;AAAA,EACA;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,WAAW;AAC9C,YAAU,MAAM;AACd,aAAS,WAAW;AAAA,EACtB,GAAG,CAAC,WAAW,CAAC;AAEhB,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,CAAC;AAChD,QAAM,CAAC,uBAAuB,wBAAwB,IAAI;AAAA,IACxD,sBAAsB,CAAC;AAAA,EACzB;AACA,QAAM,aAAa,KAAK,KAAK,QAAQ,qBAAqB,IAAI;AAE9D,QAAM,2BAA2B,cAAc,KAAK,wBAAwB;AAE5E,QAAM,wBACJ,cAAc,wBAAwB,QAClC,cAAc,wBACd;AAEN,QAAM,WAAW,OAAwC,MAAS;AAClE,QAAM,iBAAiB,OAA0C,MAAS;AAE1E,YAAU,MAAM;AACd,mBAAe,aAAa,cAAc,aAAa,WAAW;AAAA,EACpE,GAAG,CAAC,aAAa,UAAU,CAAC;AAE5B,QAAM,0BAA0B,MAAM;AACpC,WAAO;AAAA,MACL,OAAO;AAAA,MACP,KAAK;AAAA,MACL;AAAA,MACA,KAAK,SAAS;AAAA,IAChB;AAAA,EACF;AACA,QAAM,yCAAyC,MAAM;AACnD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,gBAAgB;AAAA,MAChB,KAAK,eAAe;AAAA,IACtB;AAAA,EACF;AAEA,QAAM,QAAQ,QAAQ,MAAM;AAC1B,UAAM,UAA2C,CAAC;AAClD,QAAI,eAAe;AACnB,YAAQ,KAAK;AAAA,MACX,UAAU;AAAA,MACV,OAAO;AAAA,MACP,SAAS,MAAM,gBAAgB,KAAK,eAAe,cAAc,CAAC;AAAA,MAClE,QAAQ,gBAAgB;AAAA,IAC1B,CAAC;AACD,aAAS,OAAO,GAAG,QAAQ,YAAY,QAAQ;AAC7C,UACE,QAAQ,KACR,QAAQ,cACP,QAAQ,cAAc,KAAK,QAAQ,cAAc,GAClD;AACA,YAAI,cAAc;AAChB,yBAAe;AAAA,QACjB;AACA,gBAAQ,IAAI,MAAM,WAAW;AAE7B,gBAAQ,KAAK;AAAA,UACX,UAAU;AAAA,UACV,SAAS;AAAA,UACT,SAAS,MAAM,eAAe,IAAI;AAAA,UAClC,eAAe,gBAAgB;AAAA,QACjC,CAAC;AAAA,MACH,OAAO;AACL,YAAI,CAAC,cAAc;AACjB,yBAAe;AACf,kBAAQ,KAAK;AAAA,YACX,SAAS;AAAA,UACX,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AACA,YAAQ,KAAK;AAAA,MACX,UAAU;AAAA,MACV,OAAO;AAAA,MACP,SAAS,MACP,gBAAgB,cAAc,eAAe,cAAc,CAAC;AAAA,MAC9D,QAAQ,gBAAgB;AAAA,IAC1B,CAAC;AACD,WAAO;AAAA,EACT,GAAG,CAAC,aAAa,UAAU,CAAC;AAE5B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS,cAAc,KAAK;AAAA,IAC5B,OAAO,wBAAwB;AAAA,IAC/B;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -13,7 +13,7 @@ export interface UseTabsReturn {
|
|
|
13
13
|
tabIndex: number;
|
|
14
14
|
onClick: (e: any) => void;
|
|
15
15
|
onKeyDown: (e: React.KeyboardEvent) => void;
|
|
16
|
-
ref?: React.RefObject<HTMLAnchorElement>;
|
|
16
|
+
ref?: React.RefObject<HTMLAnchorElement | null>;
|
|
17
17
|
};
|
|
18
18
|
panel: (id: TabId) => {
|
|
19
19
|
tab: TabId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/navigation/Tabs/hooks.ts"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useRef, useCallback } from 'react';\nimport { useScreenSize } from '@digigov/ui/utils/hooks/useScreen';\n\nexport type TabId = string | number | null;\n\nexport interface UseTabsProps {\n defaultOpen?: TabId;\n}\n\nexport interface UseTabsReturn {\n register: (id: TabId) => {\n role: string;\n href: string;\n id: string;\n 'aria-selected': boolean;\n 'aria-controls': string;\n tabIndex: number;\n onClick: (e: any) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n ref?: React.RefObject<HTMLAnchorElement>;\n };\n panel: (id: TabId) => {\n tab: TabId;\n role: string;\n 'aria-labelledby': string;\n id: string;\n active: boolean;\n };\n currentOpen: TabId;\n open: (id: TabId) => void;\n}\n\nexport const useTabs = ({\n defaultOpen = null,\n}: UseTabsProps = {}): UseTabsReturn => {\n const [currentOpen, setCurrentOpen] = useState<TabId | null>(defaultOpen);\n const tabsRef = useRef<Map<TabId, React.RefObject<HTMLAnchorElement>>>(\n new Map()\n );\n const { screenSize } = useScreenSize();\n\n const open = useCallback((id: TabId) => {\n setCurrentOpen(id);\n tabsRef.current.get(id)?.current?.focus();\n }, []);\n\n const navigate = useCallback(\n (direction: 'next' | 'previous') => {\n const focusedTabId = document.activeElement?.id.match(/tab-(.*?)$/)?.[1];\n const tabs = Array.from(tabsRef.current.keys());\n const currentIndex = tabs.indexOf(focusedTabId || currentOpen);\n const newIndex =\n direction === 'next' ? currentIndex + 1 : currentIndex - 1;\n if (newIndex >= 0 && newIndex < tabs.length) {\n tabsRef.current.get(tabs[newIndex])?.current?.focus();\n }\n },\n [currentOpen, tabsRef.current]\n );\n\n const register = useCallback(\n (id: TabId) => {\n if (!tabsRef.current.has(id)) {\n if (tabsRef.current.size === 0 && !currentOpen) {\n setCurrentOpen(id);\n }\n tabsRef.current.set(id, React.createRef());\n }\n return {\n role: 'tab',\n id: `tab-${id}`,\n href: `#panel-${id}`,\n 'aria-selected': currentOpen === id,\n open: currentOpen === id,\n 'aria-controls': `panel-${id}`,\n tabIndex: currentOpen === id ? 0 : -1,\n onClick: (e) => {\n // If the screen is mobile, we don't want to prevent the default behavior of the anchor tag,\n // which is to navigate to the href.\n if (screenSize != 'xs' && screenSize != 'sm') {\n e.preventDefault();\n }\n open(id);\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n navigate('next');\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n navigate('previous');\n break;\n case 'Enter':\n open(id);\n break;\n }\n },\n ref: tabsRef.current.get(id),\n };\n },\n [currentOpen]\n );\n\n const panel = (id: TabId) => {\n return {\n role: 'tabpanel',\n 'aria-labelledby': `tab-${id}`,\n id: `panel-${id}`,\n active: currentOpen === id,\n tab: id,\n };\n };\n\n return {\n register,\n panel,\n currentOpen,\n open,\n };\n};\n"],
|
|
4
|
+
"sourcesContent": ["import React, { useState, useRef, useCallback } from 'react';\nimport { useScreenSize } from '@digigov/ui/utils/hooks/useScreen';\n\nexport type TabId = string | number | null;\n\nexport interface UseTabsProps {\n defaultOpen?: TabId;\n}\n\nexport interface UseTabsReturn {\n register: (id: TabId) => {\n role: string;\n href: string;\n id: string;\n 'aria-selected': boolean;\n 'aria-controls': string;\n tabIndex: number;\n onClick: (e: any) => void;\n onKeyDown: (e: React.KeyboardEvent) => void;\n ref?: React.RefObject<HTMLAnchorElement | null>;\n };\n panel: (id: TabId) => {\n tab: TabId;\n role: string;\n 'aria-labelledby': string;\n id: string;\n active: boolean;\n };\n currentOpen: TabId;\n open: (id: TabId) => void;\n}\n\nexport const useTabs = ({\n defaultOpen = null,\n}: UseTabsProps = {}): UseTabsReturn => {\n const [currentOpen, setCurrentOpen] = useState<TabId | null>(defaultOpen);\n const tabsRef = useRef<Map<TabId, React.RefObject<HTMLAnchorElement | null>>>(\n new Map()\n );\n const { screenSize } = useScreenSize();\n\n const open = useCallback((id: TabId) => {\n setCurrentOpen(id);\n tabsRef.current.get(id)?.current?.focus();\n }, []);\n\n const navigate = useCallback(\n (direction: 'next' | 'previous') => {\n const focusedTabId = document.activeElement?.id.match(/tab-(.*?)$/)?.[1];\n const tabs = Array.from(tabsRef.current.keys());\n const currentIndex = tabs.indexOf(focusedTabId || currentOpen);\n const newIndex =\n direction === 'next' ? currentIndex + 1 : currentIndex - 1;\n if (newIndex >= 0 && newIndex < tabs.length) {\n tabsRef.current.get(tabs[newIndex])?.current?.focus();\n }\n },\n [currentOpen, tabsRef.current]\n );\n\n const register = useCallback(\n (id: TabId) => {\n if (!tabsRef.current.has(id)) {\n if (tabsRef.current.size === 0 && !currentOpen) {\n setCurrentOpen(id);\n }\n tabsRef.current.set(id, React.createRef());\n }\n return {\n role: 'tab',\n id: `tab-${id}`,\n href: `#panel-${id}`,\n 'aria-selected': currentOpen === id,\n open: currentOpen === id,\n 'aria-controls': `panel-${id}`,\n tabIndex: currentOpen === id ? 0 : -1,\n onClick: (e) => {\n // If the screen is mobile, we don't want to prevent the default behavior of the anchor tag,\n // which is to navigate to the href.\n if (screenSize != 'xs' && screenSize != 'sm') {\n e.preventDefault();\n }\n open(id);\n },\n onKeyDown: (e: React.KeyboardEvent) => {\n switch (e.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n navigate('next');\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n navigate('previous');\n break;\n case 'Enter':\n open(id);\n break;\n }\n },\n ref: tabsRef.current.get(id),\n };\n },\n [currentOpen]\n );\n\n const panel = (id: TabId) => {\n return {\n role: 'tabpanel',\n 'aria-labelledby': `tab-${id}`,\n id: `panel-${id}`,\n active: currentOpen === id,\n tab: id,\n };\n };\n\n return {\n register,\n panel,\n currentOpen,\n open,\n };\n};\n"],
|
|
5
5
|
"mappings": "AAAA,OAAO,SAAS,UAAU,QAAQ,mBAAmB;AACrD,SAAS,qBAAqB;AA+BvB,MAAM,UAAU,CAAC;AAAA,EACtB,cAAc;AAChB,IAAkB,CAAC,MAAqB;AACtC,QAAM,CAAC,aAAa,cAAc,IAAI,SAAuB,WAAW;AACxE,QAAM,UAAU;AAAA,IACd,oBAAI,IAAI;AAAA,EACV;AACA,QAAM,EAAE,WAAW,IAAI,cAAc;AAErC,QAAM,OAAO,YAAY,CAAC,OAAc;AACtC,mBAAe,EAAE;AACjB,YAAQ,QAAQ,IAAI,EAAE,GAAG,SAAS,MAAM;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,QAAM,WAAW;AAAA,IACf,CAAC,cAAmC;AAClC,YAAM,eAAe,SAAS,eAAe,GAAG,MAAM,YAAY,IAAI,CAAC;AACvE,YAAM,OAAO,MAAM,KAAK,QAAQ,QAAQ,KAAK,CAAC;AAC9C,YAAM,eAAe,KAAK,QAAQ,gBAAgB,WAAW;AAC7D,YAAM,WACJ,cAAc,SAAS,eAAe,IAAI,eAAe;AAC3D,UAAI,YAAY,KAAK,WAAW,KAAK,QAAQ;AAC3C,gBAAQ,QAAQ,IAAI,KAAK,QAAQ,CAAC,GAAG,SAAS,MAAM;AAAA,MACtD;AAAA,IACF;AAAA,IACA,CAAC,aAAa,QAAQ,OAAO;AAAA,EAC/B;AAEA,QAAM,WAAW;AAAA,IACf,CAAC,OAAc;AACb,UAAI,CAAC,QAAQ,QAAQ,IAAI,EAAE,GAAG;AAC5B,YAAI,QAAQ,QAAQ,SAAS,KAAK,CAAC,aAAa;AAC9C,yBAAe,EAAE;AAAA,QACnB;AACA,gBAAQ,QAAQ,IAAI,IAAI,MAAM,UAAU,CAAC;AAAA,MAC3C;AACA,aAAO;AAAA,QACL,MAAM;AAAA,QACN,IAAI,OAAO,EAAE;AAAA,QACb,MAAM,UAAU,EAAE;AAAA,QAClB,iBAAiB,gBAAgB;AAAA,QACjC,MAAM,gBAAgB;AAAA,QACtB,iBAAiB,SAAS,EAAE;AAAA,QAC5B,UAAU,gBAAgB,KAAK,IAAI;AAAA,QACnC,SAAS,CAAC,MAAM;AAGd,cAAI,cAAc,QAAQ,cAAc,MAAM;AAC5C,cAAE,eAAe;AAAA,UACnB;AACA,eAAK,EAAE;AAAA,QACT;AAAA,QACA,WAAW,CAAC,MAA2B;AACrC,kBAAQ,EAAE,KAAK;AAAA,YACb,KAAK;AAAA,YACL,KAAK;AACH,uBAAS,MAAM;AACf;AAAA,YACF,KAAK;AAAA,YACL,KAAK;AACH,uBAAS,UAAU;AACnB;AAAA,YACF,KAAK;AACH,mBAAK,EAAE;AACP;AAAA,UACJ;AAAA,QACF;AAAA,QACA,KAAK,QAAQ,QAAQ,IAAI,EAAE;AAAA,MAC7B;AAAA,IACF;AAAA,IACA,CAAC,WAAW;AAAA,EACd;AAEA,QAAM,QAAQ,CAAC,OAAc;AAC3B,WAAO;AAAA,MACL,MAAM;AAAA,MACN,mBAAmB,OAAO,EAAE;AAAA,MAC5B,IAAI,SAAS,EAAE;AAAA,MACf,QAAQ,gBAAgB;AAAA,MACxB,KAAK;AAAA,IACP;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digigov/ui",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-7d765d3c",
|
|
4
4
|
"description": "@digigov reusable components toolkit",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@uides/react-qr-reader": "3.0
|
|
9
|
-
"@digigov/react-icons": "2.0.0-
|
|
8
|
+
"@uides/react-qr-reader": "3.1.0-7d765d3c",
|
|
9
|
+
"@digigov/react-icons": "2.0.0-7d765d3c",
|
|
10
10
|
"dompurify": "3.0.6",
|
|
11
11
|
"highlight.js": "11.10.0"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
14
|
"clsx": "1.1.1",
|
|
15
|
-
"react": "
|
|
16
|
-
"react-dom": "
|
|
17
|
-
"@digigov/react-core": "2.0.0-
|
|
18
|
-
"@digigov/css": "2.0.0-
|
|
15
|
+
"react": "^18.3.0 || ^19.1.0",
|
|
16
|
+
"react-dom": "^18.3.0 || ^19.1.0",
|
|
17
|
+
"@digigov/react-core": "2.0.0-7d765d3c",
|
|
18
|
+
"@digigov/css": "2.0.0-7d765d3c"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"react-native": {
|
package/registry/index.js
CHANGED
|
@@ -4,10 +4,10 @@ import * as _digigov_ui_app_App from "@digigov/ui/app/App";
|
|
|
4
4
|
import * as _digigov_ui_app from "@digigov/ui/app";
|
|
5
5
|
import * as _digigov_ui_content from "@digigov/ui/content";
|
|
6
6
|
import * as _digigov_ui_feedback from "@digigov/ui/feedback";
|
|
7
|
+
import * as _digigov_ui_form from "@digigov/ui/form";
|
|
7
8
|
import * as _digigov_ui_govgr from "@digigov/ui/govgr";
|
|
8
9
|
import * as _digigov_ui_i18n_I18nText from "@digigov/ui/i18n/I18nText";
|
|
9
10
|
import * as _digigov_ui_i18n from "@digigov/ui/i18n";
|
|
10
|
-
import * as _digigov_ui_form from "@digigov/ui/form";
|
|
11
11
|
import * as _digigov_ui_icons from "@digigov/ui/icons";
|
|
12
12
|
import * as _digigov_ui_layouts from "@digigov/ui/layouts";
|
|
13
13
|
import * as _digigov_ui_navigation from "@digigov/ui/navigation";
|
|
@@ -30,14 +30,14 @@ import * as _digigov_ui_app_Header from "@digigov/ui/app/Header";
|
|
|
30
30
|
import * as _digigov_ui_app_Loader from "@digigov/ui/app/Loader";
|
|
31
31
|
import * as _digigov_ui_app_Loader_index_web from "@digigov/ui/app/Loader/index.web";
|
|
32
32
|
import * as _digigov_ui_app_Masthead from "@digigov/ui/app/Masthead";
|
|
33
|
-
import * as _digigov_ui_app_Modal_auto from "@digigov/ui/app/Modal/auto";
|
|
34
|
-
import * as _digigov_ui_app_Modal_hooks from "@digigov/ui/app/Modal/hooks";
|
|
35
|
-
import * as _digigov_ui_app_Modal from "@digigov/ui/app/Modal";
|
|
36
|
-
import * as _digigov_ui_app_Modal_index_web from "@digigov/ui/app/Modal/index.web";
|
|
37
33
|
import * as _digigov_ui_app_NotFound from "@digigov/ui/app/NotFound";
|
|
38
34
|
import * as _digigov_ui_app_OutdatedBrowserBanner from "@digigov/ui/app/OutdatedBrowserBanner";
|
|
39
35
|
import * as _digigov_ui_app_PageTitleContainer from "@digigov/ui/app/PageTitleContainer";
|
|
40
36
|
import * as _digigov_ui_app_Panel from "@digigov/ui/app/Panel";
|
|
37
|
+
import * as _digigov_ui_app_Modal_auto from "@digigov/ui/app/Modal/auto";
|
|
38
|
+
import * as _digigov_ui_app_Modal_hooks from "@digigov/ui/app/Modal/hooks";
|
|
39
|
+
import * as _digigov_ui_app_Modal from "@digigov/ui/app/Modal";
|
|
40
|
+
import * as _digigov_ui_app_Modal_index_web from "@digigov/ui/app/Modal/index.web";
|
|
41
41
|
import * as _digigov_ui_app_PhaseBannerHeader from "@digigov/ui/app/PhaseBannerHeader";
|
|
42
42
|
import * as _digigov_ui_app_QrCodeScanner from "@digigov/ui/app/QrCodeScanner";
|
|
43
43
|
import * as _digigov_ui_app_QrCodeViewer from "@digigov/ui/app/QrCodeViewer";
|
|
@@ -50,6 +50,7 @@ import * as _digigov_ui_app_hooks_useFontSize from "@digigov/ui/app/hooks/useFon
|
|
|
50
50
|
import * as _digigov_ui_app_hooks_useHighlightLinks from "@digigov/ui/app/hooks/useHighlightLinks";
|
|
51
51
|
import * as _digigov_ui_app_hooks_useLetterSpacing from "@digigov/ui/app/hooks/useLetterSpacing";
|
|
52
52
|
import * as _digigov_ui_app_hooks_useLineHeight from "@digigov/ui/app/hooks/useLineHeight";
|
|
53
|
+
import * as _digigov_ui_app_hooks_useNotificationArea from "@digigov/ui/app/hooks/useNotificationArea";
|
|
53
54
|
import * as _digigov_ui_app_hooks_useTheme from "@digigov/ui/app/hooks/useTheme";
|
|
54
55
|
import * as _digigov_ui_app_hooks_useVariantVars from "@digigov/ui/app/hooks/useVariantVars";
|
|
55
56
|
import * as _digigov_ui_content_Accordion_auto from "@digigov/ui/content/Accordion/auto";
|
|
@@ -78,22 +79,6 @@ import * as _digigov_ui_feedback_ErrorSummary from "@digigov/ui/feedback/ErrorSu
|
|
|
78
79
|
import * as _digigov_ui_feedback_NotificationBanner from "@digigov/ui/feedback/NotificationBanner";
|
|
79
80
|
import * as _digigov_ui_feedback_PhaseBanner from "@digigov/ui/feedback/PhaseBanner";
|
|
80
81
|
import * as _digigov_ui_feedback_WarningText from "@digigov/ui/feedback/WarningText";
|
|
81
|
-
import * as _digigov_ui_govgr_Footer_Copyright from "@digigov/ui/govgr/Footer/Copyright";
|
|
82
|
-
import * as _digigov_ui_govgr_Footer_HellenicRepublicLogo from "@digigov/ui/govgr/Footer/HellenicRepublicLogo";
|
|
83
|
-
import * as _digigov_ui_govgr_Footer_LicenseCCSA from "@digigov/ui/govgr/Footer/LicenseCCSA";
|
|
84
|
-
import * as _digigov_ui_govgr_Footer from "@digigov/ui/govgr/Footer";
|
|
85
|
-
import * as _digigov_ui_govgr_Footer_logo from "@digigov/ui/govgr/Footer/logo";
|
|
86
|
-
import * as _digigov_ui_govgr_GovGRLogo from "@digigov/ui/govgr/GovGRLogo";
|
|
87
|
-
import * as _digigov_ui_govgr_GovGRLogo_logo from "@digigov/ui/govgr/GovGRLogo/logo";
|
|
88
|
-
import * as _digigov_ui_govgr_images_govgr_logo_base64 from "@digigov/ui/govgr/images/govgr-logo-base64";
|
|
89
|
-
import * as _digigov_ui_govgr_images_govgr_logo_blue_base64 from "@digigov/ui/govgr/images/govgr-logo-blue-base64";
|
|
90
|
-
import * as _digigov_ui_govgr_images_greek_government_base64 from "@digigov/ui/govgr/images/greek-government-base64";
|
|
91
|
-
import * as _digigov_ui_govgr_images_grnet_logo_base64 from "@digigov/ui/govgr/images/grnet-logo-base64";
|
|
92
|
-
import * as _digigov_ui_govgr_images from "@digigov/ui/govgr/images";
|
|
93
|
-
import * as _digigov_ui_govgr_images_minedu_logo_base64 from "@digigov/ui/govgr/images/minedu-logo-base64";
|
|
94
|
-
import * as _digigov_ui_govgr_images_minedu_logo_black_base64 from "@digigov/ui/govgr/images/minedu-logo-black-base64";
|
|
95
|
-
import * as _digigov_ui_i18n_locales_el from "@digigov/ui/i18n/locales/el";
|
|
96
|
-
import * as _digigov_ui_i18n_locales_en from "@digigov/ui/i18n/locales/en";
|
|
97
82
|
import * as _digigov_ui_form_AutoComplete from "@digigov/ui/form/AutoComplete";
|
|
98
83
|
import * as _digigov_ui_form_AutoComplete_utils from "@digigov/ui/form/AutoComplete/utils";
|
|
99
84
|
import * as _digigov_ui_form_Button_ButtonLink from "@digigov/ui/form/Button/ButtonLink";
|
|
@@ -113,6 +98,22 @@ import * as _digigov_ui_form_SelectContainer from "@digigov/ui/form/SelectContai
|
|
|
113
98
|
import * as _digigov_ui_form_SingleCharacterInputs from "@digigov/ui/form/SingleCharacterInputs";
|
|
114
99
|
import * as _digigov_ui_form_TextArea from "@digigov/ui/form/TextArea";
|
|
115
100
|
import * as _digigov_ui_form_TextInput from "@digigov/ui/form/TextInput";
|
|
101
|
+
import * as _digigov_ui_govgr_Footer_Copyright from "@digigov/ui/govgr/Footer/Copyright";
|
|
102
|
+
import * as _digigov_ui_govgr_Footer_HellenicRepublicLogo from "@digigov/ui/govgr/Footer/HellenicRepublicLogo";
|
|
103
|
+
import * as _digigov_ui_govgr_Footer_LicenseCCSA from "@digigov/ui/govgr/Footer/LicenseCCSA";
|
|
104
|
+
import * as _digigov_ui_govgr_Footer from "@digigov/ui/govgr/Footer";
|
|
105
|
+
import * as _digigov_ui_govgr_Footer_logo from "@digigov/ui/govgr/Footer/logo";
|
|
106
|
+
import * as _digigov_ui_govgr_GovGRLogo from "@digigov/ui/govgr/GovGRLogo";
|
|
107
|
+
import * as _digigov_ui_govgr_GovGRLogo_logo from "@digigov/ui/govgr/GovGRLogo/logo";
|
|
108
|
+
import * as _digigov_ui_i18n_locales_el from "@digigov/ui/i18n/locales/el";
|
|
109
|
+
import * as _digigov_ui_i18n_locales_en from "@digigov/ui/i18n/locales/en";
|
|
110
|
+
import * as _digigov_ui_govgr_images_govgr_logo_base64 from "@digigov/ui/govgr/images/govgr-logo-base64";
|
|
111
|
+
import * as _digigov_ui_govgr_images_govgr_logo_blue_base64 from "@digigov/ui/govgr/images/govgr-logo-blue-base64";
|
|
112
|
+
import * as _digigov_ui_govgr_images_greek_government_base64 from "@digigov/ui/govgr/images/greek-government-base64";
|
|
113
|
+
import * as _digigov_ui_govgr_images_grnet_logo_base64 from "@digigov/ui/govgr/images/grnet-logo-base64";
|
|
114
|
+
import * as _digigov_ui_govgr_images from "@digigov/ui/govgr/images";
|
|
115
|
+
import * as _digigov_ui_govgr_images_minedu_logo_base64 from "@digigov/ui/govgr/images/minedu-logo-base64";
|
|
116
|
+
import * as _digigov_ui_govgr_images_minedu_logo_black_base64 from "@digigov/ui/govgr/images/minedu-logo-black-base64";
|
|
116
117
|
import * as _digigov_ui_icons_Icon from "@digigov/ui/icons/Icon";
|
|
117
118
|
import * as _digigov_ui_icons_IconBase from "@digigov/ui/icons/IconBase";
|
|
118
119
|
import * as _digigov_ui_icons_ImageLogo from "@digigov/ui/icons/ImageLogo";
|
|
@@ -159,8 +160,8 @@ import * as _digigov_ui_typography_Code from "@digigov/ui/typography/Code";
|
|
|
159
160
|
import * as _digigov_ui_typography_CodeBlock from "@digigov/ui/typography/CodeBlock";
|
|
160
161
|
import * as _digigov_ui_typography_Heading from "@digigov/ui/typography/Heading";
|
|
161
162
|
import * as _digigov_ui_typography_HeadingCaption from "@digigov/ui/typography/HeadingCaption";
|
|
162
|
-
import * as _digigov_ui_typography_Hint from "@digigov/ui/typography/Hint";
|
|
163
163
|
import * as _digigov_ui_typography_NormalText from "@digigov/ui/typography/NormalText";
|
|
164
|
+
import * as _digigov_ui_typography_Hint from "@digigov/ui/typography/Hint";
|
|
164
165
|
import * as _digigov_ui_typography_Paragraph from "@digigov/ui/typography/Paragraph";
|
|
165
166
|
import * as _digigov_ui_typography_Typography from "@digigov/ui/typography/Typography";
|
|
166
167
|
import * as _digigov_ui_utils_Base from "@digigov/ui/utils/Base";
|
|
@@ -177,10 +178,10 @@ import * as _digigov_ui_utils_hooks_useTogglableTab from "@digigov/ui/utils/hook
|
|
|
177
178
|
import * as _digigov_ui_app_OutdatedBrowserBanner_hooks_evaluateBrowserVersion from "@digigov/ui/app/OutdatedBrowserBanner/hooks/evaluateBrowserVersion";
|
|
178
179
|
import * as _digigov_ui_app_OutdatedBrowserBanner_hooks_useOutdatedBrowserCheck from "@digigov/ui/app/OutdatedBrowserBanner/hooks/useOutdatedBrowserCheck";
|
|
179
180
|
import * as _digigov_ui_content_Table_hooks_useSort from "@digigov/ui/content/Table/hooks/useSort";
|
|
180
|
-
import * as _digigov_ui_govgr_Footer_logos_logo_el from "@digigov/ui/govgr/Footer/logos/logo-el";
|
|
181
|
-
import * as _digigov_ui_govgr_Footer_logos_logo_en from "@digigov/ui/govgr/Footer/logos/logo-en";
|
|
182
181
|
import * as _digigov_ui_form_AutoComplete_Status from "@digigov/ui/form/AutoComplete/Status";
|
|
183
182
|
import * as _digigov_ui_form_AutoComplete___stories___utils from "@digigov/ui/form/AutoComplete/__stories__/utils";
|
|
183
|
+
import * as _digigov_ui_govgr_Footer_logos_logo_el from "@digigov/ui/govgr/Footer/logos/logo-el";
|
|
184
|
+
import * as _digigov_ui_govgr_Footer_logos_logo_en from "@digigov/ui/govgr/Footer/logos/logo-en";
|
|
184
185
|
import * as _digigov_ui_layouts_Basic_Aside from "@digigov/ui/layouts/Basic/Aside";
|
|
185
186
|
import * as _digigov_ui_layouts_Basic_Bottom from "@digigov/ui/layouts/Basic/Bottom";
|
|
186
187
|
import * as _digigov_ui_layouts_Basic_Container from "@digigov/ui/layouts/Basic/Container";
|
|
@@ -213,10 +214,10 @@ export default {
|
|
|
213
214
|
'@digigov/ui/app': lazyImport(_digigov_ui_app),
|
|
214
215
|
'@digigov/ui/content': lazyImport(_digigov_ui_content),
|
|
215
216
|
'@digigov/ui/feedback': lazyImport(_digigov_ui_feedback),
|
|
217
|
+
'@digigov/ui/form': lazyImport(_digigov_ui_form),
|
|
216
218
|
'@digigov/ui/govgr': lazyImport(_digigov_ui_govgr),
|
|
217
219
|
'@digigov/ui/i18n/I18nText': lazyImport(_digigov_ui_i18n_I18nText),
|
|
218
220
|
'@digigov/ui/i18n': lazyImport(_digigov_ui_i18n),
|
|
219
|
-
'@digigov/ui/form': lazyImport(_digigov_ui_form),
|
|
220
221
|
'@digigov/ui/icons': lazyImport(_digigov_ui_icons),
|
|
221
222
|
'@digigov/ui/layouts': lazyImport(_digigov_ui_layouts),
|
|
222
223
|
'@digigov/ui/navigation': lazyImport(_digigov_ui_navigation),
|
|
@@ -239,14 +240,14 @@ export default {
|
|
|
239
240
|
'@digigov/ui/app/Loader': lazyImport(_digigov_ui_app_Loader),
|
|
240
241
|
'@digigov/ui/app/Loader/index.web': lazyImport(_digigov_ui_app_Loader_index_web),
|
|
241
242
|
'@digigov/ui/app/Masthead': lazyImport(_digigov_ui_app_Masthead),
|
|
242
|
-
'@digigov/ui/app/Modal/auto': lazyImport(_digigov_ui_app_Modal_auto),
|
|
243
|
-
'@digigov/ui/app/Modal/hooks': lazyImport(_digigov_ui_app_Modal_hooks),
|
|
244
|
-
'@digigov/ui/app/Modal': lazyImport(_digigov_ui_app_Modal),
|
|
245
|
-
'@digigov/ui/app/Modal/index.web': lazyImport(_digigov_ui_app_Modal_index_web),
|
|
246
243
|
'@digigov/ui/app/NotFound': lazyImport(_digigov_ui_app_NotFound),
|
|
247
244
|
'@digigov/ui/app/OutdatedBrowserBanner': lazyImport(_digigov_ui_app_OutdatedBrowserBanner),
|
|
248
245
|
'@digigov/ui/app/PageTitleContainer': lazyImport(_digigov_ui_app_PageTitleContainer),
|
|
249
246
|
'@digigov/ui/app/Panel': lazyImport(_digigov_ui_app_Panel),
|
|
247
|
+
'@digigov/ui/app/Modal/auto': lazyImport(_digigov_ui_app_Modal_auto),
|
|
248
|
+
'@digigov/ui/app/Modal/hooks': lazyImport(_digigov_ui_app_Modal_hooks),
|
|
249
|
+
'@digigov/ui/app/Modal': lazyImport(_digigov_ui_app_Modal),
|
|
250
|
+
'@digigov/ui/app/Modal/index.web': lazyImport(_digigov_ui_app_Modal_index_web),
|
|
250
251
|
'@digigov/ui/app/PhaseBannerHeader': lazyImport(_digigov_ui_app_PhaseBannerHeader),
|
|
251
252
|
'@digigov/ui/app/QrCodeScanner': lazyImport(_digigov_ui_app_QrCodeScanner),
|
|
252
253
|
'@digigov/ui/app/QrCodeViewer': lazyImport(_digigov_ui_app_QrCodeViewer),
|
|
@@ -259,6 +260,7 @@ export default {
|
|
|
259
260
|
'@digigov/ui/app/hooks/useHighlightLinks': lazyImport(_digigov_ui_app_hooks_useHighlightLinks),
|
|
260
261
|
'@digigov/ui/app/hooks/useLetterSpacing': lazyImport(_digigov_ui_app_hooks_useLetterSpacing),
|
|
261
262
|
'@digigov/ui/app/hooks/useLineHeight': lazyImport(_digigov_ui_app_hooks_useLineHeight),
|
|
263
|
+
'@digigov/ui/app/hooks/useNotificationArea': lazyImport(_digigov_ui_app_hooks_useNotificationArea),
|
|
262
264
|
'@digigov/ui/app/hooks/useTheme': lazyImport(_digigov_ui_app_hooks_useTheme),
|
|
263
265
|
'@digigov/ui/app/hooks/useVariantVars': lazyImport(_digigov_ui_app_hooks_useVariantVars),
|
|
264
266
|
'@digigov/ui/content/Accordion/auto': lazyImport(_digigov_ui_content_Accordion_auto),
|
|
@@ -287,22 +289,6 @@ export default {
|
|
|
287
289
|
'@digigov/ui/feedback/NotificationBanner': lazyImport(_digigov_ui_feedback_NotificationBanner),
|
|
288
290
|
'@digigov/ui/feedback/PhaseBanner': lazyImport(_digigov_ui_feedback_PhaseBanner),
|
|
289
291
|
'@digigov/ui/feedback/WarningText': lazyImport(_digigov_ui_feedback_WarningText),
|
|
290
|
-
'@digigov/ui/govgr/Footer/Copyright': lazyImport(_digigov_ui_govgr_Footer_Copyright),
|
|
291
|
-
'@digigov/ui/govgr/Footer/HellenicRepublicLogo': lazyImport(_digigov_ui_govgr_Footer_HellenicRepublicLogo),
|
|
292
|
-
'@digigov/ui/govgr/Footer/LicenseCCSA': lazyImport(_digigov_ui_govgr_Footer_LicenseCCSA),
|
|
293
|
-
'@digigov/ui/govgr/Footer': lazyImport(_digigov_ui_govgr_Footer),
|
|
294
|
-
'@digigov/ui/govgr/Footer/logo': lazyImport(_digigov_ui_govgr_Footer_logo),
|
|
295
|
-
'@digigov/ui/govgr/GovGRLogo': lazyImport(_digigov_ui_govgr_GovGRLogo),
|
|
296
|
-
'@digigov/ui/govgr/GovGRLogo/logo': lazyImport(_digigov_ui_govgr_GovGRLogo_logo),
|
|
297
|
-
'@digigov/ui/govgr/images/govgr-logo-base64': lazyImport(_digigov_ui_govgr_images_govgr_logo_base64),
|
|
298
|
-
'@digigov/ui/govgr/images/govgr-logo-blue-base64': lazyImport(_digigov_ui_govgr_images_govgr_logo_blue_base64),
|
|
299
|
-
'@digigov/ui/govgr/images/greek-government-base64': lazyImport(_digigov_ui_govgr_images_greek_government_base64),
|
|
300
|
-
'@digigov/ui/govgr/images/grnet-logo-base64': lazyImport(_digigov_ui_govgr_images_grnet_logo_base64),
|
|
301
|
-
'@digigov/ui/govgr/images': lazyImport(_digigov_ui_govgr_images),
|
|
302
|
-
'@digigov/ui/govgr/images/minedu-logo-base64': lazyImport(_digigov_ui_govgr_images_minedu_logo_base64),
|
|
303
|
-
'@digigov/ui/govgr/images/minedu-logo-black-base64': lazyImport(_digigov_ui_govgr_images_minedu_logo_black_base64),
|
|
304
|
-
'@digigov/ui/i18n/locales/el': lazyImport(_digigov_ui_i18n_locales_el),
|
|
305
|
-
'@digigov/ui/i18n/locales/en': lazyImport(_digigov_ui_i18n_locales_en),
|
|
306
292
|
'@digigov/ui/form/AutoComplete': lazyImport(_digigov_ui_form_AutoComplete),
|
|
307
293
|
'@digigov/ui/form/AutoComplete/utils': lazyImport(_digigov_ui_form_AutoComplete_utils),
|
|
308
294
|
'@digigov/ui/form/Button/ButtonLink': lazyImport(_digigov_ui_form_Button_ButtonLink),
|
|
@@ -322,6 +308,22 @@ export default {
|
|
|
322
308
|
'@digigov/ui/form/SingleCharacterInputs': lazyImport(_digigov_ui_form_SingleCharacterInputs),
|
|
323
309
|
'@digigov/ui/form/TextArea': lazyImport(_digigov_ui_form_TextArea),
|
|
324
310
|
'@digigov/ui/form/TextInput': lazyImport(_digigov_ui_form_TextInput),
|
|
311
|
+
'@digigov/ui/govgr/Footer/Copyright': lazyImport(_digigov_ui_govgr_Footer_Copyright),
|
|
312
|
+
'@digigov/ui/govgr/Footer/HellenicRepublicLogo': lazyImport(_digigov_ui_govgr_Footer_HellenicRepublicLogo),
|
|
313
|
+
'@digigov/ui/govgr/Footer/LicenseCCSA': lazyImport(_digigov_ui_govgr_Footer_LicenseCCSA),
|
|
314
|
+
'@digigov/ui/govgr/Footer': lazyImport(_digigov_ui_govgr_Footer),
|
|
315
|
+
'@digigov/ui/govgr/Footer/logo': lazyImport(_digigov_ui_govgr_Footer_logo),
|
|
316
|
+
'@digigov/ui/govgr/GovGRLogo': lazyImport(_digigov_ui_govgr_GovGRLogo),
|
|
317
|
+
'@digigov/ui/govgr/GovGRLogo/logo': lazyImport(_digigov_ui_govgr_GovGRLogo_logo),
|
|
318
|
+
'@digigov/ui/i18n/locales/el': lazyImport(_digigov_ui_i18n_locales_el),
|
|
319
|
+
'@digigov/ui/i18n/locales/en': lazyImport(_digigov_ui_i18n_locales_en),
|
|
320
|
+
'@digigov/ui/govgr/images/govgr-logo-base64': lazyImport(_digigov_ui_govgr_images_govgr_logo_base64),
|
|
321
|
+
'@digigov/ui/govgr/images/govgr-logo-blue-base64': lazyImport(_digigov_ui_govgr_images_govgr_logo_blue_base64),
|
|
322
|
+
'@digigov/ui/govgr/images/greek-government-base64': lazyImport(_digigov_ui_govgr_images_greek_government_base64),
|
|
323
|
+
'@digigov/ui/govgr/images/grnet-logo-base64': lazyImport(_digigov_ui_govgr_images_grnet_logo_base64),
|
|
324
|
+
'@digigov/ui/govgr/images': lazyImport(_digigov_ui_govgr_images),
|
|
325
|
+
'@digigov/ui/govgr/images/minedu-logo-base64': lazyImport(_digigov_ui_govgr_images_minedu_logo_base64),
|
|
326
|
+
'@digigov/ui/govgr/images/minedu-logo-black-base64': lazyImport(_digigov_ui_govgr_images_minedu_logo_black_base64),
|
|
325
327
|
'@digigov/ui/icons/Icon': lazyImport(_digigov_ui_icons_Icon),
|
|
326
328
|
'@digigov/ui/icons/IconBase': lazyImport(_digigov_ui_icons_IconBase),
|
|
327
329
|
'@digigov/ui/icons/ImageLogo': lazyImport(_digigov_ui_icons_ImageLogo),
|
|
@@ -368,8 +370,8 @@ export default {
|
|
|
368
370
|
'@digigov/ui/typography/CodeBlock': lazyImport(_digigov_ui_typography_CodeBlock),
|
|
369
371
|
'@digigov/ui/typography/Heading': lazyImport(_digigov_ui_typography_Heading),
|
|
370
372
|
'@digigov/ui/typography/HeadingCaption': lazyImport(_digigov_ui_typography_HeadingCaption),
|
|
371
|
-
'@digigov/ui/typography/Hint': lazyImport(_digigov_ui_typography_Hint),
|
|
372
373
|
'@digigov/ui/typography/NormalText': lazyImport(_digigov_ui_typography_NormalText),
|
|
374
|
+
'@digigov/ui/typography/Hint': lazyImport(_digigov_ui_typography_Hint),
|
|
373
375
|
'@digigov/ui/typography/Paragraph': lazyImport(_digigov_ui_typography_Paragraph),
|
|
374
376
|
'@digigov/ui/typography/Typography': lazyImport(_digigov_ui_typography_Typography),
|
|
375
377
|
'@digigov/ui/utils/Base': lazyImport(_digigov_ui_utils_Base),
|
|
@@ -386,10 +388,10 @@ export default {
|
|
|
386
388
|
'@digigov/ui/app/OutdatedBrowserBanner/hooks/evaluateBrowserVersion': lazyImport(_digigov_ui_app_OutdatedBrowserBanner_hooks_evaluateBrowserVersion),
|
|
387
389
|
'@digigov/ui/app/OutdatedBrowserBanner/hooks/useOutdatedBrowserCheck': lazyImport(_digigov_ui_app_OutdatedBrowserBanner_hooks_useOutdatedBrowserCheck),
|
|
388
390
|
'@digigov/ui/content/Table/hooks/useSort': lazyImport(_digigov_ui_content_Table_hooks_useSort),
|
|
389
|
-
'@digigov/ui/govgr/Footer/logos/logo-el': lazyImport(_digigov_ui_govgr_Footer_logos_logo_el),
|
|
390
|
-
'@digigov/ui/govgr/Footer/logos/logo-en': lazyImport(_digigov_ui_govgr_Footer_logos_logo_en),
|
|
391
391
|
'@digigov/ui/form/AutoComplete/Status': lazyImport(_digigov_ui_form_AutoComplete_Status),
|
|
392
392
|
'@digigov/ui/form/AutoComplete/__stories__/utils': lazyImport(_digigov_ui_form_AutoComplete___stories___utils),
|
|
393
|
+
'@digigov/ui/govgr/Footer/logos/logo-el': lazyImport(_digigov_ui_govgr_Footer_logos_logo_el),
|
|
394
|
+
'@digigov/ui/govgr/Footer/logos/logo-en': lazyImport(_digigov_ui_govgr_Footer_logos_logo_en),
|
|
393
395
|
'@digigov/ui/layouts/Basic/Aside': lazyImport(_digigov_ui_layouts_Basic_Aside),
|
|
394
396
|
'@digigov/ui/layouts/Basic/Bottom': lazyImport(_digigov_ui_layouts_Basic_Bottom),
|
|
395
397
|
'@digigov/ui/layouts/Basic/Container': lazyImport(_digigov_ui_layouts_Basic_Container),
|
|
@@ -1,31 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
import BannerContainer from '@digigov/ui/app/BannerContainer';
|
|
4
|
-
import Button, { ButtonGroup } from '@digigov/ui/form/Button';
|
|
5
|
-
import { Container } from '@digigov/ui/layouts/Basic/Container';
|
|
6
|
-
import { Main } from '@digigov/ui/layouts/Basic/Main';
|
|
7
|
-
import { Heading } from '@digigov/ui/typography/Heading';
|
|
8
3
|
import { Paragraph } from '@digigov/ui/typography/Paragraph';
|
|
9
4
|
|
|
10
5
|
export const CookiesBanner = (_: any) => {
|
|
11
6
|
return (
|
|
12
7
|
<BannerContainer>
|
|
13
|
-
<
|
|
14
|
-
<Main>
|
|
15
|
-
<Heading size="md">Cookies στο GOV.GR</Heading>
|
|
16
|
-
<Paragraph>
|
|
17
|
-
Επιλέξτε «Αποδοχή» για να συμφωνήσετε με τη χρήση των cookies και
|
|
18
|
-
την επεξεργασία των προσωπικών σας δεδομένων.
|
|
19
|
-
</Paragraph>
|
|
20
|
-
<Paragraph>
|
|
21
|
-
<Button variant="link">Όροι και Προϋποθέσεις</Button>
|
|
22
|
-
</Paragraph>
|
|
23
|
-
<ButtonGroup>
|
|
24
|
-
<Button>Αποδοχή</Button>
|
|
25
|
-
<Button>Απόρριψη</Button>
|
|
26
|
-
</ButtonGroup>
|
|
27
|
-
</Main>
|
|
28
|
-
</Container>
|
|
8
|
+
<Paragraph p={4}>A text inside the BannerContainer.</Paragraph>
|
|
29
9
|
</BannerContainer>
|
|
30
10
|
);
|
|
31
11
|
};
|
package/src/app/Header/doc.mdx
CHANGED
|
@@ -9,15 +9,15 @@ title: Header
|
|
|
9
9
|
|
|
10
10
|
<code src="@digigov/ui/app/Header/__stories__/Default.tsx" />
|
|
11
11
|
|
|
12
|
-
###
|
|
12
|
+
### With service name
|
|
13
13
|
|
|
14
14
|
<code src="@digigov/ui/app/Header/__stories__/WithServiceName.tsx" />
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### With service logo and service name
|
|
17
17
|
|
|
18
18
|
<code src="@digigov/ui/app/Header/__stories__/WithServiceNameAndLogo.tsx" />
|
|
19
19
|
|
|
20
|
-
###
|
|
20
|
+
### With responsive navigation
|
|
21
21
|
|
|
22
22
|
<code src="@digigov/ui/app/Header/__stories__/WithNavigation.tsx" />
|
|
23
23
|
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoaderContainer, CircularProgress } from '@digigov/ui/app/Loader';
|
|
3
|
+
import doc from './doc.mdx?raw';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Digigov UI/app/CircularProgress',
|
|
7
|
+
component: CircularProgress,
|
|
8
|
+
displayName: 'CircularProgress',
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
markdown: doc,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const WithControls = {
|
|
14
|
+
render: (args) => {
|
|
15
|
+
return (
|
|
16
|
+
<LoaderContainer>
|
|
17
|
+
<CircularProgress
|
|
18
|
+
loadingText={args.loadingText}
|
|
19
|
+
loadingFinishedText={args.loadingFinishedText}
|
|
20
|
+
color={args.color}
|
|
21
|
+
size={args.size}
|
|
22
|
+
/>
|
|
23
|
+
</LoaderContainer>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
loadingText: 'Γίνεται φόρτωση',
|
|
28
|
+
loadingFinishedText: 'Η φόρτωση ολοκληρώθηκε',
|
|
29
|
+
color: 'primary',
|
|
30
|
+
size: 'md',
|
|
31
|
+
},
|
|
32
|
+
argsTypes: {
|
|
33
|
+
loadingText: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
},
|
|
36
|
+
loadingFinishedText: {
|
|
37
|
+
control: 'text',
|
|
38
|
+
},
|
|
39
|
+
color: {
|
|
40
|
+
control: { type: 'select' },
|
|
41
|
+
options: ['primary', 'secondary'],
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
control: { type: 'select' },
|
|
45
|
+
options: ['sm', 'md', 'lg'],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { Default } from '@digigov/ui/app/Loader/__stories__/Default';
|
|
51
|
+
export { Secondary } from '@digigov/ui/app/Loader/__stories__/Secondary';
|
|
52
|
+
export { Sizes } from '@digigov/ui/app/Loader/__stories__/Sizes';
|
|
53
|
+
export { FullPageLoader } from '@digigov/ui/app/Loader/__stories__/FullPageLoader';
|
|
54
|
+
export { AccessibilityLoader } from '@digigov/ui/app/Loader/__stories__/AccessibilityLoader';
|