@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,107 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var lucideReact = require('lucide-react');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var styles = require('./CodeBlock.module.css');
|
|
7
|
+
var Button = require('../button/Button');
|
|
8
|
+
var CopyButton = require('../copy-button/CopyButton');
|
|
9
|
+
|
|
10
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
13
|
+
|
|
14
|
+
const looksLikeStackFrame = (line) => {
|
|
15
|
+
const t = line.trim();
|
|
16
|
+
return t.startsWith("at ") || // Java, JS
|
|
17
|
+
t.startsWith("...") || t.startsWith("Caused by:") || t.startsWith("Suppressed:") || t.startsWith("Traceback") || // Python header
|
|
18
|
+
t.startsWith("File ") || // Python
|
|
19
|
+
t.startsWith("\u21B3") || // some tools
|
|
20
|
+
/^at\s+\w/.test(t);
|
|
21
|
+
};
|
|
22
|
+
function getTextContent(node) {
|
|
23
|
+
if (node == null || typeof node === "boolean") return "";
|
|
24
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
25
|
+
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
26
|
+
if (react.isValidElement(node)) return getTextContent(node.props.children);
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
function CodeBlock({
|
|
30
|
+
code,
|
|
31
|
+
children,
|
|
32
|
+
copyButton,
|
|
33
|
+
copyText,
|
|
34
|
+
size = "md",
|
|
35
|
+
smart = true,
|
|
36
|
+
wrap = true
|
|
37
|
+
}) {
|
|
38
|
+
const text = typeof code === "string" ? code : void 0;
|
|
39
|
+
const hasChildren = children !== void 0 && children !== null;
|
|
40
|
+
const [isWrapped, setIsWrapped] = react.useState(wrap);
|
|
41
|
+
const codeRef = react.useRef(null);
|
|
42
|
+
const copy = react.useMemo(
|
|
43
|
+
() => {
|
|
44
|
+
var _a;
|
|
45
|
+
return (_a = copyText != null ? copyText : text) != null ? _a : getTextContent(children);
|
|
46
|
+
},
|
|
47
|
+
[copyText, text, children]
|
|
48
|
+
);
|
|
49
|
+
const lines = react.useMemo(
|
|
50
|
+
() => smart && !hasChildren && typeof text === "string" ? text.split("\n") : null,
|
|
51
|
+
[smart, hasChildren, text]
|
|
52
|
+
);
|
|
53
|
+
const handleDoubleClick = () => {
|
|
54
|
+
const el = codeRef.current;
|
|
55
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
56
|
+
if (!el || !selection) return;
|
|
57
|
+
const range = document.createRange();
|
|
58
|
+
range.selectNodeContents(el);
|
|
59
|
+
selection.removeAllRanges();
|
|
60
|
+
selection.addRange(range);
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: [
|
|
66
|
+
styles__default.default.wrapper,
|
|
67
|
+
styles__default.default[size],
|
|
68
|
+
isWrapped ? styles__default.default.wrap : styles__default.default.noWrap,
|
|
69
|
+
copyButton ? styles__default.default.hasActions : ""
|
|
70
|
+
].filter(Boolean).join(" "),
|
|
71
|
+
children: [
|
|
72
|
+
copyButton && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.actions, "aria-hidden": false, children: [
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
74
|
+
Button.Button,
|
|
75
|
+
{
|
|
76
|
+
type: "button",
|
|
77
|
+
variant: "inline",
|
|
78
|
+
size: "sm",
|
|
79
|
+
shape: "round",
|
|
80
|
+
onClick: () => setIsWrapped((v) => !v),
|
|
81
|
+
"aria-pressed": isWrapped,
|
|
82
|
+
active: isWrapped,
|
|
83
|
+
title: isWrapped ? "Ombryd ikke tekst" : "Ombryd tekst",
|
|
84
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.TextWrap, { size: 16 })
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(CopyButton.CopyButton, { size: "sm", shape: "round", variant: "inline", text: copy })
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: styles__default.default.container, tabIndex: 0, onDoubleClick: handleDoubleClick, children: /* @__PURE__ */ jsxRuntime.jsx("code", { ref: codeRef, className: styles__default.default.code, children: hasChildren ? children : lines ? lines.map((line, i) => {
|
|
90
|
+
const isFirst = i === 0;
|
|
91
|
+
const isFrame = looksLikeStackFrame(line);
|
|
92
|
+
const cls = [
|
|
93
|
+
styles__default.default.line,
|
|
94
|
+
isFirst ? styles__default.default.lineFirst : "",
|
|
95
|
+
isFrame ? styles__default.default.lineFrame : ""
|
|
96
|
+
].filter(Boolean).join(" ");
|
|
97
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cls, children: [
|
|
98
|
+
line,
|
|
99
|
+
"\n"
|
|
100
|
+
] }, i);
|
|
101
|
+
}) : text }) })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
exports.CodeBlock = CodeBlock;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from 'react';
|
|
2
|
+
export interface CodeBlockProps {
|
|
3
|
+
code?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
copyButton?: boolean;
|
|
6
|
+
copyText?: string;
|
|
7
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
8
|
+
smart?: boolean;
|
|
9
|
+
wrap?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function CodeBlock({ code, children, copyButton, copyText, size, smart, wrap, }: CodeBlockProps): JSX.Element;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { TextWrap } from 'lucide-react';
|
|
3
|
+
import { useState, useRef, useMemo, isValidElement } from 'react';
|
|
4
|
+
import styles from './CodeBlock.module.css';
|
|
5
|
+
import { Button } from '../button/Button';
|
|
6
|
+
import { CopyButton } from '../copy-button/CopyButton';
|
|
7
|
+
|
|
8
|
+
const looksLikeStackFrame = (line) => {
|
|
9
|
+
const t = line.trim();
|
|
10
|
+
return t.startsWith("at ") || // Java, JS
|
|
11
|
+
t.startsWith("...") || t.startsWith("Caused by:") || t.startsWith("Suppressed:") || t.startsWith("Traceback") || // Python header
|
|
12
|
+
t.startsWith("File ") || // Python
|
|
13
|
+
t.startsWith("\u21B3") || // some tools
|
|
14
|
+
/^at\s+\w/.test(t);
|
|
15
|
+
};
|
|
16
|
+
function getTextContent(node) {
|
|
17
|
+
if (node == null || typeof node === "boolean") return "";
|
|
18
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
19
|
+
if (Array.isArray(node)) return node.map(getTextContent).join("");
|
|
20
|
+
if (isValidElement(node)) return getTextContent(node.props.children);
|
|
21
|
+
return "";
|
|
22
|
+
}
|
|
23
|
+
function CodeBlock({
|
|
24
|
+
code,
|
|
25
|
+
children,
|
|
26
|
+
copyButton,
|
|
27
|
+
copyText,
|
|
28
|
+
size = "md",
|
|
29
|
+
smart = true,
|
|
30
|
+
wrap = true
|
|
31
|
+
}) {
|
|
32
|
+
const text = typeof code === "string" ? code : void 0;
|
|
33
|
+
const hasChildren = children !== void 0 && children !== null;
|
|
34
|
+
const [isWrapped, setIsWrapped] = useState(wrap);
|
|
35
|
+
const codeRef = useRef(null);
|
|
36
|
+
const copy = useMemo(
|
|
37
|
+
() => {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_a = copyText != null ? copyText : text) != null ? _a : getTextContent(children);
|
|
40
|
+
},
|
|
41
|
+
[copyText, text, children]
|
|
42
|
+
);
|
|
43
|
+
const lines = useMemo(
|
|
44
|
+
() => smart && !hasChildren && typeof text === "string" ? text.split("\n") : null,
|
|
45
|
+
[smart, hasChildren, text]
|
|
46
|
+
);
|
|
47
|
+
const handleDoubleClick = () => {
|
|
48
|
+
const el = codeRef.current;
|
|
49
|
+
const selection = typeof window !== "undefined" ? window.getSelection() : null;
|
|
50
|
+
if (!el || !selection) return;
|
|
51
|
+
const range = document.createRange();
|
|
52
|
+
range.selectNodeContents(el);
|
|
53
|
+
selection.removeAllRanges();
|
|
54
|
+
selection.addRange(range);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsxs(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
className: [
|
|
60
|
+
styles.wrapper,
|
|
61
|
+
styles[size],
|
|
62
|
+
isWrapped ? styles.wrap : styles.noWrap,
|
|
63
|
+
copyButton ? styles.hasActions : ""
|
|
64
|
+
].filter(Boolean).join(" "),
|
|
65
|
+
children: [
|
|
66
|
+
copyButton && /* @__PURE__ */ jsxs("span", { className: styles.actions, "aria-hidden": false, children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
Button,
|
|
69
|
+
{
|
|
70
|
+
type: "button",
|
|
71
|
+
variant: "inline",
|
|
72
|
+
size: "sm",
|
|
73
|
+
shape: "round",
|
|
74
|
+
onClick: () => setIsWrapped((v) => !v),
|
|
75
|
+
"aria-pressed": isWrapped,
|
|
76
|
+
active: isWrapped,
|
|
77
|
+
title: isWrapped ? "Ombryd ikke tekst" : "Ombryd tekst",
|
|
78
|
+
children: /* @__PURE__ */ jsx(TextWrap, { size: 16 })
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx(CopyButton, { size: "sm", shape: "round", variant: "inline", text: copy })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ jsx("pre", { className: styles.container, tabIndex: 0, onDoubleClick: handleDoubleClick, children: /* @__PURE__ */ jsx("code", { ref: codeRef, className: styles.code, children: hasChildren ? children : lines ? lines.map((line, i) => {
|
|
84
|
+
const isFirst = i === 0;
|
|
85
|
+
const isFrame = looksLikeStackFrame(line);
|
|
86
|
+
const cls = [
|
|
87
|
+
styles.line,
|
|
88
|
+
isFirst ? styles.lineFirst : "",
|
|
89
|
+
isFrame ? styles.lineFrame : ""
|
|
90
|
+
].filter(Boolean).join(" ");
|
|
91
|
+
return /* @__PURE__ */ jsxs("span", { className: cls, children: [
|
|
92
|
+
line,
|
|
93
|
+
"\n"
|
|
94
|
+
] }, i);
|
|
95
|
+
}) : text }) })
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { CodeBlock };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
.wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: inline-block;
|
|
4
|
+
max-inline-size: 100%;
|
|
5
|
+
--code-actions-h: var(--component-size-sm);
|
|
6
|
+
--code-actions-inset: var(--spacing-xs);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* <pre> */
|
|
10
|
+
.container {
|
|
11
|
+
position: relative;
|
|
12
|
+
margin-block: 0;
|
|
13
|
+
background: var(--color-bg-surface-strong);
|
|
14
|
+
border: var(--border-width-thin) solid var(--color-border-subtle);
|
|
15
|
+
border-radius: var(--border-radius-lg);
|
|
16
|
+
box-shadow: var(--shadow-xs);
|
|
17
|
+
padding: var(--spacing-sm);
|
|
18
|
+
font-family: var(--font-family-mono);
|
|
19
|
+
line-height: 1.35;
|
|
20
|
+
overflow: auto;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
max-inline-size: 100%;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* Sizes */
|
|
27
|
+
.xs .container {
|
|
28
|
+
padding: var(--spacing-xxs);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.xs .code {
|
|
32
|
+
font-size: var(--font-size-xs);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sm .container {
|
|
36
|
+
padding: var(--spacing-xs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sm .code {
|
|
40
|
+
font-size: var(--font-size-xs);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.md .code {
|
|
44
|
+
font-size: var(--font-size-sm);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.lg .code {
|
|
48
|
+
font-size: var(--font-size-base);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hasActions .container {
|
|
52
|
+
min-block-size: calc(var(--code-actions-h) + var(--spacing-sm) + var(--spacing-sm));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.xs.hasActions .container {
|
|
56
|
+
min-block-size: calc(var(--code-actions-h) + var(--spacing-xxs) + var(--spacing-xxs));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.sm.hasActions .container {
|
|
60
|
+
min-block-size: calc(var(--code-actions-h) + var(--spacing-xs) + var(--spacing-xs));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.md.hasActions .container {
|
|
64
|
+
min-block-size: calc(var(--code-actions-h) + var(--spacing-sm) + var(--spacing-sm));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.lg.hasActions .container {
|
|
68
|
+
min-block-size: calc(var(--code-actions-h) + var(--spacing-sm) + var(--spacing-sm));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Focus ring */
|
|
72
|
+
.wrapper:focus-within .container {
|
|
73
|
+
border-color: var(--color-border-selected);
|
|
74
|
+
box-shadow: var(--shadow-xs), var(--focus-ring);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* <code> */
|
|
78
|
+
.code {
|
|
79
|
+
display: block;
|
|
80
|
+
margin: 0;
|
|
81
|
+
font-family: var(--font-family-mono);
|
|
82
|
+
color: var(--color-fg-default);
|
|
83
|
+
flex: 1 1 auto;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/* Wrapping modes */
|
|
88
|
+
.wrap .code {
|
|
89
|
+
white-space: pre-wrap;
|
|
90
|
+
overflow-wrap: break-word;
|
|
91
|
+
word-break: normal;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.noWrap .code {
|
|
95
|
+
white-space: pre;
|
|
96
|
+
overflow-wrap: normal;
|
|
97
|
+
word-break: normal;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.actions {
|
|
101
|
+
position: absolute;
|
|
102
|
+
top: var(--code-actions-inset);
|
|
103
|
+
right: var(--code-actions-inset);
|
|
104
|
+
z-index: 3;
|
|
105
|
+
display: inline-flex;
|
|
106
|
+
gap: var(--spacing-xs);
|
|
107
|
+
align-items: center;
|
|
108
|
+
padding: var(--spacing-2xs);
|
|
109
|
+
border-radius: var(--border-radius-lg);
|
|
110
|
+
background: color-mix(in oklab, var(--color-bg-surface) 70%, transparent);
|
|
111
|
+
backdrop-filter: blur(6px);
|
|
112
|
+
opacity: 0;
|
|
113
|
+
pointer-events: none;
|
|
114
|
+
transition: opacity var(--transition-fast) var(--ease-standard);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.wrapper:hover .actions,
|
|
118
|
+
.wrapper:focus-within .actions {
|
|
119
|
+
opacity: 1;
|
|
120
|
+
pointer-events: auto;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.line {
|
|
124
|
+
display: inline;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.lineFirst {
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
color: var(--color-fg-default);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.lineFrame {
|
|
134
|
+
color: var(--color-fg-subtle);
|
|
135
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
+
var lucideReact = require('lucide-react');
|
|
6
|
+
var react = require('react');
|
|
7
|
+
var styles = require('./CopyButton.module.css');
|
|
8
|
+
var Button = require('../button/Button');
|
|
9
|
+
var Input = require('../forms/input/Input');
|
|
10
|
+
var Hyperlink = require('../hyperlink/Hyperlink');
|
|
11
|
+
var ToastProvider = require('../toast/provider/ToastProvider');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
16
|
+
|
|
17
|
+
function CopyButton(props) {
|
|
18
|
+
var _a, _b, _c;
|
|
19
|
+
const {
|
|
20
|
+
text,
|
|
21
|
+
variant = "outlined",
|
|
22
|
+
size = "sm",
|
|
23
|
+
children,
|
|
24
|
+
displayStyle,
|
|
25
|
+
disableIcon = false,
|
|
26
|
+
disableToast = false,
|
|
27
|
+
className,
|
|
28
|
+
style,
|
|
29
|
+
fullWidth,
|
|
30
|
+
disabled,
|
|
31
|
+
...rest
|
|
32
|
+
} = props;
|
|
33
|
+
const [copied, setCopied] = react.useState(false);
|
|
34
|
+
const toast = ToastProvider.useOptionalToast();
|
|
35
|
+
const buttonLabel = children;
|
|
36
|
+
const icon = disableIcon ? null : copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, {}) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, {});
|
|
37
|
+
const handleCopySuccess = () => {
|
|
38
|
+
if (!disableIcon) {
|
|
39
|
+
setCopied(true);
|
|
40
|
+
window.setTimeout(() => setCopied(false), 1e3);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (!disableToast) {
|
|
44
|
+
toast == null ? void 0 : toast.showToast({
|
|
45
|
+
severity: "neutral",
|
|
46
|
+
message: "Kopieret"
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const handleCopy = async () => {
|
|
51
|
+
try {
|
|
52
|
+
if (!window.isSecureContext || !navigator.clipboard) {
|
|
53
|
+
throw new Error("Clipboard API unavailable");
|
|
54
|
+
}
|
|
55
|
+
await navigator.clipboard.writeText(text);
|
|
56
|
+
handleCopySuccess();
|
|
57
|
+
} catch (err) {
|
|
58
|
+
console.error("Failed to copy:", err);
|
|
59
|
+
try {
|
|
60
|
+
const textarea = document.createElement("textarea");
|
|
61
|
+
textarea.value = text;
|
|
62
|
+
textarea.setAttribute("readonly", "");
|
|
63
|
+
textarea.style.position = "fixed";
|
|
64
|
+
textarea.style.left = "-9999px";
|
|
65
|
+
document.body.appendChild(textarea);
|
|
66
|
+
textarea.select();
|
|
67
|
+
const success = document.execCommand("copy");
|
|
68
|
+
document.body.removeChild(textarea);
|
|
69
|
+
if (success) {
|
|
70
|
+
handleCopySuccess();
|
|
71
|
+
}
|
|
72
|
+
} catch (fallbackErr) {
|
|
73
|
+
console.error("Fallback copy failed:", fallbackErr);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
if (displayStyle === "link") {
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Hyperlink.Hyperlink, { asChild: true, variant: "primary", icon, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
"button",
|
|
80
|
+
{
|
|
81
|
+
type: "button",
|
|
82
|
+
"aria-label": children ? "" : (_a = rest["aria-label"]) != null ? _a : "Kopier til udklipsholder",
|
|
83
|
+
onClick: (e) => {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
handleCopy();
|
|
87
|
+
},
|
|
88
|
+
className: [styles__default.default.link, copied ? styles__default.default.copied : "", className != null ? className : ""].filter(Boolean).join(" "),
|
|
89
|
+
style,
|
|
90
|
+
disabled,
|
|
91
|
+
children: buttonLabel
|
|
92
|
+
}
|
|
93
|
+
) });
|
|
94
|
+
}
|
|
95
|
+
if (displayStyle === "field") {
|
|
96
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
97
|
+
Input.Input,
|
|
98
|
+
{
|
|
99
|
+
value: text,
|
|
100
|
+
readOnly: true,
|
|
101
|
+
disabled,
|
|
102
|
+
fullWidth,
|
|
103
|
+
className,
|
|
104
|
+
style,
|
|
105
|
+
inputSize: size,
|
|
106
|
+
variant: "outlined",
|
|
107
|
+
buttonLabel: typeof buttonLabel === "string" ? buttonLabel : void 0,
|
|
108
|
+
buttonIcon: icon,
|
|
109
|
+
onButtonClick: () => {
|
|
110
|
+
void handleCopy();
|
|
111
|
+
},
|
|
112
|
+
"aria-label": (_b = rest["aria-label"]) != null ? _b : "Kopier til udklipsholder"
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
117
|
+
Button.Button,
|
|
118
|
+
{
|
|
119
|
+
...rest,
|
|
120
|
+
"aria-label": children ? "" : (_c = rest["aria-label"]) != null ? _c : "Kopier til udklipsholder",
|
|
121
|
+
onClick: (e) => {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
handleCopy();
|
|
125
|
+
},
|
|
126
|
+
variant,
|
|
127
|
+
size,
|
|
128
|
+
className,
|
|
129
|
+
style,
|
|
130
|
+
disabled,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${styles__default.default.container} ${copied ? styles__default.default.copied : ""}`, children: icon }),
|
|
133
|
+
buttonLabel
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
exports.CopyButton = CopyButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode, ComponentProps } from 'react';
|
|
2
|
+
import { Button, ButtonSize, ButtonVariant } from '../button/Button';
|
|
3
|
+
interface CopyButtonProps {
|
|
4
|
+
text: string;
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
displayStyle?: 'button' | 'link' | 'field';
|
|
9
|
+
disableIcon?: boolean;
|
|
10
|
+
disableToast?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function CopyButton(props: CopyButtonProps & ComponentProps<typeof Button>): ReactNode;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { Check, Copy } from 'lucide-react';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import styles from './CopyButton.module.css';
|
|
6
|
+
import { Button } from '../button/Button';
|
|
7
|
+
import { Input } from '../forms/input/Input';
|
|
8
|
+
import { Hyperlink } from '../hyperlink/Hyperlink';
|
|
9
|
+
import { useOptionalToast } from '../toast/provider/ToastProvider';
|
|
10
|
+
|
|
11
|
+
function CopyButton(props) {
|
|
12
|
+
var _a, _b, _c;
|
|
13
|
+
const {
|
|
14
|
+
text,
|
|
15
|
+
variant = "outlined",
|
|
16
|
+
size = "sm",
|
|
17
|
+
children,
|
|
18
|
+
displayStyle,
|
|
19
|
+
disableIcon = false,
|
|
20
|
+
disableToast = false,
|
|
21
|
+
className,
|
|
22
|
+
style,
|
|
23
|
+
fullWidth,
|
|
24
|
+
disabled,
|
|
25
|
+
...rest
|
|
26
|
+
} = props;
|
|
27
|
+
const [copied, setCopied] = useState(false);
|
|
28
|
+
const toast = useOptionalToast();
|
|
29
|
+
const buttonLabel = children;
|
|
30
|
+
const icon = disableIcon ? null : copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {});
|
|
31
|
+
const handleCopySuccess = () => {
|
|
32
|
+
if (!disableIcon) {
|
|
33
|
+
setCopied(true);
|
|
34
|
+
window.setTimeout(() => setCopied(false), 1e3);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!disableToast) {
|
|
38
|
+
toast == null ? void 0 : toast.showToast({
|
|
39
|
+
severity: "neutral",
|
|
40
|
+
message: "Kopieret"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const handleCopy = async () => {
|
|
45
|
+
try {
|
|
46
|
+
if (!window.isSecureContext || !navigator.clipboard) {
|
|
47
|
+
throw new Error("Clipboard API unavailable");
|
|
48
|
+
}
|
|
49
|
+
await navigator.clipboard.writeText(text);
|
|
50
|
+
handleCopySuccess();
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error("Failed to copy:", err);
|
|
53
|
+
try {
|
|
54
|
+
const textarea = document.createElement("textarea");
|
|
55
|
+
textarea.value = text;
|
|
56
|
+
textarea.setAttribute("readonly", "");
|
|
57
|
+
textarea.style.position = "fixed";
|
|
58
|
+
textarea.style.left = "-9999px";
|
|
59
|
+
document.body.appendChild(textarea);
|
|
60
|
+
textarea.select();
|
|
61
|
+
const success = document.execCommand("copy");
|
|
62
|
+
document.body.removeChild(textarea);
|
|
63
|
+
if (success) {
|
|
64
|
+
handleCopySuccess();
|
|
65
|
+
}
|
|
66
|
+
} catch (fallbackErr) {
|
|
67
|
+
console.error("Fallback copy failed:", fallbackErr);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
if (displayStyle === "link") {
|
|
72
|
+
return /* @__PURE__ */ jsx(Hyperlink, { asChild: true, variant: "primary", icon, children: /* @__PURE__ */ jsx(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
"aria-label": children ? "" : (_a = rest["aria-label"]) != null ? _a : "Kopier til udklipsholder",
|
|
77
|
+
onClick: (e) => {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
e.stopPropagation();
|
|
80
|
+
handleCopy();
|
|
81
|
+
},
|
|
82
|
+
className: [styles.link, copied ? styles.copied : "", className != null ? className : ""].filter(Boolean).join(" "),
|
|
83
|
+
style,
|
|
84
|
+
disabled,
|
|
85
|
+
children: buttonLabel
|
|
86
|
+
}
|
|
87
|
+
) });
|
|
88
|
+
}
|
|
89
|
+
if (displayStyle === "field") {
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
Input,
|
|
92
|
+
{
|
|
93
|
+
value: text,
|
|
94
|
+
readOnly: true,
|
|
95
|
+
disabled,
|
|
96
|
+
fullWidth,
|
|
97
|
+
className,
|
|
98
|
+
style,
|
|
99
|
+
inputSize: size,
|
|
100
|
+
variant: "outlined",
|
|
101
|
+
buttonLabel: typeof buttonLabel === "string" ? buttonLabel : void 0,
|
|
102
|
+
buttonIcon: icon,
|
|
103
|
+
onButtonClick: () => {
|
|
104
|
+
void handleCopy();
|
|
105
|
+
},
|
|
106
|
+
"aria-label": (_b = rest["aria-label"]) != null ? _b : "Kopier til udklipsholder"
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
return /* @__PURE__ */ jsxs(
|
|
111
|
+
Button,
|
|
112
|
+
{
|
|
113
|
+
...rest,
|
|
114
|
+
"aria-label": children ? "" : (_c = rest["aria-label"]) != null ? _c : "Kopier til udklipsholder",
|
|
115
|
+
onClick: (e) => {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
e.stopPropagation();
|
|
118
|
+
handleCopy();
|
|
119
|
+
},
|
|
120
|
+
variant,
|
|
121
|
+
size,
|
|
122
|
+
className,
|
|
123
|
+
style,
|
|
124
|
+
disabled,
|
|
125
|
+
children: [
|
|
126
|
+
/* @__PURE__ */ jsx("span", { className: `${styles.container} ${copied ? styles.copied : ""}`, children: icon }),
|
|
127
|
+
buttonLabel
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export { CopyButton };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.container,
|
|
2
|
+
.link {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
gap: var(--spacing-xxs);
|
|
6
|
+
background-color: unset;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.link {
|
|
10
|
+
appearance: none;
|
|
11
|
+
border: none;
|
|
12
|
+
padding: 0;
|
|
13
|
+
font: inherit;
|
|
14
|
+
color: inherit;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.copied {
|
|
20
|
+
color: var(--color-status-success);
|
|
21
|
+
transition: color ease-in 0.1s;
|
|
22
|
+
}
|