@dbcdk/react-components 0.0.3 → 0.0.5
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/dist/assets/logo.cjs +10 -10
- package/dist/assets/logo.js +10 -10
- package/dist/components/__stories__/story-components/Colors.cjs +159 -0
- package/dist/components/__stories__/story-components/Colors.d.ts +10 -0
- package/dist/components/__stories__/story-components/Colors.js +151 -0
- package/dist/components/__stories__/story-components/Colors.module.css +27 -0
- package/dist/components/__stories__/story-components/Spacing.cjs +190 -0
- package/dist/components/__stories__/story-components/Spacing.d.ts +1 -0
- package/dist/components/__stories__/story-components/Spacing.js +184 -0
- package/dist/components/__stories__/story-components/Spacing.module.css +154 -0
- package/dist/components/app-header/AppHeader.module.css +10 -15
- package/dist/components/attribute-chip/AttributeChip.cjs +22 -0
- package/dist/components/attribute-chip/AttributeChip.d.ts +8 -0
- package/dist/components/attribute-chip/AttributeChip.js +16 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
- package/dist/components/avatar/Avatar.cjs +38 -4
- package/dist/components/avatar/Avatar.d.ts +4 -2
- package/dist/components/avatar/Avatar.js +39 -5
- package/dist/components/avatar/Avatar.module.css +27 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.js +1 -2
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +19 -22
- package/dist/components/button/Button.cjs +20 -12
- package/dist/components/button/Button.d.ts +4 -1
- package/dist/components/button/Button.js +20 -12
- package/dist/components/button/Button.module.css +118 -55
- package/dist/components/card/Card.cjs +53 -13
- package/dist/components/card/Card.d.ts +21 -6
- package/dist/components/card/Card.js +54 -14
- package/dist/components/card/Card.module.css +148 -44
- package/dist/components/card-container/CardContainer.cjs +6 -5
- package/dist/components/card-container/CardContainer.d.ts +5 -2
- package/dist/components/card-container/CardContainer.js +6 -5
- package/dist/components/card-container/CardContainer.module.css +40 -0
- package/dist/components/checkbox/Checkbox.cjs +3 -4
- package/dist/components/checkbox/Checkbox.d.ts +1 -1
- package/dist/components/checkbox/Checkbox.js +3 -4
- package/dist/components/checkbox/Checkbox.module.css +10 -10
- package/dist/components/chip/Chip.cjs +2 -1
- package/dist/components/chip/Chip.d.ts +2 -1
- package/dist/components/chip/Chip.js +2 -1
- package/dist/components/chip/Chip.module.css +42 -27
- package/dist/components/circle/Circle.module.css +11 -11
- package/dist/components/clear-button/ClearButton.cjs +3 -3
- package/dist/components/clear-button/ClearButton.js +3 -3
- package/dist/components/clear-button/ClearButton.module.css +8 -7
- package/dist/components/code-block/CodeBlock.cjs +18 -0
- package/dist/components/code-block/CodeBlock.d.ts +6 -0
- package/dist/components/code-block/CodeBlock.js +12 -0
- package/dist/components/code-block/CodeBlock.module.css +60 -0
- package/dist/components/copy-button/CopyButton.cjs +35 -0
- package/dist/components/copy-button/CopyButton.d.ts +9 -0
- package/dist/components/copy-button/CopyButton.js +29 -0
- package/dist/components/copy-button/CopyButton.module.css +6 -0
- package/dist/components/datetime-picker/DateTimePicker.cjs +504 -0
- package/dist/components/datetime-picker/DateTimePicker.d.ts +39 -0
- package/dist/components/datetime-picker/DateTimePicker.js +498 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +144 -0
- package/dist/components/filter-field/FilterField.cjs +34 -19
- package/dist/components/filter-field/FilterField.d.ts +2 -2
- package/dist/components/filter-field/FilterField.js +35 -20
- package/dist/components/filter-field/FilterField.module.css +14 -20
- package/dist/components/headline/Headline.cjs +10 -4
- package/dist/components/headline/Headline.d.ts +9 -1
- package/dist/components/headline/Headline.js +10 -4
- package/dist/components/headline/Headline.module.css +32 -7
- package/dist/components/icon/Icon.module.css +10 -9
- package/dist/components/input/Input.cjs +60 -19
- package/dist/components/input/Input.d.ts +7 -2
- package/dist/components/input/Input.js +60 -19
- package/dist/components/input/Input.module.css +90 -43
- package/dist/components/link/Link.cjs +46 -0
- package/dist/components/link/Link.d.ts +9 -0
- package/dist/components/link/Link.js +21 -0
- package/dist/components/link/Link.module.css +32 -0
- package/dist/components/menu/Menu.module.css +10 -32
- package/dist/components/meta-bar/MetaBar.cjs +29 -0
- package/dist/components/meta-bar/MetaBar.d.ts +11 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +12 -0
- package/dist/components/modal/Modal.cjs +134 -0
- package/dist/components/modal/Modal.d.ts +21 -0
- package/dist/components/modal/Modal.js +128 -0
- package/dist/components/modal/Modal.module.css +66 -0
- package/dist/components/modal/provider/ModalProvider.cjs +80 -0
- package/dist/components/modal/provider/ModalProvider.d.ts +21 -0
- package/dist/components/modal/provider/ModalProvider.js +77 -0
- package/dist/components/multi-select/MultiSelect.cjs +12 -1
- package/dist/components/multi-select/MultiSelect.js +12 -1
- package/dist/components/nav-bar/NavBar.module.css +11 -16
- package/dist/components/page/Page.module.css +2 -2
- package/dist/components/page-layout/PageLayout.cjs +5 -22
- package/dist/components/page-layout/PageLayout.d.ts +1 -8
- package/dist/components/page-layout/PageLayout.js +5 -22
- package/dist/components/page-layout/PageLayout.module.css +4 -80
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.cjs +32 -0
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.d.ts +11 -0
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.js +25 -0
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.module.css +84 -0
- package/dist/components/pagination/Pagination.cjs +83 -67
- package/dist/components/pagination/Pagination.d.ts +3 -1
- package/dist/components/pagination/Pagination.js +84 -68
- package/dist/components/pagination/Pagination.module.css +11 -3
- package/dist/components/panel/Panel.module.css +5 -7
- package/dist/components/popover/Popover.cjs +25 -8
- package/dist/components/popover/Popover.d.ts +2 -1
- package/dist/components/popover/Popover.js +25 -8
- package/dist/components/popover/Popover.module.css +4 -6
- package/dist/components/search-box/SearchBox.cjs +50 -37
- package/dist/components/search-box/SearchBox.d.ts +10 -7
- package/dist/components/search-box/SearchBox.js +50 -37
- package/dist/components/search-box/SearchBox.module.css +0 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +12 -6
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +12 -6
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +5 -1
- package/dist/components/select/Select.cjs +82 -13
- package/dist/components/select/Select.d.ts +2 -1
- package/dist/components/select/Select.js +83 -14
- package/dist/components/sidebar/Sidebar.cjs +3 -30
- package/dist/components/sidebar/Sidebar.d.ts +2 -1
- package/dist/components/sidebar/Sidebar.js +4 -26
- package/dist/components/sidebar/components/SidebarItem.cjs +3 -1
- package/dist/components/sidebar/components/SidebarItem.js +3 -1
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +40 -14
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +3 -1
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +40 -14
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +9 -38
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +50 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +8 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +43 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +155 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +16 -9
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +2 -1
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +16 -9
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +25 -12
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +2 -1
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +1 -1
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +2 -1
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +29 -2
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +25 -2
- package/dist/components/sidebar/providers/SidebarProvider.cjs +108 -10
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +7 -3
- package/dist/components/sidebar/providers/SidebarProvider.js +109 -11
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +1 -1
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +1 -1
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -12
- package/dist/components/split-pane/SplitPane.cjs +123 -0
- package/dist/components/split-pane/SplitPane.d.ts +34 -0
- package/dist/components/split-pane/SplitPane.js +114 -0
- package/dist/components/split-pane/SplitPane.module.css +106 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +87 -0
- package/dist/components/split-pane/provider/SplitPaneContext.d.ts +23 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +79 -0
- package/dist/components/table/Table.cjs +180 -112
- package/dist/components/table/Table.d.ts +22 -6
- package/dist/components/table/Table.js +181 -113
- package/dist/components/table/Table.module.css +74 -47
- package/dist/components/table/components/empty-state/EmptyState.cjs +52 -0
- package/dist/components/table/components/empty-state/EmptyState.d.ts +40 -0
- package/dist/components/table/components/empty-state/EmptyState.js +46 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +16 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +32 -0
- package/dist/components/table/components/table-settings/TableSettings.d.ts +7 -0
- package/dist/components/table/components/table-settings/TableSettings.js +30 -0
- package/dist/{tanstack.cjs → components/table/tanstack.cjs} +61 -99
- package/dist/components/table/tanstack.d.ts +14 -0
- package/dist/{tanstack.js → components/table/tanstack.js} +61 -99
- package/dist/components/tabs/Tabs.cjs +33 -17
- package/dist/components/tabs/Tabs.d.ts +6 -3
- package/dist/components/tabs/Tabs.js +33 -17
- package/dist/components/tabs/Tabs.module.css +9 -9
- package/dist/components/toast/Toast.cjs +47 -0
- package/dist/components/toast/Toast.d.ts +14 -0
- package/dist/components/toast/Toast.js +41 -0
- package/dist/components/toast/Toast.module.css +101 -0
- package/dist/components/toast/provider/ToastProvider.cjs +98 -0
- package/dist/components/toast/provider/ToastProvider.d.ts +23 -0
- package/dist/components/toast/provider/ToastProvider.js +91 -0
- package/dist/components/tooltip/Tooltip.cjs +134 -29
- package/dist/components/tooltip/Tooltip.js +135 -30
- package/dist/components/tooltip/Tooltip.module.css +25 -43
- package/dist/components/user-display/UserDisplay.module.css +2 -2
- package/dist/constants/severity.cjs +12 -12
- package/dist/constants/severity.js +12 -12
- package/dist/constants/sizes.cjs +1 -0
- package/dist/constants/sizes.d.ts +1 -1
- package/dist/constants/sizes.js +1 -0
- package/dist/hooks/usePagination.cjs +88 -0
- package/dist/hooks/usePagination.d.ts +33 -0
- package/dist/hooks/usePagination.js +86 -0
- package/dist/hooks/useSorting.cjs +118 -0
- package/dist/hooks/useSorting.d.ts +49 -0
- package/dist/hooks/useSorting.js +116 -0
- package/dist/hooks/useTableData.cjs +52 -0
- package/dist/hooks/useTableData.d.ts +40 -0
- package/dist/hooks/useTableData.js +50 -0
- package/dist/hooks/useTableSelection.cjs +130 -0
- package/dist/hooks/useTableSelection.d.ts +25 -0
- package/dist/hooks/useTableSelection.js +128 -0
- package/dist/hooks/useTableSettings.cjs +28 -0
- package/dist/hooks/useTableSettings.d.ts +7 -0
- package/dist/hooks/useTableSettings.js +26 -0
- package/dist/hooks/useTimeDuration.cjs +39 -0
- package/dist/hooks/useTimeDuration.d.ts +22 -0
- package/dist/hooks/useTimeDuration.js +37 -0
- package/dist/hooks/useViewportFill.js +1 -1
- package/dist/index.cjs +119 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +17 -0
- package/dist/src/styles/styles.css +101 -8
- package/dist/styles/css-helper-classes/flex.css +97 -0
- package/dist/styles/css-helper-classes/typography.css +7 -0
- package/dist/styles/styles.css +101 -8
- package/dist/styles/themes/dbc/dark.css +206 -99
- package/dist/styles/themes/dbc/light.css +183 -89
- package/dist/types/sizes.types.d.ts +2 -2
- package/package.json +17 -11
- package/dist/components/data-summary/DataSummary.cjs +0 -49
- package/dist/components/data-summary/DataSummary.d.ts +0 -19
- package/dist/components/data-summary/DataSummary.js +0 -43
- package/dist/components/data-summary/DataSummary.module.css +0 -51
- package/dist/components/sidebar/Sidebar.module.css +0 -66
- package/dist/tanstack.d.ts +0 -25
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var styles = require('./PageLayout.module.css');
|
|
5
|
+
var PageLayoutHero = require('./components/page-layout-hero/PageLayoutHero');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
8
|
|
|
@@ -41,8 +42,9 @@ const PageLayoutBase = ({
|
|
|
41
42
|
flex: 1,
|
|
42
43
|
display: "flex",
|
|
43
44
|
flexDirection: "column",
|
|
44
|
-
padding: "
|
|
45
|
-
gap:
|
|
45
|
+
padding: "var(--spacing-md)",
|
|
46
|
+
gap: "var(--spacing-md)",
|
|
47
|
+
backgroundColor: "var(--color-bg-surface)",
|
|
46
48
|
overflow: "auto"
|
|
47
49
|
},
|
|
48
50
|
children
|
|
@@ -63,25 +65,6 @@ const PageLayoutHeader = ({
|
|
|
63
65
|
}) => {
|
|
64
66
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.headerContainer, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles__default.default.headerContent} ${maxWidth ? styles__default.default.maxWidth : ""}`, children }) });
|
|
65
67
|
};
|
|
66
|
-
const PageLayoutHero = ({
|
|
67
|
-
children,
|
|
68
|
-
link,
|
|
69
|
-
metaHeadline,
|
|
70
|
-
headline,
|
|
71
|
-
image,
|
|
72
|
-
maxWidth = true
|
|
73
|
-
}) => {
|
|
74
|
-
const content = /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles__default.default.heroContainer} ${maxWidth ? styles__default.default.maxWidth : ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.heroImageWrapper, children: [
|
|
75
|
-
image,
|
|
76
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.heroText, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
77
|
-
metaHeadline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.metaHeadline, children: metaHeadline }),
|
|
78
|
-
headline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.headline, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: headline }) }),
|
|
79
|
-
children
|
|
80
|
-
] }) })
|
|
81
|
-
] }) });
|
|
82
|
-
const rendered = link ? link(content) : content;
|
|
83
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: rendered });
|
|
84
|
-
};
|
|
85
68
|
const PageLayoutContent = ({
|
|
86
69
|
maxWidth = true,
|
|
87
70
|
children
|
|
@@ -93,7 +76,7 @@ const PageLayoutFooter = ({ children }) => {
|
|
|
93
76
|
};
|
|
94
77
|
const PageLayout = Object.assign(PageLayoutBase, {
|
|
95
78
|
Header: PageLayoutHeader,
|
|
96
|
-
Hero: PageLayoutHero,
|
|
79
|
+
Hero: PageLayoutHero.PageLayoutHero,
|
|
97
80
|
Content: PageLayoutContent,
|
|
98
81
|
Footer: PageLayoutFooter
|
|
99
82
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import { PageLayoutHeroProps } from './components/page-layout-hero/PageLayoutHero';
|
|
3
4
|
type Orientation = 'vertical' | 'horizontal';
|
|
4
5
|
export interface PageLayoutProps extends PropsWithChildren {
|
|
5
6
|
containScrolling?: boolean;
|
|
@@ -11,14 +12,6 @@ export interface PageLayoutHeaderProps {
|
|
|
11
12
|
maxWidth?: boolean;
|
|
12
13
|
children: React.ReactNode;
|
|
13
14
|
}
|
|
14
|
-
export interface PageLayoutHeroProps {
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
link?: (children: React.ReactNode) => React.ReactNode;
|
|
17
|
-
image?: React.ReactNode;
|
|
18
|
-
headline?: string | React.ReactNode;
|
|
19
|
-
metaHeadline?: string | React.ReactNode;
|
|
20
|
-
maxWidth?: boolean;
|
|
21
|
-
}
|
|
22
15
|
export interface PageLayoutContentProps {
|
|
23
16
|
maxWidth?: boolean;
|
|
24
17
|
children: React.ReactNode;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx, jsxs
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import styles from './PageLayout.module.css';
|
|
3
|
+
import { PageLayoutHero } from './components/page-layout-hero/PageLayoutHero';
|
|
3
4
|
|
|
4
5
|
const PageLayoutBase = ({
|
|
5
6
|
children,
|
|
@@ -35,8 +36,9 @@ const PageLayoutBase = ({
|
|
|
35
36
|
flex: 1,
|
|
36
37
|
display: "flex",
|
|
37
38
|
flexDirection: "column",
|
|
38
|
-
padding: "
|
|
39
|
-
gap:
|
|
39
|
+
padding: "var(--spacing-md)",
|
|
40
|
+
gap: "var(--spacing-md)",
|
|
41
|
+
backgroundColor: "var(--color-bg-surface)",
|
|
40
42
|
overflow: "auto"
|
|
41
43
|
},
|
|
42
44
|
children
|
|
@@ -57,25 +59,6 @@ const PageLayoutHeader = ({
|
|
|
57
59
|
}) => {
|
|
58
60
|
return /* @__PURE__ */ jsx("div", { className: styles.headerContainer, children: /* @__PURE__ */ jsx("div", { className: `${styles.headerContent} ${maxWidth ? styles.maxWidth : ""}`, children }) });
|
|
59
61
|
};
|
|
60
|
-
const PageLayoutHero = ({
|
|
61
|
-
children,
|
|
62
|
-
link,
|
|
63
|
-
metaHeadline,
|
|
64
|
-
headline,
|
|
65
|
-
image,
|
|
66
|
-
maxWidth = true
|
|
67
|
-
}) => {
|
|
68
|
-
const content = /* @__PURE__ */ jsx("div", { className: `${styles.heroContainer} ${maxWidth ? styles.maxWidth : ""}`, children: /* @__PURE__ */ jsxs("div", { className: styles.heroImageWrapper, children: [
|
|
69
|
-
image,
|
|
70
|
-
/* @__PURE__ */ jsx("div", { className: styles.heroText, children: /* @__PURE__ */ jsxs("div", { children: [
|
|
71
|
-
metaHeadline && /* @__PURE__ */ jsx("div", { className: styles.metaHeadline, children: metaHeadline }),
|
|
72
|
-
headline && /* @__PURE__ */ jsx("div", { className: styles.headline, children: /* @__PURE__ */ jsx("h2", { children: headline }) }),
|
|
73
|
-
children
|
|
74
|
-
] }) })
|
|
75
|
-
] }) });
|
|
76
|
-
const rendered = link ? link(content) : content;
|
|
77
|
-
return /* @__PURE__ */ jsx(Fragment, { children: rendered });
|
|
78
|
-
};
|
|
79
62
|
const PageLayoutContent = ({
|
|
80
63
|
maxWidth = true,
|
|
81
64
|
children
|
|
@@ -22,91 +22,15 @@
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.heroContainer {
|
|
26
|
-
height: clamp(220px, 80svh, 520px);
|
|
27
|
-
height: clamp(220px, 80vh, 600px);
|
|
28
|
-
position: relative;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
margin: var(--spacing-lg) auto;
|
|
31
|
-
width: 100%;
|
|
32
|
-
padding: 0 var(--spacing-lg);
|
|
33
|
-
box-sizing: border-box;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.heroContainer img {
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: 100%;
|
|
39
|
-
object-fit: cover;
|
|
40
|
-
object-position: 0% 10%;
|
|
41
|
-
display: block;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.heroImageWrapper {
|
|
45
|
-
height: 100%;
|
|
46
|
-
position: relative;
|
|
47
|
-
}
|
|
48
|
-
.heroImageWrapper::after {
|
|
49
|
-
content: '';
|
|
50
|
-
position: absolute;
|
|
51
|
-
inset: 0;
|
|
52
|
-
top: 0;
|
|
53
|
-
left: 0;
|
|
54
|
-
height: 100%;
|
|
55
|
-
width: 100%;
|
|
56
|
-
background: rgba(0, 0, 0, 0.15);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.heroText {
|
|
60
|
-
z-index: 10;
|
|
61
|
-
position: absolute;
|
|
62
|
-
left: var(--spacing-2xl);
|
|
63
|
-
bottom: var(--spacing-2xl);
|
|
64
|
-
padding: var(--spacing-md);
|
|
65
|
-
letter-spacing: 1px;
|
|
66
|
-
color: #fff;
|
|
67
|
-
text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
|
|
68
|
-
font-size: 1.5rem;
|
|
69
|
-
font-weight: 600;
|
|
70
|
-
line-height: 1.3;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.heroText h2 {
|
|
74
|
-
margin: 0;
|
|
75
|
-
font-size: var(--font-size-2xl);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.heroText .metaHeadline {
|
|
79
|
-
text-transform: uppercase;
|
|
80
|
-
opacity: 0.9;
|
|
81
|
-
font-size: var(--font-size-lg);
|
|
82
|
-
text-transform: uppercase;
|
|
83
|
-
opacity: 0.9;
|
|
84
|
-
font-weight: 500;
|
|
85
|
-
padding: 0 0 var(--spacing-xs) 0;
|
|
86
|
-
font-weight: 400;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.metaHeadline::after {
|
|
90
|
-
content: '';
|
|
91
|
-
display: block;
|
|
92
|
-
width: 40px;
|
|
93
|
-
height: 3px;
|
|
94
|
-
background: var(--color-primary);
|
|
95
|
-
margin-top: 4px;
|
|
96
|
-
border-radius: 2px;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
25
|
.headerContainer {
|
|
100
26
|
display: flex;
|
|
101
27
|
justify-content: center;
|
|
102
28
|
}
|
|
103
29
|
|
|
104
|
-
.container:not(.containScrolling) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
top: 0;
|
|
109
|
-
}
|
|
30
|
+
.container:not(.containScrolling) .headerContainer {
|
|
31
|
+
position: sticky;
|
|
32
|
+
z-index: 1000;
|
|
33
|
+
top: 0;
|
|
110
34
|
}
|
|
111
35
|
|
|
112
36
|
.headerContent {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var heroStyles = require('./PageLayoutHero.module.css');
|
|
5
|
+
var layoutStyles = require('../../PageLayout.module.css');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var heroStyles__default = /*#__PURE__*/_interopDefault(heroStyles);
|
|
10
|
+
var layoutStyles__default = /*#__PURE__*/_interopDefault(layoutStyles);
|
|
11
|
+
|
|
12
|
+
const PageLayoutHero = ({
|
|
13
|
+
children,
|
|
14
|
+
link,
|
|
15
|
+
metaHeadline,
|
|
16
|
+
headline,
|
|
17
|
+
image,
|
|
18
|
+
maxWidth = true,
|
|
19
|
+
textBgColor = "var(--color-primary-900)"
|
|
20
|
+
}) => {
|
|
21
|
+
const content = /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${heroStyles__default.default.heroContainer} ${maxWidth ? layoutStyles__default.default.maxWidth : ""}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: heroStyles__default.default.splitWrapper, children: [
|
|
22
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: heroStyles__default.default.imageColumn, children: image }),
|
|
23
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: heroStyles__default.default.textColumn, style: { backgroundColor: textBgColor }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: heroStyles__default.default.textInner, children: [
|
|
24
|
+
metaHeadline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: heroStyles__default.default.metaHeadline, children: metaHeadline }),
|
|
25
|
+
headline && /* @__PURE__ */ jsxRuntime.jsx("div", { className: heroStyles__default.default.headline, children: /* @__PURE__ */ jsxRuntime.jsx("h2", { children: headline }) }),
|
|
26
|
+
children
|
|
27
|
+
] }) })
|
|
28
|
+
] }) });
|
|
29
|
+
return link ? /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: link(content) }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: content });
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.PageLayoutHero = PageLayoutHero;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PageLayoutHeroProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
link?: (children: React.ReactNode) => React.ReactNode;
|
|
5
|
+
image?: React.ReactNode;
|
|
6
|
+
headline?: string | React.ReactNode;
|
|
7
|
+
metaHeadline?: string | React.ReactNode;
|
|
8
|
+
maxWidth?: boolean;
|
|
9
|
+
textBgColor?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const PageLayoutHero: React.FC<PageLayoutHeroProps>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import heroStyles from './PageLayoutHero.module.css';
|
|
3
|
+
import layoutStyles from '../../PageLayout.module.css';
|
|
4
|
+
|
|
5
|
+
const PageLayoutHero = ({
|
|
6
|
+
children,
|
|
7
|
+
link,
|
|
8
|
+
metaHeadline,
|
|
9
|
+
headline,
|
|
10
|
+
image,
|
|
11
|
+
maxWidth = true,
|
|
12
|
+
textBgColor = "var(--color-primary-900)"
|
|
13
|
+
}) => {
|
|
14
|
+
const content = /* @__PURE__ */ jsx("div", { className: `${heroStyles.heroContainer} ${maxWidth ? layoutStyles.maxWidth : ""}`, children: /* @__PURE__ */ jsxs("div", { className: heroStyles.splitWrapper, children: [
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: heroStyles.imageColumn, children: image }),
|
|
16
|
+
/* @__PURE__ */ jsx("div", { className: heroStyles.textColumn, style: { backgroundColor: textBgColor }, children: /* @__PURE__ */ jsxs("div", { className: heroStyles.textInner, children: [
|
|
17
|
+
metaHeadline && /* @__PURE__ */ jsx("div", { className: heroStyles.metaHeadline, children: metaHeadline }),
|
|
18
|
+
headline && /* @__PURE__ */ jsx("div", { className: heroStyles.headline, children: /* @__PURE__ */ jsx("h2", { children: headline }) }),
|
|
19
|
+
children
|
|
20
|
+
] }) })
|
|
21
|
+
] }) });
|
|
22
|
+
return link ? /* @__PURE__ */ jsx(Fragment, { children: link(content) }) : /* @__PURE__ */ jsx(Fragment, { children: content });
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { PageLayoutHero };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.heroContainer {
|
|
2
|
+
width: 100%;
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
background-color: var(--color-brand);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.splitWrapper {
|
|
8
|
+
display: flex;
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: clamp(260px, 60vh, 540px);
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* LEFT SIDE — IMAGE */
|
|
15
|
+
.imageColumn {
|
|
16
|
+
flex: 0 0 60%;
|
|
17
|
+
position: relative;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.imageColumn img,
|
|
22
|
+
.imageColumn picture,
|
|
23
|
+
.imageColumn video {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
object-fit: cover;
|
|
27
|
+
display: block;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* RIGHT SIDE — TEXT BLOCK */
|
|
31
|
+
.textColumn {
|
|
32
|
+
flex: 0 0 40%;
|
|
33
|
+
color: var(--color-fg-on-brand);
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: flex-end;
|
|
36
|
+
padding: var(--spacing-lg);
|
|
37
|
+
position: relative;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.textInner {
|
|
41
|
+
z-index: 1;
|
|
42
|
+
max-width: 500px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.metaHeadline {
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
opacity: 0.9;
|
|
48
|
+
font-size: var(--font-size-lg);
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
margin-bottom: var(--spacing-xs);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.metaHeadline::after {
|
|
54
|
+
content: '';
|
|
55
|
+
display: block;
|
|
56
|
+
width: 40px;
|
|
57
|
+
height: 3px;
|
|
58
|
+
background-color: var(--color-fg-on-brand);
|
|
59
|
+
margin-top: 4px;
|
|
60
|
+
border-radius: 2px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.headline h2 {
|
|
64
|
+
margin: 0 0 var(--spacing-sm) 0;
|
|
65
|
+
font-size: var(--font-size-3xl);
|
|
66
|
+
color: var(--color-fg-on-brand);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (max-width: 900px) {
|
|
70
|
+
.splitWrapper {
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
height: auto;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.imageColumn,
|
|
76
|
+
.textColumn {
|
|
77
|
+
flex: none;
|
|
78
|
+
width: 100%;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.textColumn {
|
|
82
|
+
padding: var(--spacing-xl) var(--spacing-lg);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -18,97 +18,113 @@ function Pagination({
|
|
|
18
18
|
skip = 0,
|
|
19
19
|
take = DEFAULT_PAGE_SIZE_OPTIONS[1],
|
|
20
20
|
onPageChange,
|
|
21
|
-
pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS
|
|
21
|
+
pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,
|
|
22
|
+
showFirstLast = true,
|
|
23
|
+
showGoToPage = true
|
|
22
24
|
}) {
|
|
23
|
-
const totalPages = react.useMemo(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
const totalPages = react.useMemo(
|
|
26
|
+
() => Math.max(1, Math.ceil(itemsCount / Math.max(1, take))),
|
|
27
|
+
[itemsCount, take]
|
|
28
|
+
);
|
|
27
29
|
const currentPage = react.useMemo(() => {
|
|
28
30
|
const p = Math.floor(skip / Math.max(1, take)) + 1;
|
|
29
31
|
return Math.min(Math.max(1, p), totalPages);
|
|
30
32
|
}, [skip, take, totalPages]);
|
|
31
33
|
const emit = react.useCallback(
|
|
32
|
-
(page) => {
|
|
33
|
-
const
|
|
34
|
-
const
|
|
34
|
+
(page, nextTake = take) => {
|
|
35
|
+
const nextTotalPages = Math.max(1, Math.ceil(itemsCount / Math.max(1, nextTake)));
|
|
36
|
+
const clampedPage = Math.min(Math.max(1, page), nextTotalPages);
|
|
37
|
+
const nextSkip = (clampedPage - 1) * nextTake;
|
|
35
38
|
onPageChange == null ? void 0 : onPageChange({
|
|
36
39
|
page: clampedPage,
|
|
37
|
-
take,
|
|
40
|
+
take: nextTake,
|
|
38
41
|
skip: nextSkip,
|
|
39
|
-
totalPages
|
|
42
|
+
totalPages: nextTotalPages
|
|
40
43
|
});
|
|
41
44
|
},
|
|
42
|
-
[onPageChange, take,
|
|
45
|
+
[onPageChange, take, itemsCount]
|
|
43
46
|
);
|
|
47
|
+
const firstPage = react.useCallback(() => emit(1), [emit]);
|
|
48
|
+
const lastPage = react.useCallback(() => emit(totalPages), [emit, totalPages]);
|
|
44
49
|
const prevPage = react.useCallback(() => emit(currentPage - 1), [emit, currentPage]);
|
|
45
50
|
const nextPage = react.useCallback(() => emit(currentPage + 1), [emit, currentPage]);
|
|
46
51
|
const goToPage = react.useCallback((page) => emit(page), [emit]);
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
first: startIndex > 0 ? 1 : void 0,
|
|
58
|
-
items: pages.slice(startIndex, endIndex),
|
|
59
|
-
last: endIndex < totalPages ? totalPages : void 0
|
|
60
|
-
};
|
|
61
|
-
}, [totalPages, currentPage]);
|
|
62
|
-
const handlePageSizeChange = react.useCallback(
|
|
63
|
-
(size) => {
|
|
64
|
-
onPageChange == null ? void 0 : onPageChange({
|
|
65
|
-
page: 1,
|
|
66
|
-
take: size,
|
|
67
|
-
skip: 0,
|
|
68
|
-
totalPages: Math.max(1, Math.ceil(itemsCount / Math.max(1, size)))
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
[onPageChange, itemsCount]
|
|
72
|
-
);
|
|
52
|
+
const canPrev = currentPage > 1;
|
|
53
|
+
const canNext = currentPage < totalPages;
|
|
54
|
+
const rangeLabel = react.useMemo(() => {
|
|
55
|
+
if (itemsCount <= 0) return "0 af 0";
|
|
56
|
+
const first = skip + 1;
|
|
57
|
+
const last = Math.min(skip + take, itemsCount);
|
|
58
|
+
return `${first.toLocaleString("da-DK")}\u2013${last.toLocaleString("da-DK")} af ${itemsCount.toLocaleString("da-DK")}`;
|
|
59
|
+
}, [itemsCount, skip, take]);
|
|
60
|
+
const pages = react.useMemo(() => Array.from({ length: totalPages }, (_, i) => i + 1), [totalPages]);
|
|
61
|
+
const handlePageSizeChange = react.useCallback((size) => emit(1, size), [emit]);
|
|
73
62
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.container, children: [
|
|
74
|
-
|
|
75
|
-
pageList.first && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.ellipsisButton, children: [
|
|
76
|
-
/* @__PURE__ */ jsxRuntime.jsx(Button.Button, { variant: "outlined", onClick: () => goToPage(1), children: pageList.first }),
|
|
77
|
-
"\u2026"
|
|
78
|
-
] }),
|
|
79
|
-
pageList.items.map((page) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
63
|
+
showFirstLast && /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
64
|
Button.Button,
|
|
81
65
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
size: "sm",
|
|
67
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsLeft, {}),
|
|
68
|
+
disabled: !canPrev,
|
|
69
|
+
onClick: firstPage,
|
|
70
|
+
"aria-label": "First page"
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
Button.Button,
|
|
75
|
+
{
|
|
76
|
+
size: "sm",
|
|
77
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, {}),
|
|
78
|
+
disabled: !canPrev,
|
|
79
|
+
onClick: prevPage,
|
|
80
|
+
"aria-label": "Previous page"
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.range, "aria-live": "polite", children: rangeLabel }),
|
|
84
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
85
|
+
Button.Button,
|
|
86
|
+
{
|
|
87
|
+
size: "sm",
|
|
88
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, {}),
|
|
89
|
+
disabled: !canNext,
|
|
90
|
+
onClick: nextPage,
|
|
91
|
+
"aria-label": "Next page"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
showFirstLast && /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
Button.Button,
|
|
96
|
+
{
|
|
97
|
+
size: "sm",
|
|
98
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsRight, {}),
|
|
99
|
+
disabled: !canNext,
|
|
100
|
+
onClick: lastPage,
|
|
101
|
+
"aria-label": "Last page"
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
showGoToPage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
105
|
+
Popover.Popover,
|
|
106
|
+
{
|
|
107
|
+
trigger: (open) => /* @__PURE__ */ jsxRuntime.jsxs(Button.Button, { size: "sm", variant: "outlined", onClick: open, children: [
|
|
108
|
+
"Side ",
|
|
109
|
+
currentPage,
|
|
110
|
+
"/",
|
|
111
|
+
totalPages,
|
|
112
|
+
" ",
|
|
113
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: 16 })
|
|
114
|
+
] }),
|
|
115
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu, { children: pages.map((page) => /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: page === currentPage, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => goToPage(page), children: page }) }, page)) })
|
|
116
|
+
}
|
|
117
|
+
),
|
|
95
118
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
96
119
|
Popover.Popover,
|
|
97
120
|
{
|
|
98
|
-
trigger: (
|
|
121
|
+
trigger: (open) => /* @__PURE__ */ jsxRuntime.jsxs(Button.Button, { size: "sm", variant: "outlined", onClick: open, children: [
|
|
99
122
|
"Vis ",
|
|
100
123
|
take,
|
|
101
|
-
|
|
124
|
+
" ",
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: 16 })
|
|
102
126
|
] }),
|
|
103
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: size === take, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
-
"button",
|
|
105
|
-
{
|
|
106
|
-
onClick: () => {
|
|
107
|
-
handlePageSizeChange(size);
|
|
108
|
-
},
|
|
109
|
-
children: size
|
|
110
|
-
}
|
|
111
|
-
) }, size)) })
|
|
127
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: size === take, children: /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handlePageSizeChange(size), children: size }) }, size)) })
|
|
112
128
|
}
|
|
113
129
|
)
|
|
114
130
|
] });
|
|
@@ -12,6 +12,8 @@ interface PaginationProps {
|
|
|
12
12
|
onPageChange?: (e: PageChangeEvent) => void;
|
|
13
13
|
lazy?: boolean;
|
|
14
14
|
pageSizeOptions?: number[];
|
|
15
|
+
showFirstLast?: boolean;
|
|
16
|
+
showGoToPage?: boolean;
|
|
15
17
|
}
|
|
16
|
-
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, }: PaginationProps): React.ReactNode;
|
|
18
|
+
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, showFirstLast, showGoToPage, }: PaginationProps): React.ReactNode;
|
|
17
19
|
export {};
|