@ceed/cds 1.18.1-next.1 → 1.19.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.
package/dist/index.cjs CHANGED
@@ -54,7 +54,7 @@ function rehypeAccent(options) {
54
54
  const innerText = match[0].split("||")[1];
55
55
  newNodes.push({
56
56
  type: "element",
57
- tagName: "p",
57
+ tagName: "span",
58
58
  properties: { textColor: accentColor },
59
59
  children: [{ type: "text", value: innerText }]
60
60
  });
@@ -4955,15 +4955,83 @@ var Markdown = (props) => {
4955
4955
  rehypePlugins: [[rehypeAccent2, { accentColor }]],
4956
4956
  remarkPlugins: [import_remark_gfm.default],
4957
4957
  components: {
4958
- h1: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { color, textColor, level: "h1" }, children),
4959
- h2: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { color, textColor, level: "h2" }, children),
4960
- h3: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { color, textColor, level: "h3" }, children),
4961
- h4: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { color, textColor, level: "h4" }, children),
4962
- p: ({ children, node }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
4963
4958
  a: ({ children, href }) => /* @__PURE__ */ import_react36.default.createElement(import_joy47.Link, { href, target: defaultLinkAction }, children),
4964
- hr: () => /* @__PURE__ */ import_react36.default.createElement(Divider, null),
4965
- b: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
4966
- strong: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { fontWeight: boldFontWeight }, children),
4959
+ hr: () => /* @__PURE__ */ import_react36.default.createElement(Divider, { sx: { display: "block" } }),
4960
+ b: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
4961
+ strong: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
4962
+ // Table components
4963
+ table: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Sheet, { variant: "outlined", sx: { display: "block", borderRadius: "sm", overflow: "auto" } }, /* @__PURE__ */ import_react36.default.createElement(Table, { size: "sm" }, children)),
4964
+ // Code components
4965
+ code: ({ children, className }) => {
4966
+ const isBlock = className?.startsWith("language-");
4967
+ if (isBlock) {
4968
+ return /* @__PURE__ */ import_react36.default.createElement(
4969
+ Typography,
4970
+ {
4971
+ component: "code",
4972
+ sx: {
4973
+ display: "block",
4974
+ fontFamily: "monospace",
4975
+ fontSize: "0.875em",
4976
+ whiteSpace: "pre"
4977
+ }
4978
+ },
4979
+ children
4980
+ );
4981
+ }
4982
+ return /* @__PURE__ */ import_react36.default.createElement(
4983
+ Typography,
4984
+ {
4985
+ component: "code",
4986
+ sx: {
4987
+ fontFamily: "monospace",
4988
+ fontSize: "0.875em",
4989
+ bgcolor: "neutral.100",
4990
+ px: 0.5,
4991
+ borderRadius: "xs"
4992
+ }
4993
+ },
4994
+ children
4995
+ );
4996
+ },
4997
+ pre: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(
4998
+ Sheet,
4999
+ {
5000
+ variant: "soft",
5001
+ sx: {
5002
+ display: "block",
5003
+ p: 1.5,
5004
+ my: 1,
5005
+ borderRadius: "sm",
5006
+ overflow: "auto",
5007
+ whiteSpace: "pre"
5008
+ }
5009
+ },
5010
+ children
5011
+ ),
5012
+ // Task list checkbox
5013
+ input: ({ checked, type }) => {
5014
+ if (type === "checkbox") {
5015
+ return /* @__PURE__ */ import_react36.default.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
5016
+ }
5017
+ return /* @__PURE__ */ import_react36.default.createElement("input", { checked, type });
5018
+ },
5019
+ // Blockquote
5020
+ blockquote: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(
5021
+ Sheet,
5022
+ {
5023
+ variant: "soft",
5024
+ sx: { display: "block", borderLeft: 3, borderColor: "primary.500", pl: 2, py: 1, my: 1 }
5025
+ },
5026
+ children
5027
+ ),
5028
+ // Image
5029
+ img: ({ src, alt }) => /* @__PURE__ */ import_react36.default.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
5030
+ // Text style components
5031
+ em: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { component: "em", sx: { fontStyle: "italic" } }, children),
5032
+ del: ({ children }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { component: "del", sx: { textDecoration: "line-through" } }, children),
5033
+ // Span for accent color (from rehype-accent plugin)
5034
+ span: ({ children, node }) => /* @__PURE__ */ import_react36.default.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
4967
5035
  ...markdownOptions?.components
4968
5036
  }
4969
5037
  }
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ function rehypeAccent(options) {
33
33
  const innerText = match[0].split("||")[1];
34
34
  newNodes.push({
35
35
  type: "element",
36
- tagName: "p",
36
+ tagName: "span",
37
37
  properties: { textColor: accentColor },
38
38
  children: [{ type: "text", value: innerText }]
39
39
  });
@@ -4901,15 +4901,83 @@ var Markdown = (props) => {
4901
4901
  rehypePlugins: [[rehypeAccent2, { accentColor }]],
4902
4902
  remarkPlugins: [remarkGfm],
4903
4903
  components: {
4904
- h1: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h1" }, children),
4905
- h2: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h2" }, children),
4906
- h3: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h3" }, children),
4907
- h4: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: "h4" }, children),
4908
- p: ({ children, node }) => /* @__PURE__ */ React33.createElement(Typography, { color, textColor, level: defaultLevel, ...node?.properties }, children),
4909
4904
  a: ({ children, href }) => /* @__PURE__ */ React33.createElement(Link2, { href, target: defaultLinkAction }, children),
4910
- hr: () => /* @__PURE__ */ React33.createElement(Divider, null),
4911
- b: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { fontWeight: boldFontWeight }, children),
4912
- strong: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { fontWeight: boldFontWeight }, children),
4905
+ hr: () => /* @__PURE__ */ React33.createElement(Divider, { sx: { display: "block" } }),
4906
+ b: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
4907
+ strong: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { component: "strong", fontWeight: boldFontWeight || "lg" }, children),
4908
+ // Table components
4909
+ table: ({ children }) => /* @__PURE__ */ React33.createElement(Sheet, { variant: "outlined", sx: { display: "block", borderRadius: "sm", overflow: "auto" } }, /* @__PURE__ */ React33.createElement(Table, { size: "sm" }, children)),
4910
+ // Code components
4911
+ code: ({ children, className }) => {
4912
+ const isBlock = className?.startsWith("language-");
4913
+ if (isBlock) {
4914
+ return /* @__PURE__ */ React33.createElement(
4915
+ Typography,
4916
+ {
4917
+ component: "code",
4918
+ sx: {
4919
+ display: "block",
4920
+ fontFamily: "monospace",
4921
+ fontSize: "0.875em",
4922
+ whiteSpace: "pre"
4923
+ }
4924
+ },
4925
+ children
4926
+ );
4927
+ }
4928
+ return /* @__PURE__ */ React33.createElement(
4929
+ Typography,
4930
+ {
4931
+ component: "code",
4932
+ sx: {
4933
+ fontFamily: "monospace",
4934
+ fontSize: "0.875em",
4935
+ bgcolor: "neutral.100",
4936
+ px: 0.5,
4937
+ borderRadius: "xs"
4938
+ }
4939
+ },
4940
+ children
4941
+ );
4942
+ },
4943
+ pre: ({ children }) => /* @__PURE__ */ React33.createElement(
4944
+ Sheet,
4945
+ {
4946
+ variant: "soft",
4947
+ sx: {
4948
+ display: "block",
4949
+ p: 1.5,
4950
+ my: 1,
4951
+ borderRadius: "sm",
4952
+ overflow: "auto",
4953
+ whiteSpace: "pre"
4954
+ }
4955
+ },
4956
+ children
4957
+ ),
4958
+ // Task list checkbox
4959
+ input: ({ checked, type }) => {
4960
+ if (type === "checkbox") {
4961
+ return /* @__PURE__ */ React33.createElement(Checkbox, { checked, disabled: true, size: "sm", sx: { mr: 1 } });
4962
+ }
4963
+ return /* @__PURE__ */ React33.createElement("input", { checked, type });
4964
+ },
4965
+ // Blockquote
4966
+ blockquote: ({ children }) => /* @__PURE__ */ React33.createElement(
4967
+ Sheet,
4968
+ {
4969
+ variant: "soft",
4970
+ sx: { display: "block", borderLeft: 3, borderColor: "primary.500", pl: 2, py: 1, my: 1 }
4971
+ },
4972
+ children
4973
+ ),
4974
+ // Image
4975
+ img: ({ src, alt }) => /* @__PURE__ */ React33.createElement("img", { src, alt, style: { maxWidth: "100%", borderRadius: "4px" } }),
4976
+ // Text style components
4977
+ em: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { component: "em", sx: { fontStyle: "italic" } }, children),
4978
+ del: ({ children }) => /* @__PURE__ */ React33.createElement(Typography, { component: "del", sx: { textDecoration: "line-through" } }, children),
4979
+ // Span for accent color (from rehype-accent plugin)
4980
+ span: ({ children, node }) => /* @__PURE__ */ React33.createElement(Typography, { component: "span", textColor: node?.properties?.textColor }, children),
4913
4981
  ...markdownOptions?.components
4914
4982
  }
4915
4983
  }