@bergetai/ui 0.23.0 → 0.25.0

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.
@@ -57,13 +57,17 @@ const bergetComponents = {
57
57
  ul: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.ul, {
58
58
  ...props,
59
59
  className: `
60
- my-2 ms-5 list-disc space-y-1
60
+ my-2 ms-5 list-disc
61
61
  marker:text-berget-muted-foreground
62
+ [&>li+li]:mt-1
62
63
  `
63
64
  }),
64
65
  ol: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.ol, {
65
66
  ...props,
66
- className: `my-2 ms-5 list-decimal space-y-1`
67
+ className: `
68
+ my-2 ms-5 list-decimal
69
+ [&>li+li]:mt-1
70
+ `
67
71
  }),
68
72
  li: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.li, {
69
73
  ...props,
@@ -90,7 +94,7 @@ const bergetComponents = {
90
94
  }),
91
95
  img: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.img, {
92
96
  ...props,
93
- className: `my-3 max-w-full rounded-berget-xs border-berget-border`
97
+ className: `my-3 max-w-full rounded-berget-xs border border-berget-border`
94
98
  }),
95
99
  a: ({ node: _node, ...props }) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
96
100
  ...props,
@@ -131,11 +135,13 @@ const bergetComponents = {
131
135
  }),
132
136
  th: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.th, {
133
137
  ...props,
134
- className: `border-b-berget-border px-3 py-1.5 text-start font-semibold`
138
+ className: `
139
+ border-b border-b-berget-border px-3 py-1.5 text-start font-semibold
140
+ `
135
141
  }),
136
142
  td: (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(streamdown.defaultComponents.td, {
137
143
  ...props,
138
- className: `border-b-berget-border px-3 py-1.5`
144
+ className: `border-b border-b-berget-border px-3 py-1.5`
139
145
  })
140
146
  };
141
147
  function Markdown({ className, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.cjs","names":["defaultComponents","React","MarkdownCodeBlock","Streamdown","cn"],"sources":["../../../src/components/markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Streamdown, defaultComponents, type Components, type StreamdownProps } from 'streamdown';\nimport { cn } from '../../lib/utils';\nimport { MarkdownCodeBlock } from './MarkdownCodeBlock';\n\n/**\n * Markdown renderer for chat/UI text, built on Streamdown (incomplete-markdown\n * repair during streaming, GFM tables, rehype-sanitize + rehype-harden).\n *\n * Streamdown ships its own Tailwind classes inside its dist files, which\n * consumers' Tailwind builds never scan — so every element is given a full\n * Berget class set here instead of relying on the defaults. Utility classes\n * used below live in this package's own dist, which the shipped `@source`\n * covers for all consumers.\n *\n * Code highlighting reuses the package CodeBlock family and the shared Shiki\n * highlighter (Berget CSS-variable theme). Mermaid/KaTeX are intentionally\n * not enabled.\n */\nconst bergetComponents: Components = {\n h1: (props) => <defaultComponents.h1 {...props} className={`mt-4 mb-2 text-lg font-semibold`} />,\n h2: (props) => (\n <defaultComponents.h2 {...props} className={`mt-4 mb-2 text-base font-semibold`} />\n ),\n h3: (props) => (\n <defaultComponents.h3 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h4: (props) => (\n <defaultComponents.h4 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h5: (props) => (\n <defaultComponents.h5 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h6: (props) => (\n <defaultComponents.h6 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n p: (props) => (\n <defaultComponents.p\n {...props}\n className={`\n my-2\n first:mt-0\n last:mb-0\n `}\n />\n ),\n ul: (props) => (\n <defaultComponents.ul\n {...props}\n className={`\n my-2 ms-5 list-disc space-y-1\n marker:text-berget-muted-foreground\n `}\n />\n ),\n ol: (props) => <defaultComponents.ol {...props} className={`my-2 ms-5 list-decimal space-y-1`} />,\n li: (props) => <defaultComponents.li {...props} className={`leading-relaxed`} />,\n del: (props) => <del {...props} className={`line-through`} />,\n em: (props) => <em {...props} className={`italic`} />,\n blockquote: (props) => (\n <defaultComponents.blockquote\n {...props}\n className={`\n my-3 border-l-4 border-berget-border ps-3 text-berget-muted-foreground\n italic\n `}\n />\n ),\n hr: (props) => <defaultComponents.hr {...props} className={`my-4 border-berget-border`} />,\n img: (props) => (\n <defaultComponents.img\n {...props}\n className={`my-3 max-w-full rounded-berget-xs border-berget-border`}\n />\n ),\n // Real anchor, not Streamdown's default <button>: links must keep href\n // semantics (middle-click, new tab). Hardening attrs are added explicitly\n // since rehype-harden can only act on real anchors.\n a: ({ node: _node, ...props }) => (\n <a\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer nofollow\"\n className={`text-berget-primary underline underline-offset-2`}\n />\n ),\n // Inline code only — fenced blocks are consumed by the `pre` override below.\n code: (props) => (\n <defaultComponents.code\n {...props}\n className={`\n rounded-berget-xs bg-muted px-1.5 py-0.5 font-mono text-[0.85em]\n `}\n />\n ),\n // Fenced / indented code: derive code + language from the child code\n // element and render with the package CodeBlock (highlighting included).\n pre: ({ children }) => {\n if (React.isValidElement(children)) {\n const { className, children: code } = children.props as {\n className?: string;\n children?: React.ReactNode;\n };\n const language = /language-([\\w+-]+)/.exec(className ?? '')?.[1] ?? 'text';\n return <MarkdownCodeBlock code={String(code ?? '')} language={language} />;\n }\n return <>{children}</>;\n },\n table: (props) => (\n <div\n className={`\n my-3 max-w-full overflow-x-auto rounded-berget-xs border\n border-berget-border\n `}\n >\n <table {...props} className={`w-full border-collapse text-sm`} />\n </div>\n ),\n thead: (props) => <defaultComponents.thead {...props} className={`bg-muted/50`} />,\n th: (props) => (\n <defaultComponents.th\n {...props}\n className={`border-b-berget-border px-3 py-1.5 text-start font-semibold`}\n />\n ),\n td: (props) => (\n <defaultComponents.td {...props} className={`border-b-berget-border px-3 py-1.5`} />\n ),\n};\n\ntype MarkdownProps = Omit<StreamdownProps, 'components' | 'plugins' | 'dir' | 'prefix'>;\nexport type { MarkdownProps };\n\nexport function Markdown({ className, ...props }: MarkdownProps) {\n return (\n <Streamdown\n {...props}\n dir=\"ltr\"\n components={bergetComponents}\n className={cn('text-caption/relaxed text-berget-foreground', className)}\n />\n );\n}\n\nMarkdown.displayName = 'Markdown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,mBAA+B;CACnC,KAAK,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAoC,CAAA;CAC/F,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC,CAAA;CAEpF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC,CAAA;CAEpF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC,CAAA;CAEpF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC,CAAA;CAEpF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC,CAAA;CAEpF,IAAI,UACF,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,GAAnB;EACE,GAAI;EACJ,WAAW;;;;;CAKZ,CAAA;CAEH,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EACE,GAAI;EACJ,WAAW;;;;CAIZ,CAA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MAAM,OAAO,QAAQ,EAAE;IAAa;GAAW,CAAA;EAC3E;EACA,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAA,kBAAA,UAAA,EAAG,SAAW,CAAA;CACvB;CACA,QAAQ,UACN,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,WAAW;;;;EAKX,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;GAAO,GAAI;GAAO,WAAW;EAAmC,CAAA;CAC7D,CAAA;CAEP,QAAQ,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACF,WAAAA,kBAAkB,OAAnB;EAAyB,GAAI;EAAO,WAAW;CAAgB,CAAA;CACjF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EACE,GAAI;EACJ,WAAW;CACZ,CAAA;CAEH,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAuC,CAAA;AAEvF;AAKA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAwB;CAC/D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,WAAAA,YAAD;EACE,GAAI;EACJ,KAAI;EACJ,YAAY;EACZ,WAAWC,cAAAA,GAAG,+CAA+C,SAAS;CACvE,CAAA;AAEL;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"Markdown.cjs","names":["defaultComponents","React","MarkdownCodeBlock","Streamdown","cn"],"sources":["../../../src/components/markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Streamdown, defaultComponents, type Components, type StreamdownProps } from 'streamdown';\nimport { cn } from '../../lib/utils';\nimport { MarkdownCodeBlock } from './MarkdownCodeBlock';\n\n/**\n * Markdown renderer for chat/UI text, built on Streamdown (incomplete-markdown\n * repair during streaming, GFM tables, rehype-sanitize + rehype-harden).\n *\n * Streamdown ships its own Tailwind classes inside its dist files, which\n * consumers' Tailwind builds never scan — so every element is given a full\n * Berget class set here instead of relying on the defaults. Utility classes\n * used below live in this package's own dist, which the shipped `@source`\n * covers for all consumers.\n *\n * Code highlighting reuses the package CodeBlock family and the shared Shiki\n * highlighter (Berget CSS-variable theme). Mermaid/KaTeX are intentionally\n * not enabled.\n */\nconst bergetComponents: Components = {\n h1: (props) => <defaultComponents.h1 {...props} className={`mt-4 mb-2 text-lg font-semibold`} />,\n h2: (props) => (\n <defaultComponents.h2 {...props} className={`mt-4 mb-2 text-base font-semibold`} />\n ),\n h3: (props) => (\n <defaultComponents.h3 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h4: (props) => (\n <defaultComponents.h4 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h5: (props) => (\n <defaultComponents.h5 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h6: (props) => (\n <defaultComponents.h6 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n p: (props) => (\n <defaultComponents.p\n {...props}\n className={`\n my-2\n first:mt-0\n last:mb-0\n `}\n />\n ),\n ul: (props) => (\n <defaultComponents.ul\n {...props}\n className={`\n my-2 ms-5 list-disc\n marker:text-berget-muted-foreground\n [&>li+li]:mt-1\n `}\n />\n ),\n ol: (props) => (\n <defaultComponents.ol\n {...props}\n className={`\n my-2 ms-5 list-decimal\n [&>li+li]:mt-1\n `}\n />\n ),\n li: (props) => <defaultComponents.li {...props} className={`leading-relaxed`} />,\n del: (props) => <del {...props} className={`line-through`} />,\n em: (props) => <em {...props} className={`italic`} />,\n blockquote: (props) => (\n <defaultComponents.blockquote\n {...props}\n className={`\n my-3 border-l-4 border-berget-border ps-3 text-berget-muted-foreground\n italic\n `}\n />\n ),\n hr: (props) => <defaultComponents.hr {...props} className={`my-4 border-berget-border`} />,\n img: (props) => (\n <defaultComponents.img\n {...props}\n className={`my-3 max-w-full rounded-berget-xs border border-berget-border`}\n />\n ),\n // Real anchor, not Streamdown's default <button>: links must keep href\n // semantics (middle-click, new tab). Hardening attrs are added explicitly\n // since rehype-harden can only act on real anchors.\n a: ({ node: _node, ...props }) => (\n <a\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer nofollow\"\n className={`text-berget-primary underline underline-offset-2`}\n />\n ),\n // Inline code only — fenced blocks are consumed by the `pre` override below.\n code: (props) => (\n <defaultComponents.code\n {...props}\n className={`\n rounded-berget-xs bg-muted px-1.5 py-0.5 font-mono text-[0.85em]\n `}\n />\n ),\n // Fenced / indented code: derive code + language from the child code\n // element and render with the package CodeBlock (highlighting included).\n pre: ({ children }) => {\n if (React.isValidElement(children)) {\n const { className, children: code } = children.props as {\n className?: string;\n children?: React.ReactNode;\n };\n const language = /language-([\\w+-]+)/.exec(className ?? '')?.[1] ?? 'text';\n return <MarkdownCodeBlock code={String(code ?? '')} language={language} />;\n }\n return <>{children}</>;\n },\n table: (props) => (\n <div\n className={`\n my-3 max-w-full overflow-x-auto rounded-berget-xs border\n border-berget-border\n `}\n >\n <table {...props} className={`w-full border-collapse text-sm`} />\n </div>\n ),\n thead: (props) => <defaultComponents.thead {...props} className={`bg-muted/50`} />,\n th: (props) => (\n <defaultComponents.th\n {...props}\n className={`\n border-b border-b-berget-border px-3 py-1.5 text-start font-semibold\n `}\n />\n ),\n td: (props) => (\n <defaultComponents.td {...props} className={`border-b border-b-berget-border px-3 py-1.5`} />\n ),\n};\n\ntype MarkdownProps = Omit<StreamdownProps, 'components' | 'plugins' | 'dir' | 'prefix'>;\nexport type { MarkdownProps };\n\nexport function Markdown({ className, ...props }: MarkdownProps) {\n return (\n <Streamdown\n {...props}\n dir=\"ltr\"\n components={bergetComponents}\n className={cn('text-caption/relaxed text-berget-foreground', className)}\n />\n );\n}\n\nMarkdown.displayName = 'Markdown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,mBAA+B;CACnC,KAAK,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EA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AA;CACjF,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EACE,GAAI;EACJ,WAAW;;;CAGZ,CAAA;CAEH,KAAK,UACH,iBAAA,GAAA,kBAAA,IAAA,CAACA,WAAAA,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAgD,CAAA;AAEhG;AAKA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAwB;CAC/D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACG,WAAAA,YAAD;EACE,GAAI;EACJ,KAAI;EACJ,YAAY;EACZ,WAAWC,cAAAA,GAAG,+CAA+C,SAAS;CACvE,CAAA;AAEL;AAEA,SAAS,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.d.cts","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"mappings":";;KAoIK,gBAAgB,KAAK;wBAGV,WAAW,cAAc,SAAS,4CAAa,IAAA;yBAA/C"}
1
+ {"version":3,"file":"Markdown.d.cts","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"mappings":";;KA+IK,gBAAgB,KAAK;wBAGV,WAAW,cAAc,SAAS,4CAAa,IAAA;yBAA/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.d.mts","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"mappings":";;KAoIK,gBAAgB,KAAK;wBAGV,WAAW,cAAc,SAAS,4CAAa,IAAA;yBAA/C"}
1
+ {"version":3,"file":"Markdown.d.mts","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"mappings":";;KA+IK,gBAAgB,KAAK;wBAGV,WAAW,cAAc,SAAS,4CAAa,IAAA;yBAA/C"}
@@ -55,13 +55,17 @@ const bergetComponents = {
55
55
  ul: (props) => /* @__PURE__ */ jsx(defaultComponents.ul, {
56
56
  ...props,
57
57
  className: `
58
- my-2 ms-5 list-disc space-y-1
58
+ my-2 ms-5 list-disc
59
59
  marker:text-berget-muted-foreground
60
+ [&>li+li]:mt-1
60
61
  `
61
62
  }),
62
63
  ol: (props) => /* @__PURE__ */ jsx(defaultComponents.ol, {
63
64
  ...props,
64
- className: `my-2 ms-5 list-decimal space-y-1`
65
+ className: `
66
+ my-2 ms-5 list-decimal
67
+ [&>li+li]:mt-1
68
+ `
65
69
  }),
66
70
  li: (props) => /* @__PURE__ */ jsx(defaultComponents.li, {
67
71
  ...props,
@@ -88,7 +92,7 @@ const bergetComponents = {
88
92
  }),
89
93
  img: (props) => /* @__PURE__ */ jsx(defaultComponents.img, {
90
94
  ...props,
91
- className: `my-3 max-w-full rounded-berget-xs border-berget-border`
95
+ className: `my-3 max-w-full rounded-berget-xs border border-berget-border`
92
96
  }),
93
97
  a: ({ node: _node, ...props }) => /* @__PURE__ */ jsx("a", {
94
98
  ...props,
@@ -129,11 +133,13 @@ const bergetComponents = {
129
133
  }),
130
134
  th: (props) => /* @__PURE__ */ jsx(defaultComponents.th, {
131
135
  ...props,
132
- className: `border-b-berget-border px-3 py-1.5 text-start font-semibold`
136
+ className: `
137
+ border-b border-b-berget-border px-3 py-1.5 text-start font-semibold
138
+ `
133
139
  }),
134
140
  td: (props) => /* @__PURE__ */ jsx(defaultComponents.td, {
135
141
  ...props,
136
- className: `border-b-berget-border px-3 py-1.5`
142
+ className: `border-b border-b-berget-border px-3 py-1.5`
137
143
  })
138
144
  };
139
145
  function Markdown({ className, ...props }) {
@@ -1 +1 @@
1
- {"version":3,"file":"Markdown.mjs","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Streamdown, defaultComponents, type Components, type StreamdownProps } from 'streamdown';\nimport { cn } from '../../lib/utils';\nimport { MarkdownCodeBlock } from './MarkdownCodeBlock';\n\n/**\n * Markdown renderer for chat/UI text, built on Streamdown (incomplete-markdown\n * repair during streaming, GFM tables, rehype-sanitize + rehype-harden).\n *\n * Streamdown ships its own Tailwind classes inside its dist files, which\n * consumers' Tailwind builds never scan — so every element is given a full\n * Berget class set here instead of relying on the defaults. Utility classes\n * used below live in this package's own dist, which the shipped `@source`\n * covers for all consumers.\n *\n * Code highlighting reuses the package CodeBlock family and the shared Shiki\n * highlighter (Berget CSS-variable theme). Mermaid/KaTeX are intentionally\n * not enabled.\n */\nconst bergetComponents: Components = {\n h1: (props) => <defaultComponents.h1 {...props} className={`mt-4 mb-2 text-lg font-semibold`} />,\n h2: (props) => (\n <defaultComponents.h2 {...props} className={`mt-4 mb-2 text-base font-semibold`} />\n ),\n h3: (props) => (\n <defaultComponents.h3 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h4: (props) => (\n <defaultComponents.h4 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h5: (props) => (\n <defaultComponents.h5 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h6: (props) => (\n <defaultComponents.h6 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n p: (props) => (\n <defaultComponents.p\n {...props}\n className={`\n my-2\n first:mt-0\n last:mb-0\n `}\n />\n ),\n ul: (props) => (\n <defaultComponents.ul\n {...props}\n className={`\n my-2 ms-5 list-disc space-y-1\n marker:text-berget-muted-foreground\n `}\n />\n ),\n ol: (props) => <defaultComponents.ol {...props} className={`my-2 ms-5 list-decimal space-y-1`} />,\n li: (props) => <defaultComponents.li {...props} className={`leading-relaxed`} />,\n del: (props) => <del {...props} className={`line-through`} />,\n em: (props) => <em {...props} className={`italic`} />,\n blockquote: (props) => (\n <defaultComponents.blockquote\n {...props}\n className={`\n my-3 border-l-4 border-berget-border ps-3 text-berget-muted-foreground\n italic\n `}\n />\n ),\n hr: (props) => <defaultComponents.hr {...props} className={`my-4 border-berget-border`} />,\n img: (props) => (\n <defaultComponents.img\n {...props}\n className={`my-3 max-w-full rounded-berget-xs border-berget-border`}\n />\n ),\n // Real anchor, not Streamdown's default <button>: links must keep href\n // semantics (middle-click, new tab). Hardening attrs are added explicitly\n // since rehype-harden can only act on real anchors.\n a: ({ node: _node, ...props }) => (\n <a\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer nofollow\"\n className={`text-berget-primary underline underline-offset-2`}\n />\n ),\n // Inline code only — fenced blocks are consumed by the `pre` override below.\n code: (props) => (\n <defaultComponents.code\n {...props}\n className={`\n rounded-berget-xs bg-muted px-1.5 py-0.5 font-mono text-[0.85em]\n `}\n />\n ),\n // Fenced / indented code: derive code + language from the child code\n // element and render with the package CodeBlock (highlighting included).\n pre: ({ children }) => {\n if (React.isValidElement(children)) {\n const { className, children: code } = children.props as {\n className?: string;\n children?: React.ReactNode;\n };\n const language = /language-([\\w+-]+)/.exec(className ?? '')?.[1] ?? 'text';\n return <MarkdownCodeBlock code={String(code ?? '')} language={language} />;\n }\n return <>{children}</>;\n },\n table: (props) => (\n <div\n className={`\n my-3 max-w-full overflow-x-auto rounded-berget-xs border\n border-berget-border\n `}\n >\n <table {...props} className={`w-full border-collapse text-sm`} />\n </div>\n ),\n thead: (props) => <defaultComponents.thead {...props} className={`bg-muted/50`} />,\n th: (props) => (\n <defaultComponents.th\n {...props}\n className={`border-b-berget-border px-3 py-1.5 text-start font-semibold`}\n />\n ),\n td: (props) => (\n <defaultComponents.td {...props} className={`border-b-berget-border px-3 py-1.5`} />\n ),\n};\n\ntype MarkdownProps = Omit<StreamdownProps, 'components' | 'plugins' | 'dir' | 'prefix'>;\nexport type { MarkdownProps };\n\nexport function Markdown({ className, ...props }: MarkdownProps) {\n return (\n <Streamdown\n {...props}\n dir=\"ltr\"\n components={bergetComponents}\n className={cn('text-caption/relaxed text-berget-foreground', className)}\n />\n );\n}\n\nMarkdown.displayName = 'Markdown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,mBAA+B;CACnC,KAAK,UAAU,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAoC,CAAA;CAC/F,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;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,eAAe;EACrB,IAAI,MAAM,eAAe,QAAQ,GAAG;GAClC,MAAM,EAAE,WAAW,UAAU,SAAS,SAAS;GAI/C,MAAM,WAAW,qBAAqB,KAAK,aAAa,EAAE,CAAC,GAAG,MAAM;GACpE,OAAO,oBAAC,mBAAD;IAAmB,MAAM,OAAO,QAAQ,EAAE;IAAa;GAAW,CAAA;EAC3E;EACA,OAAO,oBAAA,UAAA,EAAG,SAAW,CAAA;CACvB;CACA,QAAQ,UACN,oBAAC,OAAD;EACE,WAAW;;;;EAKX,UAAA,oBAAC,SAAD;GAAO,GAAI;GAAO,WAAW;EAAmC,CAAA;CAC7D,CAAA;CAEP,QAAQ,UAAU,oBAAC,kBAAkB,OAAnB;EAAyB,GAAI;EAAO,WAAW;CAAgB,CAAA;CACjF,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EACE,GAAI;EACJ,WAAW;CACZ,CAAA;CAEH,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAuC,CAAA;AAEvF;AAKA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAwB;CAC/D,OACE,oBAAC,YAAD;EACE,GAAI;EACJ,KAAI;EACJ,YAAY;EACZ,WAAW,GAAG,+CAA+C,SAAS;CACvE,CAAA;AAEL;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"Markdown.mjs","names":[],"sources":["../../../src/components/markdown/Markdown.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Streamdown, defaultComponents, type Components, type StreamdownProps } from 'streamdown';\nimport { cn } from '../../lib/utils';\nimport { MarkdownCodeBlock } from './MarkdownCodeBlock';\n\n/**\n * Markdown renderer for chat/UI text, built on Streamdown (incomplete-markdown\n * repair during streaming, GFM tables, rehype-sanitize + rehype-harden).\n *\n * Streamdown ships its own Tailwind classes inside its dist files, which\n * consumers' Tailwind builds never scan — so every element is given a full\n * Berget class set here instead of relying on the defaults. Utility classes\n * used below live in this package's own dist, which the shipped `@source`\n * covers for all consumers.\n *\n * Code highlighting reuses the package CodeBlock family and the shared Shiki\n * highlighter (Berget CSS-variable theme). Mermaid/KaTeX are intentionally\n * not enabled.\n */\nconst bergetComponents: Components = {\n h1: (props) => <defaultComponents.h1 {...props} className={`mt-4 mb-2 text-lg font-semibold`} />,\n h2: (props) => (\n <defaultComponents.h2 {...props} className={`mt-4 mb-2 text-base font-semibold`} />\n ),\n h3: (props) => (\n <defaultComponents.h3 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h4: (props) => (\n <defaultComponents.h4 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h5: (props) => (\n <defaultComponents.h5 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n h6: (props) => (\n <defaultComponents.h6 {...props} className={`mt-3 mb-1.5 text-sm font-semibold`} />\n ),\n p: (props) => (\n <defaultComponents.p\n {...props}\n className={`\n my-2\n first:mt-0\n last:mb-0\n `}\n />\n ),\n ul: (props) => (\n <defaultComponents.ul\n {...props}\n className={`\n my-2 ms-5 list-disc\n marker:text-berget-muted-foreground\n [&>li+li]:mt-1\n `}\n />\n ),\n ol: (props) => (\n <defaultComponents.ol\n {...props}\n className={`\n my-2 ms-5 list-decimal\n [&>li+li]:mt-1\n `}\n />\n ),\n li: (props) => <defaultComponents.li {...props} className={`leading-relaxed`} />,\n del: (props) => <del {...props} className={`line-through`} />,\n em: (props) => <em {...props} className={`italic`} />,\n blockquote: (props) => (\n <defaultComponents.blockquote\n {...props}\n className={`\n my-3 border-l-4 border-berget-border ps-3 text-berget-muted-foreground\n italic\n `}\n />\n ),\n hr: (props) => <defaultComponents.hr {...props} className={`my-4 border-berget-border`} />,\n img: (props) => (\n <defaultComponents.img\n {...props}\n className={`my-3 max-w-full rounded-berget-xs border border-berget-border`}\n />\n ),\n // Real anchor, not Streamdown's default <button>: links must keep href\n // semantics (middle-click, new tab). Hardening attrs are added explicitly\n // since rehype-harden can only act on real anchors.\n a: ({ node: _node, ...props }) => (\n <a\n {...props}\n target=\"_blank\"\n rel=\"noopener noreferrer nofollow\"\n className={`text-berget-primary underline underline-offset-2`}\n />\n ),\n // Inline code only — fenced blocks are consumed by the `pre` override below.\n code: (props) => (\n <defaultComponents.code\n {...props}\n className={`\n rounded-berget-xs bg-muted px-1.5 py-0.5 font-mono text-[0.85em]\n `}\n />\n ),\n // Fenced / indented code: derive code + language from the child code\n // element and render with the package CodeBlock (highlighting included).\n pre: ({ children }) => {\n if (React.isValidElement(children)) {\n const { className, children: code } = children.props as {\n className?: string;\n children?: React.ReactNode;\n };\n const language = /language-([\\w+-]+)/.exec(className ?? '')?.[1] ?? 'text';\n return <MarkdownCodeBlock code={String(code ?? '')} language={language} />;\n }\n return <>{children}</>;\n },\n table: (props) => (\n <div\n className={`\n my-3 max-w-full overflow-x-auto rounded-berget-xs border\n border-berget-border\n `}\n >\n <table {...props} className={`w-full border-collapse text-sm`} />\n </div>\n ),\n thead: (props) => <defaultComponents.thead {...props} className={`bg-muted/50`} />,\n th: (props) => (\n <defaultComponents.th\n {...props}\n className={`\n border-b border-b-berget-border px-3 py-1.5 text-start font-semibold\n `}\n />\n ),\n td: (props) => (\n <defaultComponents.td {...props} className={`border-b border-b-berget-border px-3 py-1.5`} />\n ),\n};\n\ntype MarkdownProps = Omit<StreamdownProps, 'components' | 'plugins' | 'dir' | 'prefix'>;\nexport type { MarkdownProps };\n\nexport function Markdown({ className, ...props }: MarkdownProps) {\n return (\n <Streamdown\n {...props}\n dir=\"ltr\"\n components={bergetComponents}\n className={cn('text-caption/relaxed text-berget-foreground', className)}\n />\n );\n}\n\nMarkdown.displayName = 'Markdown';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,MAAM,mBAA+B;CACnC,KAAK,UAAU,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAoC,CAAA;CAC/F,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAsC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e;EACrB,IAAI,MAAM,eAAe,QAAQ,GAAG;GAClC,MAAM,EAAE,WAAW,UAAU,SAAS,SAAS;GAI/C,MAAM,WAAW,qBAAqB,KAAK,aAAa,EAAE,CAAC,GAAG,MAAM;GACpE,OAAO,oBAAC,mBAAD;IAAmB,MAAM,OAAO,QAAQ,EAAE;IAAa;GAAW,CAAA;EAC3E;EACA,OAAO,oBAAA,UAAA,EAAG,SAAW,CAAA;CACvB;CACA,QAAQ,UACN,oBAAC,OAAD;EACE,WAAW;;;;EAKX,UAAA,oBAAC,SAAD;GAAO,GAAI;GAAO,WAAW;EAAmC,CAAA;CAC7D,CAAA;CAEP,QAAQ,UAAU,oBAAC,kBAAkB,OAAnB;EAAyB,GAAI;EAAO,WAAW;CAAgB,CAAA;CACjF,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EACE,GAAI;EACJ,WAAW;;;CAGZ,CAAA;CAEH,KAAK,UACH,oBAAC,kBAAkB,IAAnB;EAAsB,GAAI;EAAO,WAAW;CAAgD,CAAA;AAEhG;AAKA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAAwB;CAC/D,OACE,oBAAC,YAAD;EACE,GAAI;EACJ,KAAI;EACJ,YAAY;EACZ,WAAW,GAAG,+CAA+C,SAAS;CACvE,CAAA;AAEL;AAEA,SAAS,cAAc"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bergetai/ui",
3
- "version": "0.23.0",
3
+ "version": "0.25.0",
4
4
  "description": "Berget Design System - Scandinavian-inspired design system with console aesthetic",
5
5
  "type": "module",
6
6
  "license": "MIT",