@dbcdk/react-components 0.0.103 → 0.0.104
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 +87 -0
- package/dist/assets/logo.js +85 -0
- package/dist/client.cjs +587 -0
- package/dist/client.d.ts +83 -0
- package/dist/client.js +84 -0
- package/dist/components/accordion/Accordion.cjs +103 -0
- package/dist/components/accordion/Accordion.js +97 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +115 -0
- package/dist/components/accordion/components/AccordionRow.js +109 -0
- package/dist/components/accordion/components/AccordionRow.module.css +99 -0
- package/dist/components/alert/Alert.cjs +52 -0
- package/dist/components/alert/Alert.d.ts +2 -1
- package/dist/components/alert/Alert.js +46 -0
- package/dist/components/alert/Alert.module.css +97 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.js +8 -0
- package/dist/components/app-header/AppHeader.module.css +74 -0
- package/dist/components/attribute-chip/AttributeChip.cjs +22 -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 +111 -0
- package/dist/components/avatar/Avatar.js +86 -0
- package/dist/components/avatar/Avatar.module.css +91 -0
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +24 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +80 -0
- package/dist/components/button/Button.cjs +149 -0
- package/dist/components/button/Button.js +124 -0
- package/dist/components/button/Button.module.css +260 -0
- package/dist/components/button-select/ButtonSelect.cjs +35 -0
- package/dist/components/button-select/ButtonSelect.js +29 -0
- package/dist/components/button-select/ButtonSelect.module.css +40 -0
- package/dist/components/card/Card.cjs +112 -0
- package/dist/components/card/Card.d.ts +2 -1
- package/dist/components/card/Card.js +106 -0
- package/dist/components/card/Card.module.css +187 -0
- package/dist/components/card/components/CardMeta.cjs +62 -0
- package/dist/components/card/components/CardMeta.js +55 -0
- package/dist/components/card/components/CardMeta.module.css +55 -0
- package/dist/components/card-container/CardContainer.cjs +34 -0
- package/dist/components/card-container/CardContainer.js +28 -0
- package/dist/components/card-container/CardContainer.module.css +63 -0
- package/dist/components/chip/Chip.cjs +65 -0
- package/dist/components/chip/Chip.js +59 -0
- package/dist/components/chip/Chip.module.css +236 -0
- package/dist/components/circle/Circle.cjs +33 -0
- package/dist/components/circle/Circle.js +27 -0
- package/dist/components/circle/Circle.module.css +128 -0
- package/dist/components/clear-button/ClearButton.cjs +33 -0
- package/dist/components/clear-button/ClearButton.d.ts +2 -1
- package/dist/components/clear-button/ClearButton.js +27 -0
- package/dist/components/clear-button/ClearButton.module.css +26 -0
- package/dist/components/code-block/CodeBlock.cjs +97 -0
- package/dist/components/code-block/CodeBlock.js +91 -0
- package/dist/components/code-block/CodeBlock.module.css +124 -0
- package/dist/components/copy-button/CopyButton.cjs +139 -0
- package/dist/components/copy-button/CopyButton.js +133 -0
- package/dist/components/copy-button/CopyButton.module.css +22 -0
- package/dist/components/datetime-picker/DateTimePicker.cjs +559 -0
- package/dist/components/datetime-picker/DateTimePicker.js +553 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +179 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +160 -0
- package/dist/components/divider/Divider.cjs +22 -0
- package/dist/components/divider/Divider.js +20 -0
- package/dist/components/filter-field/FilterField.cjs +296 -0
- package/dist/components/filter-field/FilterField.js +289 -0
- package/dist/components/filter-field/FilterField.module.css +379 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.js +108 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.module.css +59 -0
- package/dist/components/forms/checkbox/Checkbox.cjs +88 -0
- package/dist/components/forms/checkbox/Checkbox.js +82 -0
- package/dist/components/forms/checkbox/Checkbox.module.css +104 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.js +115 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.module.css +115 -0
- package/dist/components/forms/form-select/FormSelect.cjs +191 -0
- package/dist/components/forms/form-select/FormSelect.js +166 -0
- package/dist/components/forms/form-select/FormSelect.module.css +236 -0
- package/dist/components/forms/input/Input.cjs +188 -0
- package/dist/components/forms/input/Input.d.ts +1 -0
- package/dist/components/forms/input/Input.js +182 -0
- package/dist/components/forms/input/Input.module.css +468 -0
- package/dist/components/forms/input-container/InputContainer.cjs +72 -0
- package/dist/components/forms/input-container/InputContainer.js +66 -0
- package/dist/components/forms/input-container/InputContainer.module.css +59 -0
- package/dist/components/forms/multi-select/MultiSelect.cjs +227 -0
- package/dist/components/forms/multi-select/MultiSelect.js +225 -0
- package/dist/components/forms/radio-buttons/RadioButton.cjs +91 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +85 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +118 -0
- package/dist/components/forms/select/Select.cjs +286 -0
- package/dist/components/forms/select/Select.js +280 -0
- package/dist/components/forms/select/Select.module.css +32 -0
- package/dist/components/forms/text-area/Textarea.cjs +116 -0
- package/dist/components/forms/text-area/Textarea.js +110 -0
- package/dist/components/forms/text-area/Textarea.module.css +70 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +792 -0
- package/dist/components/forms/typeahead/Typeahead.js +768 -0
- package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
- package/dist/components/grid/Grid.cjs +45 -0
- package/dist/components/grid/Grid.js +38 -0
- package/dist/components/grid/Grid.module.css +35 -0
- package/dist/components/headline/CollapsibleHeadline.cjs +80 -0
- package/dist/components/headline/CollapsibleHeadline.js +74 -0
- package/dist/components/headline/Headline.cjs +59 -0
- package/dist/components/headline/Headline.js +53 -0
- package/dist/components/headline/Headline.module.css +185 -0
- package/dist/components/hyperlink/Hyperlink.cjs +107 -0
- package/dist/components/hyperlink/Hyperlink.js +82 -0
- package/dist/components/hyperlink/Hyperlink.module.css +121 -0
- package/dist/components/icon/Icon.cjs +27 -0
- package/dist/components/icon/Icon.js +20 -0
- package/dist/components/icon/Icon.module.css +36 -0
- package/dist/components/inline-status/InlineStatus.cjs +39 -0
- package/dist/components/inline-status/InlineStatus.js +33 -0
- package/dist/components/inline-status/InlineStatus.module.css +92 -0
- package/dist/components/interval-select/IntervalSelect.cjs +203 -0
- package/dist/components/interval-select/IntervalSelect.js +201 -0
- package/dist/components/json-viewer/HighlightedText.cjs +13 -0
- package/dist/components/json-viewer/HighlightedText.js +11 -0
- package/dist/components/json-viewer/JsonNode.cjs +124 -0
- package/dist/components/json-viewer/JsonNode.js +118 -0
- package/dist/components/json-viewer/JsonViewer.cjs +164 -0
- package/dist/components/json-viewer/JsonViewer.js +158 -0
- package/dist/components/json-viewer/JsonViewer.module.css +346 -0
- package/dist/components/json-viewer/types.cjs +2 -0
- package/dist/components/json-viewer/types.js +1 -0
- package/dist/components/json-viewer/useClipboardStatus.cjs +15 -0
- package/dist/components/json-viewer/useClipboardStatus.js +13 -0
- package/dist/components/json-viewer/utils.cjs +126 -0
- package/dist/components/json-viewer/utils.js +111 -0
- package/dist/components/media-card/MediaCard.cjs +60 -0
- package/dist/components/media-card/MediaCard.d.ts +19 -0
- package/dist/components/media-card/MediaCard.js +54 -0
- package/dist/components/media-card/MediaCard.module.css +92 -0
- package/dist/components/menu/Menu.cjs +287 -0
- package/dist/components/menu/Menu.js +262 -0
- package/dist/components/menu/Menu.module.css +220 -0
- package/dist/components/meta-bar/MetaBar.cjs +28 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +27 -0
- package/dist/components/nav-bar/NavBar.cjs +95 -0
- package/dist/components/nav-bar/NavBar.d.ts +1 -1
- package/dist/components/nav-bar/NavBar.js +89 -0
- package/dist/components/nav-bar/NavBar.module.css +225 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.js +24 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.module.css +54 -0
- package/dist/components/overlay/modal/Modal.cjs +189 -0
- package/dist/components/overlay/modal/Modal.d.ts +2 -1
- package/dist/components/overlay/modal/Modal.js +183 -0
- package/dist/components/overlay/modal/Modal.module.css +112 -0
- package/dist/components/overlay/modal/provider/ModalProvider.cjs +98 -0
- package/dist/components/overlay/modal/provider/ModalProvider.js +95 -0
- package/dist/components/overlay/side-panel/SidePanel.cjs +173 -0
- package/dist/components/overlay/side-panel/SidePanel.js +167 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +177 -0
- package/dist/components/overlay/side-panel/useSidePanel.cjs +16 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
- package/dist/components/overlay/tooltip/Tooltip.cjs +34 -0
- package/dist/components/overlay/tooltip/Tooltip.js +32 -0
- package/dist/components/overlay/tooltip/Tooltip.module.css +104 -0
- package/dist/components/overlay/tooltip/TooltipProvider.cjs +238 -0
- package/dist/components/overlay/tooltip/TooltipProvider.js +231 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.cjs +117 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
- package/dist/components/page/Page.cjs +63 -0
- package/dist/components/page/Page.js +57 -0
- package/dist/components/page/Page.module.css +95 -0
- package/dist/components/page-layout/PageLayout.cjs +97 -0
- package/dist/components/page-layout/PageLayout.d.ts +0 -5
- package/dist/components/page-layout/PageLayout.js +91 -0
- package/dist/components/page-layout/PageLayout.module.css +236 -0
- package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
- package/dist/components/page-layout/components/footer/Footer.js +47 -0
- package/dist/components/page-layout/components/footer/Footer.module.css +89 -0
- package/dist/components/pagination/Pagination.cjs +160 -0
- package/dist/components/pagination/Pagination.js +154 -0
- package/dist/components/pagination/Pagination.module.css +25 -0
- package/dist/components/panel/Panel.cjs +38 -0
- package/dist/components/panel/Panel.js +32 -0
- package/dist/components/panel/Panel.module.css +30 -0
- package/dist/components/popover/Popover.cjs +331 -0
- package/dist/components/popover/Popover.js +307 -0
- package/dist/components/popover/Popover.module.css +52 -0
- package/dist/components/search-box/SearchBox.cjs +274 -0
- package/dist/components/search-box/SearchBox.js +268 -0
- package/dist/components/search-box/SearchBox.module.css +27 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +127 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +121 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +174 -0
- package/dist/components/sidebar/Sidebar.cjs +39 -0
- package/dist/components/sidebar/Sidebar.js +37 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
- package/dist/components/sidebar/components/SidebarItem.js +27 -0
- package/dist/components/sidebar/components/SidebarItem.module.css +0 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +133 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +127 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +29 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +214 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +207 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +260 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +106 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +55 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.module.css +20 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.cjs +97 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +91 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
- package/dist/components/sidebar/providers/SidebarProvider.js +220 -0
- package/dist/components/skeleton-loader/SkeletonLoader.cjs +442 -0
- package/dist/components/skeleton-loader/SkeletonLoader.js +440 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.cjs +42 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +51 -0
- package/dist/components/split-button/SplitButton.cjs +46 -0
- package/dist/components/split-button/SplitButton.js +40 -0
- package/dist/components/split-button/SplitButton.module.css +32 -0
- package/dist/components/split-pane/SplitPane.cjs +177 -0
- package/dist/components/split-pane/SplitPane.js +168 -0
- package/dist/components/split-pane/SplitPane.module.css +111 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
- package/dist/components/stack/Stack.cjs +47 -0
- package/dist/components/stack/Stack.d.ts +1 -1
- package/dist/components/stack/Stack.js +41 -0
- package/dist/components/stack/Stack.module.css +61 -0
- package/dist/components/state-page/StatePage.cjs +48 -0
- package/dist/components/state-page/StatePage.js +42 -0
- package/dist/components/state-page/StatePage.module.css +9 -0
- package/dist/components/state-page/empty.cjs +664 -0
- package/dist/components/state-page/empty.js +662 -0
- package/dist/components/state-page/error.cjs +310 -0
- package/dist/components/state-page/error.js +308 -0
- package/dist/components/state-page/notFound.cjs +243 -0
- package/dist/components/state-page/notFound.js +241 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.cjs +98 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
- package/dist/components/table/Table.cjs +216 -0
- package/dist/components/table/Table.js +210 -0
- package/dist/components/table/Table.module.css +534 -0
- package/dist/components/table/Table.types.cjs +2 -0
- package/dist/components/table/Table.types.js +1 -0
- package/dist/components/table/TanstackTable.cjs +172 -0
- package/dist/components/table/TanstackTable.js +147 -0
- package/dist/components/table/components/TableBody.cjs +50 -0
- package/dist/components/table/components/TableBody.js +44 -0
- package/dist/components/table/components/TableHeader.cjs +56 -0
- package/dist/components/table/components/TableHeader.js +50 -0
- package/dist/components/table/components/TableHeaderCell.cjs +69 -0
- package/dist/components/table/components/TableHeaderCell.js +63 -0
- package/dist/components/table/components/TableLoadingBody.cjs +35 -0
- package/dist/components/table/components/TableLoadingBody.js +29 -0
- package/dist/components/table/components/TablePagination.cjs +2 -0
- package/dist/components/table/components/TablePagination.js +1 -0
- package/dist/components/table/components/TableRow.cjs +151 -0
- package/dist/components/table/components/TableRow.js +145 -0
- package/dist/components/table/components/TableSelectionCell.cjs +41 -0
- package/dist/components/table/components/TableSelectionCell.js +35 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.cjs +25 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +22 -0
- package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
- package/dist/components/table/components/empty-state/EmptyState.js +31 -0
- package/dist/components/table/components/empty-state/EmptyState.module.css +4 -0
- package/dist/components/table/components/table-settings/TableSettings.cjs +139 -0
- package/dist/components/table/components/table-settings/TableSettings.js +137 -0
- package/dist/components/table/hooks/useTableRowInteractions.cjs +46 -0
- package/dist/components/table/hooks/useTableRowInteractions.js +44 -0
- package/dist/components/table/table.classes.cjs +49 -0
- package/dist/components/table/table.classes.js +40 -0
- package/dist/components/table/table.utils.cjs +57 -0
- package/dist/components/table/table.utils.js +45 -0
- package/dist/components/table/tanstackTable.utils.cjs +166 -0
- package/dist/components/table/tanstackTable.utils.js +159 -0
- package/dist/components/tabs/Tabs.cjs +172 -0
- package/dist/components/tabs/Tabs.js +166 -0
- package/dist/components/tabs/Tabs.module.css +261 -0
- package/dist/components/theme-button/ThemeButton.cjs +78 -0
- package/dist/components/theme-button/ThemeButton.js +75 -0
- package/dist/components/toast/Toast.cjs +68 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/toast/Toast.module.css +161 -0
- package/dist/components/toast/provider/ToastProvider.cjs +105 -0
- package/dist/components/toast/provider/ToastProvider.js +97 -0
- package/dist/components/user-display/UserDisplay.cjs +22 -0
- package/dist/components/user-display/UserDisplay.js +16 -0
- package/dist/components/user-display/UserDisplay.module.css +25 -0
- package/dist/constants/chart-colors.cjs +10 -0
- package/dist/constants/chart-colors.js +8 -0
- package/dist/constants/chart-colors.types.cjs +2 -0
- package/dist/constants/chart-colors.types.js +1 -0
- package/dist/constants/severity.cjs +30 -0
- package/dist/constants/severity.js +26 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +11 -0
- package/dist/constants/sizes.js +9 -0
- package/dist/hooks/useDeviceSize.cjs +35 -0
- package/dist/hooks/useDeviceSize.js +33 -0
- package/dist/hooks/useListNavigation.cjs +237 -0
- package/dist/hooks/useListNavigation.js +235 -0
- package/dist/hooks/usePagination.cjs +144 -0
- package/dist/hooks/usePagination.js +142 -0
- package/dist/hooks/useSorting.cjs +119 -0
- package/dist/hooks/useSorting.js +117 -0
- package/dist/hooks/useTableData.cjs +53 -0
- package/dist/hooks/useTableData.js +51 -0
- package/dist/hooks/useTableSelection.cjs +172 -0
- package/dist/hooks/useTableSelection.js +170 -0
- package/dist/hooks/useTableSettings.cjs +90 -0
- package/dist/hooks/useTableSettings.js +87 -0
- package/dist/hooks/useTheme.cjs +64 -0
- package/dist/hooks/useTheme.js +62 -0
- package/dist/hooks/useTimeDuration.cjs +72 -0
- package/dist/hooks/useTimeDuration.js +70 -0
- package/dist/hooks/useViewportFill.cjs +82 -0
- package/dist/hooks/useViewportFill.js +80 -0
- package/dist/index.cjs +161 -12908
- package/dist/index.css +67 -7357
- package/dist/index.d.ts +0 -58
- package/dist/index.js +24 -12809
- package/dist/styles/animation.cjs +9 -0
- package/dist/styles/animation.js +7 -0
- package/dist/styles/themes/dbc/colors.css +5 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/tanstack.cjs +18 -2717
- package/dist/tanstack.js +3 -2701
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.js +1 -0
- package/dist/types/assets.d.cjs +2 -0
- package/dist/types/assets.d.js +1 -0
- package/dist/types/css.d.cjs +2 -0
- package/dist/types/css.d.js +1 -0
- package/dist/types/sizes.types.cjs +2 -0
- package/dist/types/sizes.types.js +1 -0
- package/dist/utils/arrays/nested-filtering.cjs +40 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/date/formatDate.cjs +35 -0
- package/dist/utils/date/formatDate.js +33 -0
- package/dist/utils/localStorage.utils.cjs +53 -0
- package/dist/utils/localStorage.utils.js +49 -0
- package/dist/utils/text/get-highlighted-segments.cjs +49 -0
- package/dist/utils/text/get-highlighted-segments.js +47 -0
- package/package.json +8 -3
- package/dist/tanstack.css +0 -1385
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
.root {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
min-width: 0;
|
|
5
|
+
overflow: auto;
|
|
6
|
+
flex-grow: 1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.headerContainer {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding-block: var(--spacing-lg);
|
|
14
|
+
gap: var(--spacing-md);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.headerContainer.disableTopPadding {
|
|
18
|
+
padding-block-start: 0;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Outer wrapper for tablist + content */
|
|
22
|
+
.tabs {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
flex-grow: 1;
|
|
26
|
+
overflow: hidden;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Tablist */
|
|
31
|
+
.tabList {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-wrap: wrap;
|
|
34
|
+
min-width: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Individual tab wrapper */
|
|
38
|
+
.tab {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
border-radius: 0;
|
|
42
|
+
border-block-end: 2px solid var(--color-border-default);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.active {
|
|
46
|
+
border-block-end-color: var(--color-brand);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Button */
|
|
50
|
+
.tabButton {
|
|
51
|
+
font-size: var(--font-size-sm);
|
|
52
|
+
color: inherit;
|
|
53
|
+
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
gap: var(--spacing-xs);
|
|
58
|
+
|
|
59
|
+
white-space: nowrap;
|
|
60
|
+
|
|
61
|
+
background: none;
|
|
62
|
+
border: 0;
|
|
63
|
+
border-radius: 0;
|
|
64
|
+
|
|
65
|
+
padding-block: var(--spacing-sm);
|
|
66
|
+
padding-inline: var(--spacing-md);
|
|
67
|
+
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
|
|
70
|
+
transition:
|
|
71
|
+
color var(--transition-fast) var(--ease-standard),
|
|
72
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
73
|
+
border-color var(--transition-fast) var(--ease-standard);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.active .tabButton {
|
|
77
|
+
}
|
|
78
|
+
.tabButton:focus-visible {
|
|
79
|
+
outline: none;
|
|
80
|
+
box-shadow: var(--focus-ring);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.tabButton:disabled {
|
|
84
|
+
cursor: not-allowed;
|
|
85
|
+
color: var(--color-disabled-fg);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Icon + label */
|
|
89
|
+
.icon {
|
|
90
|
+
display: inline-flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
color: inherit;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.icon svg {
|
|
96
|
+
inline-size: var(--icon-size-md);
|
|
97
|
+
block-size: var(--icon-size-md);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.label {
|
|
101
|
+
display: inline-block;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.badge {
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/* Content panel */
|
|
110
|
+
.tabContent {
|
|
111
|
+
flex: 1 1 auto;
|
|
112
|
+
min-height: 0;
|
|
113
|
+
overflow: auto;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.loadingContent {
|
|
117
|
+
display: flex;
|
|
118
|
+
width: 100%;
|
|
119
|
+
min-height: 12rem;
|
|
120
|
+
height: 100%;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* =========================
|
|
124
|
+
Filled variant
|
|
125
|
+
========================= */
|
|
126
|
+
|
|
127
|
+
.filled {
|
|
128
|
+
gap: 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/* Outer container: layout only, no visible border — tab list is borderless */
|
|
132
|
+
.tabs.filled {
|
|
133
|
+
border-radius: var(--border-radius-md);
|
|
134
|
+
background: var(--color-bg-surface);
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.filled .tabList {
|
|
139
|
+
border-block-end: 1px solid var(--color-border-subtle);
|
|
140
|
+
background: var(--color-bg-surface);
|
|
141
|
+
inline-size: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.filled .tab {
|
|
145
|
+
border: 1px solid transparent;
|
|
146
|
+
color: var(--color-fg-muted);
|
|
147
|
+
position: relative;
|
|
148
|
+
transition:
|
|
149
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
150
|
+
color var(--transition-fast) var(--ease-standard),
|
|
151
|
+
border-color var(--transition-fast) var(--ease-standard);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.filled .tab:not(.active):hover {
|
|
155
|
+
color: var(--color-brand);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Active tab physically overlaps the tabList separator by 1px so its
|
|
159
|
+
erased bottom border seamlessly merges with the panel below.
|
|
160
|
+
No top border — the outer container already provides the top edge. */
|
|
161
|
+
.filled .tab.active {
|
|
162
|
+
background: var(--opac-bg-brand);
|
|
163
|
+
border-inline-color: var(--color-border-subtle);
|
|
164
|
+
border-block-start-color: var(--color-border-subtle);
|
|
165
|
+
border-block-end-color: var(--opac-bg-brand);
|
|
166
|
+
border-start-start-radius: var(--border-radius-md);
|
|
167
|
+
border-start-end-radius: var(--border-radius-md);
|
|
168
|
+
margin-block-end: -1px;
|
|
169
|
+
z-index: 1;
|
|
170
|
+
color: var(--color-brand);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.filled .tabContent {
|
|
174
|
+
background: var(--color-bg-surface);
|
|
175
|
+
border: 1px solid var(--color-border-subtle);
|
|
176
|
+
border-block-start: none;
|
|
177
|
+
border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
|
|
178
|
+
box-shadow: var(--shadow-xs);
|
|
179
|
+
padding: var(--spacing-lg);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* =========================
|
|
183
|
+
Outlined variant
|
|
184
|
+
========================= */
|
|
185
|
+
|
|
186
|
+
.outlined {
|
|
187
|
+
gap: var(--spacing-lg);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.outlined .tab {
|
|
191
|
+
color: var(--color-fg-muted);
|
|
192
|
+
border-block-end: 2px solid var(--color-border-default);
|
|
193
|
+
transition: color var(--transition-fast) var(--ease-standard);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.outlined .tab:not(.active):hover {
|
|
197
|
+
color: var(--color-brand);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.outlined .tab.active {
|
|
201
|
+
color: var(--color-brand);
|
|
202
|
+
border-block-end-color: var(--color-brand);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.outlined .tabContent {
|
|
206
|
+
background: transparent;
|
|
207
|
+
padding: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/* =========================
|
|
211
|
+
Panel style modifier
|
|
212
|
+
========================= */
|
|
213
|
+
|
|
214
|
+
.panelStyle .tabList {
|
|
215
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
216
|
+
border-block-end: 0;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* When panelStyle is on, tabs look “embedded” (no bottom border indicators) */
|
|
220
|
+
.panelStyle .tab {
|
|
221
|
+
border-block-end: 0;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* In filled mode, keep the filled content panel visuals (already handled above).
|
|
225
|
+
In outlined mode with panelStyle, give the content a panel container too. */
|
|
226
|
+
.panelStyle.outlined .tabContent {
|
|
227
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
228
|
+
background: var(--color-bg-surface);
|
|
229
|
+
padding: var(--spacing-lg);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@media (max-width: 767px) {
|
|
233
|
+
.headerContainer {
|
|
234
|
+
padding-block: var(--spacing-md);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.tabButton {
|
|
238
|
+
padding-block: var(--spacing-sm);
|
|
239
|
+
padding-inline: var(--spacing-xs);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.tabs.filled {
|
|
243
|
+
border-radius: 0;
|
|
244
|
+
border-inline: 0;
|
|
245
|
+
box-shadow: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.filled .tabList {
|
|
249
|
+
inline-size: 100%;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.filled .tabContent,
|
|
253
|
+
.panelStyle.outlined .tabContent {
|
|
254
|
+
padding-block: var(--spacing-md);
|
|
255
|
+
padding-inline: var(--spacing-md);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.panelStyle .tabList {
|
|
259
|
+
border: 0;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var Button = require('../../components/button/Button');
|
|
7
|
+
var Menu = require('../../components/menu/Menu');
|
|
8
|
+
var Popover = require('../../components/popover/Popover');
|
|
9
|
+
var useTheme = require('../../hooks/useTheme');
|
|
10
|
+
|
|
11
|
+
const THEME_OPTIONS = [
|
|
12
|
+
{ value: "system", label: "System", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, { size: 16 }) },
|
|
13
|
+
{ value: "light", label: "Lyst", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { size: 16 }) },
|
|
14
|
+
{ value: "dark", label: "M\xF8rkt", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { size: 16 }) }
|
|
15
|
+
];
|
|
16
|
+
function ThemeMenuSection() {
|
|
17
|
+
const { theme, switchTheme } = useTheme.useTheme();
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
19
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Menu.Menu.Header, { children: [
|
|
20
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, {}),
|
|
21
|
+
"Udseende"
|
|
22
|
+
] }),
|
|
23
|
+
THEME_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
Menu.Menu.RadioItem,
|
|
25
|
+
{
|
|
26
|
+
name: "theme",
|
|
27
|
+
value: option.value,
|
|
28
|
+
checked: theme === option.value,
|
|
29
|
+
label: option.label,
|
|
30
|
+
onValueChange: (value) => switchTheme(value)
|
|
31
|
+
},
|
|
32
|
+
option.value
|
|
33
|
+
))
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
function ThemeButton({ size, variant = "outlined" }) {
|
|
37
|
+
const { theme, switchTheme } = useTheme.useTheme();
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
Popover.Popover,
|
|
40
|
+
{
|
|
41
|
+
matchTriggerWidth: false,
|
|
42
|
+
minWidth: "140px",
|
|
43
|
+
trigger: (handleClick, chevron) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
44
|
+
Button.Button,
|
|
45
|
+
{
|
|
46
|
+
variant,
|
|
47
|
+
size,
|
|
48
|
+
onClick: handleClick,
|
|
49
|
+
"aria-label": "Skift tema",
|
|
50
|
+
"aria-haspopup": "menu",
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Palette, {}),
|
|
53
|
+
chevron
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
children: (close) => /* @__PURE__ */ jsxRuntime.jsxs(Menu.Menu, { children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Header, { children: "Udseende" }),
|
|
59
|
+
THEME_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(Menu.Menu.Item, { active: theme === option.value, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
onClick: () => {
|
|
63
|
+
switchTheme(option.value);
|
|
64
|
+
close();
|
|
65
|
+
},
|
|
66
|
+
children: [
|
|
67
|
+
option.icon,
|
|
68
|
+
option.label
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
) }, option.value))
|
|
72
|
+
] })
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
exports.ThemeButton = ThemeButton;
|
|
78
|
+
exports.ThemeMenuSection = ThemeMenuSection;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Palette, Monitor, Sun, Moon } from 'lucide-react';
|
|
4
|
+
import { Button } from '../../components/button/Button';
|
|
5
|
+
import { Menu } from '../../components/menu/Menu';
|
|
6
|
+
import { Popover } from '../../components/popover/Popover';
|
|
7
|
+
import { useTheme } from '../../hooks/useTheme';
|
|
8
|
+
|
|
9
|
+
const THEME_OPTIONS = [
|
|
10
|
+
{ value: "system", label: "System", icon: /* @__PURE__ */ jsx(Monitor, { size: 16 }) },
|
|
11
|
+
{ value: "light", label: "Lyst", icon: /* @__PURE__ */ jsx(Sun, { size: 16 }) },
|
|
12
|
+
{ value: "dark", label: "M\xF8rkt", icon: /* @__PURE__ */ jsx(Moon, { size: 16 }) }
|
|
13
|
+
];
|
|
14
|
+
function ThemeMenuSection() {
|
|
15
|
+
const { theme, switchTheme } = useTheme();
|
|
16
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
17
|
+
/* @__PURE__ */ jsxs(Menu.Header, { children: [
|
|
18
|
+
/* @__PURE__ */ jsx(Palette, {}),
|
|
19
|
+
"Udseende"
|
|
20
|
+
] }),
|
|
21
|
+
THEME_OPTIONS.map((option) => /* @__PURE__ */ jsx(
|
|
22
|
+
Menu.RadioItem,
|
|
23
|
+
{
|
|
24
|
+
name: "theme",
|
|
25
|
+
value: option.value,
|
|
26
|
+
checked: theme === option.value,
|
|
27
|
+
label: option.label,
|
|
28
|
+
onValueChange: (value) => switchTheme(value)
|
|
29
|
+
},
|
|
30
|
+
option.value
|
|
31
|
+
))
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
function ThemeButton({ size, variant = "outlined" }) {
|
|
35
|
+
const { theme, switchTheme } = useTheme();
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
|
+
Popover,
|
|
38
|
+
{
|
|
39
|
+
matchTriggerWidth: false,
|
|
40
|
+
minWidth: "140px",
|
|
41
|
+
trigger: (handleClick, chevron) => /* @__PURE__ */ jsxs(
|
|
42
|
+
Button,
|
|
43
|
+
{
|
|
44
|
+
variant,
|
|
45
|
+
size,
|
|
46
|
+
onClick: handleClick,
|
|
47
|
+
"aria-label": "Skift tema",
|
|
48
|
+
"aria-haspopup": "menu",
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Palette, {}),
|
|
51
|
+
chevron
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
children: (close) => /* @__PURE__ */ jsxs(Menu, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx(Menu.Header, { children: "Udseende" }),
|
|
57
|
+
THEME_OPTIONS.map((option) => /* @__PURE__ */ jsx(Menu.Item, { active: theme === option.value, children: /* @__PURE__ */ jsxs(
|
|
58
|
+
"button",
|
|
59
|
+
{
|
|
60
|
+
onClick: () => {
|
|
61
|
+
switchTheme(option.value);
|
|
62
|
+
close();
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
option.icon,
|
|
66
|
+
option.label
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
) }, option.value))
|
|
70
|
+
] })
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { ThemeButton, ThemeMenuSection };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var styles = require('./Toast.module.css');
|
|
6
|
+
var Button = require('../button/Button');
|
|
7
|
+
var Headline = require('../headline/Headline');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
12
|
+
|
|
13
|
+
function Toast({
|
|
14
|
+
title,
|
|
15
|
+
subheader,
|
|
16
|
+
message,
|
|
17
|
+
severity = "info",
|
|
18
|
+
action,
|
|
19
|
+
onClose
|
|
20
|
+
}) {
|
|
21
|
+
const showHeader = Boolean(title);
|
|
22
|
+
const showMessage = Boolean(message);
|
|
23
|
+
const canClose = severity !== "neutral";
|
|
24
|
+
const isDismissibleNeutral = severity === "neutral" && Boolean(onClose);
|
|
25
|
+
const CloseButton = onClose && canClose ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
26
|
+
Button.Button,
|
|
27
|
+
{
|
|
28
|
+
type: "button",
|
|
29
|
+
variant: "inline",
|
|
30
|
+
shape: "round",
|
|
31
|
+
className: styles__default.default.closeButton,
|
|
32
|
+
"aria-label": "Dismiss notification",
|
|
33
|
+
onClick: onClose,
|
|
34
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: styles__default.default.closeIcon, "aria-hidden": "true" })
|
|
35
|
+
}
|
|
36
|
+
) : null;
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: `${styles__default.default.toast} ${styles__default.default[severity]} ${isDismissibleNeutral ? styles__default.default.dismissibleNeutral : ""}`,
|
|
41
|
+
role: "status",
|
|
42
|
+
onClick: isDismissibleNeutral ? onClose : void 0,
|
|
43
|
+
onKeyDown: isDismissibleNeutral ? (e) => {
|
|
44
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
45
|
+
e.preventDefault();
|
|
46
|
+
onClose == null ? void 0 : onClose();
|
|
47
|
+
}
|
|
48
|
+
} : void 0,
|
|
49
|
+
tabIndex: isDismissibleNeutral ? 0 : void 0,
|
|
50
|
+
"aria-label": isDismissibleNeutral ? "Luk notifikation" : void 0,
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.content, children: [
|
|
53
|
+
showHeader && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.row, children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { size: 4, severity, disableMargin: true, subheader, children: title }),
|
|
55
|
+
CloseButton
|
|
56
|
+
] }),
|
|
57
|
+
showMessage && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.row, children: [
|
|
58
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.message, children: message }),
|
|
59
|
+
!showHeader && CloseButton
|
|
60
|
+
] })
|
|
61
|
+
] }),
|
|
62
|
+
action && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.actions, children: /* @__PURE__ */ jsxRuntime.jsx(Button.Button, { type: "button", variant: "primary", onClick: action.onClick, children: action.label }) })
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
exports.Toast = Toast;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { X } from 'lucide-react';
|
|
3
|
+
import styles from './Toast.module.css';
|
|
4
|
+
import { Button } from '../button/Button';
|
|
5
|
+
import { Headline } from '../headline/Headline';
|
|
6
|
+
|
|
7
|
+
function Toast({
|
|
8
|
+
title,
|
|
9
|
+
subheader,
|
|
10
|
+
message,
|
|
11
|
+
severity = "info",
|
|
12
|
+
action,
|
|
13
|
+
onClose
|
|
14
|
+
}) {
|
|
15
|
+
const showHeader = Boolean(title);
|
|
16
|
+
const showMessage = Boolean(message);
|
|
17
|
+
const canClose = severity !== "neutral";
|
|
18
|
+
const isDismissibleNeutral = severity === "neutral" && Boolean(onClose);
|
|
19
|
+
const CloseButton = onClose && canClose ? /* @__PURE__ */ jsx(
|
|
20
|
+
Button,
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
variant: "inline",
|
|
24
|
+
shape: "round",
|
|
25
|
+
className: styles.closeButton,
|
|
26
|
+
"aria-label": "Dismiss notification",
|
|
27
|
+
onClick: onClose,
|
|
28
|
+
children: /* @__PURE__ */ jsx(X, { className: styles.closeIcon, "aria-hidden": "true" })
|
|
29
|
+
}
|
|
30
|
+
) : null;
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: `${styles.toast} ${styles[severity]} ${isDismissibleNeutral ? styles.dismissibleNeutral : ""}`,
|
|
35
|
+
role: "status",
|
|
36
|
+
onClick: isDismissibleNeutral ? onClose : void 0,
|
|
37
|
+
onKeyDown: isDismissibleNeutral ? (e) => {
|
|
38
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
onClose == null ? void 0 : onClose();
|
|
41
|
+
}
|
|
42
|
+
} : void 0,
|
|
43
|
+
tabIndex: isDismissibleNeutral ? 0 : void 0,
|
|
44
|
+
"aria-label": isDismissibleNeutral ? "Luk notifikation" : void 0,
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ jsxs("div", { className: styles.content, children: [
|
|
47
|
+
showHeader && /* @__PURE__ */ jsxs("div", { className: styles.row, children: [
|
|
48
|
+
/* @__PURE__ */ jsx(Headline, { size: 4, severity, disableMargin: true, subheader, children: title }),
|
|
49
|
+
CloseButton
|
|
50
|
+
] }),
|
|
51
|
+
showMessage && /* @__PURE__ */ jsxs("div", { className: styles.row, children: [
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: styles.message, children: message }),
|
|
53
|
+
!showHeader && CloseButton
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
action && /* @__PURE__ */ jsx("div", { className: styles.actions, children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "primary", onClick: action.onClick, children: action.label }) })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { Toast };
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset-inline-end: var(--spacing-lg);
|
|
4
|
+
inset-block-start: var(--spacing-lg);
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: var(--spacing-xs);
|
|
8
|
+
z-index: var(--z-toast);
|
|
9
|
+
min-width: 280px;
|
|
10
|
+
word-break: break-word;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@media (max-width: 640px) {
|
|
14
|
+
.container {
|
|
15
|
+
inset-inline: var(--spacing-md);
|
|
16
|
+
inset-block-end: var(--spacing-md);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.toast {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
gap: var(--spacing-xs);
|
|
24
|
+
padding: var(--spacing-xs) var(--spacing-md);
|
|
25
|
+
border-radius: var(--border-radius-md);
|
|
26
|
+
box-shadow: var(--shadow-md);
|
|
27
|
+
background-color: var(--color-bg-surface);
|
|
28
|
+
border: var(--border-width-thin) solid var(--color-border-default);
|
|
29
|
+
font-family: var(--font-family);
|
|
30
|
+
max-width: 360px;
|
|
31
|
+
animation: toast-enter var(--transition-normal) var(--ease-standard);
|
|
32
|
+
border-left-width: var(--border-width-thick);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Severity accents */
|
|
36
|
+
.info {
|
|
37
|
+
border-left-color: var(--color-status-info-border);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.brand {
|
|
41
|
+
border-left-color: var(--color-brand);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.success {
|
|
45
|
+
border-left-color: var(--color-status-success-border);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.warning {
|
|
49
|
+
border-left-color: var(--color-status-warning-border);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.error {
|
|
53
|
+
border-left-color: var(--color-status-error-border);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.neutral {
|
|
57
|
+
background-color: var(--color-bg-inverse);
|
|
58
|
+
color: var(--color-fg-inverse);
|
|
59
|
+
border-left-width: 0;
|
|
60
|
+
min-width: 50px;
|
|
61
|
+
max-width: 200px;
|
|
62
|
+
width: fit-content;
|
|
63
|
+
align-self: flex-end;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.dismissibleNeutral {
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
transition:
|
|
69
|
+
background-color var(--transition-fast) var(--ease-standard),
|
|
70
|
+
transform 60ms ease;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.dismissibleNeutral:hover {
|
|
74
|
+
background-color: color-mix(in srgb, var(--color-bg-inverse) 92%, white);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dismissibleNeutral:active {
|
|
78
|
+
transform: translateY(1px);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.dismissibleNeutral:focus-visible {
|
|
82
|
+
outline: 2px solid var(--color-fg-inverse);
|
|
83
|
+
outline-offset: 2px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Layout */
|
|
87
|
+
.content {
|
|
88
|
+
flex: 1;
|
|
89
|
+
min-width: 0;
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: var(--spacing-xxs);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.row {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
gap: var(--spacing-xs);
|
|
99
|
+
min-width: 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Long-text handling suitable for toasts */
|
|
103
|
+
.title,
|
|
104
|
+
.message {
|
|
105
|
+
min-width: 0;
|
|
106
|
+
overflow-wrap: anywhere;
|
|
107
|
+
word-break: break-word;
|
|
108
|
+
white-space: normal;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Optional: clamp to avoid giant toasts */
|
|
112
|
+
.title {
|
|
113
|
+
font-size: var(--font-size-sm);
|
|
114
|
+
font-weight: var(--font-weight-semibold);
|
|
115
|
+
line-height: var(--line-height-tight);
|
|
116
|
+
|
|
117
|
+
display: -webkit-box;
|
|
118
|
+
-webkit-box-orient: vertical;
|
|
119
|
+
-webkit-line-clamp: 2;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.message {
|
|
124
|
+
font-size: var(--font-size-sm);
|
|
125
|
+
line-height: var(--line-height-normal);
|
|
126
|
+
|
|
127
|
+
display: -webkit-box;
|
|
128
|
+
-webkit-box-orient: vertical;
|
|
129
|
+
-webkit-line-clamp: 4;
|
|
130
|
+
overflow: hidden;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Close button stays aligned at the end of the row */
|
|
134
|
+
.closeButton {
|
|
135
|
+
margin-inline-start: auto;
|
|
136
|
+
flex: 0 0 auto;
|
|
137
|
+
align-self: flex-start;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.closeIcon {
|
|
141
|
+
width: var(--icon-size-sm);
|
|
142
|
+
height: var(--icon-size-sm);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.actions {
|
|
146
|
+
display: flex;
|
|
147
|
+
justify-content: flex-end;
|
|
148
|
+
gap: var(--spacing-xs);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Simple enter animation */
|
|
152
|
+
@keyframes toast-enter {
|
|
153
|
+
from {
|
|
154
|
+
opacity: 0;
|
|
155
|
+
transform: translateY(6px);
|
|
156
|
+
}
|
|
157
|
+
to {
|
|
158
|
+
opacity: 1;
|
|
159
|
+
transform: translateY(0);
|
|
160
|
+
}
|
|
161
|
+
}
|