@dbcdk/react-components 0.0.102 → 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.d.ts +1 -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 -12901
- package/dist/index.css +67 -7228
- package/dist/index.d.ts +0 -58
- package/dist/index.js +24 -12802
- 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 -2652
- package/dist/tanstack.js +3 -2636
- 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 -1271
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var Toast = require('../Toast');
|
|
7
|
+
var styles = require('../Toast.module.css');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
12
|
+
|
|
13
|
+
const ToastContext = react.createContext(void 0);
|
|
14
|
+
function ToastProvider({
|
|
15
|
+
children,
|
|
16
|
+
defaultDuration = 4e3
|
|
17
|
+
}) {
|
|
18
|
+
const [toasts, setToasts] = react.useState([]);
|
|
19
|
+
const timeouts = react.useRef(/* @__PURE__ */ new Map());
|
|
20
|
+
const clearTimeoutForId = (id) => {
|
|
21
|
+
const timeoutId = timeouts.current.get(id);
|
|
22
|
+
if (timeoutId) {
|
|
23
|
+
window.clearTimeout(timeoutId);
|
|
24
|
+
timeouts.current.delete(id);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const hideToast = react.useCallback((id) => {
|
|
28
|
+
clearTimeoutForId(id);
|
|
29
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
30
|
+
}, []);
|
|
31
|
+
const scheduleAutoDismiss = react.useCallback(
|
|
32
|
+
(toast) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const duration = (_a = toast.duration) != null ? _a : defaultDuration;
|
|
35
|
+
if (!duration || duration <= 0) return;
|
|
36
|
+
clearTimeoutForId(toast.id);
|
|
37
|
+
const timeoutId = window.setTimeout(() => {
|
|
38
|
+
hideToast(toast.id);
|
|
39
|
+
}, duration);
|
|
40
|
+
timeouts.current.set(toast.id, timeoutId);
|
|
41
|
+
},
|
|
42
|
+
[defaultDuration, hideToast]
|
|
43
|
+
);
|
|
44
|
+
const showToast = react.useCallback(
|
|
45
|
+
(config) => {
|
|
46
|
+
var _a, _b, _c;
|
|
47
|
+
const id = (_c = (_b = config.id) != null ? _b : (_a = crypto.randomUUID) == null ? void 0 : _a.call(crypto)) != null ? _c : `${Date.now()}-${Math.random()}`;
|
|
48
|
+
const toast = { ...config, id };
|
|
49
|
+
setToasts((prev) => [...prev, toast]);
|
|
50
|
+
scheduleAutoDismiss(toast);
|
|
51
|
+
return id;
|
|
52
|
+
},
|
|
53
|
+
[scheduleAutoDismiss]
|
|
54
|
+
);
|
|
55
|
+
const clearToasts = react.useCallback(() => {
|
|
56
|
+
timeouts.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
57
|
+
timeouts.current.clear();
|
|
58
|
+
setToasts([]);
|
|
59
|
+
}, []);
|
|
60
|
+
react.useEffect(
|
|
61
|
+
() => () => {
|
|
62
|
+
timeouts.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
63
|
+
timeouts.current.clear();
|
|
64
|
+
},
|
|
65
|
+
[]
|
|
66
|
+
);
|
|
67
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: { showToast, hideToast, clearToasts }, children: [
|
|
68
|
+
children,
|
|
69
|
+
toasts.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.container, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((toast) => {
|
|
70
|
+
var _a;
|
|
71
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
Toast.Toast,
|
|
73
|
+
{
|
|
74
|
+
title: toast.title,
|
|
75
|
+
message: toast.message,
|
|
76
|
+
severity: (_a = toast.severity) != null ? _a : "info",
|
|
77
|
+
action: toast.action && {
|
|
78
|
+
label: toast.action.label,
|
|
79
|
+
onClick: () => {
|
|
80
|
+
var _a2, _b;
|
|
81
|
+
(_b = (_a2 = toast.action) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2);
|
|
82
|
+
hideToast(toast.id);
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
onClose: () => hideToast(toast.id)
|
|
86
|
+
},
|
|
87
|
+
toast.id
|
|
88
|
+
);
|
|
89
|
+
}) })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
function useToast() {
|
|
93
|
+
const ctx = react.useContext(ToastContext);
|
|
94
|
+
if (!ctx) {
|
|
95
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
96
|
+
}
|
|
97
|
+
return ctx;
|
|
98
|
+
}
|
|
99
|
+
function useOptionalToast() {
|
|
100
|
+
return react.useContext(ToastContext);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
exports.ToastProvider = ToastProvider;
|
|
104
|
+
exports.useOptionalToast = useOptionalToast;
|
|
105
|
+
exports.useToast = useToast;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { createContext, useState, useRef, useCallback, useEffect, useContext } from 'react';
|
|
4
|
+
import { Toast } from '../Toast';
|
|
5
|
+
import styles from '../Toast.module.css';
|
|
6
|
+
|
|
7
|
+
const ToastContext = createContext(void 0);
|
|
8
|
+
function ToastProvider({
|
|
9
|
+
children,
|
|
10
|
+
defaultDuration = 4e3
|
|
11
|
+
}) {
|
|
12
|
+
const [toasts, setToasts] = useState([]);
|
|
13
|
+
const timeouts = useRef(/* @__PURE__ */ new Map());
|
|
14
|
+
const clearTimeoutForId = (id) => {
|
|
15
|
+
const timeoutId = timeouts.current.get(id);
|
|
16
|
+
if (timeoutId) {
|
|
17
|
+
window.clearTimeout(timeoutId);
|
|
18
|
+
timeouts.current.delete(id);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const hideToast = useCallback((id) => {
|
|
22
|
+
clearTimeoutForId(id);
|
|
23
|
+
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
24
|
+
}, []);
|
|
25
|
+
const scheduleAutoDismiss = useCallback(
|
|
26
|
+
(toast) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const duration = (_a = toast.duration) != null ? _a : defaultDuration;
|
|
29
|
+
if (!duration || duration <= 0) return;
|
|
30
|
+
clearTimeoutForId(toast.id);
|
|
31
|
+
const timeoutId = window.setTimeout(() => {
|
|
32
|
+
hideToast(toast.id);
|
|
33
|
+
}, duration);
|
|
34
|
+
timeouts.current.set(toast.id, timeoutId);
|
|
35
|
+
},
|
|
36
|
+
[defaultDuration, hideToast]
|
|
37
|
+
);
|
|
38
|
+
const showToast = useCallback(
|
|
39
|
+
(config) => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const id = (_c = (_b = config.id) != null ? _b : (_a = crypto.randomUUID) == null ? void 0 : _a.call(crypto)) != null ? _c : `${Date.now()}-${Math.random()}`;
|
|
42
|
+
const toast = { ...config, id };
|
|
43
|
+
setToasts((prev) => [...prev, toast]);
|
|
44
|
+
scheduleAutoDismiss(toast);
|
|
45
|
+
return id;
|
|
46
|
+
},
|
|
47
|
+
[scheduleAutoDismiss]
|
|
48
|
+
);
|
|
49
|
+
const clearToasts = useCallback(() => {
|
|
50
|
+
timeouts.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
51
|
+
timeouts.current.clear();
|
|
52
|
+
setToasts([]);
|
|
53
|
+
}, []);
|
|
54
|
+
useEffect(
|
|
55
|
+
() => () => {
|
|
56
|
+
timeouts.current.forEach((timeoutId) => window.clearTimeout(timeoutId));
|
|
57
|
+
timeouts.current.clear();
|
|
58
|
+
},
|
|
59
|
+
[]
|
|
60
|
+
);
|
|
61
|
+
return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: { showToast, hideToast, clearToasts }, children: [
|
|
62
|
+
children,
|
|
63
|
+
toasts.length > 0 && /* @__PURE__ */ jsx("div", { className: styles.container, "aria-live": "polite", "aria-atomic": "false", children: toasts.map((toast) => {
|
|
64
|
+
var _a;
|
|
65
|
+
return /* @__PURE__ */ jsx(
|
|
66
|
+
Toast,
|
|
67
|
+
{
|
|
68
|
+
title: toast.title,
|
|
69
|
+
message: toast.message,
|
|
70
|
+
severity: (_a = toast.severity) != null ? _a : "info",
|
|
71
|
+
action: toast.action && {
|
|
72
|
+
label: toast.action.label,
|
|
73
|
+
onClick: () => {
|
|
74
|
+
var _a2, _b;
|
|
75
|
+
(_b = (_a2 = toast.action) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2);
|
|
76
|
+
hideToast(toast.id);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
onClose: () => hideToast(toast.id)
|
|
80
|
+
},
|
|
81
|
+
toast.id
|
|
82
|
+
);
|
|
83
|
+
}) })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
function useToast() {
|
|
87
|
+
const ctx = useContext(ToastContext);
|
|
88
|
+
if (!ctx) {
|
|
89
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
90
|
+
}
|
|
91
|
+
return ctx;
|
|
92
|
+
}
|
|
93
|
+
function useOptionalToast() {
|
|
94
|
+
return useContext(ToastContext);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export { ToastProvider, useOptionalToast, useToast };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var styles = require('./UserDisplay.module.css');
|
|
5
|
+
var Avatar = require('../avatar/Avatar');
|
|
6
|
+
|
|
7
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
10
|
+
|
|
11
|
+
function UserDisplay({ name, email, role, avatarUrl }) {
|
|
12
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.container, children: [
|
|
13
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(Avatar.Avatar, { imgSrc: avatarUrl, imgAlt: name, fullName: name, size: "xl" }) }),
|
|
14
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.userInfo, children: [
|
|
15
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { children: name }),
|
|
16
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: email }),
|
|
17
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: role })
|
|
18
|
+
] })
|
|
19
|
+
] });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.UserDisplay = UserDisplay;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import styles from './UserDisplay.module.css';
|
|
3
|
+
import { Avatar } from '../avatar/Avatar';
|
|
4
|
+
|
|
5
|
+
function UserDisplay({ name, email, role, avatarUrl }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
7
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Avatar, { imgSrc: avatarUrl, imgAlt: name, fullName: name, size: "xl" }) }),
|
|
8
|
+
/* @__PURE__ */ jsxs("div", { className: styles.userInfo, children: [
|
|
9
|
+
/* @__PURE__ */ jsx("h4", { children: name }),
|
|
10
|
+
/* @__PURE__ */ jsx("p", { children: email }),
|
|
11
|
+
/* @__PURE__ */ jsx("p", { children: role })
|
|
12
|
+
] })
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { UserDisplay };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: var(--spacing-sm);
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: var(--spacing-xs);
|
|
6
|
+
background-color: var(--opac-bg-light);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.userInfo {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
padding: var(--spacing-sm);
|
|
14
|
+
flex-grow: 0;
|
|
15
|
+
color: var(--color-fg-muted);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.userInfo h4 {
|
|
19
|
+
color: var(--color-fg-default);
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.userInfo p {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const ChartSemanticColorVar = {
|
|
4
|
+
primary: "var(--color-chart-primary)",
|
|
5
|
+
success: "var(--color-chart-success)",
|
|
6
|
+
warning: "var(--color-chart-warning)",
|
|
7
|
+
error: "var(--color-chart-error)"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
exports.ChartSemanticColorVar = ChartSemanticColorVar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const SeverityBgColor = {
|
|
4
|
+
neutral: "var(--color-neutral-strong)",
|
|
5
|
+
brand: "var(--color-brand)",
|
|
6
|
+
success: "var(--color-status-success)",
|
|
7
|
+
error: "var(--color-status-error)",
|
|
8
|
+
info: "var(--color-status-info)",
|
|
9
|
+
warning: "var(--color-status-warning)"
|
|
10
|
+
};
|
|
11
|
+
const SeverityBorderColor = {
|
|
12
|
+
neutral: "var(--color-neutral-strong)",
|
|
13
|
+
brand: "var(--color-brand)",
|
|
14
|
+
success: "var(--color-status-success-border)",
|
|
15
|
+
error: "var(--color-status-error-border)",
|
|
16
|
+
info: "var(--color-status-info-border)",
|
|
17
|
+
warning: "var(--color-status-warning-border)"
|
|
18
|
+
};
|
|
19
|
+
const SeverityTextColor = {
|
|
20
|
+
neutral: "var(--color-neutral-strong-fg)",
|
|
21
|
+
brand: "var(--color-fg-on-brand)",
|
|
22
|
+
success: "var(--color-status-success-fg)",
|
|
23
|
+
error: "var(--color-status-error-fg)",
|
|
24
|
+
info: "var(--color-status-info-fg)",
|
|
25
|
+
warning: "var(--color-status-warning-fg)"
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.SeverityBgColor = SeverityBgColor;
|
|
29
|
+
exports.SeverityBorderColor = SeverityBorderColor;
|
|
30
|
+
exports.SeverityTextColor = SeverityTextColor;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const SeverityBgColor = {
|
|
2
|
+
neutral: "var(--color-neutral-strong)",
|
|
3
|
+
brand: "var(--color-brand)",
|
|
4
|
+
success: "var(--color-status-success)",
|
|
5
|
+
error: "var(--color-status-error)",
|
|
6
|
+
info: "var(--color-status-info)",
|
|
7
|
+
warning: "var(--color-status-warning)"
|
|
8
|
+
};
|
|
9
|
+
const SeverityBorderColor = {
|
|
10
|
+
neutral: "var(--color-neutral-strong)",
|
|
11
|
+
brand: "var(--color-brand)",
|
|
12
|
+
success: "var(--color-status-success-border)",
|
|
13
|
+
error: "var(--color-status-error-border)",
|
|
14
|
+
info: "var(--color-status-info-border)",
|
|
15
|
+
warning: "var(--color-status-warning-border)"
|
|
16
|
+
};
|
|
17
|
+
const SeverityTextColor = {
|
|
18
|
+
neutral: "var(--color-neutral-strong-fg)",
|
|
19
|
+
brand: "var(--color-fg-on-brand)",
|
|
20
|
+
success: "var(--color-status-success-fg)",
|
|
21
|
+
error: "var(--color-status-error-fg)",
|
|
22
|
+
info: "var(--color-status-info-fg)",
|
|
23
|
+
warning: "var(--color-status-warning-fg)"
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { SeverityBgColor, SeverityBorderColor, SeverityTextColor };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
const BREAKPOINTS = {
|
|
7
|
+
tablet: 640,
|
|
8
|
+
desktop: 1024
|
|
9
|
+
};
|
|
10
|
+
function getDeviceSize(width) {
|
|
11
|
+
if (width < BREAKPOINTS.tablet) return "mobile";
|
|
12
|
+
if (width < BREAKPOINTS.desktop) return "tablet";
|
|
13
|
+
return "desktop";
|
|
14
|
+
}
|
|
15
|
+
function useDeviceSize() {
|
|
16
|
+
const [deviceSize, setDeviceSize] = react.useState(() => {
|
|
17
|
+
if (typeof window === "undefined") return "desktop";
|
|
18
|
+
return getDeviceSize(window.innerWidth);
|
|
19
|
+
});
|
|
20
|
+
react.useEffect(() => {
|
|
21
|
+
const mediaQueries = [
|
|
22
|
+
window.matchMedia(`(max-width: ${BREAKPOINTS.tablet - 1}px)`),
|
|
23
|
+
window.matchMedia(
|
|
24
|
+
`(min-width: ${BREAKPOINTS.tablet}px) and (max-width: ${BREAKPOINTS.desktop - 1}px)`
|
|
25
|
+
),
|
|
26
|
+
window.matchMedia(`(min-width: ${BREAKPOINTS.desktop}px)`)
|
|
27
|
+
];
|
|
28
|
+
const update = () => setDeviceSize(getDeviceSize(window.innerWidth));
|
|
29
|
+
mediaQueries.forEach((mq) => mq.addEventListener("change", update));
|
|
30
|
+
return () => mediaQueries.forEach((mq) => mq.removeEventListener("change", update));
|
|
31
|
+
}, []);
|
|
32
|
+
return deviceSize;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.useDeviceSize = useDeviceSize;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const BREAKPOINTS = {
|
|
5
|
+
tablet: 640,
|
|
6
|
+
desktop: 1024
|
|
7
|
+
};
|
|
8
|
+
function getDeviceSize(width) {
|
|
9
|
+
if (width < BREAKPOINTS.tablet) return "mobile";
|
|
10
|
+
if (width < BREAKPOINTS.desktop) return "tablet";
|
|
11
|
+
return "desktop";
|
|
12
|
+
}
|
|
13
|
+
function useDeviceSize() {
|
|
14
|
+
const [deviceSize, setDeviceSize] = useState(() => {
|
|
15
|
+
if (typeof window === "undefined") return "desktop";
|
|
16
|
+
return getDeviceSize(window.innerWidth);
|
|
17
|
+
});
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const mediaQueries = [
|
|
20
|
+
window.matchMedia(`(max-width: ${BREAKPOINTS.tablet - 1}px)`),
|
|
21
|
+
window.matchMedia(
|
|
22
|
+
`(min-width: ${BREAKPOINTS.tablet}px) and (max-width: ${BREAKPOINTS.desktop - 1}px)`
|
|
23
|
+
),
|
|
24
|
+
window.matchMedia(`(min-width: ${BREAKPOINTS.desktop}px)`)
|
|
25
|
+
];
|
|
26
|
+
const update = () => setDeviceSize(getDeviceSize(window.innerWidth));
|
|
27
|
+
mediaQueries.forEach((mq) => mq.addEventListener("change", update));
|
|
28
|
+
return () => mediaQueries.forEach((mq) => mq.removeEventListener("change", update));
|
|
29
|
+
}, []);
|
|
30
|
+
return deviceSize;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { useDeviceSize };
|