uibee 2.17.2 → 2.17.3

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.
@@ -1,4 +1,5 @@
1
1
  import { Components } from 'react-markdown';
2
+ import 'highlight.js/styles/github-dark.css';
2
3
  export default function MarkdownRender({ MDstr, components, className }: {
3
4
  MDstr: string;
4
5
  components?: Components;
@@ -1,9 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import Markdown from 'react-markdown';
3
3
  import remarkGfm from 'remark-gfm';
4
+ import rehypeHighlight from 'rehype-highlight';
5
+ import 'highlight.js/styles/github-dark.css';
4
6
  const defaultComponents = {
5
7
  h1: ({ ...props }) => _jsx("h2", { ...props }),
8
+ pre({ children }) {
9
+ return (_jsx("pre", { className: 'inline-block rounded-lg overflow-auto whitespace-pre-wrap wrap-break-word w-full', children: children }));
10
+ },
6
11
  };
7
12
  export default function MarkdownRender({ MDstr, components, className }) {
8
- return (_jsx("div", { className: className ?? 'prose prose-sm prose-custom max-w-none', children: _jsx(Markdown, { components: { ...defaultComponents, ...components }, remarkPlugins: [remarkGfm], children: MDstr.replace(/\\n/g, '\n') }) }));
13
+ return (_jsx("div", { className: className ?? 'prose prose-sm prose-custom max-w-none', children: _jsx(Markdown, { components: { ...defaultComponents, ...components }, remarkPlugins: [remarkGfm], rehypePlugins: [rehypeHighlight], children: MDstr.replace(/\\n/g, '\n') }) }));
9
14
  }
@@ -1110,6 +1110,9 @@
1110
1110
  .hidden {
1111
1111
  display: none;
1112
1112
  }
1113
+ .inline-block {
1114
+ display: inline-block;
1115
+ }
1113
1116
  .inline-flex {
1114
1117
  display: inline-flex;
1115
1118
  }
@@ -2074,9 +2077,15 @@
2074
2077
  --tw-tracking: var(--tracking-wider);
2075
2078
  letter-spacing: var(--tracking-wider);
2076
2079
  }
2080
+ .wrap-break-word {
2081
+ overflow-wrap: break-word;
2082
+ }
2077
2083
  .whitespace-nowrap {
2078
2084
  white-space: nowrap;
2079
2085
  }
2086
+ .whitespace-pre-wrap {
2087
+ white-space: pre-wrap;
2088
+ }
2080
2089
  .text-amber-200 {
2081
2090
  color: var(--color-amber-200);
2082
2091
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uibee",
3
- "version": "2.17.2",
3
+ "version": "2.17.3",
4
4
  "description": "Shared components, functions and hooks for reuse across Login projects",
5
5
  "homepage": "https://github.com/Login-Linjeforening-for-IT/uibee#readme",
6
6
  "bugs": {