@dbcdk/react-components 0.0.169 → 0.0.170
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.d.ts +2 -0
- package/dist/assets/logo.js +85 -0
- package/dist/client.cjs +629 -0
- package/dist/client.d.ts +89 -0
- package/dist/client.js +90 -0
- package/dist/components/accordion/Accordion.cjs +127 -0
- package/dist/components/accordion/Accordion.d.ts +36 -0
- package/dist/components/accordion/Accordion.js +121 -0
- package/dist/components/accordion/Accordion.module.css +41 -0
- package/dist/components/accordion/components/AccordionRow.cjs +129 -0
- package/dist/components/accordion/components/AccordionRow.d.ts +14 -0
- package/dist/components/accordion/components/AccordionRow.js +123 -0
- package/dist/components/accordion/components/AccordionRow.module.css +129 -0
- package/dist/components/alert/Alert.cjs +52 -0
- package/dist/components/alert/Alert.d.ts +14 -0
- package/dist/components/alert/Alert.js +46 -0
- package/dist/components/alert/Alert.module.css +102 -0
- package/dist/components/app-header/AppHeader.cjs +14 -0
- package/dist/components/app-header/AppHeader.d.ts +8 -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 +36 -0
- package/dist/components/attribute-chip/AttributeChip.d.ts +11 -0
- package/dist/components/attribute-chip/AttributeChip.js +30 -0
- package/dist/components/attribute-chip/AttributeChip.module.css +64 -0
- package/dist/components/avatar/Avatar.cjs +111 -0
- package/dist/components/avatar/Avatar.d.ts +17 -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.d.ts +12 -0
- package/dist/components/breadcrumbs/Breadcrumbs.js +18 -0
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +77 -0
- package/dist/components/button/Button.cjs +150 -0
- package/dist/components/button/Button.d.ts +18 -0
- package/dist/components/button/Button.js +125 -0
- package/dist/components/button/Button.module.css +266 -0
- package/dist/components/button-select/ButtonSelect.cjs +35 -0
- package/dist/components/button-select/ButtonSelect.d.ts +16 -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 +109 -0
- package/dist/components/card/Card.d.ts +37 -0
- package/dist/components/card/Card.js +103 -0
- package/dist/components/card/Card.module.css +191 -0
- package/dist/components/card/components/CardMeta.cjs +62 -0
- package/dist/components/card/components/CardMeta.d.ts +16 -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.d.ts +12 -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.d.ts +16 -0
- package/dist/components/chip/Chip.js +59 -0
- package/dist/components/chip/Chip.module.css +247 -0
- package/dist/components/circle/Circle.cjs +39 -0
- package/dist/components/circle/Circle.d.ts +14 -0
- package/dist/components/circle/Circle.js +33 -0
- package/dist/components/circle/Circle.module.css +138 -0
- package/dist/components/clear-button/ClearButton.cjs +33 -0
- package/dist/components/clear-button/ClearButton.d.ts +8 -0
- 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 +107 -0
- package/dist/components/code-block/CodeBlock.d.ts +11 -0
- package/dist/components/code-block/CodeBlock.js +101 -0
- package/dist/components/code-block/CodeBlock.module.css +135 -0
- package/dist/components/copy-button/CopyButton.cjs +139 -0
- package/dist/components/copy-button/CopyButton.d.ts +13 -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 +563 -0
- package/dist/components/datetime-picker/DateTimePicker.d.ts +66 -0
- package/dist/components/datetime-picker/DateTimePicker.js +557 -0
- package/dist/components/datetime-picker/DateTimePicker.module.css +155 -0
- package/dist/components/datetime-picker/dateTimeHelpers.cjs +185 -0
- package/dist/components/datetime-picker/dateTimeHelpers.d.ts +37 -0
- package/dist/components/datetime-picker/dateTimeHelpers.js +166 -0
- package/dist/components/divider/Divider.cjs +22 -0
- package/dist/components/divider/Divider.d.ts +5 -0
- package/dist/components/divider/Divider.js +20 -0
- package/dist/components/environment-banner/EnvironmentBanner.cjs +20 -0
- package/dist/components/environment-banner/EnvironmentBanner.d.ts +13 -0
- package/dist/components/environment-banner/EnvironmentBanner.js +14 -0
- package/dist/components/environment-banner/EnvironmentBanner.module.css +54 -0
- package/dist/components/filter-field/FilterField.cjs +324 -0
- package/dist/components/filter-field/FilterField.d.ts +39 -0
- package/dist/components/filter-field/FilterField.js +317 -0
- package/dist/components/filter-field/FilterField.module.css +304 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.cjs +115 -0
- package/dist/components/filtering/chip-multi-toggle/ChipMultiToggle.d.ts +35 -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 +99 -0
- package/dist/components/forms/checkbox/Checkbox.d.ts +39 -0
- package/dist/components/forms/checkbox/Checkbox.js +93 -0
- package/dist/components/forms/checkbox/Checkbox.module.css +110 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.cjs +121 -0
- package/dist/components/forms/checkbox-group/CheckboxGroup.d.ts +47 -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/file-upload/FileUpload.cjs +127 -0
- package/dist/components/forms/file-upload/FileUpload.d.ts +18 -0
- package/dist/components/forms/file-upload/FileUpload.js +121 -0
- package/dist/components/forms/file-upload/FileUpload.module.css +75 -0
- package/dist/components/forms/form-select/FormSelect.cjs +191 -0
- package/dist/components/forms/form-select/FormSelect.d.ts +35 -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 +190 -0
- package/dist/components/forms/input/Input.d.ts +37 -0
- package/dist/components/forms/input/Input.js +184 -0
- package/dist/components/forms/input/Input.module.css +478 -0
- package/dist/components/forms/input-container/InputContainer.cjs +72 -0
- package/dist/components/forms/input-container/InputContainer.d.ts +18 -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 +229 -0
- package/dist/components/forms/multi-select/MultiSelect.d.ts +26 -0
- package/dist/components/forms/multi-select/MultiSelect.js +227 -0
- package/dist/components/forms/radio-buttons/RadioButton.cjs +94 -0
- package/dist/components/forms/radio-buttons/RadioButton.d.ts +46 -0
- package/dist/components/forms/radio-buttons/RadioButton.js +88 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.cjs +74 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.d.ts +25 -0
- package/dist/components/forms/radio-buttons/RadioButtonGroup.js +72 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +131 -0
- package/dist/components/forms/select/Select.cjs +287 -0
- package/dist/components/forms/select/Select.d.ts +24 -0
- package/dist/components/forms/select/Select.js +281 -0
- package/dist/components/forms/select/Select.module.css +41 -0
- package/dist/components/forms/switch/Switch.cjs +93 -0
- package/dist/components/forms/switch/Switch.d.ts +37 -0
- package/dist/components/forms/switch/Switch.js +87 -0
- package/dist/components/forms/switch/Switch.module.css +89 -0
- package/dist/components/forms/text-area/Textarea.cjs +118 -0
- package/dist/components/forms/text-area/Textarea.d.ts +17 -0
- package/dist/components/forms/text-area/Textarea.js +112 -0
- package/dist/components/forms/text-area/Textarea.module.css +70 -0
- package/dist/components/forms/typeahead/Typeahead.cjs +824 -0
- package/dist/components/forms/typeahead/Typeahead.d.ts +46 -0
- package/dist/components/forms/typeahead/Typeahead.js +800 -0
- package/dist/components/forms/typeahead/Typeahead.module.css +38 -0
- package/dist/components/grid/Grid.cjs +58 -0
- package/dist/components/grid/Grid.d.ts +29 -0
- package/dist/components/grid/Grid.js +51 -0
- package/dist/components/grid/Grid.module.css +44 -0
- package/dist/components/headline/CollapsibleHeadline.cjs +84 -0
- package/dist/components/headline/CollapsibleHeadline.d.ts +25 -0
- package/dist/components/headline/CollapsibleHeadline.js +78 -0
- package/dist/components/headline/Headline.cjs +59 -0
- package/dist/components/headline/Headline.d.ts +20 -0
- package/dist/components/headline/Headline.js +53 -0
- package/dist/components/headline/Headline.module.css +167 -0
- package/dist/components/highlighted-text/HighlightedText.cjs +21 -0
- package/dist/components/highlighted-text/HighlightedText.d.ts +7 -0
- package/dist/components/highlighted-text/HighlightedText.js +19 -0
- package/dist/components/hyperlink/Hyperlink.cjs +113 -0
- package/dist/components/hyperlink/Hyperlink.d.ts +24 -0
- package/dist/components/hyperlink/Hyperlink.js +88 -0
- package/dist/components/hyperlink/Hyperlink.module.css +121 -0
- package/dist/components/icon/Icon.cjs +39 -0
- package/dist/components/icon/Icon.d.ts +14 -0
- package/dist/components/icon/Icon.js +32 -0
- package/dist/components/icon/Icon.module.css +50 -0
- package/dist/components/inline-status/InlineStatus.cjs +39 -0
- package/dist/components/inline-status/InlineStatus.d.ts +11 -0
- package/dist/components/inline-status/InlineStatus.js +33 -0
- package/dist/components/inline-status/InlineStatus.module.css +98 -0
- package/dist/components/interval-select/IntervalSelect.cjs +203 -0
- package/dist/components/interval-select/IntervalSelect.d.ts +37 -0
- package/dist/components/interval-select/IntervalSelect.js +201 -0
- package/dist/components/json-viewer/JsonNode.cjs +124 -0
- package/dist/components/json-viewer/JsonNode.d.ts +3 -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.d.ts +4 -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.d.ts +33 -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.d.ts +4 -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.d.ts +17 -0
- package/dist/components/json-viewer/utils.js +111 -0
- package/dist/components/lightbox/Lightbox.cjs +291 -0
- package/dist/components/lightbox/Lightbox.d.ts +36 -0
- package/dist/components/lightbox/Lightbox.js +285 -0
- package/dist/components/lightbox/Lightbox.module.css +214 -0
- package/dist/components/media-card/MediaCard.cjs +87 -0
- package/dist/components/media-card/MediaCard.d.ts +21 -0
- package/dist/components/media-card/MediaCard.js +80 -0
- package/dist/components/media-card/MediaCard.module.css +91 -0
- package/dist/components/menu/Menu.cjs +455 -0
- package/dist/components/menu/Menu.d.ts +102 -0
- package/dist/components/menu/Menu.js +430 -0
- package/dist/components/menu/Menu.module.css +286 -0
- package/dist/components/meta-bar/MetaBar.cjs +28 -0
- package/dist/components/meta-bar/MetaBar.d.ts +12 -0
- package/dist/components/meta-bar/MetaBar.js +22 -0
- package/dist/components/meta-bar/MetaBar.module.css +27 -0
- package/dist/components/metric-tile/MetricTile.cjs +33 -0
- package/dist/components/metric-tile/MetricTile.d.ts +15 -0
- package/dist/components/metric-tile/MetricTile.js +27 -0
- package/dist/components/metric-tile/MetricTile.module.css +103 -0
- package/dist/components/nav-bar/NavBar.cjs +107 -0
- package/dist/components/nav-bar/NavBar.d.ts +44 -0
- package/dist/components/nav-bar/NavBar.js +101 -0
- package/dist/components/nav-bar/NavBar.module.css +243 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.cjs +30 -0
- package/dist/components/overlay/fade-overlay/FadeOverlay.d.ts +13 -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 +200 -0
- package/dist/components/overlay/modal/Modal.d.ts +30 -0
- package/dist/components/overlay/modal/Modal.js +194 -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.d.ts +23 -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.d.ts +25 -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.d.ts +5 -0
- package/dist/components/overlay/side-panel/useSidePanel.js +14 -0
- package/dist/components/overlay/tooltip/Tooltip.cjs +56 -0
- package/dist/components/overlay/tooltip/Tooltip.d.ts +12 -0
- package/dist/components/overlay/tooltip/Tooltip.js +54 -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.d.ts +20 -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.d.ts +28 -0
- package/dist/components/overlay/tooltip/useTooltipTrigger.js +115 -0
- package/dist/components/page/Page.cjs +64 -0
- package/dist/components/page/Page.d.ts +21 -0
- package/dist/components/page/Page.js +58 -0
- package/dist/components/page/Page.module.css +95 -0
- package/dist/components/page-layout/PageLayout.cjs +126 -0
- package/dist/components/page-layout/PageLayout.d.ts +47 -0
- package/dist/components/page-layout/PageLayout.js +120 -0
- package/dist/components/page-layout/PageLayout.module.css +333 -0
- package/dist/components/page-layout/components/footer/Footer.cjs +53 -0
- package/dist/components/page-layout/components/footer/Footer.d.ts +14 -0
- package/dist/components/page-layout/components/footer/Footer.js +47 -0
- package/dist/components/page-layout/components/footer/Footer.module.css +86 -0
- package/dist/components/pagination/Pagination.cjs +161 -0
- package/dist/components/pagination/Pagination.d.ts +21 -0
- package/dist/components/pagination/Pagination.js +155 -0
- package/dist/components/pagination/Pagination.module.css +25 -0
- package/dist/components/panel/Panel.cjs +38 -0
- package/dist/components/panel/Panel.d.ts +13 -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.d.ts +27 -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 +297 -0
- package/dist/components/search-box/SearchBox.d.ts +30 -0
- package/dist/components/search-box/SearchBox.js +291 -0
- package/dist/components/search-box/SearchBox.module.css +27 -0
- package/dist/components/section-label/SectionLabel.cjs +18 -0
- package/dist/components/section-label/SectionLabel.d.ts +5 -0
- package/dist/components/section-label/SectionLabel.js +12 -0
- package/dist/components/section-label/SectionLabel.module.css +12 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.cjs +130 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +27 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.js +124 -0
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.module.css +187 -0
- package/dist/components/sidebar/Sidebar.cjs +41 -0
- package/dist/components/sidebar/Sidebar.d.ts +23 -0
- package/dist/components/sidebar/Sidebar.js +39 -0
- package/dist/components/sidebar/components/SidebarItem.cjs +29 -0
- package/dist/components/sidebar/components/SidebarItem.d.ts +11 -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 +153 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +13 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +147 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.module.css +47 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +220 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +18 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +213 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +293 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +54 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +13 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +47 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +117 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +61 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.d.ts +4 -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 +96 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.d.ts +7 -0
- package/dist/components/sidebar/components/sidenav-filteirng/SidenavFiltering.js +90 -0
- package/dist/components/sidebar/providers/SidebarProvider.cjs +223 -0
- package/dist/components/sidebar/providers/SidebarProvider.d.ts +34 -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.d.ts +9 -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.d.ts +11 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.js +36 -0
- package/dist/components/skeleton-loader/skeleton-loader-item/SkeletonLoaderItem.module.css +55 -0
- package/dist/components/split-button/SplitButton.cjs +46 -0
- package/dist/components/split-button/SplitButton.d.ts +16 -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 +191 -0
- package/dist/components/split-pane/SplitPane.d.ts +21 -0
- package/dist/components/split-pane/SplitPane.js +182 -0
- package/dist/components/split-pane/SplitPane.module.css +118 -0
- package/dist/components/split-pane/provider/SplitPaneContext.cjs +129 -0
- package/dist/components/split-pane/provider/SplitPaneContext.d.ts +24 -0
- package/dist/components/split-pane/provider/SplitPaneContext.js +121 -0
- package/dist/components/stack/Stack.cjs +56 -0
- package/dist/components/stack/Stack.d.ts +26 -0
- package/dist/components/stack/Stack.js +50 -0
- package/dist/components/stack/Stack.module.css +77 -0
- package/dist/components/state-page/StatePage.cjs +48 -0
- package/dist/components/state-page/StatePage.d.ts +10 -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.d.ts +2 -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.d.ts +2 -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.d.ts +2 -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.d.ts +14 -0
- package/dist/components/sticky-footer-layout/StickyFooterLayout.js +96 -0
- package/dist/components/table/Table.cjs +240 -0
- package/dist/components/table/Table.d.ts +4 -0
- package/dist/components/table/Table.js +234 -0
- package/dist/components/table/Table.module.css +704 -0
- package/dist/components/table/Table.types.cjs +2 -0
- package/dist/components/table/Table.types.d.ts +91 -0
- package/dist/components/table/Table.types.js +1 -0
- package/dist/components/table/TanstackTable.cjs +191 -0
- package/dist/components/table/TanstackTable.d.ts +15 -0
- package/dist/components/table/TanstackTable.js +166 -0
- package/dist/components/table/components/TableBody.cjs +58 -0
- package/dist/components/table/components/TableBody.d.ts +28 -0
- package/dist/components/table/components/TableBody.js +52 -0
- package/dist/components/table/components/TableHeader.cjs +56 -0
- package/dist/components/table/components/TableHeader.d.ts +16 -0
- package/dist/components/table/components/TableHeader.js +50 -0
- package/dist/components/table/components/TableHeaderCell.cjs +68 -0
- package/dist/components/table/components/TableHeaderCell.d.ts +12 -0
- package/dist/components/table/components/TableHeaderCell.js +62 -0
- package/dist/components/table/components/TablePagination.cjs +2 -0
- package/dist/components/table/components/TablePagination.d.ts +0 -0
- package/dist/components/table/components/TablePagination.js +1 -0
- package/dist/components/table/components/TableRow.cjs +287 -0
- package/dist/components/table/components/TableRow.d.ts +28 -0
- package/dist/components/table/components/TableRow.js +281 -0
- package/dist/components/table/components/TableSelectionCell.cjs +41 -0
- package/dist/components/table/components/TableSelectionCell.d.ts +9 -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.d.ts +7 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.js +19 -0
- package/dist/components/table/components/column-resizer/ColumnResizer.module.css +24 -0
- package/dist/components/table/components/empty-state/EmptyState.cjs +33 -0
- package/dist/components/table/components/empty-state/EmptyState.d.ts +21 -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.d.ts +18 -0
- package/dist/components/table/components/table-settings/TableSettings.js +137 -0
- package/dist/components/table/hooks/useTableRowInteractions.cjs +47 -0
- package/dist/components/table/hooks/useTableRowInteractions.d.ts +15 -0
- package/dist/components/table/hooks/useTableRowInteractions.js +45 -0
- package/dist/components/table/table.classes.cjs +49 -0
- package/dist/components/table/table.classes.d.ts +10 -0
- package/dist/components/table/table.classes.js +40 -0
- package/dist/components/table/table.utils.cjs +59 -0
- package/dist/components/table/table.utils.d.ts +18 -0
- package/dist/components/table/table.utils.js +46 -0
- package/dist/components/table/tanstackTable.utils.cjs +181 -0
- package/dist/components/table/tanstackTable.utils.d.ts +29 -0
- package/dist/components/table/tanstackTable.utils.js +174 -0
- package/dist/components/tabs/Tabs.cjs +187 -0
- package/dist/components/tabs/Tabs.d.ts +52 -0
- package/dist/components/tabs/Tabs.js +181 -0
- package/dist/components/tabs/Tabs.module.css +263 -0
- package/dist/components/theme-button/ThemeButton.cjs +75 -0
- package/dist/components/theme-button/ThemeButton.d.ts +8 -0
- package/dist/components/theme-button/ThemeButton.js +72 -0
- package/dist/components/toast/Toast.cjs +68 -0
- package/dist/components/toast/Toast.d.ts +15 -0
- package/dist/components/toast/Toast.js +62 -0
- package/dist/components/toast/Toast.module.css +165 -0
- package/dist/components/toast/provider/ToastProvider.cjs +105 -0
- package/dist/components/toast/provider/ToastProvider.d.ts +24 -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.d.ts +10 -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.d.ts +2 -0
- package/dist/constants/chart-colors.js +8 -0
- package/dist/constants/chart-colors.types.cjs +2 -0
- package/dist/constants/chart-colors.types.d.ts +3 -0
- package/dist/constants/chart-colors.types.js +1 -0
- package/dist/constants/severity.cjs +33 -0
- package/dist/constants/severity.d.ts +4 -0
- package/dist/constants/severity.js +29 -0
- package/dist/constants/severity.types.cjs +2 -0
- package/dist/constants/severity.types.d.ts +1 -0
- package/dist/constants/severity.types.js +1 -0
- package/dist/constants/sizes.cjs +11 -0
- package/dist/constants/sizes.d.ts +2 -0
- package/dist/constants/sizes.js +9 -0
- package/dist/hooks/useDeviceSize.cjs +33 -0
- package/dist/hooks/useDeviceSize.d.ts +2 -0
- package/dist/hooks/useDeviceSize.js +31 -0
- package/dist/hooks/useListNavigation.cjs +237 -0
- package/dist/hooks/useListNavigation.d.ts +24 -0
- package/dist/hooks/useListNavigation.js +235 -0
- package/dist/hooks/usePagination.cjs +144 -0
- package/dist/hooks/usePagination.d.ts +38 -0
- package/dist/hooks/usePagination.js +142 -0
- package/dist/hooks/usePersistentState.cjs +60 -0
- package/dist/hooks/usePersistentState.d.ts +33 -0
- package/dist/hooks/usePersistentState.js +58 -0
- package/dist/hooks/useSorting.cjs +120 -0
- package/dist/hooks/useSorting.d.ts +50 -0
- package/dist/hooks/useSorting.js +117 -0
- package/dist/hooks/useTableData.cjs +75 -0
- package/dist/hooks/useTableData.d.ts +42 -0
- package/dist/hooks/useTableData.js +73 -0
- package/dist/hooks/useTableSelection.cjs +172 -0
- package/dist/hooks/useTableSelection.d.ts +27 -0
- package/dist/hooks/useTableSelection.js +170 -0
- package/dist/hooks/useTableSettings.cjs +90 -0
- package/dist/hooks/useTableSettings.d.ts +26 -0
- package/dist/hooks/useTableSettings.js +87 -0
- package/dist/hooks/useTheme.cjs +64 -0
- package/dist/hooks/useTheme.d.ts +7 -0
- package/dist/hooks/useTheme.js +62 -0
- package/dist/hooks/useTimeDuration.cjs +75 -0
- package/dist/hooks/useTimeDuration.d.ts +26 -0
- package/dist/hooks/useTimeDuration.js +73 -0
- package/dist/hooks/useViewportFill.cjs +82 -0
- package/dist/hooks/useViewportFill.d.ts +13 -0
- package/dist/hooks/useViewportFill.js +80 -0
- package/dist/index.cjs +292 -0
- package/dist/index.css +75 -0
- package/dist/index.d.ts +42 -0
- package/dist/index.js +41 -0
- package/dist/styles/animation.cjs +9 -0
- package/dist/styles/animation.d.ts +5 -0
- package/dist/styles/animation.js +7 -0
- package/dist/styles/css-helper-classes/flex.css +113 -0
- package/dist/styles/css-helper-classes/spacing.css +312 -0
- package/dist/styles/css-helper-classes/typography.css +11 -0
- package/dist/styles/fonts/Roboto/OFL.txt +93 -0
- package/dist/styles/fonts/Roboto/README.txt +118 -0
- package/dist/styles/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Tajawal/OFL.txt +93 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Black.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Bold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Light.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Medium.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Regular.ttf +0 -0
- package/dist/styles/styles.css +377 -0
- package/dist/styles/themes/dbc/base.css +141 -0
- package/dist/styles/themes/dbc/colors.css +320 -0
- package/dist/styles/themes/filmstriben-budget/theme.css +22 -0
- package/dist/styles/themes/types.cjs +2 -0
- package/dist/styles/themes/types.d.ts +16 -0
- package/dist/styles/themes/types.js +1 -0
- package/dist/styles.css +377 -0
- package/dist/tanstack.cjs +26 -0
- package/dist/tanstack.d.ts +3 -0
- package/dist/tanstack.js +3 -0
- package/dist/themes/dbc.css +3 -0
- package/dist/themes/filmstriben-budget.css +3 -0
- package/dist/types/a11y-props.types.cjs +2 -0
- package/dist/types/a11y-props.types.d.ts +8 -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.d.ts +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.d.ts +9 -0
- package/dist/utils/arrays/nested-filtering.js +38 -0
- package/dist/utils/cookie.utils.cjs +44 -0
- package/dist/utils/cookie.utils.d.ts +19 -0
- package/dist/utils/cookie.utils.js +40 -0
- package/dist/utils/date/formatDate.cjs +49 -0
- package/dist/utils/date/formatDate.d.ts +28 -0
- package/dist/utils/date/formatDate.js +47 -0
- package/dist/utils/localStorage.utils.cjs +53 -0
- package/dist/utils/localStorage.utils.d.ts +19 -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.d.ts +5 -0
- package/dist/utils/text/get-highlighted-segments.js +47 -0
- package/package.json +2 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
const THEME_VARIANTS = ["light", "dark", "system"];
|
|
7
|
+
const STORAGE_KEY = "dbc_theme";
|
|
8
|
+
function isThemeVariant(x) {
|
|
9
|
+
return !!x && THEME_VARIANTS.includes(x);
|
|
10
|
+
}
|
|
11
|
+
function getCookie(name) {
|
|
12
|
+
const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`));
|
|
13
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
14
|
+
}
|
|
15
|
+
function persistTheme(id) {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(STORAGE_KEY, id);
|
|
18
|
+
} catch {
|
|
19
|
+
console.error("Failed to access localStorage");
|
|
20
|
+
}
|
|
21
|
+
try {
|
|
22
|
+
document.cookie = `${STORAGE_KEY}=${encodeURIComponent(
|
|
23
|
+
id
|
|
24
|
+
)}; Path=/; Max-Age=${60 * 60 * 24 * 365}`;
|
|
25
|
+
} catch {
|
|
26
|
+
console.error("Failed to set theme cookie");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function getTheme() {
|
|
30
|
+
return document.documentElement.dataset.theme;
|
|
31
|
+
}
|
|
32
|
+
function applyTheme(id) {
|
|
33
|
+
document.documentElement.dataset.theme = id;
|
|
34
|
+
}
|
|
35
|
+
function useTheme(initialTheme = "system") {
|
|
36
|
+
const [theme, setTheme] = react.useState(null);
|
|
37
|
+
react.useEffect(() => {
|
|
38
|
+
const themeFromDataAttributes = getTheme();
|
|
39
|
+
let resolved = isThemeVariant(themeFromDataAttributes) ? themeFromDataAttributes : initialTheme;
|
|
40
|
+
const fromCookie = getCookie(STORAGE_KEY);
|
|
41
|
+
if (isThemeVariant(fromCookie)) {
|
|
42
|
+
resolved = fromCookie;
|
|
43
|
+
} else {
|
|
44
|
+
try {
|
|
45
|
+
const fromStorage = localStorage.getItem(STORAGE_KEY);
|
|
46
|
+
if (isThemeVariant(fromStorage)) resolved = fromStorage;
|
|
47
|
+
} catch {
|
|
48
|
+
console.error("Failed to access localStorage");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
applyTheme(resolved);
|
|
52
|
+
setTheme(resolved);
|
|
53
|
+
persistTheme(resolved);
|
|
54
|
+
}, [initialTheme]);
|
|
55
|
+
const switchTheme = react.useCallback((id) => {
|
|
56
|
+
applyTheme(id);
|
|
57
|
+
setTheme(id);
|
|
58
|
+
persistTheme(id);
|
|
59
|
+
return id;
|
|
60
|
+
}, []);
|
|
61
|
+
return { theme, switchTheme };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
exports.useTheme = useTheme;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const THEME_VARIANTS: readonly ["light", "dark", "system"];
|
|
2
|
+
export type ThemeVariant = (typeof THEME_VARIANTS)[number];
|
|
3
|
+
export declare function useTheme(initialTheme?: ThemeVariant): {
|
|
4
|
+
theme: ThemeVariant | null;
|
|
5
|
+
switchTheme: (id: ThemeVariant) => ThemeVariant;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
|
|
4
|
+
const THEME_VARIANTS = ["light", "dark", "system"];
|
|
5
|
+
const STORAGE_KEY = "dbc_theme";
|
|
6
|
+
function isThemeVariant(x) {
|
|
7
|
+
return !!x && THEME_VARIANTS.includes(x);
|
|
8
|
+
}
|
|
9
|
+
function getCookie(name) {
|
|
10
|
+
const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`));
|
|
11
|
+
return match ? decodeURIComponent(match[1]) : null;
|
|
12
|
+
}
|
|
13
|
+
function persistTheme(id) {
|
|
14
|
+
try {
|
|
15
|
+
localStorage.setItem(STORAGE_KEY, id);
|
|
16
|
+
} catch {
|
|
17
|
+
console.error("Failed to access localStorage");
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
document.cookie = `${STORAGE_KEY}=${encodeURIComponent(
|
|
21
|
+
id
|
|
22
|
+
)}; Path=/; Max-Age=${60 * 60 * 24 * 365}`;
|
|
23
|
+
} catch {
|
|
24
|
+
console.error("Failed to set theme cookie");
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function getTheme() {
|
|
28
|
+
return document.documentElement.dataset.theme;
|
|
29
|
+
}
|
|
30
|
+
function applyTheme(id) {
|
|
31
|
+
document.documentElement.dataset.theme = id;
|
|
32
|
+
}
|
|
33
|
+
function useTheme(initialTheme = "system") {
|
|
34
|
+
const [theme, setTheme] = useState(null);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const themeFromDataAttributes = getTheme();
|
|
37
|
+
let resolved = isThemeVariant(themeFromDataAttributes) ? themeFromDataAttributes : initialTheme;
|
|
38
|
+
const fromCookie = getCookie(STORAGE_KEY);
|
|
39
|
+
if (isThemeVariant(fromCookie)) {
|
|
40
|
+
resolved = fromCookie;
|
|
41
|
+
} else {
|
|
42
|
+
try {
|
|
43
|
+
const fromStorage = localStorage.getItem(STORAGE_KEY);
|
|
44
|
+
if (isThemeVariant(fromStorage)) resolved = fromStorage;
|
|
45
|
+
} catch {
|
|
46
|
+
console.error("Failed to access localStorage");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
applyTheme(resolved);
|
|
50
|
+
setTheme(resolved);
|
|
51
|
+
persistTheme(resolved);
|
|
52
|
+
}, [initialTheme]);
|
|
53
|
+
const switchTheme = useCallback((id) => {
|
|
54
|
+
applyTheme(id);
|
|
55
|
+
setTheme(id);
|
|
56
|
+
persistTheme(id);
|
|
57
|
+
return id;
|
|
58
|
+
}, []);
|
|
59
|
+
return { theme, switchTheme };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { useTheme };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
function defaultDuration(ms) {
|
|
7
|
+
if (!Number.isFinite(ms) || ms < 0) return "\u2014";
|
|
8
|
+
const sec = Math.floor(ms / 1e3) % 60;
|
|
9
|
+
const min = Math.floor(ms / (1e3 * 60)) % 60;
|
|
10
|
+
const hr = Math.floor(ms / (1e3 * 60 * 60));
|
|
11
|
+
if (hr > 0) {
|
|
12
|
+
return `${hr}t ${min}m ${sec}s`;
|
|
13
|
+
}
|
|
14
|
+
if (min > 0) {
|
|
15
|
+
return `${min}m ${sec}s`;
|
|
16
|
+
}
|
|
17
|
+
return `${sec}s`;
|
|
18
|
+
}
|
|
19
|
+
function useTimeDuration({
|
|
20
|
+
start,
|
|
21
|
+
end,
|
|
22
|
+
dateFormat = {
|
|
23
|
+
year: "2-digit",
|
|
24
|
+
month: "2-digit",
|
|
25
|
+
day: "2-digit",
|
|
26
|
+
hour: "2-digit",
|
|
27
|
+
minute: "2-digit",
|
|
28
|
+
second: "2-digit"
|
|
29
|
+
},
|
|
30
|
+
fallback = "\u2014",
|
|
31
|
+
liveUpdate = false,
|
|
32
|
+
formatDuration = defaultDuration
|
|
33
|
+
}) {
|
|
34
|
+
const [hydrated, setHydrated] = react.useState(false);
|
|
35
|
+
const [now, setNow] = react.useState(0);
|
|
36
|
+
react.useEffect(() => {
|
|
37
|
+
setHydrated(true);
|
|
38
|
+
setNow(Date.now());
|
|
39
|
+
}, []);
|
|
40
|
+
react.useEffect(() => {
|
|
41
|
+
if (!liveUpdate) return;
|
|
42
|
+
if (end && end.getTime() <= Date.now()) return;
|
|
43
|
+
const timer = setInterval(() => {
|
|
44
|
+
const next = Date.now();
|
|
45
|
+
setNow(next);
|
|
46
|
+
if (end && end.getTime() <= next) {
|
|
47
|
+
clearInterval(timer);
|
|
48
|
+
}
|
|
49
|
+
}, 1e3);
|
|
50
|
+
return () => clearInterval(timer);
|
|
51
|
+
}, [liveUpdate, end]);
|
|
52
|
+
const started = react.useMemo(() => {
|
|
53
|
+
if (!start) return fallback;
|
|
54
|
+
if (!hydrated) return fallback;
|
|
55
|
+
return new Intl.DateTimeFormat("da-DK", dateFormat).format(start);
|
|
56
|
+
}, [start, hydrated, fallback, dateFormat]);
|
|
57
|
+
const ended = react.useMemo(() => {
|
|
58
|
+
if (!end) return fallback;
|
|
59
|
+
if (!hydrated) return fallback;
|
|
60
|
+
return new Intl.DateTimeFormat("da-DK", dateFormat).format(end);
|
|
61
|
+
}, [end, hydrated, fallback, dateFormat]);
|
|
62
|
+
const duration = react.useMemo(() => {
|
|
63
|
+
if (!start || !hydrated) return fallback;
|
|
64
|
+
if (!end) {
|
|
65
|
+
return formatDuration(now - start.getTime());
|
|
66
|
+
}
|
|
67
|
+
if (end.getTime() > now) {
|
|
68
|
+
return formatDuration(end.getTime() - now);
|
|
69
|
+
}
|
|
70
|
+
return formatDuration(end.getTime() - start.getTime());
|
|
71
|
+
}, [start, end, fallback, hydrated, formatDuration, now]);
|
|
72
|
+
return { started, ended, isFinished: !!start && !!end, duration, hydrated };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
exports.useTimeDuration = useTimeDuration;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type useTimeDurationReturn = {
|
|
2
|
+
/** Formatted start date (hydration-safe) */
|
|
3
|
+
started: string;
|
|
4
|
+
/** Formatted end date (hydration-safe) */
|
|
5
|
+
ended: string;
|
|
6
|
+
/** Whether the time duration has finished */
|
|
7
|
+
isFinished?: boolean;
|
|
8
|
+
/** Formatted duration (hydration-safe) */
|
|
9
|
+
duration: string;
|
|
10
|
+
/** Whether client hydration has completed */
|
|
11
|
+
hydrated: boolean;
|
|
12
|
+
};
|
|
13
|
+
type useTimeDurationArgs = {
|
|
14
|
+
start?: Date;
|
|
15
|
+
end?: Date;
|
|
16
|
+
/** Intl options for started/ended formatting */
|
|
17
|
+
dateFormat?: Intl.DateTimeFormatOptions;
|
|
18
|
+
/** Placeholder shown before hydration or when date is missing */
|
|
19
|
+
fallback?: string;
|
|
20
|
+
/** Whether to update the duration in real time (every second) */
|
|
21
|
+
liveUpdate?: boolean;
|
|
22
|
+
/** Custom duration formatter if you don’t want the default "1t 2m 3s" */
|
|
23
|
+
formatDuration?: (ms: number) => string;
|
|
24
|
+
};
|
|
25
|
+
export declare function useTimeDuration({ start, end, dateFormat, fallback, liveUpdate, formatDuration, }: useTimeDurationArgs): useTimeDurationReturn;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
3
|
+
|
|
4
|
+
function defaultDuration(ms) {
|
|
5
|
+
if (!Number.isFinite(ms) || ms < 0) return "\u2014";
|
|
6
|
+
const sec = Math.floor(ms / 1e3) % 60;
|
|
7
|
+
const min = Math.floor(ms / (1e3 * 60)) % 60;
|
|
8
|
+
const hr = Math.floor(ms / (1e3 * 60 * 60));
|
|
9
|
+
if (hr > 0) {
|
|
10
|
+
return `${hr}t ${min}m ${sec}s`;
|
|
11
|
+
}
|
|
12
|
+
if (min > 0) {
|
|
13
|
+
return `${min}m ${sec}s`;
|
|
14
|
+
}
|
|
15
|
+
return `${sec}s`;
|
|
16
|
+
}
|
|
17
|
+
function useTimeDuration({
|
|
18
|
+
start,
|
|
19
|
+
end,
|
|
20
|
+
dateFormat = {
|
|
21
|
+
year: "2-digit",
|
|
22
|
+
month: "2-digit",
|
|
23
|
+
day: "2-digit",
|
|
24
|
+
hour: "2-digit",
|
|
25
|
+
minute: "2-digit",
|
|
26
|
+
second: "2-digit"
|
|
27
|
+
},
|
|
28
|
+
fallback = "\u2014",
|
|
29
|
+
liveUpdate = false,
|
|
30
|
+
formatDuration = defaultDuration
|
|
31
|
+
}) {
|
|
32
|
+
const [hydrated, setHydrated] = useState(false);
|
|
33
|
+
const [now, setNow] = useState(0);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
setHydrated(true);
|
|
36
|
+
setNow(Date.now());
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!liveUpdate) return;
|
|
40
|
+
if (end && end.getTime() <= Date.now()) return;
|
|
41
|
+
const timer = setInterval(() => {
|
|
42
|
+
const next = Date.now();
|
|
43
|
+
setNow(next);
|
|
44
|
+
if (end && end.getTime() <= next) {
|
|
45
|
+
clearInterval(timer);
|
|
46
|
+
}
|
|
47
|
+
}, 1e3);
|
|
48
|
+
return () => clearInterval(timer);
|
|
49
|
+
}, [liveUpdate, end]);
|
|
50
|
+
const started = useMemo(() => {
|
|
51
|
+
if (!start) return fallback;
|
|
52
|
+
if (!hydrated) return fallback;
|
|
53
|
+
return new Intl.DateTimeFormat("da-DK", dateFormat).format(start);
|
|
54
|
+
}, [start, hydrated, fallback, dateFormat]);
|
|
55
|
+
const ended = useMemo(() => {
|
|
56
|
+
if (!end) return fallback;
|
|
57
|
+
if (!hydrated) return fallback;
|
|
58
|
+
return new Intl.DateTimeFormat("da-DK", dateFormat).format(end);
|
|
59
|
+
}, [end, hydrated, fallback, dateFormat]);
|
|
60
|
+
const duration = useMemo(() => {
|
|
61
|
+
if (!start || !hydrated) return fallback;
|
|
62
|
+
if (!end) {
|
|
63
|
+
return formatDuration(now - start.getTime());
|
|
64
|
+
}
|
|
65
|
+
if (end.getTime() > now) {
|
|
66
|
+
return formatDuration(end.getTime() - now);
|
|
67
|
+
}
|
|
68
|
+
return formatDuration(end.getTime() - start.getTime());
|
|
69
|
+
}, [start, end, fallback, hydrated, formatDuration, now]);
|
|
70
|
+
return { started, ended, isFinished: !!start && !!end, duration, hydrated };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { useTimeDuration };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var react = require('react');
|
|
5
|
+
|
|
6
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? react.useLayoutEffect : react.useEffect;
|
|
7
|
+
function useViewportFill(ref, { bottomOffset = 0, min = 120, includeMarginTop = false, watchRef } = {}) {
|
|
8
|
+
const [maxHeight, setMaxHeight] = react.useState(min);
|
|
9
|
+
const raf = react.useRef(null);
|
|
10
|
+
const measure = react.useCallback(() => {
|
|
11
|
+
if (typeof window === "undefined" || !ref.current) return;
|
|
12
|
+
const el = ref.current;
|
|
13
|
+
const rect = el.getBoundingClientRect();
|
|
14
|
+
let top = rect.top;
|
|
15
|
+
if (includeMarginTop) {
|
|
16
|
+
const marginTop = parseFloat(window.getComputedStyle(el).marginTop || "0") || 0;
|
|
17
|
+
top -= marginTop;
|
|
18
|
+
}
|
|
19
|
+
const next = Math.max(min, Math.floor(window.innerHeight - bottomOffset - top));
|
|
20
|
+
setMaxHeight((prev) => prev === next ? prev : next);
|
|
21
|
+
}, [ref, bottomOffset, min, includeMarginTop]);
|
|
22
|
+
const scheduleMeasure = react.useCallback(() => {
|
|
23
|
+
if (typeof window === "undefined") return;
|
|
24
|
+
if (raf.current != null) {
|
|
25
|
+
cancelAnimationFrame(raf.current);
|
|
26
|
+
}
|
|
27
|
+
raf.current = window.requestAnimationFrame(() => {
|
|
28
|
+
raf.current = null;
|
|
29
|
+
measure();
|
|
30
|
+
});
|
|
31
|
+
}, [measure]);
|
|
32
|
+
useIsomorphicLayoutEffect(() => {
|
|
33
|
+
measure();
|
|
34
|
+
}, [measure]);
|
|
35
|
+
react.useEffect(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (typeof window === "undefined" || !ref.current) return;
|
|
38
|
+
const target = ref.current;
|
|
39
|
+
const extra = (_a = watchRef == null ? void 0 : watchRef.current) != null ? _a : null;
|
|
40
|
+
const parent = target.parentElement;
|
|
41
|
+
const onResize = () => scheduleMeasure();
|
|
42
|
+
const onTransitionOrAnimationEnd = () => scheduleMeasure();
|
|
43
|
+
window.addEventListener("resize", onResize);
|
|
44
|
+
document.addEventListener("transitionend", onTransitionOrAnimationEnd, true);
|
|
45
|
+
document.addEventListener("animationend", onTransitionOrAnimationEnd, true);
|
|
46
|
+
let resizeObserver = null;
|
|
47
|
+
if ("ResizeObserver" in window) {
|
|
48
|
+
resizeObserver = new ResizeObserver(() => scheduleMeasure());
|
|
49
|
+
resizeObserver.observe(target);
|
|
50
|
+
if (parent && parent !== target) {
|
|
51
|
+
resizeObserver.observe(parent);
|
|
52
|
+
}
|
|
53
|
+
if (extra && extra !== target && extra !== parent) {
|
|
54
|
+
resizeObserver.observe(extra);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return () => {
|
|
58
|
+
window.removeEventListener("resize", onResize);
|
|
59
|
+
document.removeEventListener("transitionend", onTransitionOrAnimationEnd, true);
|
|
60
|
+
document.removeEventListener("animationend", onTransitionOrAnimationEnd, true);
|
|
61
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
62
|
+
if (raf.current != null) {
|
|
63
|
+
cancelAnimationFrame(raf.current);
|
|
64
|
+
raf.current = null;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [ref, watchRef, scheduleMeasure]);
|
|
68
|
+
const style = react.useMemo(
|
|
69
|
+
() => ({
|
|
70
|
+
maxHeight,
|
|
71
|
+
overflow: "auto"
|
|
72
|
+
}),
|
|
73
|
+
[maxHeight]
|
|
74
|
+
);
|
|
75
|
+
return {
|
|
76
|
+
maxHeight,
|
|
77
|
+
style,
|
|
78
|
+
recompute: measure
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
exports.useViewportFill = useViewportFill;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type CSSProperties, type RefObject } from 'react';
|
|
2
|
+
type Options = {
|
|
3
|
+
bottomOffset?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
includeMarginTop?: boolean;
|
|
6
|
+
watchRef?: RefObject<HTMLElement | null>;
|
|
7
|
+
};
|
|
8
|
+
export declare function useViewportFill<T extends HTMLElement>(ref: RefObject<T | null>, { bottomOffset, min, includeMarginTop, watchRef }?: Options): {
|
|
9
|
+
maxHeight: number;
|
|
10
|
+
style: CSSProperties;
|
|
11
|
+
recompute: () => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useMemo, useLayoutEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
5
|
+
function useViewportFill(ref, { bottomOffset = 0, min = 120, includeMarginTop = false, watchRef } = {}) {
|
|
6
|
+
const [maxHeight, setMaxHeight] = useState(min);
|
|
7
|
+
const raf = useRef(null);
|
|
8
|
+
const measure = useCallback(() => {
|
|
9
|
+
if (typeof window === "undefined" || !ref.current) return;
|
|
10
|
+
const el = ref.current;
|
|
11
|
+
const rect = el.getBoundingClientRect();
|
|
12
|
+
let top = rect.top;
|
|
13
|
+
if (includeMarginTop) {
|
|
14
|
+
const marginTop = parseFloat(window.getComputedStyle(el).marginTop || "0") || 0;
|
|
15
|
+
top -= marginTop;
|
|
16
|
+
}
|
|
17
|
+
const next = Math.max(min, Math.floor(window.innerHeight - bottomOffset - top));
|
|
18
|
+
setMaxHeight((prev) => prev === next ? prev : next);
|
|
19
|
+
}, [ref, bottomOffset, min, includeMarginTop]);
|
|
20
|
+
const scheduleMeasure = useCallback(() => {
|
|
21
|
+
if (typeof window === "undefined") return;
|
|
22
|
+
if (raf.current != null) {
|
|
23
|
+
cancelAnimationFrame(raf.current);
|
|
24
|
+
}
|
|
25
|
+
raf.current = window.requestAnimationFrame(() => {
|
|
26
|
+
raf.current = null;
|
|
27
|
+
measure();
|
|
28
|
+
});
|
|
29
|
+
}, [measure]);
|
|
30
|
+
useIsomorphicLayoutEffect(() => {
|
|
31
|
+
measure();
|
|
32
|
+
}, [measure]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
var _a;
|
|
35
|
+
if (typeof window === "undefined" || !ref.current) return;
|
|
36
|
+
const target = ref.current;
|
|
37
|
+
const extra = (_a = watchRef == null ? void 0 : watchRef.current) != null ? _a : null;
|
|
38
|
+
const parent = target.parentElement;
|
|
39
|
+
const onResize = () => scheduleMeasure();
|
|
40
|
+
const onTransitionOrAnimationEnd = () => scheduleMeasure();
|
|
41
|
+
window.addEventListener("resize", onResize);
|
|
42
|
+
document.addEventListener("transitionend", onTransitionOrAnimationEnd, true);
|
|
43
|
+
document.addEventListener("animationend", onTransitionOrAnimationEnd, true);
|
|
44
|
+
let resizeObserver = null;
|
|
45
|
+
if ("ResizeObserver" in window) {
|
|
46
|
+
resizeObserver = new ResizeObserver(() => scheduleMeasure());
|
|
47
|
+
resizeObserver.observe(target);
|
|
48
|
+
if (parent && parent !== target) {
|
|
49
|
+
resizeObserver.observe(parent);
|
|
50
|
+
}
|
|
51
|
+
if (extra && extra !== target && extra !== parent) {
|
|
52
|
+
resizeObserver.observe(extra);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return () => {
|
|
56
|
+
window.removeEventListener("resize", onResize);
|
|
57
|
+
document.removeEventListener("transitionend", onTransitionOrAnimationEnd, true);
|
|
58
|
+
document.removeEventListener("animationend", onTransitionOrAnimationEnd, true);
|
|
59
|
+
resizeObserver == null ? void 0 : resizeObserver.disconnect();
|
|
60
|
+
if (raf.current != null) {
|
|
61
|
+
cancelAnimationFrame(raf.current);
|
|
62
|
+
raf.current = null;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, [ref, watchRef, scheduleMeasure]);
|
|
66
|
+
const style = useMemo(
|
|
67
|
+
() => ({
|
|
68
|
+
maxHeight,
|
|
69
|
+
overflow: "auto"
|
|
70
|
+
}),
|
|
71
|
+
[maxHeight]
|
|
72
|
+
);
|
|
73
|
+
return {
|
|
74
|
+
maxHeight,
|
|
75
|
+
style,
|
|
76
|
+
recompute: measure
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export { useViewportFill };
|