devnonla-ui 0.13.0 → 0.15.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.
Files changed (86) hide show
  1. package/package.json +2 -2
  2. package/src/app/App.tsx +2 -2
  3. package/src/app/context.ts +1 -12
  4. package/src/avatar/avatar.css +107 -0
  5. package/src/blob-shape/BlobShape.tsx +337 -0
  6. package/src/button/Button.tsx +4 -4
  7. package/src/button/ButtonCopy.tsx +3 -3
  8. package/src/calendar/Calendar.tsx +1 -1
  9. package/src/card/Card.tsx +1 -1
  10. package/src/chat/AgentChatbox.tsx +1 -1
  11. package/src/chat/AgentPanel.tsx +1 -1
  12. package/src/chat/chatMessageList.tsx +5 -3
  13. package/src/chat/chatRhythm.ts +8 -0
  14. package/src/chat/common/createAgentSseSession.ts +9 -3
  15. package/src/chat/common/sse.ts +290 -122
  16. package/src/chat/common/useAgentStream.ts +1 -1
  17. package/src/chat/index.ts +2 -2
  18. package/src/chat/message-ui/ChatAgentMessage.tsx +4 -3
  19. package/src/chat/message-ui/ChatError.tsx +5 -4
  20. package/src/chat/message-ui/ChatInput.tsx +9 -8
  21. package/src/chat/message-ui/ChatMarkdown.tsx +36 -2
  22. package/src/chat/message-ui/ChatThinking.tsx +8 -7
  23. package/src/chat/message-ui/ChatUserMessage.tsx +5 -5
  24. package/src/chat/tool-ui/BackgroundTaskToolUI.tsx +7 -6
  25. package/src/chat/tool-ui/BackgroundTasksBar.tsx +9 -9
  26. package/src/chat/tool-ui/CallAgentToolUI.tsx +16 -15
  27. package/src/chat/tool-ui/ChatToolCall.tsx +13 -12
  28. package/src/chat/tool-ui/GetCurrentTimeToolUI.tsx +7 -6
  29. package/src/chat/tool-ui/ReadSkillToolUI.tsx +10 -9
  30. package/src/chat/tool-ui/RunJsToolUI.tsx +9 -8
  31. package/src/chat/tool-ui/ToolUiBadge.tsx +1 -1
  32. package/src/chat/tool-ui/ToolUiTrailing.tsx +3 -3
  33. package/src/chat/tool-ui/WebFetchToolUI.tsx +10 -9
  34. package/src/checkbox/Checkbox.tsx +2 -2
  35. package/src/codeblock/CodeBlock.tsx +1 -1
  36. package/src/colorpicker/ColorPicker.tsx +10 -8
  37. package/src/datepicker/DatePicker.tsx +3 -3
  38. package/src/desktop/DesktopHeader.tsx +2 -2
  39. package/src/desktop/DesktopIcon.tsx +3 -4
  40. package/src/desktop/DesktopStage.tsx +1 -1
  41. package/src/desktop/DesktopWindow.tsx +3 -3
  42. package/src/desktop/MeadowDesktop.tsx +2 -2
  43. package/src/drawer/Drawer.tsx +6 -2
  44. package/src/dropdown/menuClasses.ts +1 -1
  45. package/src/empty/Empty.tsx +1 -1
  46. package/src/form/variants/FieldRadio.tsx +1 -1
  47. package/src/form/variants/FieldRepeaterItem.tsx +1 -1
  48. package/src/icon/Icon.tsx +21 -0
  49. package/src/icon/glyphs.ts +35 -0
  50. package/src/index.ts +9 -23
  51. package/src/input/EditableInput.tsx +5 -4
  52. package/src/input/Input.tsx +15 -7
  53. package/src/lib/sizes.ts +6 -6
  54. package/src/lib/surface.ts +14 -4
  55. package/src/markdown-editor/MarkdownDiff.tsx +4 -4
  56. package/src/markdown-editor/MarkdownEditor.tsx +4 -4
  57. package/src/markdown-editor/MarkdownPreview.tsx +6 -6
  58. package/src/markdown-editor/MarkdownSource.tsx +1 -1
  59. package/src/markdown-editor/MarkdownTable.tsx +48 -11
  60. package/src/markdown-editor/MarkdownViewer.tsx +28 -31
  61. package/src/markdown-editor/MermaidBlock.tsx +5 -5
  62. package/src/markdown-editor/ReactCodeFrame.tsx +10 -6
  63. package/src/markdown-editor/ReactCodeSandbox.tsx +2 -2
  64. package/src/markdown-editor/markdownScale.ts +66 -127
  65. package/src/menu/Menu.tsx +3 -3
  66. package/src/message/message.tsx +18 -8
  67. package/src/modal/Modal.tsx +13 -7
  68. package/src/pagination/Pagination.tsx +7 -7
  69. package/src/popover/Popover.tsx +1 -1
  70. package/src/scroll/OverlayScroll.tsx +13 -5
  71. package/src/segmented/Segmented.tsx +1 -1
  72. package/src/select/Select.tsx +4 -4
  73. package/src/sidebar/Sidebar.tsx +39 -36
  74. package/src/skeleton/Skeleton.tsx +4 -4
  75. package/src/spin/Spin.tsx +14 -2
  76. package/src/splitter/Splitter.tsx +1 -1
  77. package/src/styles.css +188 -844
  78. package/src/table/Table.tsx +12 -12
  79. package/src/tabs/Tabs.tsx +76 -14
  80. package/src/tag/Tag.tsx +3 -3
  81. package/src/theme-switcher/ThemeSwitcher.tsx +6 -6
  82. package/src/theme.ts +53 -147
  83. package/src/timepicker/TimePicker.tsx +2 -2
  84. package/src/typography/Typography.tsx +8 -8
  85. package/src/icon/SolarIcon.tsx +0 -39
  86. package/src/icon/solar.ts +0 -172
@@ -2,7 +2,7 @@ import { type MouseEvent, useLayoutEffect, useRef } from "react";
2
2
  import { cn } from "../lib/cn";
3
3
  import { OverlayScroll } from "../scroll/OverlayScroll";
4
4
  import { type MarkdownDoc, readInlineEdit, writeInlineEdit } from "./blocks";
5
- import { BlockBody, headingClass, ListItem, markdownVariantStyle, spaceBefore } from "./MarkdownViewer";
5
+ import { BlockBody, headingClass, ListItem, markdownScaleStyle, spaceBefore } from "./MarkdownViewer";
6
6
 
7
7
  function BlockEditor({ value, mono, className, caret = "end", onChange, onBlur, onEnter }: { value: string; mono?: boolean; className?: string; caret?: "start" | "end"; onChange: (value: string) => void; onBlur: () => void; onEnter?: (before: string, after: string) => void }) {
8
8
  const ref = useRef<HTMLTextAreaElement>(null);
@@ -57,8 +57,8 @@ function BlockEditor({ value, mono, className, caret = "end", onChange, onBlur,
57
57
  });
58
58
  }}
59
59
  className={cn(
60
- "block w-full resize-none overflow-hidden border-0 bg-transparent p-0 text-(length:--md-body-size,16px) leading-(--md-body-leading,24px) text-(--md-ink) shadow-none outline-none ring-0 placeholder:text-placeholder focus:outline-none focus:ring-0",
61
- mono && "font-mono text-[13px] leading-5",
60
+ "block w-full resize-none overflow-hidden border-0 bg-transparent p-0 text-(length:--md-body-size,var(--nonla-md-text-size,16px)) leading-(--md-body-leading,calc(var(--nonla-md-text-size,16px)*1.6)) text-foreground shadow-none outline-none ring-0 placeholder:text-quaternary-foreground focus:outline-none focus:ring-0",
61
+ mono && "font-mono text-(length:--md-code-size,var(--nonla-mono-text-size)) leading-(--md-code-leading,calc(var(--nonla-mono-text-size)*1.6))",
62
62
  className,
63
63
  )}
64
64
  aria-label="Edit markdown"
@@ -88,7 +88,7 @@ export type MarkdownPreviewProps = {
88
88
  export function MarkdownPreview({ doc, editingIndex, readOnly, placeholder = "Write markdown…", onStartEdit, onEditMouseDown, onChangeBody, onBlurBlock, onEnterList, caret = "end", onAppend }: MarkdownPreviewProps) {
89
89
  return (
90
90
  <OverlayScroll className="h-full bg-card">
91
- <div className="mx-auto flex w-full max-w-3xl flex-col px-8 py-6" style={markdownVariantStyle("docs")}>
91
+ <div className="mx-auto flex w-full max-w-3xl flex-col px-8 py-6" style={markdownScaleStyle}>
92
92
  {doc.blocks.map((block, index) => {
93
93
  const editing = editingIndex === index;
94
94
  const locked = block.kind === "mermaid" || readOnly;
@@ -142,9 +142,9 @@ export function MarkdownPreview({ doc, editingIndex, readOnly, placeholder = "Wr
142
142
  );
143
143
  })}
144
144
  {readOnly ? (
145
- doc.blocks.length === 0 ? <p className="m-0 text-sm text-placeholder">{placeholder}</p> : null
145
+ doc.blocks.length === 0 ? <p className="m-0 text-sm text-quaternary-foreground">{placeholder}</p> : null
146
146
  ) : (
147
- <button type="button" className="mt-3 min-h-16 text-left text-sm text-placeholder" onClick={onAppend} aria-label="Add paragraph">
147
+ <button type="button" className="mt-3 min-h-16 text-left text-sm text-quaternary-foreground" onClick={onAppend} aria-label="Add paragraph">
148
148
  {doc.blocks.length === 0 ? placeholder : ""}
149
149
  </button>
150
150
  )}
@@ -63,7 +63,7 @@ export function MarkdownSource({ value, onChange, readOnly, placeholder = "Write
63
63
  setCursor(pos);
64
64
  });
65
65
  }}
66
- className="relative z-10 block w-full resize-none overflow-hidden bg-transparent py-2 pr-4 font-mono text-[13px] leading-5 text-foreground outline-none placeholder:text-placeholder"
66
+ className="relative z-10 block w-full resize-none overflow-hidden bg-transparent py-2 pr-4 font-mono text-[13px] leading-5 text-foreground outline-none placeholder:text-quaternary-foreground"
67
67
  style={{ height: Math.max(lines.length, 1) * LINE + PAD * 2 }}
68
68
  />
69
69
  </div>
@@ -1,5 +1,8 @@
1
1
  import { type ReactNode, useCallback, useRef } from "react";
2
+ import { Button } from "../button/Button";
2
3
  import { ButtonCopy } from "../button/ButtonCopy";
4
+ import { Icon } from "../icon/Icon";
5
+ import { OverlayScroll } from "../scroll/OverlayScroll";
3
6
 
4
7
  function escapeCell(text: string): string {
5
8
  return text.replace(/\|/g, "\\|").replace(/\n+/g, "").trim();
@@ -20,26 +23,60 @@ function tableToMarkdown(table: HTMLTableElement): string {
20
23
  return [`| ${header.join(" | ")} |`, `| ${separator.join(" | ")} |`, ...body.map((row) => `| ${row.join(" | ")} |`)].join("\n");
21
24
  }
22
25
 
26
+ const tableClass =
27
+ "w-max min-w-full border-separate border-spacing-0 text-base [&_th]:whitespace-normal [&_td]:whitespace-normal [&_th]:wrap-normal [&_td]:wrap-normal [&_th]:border-b [&_th]:border-border-secondary [&_th]:px-4 [&_th]:py-1.5 [&_th]:text-left [&_th]:align-top [&_th]:font-medium [&_td]:border-b [&_td]:border-border-secondary [&_td]:px-4 [&_td]:py-1.5 [&_td]:align-top";
28
+
23
29
  export function MarkdownTable({ children }: { children: ReactNode }) {
24
30
  const tableRef = useRef<HTMLTableElement>(null);
31
+ const dialogRef = useRef<HTMLDialogElement>(null);
25
32
 
26
33
  const getText = useCallback(() => {
27
34
  const table = tableRef.current;
28
35
  return table ? tableToMarkdown(table) : "";
29
36
  }, []);
30
37
 
38
+ const openFullscreen = () => {
39
+ dialogRef.current?.showModal();
40
+ };
41
+
42
+ const closeFullscreen = () => {
43
+ dialogRef.current?.close();
44
+ };
45
+
31
46
  return (
32
- <div className="relative my-(--md-table-my,16px) max-w-full overflow-hidden rounded-xl border border-border bg-card group">
33
- <ButtonCopy getText={getText} label="Copy as Markdown" className="absolute top-1 right-1 z-10 opacity-0 group-hover:opacity-100" />
34
-
35
- <div className="overflow-x-auto">
36
- <table
37
- ref={tableRef}
38
- className="w-max min-w-full border-separate border-spacing-0 text-(length:--md-table-size,15px) [&_th]:max-w-[360px] [&_td]:max-w-[360px] [&_th]:whitespace-normal [&_td]:whitespace-normal [&_th]:wrap-normal [&_td]:wrap-normal [&_th]:bg-(--nonla-table-head) [&_th]:font-semibold [&_th]:px-2.5 [&_th]:py-1.5 [&_th]:text-left [&_th]:align-top [&_th]:border-r [&_th]:border-b [&_th]:border-border [&_th:last-child]:border-r-0 [&_td]:px-2.5 [&_td]:py-1.5 [&_td]:align-top [&_td]:bg-card [&_td]:border-r [&_td]:border-b [&_td]:border-border [&_td:last-child]:border-r-0 [&_tbody_tr:last-child_td]:border-b-0"
39
- >
40
- {children}
41
- </table>
47
+ <>
48
+ <div className="group relative my-(--md-table-my,16px) max-w-full">
49
+ <div className="absolute top-1 right-1 z-10 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100">
50
+ <ButtonCopy getText={getText} label="Copy as Markdown" />
51
+ <Button size="small" icon={<Icon name="maximize" size={12} />} title="Fullscreen" aria-label="Fullscreen" onClick={openFullscreen} />
52
+ </div>
53
+
54
+ <OverlayScroll autoHeight visibility="hover" scope="table" innerClassName="overflow-x-auto">
55
+ <table ref={tableRef} className={`${tableClass} [&_th]:max-w-[360px] [&_td]:max-w-[360px] [&_th:first-child]:pl-0 [&_th:last-child]:pr-0 [&_td:first-child]:pl-0 [&_td:last-child]:pr-0`}>
56
+ {children}
57
+ </table>
58
+ </OverlayScroll>
42
59
  </div>
43
- </div>
60
+
61
+ <dialog
62
+ ref={dialogRef}
63
+ className="inset-2.5 m-0 h-auto w-auto max-h-none max-w-none overflow-hidden rounded-xl border border-foreground/25 bg-card p-0 shadow-xl backdrop:bg-black/40 open:flex open:flex-col"
64
+ onKeyDown={(e) => {
65
+ if (e.key !== "Escape") return;
66
+ e.preventDefault();
67
+ e.stopPropagation();
68
+ closeFullscreen();
69
+ }}
70
+ >
71
+ <div className="absolute top-5 right-5 z-50 flex items-center gap-1.5">
72
+ <ButtonCopy getText={getText} label="Copy as Markdown" />
73
+ <Button size="small" icon={<Icon name="minimize" size={12} />} title="Exit fullscreen" aria-label="Exit fullscreen" onClick={closeFullscreen} />
74
+ </div>
75
+
76
+ <div className="min-h-0 flex-1 overflow-auto p-8">
77
+ <table className={tableClass}>{children}</table>
78
+ </div>
79
+ </dialog>
80
+ </>
44
81
  );
45
82
  }
@@ -1,4 +1,4 @@
1
- import { type ReactNode, useMemo } from "react";
1
+ import { type CSSProperties, type ReactNode, useMemo } from "react";
2
2
  import ReactMarkdown, { type Components } from "react-markdown";
3
3
  import remarkGfm from "remark-gfm";
4
4
  import { Checkbox } from "../checkbox/Checkbox";
@@ -7,37 +7,35 @@ import { cn } from "../lib/cn";
7
7
  import { type InlineEdit, type MarkdownBlock, parseMarkdownDoc, readFence, readInlineEdit } from "./blocks";
8
8
  import { MarkdownTable } from "./MarkdownTable";
9
9
  import { MermaidBlock } from "./MermaidBlock";
10
- import { headingClass, type MarkdownVariant, markdownVariantStyle } from "./markdownScale";
10
+ import { headingClass, markdownScaleStyle } from "./markdownScale";
11
11
  import { ReactCode } from "./ReactCode";
12
12
  import { ReactCodeSandbox } from "./ReactCodeSandbox";
13
13
 
14
- export type { MarkdownVariant };
15
- export { headingClass, markdownVariantStyle };
14
+ export { headingClass, markdownScaleStyle };
16
15
 
17
16
  /** Task checks use the body ink, so a checked box sits with the text instead of the brand fill. */
18
17
  const taskCheckClass =
19
- "data-[state=checked]:border-(--md-ink)! data-[state=checked]:bg-(--md-ink)! data-[state=checked]:text-background! data-[state=indeterminate]:border-(--md-ink)! data-[state=indeterminate]:bg-(--md-ink)! data-[state=indeterminate]:text-background!";
18
+ "data-[state=checked]:border-foreground! data-[state=checked]:bg-foreground! data-[state=checked]:text-background! data-[state=indeterminate]:border-foreground! data-[state=indeterminate]:bg-foreground! data-[state=indeterminate]:text-background!";
20
19
 
21
20
  const documentClass = cn(
22
- "min-w-0 wrap-anywhere text-(length:--md-body-size,16px) leading-(--md-body-leading,24px) text-(--md-ink)",
23
- "[&_:is(h1,h2,h3,h4,h5,h6)]:text-(--md-heading)",
24
- "[&_:is(h1,h2)]:mt-(--md-h2-mt,24px) [&_h1]:mb-(--md-h1-mb,12px) [&_h2]:mb-(--md-h2-mb,1px) [&_:is(h1,h2)]:pt-(--md-h2-py,3px) [&_:is(h1,h2)]:pb-(--md-h2-py,3px) [&_:is(h1,h2)]:text-(length:--md-h2-size,30px) [&_:is(h1,h2)]:leading-(--md-h2-leading,40px) [&_:is(h1,h2)]:font-(--md-h2-weight,600) [&_:is(h1,h2)]:tracking-normal",
25
- "[&_h3]:mt-(--md-h3-mt,22px) [&_h3]:mb-(--md-h3-mb,1px) [&_h3]:text-(length:--md-h3-size,24px) [&_h3]:leading-(--md-h3-leading,32px) [&_h3]:font-(--md-h3-weight,700)",
26
- "[&_h4]:mt-(--md-h4-mt,16px) [&_h4]:mb-(--md-h4-mb,1px) [&_h4]:text-(length:--md-h4-size,20px) [&_h4]:leading-(--md-h4-leading,26px) [&_h4]:font-(--md-h4-weight,700)",
27
- "[&_h5]:mt-(--md-h5-mt,0px) [&_h5]:mb-(--md-h5-mb,0px) [&_h5]:text-(length:--md-h5-size,16px) [&_h5]:leading-(--md-h5-leading,1.375) [&_h5]:font-(--md-h5-weight,700)",
28
- "[&_h6]:mt-(--md-h6-mt,0px) [&_h6]:mb-(--md-h6-mb,0px) [&_h6]:text-(length:--md-h6-size,14px) [&_h6]:leading-(--md-h6-leading,1.375) [&_h6]:font-(--md-h6-weight,700)",
29
- "[&_p]:my-(--md-p-my,1px) [&_p]:py-(--md-p-py,4px) [&_p]:leading-(--md-p-leading,1.5)",
21
+ "min-w-0 wrap-anywhere text-(length:--md-body-size,var(--nonla-md-text-size,16px)) leading-(--md-body-leading,calc(var(--nonla-md-text-size,16px)*1.6)) text-foreground",
22
+ "[&_:is(h1,h2,h3,h4,h5,h6)]:text-foreground",
23
+ "[&_:is(h1,h2)]:mt-(--md-h2-mt,24px) [&_h1]:mb-(--md-h1-mb,12px) [&_h2]:mb-(--md-h2-mb,8px) [&_:is(h1,h2)]:pt-(--md-h2-py,3px) [&_:is(h1,h2)]:pb-(--md-h2-py,3px) [&_:is(h1,h2)]:text-(length:--md-h2-size,26px) [&_:is(h1,h2)]:leading-(--md-h2-leading,32px) [&_:is(h1,h2)]:font-(--md-h2-weight,600) [&_:is(h1,h2)]:tracking-normal",
24
+ "[&_h3]:mt-(--md-h3-mt,22px) [&_h3]:mb-(--md-h3-mb,8px) [&_h3]:text-(length:--md-h3-size,24px) [&_h3]:leading-(--md-h3-leading,32px) [&_h3]:font-(--md-h3-weight,600)",
25
+ "[&_:is(h4,h5,h6)]:mt-(--md-h4-mt,16px) [&_:is(h4,h5,h6)]:mb-(--md-h4-mb,1px) [&_:is(h4,h5,h6)]:text-(length:--md-h4-size,20px) [&_:is(h4,h5,h6)]:leading-(--md-h4-leading,26px) [&_:is(h4,h5,h6)]:font-(--md-h4-weight,700)",
26
+ "[&_p]:my-(--md-p-my,1px) [&_p]:py-(--md-p-py,4px) [&_p]:leading-(--md-p-leading,1.6)",
30
27
  "[&_ul]:my-(--md-list-my,8px) [&_ul]:list-disc [&_ul]:pl-(--md-ul-pl,4px)",
31
28
  "[&_ol]:my-(--md-list-my,8px) [&_ol]:list-decimal [&_ol]:pl-(--md-ol-pl,4px)",
32
29
  "[&_li>ul]:mt-1 [&_li>ol]:mt-1 [&_li>ol]:pl-(--md-nest,1.25rem)",
33
30
  "[&_th_ul]:my-0 [&_td_ul]:my-0 [&_th_ol]:my-0 [&_td_ol]:my-0 [&_th_li]:mt-0 [&_td_li]:mt-0 [&_th_li>ul]:mt-0.5 [&_td_li>ul]:mt-0.5 [&_th_li>ol]:mt-0.5 [&_td_li>ol]:mt-0.5 [&_th_li>p]:my-0 [&_td_li>p]:my-0",
34
31
  "[&_ul.contains-task-list]:list-none",
35
- "[&_li]:mt-(--md-li-mt,4px) [&_li]:leading-[1.5]",
32
+ "[&_li]:mt-(--md-li-mt,4px) [&_li]:leading-[1.6]",
36
33
  "[&_li.task-list-item]:relative",
37
34
  "[&_li.task-list-item>.nonla-md-task-check]:absolute [&_li.task-list-item>.nonla-md-task-check]:top-1 [&_li.task-list-item>.nonla-md-task-check]:-left-5",
38
- "[&_blockquote]:my-(--md-quote-my,4px) [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-muted-foreground",
35
+ /* Body paragraphs sit in separate blocks, so their margins do not collapse. Quote paragraphs share one block, so the next paragraph's top margin is doubled to land on that same gap. */
36
+ "[&_blockquote]:my-(--md-quote-my,0px) [&_blockquote>p:not(:first-child)]:mt-[calc(var(--md-p-my,1px)*2)] [&_blockquote>p:not(:last-child)]:mb-0 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-3 [&_blockquote]:text-foreground",
39
37
  "[&_a]:text-link [&_a]:underline-offset-[3px] hover:[&_a]:underline",
40
- "[&_hr]:my-(--md-rule-my,8px) [&_hr]:border-border",
38
+ "[&_hr]:hidden",
41
39
  "[&_strong]:font-(--md-strong-weight,600)",
42
40
  "[&_img]:my-(--md-img-my,4px) [&_img]:max-w-full [&_img]:rounded-lg",
43
41
  );
@@ -49,7 +47,7 @@ const previewComponents: Components = {
49
47
  const codeText = String(children).replace(/\n$/, "");
50
48
  const isBlock = codeText.includes("\n") || !!match;
51
49
  if (!isBlock) {
52
- return <code className="nonla-inline-code">{children}</code>;
50
+ return <code className="nonla-inline-code rounded-[4px] bg-muted px-[2px] py-px align-baseline font-mono text-(length:--md-inline-size,var(--nonla-mono-text-size)) leading-none whitespace-nowrap [box-decoration-break:clone] [-webkit-box-decoration-break:clone]">{children}</code>;
53
51
  }
54
52
  if (lang.toLowerCase() === "mermaid") return <MermaidView code={codeText} />;
55
53
  return <CodeBlock code={codeText} language={lang || undefined} className="my-(--md-code-my,8px)" />;
@@ -67,7 +65,7 @@ const previewComponents: Components = {
67
65
  input({ type, checked }) {
68
66
  if (type !== "checkbox") return <input type={type} checked={checked} readOnly />;
69
67
  return (
70
- <span className="nonla-md-task-check pointer-events-none inline-flex h-(--md-body-leading,24px) items-center">
68
+ <span className="nonla-md-task-check pointer-events-none inline-flex h-(--md-body-leading,calc(var(--nonla-md-text-size,16px)*1.6)) items-center">
71
69
  <Checkbox checked={Boolean(checked)} tabIndex={-1} className={taskCheckClass} />
72
70
  </span>
73
71
  );
@@ -137,7 +135,7 @@ function RichText({ source }: { source: string }) {
137
135
  export function ListItem({ view, children }: { view: Extract<InlineEdit, { kind: "list" }>; children: ReactNode }) {
138
136
  const level = Math.floor(view.indent.length / 2);
139
137
  const ordinal = Number(/^(\d+)/.exec(view.marker)?.[1] ?? "1");
140
- const marker = "w-6 shrink-0 pt-0.5 text-(length:--md-body-size,16px) leading-(--md-p-leading,1.5)";
138
+ const marker = "w-6 shrink-0 pt-0.5 text-(length:--md-body-size,var(--nonla-md-text-size,16px)) leading-(--md-p-leading,1.6)";
141
139
  return (
142
140
  <div className="flex items-start gap-1.5 pl-(--md-item-pl,4px)" style={level > 0 ? { marginLeft: `calc(${level} * var(--md-nest, 1.25rem))` } : undefined}>
143
141
  {view.task ? (
@@ -162,14 +160,13 @@ function isListBlock(block: MarkdownBlock): boolean {
162
160
  return block.kind === "text" && readInlineEdit(block.body).kind === "list";
163
161
  }
164
162
 
165
- export function spaceBefore(block: MarkdownBlock, prev?: MarkdownBlock, variant: MarkdownVariant = "docs"): string {
166
- const chat = variant === "chat";
163
+ export function spaceBefore(block: MarkdownBlock, prev?: MarkdownBlock): string {
167
164
  if (!prev) return "";
168
- if (isListBlock(block) && isListBlock(prev)) return chat ? "mt-px" : "mt-0.5";
169
- if (prev.kind === "text" && readInlineEdit(prev.body).kind === "heading") return "[&_p]:mt-0! [&_p]:pt-0.5!";
170
- if (isListBlock(block) && prev.kind === "text") return chat ? "mt-0.5" : "mt-1";
165
+ if (isListBlock(block) && isListBlock(prev)) return "mt-0.5";
166
+ if (prev.kind === "text" && readInlineEdit(prev.body).kind === "heading") return "[&_p:first-child]:mt-0! [&_p:first-child]:pt-0.5!";
167
+ if (isListBlock(block) && prev.kind === "text") return "mt-1";
171
168
  if (block.kind === "text" && prev.kind === "text") return "";
172
- return chat ? "mt-2" : "mt-3";
169
+ return "mt-3";
173
170
  }
174
171
 
175
172
  function fenceClosed(body: string): boolean {
@@ -235,24 +232,24 @@ export type MarkdownViewerProps = {
235
232
  showHeader?: boolean;
236
233
  /** Switch that opens the source of a `live-react` preview. Needs `showHeader`. Default `true`. */
237
234
  showCode?: boolean;
238
- /** `docs` is the article scale. `chat` tightens size and spacing for a thread. Default `docs`. */
239
- variant?: MarkdownVariant;
235
+ /** Overrides scale variables from `markdownScaleStyle`, such as heading size. */
236
+ style?: CSSProperties;
240
237
  };
241
238
 
242
239
  /** Read-only markdown. Same blocks as the editor preview, without editing. */
243
- export function MarkdownViewer({ value = "", streaming = false, sandboxSrc, trustedModules, showHeader = true, showCode = true, placeholder, className, variant = "docs" }: MarkdownViewerProps) {
240
+ export function MarkdownViewer({ value = "", streaming = false, sandboxSrc, trustedModules, showHeader = true, showCode = true, placeholder, className, style }: MarkdownViewerProps) {
244
241
  const doc = useMemo(() => parseMarkdownDoc(value), [value]);
245
242
  if (doc.blocks.length === 0) {
246
- return placeholder ? <p className={cn("m-0 text-sm text-placeholder", className)}>{placeholder}</p> : null;
243
+ return placeholder ? <p className={cn("m-0 text-sm text-quaternary-foreground", className)}>{placeholder}</p> : null;
247
244
  }
248
245
  return (
249
- <div data-variant={variant} className={cn("nonla-markdown-viewer flex min-w-0 flex-col text-(--md-ink)", variant === "chat" && "[&>[data-md-block]:first-child_:is(h1,h2,h3,h4,h5,h6)]:mt-0", className)} style={markdownVariantStyle(variant)}>
246
+ <div className={cn("nonla-markdown-viewer flex min-w-0 flex-col text-foreground", className)} style={{ ...markdownScaleStyle, ...style }}>
250
247
  {doc.blocks.map((block, index) => (
251
248
  <div
252
249
  // biome-ignore lint/suspicious/noArrayIndexKey: block position is the document identity
253
250
  key={`${index}:${block.kind}`}
254
251
  data-md-block={block.kind}
255
- className={cn("outline-none", spaceBefore(block, doc.blocks[index - 1], variant))}
252
+ className={cn("outline-none", spaceBefore(block, doc.blocks[index - 1]))}
256
253
  >
257
254
  <BlockBody block={block} streaming={streaming} trustedModules={trustedModules} sandboxSrc={sandboxSrc} showHeader={showHeader} showCode={showCode} />
258
255
  </div>
@@ -1,7 +1,7 @@
1
1
  import { useCallback, useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
2
2
  import { Button } from "../button/Button";
3
3
  import { CodeBlock } from "../codeblock/CodeBlock";
4
- import { SolarIcon } from "../icon/SolarIcon";
4
+ import { Icon } from "../icon/Icon";
5
5
  import { cn } from "../lib/cn";
6
6
  import { getColorMode, subscribeColorMode } from "../theme";
7
7
  import { sanitizeMermaid } from "./sanitizeMermaid";
@@ -176,7 +176,7 @@ export function MermaidBlock({ children, className }: MermaidBlockProps) {
176
176
 
177
177
  if (error) {
178
178
  return (
179
- <div className={cn("my-3 rounded-lg bg-accent border border-destructive/30 p-4 text-xs text-destructive", className)}>
179
+ <div className={cn("my-3 rounded-lg bg-brand/14 border border-destructive/30 p-4 text-xs text-destructive", className)}>
180
180
  <p className="font-medium mb-1">Mermaid render error</p>
181
181
  <pre className="whitespace-pre-wrap text-[11px] opacity-70">{error}</pre>
182
182
  </div>
@@ -191,7 +191,7 @@ export function MermaidBlock({ children, className }: MermaidBlockProps) {
191
191
  <>
192
192
  <div className={cn("my-3 last:mb-0 group relative overflow-hidden rounded-xl bg-card", className)}>
193
193
  <div className="absolute top-2 right-2 z-10 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
194
- <Button size="small" icon={<SolarIcon name="maximize-linear" size={12} />} title="Fullscreen" aria-label="Fullscreen" onClick={openFullscreen} />
194
+ <Button size="small" icon={<Icon name="maximize" size={12} />} title="Fullscreen" aria-label="Fullscreen" onClick={openFullscreen} />
195
195
  </div>
196
196
  <div ref={containerRef} className="flex justify-center p-6 overflow-x-auto [&_svg]:max-w-full" />
197
197
  </div>
@@ -208,8 +208,8 @@ export function MermaidBlock({ children, className }: MermaidBlockProps) {
208
208
  }}
209
209
  >
210
210
  <div className="absolute top-5 right-5 z-50 flex items-center gap-1.5">
211
- <Button size="small" icon={<SolarIcon name="download-linear" size={12} />} title="Download SVG" aria-label="Download SVG" onClick={downloadSvg} disabled={!svgContent} />
212
- <Button size="small" icon={<SolarIcon name="minimize-linear" size={12} />} title="Exit fullscreen" onClick={closeFullscreen}>
211
+ <Button size="small" icon={<Icon name="download" size={12} />} title="Download SVG" aria-label="Download SVG" onClick={downloadSvg} disabled={!svgContent} />
212
+ <Button size="small" icon={<Icon name="minimize" size={12} />} title="Exit fullscreen" onClick={closeFullscreen}>
213
213
  Exit
214
214
  </Button>
215
215
  </div>
@@ -1,6 +1,6 @@
1
1
  import { type ReactNode, useState } from "react";
2
2
  import { CodeBlock } from "../codeblock/CodeBlock";
3
- import { SolarIcon } from "../icon/SolarIcon";
3
+ import { Icon } from "../icon/Icon";
4
4
  import { cn } from "../lib/cn";
5
5
  import { Segmented } from "../segmented/Segmented";
6
6
  import { Tooltip } from "../tooltip/Tooltip";
@@ -46,8 +46,8 @@ export function ReactCodeFrame({ title, icon, showHeader = true, code, className
46
46
  {hasCode ? <Segmented<Tab> size="small" options={TABS} value={tab} onChange={setTab} /> : null}
47
47
  </div>
48
48
  ) : null}
49
- {/* Stays mounted on the Code view, so an iframe keeps its state. */}
50
- <div className={cn("min-w-0 px-6 py-8", showingCode && "hidden")}>{children}</div>
49
+ {/* Stays mounted when the Code tab replaces it, so an iframe keeps its state. The code button keeps this and opens the source under it. */}
50
+ <div className={cn("min-w-0 px-6 py-8", hasLabel && showingCode && "hidden")}>{children}</div>
51
51
  {hasCode && !hasLabel ? (
52
52
  <div className="flex h-10 items-center justify-end border-t border-border pr-1.5">
53
53
  <Tooltip title={codeLabel}>
@@ -56,17 +56,21 @@ export function ReactCodeFrame({ title, icon, showHeader = true, code, className
56
56
  aria-expanded={open}
57
57
  aria-label={codeLabel}
58
58
  className={cn(
59
- "inline-flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
59
+ "inline-flex size-7 cursor-pointer items-center justify-center rounded-md transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand/55",
60
60
  open ? "bg-muted text-foreground" : "text-muted-foreground",
61
61
  )}
62
62
  onClick={() => setOpen((value) => !value)}
63
63
  >
64
- <SolarIcon name="code-square-linear" size={16} />
64
+ <Icon name="code" size={16} />
65
65
  </button>
66
66
  </Tooltip>
67
67
  </div>
68
68
  ) : null}
69
- {hasCode && showingCode ? <CodeBlock code={code} language="tsx" className="my-0 rounded-none border-0" /> : null}
69
+ {hasCode && showingCode ? (
70
+ <div className={cn(!hasLabel && "border-t border-border")}>
71
+ <CodeBlock code={code} language="tsx" className="my-0 rounded-none border-0" />
72
+ </div>
73
+ ) : null}
70
74
  </div>
71
75
  );
72
76
  }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode, useEffect, useMemo, useRef, useState } from "react";
2
- import { SolarIcon } from "../icon/SolarIcon";
2
+ import { Icon } from "../icon/Icon";
3
3
  import { cn } from "../lib/cn";
4
4
  import { getColorMode, type NonlaColorMode, subscribeColorMode } from "../theme";
5
5
  import { ReactCodeFrame } from "./ReactCodeFrame";
@@ -136,7 +136,7 @@ export function ReactCodeSandbox({ code, src, showHeader = true, showCode = true
136
136
  return (
137
137
  <ReactCodeFrame
138
138
  title={title}
139
- icon={icon === undefined ? <SolarIcon name="shield-check-linear" size={16} className="text-success" /> : icon}
139
+ icon={icon === undefined ? <Icon name="shield-check" size={16} className="text-success" /> : icon}
140
140
  showHeader={showHeader}
141
141
  code={showCode ? code : undefined}
142
142
  className={className}
@@ -1,144 +1,83 @@
1
1
  import type { CSSProperties } from "react";
2
2
 
3
- /** `docs` is the article scale. `chat` is the tighter thread scale. */
4
- export type MarkdownVariant = "docs" | "chat";
5
-
6
3
  /**
7
- * Size and spacing for each scale. Class fallbacks match `docs`, so the editor
8
- * preview stays on the article scale when no preset is set.
9
- * Docs body is 16px. Chat body and h1–h3 are 15px. Inline code is 14px on docs, 13px in chat.
4
+ * One markdown scale. Body reads `text-md` (`--nonla-md-text-size`). Leading is 1.6.
5
+ * Tables always use `text-base`.
6
+ * Inline code and fenced code read `--nonla-mono-text-size`.
7
+ * Class fallbacks match these values when the variables are not set.
10
8
  */
11
- const MARKDOWN_PRESETS = {
12
- docs: {
13
- "--md-body-size": "16px",
14
- "--md-body-leading": "24px",
15
- "--md-h1-size": "32px",
16
- "--md-h1-leading": "1.25",
17
- "--md-h1-weight": "800",
18
- "--md-h1-mt": "0px",
19
- "--md-h1-mb": "12px",
20
- "--md-h1-py": "3px",
21
- "--md-h2-size": "30px",
22
- "--md-h2-leading": "40px",
23
- "--md-h2-weight": "600",
24
- "--md-h2-mt": "24px",
25
- "--md-h2-mb": "1px",
26
- "--md-h2-py": "3px",
27
- "--md-h3-size": "24px",
28
- "--md-h3-leading": "32px",
29
- "--md-h3-weight": "700",
30
- "--md-h3-mt": "22px",
31
- "--md-h3-mb": "1px",
32
- "--md-h4-size": "20px",
33
- "--md-h4-leading": "26px",
34
- "--md-h4-weight": "700",
35
- "--md-h4-mt": "16px",
36
- "--md-h4-mb": "1px",
37
- "--md-h5-size": "16px",
38
- "--md-h5-leading": "1.375",
39
- "--md-h5-weight": "700",
40
- "--md-h5-mt": "0px",
41
- "--md-h5-mb": "0px",
42
- "--md-h6-size": "14px",
43
- "--md-h6-leading": "1.375",
44
- "--md-h6-weight": "700",
45
- "--md-h6-mt": "0px",
46
- "--md-h6-mb": "0px",
47
- "--md-strong-weight": "600",
48
- "--md-p-my": "1px",
49
- "--md-p-py": "4px",
50
- "--md-p-leading": "1.5",
51
- "--md-list-my": "8px",
52
- "--md-ul-pl": "4px",
53
- "--md-ol-pl": "4px",
54
- "--md-li-mt": "4px",
55
- "--md-quote-my": "4px",
56
- "--md-rule-my": "8px",
57
- "--md-img-my": "4px",
58
- "--md-table-my": "16px",
59
- "--md-table-size": "15px",
60
- "--md-code-my": "8px",
61
- "--md-inline-size": "14px",
62
- "--md-item-pl": "4px",
63
- "--md-nest": "1.25rem",
64
- },
65
- chat: {
66
- "--md-body-size": "15px",
67
- "--md-body-leading": "24px",
68
- "--md-h1-size": "15px",
69
- "--md-h1-leading": "24px",
70
- "--md-h1-weight": "600",
71
- "--md-h1-mt": "0px",
72
- "--md-h1-mb": "2px",
73
- "--md-h1-py": "0px",
74
- "--md-h2-size": "15px",
75
- "--md-h2-leading": "24px",
76
- "--md-h2-weight": "600",
77
- "--md-h2-mt": "12px",
78
- "--md-h2-mb": "2px",
79
- "--md-h2-py": "0px",
80
- "--md-h3-size": "15px",
81
- "--md-h3-leading": "24px",
82
- "--md-h3-weight": "600",
83
- "--md-h3-mt": "10px",
84
- "--md-h3-mb": "2px",
85
- "--md-h4-size": "15px",
86
- "--md-h4-leading": "24px",
87
- "--md-h4-weight": "600",
88
- "--md-h4-mt": "8px",
89
- "--md-h4-mb": "2px",
90
- "--md-h5-size": "14px",
91
- "--md-h5-leading": "22px",
92
- "--md-h5-weight": "600",
93
- "--md-h5-mt": "6px",
94
- "--md-h5-mb": "0px",
95
- "--md-h6-size": "14px",
96
- "--md-h6-leading": "22px",
97
- "--md-h6-weight": "600",
98
- "--md-h6-mt": "6px",
99
- "--md-h6-mb": "0px",
100
- "--md-strong-weight": "400",
101
- "--md-p-my": "0px",
102
- "--md-p-py": "1px",
103
- "--md-p-leading": "1.5",
104
- "--md-list-my": "4px",
105
- "--md-ul-pl": "4px",
106
- "--md-ol-pl": "4px",
107
- "--md-li-mt": "2px",
108
- "--md-quote-my": "2px",
109
- "--md-rule-my": "6px",
110
- "--md-img-my": "4px",
111
- "--md-table-my": "8px",
112
- "--md-table-size": "15px",
113
- "--md-code-my": "6px",
114
- "--md-inline-size": "13px",
115
- "--md-item-pl": "4px",
116
- "--md-nest": "1rem",
117
- },
118
- } as const;
119
-
120
- export function markdownVariantStyle(variant: MarkdownVariant = "docs"): CSSProperties {
121
- return MARKDOWN_PRESETS[variant] as CSSProperties;
122
- }
9
+ export const markdownScaleStyle = {
10
+ "--md-body-size": "var(--nonla-md-text-size)",
11
+ "--md-body-leading": "calc(var(--nonla-md-text-size) * 1.6)",
12
+ "--md-h1-size": "32px",
13
+ "--md-h1-leading": "1.25",
14
+ "--md-h1-weight": "800",
15
+ "--md-h1-mt": "0px",
16
+ "--md-h1-mb": "12px",
17
+ "--md-h1-py": "3px",
18
+ "--md-h2-size": "26px",
19
+ "--md-h2-leading": "32px",
20
+ "--md-h2-weight": "600",
21
+ "--md-h2-mt": "24px",
22
+ "--md-h2-mb": "8px",
23
+ "--md-h2-py": "3px",
24
+ "--md-h3-size": "24px",
25
+ "--md-h3-leading": "32px",
26
+ "--md-h3-weight": "600",
27
+ "--md-h3-mt": "22px",
28
+ "--md-h3-mb": "8px",
29
+ "--md-h4-size": "20px",
30
+ "--md-h4-leading": "26px",
31
+ "--md-h4-weight": "700",
32
+ "--md-h4-mt": "16px",
33
+ "--md-h4-mb": "1px",
34
+ "--md-h5-size": "20px",
35
+ "--md-h5-leading": "26px",
36
+ "--md-h5-weight": "700",
37
+ "--md-h5-mt": "16px",
38
+ "--md-h5-mb": "1px",
39
+ "--md-h6-size": "20px",
40
+ "--md-h6-leading": "26px",
41
+ "--md-h6-weight": "700",
42
+ "--md-h6-mt": "16px",
43
+ "--md-h6-mb": "1px",
44
+ "--md-strong-weight": "600",
45
+ "--md-p-my": "1px",
46
+ "--md-p-py": "4px",
47
+ "--md-p-leading": "1.6",
48
+ "--md-list-my": "8px",
49
+ "--md-ul-pl": "4px",
50
+ "--md-ol-pl": "4px",
51
+ "--md-li-mt": "4px",
52
+ "--md-quote-my": "0px",
53
+ "--md-rule-my": "8px",
54
+ "--md-img-my": "4px",
55
+ "--md-table-my": "16px",
56
+ "--md-code-my": "8px",
57
+ "--md-code-size": "var(--nonla-mono-text-size)",
58
+ "--md-code-leading": "calc(var(--nonla-mono-text-size) * 1.6)",
59
+ "--md-inline-size": "var(--nonla-mono-text-size)",
60
+ "--md-item-pl": "4px",
61
+ "--md-nest": "1.25rem",
62
+ } as CSSProperties;
123
63
 
124
64
  /**
125
65
  * Article headings. A markdown `#` paints the same as `##`.
66
+ * `#####` and `######` paint the same as `####`.
126
67
  * The large page title is `pageTitleClass`, used by Typography only.
127
68
  */
128
69
  export function headingClass(level: number): string {
129
- if (level <= 1) return "text-(--md-heading) mt-(--md-h2-mt,24px) mb-(--md-h1-mb,12px) pt-(--md-h2-py,3px) pb-(--md-h2-py,3px) text-(length:--md-h2-size,30px) leading-(--md-h2-leading,40px) font-(--md-h2-weight,600)";
130
- if (level === 2) return "text-(--md-heading) mt-(--md-h2-mt,24px) mb-(--md-h2-mb,1px) pt-(--md-h2-py,3px) pb-(--md-h2-py,3px) text-(length:--md-h2-size,30px) leading-(--md-h2-leading,40px) font-(--md-h2-weight,600)";
131
- if (level === 3) return "text-(--md-heading) mt-(--md-h3-mt,22px) mb-(--md-h3-mb,1px) text-(length:--md-h3-size,24px) leading-(--md-h3-leading,32px) font-(--md-h3-weight,700)";
132
- if (level === 4) return "text-(--md-heading) mt-(--md-h4-mt,16px) mb-(--md-h4-mb,1px) text-(length:--md-h4-size,20px) leading-(--md-h4-leading,26px) font-(--md-h4-weight,700)";
133
- if (level === 5) return "text-(--md-heading) mt-(--md-h5-mt,0px) mb-(--md-h5-mb,0px) text-(length:--md-h5-size,16px) leading-(--md-h5-leading,1.375) font-(--md-h5-weight,700)";
134
- return "text-(--md-heading) mt-(--md-h6-mt,0px) mb-(--md-h6-mb,0px) text-(length:--md-h6-size,14px) leading-(--md-h6-leading,1.375) font-(--md-h6-weight,700)";
70
+ if (level <= 1) return "text-foreground mt-(--md-h2-mt,24px) mb-(--md-h1-mb,12px) pt-(--md-h2-py,3px) pb-(--md-h2-py,3px) text-(length:--md-h2-size,26px) leading-(--md-h2-leading,32px) font-(--md-h2-weight,600)";
71
+ if (level === 2) return "text-foreground mt-(--md-h2-mt,24px) mb-(--md-h2-mb,8px) pt-(--md-h2-py,3px) pb-(--md-h2-py,3px) text-(length:--md-h2-size,26px) leading-(--md-h2-leading,32px) font-(--md-h2-weight,600)";
72
+ if (level === 3) return "text-foreground mt-(--md-h3-mt,22px) mb-(--md-h3-mb,8px) text-(length:--md-h3-size,24px) leading-(--md-h3-leading,32px) font-(--md-h3-weight,600)";
73
+ return "text-foreground mt-(--md-h4-mt,16px) mb-(--md-h4-mb,1px) text-(length:--md-h4-size,20px) leading-(--md-h4-leading,26px) font-(--md-h4-weight,700)";
135
74
  }
136
75
 
137
76
  /** Landing and page title. Not used inside markdown. */
138
- export const pageTitleClass = "text-(--md-heading) mt-(--md-h1-mt,0px) mb-(--md-h1-mb,1px) pt-(--md-h1-py,3px) pb-(--md-h1-py,3px) text-(length:--md-h1-size,32px) leading-(--md-h1-leading,1.25) font-(--md-h1-weight,800) tracking-tight";
77
+ export const pageTitleClass = "text-foreground mt-(--md-h1-mt,0px) mb-(--md-h1-mb,1px) pt-(--md-h1-py,3px) pb-(--md-h1-py,3px) text-(length:--md-h1-size,32px) leading-(--md-h1-leading,1.25) font-(--md-h1-weight,800) tracking-tight";
139
78
 
140
79
  /** Body line. Same size and color as a markdown paragraph. */
141
- export const markdownBodyClass = "text-(length:--md-body-size,16px) leading-(--md-body-leading,24px) text-(--md-ink)";
80
+ export const markdownBodyClass = "text-(length:--md-body-size,var(--nonla-md-text-size,16px)) leading-(--md-body-leading,calc(var(--nonla-md-text-size,16px)*1.6)) text-foreground";
142
81
 
143
82
  /** Paragraph box. Same rhythm as `MarkdownViewer` `p`. */
144
- export const markdownParagraphClass = "nonla-typo m-0 my-(--md-p-my,1px) py-(--md-p-py,4px) text-(length:--md-body-size,16px) leading-(--md-p-leading,1.5) text-(--md-ink)";
83
+ export const markdownParagraphClass = "nonla-typo m-0 my-(--md-p-my,1px) py-(--md-p-py,4px) text-(length:--md-body-size,var(--nonla-md-text-size,16px)) leading-(--md-p-leading,1.6) text-foreground";
package/src/menu/Menu.tsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ButtonHTMLAttributes, ReactNode } from "react";
2
- import { SolarIcon } from "../icon/SolarIcon";
2
+ import { Icon } from "../icon/Icon";
3
3
  import { cn } from "../lib/cn";
4
4
  import type { PopperPlacement } from "../lib/placement";
5
5
  import { Popover } from "../popover/Popover";
@@ -48,7 +48,7 @@ export function MenuTrigger({ active, open, className, children, ...rest }: Menu
48
48
  {...rest}
49
49
  >
50
50
  <span className="min-w-0 truncate leading-5">{children}</span>
51
- <SolarIcon name="alt-arrow-down-linear" size={12} className={cn("shrink-0 transition-transform duration-150", open && "rotate-180")} />
51
+ <Icon name="arrow-down" size={12} className={cn("shrink-0 transition-transform duration-150", open && "rotate-180")} />
52
52
  </button>
53
53
  );
54
54
  }
@@ -89,7 +89,7 @@ export function MenuAction({ className, ...rest }: ButtonHTMLAttributes<HTMLButt
89
89
  }
90
90
 
91
91
  export function MenuDivider({ className }: { className?: string }) {
92
- return <div className={cn("mx-2.5 my-1 h-px bg-ink-line", className)} />;
92
+ return <div className={cn("mx-2.5 my-1 h-px bg-border", className)} />;
93
93
  }
94
94
 
95
95
  Menu.Trigger = MenuTrigger;