@dbcdk/react-components 0.0.4 → 0.0.6
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.js +2 -85
- package/dist/components/__stories__/_data/table.d.ts +15 -0
- package/dist/components/__stories__/_data/table.js +49 -0
- package/dist/components/__stories__/story-components/Colors.d.ts +11 -0
- package/dist/components/__stories__/story-components/Colors.js +96 -0
- package/dist/components/__stories__/story-components/Colors.module.css +27 -0
- package/dist/components/__stories__/story-components/Spacing.d.ts +2 -0
- package/dist/components/__stories__/story-components/Spacing.js +76 -0
- package/dist/components/__stories__/story-components/Spacing.module.css +154 -0
- package/dist/components/app-header/AppHeader.d.ts +4 -3
- package/dist/components/app-header/AppHeader.js +3 -6
- package/dist/components/app-header/AppHeader.module.css +10 -15
- package/dist/components/attribute-chip/AttributeChip.d.ts +9 -0
- package/dist/components/attribute-chip/AttributeChip.js +5 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +65 -0
- package/dist/components/avatar/Avatar.d.ts +5 -3
- package/dist/components/avatar/Avatar.js +37 -37
- package/dist/components/avatar/Avatar.module.css +27 -0
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/components/breadcrumbs/Breadcrumbs.js +4 -14
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +19 -22
- package/dist/components/button/Button.d.ts +6 -2
- package/dist/components/button/Button.js +56 -50
- package/dist/components/button/Button.module.css +119 -56
- package/dist/components/card/Card.d.ts +23 -7
- package/dist/components/card/Card.js +20 -21
- package/dist/components/card/Card.module.css +148 -44
- package/dist/components/card-container/CardContainer.d.ts +6 -3
- package/dist/components/card-container/CardContainer.js +4 -15
- package/dist/components/card-container/CardContainer.module.css +40 -0
- package/dist/components/chip/Chip.d.ts +7 -5
- package/dist/components/chip/Chip.js +14 -37
- package/dist/components/chip/Chip.module.css +50 -27
- package/dist/components/circle/Circle.d.ts +3 -2
- package/dist/components/circle/Circle.js +3 -10
- package/dist/components/circle/Circle.module.css +11 -11
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +6 -17
- package/dist/components/clear-button/ClearButton.module.css +8 -7
- package/dist/components/code-block/CodeBlock.d.ts +7 -0
- package/dist/components/code-block/CodeBlock.js +6 -0
- package/dist/components/code-block/CodeBlock.module.css +60 -0
- package/dist/components/copy-button/CopyButton.d.ts +10 -0
- package/dist/components/copy-button/CopyButton.js +22 -0
- package/dist/components/copy-button/CopyButton.module.css +6 -0
- package/dist/components/datetime-picker/DateTimePicker.d.ts +42 -0
- package/dist/components/datetime-picker/DateTimePicker.js +403 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +144 -0
- package/dist/components/filter-field/FilterField.d.ts +6 -3
- package/dist/components/filter-field/FilterField.js +130 -158
- package/dist/components/filter-field/FilterField.module.css +35 -25
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +36 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +53 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +60 -0
- package/dist/components/forms/checkbox/Checkbox.d.ts +31 -0
- package/dist/components/forms/checkbox/Checkbox.js +27 -0
- package/dist/components/{checkbox → forms/checkbox}/Checkbox.module.css +10 -11
- package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +47 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +75 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/forms/input/Input.d.ts +22 -0
- package/dist/components/forms/input/Input.js +70 -0
- package/dist/components/forms/input/Input.module.css +160 -0
- package/dist/components/forms/input-container/InputContainer.d.ts +15 -0
- package/dist/components/forms/input-container/InputContainer.js +15 -0
- package/dist/components/forms/input-container/InputContainer.module.css +34 -0
- package/dist/components/forms/multi-select/MultiSelect.d.ts +20 -0
- package/dist/components/forms/multi-select/MultiSelect.js +19 -0
- package/dist/components/forms/select/Select.d.ts +21 -0
- package/dist/components/forms/select/Select.js +94 -0
- package/dist/components/forms/text-area/Textarea.d.ts +17 -0
- package/dist/components/forms/text-area/Textarea.js +33 -0
- package/dist/components/forms/text-area/Textarea.module.css +26 -0
- package/dist/components/headline/Headline.d.ts +9 -1
- package/dist/components/headline/Headline.js +18 -37
- package/dist/components/headline/Headline.module.css +32 -7
- package/dist/components/hyperlink/Hyperlink.d.ts +9 -0
- package/dist/components/hyperlink/Hyperlink.js +11 -0
- package/dist/components/hyperlink/Hyperlink.module.css +23 -0
- package/dist/components/icon/Icon.d.ts +4 -3
- package/dist/components/icon/Icon.js +11 -17
- package/dist/components/icon/Icon.module.css +10 -9
- package/dist/components/menu/Menu.js +25 -67
- package/dist/components/menu/Menu.module.css +10 -32
- package/dist/components/meta-bar/MetaBar.d.ts +11 -0
- package/dist/components/meta-bar/MetaBar.js +9 -0
- package/dist/components/meta-bar/MetaBar.module.css +12 -0
- package/dist/components/nav-bar/NavBar.d.ts +5 -5
- package/dist/components/nav-bar/NavBar.js +15 -45
- package/dist/components/nav-bar/NavBar.module.css +11 -16
- package/dist/components/overlay/modal/Modal.d.ts +23 -0
- package/dist/components/overlay/modal/Modal.js +92 -0
- package/dist/components/overlay/modal/Modal.module.css +66 -0
- package/dist/components/overlay/modal/provider/ModalProvider.d.ts +20 -0
- package/dist/components/overlay/modal/provider/ModalProvider.js +70 -0
- package/dist/components/overlay/side-panel/SidePanel.d.ts +16 -0
- package/dist/components/overlay/side-panel/SidePanel.js +10 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +56 -0
- package/dist/components/overlay/side-panel/useSidePanel.d.ts +5 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +11 -0
- package/dist/components/overlay/tooltip/Tooltip.d.ts +13 -0
- package/dist/components/overlay/tooltip/Tooltip.js +17 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +106 -0
- package/dist/components/overlay/tooltip/TooltipProvider.d.ts +20 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +244 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.d.ts +24 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +108 -0
- package/dist/components/page/Page.d.ts +7 -6
- package/dist/components/page/Page.js +4 -21
- package/dist/components/page/Page.module.css +2 -2
- package/dist/components/page-layout/PageLayout.d.ts +12 -20
- package/dist/components/page-layout/PageLayout.js +35 -88
- package/dist/components/page-layout/PageLayout.module.css +4 -80
- 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 +7 -0
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.module.css +84 -0
- package/dist/components/pagination/Pagination.d.ts +4 -1
- package/dist/components/pagination/Pagination.js +38 -105
- package/dist/components/pagination/Pagination.module.css +11 -3
- package/dist/components/panel/Panel.d.ts +4 -3
- package/dist/components/panel/Panel.js +5 -10
- package/dist/components/panel/Panel.module.css +5 -7
- package/dist/components/popover/Popover.d.ts +3 -1
- package/dist/components/popover/Popover.js +116 -124
- package/dist/components/popover/Popover.module.css +4 -6
- package/dist/components/search-box/SearchBox.d.ts +11 -8
- package/dist/components/search-box/SearchBox.js +112 -149
- package/dist/components/search-box/SearchBox.module.css +0 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +1 -1
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +47 -88
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +5 -1
- package/dist/components/sidebar/Sidebar.d.ts +3 -1
- package/dist/components/sidebar/Sidebar.js +5 -29
- package/dist/components/sidebar/components/SidebarItem.js +6 -12
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +4 -2
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +48 -62
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +9 -38
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +9 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +13 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +155 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +3 -1
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +4 -18
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +25 -12
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +1 -1
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +9 -22
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +20 -18
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +9 -4
- package/dist/components/sidebar/providers/SidebarProvider.js +188 -73
- package/dist/components/skeleton-loader/SkeletonLoader.js +68 -266
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +11 -34
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +0 -12
- package/dist/components/split-button/SplitButton.d.ts +7 -5
- package/dist/components/split-button/SplitButton.js +4 -27
- package/dist/components/split-pane/SplitPane.d.ts +34 -0
- package/dist/components/split-pane/SplitPane.js +78 -0
- package/dist/components/split-pane/SplitPane.module.css +106 -0
- package/dist/components/split-pane/provider/SplitPaneContext.d.ts +23 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +85 -0
- package/dist/components/table/Table.d.ts +28 -10
- package/dist/components/table/Table.js +117 -172
- package/dist/components/table/Table.module.css +78 -47
- package/dist/components/table/components/column-resizer/ColumnResizer.js +4 -15
- package/dist/components/table/components/empty-state/EmptyState.d.ts +41 -0
- package/dist/components/table/components/empty-state/EmptyState.js +27 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +16 -0
- package/dist/components/table/components/table-settings/TableSettings.d.ts +8 -0
- package/dist/components/table/components/table-settings/TableSettings.js +12 -0
- package/dist/components/table/tanstack.d.ts +14 -0
- package/dist/components/table/tanstack.js +162 -0
- package/dist/components/tabs/Tabs.d.ts +7 -3
- package/dist/components/tabs/Tabs.js +32 -65
- package/dist/components/tabs/Tabs.module.css +9 -9
- package/dist/components/toast/Toast.d.ts +14 -0
- package/dist/components/toast/Toast.js +8 -0
- package/dist/components/toast/Toast.module.css +102 -0
- package/dist/components/toast/provider/ToastProvider.d.ts +23 -0
- package/dist/components/toast/provider/ToastProvider.js +64 -0
- package/dist/components/user-display/UserDisplay.d.ts +2 -1
- package/dist/components/user-display/UserDisplay.js +4 -20
- package/dist/components/user-display/UserDisplay.module.css +2 -2
- package/dist/constants/severity.d.ts +1 -1
- package/dist/constants/severity.js +14 -16
- package/dist/constants/severity.types.d.ts +1 -1
- package/dist/constants/severity.types.js +1 -1
- package/dist/constants/sizes.d.ts +1 -1
- package/dist/constants/sizes.js +6 -7
- package/dist/hooks/usePagination.d.ts +33 -0
- package/dist/hooks/usePagination.js +79 -0
- package/dist/hooks/useSorting.d.ts +49 -0
- package/dist/hooks/useSorting.js +118 -0
- package/dist/hooks/useTableData.d.ts +40 -0
- package/dist/hooks/useTableData.js +45 -0
- package/dist/hooks/useTableSelection.d.ts +25 -0
- package/dist/hooks/useTableSelection.js +128 -0
- package/dist/hooks/useTableSettings.d.ts +7 -0
- package/dist/hooks/useTableSettings.js +24 -0
- package/dist/hooks/useTheme.d.ts +3 -7
- package/dist/hooks/useTheme.js +52 -47
- package/dist/hooks/useTimeDuration.d.ts +22 -0
- package/dist/hooks/useTimeDuration.js +36 -0
- package/dist/hooks/useViewportFill.d.ts +3 -2
- package/dist/hooks/useViewportFill.js +55 -48
- package/dist/index.d.ts +32 -6
- package/dist/index.js +33 -6
- package/dist/src/styles/styles.css +101 -8
- package/dist/styles/css-helper-classes/flex.css +101 -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 +207 -100
- package/dist/styles/themes/dbc/light.css +185 -90
- package/dist/styles/themes/forfatterweb/light.css +1 -1
- package/dist/styles/themes/types.js +1 -1
- package/dist/types/a11y-props.types.d.ts +5 -5
- package/dist/types/a11y-props.types.js +1 -1
- package/dist/types/sizes.types.d.ts +2 -2
- package/dist/types/sizes.types.js +1 -1
- package/dist/utils/arrays/nested-filtering.js +43 -33
- package/dist/utils/date/formatDate.js +25 -16
- package/package.json +33 -18
- package/dist/assets/logo.cjs +0 -87
- package/dist/components/app-header/AppHeader.cjs +0 -14
- package/dist/components/avatar/Avatar.cjs +0 -67
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +0 -23
- package/dist/components/button/Button.cjs +0 -79
- package/dist/components/card/Card.cjs +0 -29
- package/dist/components/card-container/CardContainer.cjs +0 -23
- package/dist/components/checkbox/Checkbox.cjs +0 -43
- package/dist/components/checkbox/Checkbox.d.ts +0 -12
- package/dist/components/checkbox/Checkbox.js +0 -37
- package/dist/components/chip/Chip.cjs +0 -49
- package/dist/components/circle/Circle.cjs +0 -18
- package/dist/components/clear-button/ClearButton.cjs +0 -26
- 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/filter-field/FilterField.cjs +0 -174
- package/dist/components/headline/Headline.cjs +0 -47
- package/dist/components/icon/Icon.cjs +0 -27
- package/dist/components/input/Input.cjs +0 -48
- package/dist/components/input/Input.d.ts +0 -13
- package/dist/components/input/Input.js +0 -42
- package/dist/components/input/Input.module.css +0 -112
- package/dist/components/menu/Menu.cjs +0 -96
- package/dist/components/multi-select/MultiSelect.cjs +0 -48
- package/dist/components/multi-select/MultiSelect.d.ts +0 -18
- package/dist/components/multi-select/MultiSelect.js +0 -46
- package/dist/components/nav-bar/NavBar.cjs +0 -55
- package/dist/components/page/Page.cjs +0 -30
- package/dist/components/page-layout/PageLayout.cjs +0 -101
- package/dist/components/pagination/Pagination.cjs +0 -117
- package/dist/components/panel/Panel.cjs +0 -18
- package/dist/components/popover/Popover.cjs +0 -132
- package/dist/components/search-box/SearchBox.cjs +0 -162
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +0 -97
- package/dist/components/select/Select.cjs +0 -52
- package/dist/components/select/Select.d.ts +0 -11
- package/dist/components/select/Select.js +0 -50
- package/dist/components/sidebar/Sidebar.cjs +0 -38
- package/dist/components/sidebar/Sidebar.module.css +0 -66
- package/dist/components/sidebar/components/SidebarItem.cjs +0 -16
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +0 -74
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +0 -27
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +0 -28
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +0 -25
- package/dist/components/sidebar/providers/SidebarProvider.cjs +0 -81
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +0 -270
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +0 -42
- package/dist/components/split-button/SplitButton.cjs +0 -37
- package/dist/components/table/Table.cjs +0 -181
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +0 -22
- package/dist/components/tabs/Tabs.cjs +0 -74
- package/dist/components/text-area/Textarea.cjs +0 -62
- package/dist/components/text-area/Textarea.d.ts +0 -14
- package/dist/components/text-area/Textarea.js +0 -56
- package/dist/components/text-area/Textarea.module.css +0 -3
- package/dist/components/tooltip/Tooltip.cjs +0 -78
- package/dist/components/tooltip/Tooltip.d.ts +0 -11
- package/dist/components/tooltip/Tooltip.js +0 -72
- package/dist/components/tooltip/Tooltip.module.css +0 -84
- package/dist/components/user-display/UserDisplay.cjs +0 -28
- package/dist/constants/severity.cjs +0 -21
- package/dist/constants/severity.types.cjs +0 -2
- package/dist/constants/sizes.cjs +0 -10
- package/dist/hooks/useTheme.cjs +0 -58
- package/dist/hooks/useViewportFill.cjs +0 -52
- package/dist/index.cjs +0 -264
- package/dist/styles/themes/types.cjs +0 -2
- package/dist/tanstack.cjs +0 -231
- package/dist/tanstack.d.ts +0 -25
- package/dist/tanstack.js +0 -206
- package/dist/types/a11y-props.types.cjs +0 -2
- package/dist/types/assets.d.cjs +0 -2
- package/dist/types/assets.d.js +0 -1
- package/dist/types/css.d.cjs +0 -2
- package/dist/types/css.d.js +0 -1
- package/dist/types/sizes.types.cjs +0 -2
- package/dist/utils/arrays/nested-filtering.cjs +0 -40
- package/dist/utils/date/formatDate.cjs +0 -19
|
@@ -1,95 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { PageLayoutHero } from './components/page-layout-hero/PageLayoutHero';
|
|
2
4
|
import styles from './PageLayout.module.css';
|
|
3
|
-
|
|
4
|
-
const PageLayoutBase = ({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
flexDirection: "column",
|
|
25
|
-
height: "100%",
|
|
26
|
-
maxHeight: "100vh",
|
|
27
|
-
overflow: "auto"
|
|
28
|
-
},
|
|
29
|
-
children: [
|
|
30
|
-
header && /* @__PURE__ */ jsx("div", { className: styles.header, children: header }),
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"div",
|
|
33
|
-
{
|
|
34
|
-
style: {
|
|
35
|
-
flex: 1,
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
padding: "1rem",
|
|
39
|
-
gap: 20,
|
|
40
|
-
overflow: "auto"
|
|
41
|
-
},
|
|
42
|
-
children
|
|
43
|
-
}
|
|
44
|
-
)
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
] })
|
|
49
|
-
}
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
return /* @__PURE__ */ jsx("div", { className: `${styles.container} ${containScrolling ? styles.containScrolling : ""}`, children });
|
|
5
|
+
/** Base component */
|
|
6
|
+
const PageLayoutBase = ({ children, sidebar, header, containScrolling = false, orientation = 'vertical', }) => {
|
|
7
|
+
if (orientation === 'vertical') {
|
|
8
|
+
return (_jsx("div", { className: `${styles.container} ${styles.vertical} ${containScrolling ? styles.containScrolling : ''}`, children: _jsxs("div", { style: { flex: 1, display: 'flex', height: '100%', maxWidth: '100%' }, children: [sidebar, _jsxs("div", { style: {
|
|
9
|
+
flex: 1,
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
height: '100%',
|
|
13
|
+
maxHeight: '100vh',
|
|
14
|
+
overflow: 'auto',
|
|
15
|
+
}, children: [header && _jsx("div", { className: styles.header, children: header }), _jsx("div", { style: {
|
|
16
|
+
flex: 1,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
padding: 'var(--spacing-md)',
|
|
20
|
+
gap: 'var(--spacing-md)',
|
|
21
|
+
backgroundColor: 'var(--color-bg-surface)',
|
|
22
|
+
overflow: 'auto',
|
|
23
|
+
}, children: children })] })] }) }));
|
|
24
|
+
}
|
|
25
|
+
return (_jsx("div", { className: `${styles.container} ${containScrolling ? styles.containScrolling : ''}`, children: children }));
|
|
53
26
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) => {
|
|
58
|
-
return /* @__PURE__ */ jsx("div", { className: styles.headerContainer, children: /* @__PURE__ */ jsx("div", { className: `${styles.headerContent} ${maxWidth ? styles.maxWidth : ""}`, children }) });
|
|
27
|
+
/** Subcomponents */
|
|
28
|
+
const PageLayoutHeader = ({ maxWidth = true, children, }) => {
|
|
29
|
+
return (_jsx("div", { className: styles.headerContainer, children: _jsx("div", { className: `${styles.headerContent} ${maxWidth ? styles.maxWidth : ''}`, children: children }) }));
|
|
59
30
|
};
|
|
60
|
-
const
|
|
61
|
-
|
|
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
|
-
const PageLayoutContent = ({
|
|
80
|
-
maxWidth = true,
|
|
81
|
-
children
|
|
82
|
-
}) => {
|
|
83
|
-
return /* @__PURE__ */ jsx("main", { className: `${styles.content} ${maxWidth ? styles.maxWidth : ""}`, children });
|
|
31
|
+
const PageLayoutContent = ({ maxWidth = true, children, }) => {
|
|
32
|
+
return _jsx("main", { className: `${styles.content} ${maxWidth ? styles.maxWidth : ''}`, children: children });
|
|
84
33
|
};
|
|
85
34
|
const PageLayoutFooter = ({ children }) => {
|
|
86
|
-
|
|
35
|
+
return _jsx("footer", { className: styles.footer, children: children });
|
|
87
36
|
};
|
|
88
|
-
const PageLayout = Object.assign(PageLayoutBase, {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
37
|
+
export const PageLayout = Object.assign(PageLayoutBase, {
|
|
38
|
+
Header: PageLayoutHeader,
|
|
39
|
+
Hero: PageLayoutHero,
|
|
40
|
+
Content: PageLayoutContent,
|
|
41
|
+
Footer: PageLayoutFooter,
|
|
93
42
|
});
|
|
94
|
-
|
|
95
|
-
export { PageLayout };
|
|
@@ -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,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,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import heroStyles from './PageLayoutHero.module.css';
|
|
3
|
+
import layoutStyles from '../../PageLayout.module.css';
|
|
4
|
+
export const PageLayoutHero = ({ children, link, metaHeadline, headline, image, maxWidth = true, textBgColor = 'var(--color-primary-900)', }) => {
|
|
5
|
+
const content = (_jsx("div", { className: `${heroStyles.heroContainer} ${maxWidth ? layoutStyles.maxWidth : ''}`, children: _jsxs("div", { className: heroStyles.splitWrapper, children: [_jsx("div", { className: heroStyles.imageColumn, children: image }), _jsx("div", { className: heroStyles.textColumn, style: { backgroundColor: textBgColor }, children: _jsxs("div", { className: heroStyles.textInner, children: [metaHeadline && _jsx("div", { className: heroStyles.metaHeadline, children: metaHeadline }), headline && (_jsx("div", { className: heroStyles.headline, children: _jsx("h2", { children: headline }) })), children] }) })] }) }));
|
|
6
|
+
return link ? _jsx(_Fragment, { children: link(content) }) : _jsx(_Fragment, { children: content });
|
|
7
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export type PageChangeEvent = {
|
|
2
3
|
page: number;
|
|
3
4
|
take: number;
|
|
@@ -12,6 +13,8 @@ interface PaginationProps {
|
|
|
12
13
|
onPageChange?: (e: PageChangeEvent) => void;
|
|
13
14
|
lazy?: boolean;
|
|
14
15
|
pageSizeOptions?: number[];
|
|
16
|
+
showFirstLast?: boolean;
|
|
17
|
+
showGoToPage?: boolean;
|
|
15
18
|
}
|
|
16
|
-
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, }: PaginationProps):
|
|
19
|
+
export declare function Pagination({ itemsCount, skip, take, onPageChange, pageSizeOptions, showFirstLast, showGoToPage, }: PaginationProps): ReactNode;
|
|
17
20
|
export {};
|
|
@@ -1,111 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ArrowLeft, ArrowRight, ChevronDown, ChevronsLeft, ChevronsRight } from 'lucide-react';
|
|
2
4
|
import { useMemo, useCallback } from 'react';
|
|
3
5
|
import styles from './Pagination.module.css';
|
|
4
6
|
import { Button } from '../button/Button';
|
|
5
|
-
import { ArrowLeft, ArrowRight } from 'lucide-react';
|
|
6
|
-
import { Popover } from '../popover/Popover';
|
|
7
7
|
import { Menu } from '../menu/Menu';
|
|
8
|
-
|
|
8
|
+
import { Popover } from '../popover/Popover';
|
|
9
9
|
const DEFAULT_PAGE_SIZE_OPTIONS = [10, 25, 50, 100];
|
|
10
|
-
function Pagination({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
let startIndex = Math.max(currentPage - Math.floor(visiblePages / 2) - 1, 0);
|
|
45
|
-
let endIndex = startIndex + visiblePages;
|
|
46
|
-
if (endIndex > totalPages) {
|
|
47
|
-
endIndex = totalPages;
|
|
48
|
-
startIndex = Math.max(endIndex - visiblePages, 0);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
first: startIndex > 0 ? 1 : void 0,
|
|
52
|
-
items: pages.slice(startIndex, endIndex),
|
|
53
|
-
last: endIndex < totalPages ? totalPages : void 0
|
|
54
|
-
};
|
|
55
|
-
}, [totalPages, currentPage]);
|
|
56
|
-
const handlePageSizeChange = useCallback(
|
|
57
|
-
(size) => {
|
|
58
|
-
onPageChange == null ? void 0 : onPageChange({
|
|
59
|
-
page: 1,
|
|
60
|
-
take: size,
|
|
61
|
-
skip: 0,
|
|
62
|
-
totalPages: Math.max(1, Math.ceil(itemsCount / Math.max(1, size)))
|
|
63
|
-
});
|
|
64
|
-
},
|
|
65
|
-
[onPageChange, itemsCount]
|
|
66
|
-
);
|
|
67
|
-
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
68
|
-
/* @__PURE__ */ jsx(Button, { disabled: currentPage === 1, icon: /* @__PURE__ */ jsx(ArrowLeft, {}), onClick: prevPage }),
|
|
69
|
-
pageList.first && /* @__PURE__ */ jsxs("span", { className: styles.ellipsisButton, children: [
|
|
70
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", onClick: () => goToPage(1), children: pageList.first }),
|
|
71
|
-
"\u2026"
|
|
72
|
-
] }),
|
|
73
|
-
pageList.items.map((page) => /* @__PURE__ */ jsx(
|
|
74
|
-
Button,
|
|
75
|
-
{
|
|
76
|
-
"aria-current": page === currentPage ? "page" : void 0,
|
|
77
|
-
variant: "outlined",
|
|
78
|
-
onClick: () => goToPage(page),
|
|
79
|
-
active: page === currentPage,
|
|
80
|
-
children: page
|
|
81
|
-
},
|
|
82
|
-
page
|
|
83
|
-
)),
|
|
84
|
-
pageList.last !== void 0 && /* @__PURE__ */ jsxs("span", { className: styles.ellipsisButton, children: [
|
|
85
|
-
"\u2026",
|
|
86
|
-
/* @__PURE__ */ jsx(Button, { variant: "outlined", onClick: () => goToPage(pageList.last), children: pageList.last })
|
|
87
|
-
] }),
|
|
88
|
-
/* @__PURE__ */ jsx(Button, { disabled: currentPage === totalPages, icon: /* @__PURE__ */ jsx(ArrowRight, {}), onClick: nextPage }),
|
|
89
|
-
/* @__PURE__ */ jsx(
|
|
90
|
-
Popover,
|
|
91
|
-
{
|
|
92
|
-
trigger: (event, icon) => /* @__PURE__ */ jsxs(Button, { variant: "outlined", onClick: event, children: [
|
|
93
|
-
"Vis ",
|
|
94
|
-
take,
|
|
95
|
-
icon
|
|
96
|
-
] }),
|
|
97
|
-
children: /* @__PURE__ */ jsx(Menu, { children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx(Menu.Item, { active: size === take, children: /* @__PURE__ */ jsx(
|
|
98
|
-
"button",
|
|
99
|
-
{
|
|
100
|
-
onClick: () => {
|
|
101
|
-
handlePageSizeChange(size);
|
|
102
|
-
},
|
|
103
|
-
children: size
|
|
104
|
-
}
|
|
105
|
-
) }, size)) })
|
|
106
|
-
}
|
|
107
|
-
)
|
|
108
|
-
] });
|
|
10
|
+
export function Pagination({ itemsCount = 0, skip = 0, take = DEFAULT_PAGE_SIZE_OPTIONS[1], onPageChange, pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS, showFirstLast = true, showGoToPage = true, }) {
|
|
11
|
+
const totalPages = useMemo(() => Math.max(1, Math.ceil(itemsCount / Math.max(1, take))), [itemsCount, take]);
|
|
12
|
+
const currentPage = useMemo(() => {
|
|
13
|
+
const p = Math.floor(skip / Math.max(1, take)) + 1;
|
|
14
|
+
return Math.min(Math.max(1, p), totalPages);
|
|
15
|
+
}, [skip, take, totalPages]);
|
|
16
|
+
const emit = useCallback((page, nextTake = take) => {
|
|
17
|
+
const nextTotalPages = Math.max(1, Math.ceil(itemsCount / Math.max(1, nextTake)));
|
|
18
|
+
const clampedPage = Math.min(Math.max(1, page), nextTotalPages);
|
|
19
|
+
const nextSkip = (clampedPage - 1) * nextTake;
|
|
20
|
+
onPageChange === null || onPageChange === void 0 ? void 0 : onPageChange({
|
|
21
|
+
page: clampedPage,
|
|
22
|
+
take: nextTake,
|
|
23
|
+
skip: nextSkip,
|
|
24
|
+
totalPages: nextTotalPages,
|
|
25
|
+
});
|
|
26
|
+
}, [onPageChange, take, itemsCount]);
|
|
27
|
+
const firstPage = useCallback(() => emit(1), [emit]);
|
|
28
|
+
const lastPage = useCallback(() => emit(totalPages), [emit, totalPages]);
|
|
29
|
+
const prevPage = useCallback(() => emit(currentPage - 1), [emit, currentPage]);
|
|
30
|
+
const nextPage = useCallback(() => emit(currentPage + 1), [emit, currentPage]);
|
|
31
|
+
const goToPage = useCallback((page) => emit(page), [emit]);
|
|
32
|
+
const canPrev = currentPage > 1;
|
|
33
|
+
const canNext = currentPage < totalPages;
|
|
34
|
+
const rangeLabel = useMemo(() => {
|
|
35
|
+
if (itemsCount <= 0)
|
|
36
|
+
return '0 af 0';
|
|
37
|
+
const first = skip + 1;
|
|
38
|
+
const last = Math.min(skip + take, itemsCount);
|
|
39
|
+
return `${first.toLocaleString('da-DK')}\u2013${last.toLocaleString('da-DK')} af ${itemsCount.toLocaleString('da-DK')}`;
|
|
40
|
+
}, [itemsCount, skip, take]);
|
|
41
|
+
const pages = useMemo(() => Array.from({ length: totalPages }, (_, i) => i + 1), [totalPages]);
|
|
42
|
+
const handlePageSizeChange = useCallback((size) => emit(1, size), [emit]);
|
|
43
|
+
return (_jsxs("div", { className: styles.container, children: [showFirstLast && (_jsx(Button, { size: "sm", icon: _jsx(ChevronsLeft, {}), disabled: !canPrev, onClick: firstPage, "aria-label": "First page" })), _jsx(Button, { size: "sm", icon: _jsx(ArrowLeft, {}), disabled: !canPrev, onClick: prevPage, "aria-label": "Previous page" }), _jsx("div", { className: styles.range, "aria-live": "polite", children: rangeLabel }), _jsx(Button, { size: "sm", icon: _jsx(ArrowRight, {}), disabled: !canNext, onClick: nextPage, "aria-label": "Next page" }), showFirstLast && (_jsx(Button, { size: "sm", icon: _jsx(ChevronsRight, {}), disabled: !canNext, onClick: lastPage, "aria-label": "Last page" })), showGoToPage && (_jsx(Popover, { trigger: open => (_jsxs(Button, { size: "sm", variant: "outlined", onClick: open, children: ["Side ", currentPage, "/", totalPages, " ", _jsx(ChevronDown, { size: 16 })] })), children: _jsx(Menu, { children: pages.map(page => (_jsx(Menu.Item, { active: page === currentPage, children: _jsx("button", { onClick: () => goToPage(page), children: page }) }, page))) }) })), _jsx(Popover, { trigger: open => (_jsxs(Button, { size: "sm", variant: "outlined", onClick: open, children: ["Vis ", take, " ", _jsx(ChevronDown, { size: 16 })] })), children: _jsx(Menu, { children: pageSizeOptions.map(size => (_jsx(Menu.Item, { active: size === take, children: _jsx("button", { onClick: () => handlePageSizeChange(size), children: size }) }, size))) }) })] }));
|
|
109
44
|
}
|
|
110
|
-
|
|
111
|
-
export { Pagination };
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
.container {
|
|
2
2
|
display: flex;
|
|
3
|
-
gap:
|
|
4
|
-
align-items:
|
|
3
|
+
gap: var(--spacing-xxs);
|
|
4
|
+
align-items: center;
|
|
5
5
|
justify-content: center;
|
|
6
6
|
margin: 0 auto;
|
|
7
|
+
max-width: 100%;
|
|
8
|
+
overflow-x: auto;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.ellipsisButton {
|
|
10
12
|
display: none;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
@media (min-width:
|
|
15
|
+
@media (min-width: var(--bp-xs)) {
|
|
14
16
|
.ellipsisButton {
|
|
15
17
|
display: contents;
|
|
16
18
|
}
|
|
17
19
|
}
|
|
20
|
+
.range {
|
|
21
|
+
min-width: 110px;
|
|
22
|
+
text-align: center;
|
|
23
|
+
font-size: var(--font-size-xs);
|
|
24
|
+
padding: 0 var(--spacing-xxs);
|
|
25
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { ReactNode, JSX } from 'react';
|
|
1
2
|
interface PanelProps {
|
|
2
3
|
header: string;
|
|
3
|
-
headerIcon?:
|
|
4
|
+
headerIcon?: ReactNode;
|
|
4
5
|
severity?: Severity;
|
|
5
|
-
children:
|
|
6
|
+
children: ReactNode;
|
|
6
7
|
size?: 'sm' | 'md' | 'lg';
|
|
7
8
|
}
|
|
8
|
-
import { Severity } from '
|
|
9
|
+
import { Severity } from '../../constants/severity.types';
|
|
9
10
|
export declare function Panel({ header, headerIcon, children, severity, size }: PanelProps): JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import styles from './Panel.module.css';
|
|
4
|
-
|
|
5
|
-
function Panel({ header, headerIcon, children, severity, size }) {
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */ jsx("div", { className: styles.header, children: /* @__PURE__ */ jsx(Headline, { disableMargin: true, size: 3, icon: headerIcon, severity, children: header }) }),
|
|
8
|
-
/* @__PURE__ */ jsx("div", { className: styles.content, children })
|
|
9
|
-
] });
|
|
4
|
+
import { Headline } from '../headline/Headline';
|
|
5
|
+
export function Panel({ header, headerIcon, children, severity, size }) {
|
|
6
|
+
return (_jsxs("section", { className: `${styles.container} ${size ? styles[size] : ''}`, children: [_jsx("div", { className: styles.header, children: _jsx(Headline, { disableMargin: true, size: 3, icon: headerIcon, severity: severity, children: header }) }), _jsx("div", { className: styles.content, children: children })] }));
|
|
10
7
|
}
|
|
11
|
-
|
|
12
|
-
export { Panel };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.container {
|
|
2
2
|
border: 1px solid var(--color-border-strong);
|
|
3
3
|
border-radius: var(--border-radius-default);
|
|
4
|
-
background-color: var(--color-bg);
|
|
4
|
+
background-color: var(--color-bg-surface);
|
|
5
5
|
box-sizing: border-box;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
@@ -11,19 +11,17 @@
|
|
|
11
11
|
border-bottom: 1px solid var(--color-border-strong);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
14
|
.content {
|
|
16
15
|
padding: var(--spacing-md);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
.header
|
|
20
|
-
{
|
|
18
|
+
.header {
|
|
21
19
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
|
|
25
22
|
.container.sm {
|
|
26
|
-
.header
|
|
23
|
+
.header,
|
|
24
|
+
.content {
|
|
27
25
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
28
26
|
}
|
|
29
|
-
}
|
|
27
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface PopoverProps {
|
|
3
3
|
trigger: (event: (e: React.MouseEvent<HTMLElement> | React.FocusEvent<HTMLElement>) => void, icon: React.ReactNode) => React.ReactNode;
|
|
4
|
-
children: React.ReactNode;
|
|
4
|
+
children: ((close?: () => void) => React.ReactNode) | React.ReactNode;
|
|
5
5
|
minWidth?: string;
|
|
6
|
+
matchTriggerWidth?: boolean;
|
|
6
7
|
viewportPadding?: number;
|
|
7
8
|
edgeBuffer?: number;
|
|
9
|
+
dataCy?: string;
|
|
8
10
|
}
|
|
9
11
|
export interface PopoverHandle {
|
|
10
12
|
close: () => void;
|