devnonla-ui 0.19.2 → 0.20.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/README.md +11 -0
- package/package.json +1 -1
- package/src/alert/Alert.tsx +7 -7
- package/src/app/App.tsx +11 -7
- package/src/breadcrumb/Breadcrumb.tsx +80 -0
- package/src/button/Button.tsx +48 -33
- package/src/button/ButtonCopy.tsx +2 -2
- package/src/calendar/Calendar.tsx +12 -12
- package/src/card/Card.tsx +15 -10
- package/src/chat/AgentPanel.tsx +1 -1
- package/src/chat/index.ts +1 -5
- package/src/chat/message-ui/ChatError.tsx +1 -1
- package/src/chat/message-ui/ChatInput.tsx +4 -4
- package/src/chat/message-ui/ChatThinking.tsx +1 -1
- package/src/chat/message-ui/ChatUserMessage.tsx +3 -3
- package/src/chat/message-ui/ChatWelcome.tsx +2 -2
- package/src/chat/tool-ui/BackgroundTasksBar.tsx +6 -6
- package/src/chat/tool-ui/ChatToolCall.tsx +4 -4
- package/src/chat/tool-ui/ToolUiBadge.tsx +1 -1
- package/src/chat/tool-ui/ToolUiTrailing.tsx +1 -1
- package/src/chat/tool-ui/registry.ts +5 -19
- package/src/checkbox/Checkbox.tsx +12 -10
- package/src/colorpicker/ColorPicker.tsx +2 -2
- package/src/command-palette/CommandPalette.tsx +223 -0
- package/src/drawer/Drawer.tsx +1 -1
- package/src/dropdown/Dropdown.tsx +4 -3
- package/src/dropdown/menuClasses.ts +2 -2
- package/src/empty/Empty.tsx +23 -9
- package/src/form/FormItem.tsx +1 -1
- package/src/form/variants/FieldRadio.tsx +2 -2
- package/src/form/variants/FieldRepeaterItem.tsx +1 -1
- package/src/icon/Icon.tsx +14 -4
- package/src/icon/glyphs.ts +47 -38
- package/src/index.ts +8 -2
- package/src/input/EditableInput.tsx +3 -3
- package/src/input/Input.tsx +30 -13
- package/src/kbd/Kbd.tsx +32 -0
- package/src/lib/cn.ts +7 -0
- package/src/lib/markdownScale.ts +7 -5
- package/src/lib/sizes.ts +1 -1
- package/src/lib/surface.ts +2 -2
- package/src/markdown-editor/MarkdownDiff.tsx +4 -4
- package/src/markdown-editor/MarkdownPreview.tsx +1 -1
- package/src/markdown-editor/MarkdownSource.tsx +2 -2
- package/src/markdown-editor/MarkdownTable.tsx +2 -2
- package/src/markdown-editor/MermaidBlock.tsx +5 -5
- package/src/markdown-editor/ReactCodeFrame.tsx +1 -1
- package/src/menu/Menu.tsx +2 -2
- package/src/message/message.tsx +8 -8
- package/src/modal/Modal.tsx +2 -2
- package/src/page-header/PageHeader.tsx +33 -0
- package/src/pagination/Pagination.tsx +3 -3
- package/src/popconfirm/Popconfirm.tsx +3 -3
- package/src/scroll/OverlayScroll.tsx +1 -1
- package/src/segmented/Segmented.tsx +16 -7
- package/src/select/Select.tsx +76 -47
- package/src/sidebar/Sidebar.tsx +15 -4
- package/src/sortable-tree/SortableTree.tsx +1 -1
- package/src/splitter/Splitter.tsx +1 -1
- package/src/styles.css +258 -45
- package/src/switch/Switch.tsx +21 -20
- package/src/table/Table.tsx +32 -18
- package/src/tabs/Tabs.tsx +16 -13
- package/src/tag/Tag.tsx +16 -7
- package/src/theme-switcher/ThemeSwitcher.tsx +1 -1
- package/src/timepicker/TimePicker.tsx +2 -2
- package/src/tooltip/Tooltip.tsx +25 -3
- package/src/blob-shape/BlobShape.tsx +0 -337
- package/src/chat/tool-ui/GetCurrentTimeToolUI.tsx +0 -51
- package/src/chat/tool-ui/ReadSkillToolUI.tsx +0 -82
- package/src/chat/tool-ui/RunJsToolUI.tsx +0 -108
- package/src/chat/tool-ui/WebFetchToolUI.tsx +0 -64
package/src/icon/glyphs.ts
CHANGED
|
@@ -1,42 +1,51 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** NonlaUI glyphs, drawn in one style to match Claude desktop: 24 grid, round caps and joins, quiet geometry. */
|
|
2
2
|
export const ICON_GLYPHS = {
|
|
3
|
-
"add": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
4
|
-
"arrow-down": "<
|
|
5
|
-
"arrow-left": "<
|
|
6
|
-
"arrow-right": "<
|
|
7
|
-
"arrow-up": "<
|
|
8
|
-
"book": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
9
|
-
"check": "<
|
|
10
|
-
"checkbox": "<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><
|
|
11
|
-
"chevrons-left": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
12
|
-
"chevrons-right": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
13
|
-
"clock": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"
|
|
14
|
-
"close": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
15
|
-
"code": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-
|
|
16
|
-
"copy": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><
|
|
17
|
-
"datetime": "<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><
|
|
18
|
-
"dialog": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
19
|
-
"document": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
20
|
-
"download": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
21
|
-
"eraser": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
22
|
-
"error": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"
|
|
23
|
-
"eye": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"M3
|
|
24
|
-
"globe": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"
|
|
25
|
-
"json": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
26
|
-
"maximize": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
27
|
-
"md": "<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><
|
|
28
|
-
"minimize": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
29
|
-
"monitor": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><
|
|
30
|
-
"moon": "<
|
|
31
|
-
"pen": "<
|
|
32
|
-
"select": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
33
|
-
"shield-check": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
34
|
-
"stars": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
35
|
-
"stop": "<
|
|
36
|
-
"sun": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"
|
|
37
|
-
"text": "<g fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"><
|
|
38
|
-
"transfer": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M20
|
|
39
|
-
"trash": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.5\"><path d=\"
|
|
3
|
+
"add": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 12L19 12\"/><path d=\"M12 5L12 19\"/></g>",
|
|
4
|
+
"arrow-down": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M6 9L12 15L18 9\"/></g>",
|
|
5
|
+
"arrow-left": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M15 18L9 12L15 6\"/></g>",
|
|
6
|
+
"arrow-right": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M9 18L15 12L9 6\"/></g>",
|
|
7
|
+
"arrow-up": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M12 19V5\"/><path d=\"M6 11L12 5L18 11\"/></g>",
|
|
8
|
+
"book": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 18V6A2.5 2.5 0 0 1 7.5 3.5H19V20.5H7.5A2.5 2.5 0 0 1 5 18A2.5 2.5 0 0 1 7.5 15.5H19\"/><path d=\"M9 8H15\"/></g>",
|
|
9
|
+
"check": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 12.5L9.5 17L19 7\"/></g>",
|
|
10
|
+
"checkbox": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"3.5\" width=\"17\" height=\"17\" rx=\"3.5\"/><path d=\"M8.5 12.5L11 15L15.5 9.5\"/></g>",
|
|
11
|
+
"chevrons-left": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M11 17L6 12L11 7\"/><path d=\"M18 17L13 12L18 7\"/></g>",
|
|
12
|
+
"chevrons-right": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M13 17L18 12L13 7\"/><path d=\"M6 17L11 12L6 7\"/></g>",
|
|
13
|
+
"clock": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7.5V12L15 14\"/></g>",
|
|
14
|
+
"close": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M6 6L18 18\"/><path d=\"M18 6L6 18\"/></g>",
|
|
15
|
+
"code": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M8 7L3.5 12L8 17\"/><path d=\"M16 7L20.5 12L16 17\"/><path d=\"M13.5 4.5L10.5 19.5\"/></g>",
|
|
16
|
+
"copy": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"8.5\" y=\"8.5\" width=\"12\" height=\"12\" rx=\"2.5\"/><path d=\"M15.5 8.5V6A2.5 2.5 0 0 0 13 3.5H6A2.5 2.5 0 0 0 3.5 6V13A2.5 2.5 0 0 0 6 15.5H8.5\"/></g>",
|
|
17
|
+
"datetime": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"5\" width=\"17\" height=\"15.5\" rx=\"3\"/><path d=\"M3.5 10H20.5\"/><path d=\"M8 3.5V6.5\"/><path d=\"M16 3.5V6.5\"/></g>",
|
|
18
|
+
"dialog": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M7.5 7H13.5A3.5 3.5 0 0 1 17 10.5V13.5A3.5 3.5 0 0 1 13.5 17H10.5L7.5 19.5V17A3.5 3.5 0 0 1 4 13.5V10.5A3.5 3.5 0 0 1 7.5 7Z\"/><path d=\"M8.5 7A3.5 3.5 0 0 1 12 4H16.5A3.5 3.5 0 0 1 20 7.5V10.5A3.5 3.5 0 0 1 17 13.95\"/><path d=\"M7.5 12H7.51M10.5 12H10.51M13.5 12H13.51\"/></g>",
|
|
19
|
+
"document": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M14 3.5H7.5A2.5 2.5 0 0 0 5 6V18A2.5 2.5 0 0 0 7.5 20.5H16.5A2.5 2.5 0 0 0 19 18V8.5L14 3.5Z\"/><path d=\"M14 3.5V7A1.5 1.5 0 0 0 15.5 8.5H19\"/><path d=\"M8.5 13H15.5\"/><path d=\"M8.5 16.5H13\"/></g>",
|
|
20
|
+
"download": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M12 4V14.5\"/><path d=\"M7.5 10L12 14.5L16.5 10\"/><path d=\"M4 15V17A3 3 0 0 0 7 20H17A3 3 0 0 0 20 17V15\"/></g>",
|
|
21
|
+
"eraser": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M8.5 19.5L4.3 15.3A2 2 0 0 1 4.3 12.5L12.5 4.3A2 2 0 0 1 15.3 4.3L19.7 8.7A2 2 0 0 1 19.7 11.5L11.7 19.5\"/><path d=\"M8.5 19.5H20\"/><path d=\"M7.5 9.5L14.5 16.5\"/></g>",
|
|
22
|
+
"error": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 7.5V12.5\"/><path d=\"M12 16.25H12.01\"/></g>",
|
|
23
|
+
"eye": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M3 12C5 7.6 8.2 5.5 12 5.5C15.8 5.5 19 7.6 21 12C19 16.4 15.8 18.5 12 18.5C8.2 18.5 5 16.4 3 12Z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></g>",
|
|
24
|
+
"globe": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M3 12H21\"/><path d=\"M12 3A13.5 13.5 0 0 1 12 21A13.5 13.5 0 0 1 12 3Z\"/></g>",
|
|
25
|
+
"json": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M8.5 4H7.5A2 2 0 0 0 5.5 6V9.5A2.5 2.5 0 0 1 3.5 12A2.5 2.5 0 0 1 5.5 14.5V18A2 2 0 0 0 7.5 20H8.5\"/><path d=\"M15.5 4H16.5A2 2 0 0 1 18.5 6V9.5A2.5 2.5 0 0 0 20.5 12A2.5 2.5 0 0 0 18.5 14.5V18A2 2 0 0 1 16.5 20H15.5\"/></g>",
|
|
26
|
+
"maximize": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M13 4H20V11\"/><path d=\"M20 4L13.5 10.5\"/><path d=\"M11 20H4V13\"/><path d=\"M4 20L10.5 13.5\"/></g>",
|
|
27
|
+
"md": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"2.5\" y=\"5.5\" width=\"19\" height=\"13\" rx=\"3\"/><path d=\"M6.5 15V9L9 12L11.5 9V15\"/><path d=\"M16.5 9V15\"/><path d=\"M14.5 13L16.5 15L18.5 13\"/></g>",
|
|
28
|
+
"minimize": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M13.5 4V10.5H20\"/><path d=\"M20 4L13.5 10.5\"/><path d=\"M4 13.5H10.5V20\"/><path d=\"M4 20L10.5 13.5\"/></g>",
|
|
29
|
+
"monitor": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"4\" width=\"17\" height=\"12\" rx=\"2.5\"/><path d=\"M12 16V20\"/><path d=\"M8 20H16\"/></g>",
|
|
30
|
+
"moon": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M12 3.5A6.5 6.5 0 0 0 20.5 12A8.5 8.5 0 1 1 12 3.5Z\"/></g>",
|
|
31
|
+
"pen": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M16.5 4.5A2.12 2.12 0 0 1 19.5 7.5L8 19L4 20L5 16Z\"/><path d=\"M14.5 6.5L17.5 9.5\"/></g>",
|
|
32
|
+
"select": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M4 6.5H20\"/><path d=\"M4 12H20\"/><path d=\"M4 17.5H11\"/><path d=\"M15 16L17.5 18.5L20 16\"/></g>",
|
|
33
|
+
"shield-check": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M12 3.5C14 5 16.3 5.8 18.6 5.9A0.9 0.9 0 0 1 19.5 6.8V12C19.5 16.2 16.4 19.2 12.3 20.4A1 1 0 0 1 11.7 20.4C7.6 19.2 4.5 16.2 4.5 12V6.8A0.9 0.9 0 0 1 5.4 5.9C7.7 5.8 10 5 12 3.5Z\"/><path d=\"M9 12L11 14L15 10\"/></g>",
|
|
34
|
+
"stars": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M10 3.5Q10.8 9.2 16.5 10Q10.8 10.8 10 16.5Q9.2 10.8 3.5 10Q9.2 9.2 10 3.5Z\"/><path d=\"M17.5 14Q17.8 17.2 21 17.5Q17.8 17.8 17.5 21Q17.2 17.8 14 17.5Q17.2 17.2 17.5 14Z\"/></g>",
|
|
35
|
+
"stop": "<g fill=\"currentColor\" stroke=\"none\"><rect x=\"4.5\" y=\"4.5\" width=\"15\" height=\"15\" rx=\"3\"/></g>",
|
|
36
|
+
"sun": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><circle cx=\"12\" cy=\"12\" r=\"3.5\"/><path d=\"M12 3.5V5\"/><path d=\"M12 19V20.5\"/><path d=\"M3.5 12H5\"/><path d=\"M19 12H20.5\"/><path d=\"M6 6L7.06 7.06\"/><path d=\"M16.94 16.94L18 18\"/><path d=\"M6 18L7.06 16.94\"/><path d=\"M16.94 7.06L18 6\"/></g>",
|
|
37
|
+
"text": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"3.5\" width=\"17\" height=\"17\" rx=\"3.5\"/><path d=\"M8.5 8.5H15.5\"/><path d=\"M12 8.5V16\"/></g>",
|
|
38
|
+
"transfer": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M20 9H4.5\"/><path d=\"M8.5 5L4.5 9\"/><path d=\"M4 15H19.5\"/><path d=\"M15.5 19L19.5 15\"/></g>",
|
|
39
|
+
"trash": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M4 6.5H20\"/><path d=\"M9.5 6.5V5A1.5 1.5 0 0 1 11 3.5H13A1.5 1.5 0 0 1 14.5 5V6.5\"/><path d=\"M6 6.5L6.8 18.2A2.5 2.5 0 0 0 9.3 20.5H14.7A2.5 2.5 0 0 0 17.2 18.2L18 6.5\"/><path d=\"M10 10.5V16.5\"/><path d=\"M14 10.5V16.5\"/></g>",
|
|
40
|
+
"arrow-back": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M19 12H5\"/><path d=\"M11 6L5 12L11 18\"/></g>",
|
|
41
|
+
"arrow-forward": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5 12H19\"/><path d=\"M13 6L19 12L13 18\"/></g>",
|
|
42
|
+
"refresh": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M18.96 16.88A8.5 8.5 0 1 1 18.01 5.99L20.5 8.5\"/><path d=\"M20.5 3.5V8.5H15.5\"/></g>",
|
|
43
|
+
"more": "<g fill=\"currentColor\" stroke=\"none\"><circle cx=\"5.5\" cy=\"12\" r=\"1.6\"/><circle cx=\"12\" cy=\"12\" r=\"1.6\"/><circle cx=\"18.5\" cy=\"12\" r=\"1.6\"/></g>",
|
|
44
|
+
"panel": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><rect x=\"3.5\" y=\"3.5\" width=\"17\" height=\"17\" rx=\"3.5\"/><path d=\"M3.5 10H20.5\"/><path d=\"M9 15H15\"/></g>",
|
|
45
|
+
"window": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M20.5 11V7A3.5 3.5 0 0 0 17 3.5H7A3.5 3.5 0 0 0 3.5 7V15.5A3.5 3.5 0 0 0 7 19H11\"/><rect x=\"14\" y=\"14\" width=\"7.5\" height=\"6\" rx=\"1.75\"/></g>",
|
|
46
|
+
"send": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M4 11L20.5 3.5L13 20L11 13L4 11Z\"/></g>",
|
|
47
|
+
"pointer": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><path d=\"M5.71 4.64L18.67 8.98Q19.91 9.4 18.73 9.94L13.01 12.59Q12.46 12.84 12.23 13.39L9.91 18.71Q9.4 19.91 8.98 18.67L4.64 5.71Q4.09 4.09 5.71 4.64Z\"/></g>",
|
|
48
|
+
"search": "<g fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\"><circle cx=\"11\" cy=\"11\" r=\"6.5\"/><path d=\"M16 16L20 20\"/></g>",
|
|
40
49
|
} as const;
|
|
41
50
|
|
|
42
51
|
export type IconName = keyof typeof ICON_GLYPHS;
|
package/src/index.ts
CHANGED
|
@@ -10,13 +10,15 @@ export type { InputNumberProps, InputProps, InputSize, PasswordProps, TextAreaPr
|
|
|
10
10
|
export { Input, InputNumber, TextArea } from "./input/Input";
|
|
11
11
|
export type { SearchInputProps } from "./input/SearchInput";
|
|
12
12
|
export { SearchInput } from "./input/SearchInput";
|
|
13
|
+
export type { KbdProps } from "./kbd/Kbd";
|
|
14
|
+
export { Kbd } from "./kbd/Kbd";
|
|
13
15
|
/** Native input element ref. */
|
|
14
16
|
export type InputRef = HTMLInputElement;
|
|
15
17
|
|
|
16
18
|
export type { AlertProps, AlertType } from "./alert/Alert";
|
|
17
19
|
export { Alert } from "./alert/Alert";
|
|
18
|
-
export type {
|
|
19
|
-
export {
|
|
20
|
+
export type { BreadcrumbItem, BreadcrumbProps } from "./breadcrumb/Breadcrumb";
|
|
21
|
+
export { Breadcrumb } from "./breadcrumb/Breadcrumb";
|
|
20
22
|
export type { CalendarProps } from "./calendar/Calendar";
|
|
21
23
|
export { Calendar } from "./calendar/Calendar";
|
|
22
24
|
export type { CardFooterProps, CardItemProps, CardProps } from "./card/Card";
|
|
@@ -27,6 +29,8 @@ export type { CodeBlockCopyButtonProps, CodeBlockProps } from "./codeblock/CodeB
|
|
|
27
29
|
export { CodeBlock, CodeBlockCopyButton } from "./codeblock/CodeBlock";
|
|
28
30
|
export type { ColorFormat, ColorPickerProps, ColorPickerSemanticSlot, ColorType, PresetColorType } from "./colorpicker/ColorPicker";
|
|
29
31
|
export { Color, ColorPicker } from "./colorpicker/ColorPicker";
|
|
32
|
+
export type { CommandGroup, CommandItem, CommandPaletteProps } from "./command-palette/CommandPalette";
|
|
33
|
+
export { CommandPalette } from "./command-palette/CommandPalette";
|
|
30
34
|
export type { DatePickerProps, RangePickerProps, RangeValue } from "./datepicker/DatePicker";
|
|
31
35
|
export { DatePicker, RangePicker } from "./datepicker/DatePicker";
|
|
32
36
|
export type { DrawerPlacement, DrawerProps } from "./drawer/Drawer";
|
|
@@ -77,6 +81,8 @@ export type { MessageConfig, MessageType } from "./message/message";
|
|
|
77
81
|
export { message } from "./message/message";
|
|
78
82
|
export type { ModalConfirmProps, ModalProps } from "./modal/Modal";
|
|
79
83
|
export { Modal } from "./modal/Modal";
|
|
84
|
+
export type { PageHeaderProps } from "./page-header/PageHeader";
|
|
85
|
+
export { PageHeader } from "./page-header/PageHeader";
|
|
80
86
|
export type { PaginationAlign, PaginationItemType, PaginationProps, PaginationSemanticSlot, PaginationSizeChangerProps } from "./pagination/Pagination";
|
|
81
87
|
export { Pagination } from "./pagination/Pagination";
|
|
82
88
|
export type { PopconfirmProps } from "./popconfirm/Popconfirm";
|
|
@@ -13,7 +13,7 @@ const FIELD_INSET: Record<CanonicalSize, string> = { small: "-4px", default: "-6
|
|
|
13
13
|
const MULTILINE_MIN: Record<CanonicalSize, number> = { small: 56, default: 72, large: 96 };
|
|
14
14
|
const GLASS_BORDER = 1;
|
|
15
15
|
|
|
16
|
-
const fieldClass = (saving: boolean) => cn("relative z-1 m-0 w-full border-0 bg-transparent text-foreground placeholder:text-
|
|
16
|
+
const fieldClass = (saving: boolean) => cn("relative z-1 m-0 w-full border-0 bg-transparent text-foreground placeholder:text-tertiary-foreground focus:outline-none", saving && "opacity-60");
|
|
17
17
|
|
|
18
18
|
type Lock = {
|
|
19
19
|
top: number;
|
|
@@ -225,7 +225,7 @@ function EditButton({ label, size, onClick }: { label: string; size: CanonicalSi
|
|
|
225
225
|
aria-label={label}
|
|
226
226
|
title={label}
|
|
227
227
|
onClick={onClick}
|
|
228
|
-
className="inline-flex shrink-0 items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-
|
|
228
|
+
className="inline-flex shrink-0 items-center justify-center rounded text-muted-foreground opacity-0 transition-opacity hover:bg-ink-hover active:bg-ink-active hover:text-foreground group-hover/edit:opacity-100 focus-visible:opacity-100"
|
|
229
229
|
style={{ width: box, height: box }}
|
|
230
230
|
>
|
|
231
231
|
<Icon name="pen" size={tok.icon} />
|
|
@@ -320,7 +320,7 @@ function EditableKey({ value, editing, onStartEdit, onCancelEdit, onSave, placeh
|
|
|
320
320
|
<div ref={rowRef} className="flex w-full min-w-0 items-center" style={{ minHeight: controlHeightVar(resolved) }}>
|
|
321
321
|
<div className="group/edit inline-flex max-w-full items-center gap-1">
|
|
322
322
|
<div ref={textRef} className={cn("min-w-0", editing && "invisible")} style={{ fontSize: tok.fontSize, lineHeight: `${tok.lineHeight}px`, minHeight: tok.lineHeight }}>
|
|
323
|
-
<code className="select-text font-mono font-
|
|
323
|
+
<code className="select-text font-mono font-medium text-foreground">{value}</code>
|
|
324
324
|
</div>
|
|
325
325
|
{editing ? null : <EditButton label={editLabel} size={resolved} onClick={onStartEdit} />}
|
|
326
326
|
</div>
|
package/src/input/Input.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CSSProperties, forwardRef, type InputHTMLAttributes, type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
1
|
+
import { type ChangeEvent, type CSSProperties, forwardRef, type InputHTMLAttributes, type KeyboardEvent, type ReactNode, type TextareaHTMLAttributes, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from "react";
|
|
2
2
|
import { cn } from "../lib/cn";
|
|
3
3
|
import { type ControlSize, controlFieldFocusBorder, controlFieldStyle, controlFieldSurface, controlFieldTransition, controlHeightVar, controlRadiusVar, controlStatusClass, getSizeTokens, useControlSize } from "../lib/sizes";
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "p
|
|
|
15
15
|
onPressEnter?: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
const fieldBase = cn("w-full", controlFieldSurface, "placeholder:text-
|
|
18
|
+
const fieldBase = cn("w-full", controlFieldSurface, "placeholder:text-tertiary-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45", controlFieldFocusBorder);
|
|
19
19
|
|
|
20
20
|
function variantClass(variant: InputProps["variant"]) {
|
|
21
21
|
if (variant === "borderless") return "border-transparent bg-transparent hover:bg-transparent shadow-none focus:border-transparent focus:bg-transparent focus-within:bg-transparent";
|
|
@@ -23,10 +23,25 @@ function variantClass(variant: InputProps["variant"]) {
|
|
|
23
23
|
return "";
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const InputRoot = forwardRef<HTMLInputElement, InputProps>(function Input({ className, size, status, prefix, suffix, allowClear, variant = "outlined", disabled, value, onChange, onPressEnter, onKeyDown, style, ...rest }, ref) {
|
|
26
|
+
const InputRoot = forwardRef<HTMLInputElement, InputProps>(function Input({ className, size, status, prefix, suffix, allowClear, variant = "outlined", disabled, value, defaultValue, onChange, onPressEnter, onKeyDown, style, ...rest }, ref) {
|
|
27
27
|
const fieldStyle = controlFieldStyle(useControlSize(size));
|
|
28
|
-
|
|
29
|
-
const
|
|
28
|
+
// `allowClear` needs to know the text, so an uncontrolled input keeps it locally.
|
|
29
|
+
const controlled = value !== undefined;
|
|
30
|
+
const [inner, setInner] = useState(() => (defaultValue == null ? "" : String(defaultValue)));
|
|
31
|
+
const current = controlled ? value : inner;
|
|
32
|
+
const showClear = allowClear && !disabled && current != null && String(current).length > 0;
|
|
33
|
+
// Keep the wrapper whenever a clear button may appear, so the <input> is not remounted (and does not lose focus) on the first keystroke.
|
|
34
|
+
const wrapped = Boolean(prefix || suffix || allowClear);
|
|
35
|
+
|
|
36
|
+
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
|
|
37
|
+
if (!controlled) setInner(e.target.value);
|
|
38
|
+
onChange?.(e);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const clear = () => {
|
|
42
|
+
if (!controlled) setInner("");
|
|
43
|
+
onChange?.({ target: { value: "" }, currentTarget: { value: "" } } as never);
|
|
44
|
+
};
|
|
30
45
|
|
|
31
46
|
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
|
32
47
|
onKeyDown?.(e);
|
|
@@ -37,8 +52,9 @@ const InputRoot = forwardRef<HTMLInputElement, InputProps>(function Input({ clas
|
|
|
37
52
|
<input
|
|
38
53
|
ref={ref}
|
|
39
54
|
disabled={disabled}
|
|
40
|
-
value={value}
|
|
41
|
-
|
|
55
|
+
value={allowClear ? current : value}
|
|
56
|
+
defaultValue={allowClear ? undefined : defaultValue}
|
|
57
|
+
onChange={handleChange}
|
|
42
58
|
onKeyDown={handleKeyDown}
|
|
43
59
|
className={cn(fieldBase, controlFieldTransition, controlStatusClass(status), variantClass(variant), wrapped && "border-0 bg-transparent h-full focus:bg-transparent p-0!", !wrapped && className)}
|
|
44
60
|
style={wrapped ? { height: "100%", fontSize: fieldStyle.fontSize, lineHeight: fieldStyle.lineHeight, ...style } : { ...fieldStyle, ...style }}
|
|
@@ -56,7 +72,7 @@ const InputRoot = forwardRef<HTMLInputElement, InputProps>(function Input({ clas
|
|
|
56
72
|
{prefix ? <span className="shrink-0 text-muted-foreground inline-flex items-center">{prefix}</span> : null}
|
|
57
73
|
{input}
|
|
58
74
|
{showClear ? (
|
|
59
|
-
<button type="button" className="shrink-0 text-muted-foreground hover:text-foreground text-xs leading-none" aria-label="Clear" onClick={
|
|
75
|
+
<button type="button" className="shrink-0 text-muted-foreground hover:text-foreground text-xs leading-none" aria-label="Clear" onClick={clear}>
|
|
60
76
|
×
|
|
61
77
|
</button>
|
|
62
78
|
) : null}
|
|
@@ -169,9 +185,9 @@ function HandlerChevron({ dir, size }: { dir: "up" | "down"; size: number }) {
|
|
|
169
185
|
}
|
|
170
186
|
|
|
171
187
|
/** Stepper reveal and press. Same ease-out and duration as the field focus. */
|
|
172
|
-
const handlerEase = "duration-
|
|
188
|
+
const handlerEase = "duration-(--nonla-dur-fast) ease-(--nonla-ease-out) motion-reduce:transition-none";
|
|
173
189
|
|
|
174
|
-
const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function InputNumber({ value, defaultValue, onChange, min, max, step = 1, controls = true, precision, parser, formatter, disabled, size, status, className, style, placeholder, onBlur, onFocus, onKeyDown, ...rest }, ref) {
|
|
190
|
+
const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function InputNumber({ value, defaultValue, onChange, min, max, step = 1, controls = true, precision, parser, formatter, disabled, size, status, className, style, placeholder, onBlur, onFocus, onKeyDown, onPressEnter, ...rest }, ref) {
|
|
175
191
|
const controlled = value !== undefined;
|
|
176
192
|
const [inner, setInner] = useState<number | null>(defaultValue ?? null);
|
|
177
193
|
const numeric = controlled ? (value ?? null) : inner;
|
|
@@ -237,6 +253,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
237
253
|
stepBy(-1);
|
|
238
254
|
}
|
|
239
255
|
onKeyDown?.(e);
|
|
256
|
+
if (e.key === "Enter" && !e.nativeEvent.isComposing) onPressEnter?.(e);
|
|
240
257
|
};
|
|
241
258
|
|
|
242
259
|
return (
|
|
@@ -278,7 +295,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
278
295
|
}}
|
|
279
296
|
onKeyDown={handleKeyDown}
|
|
280
297
|
className={cn(
|
|
281
|
-
"min-w-0 flex-1 border-0 bg-transparent text-foreground placeholder:text-
|
|
298
|
+
"min-w-0 flex-1 border-0 bg-transparent text-foreground placeholder:text-tertiary-foreground outline-none",
|
|
282
299
|
"disabled:cursor-not-allowed",
|
|
283
300
|
// Kill native number chrome if type ever switches
|
|
284
301
|
"[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
@@ -307,7 +324,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
307
324
|
tabIndex={-1}
|
|
308
325
|
aria-label="Increase"
|
|
309
326
|
disabled={atMax}
|
|
310
|
-
className={cn("flex flex-1 items-center justify-center border-b border-input text-tertiary-foreground", "transition-colors", handlerEase, "hover:bg-ink-hover hover:text-foreground active:bg-ink-active active:duration-
|
|
327
|
+
className={cn("flex flex-1 items-center justify-center border-b border-input text-tertiary-foreground", "transition-colors", handlerEase, "hover:bg-ink-hover hover:text-foreground active:bg-ink-active active:duration-(--nonla-dur-instant)", "disabled:pointer-events-none disabled:opacity-30")}
|
|
311
328
|
onMouseDown={(e) => e.preventDefault()}
|
|
312
329
|
onClick={() => stepBy(1)}
|
|
313
330
|
>
|
|
@@ -318,7 +335,7 @@ const InputNumber = forwardRef<HTMLInputElement, InputNumberProps>(function Inpu
|
|
|
318
335
|
tabIndex={-1}
|
|
319
336
|
aria-label="Decrease"
|
|
320
337
|
disabled={atMin}
|
|
321
|
-
className={cn("flex flex-1 items-center justify-center text-tertiary-foreground", "transition-colors", handlerEase, "hover:bg-ink-hover hover:text-foreground active:bg-ink-active active:duration-
|
|
338
|
+
className={cn("flex flex-1 items-center justify-center text-tertiary-foreground", "transition-colors", handlerEase, "hover:bg-ink-hover hover:text-foreground active:bg-ink-active active:duration-(--nonla-dur-instant)", "disabled:pointer-events-none disabled:opacity-30")}
|
|
322
339
|
onMouseDown={(e) => e.preventDefault()}
|
|
323
340
|
onClick={() => stepBy(-1)}
|
|
324
341
|
>
|
package/src/kbd/Kbd.tsx
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { cn } from "../lib/cn";
|
|
3
|
+
|
|
4
|
+
export type KbdProps = HTMLAttributes<HTMLElement> & {
|
|
5
|
+
/** Keys of a shortcut, drawn as separate caps: `["⌘", "K"]`. Without it, `children` is one cap. */
|
|
6
|
+
keys?: ReactNode[];
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
const capClass = "inline-flex h-5 min-w-5 items-center justify-center rounded-md border border-solid border-border bg-background px-1 text-xs leading-none font-medium text-muted-foreground";
|
|
10
|
+
/** `.nonla-ui kbd` is mono for markdown; caps read better in the UI font. */
|
|
11
|
+
const capStyle = { fontFamily: "var(--nonla-font)", letterSpacing: "0" };
|
|
12
|
+
|
|
13
|
+
/** Keyboard key cap for shortcuts in menus, search fields, and tooltips. */
|
|
14
|
+
export function Kbd({ keys, className, children, ...rest }: KbdProps) {
|
|
15
|
+
if (keys?.length) {
|
|
16
|
+
return (
|
|
17
|
+
<span className={cn("inline-flex items-center gap-1", className)} {...rest}>
|
|
18
|
+
{keys.map((key, i) => (
|
|
19
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: keys of a shortcut can repeat and never reorder
|
|
20
|
+
<kbd key={i} className={capClass} style={capStyle}>
|
|
21
|
+
{key}
|
|
22
|
+
</kbd>
|
|
23
|
+
))}
|
|
24
|
+
</span>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
<kbd {...rest} className={cn(capClass, className)} style={{ ...capStyle, ...rest.style }}>
|
|
29
|
+
{children}
|
|
30
|
+
</kbd>
|
|
31
|
+
);
|
|
32
|
+
}
|
package/src/lib/cn.ts
CHANGED
|
@@ -4,3 +4,10 @@ import { twMerge } from "tailwind-merge";
|
|
|
4
4
|
export function cn(...inputs: ClassValue[]) {
|
|
5
5
|
return twMerge(clsx(inputs));
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Keyboard focus ring for buttons, toggles, and icon buttons (`--nonla-focus-ring`).
|
|
10
|
+
* The 2px offset keeps it visible on solid brand fills. Fields use the border instead.
|
|
11
|
+
*/
|
|
12
|
+
export const focusRing =
|
|
13
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
|
package/src/lib/markdownScale.ts
CHANGED
|
@@ -4,7 +4,8 @@ import type { CSSProperties } from "react";
|
|
|
4
4
|
* One markdown scale. Body reads `--nonla-base-text-size` (`text-base`). Leading is 1.6.
|
|
5
5
|
* Tables always use `text-base`.
|
|
6
6
|
* Fenced code reads `--nonla-mono-text-size`, which is `text-sm`.
|
|
7
|
-
* Inline code is `0.
|
|
7
|
+
* Inline code is `0.95em` of the surrounding text: Geist Mono has a shorter x-height than Inter, so at 0.95em
|
|
8
|
+
* its lowercase stands about 93% as tall as the body (0.875em was 85% and read small). The chip still fits the line.
|
|
8
9
|
* Class fallbacks match these values when the variables are not set.
|
|
9
10
|
*/
|
|
10
11
|
export const markdownScaleStyle = {
|
|
@@ -57,7 +58,7 @@ export const markdownScaleStyle = {
|
|
|
57
58
|
"--md-code-my": "8px",
|
|
58
59
|
"--md-code-size": "var(--nonla-mono-text-size)",
|
|
59
60
|
"--md-code-leading": "calc(var(--nonla-mono-text-size) * 1.6)",
|
|
60
|
-
"--md-inline-size": "0.
|
|
61
|
+
"--md-inline-size": "0.95em",
|
|
61
62
|
"--md-item-pl": "4px",
|
|
62
63
|
"--md-nest": "1.25rem",
|
|
63
64
|
} as CSSProperties;
|
|
@@ -84,9 +85,10 @@ export const markdownBodyClass = "text-(length:--md-body-size,var(--nonla-base-t
|
|
|
84
85
|
export const markdownParagraphClass = "nonla-typo m-0 my-(--md-p-my,1px) py-(--md-p-py,4px) text-(length:--md-body-size,var(--nonla-base-text-size,15px)) leading-(--md-p-leading,1.6) text-foreground";
|
|
85
86
|
|
|
86
87
|
/**
|
|
87
|
-
* Inline code.
|
|
88
|
-
*
|
|
88
|
+
* Inline code. Slightly smaller than the line, normal weight, a 4% wash and a 6% hairline (inset, so the box size does not change).
|
|
89
|
+
* Both are ink on whatever sits behind, so the chip reads on the page, a card, and a chat bubble.
|
|
89
90
|
* A token stays whole; the line breaks before it.
|
|
91
|
+
* Side padding 0.3em matches the space above the caps and below the baseline; the radius scales with the size (≈4px in body, more in headings).
|
|
90
92
|
*/
|
|
91
93
|
export const markdownInlineCodeClass =
|
|
92
|
-
"nonla-inline-code rounded-[
|
|
94
|
+
"nonla-inline-code rounded-[0.3em] bg-(--nonla-inline-code-bg) shadow-[inset_0_0_0_1px_var(--nonla-inline-code-ring)] px-[0.3em] py-px align-baseline font-mono text-(length:--md-inline-size,0.95em) leading-none whitespace-nowrap";
|
package/src/lib/sizes.ts
CHANGED
|
@@ -91,7 +91,7 @@ export function controlStatusClass(status?: "error" | "warning"): string {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
/** Focus surface fade — Input / Select / DatePicker / TimePicker. */
|
|
94
|
-
export const controlFieldTransition = "transition-[background-color,border-color] duration-
|
|
94
|
+
export const controlFieldTransition = "transition-[background-color,border-color] duration-(--nonla-dur-fast) ease-(--nonla-ease-out) motion-reduce:transition-none";
|
|
95
95
|
|
|
96
96
|
/**
|
|
97
97
|
* Outlined field. Resting stroke is `--input` (Cursor `--border-secondary`, ink at 12%).
|
package/src/lib/surface.ts
CHANGED
|
@@ -5,14 +5,14 @@ export const glassSurfaceClass =
|
|
|
5
5
|
/** Floating overlay chrome (Popover / Dropdown / Select / pickers / Tooltip). */
|
|
6
6
|
export const glassOverlayClass = [
|
|
7
7
|
glassSurfaceClass,
|
|
8
|
-
"nonla-popup-layer nonla-popper z-[var(--nonla-z-popup,1050)] rounded-
|
|
8
|
+
"nonla-popup-layer nonla-popper z-[var(--nonla-z-popup,1050)] rounded-lg outline-none will-change-[transform,opacity]",
|
|
9
9
|
"[transform-origin:var(--radix-popover-content-transform-origin,var(--radix-dropdown-menu-content-transform-origin,var(--radix-select-content-transform-origin,var(--radix-tooltip-content-transform-origin,center))))]",
|
|
10
10
|
"data-[state=open]:data-[side=top]:animate-[nonla-pop-in-top_var(--nonla-dur-fast)_var(--nonla-ease-out)]",
|
|
11
11
|
"data-[state=open]:data-[side=bottom]:animate-[nonla-pop-in-bottom_var(--nonla-dur-fast)_var(--nonla-ease-out)]",
|
|
12
12
|
"data-[state=open]:data-[side=left]:animate-[nonla-pop-in-left_var(--nonla-dur-fast)_var(--nonla-ease-out)]",
|
|
13
13
|
"data-[state=open]:data-[side=right]:animate-[nonla-pop-in-right_var(--nonla-dur-fast)_var(--nonla-ease-out)]",
|
|
14
14
|
"data-[state=open]:not-data-[side]:animate-[nonla-pop-in-bottom_var(--nonla-dur-fast)_var(--nonla-ease-out)]",
|
|
15
|
-
"data-[state=closed]:animate-[nonla-pop-
|
|
15
|
+
"data-[state=closed]:animate-[nonla-pop-out_var(--nonla-dur-instant)_var(--nonla-ease-in)]",
|
|
16
16
|
].join(" ");
|
|
17
17
|
|
|
18
18
|
/** Meadow menus — same panel as overlays. */
|
|
@@ -44,12 +44,12 @@ function DiffText({ line }: { line: DiffLine }) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function Gutter({ value, className }: { value?: number; className?: string }) {
|
|
47
|
-
return <span className={cn("w-10 shrink-0 select-none pr-2 text-right font-mono text-
|
|
47
|
+
return <span className={cn("w-10 shrink-0 select-none pr-2 text-right font-mono text-xs leading-5 text-quaternary-foreground tabular-nums", className)}>{value ?? ""}</span>;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function Mark({ kind }: { kind: DiffLine["kind"] }) {
|
|
51
51
|
return (
|
|
52
|
-
<span aria-hidden className={cn("w-4 shrink-0 text-center font-mono text-
|
|
52
|
+
<span aria-hidden className={cn("w-4 shrink-0 text-center font-mono text-sm leading-5", kind === "insert" && "text-success", kind === "delete" && "text-destructive")}>
|
|
53
53
|
{marker(kind)}
|
|
54
54
|
</span>
|
|
55
55
|
);
|
|
@@ -57,7 +57,7 @@ function Mark({ kind }: { kind: DiffLine["kind"] }) {
|
|
|
57
57
|
|
|
58
58
|
function LineBody({ line }: { line: DiffLine }) {
|
|
59
59
|
return (
|
|
60
|
-
<span className="min-h-5 whitespace-pre pr-4 font-mono text-
|
|
60
|
+
<span className="min-h-5 whitespace-pre pr-4 font-mono text-sm leading-5">
|
|
61
61
|
<DiffText line={line} />
|
|
62
62
|
</span>
|
|
63
63
|
);
|
|
@@ -65,7 +65,7 @@ function LineBody({ line }: { line: DiffLine }) {
|
|
|
65
65
|
|
|
66
66
|
function FoldButton({ count, onClick, span }: { count: number; onClick: () => void; span?: boolean }) {
|
|
67
67
|
return (
|
|
68
|
-
<button type="button" className={cn("flex w-full items-center justify-center border-y border-border bg-muted
|
|
68
|
+
<button type="button" className={cn("flex w-full items-center justify-center border-y border-border bg-muted py-0.5 text-xs text-link hover:bg-(--nonla-fill-strong)", span && "col-span-2")} onClick={onClick}>
|
|
69
69
|
Show {count} unchanged {count === 1 ? "line" : "lines"}
|
|
70
70
|
</button>
|
|
71
71
|
);
|
|
@@ -78,7 +78,7 @@ function BlockEditor({
|
|
|
78
78
|
});
|
|
79
79
|
}}
|
|
80
80
|
className={cn(
|
|
81
|
-
"block w-full resize-none overflow-hidden border-0 bg-transparent font-[inherit] text-foreground shadow-none outline-none ring-0 placeholder:text-
|
|
81
|
+
"block w-full resize-none overflow-hidden border-0 bg-transparent font-[inherit] text-foreground shadow-none outline-none ring-0 placeholder:text-tertiary-foreground focus:outline-none focus:ring-0",
|
|
82
82
|
// Match rendered paragraph rhythm so the block does not jump when editing starts.
|
|
83
83
|
mono ? "p-0 font-mono text-(length:--md-code-size,var(--nonla-mono-text-size)) leading-(--md-code-leading,calc(var(--nonla-mono-text-size)*1.6))" : markdownParagraphClass,
|
|
84
84
|
!autoSize && "h-full",
|
|
@@ -25,7 +25,7 @@ export function MarkdownSource({ value, onChange, readOnly, placeholder = "Write
|
|
|
25
25
|
<OverlayScroll className="h-full bg-card" innerClassName="overflow-x-auto">
|
|
26
26
|
<div className="relative flex min-h-full" style={{ width: `max(100%, calc(3.5rem + ${longest + 2}ch))` }}>
|
|
27
27
|
<div aria-hidden className="pointer-events-none absolute inset-x-0 bg-ink-hover" style={{ top: PAD + active * LINE, height: LINE }} />
|
|
28
|
-
<div className="sticky left-0 z-20 w-12 shrink-0 select-none pt-2 text-right font-mono text-
|
|
28
|
+
<div className="sticky left-0 z-20 w-12 shrink-0 select-none pt-2 text-right font-mono text-xs leading-5 text-quaternary-foreground">
|
|
29
29
|
{lines.map((_, index) => (
|
|
30
30
|
// Line number is the row identity.
|
|
31
31
|
// biome-ignore lint/suspicious/noArrayIndexKey: gutter row is the line number
|
|
@@ -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-
|
|
66
|
+
className="relative z-10 block w-full resize-none overflow-hidden bg-transparent py-2 pr-4 font-mono text-sm leading-5 text-foreground outline-none placeholder:text-tertiary-foreground"
|
|
67
67
|
style={{ height: Math.max(lines.length, 1) * LINE + PAD * 2 }}
|
|
68
68
|
/>
|
|
69
69
|
</div>
|
|
@@ -77,7 +77,7 @@ export function MarkdownTable({ children }: { children: ReactNode }) {
|
|
|
77
77
|
|
|
78
78
|
<dialog
|
|
79
79
|
ref={dialogRef}
|
|
80
|
-
className="inset-2.5 m-0 h-auto w-auto max-h-none max-w-none overflow-hidden rounded-xl border border-
|
|
80
|
+
className="inset-2.5 m-0 h-auto w-auto max-h-none max-w-none overflow-hidden rounded-xl border border-border bg-card p-0 shadow-(--nonla-shadow) backdrop:bg-black/40 open:flex open:flex-col"
|
|
81
81
|
onKeyDown={(e) => {
|
|
82
82
|
if (e.key !== "Escape") return;
|
|
83
83
|
e.preventDefault();
|
|
@@ -85,7 +85,7 @@ export function MarkdownTable({ children }: { children: ReactNode }) {
|
|
|
85
85
|
closeFullscreen();
|
|
86
86
|
}}
|
|
87
87
|
>
|
|
88
|
-
<div className="absolute top-5 right-5 z-
|
|
88
|
+
<div className="absolute top-5 right-5 z-10 flex items-center gap-1">
|
|
89
89
|
<Button size="small" className="bg-background" icon={<Icon name={copied ? "check" : "copy"} size={12} />} title={copied ? "Copied" : "Copy as Markdown"} aria-label={copied ? "Copied" : "Copy as Markdown"} onClick={copyMarkdown} />
|
|
90
90
|
<Button size="small" className="bg-background" icon={<Icon name="minimize" size={12} />} title="Exit fullscreen" aria-label="Exit fullscreen" onClick={closeFullscreen} />
|
|
91
91
|
</div>
|