@surrealdb/ui 1.2.16 → 1.2.18

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 (152) hide show
  1. package/dist/assets/1299e4695ad0bd61.svg +5 -0
  2. package/dist/assets/408117e904653548.svg +48 -0
  3. package/dist/assets/b516b020352f6369.svg +1 -0
  4. package/dist/assets/dfde8de566c3c2b9.svg +11 -0
  5. package/dist/assets/e9eae7bc863f211b.svg +1 -0
  6. package/dist/assets/f74ae3707a5d418f.svg +1 -0
  7. package/dist/icons.d.ts +6 -0
  8. package/dist/icons.js +198 -195
  9. package/dist/icons.js.map +1 -1
  10. package/dist/ui.d.ts +18 -0
  11. package/dist/ui.js +1441 -1426
  12. package/dist/ui.js.map +1 -1
  13. package/package.json +8 -2
  14. package/.claude/launch.json +0 -17
  15. package/.oxfmtrc.json +0 -27
  16. package/.oxlintrc.json +0 -23
  17. package/.picto-fix-png/Cursor.png +0 -0
  18. package/.picto-fix-png/DocumentGradient.png +0 -0
  19. package/.picto-fix-png/FileGradient.png +0 -0
  20. package/.picto-fix-png/HealthBubbleGradient.png +0 -0
  21. package/.picto-fix-png/LearnGradient.png +0 -0
  22. package/.picto-fix-png/MediaFileGradient.png +0 -0
  23. package/.zed/settings.json +0 -36
  24. package/AGENTS.md +0 -111
  25. package/CLAUDE.md +0 -111
  26. package/REVIEW.md +0 -81
  27. package/doc/code-style.md +0 -264
  28. package/doc/release.md +0 -102
  29. package/doc/stacker-plan.md +0 -219
  30. package/release-notes.md +0 -39
  31. package/tests/_setup/e2e-helpers.tsx +0 -169
  32. package/tests/_setup/markdown-classes.ts +0 -3
  33. package/tests/_setup/portable-stories.ts +0 -33
  34. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-continues-an-ordered-list-when-Enter-is-pressed-at-the-end-of-a-numbered-line-1.png +0 -0
  35. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-renders-a-diagram-for-the-fenced-mermaid-block-1.png +0 -0
  36. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-renders-a-horizontal-rule-as-a-separator-1.png +0 -0
  37. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-renders-a-read-only-table-preview-when-the-table-block-is-inactive-1.png +0 -0
  38. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-shows-blockquote-text-from-the-sample-document-1.png +0 -0
  39. package/tests/e2e/MarkdownEditor/__screenshots__/content-blocks.test.tsx/MarkdownEditor---content-blocks-shows-fenced-TypeScript-sample-code-in-the-document-1.png +0 -0
  40. package/tests/e2e/MarkdownEditor/__screenshots__/edits.test.tsx/MarkdownEditor---edits-auto-continues-a-bullet-list-when-Enter-is-pressed-at-the-end-of-a-list-item-1.png +0 -0
  41. package/tests/e2e/MarkdownEditor/__screenshots__/edits.test.tsx/MarkdownEditor---edits-expands-triple-backtick-into-a-fenced-code-block-with-the-caret-on-the-empty-body-line-1.png +0 -0
  42. package/tests/e2e/MarkdownEditor/__screenshots__/edits.test.tsx/MarkdownEditor---edits-reflects-typed-characters-in-the-underlying-document-1.png +0 -0
  43. package/tests/e2e/MarkdownEditor/__screenshots__/heading-fold.test.tsx/MarkdownEditor---heading-folds-viewer--folds-and-unfolds-a-heading-section-via-the-margin-control-1.png +0 -0
  44. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---hybrid-widgets-clicking-a-callout-header-focuses-the-editor-and-parks-the-caret-inside-the-callout--REASONING--4--1.png +0 -0
  45. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---hybrid-widgets-keeps-list-bullets-consistent-after-hopping-the-caret-across-items-several-times-1.png +0 -0
  46. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---hybrid-widgets-reveals-heading-marks-when-the-caret-enters-the-heading-line-and-hides-them-when-it-leaves-1.png +0 -0
  47. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---hybrid-widgets-shows-the-right-callout-title-when-moving-focus-between-consecutive-callouts-1.png +0 -0
  48. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---preview-widgets-clicking-a-callout-header-focuses-the-editor-with-the-caret-in-that-callout-1.png +0 -0
  49. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---preview-widgets-keeps-list-bullets-consistent-after-hopping-the-caret-across-items-several-times-1.png +0 -0
  50. package/tests/e2e/MarkdownEditor/__screenshots__/hybrid-widgets.test.tsx/MarkdownEditor---preview-widgets-shows-the-right-callout-title-when-moving-focus-between-consecutive-callouts-1.png +0 -0
  51. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-block-content.test.tsx/MarkdownEditor---block-JSX-components-clicking-the-edit-source-action-selects-the-component-source-range-1.png +0 -0
  52. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-block-content.test.tsx/MarkdownEditor---block-JSX-components-renders-block-components-via-JsxBlockWidget-with-an-edit-source-action-1.png +0 -0
  53. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-block-content.test.tsx/MarkdownEditor---inline-JSX-rendering-block-content-keeps-multiple-inline-JSX-widgets-on-the-same-line-side-by-side-1.png +0 -0
  54. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-highlight.test.tsx/MarkdownEditor---JSX-attribute-highlighting-does-not-let-the-nested-HTML-parser-mis-highlight-attributes-after-an-expression-1.png +0 -0
  55. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-inline-click.test.tsx/MarkdownEditor---inline-JSX-click-reveal-reveals-the-raw-source-when-an-inline-component-badge-is-clicked-1.png +0 -0
  56. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-inline-click.test.tsx/MarkdownEditor---inline-JSX-click-reveal-reveals-the-raw-source-when-an-inline-component-badge-is-clicked-2.png +0 -0
  57. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-inline-click.test.tsx/MarkdownEditor---inline-JSX-click-reveal-reveals-the-raw-source-when-an-inline-component-badge-is-clicked-3.png +0 -0
  58. package/tests/e2e/MarkdownEditor/__screenshots__/jsx-selection.test.tsx/MarkdownEditor---JSX-selection-reveal-shows-JSX-widget-when-inactive-and-raw-source-when-caret-is-inside-the-tag-1.png +0 -0
  59. package/tests/e2e/MarkdownEditor/__screenshots__/media-sizing.test.tsx/MarkdownEditor---media-sizing-images-and-videos-do-not-exceed-the-editor-content-width-1.png +0 -0
  60. package/tests/e2e/MarkdownEditor/__screenshots__/media-sizing.test.tsx/MarkdownEditor---media-sizing-matches-MarkdownViewer-image-width-in-the-split-playground-1.png +0 -0
  61. package/tests/e2e/MarkdownEditor/__screenshots__/modes.test.tsx/MarkdownEditor---modes-standalone-MarkdownViewer-is-not-a-CodeMirror-surface-1.png +0 -0
  62. package/tests/e2e/MarkdownEditor/__screenshots__/modes.test.tsx/MarkdownEditor---modes-toggling-the-SegmentedControl-swaps-mode-without-remounting-the-editor-1.png +0 -0
  63. package/tests/e2e/MarkdownEditor/__screenshots__/regressions.test.tsx/MarkdownEditor---regressions-repeated-checkbox-toggles-do-not-duplicate-or-drift-task-markers-1.png +0 -0
  64. package/tests/e2e/MarkdownEditor/__screenshots__/regressions.test.tsx/MarkdownEditor---regressions-scroll-position-is-preserved-when-the-document-is-edited--chat-92584463--1.png +0 -0
  65. package/tests/e2e/MarkdownEditor/__screenshots__/regressions.test.tsx/MarkdownEditor---regressions-task-checkbox-toggles-between-checked-and-unchecked-in-the-source-document-1.png +0 -0
  66. package/tests/e2e/MarkdownEditor/__screenshots__/regressions.test.tsx/MarkdownEditor---regressions-toggle-via-checkbox-preserves-task-marker-widgets-visible-from-the-previous-caret-position-1.png +0 -0
  67. package/tests/e2e/MarkdownEditor/__screenshots__/slash-commands.test.tsx/MarkdownEditor---slash-commands-dismisses-on-Escape-and-leaves-the-slash-as-literal-text-1.png +0 -0
  68. package/tests/e2e/MarkdownEditor/__screenshots__/slash-commands.test.tsx/MarkdownEditor---slash-commands-highlights-the-slash-and-shows-an-Enter-command-placeholder-until-text-is-typed-1.png +0 -0
  69. package/tests/e2e/MarkdownEditor/__screenshots__/slash-commands.test.tsx/MarkdownEditor---slash-commands-opens-a-filtered--keyboard-navigable-menu-and-inserts-boilerplate-on-Enter-1.png +0 -0
  70. package/tests/e2e/MarkdownEditor/__screenshots__/undo-redo.test.tsx/MarkdownEditor---undo-and-redo-restores-undone-document-edits-via-redo-1.png +0 -0
  71. package/tests/e2e/MarkdownEditor/content-blocks.test.tsx +0 -153
  72. package/tests/e2e/MarkdownEditor/edits.test.tsx +0 -112
  73. package/tests/e2e/MarkdownEditor/heading-fold.test.tsx +0 -45
  74. package/tests/e2e/MarkdownEditor/hybrid-widgets.test.tsx +0 -193
  75. package/tests/e2e/MarkdownEditor/image-on-image.test.tsx +0 -73
  76. package/tests/e2e/MarkdownEditor/jsx-block-content.test.tsx +0 -243
  77. package/tests/e2e/MarkdownEditor/jsx-highlight.test.tsx +0 -69
  78. package/tests/e2e/MarkdownEditor/jsx-inline-badges.test.tsx +0 -60
  79. package/tests/e2e/MarkdownEditor/jsx-inline-click.test.tsx +0 -54
  80. package/tests/e2e/MarkdownEditor/jsx-selection.test.tsx +0 -44
  81. package/tests/e2e/MarkdownEditor/link-placeholder.test.tsx +0 -68
  82. package/tests/e2e/MarkdownEditor/media-align.test.tsx +0 -58
  83. package/tests/e2e/MarkdownEditor/media-edit.test.tsx +0 -64
  84. package/tests/e2e/MarkdownEditor/media-sizing.test.tsx +0 -124
  85. package/tests/e2e/MarkdownEditor/modes.test.tsx +0 -94
  86. package/tests/e2e/MarkdownEditor/onimage-parity.test.tsx +0 -50
  87. package/tests/e2e/MarkdownEditor/regressions.test.tsx +0 -223
  88. package/tests/e2e/MarkdownEditor/slash-commands.test.tsx +0 -100
  89. package/tests/e2e/MarkdownEditor/table-click.test.tsx +0 -48
  90. package/tests/e2e/MarkdownEditor/table-controls.test.tsx +0 -57
  91. package/tests/e2e/MarkdownEditor/table-format.test.tsx +0 -42
  92. package/tests/e2e/MarkdownEditor/undo-redo.test.tsx +0 -39
  93. package/tests/e2e/MarkdownViewer/__screenshots__/parity.test.tsx/MarkdownViewer---editor-parity-matches-computed-font-size-on-first-heading-1.png +0 -0
  94. package/tests/e2e/MarkdownViewer/__screenshots__/parity.test.tsx/MarkdownViewer---editor-parity-matches-counts-for-shared-structural-classes-1.png +0 -0
  95. package/tests/e2e/MarkdownViewer/__screenshots__/parity.test.tsx/MarkdownViewer---editor-parity-matches-visible-text-between-preview-editor--blurred--and-MarkdownViewer-1.png +0 -0
  96. package/tests/e2e/MarkdownViewer/__screenshots__/render.test.tsx/MarkdownViewer---render-exercises-shared-preview-class-names-without-mounting-CodeMirror-1.png +0 -0
  97. package/tests/e2e/MarkdownViewer/parity.test.tsx +0 -191
  98. package/tests/e2e/MarkdownViewer/render.test.tsx +0 -36
  99. package/tests/e2e/Stacker/stacker.test.tsx +0 -304
  100. package/tests/unit/Editor/helpers.test.ts +0 -42
  101. package/tests/unit/MarkdownConformance/error-isolation.test.tsx +0 -44
  102. package/tests/unit/MarkdownConformance/indentation.test.tsx +0 -30
  103. package/tests/unit/MarkdownConformance/inline-code-fuzz.test.tsx +0 -255
  104. package/tests/unit/MarkdownConformance/jsx-attributes.test.tsx +0 -57
  105. package/tests/unit/MarkdownConformance/jsx-fuzz.test.tsx +0 -165
  106. package/tests/unit/MarkdownConformance/links.test.tsx +0 -95
  107. package/tests/unit/MarkdownConformance/render-helpers.tsx +0 -88
  108. package/tests/unit/MarkdownEditor/code-info.test.ts +0 -63
  109. package/tests/unit/MarkdownEditor/decorations.test.ts +0 -490
  110. package/tests/unit/MarkdownEditor/editor-ready.test.ts +0 -36
  111. package/tests/unit/MarkdownEditor/html-descriptors.test.ts +0 -94
  112. package/tests/unit/MarkdownEditor/indented-fence.test.ts +0 -103
  113. package/tests/unit/MarkdownEditor/jsx-attr-scan.test.ts +0 -115
  114. package/tests/unit/MarkdownEditor/jsx-block-widget.test.ts +0 -92
  115. package/tests/unit/MarkdownEditor/jsx-tag-grammar.test.ts +0 -88
  116. package/tests/unit/MarkdownEditor/list-indent.test.ts +0 -95
  117. package/tests/unit/MarkdownEditor/slash-commands.test.ts +0 -213
  118. package/tests/unit/MarkdownEditor/table-format.test.ts +0 -83
  119. package/tests/unit/MarkdownEditor/table.test.ts +0 -119
  120. package/tests/unit/MarkdownEditor/triggers.test.ts +0 -244
  121. package/tests/unit/MarkdownEditor/widget-store.test.ts +0 -105
  122. package/tests/unit/MarkdownViewer/callout.test.tsx +0 -60
  123. package/tests/unit/MarkdownViewer/code-highlight.test.tsx +0 -61
  124. package/tests/unit/MarkdownViewer/code-title.test.tsx +0 -62
  125. package/tests/unit/MarkdownViewer/features.test.tsx +0 -164
  126. package/tests/unit/MarkdownViewer/headings.test.tsx +0 -40
  127. package/tests/unit/MarkdownViewer/indented-jsx-children.test.tsx +0 -98
  128. package/tests/unit/MarkdownViewer/jsx-block-nesting.test.tsx +0 -234
  129. package/tests/unit/MarkdownViewer/jsx.test.tsx +0 -211
  130. package/tests/unit/MarkdownViewer/list-bullets.test.tsx +0 -49
  131. package/tests/unit/MarkdownViewer/list-code.test.tsx +0 -65
  132. package/tests/unit/MarkdownViewer/preserve-newlines.test.tsx +0 -143
  133. package/tests/unit/MarkdownViewer/read-time.test.ts +0 -21
  134. package/tests/unit/MarkdownViewer/renderers.test.tsx +0 -95
  135. package/tests/unit/MarkdownViewer/runnable.test.tsx +0 -69
  136. package/tests/unit/MarkdownViewer/ssr.test.tsx +0 -94
  137. package/tests/unit/MarkdownViewer/syntax-highlighting.test.tsx +0 -74
  138. package/tests/unit/MarkdownViewer/tabs-fenced-code.test.tsx +0 -196
  139. package/tests/unit/MarkdownViewer/tabs.test.tsx +0 -116
  140. package/tests/unit/Stacker/drag.test.ts +0 -21
  141. package/tests/unit/Stacker/helpers.test.ts +0 -105
  142. package/tests/unit/Stacker/reducer.test.ts +0 -107
  143. package/tests/unit/Syntax/language.test.ts +0 -63
  144. package/tools/duplicate-vector-mappings.json +0 -143
  145. package/tools/glass-export-overrides.json +0 -8
  146. package/tools/icon-parser.ts +0 -78
  147. package/tools/integration-gradient-exports.json +0 -57
  148. package/tools/picto-compare.ts +0 -64
  149. package/tools/picto-merge-urls.ts +0 -43
  150. package/tools/picto-sync.ts +0 -630
  151. package/tools/picto-verify-gradients.ts +0 -86
  152. package/tools/vector-export-nodes.json +0 -977
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@surrealdb/ui",
3
- "version": "1.2.16",
3
+ "version": "1.2.18",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
7
7
  ".": {
8
- "types": "./dist/index.d.ts",
8
+ "types": "./dist/ui.d.ts",
9
9
  "import": "./dist/ui.js"
10
10
  },
11
11
  "./icons": {
@@ -22,6 +22,12 @@
22
22
  "import": "./res/_mixins.scss"
23
23
  }
24
24
  },
25
+ "files": [
26
+ "README.md",
27
+ "package.json",
28
+ "dist/",
29
+ "res/"
30
+ ],
25
31
  "scripts": {
26
32
  "build": "vite build",
27
33
  "storybook:dev": "storybook dev -p 6006 --ci",
@@ -1,17 +0,0 @@
1
- {
2
- "version": "0.0.1",
3
- "configurations": [
4
- {
5
- "name": "storybook",
6
- "runtimeExecutable": "npm",
7
- "runtimeArgs": ["run", "storybook:dev"],
8
- "port": 6006
9
- },
10
- {
11
- "name": "storybook-preview",
12
- "runtimeExecutable": "npx",
13
- "runtimeArgs": ["storybook", "dev", "-p", "6019", "--ci", "--no-open"],
14
- "port": 6019
15
- }
16
- ]
17
- }
package/.oxfmtrc.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "./node_modules/oxfmt/configuration_schema.json",
3
- "useTabs": true,
4
- "tabWidth": 4,
5
- "printWidth": 100,
6
- "singleQuote": false,
7
- "jsxSingleQuote": false,
8
- "quoteProps": "as-needed",
9
- "trailingComma": "all",
10
- "semi": true,
11
- "arrowParens": "always",
12
- "bracketSameLine": false,
13
- "bracketSpacing": true,
14
- "singleAttributePerLine": true,
15
- "sortImports": true,
16
- "sortPackageJson": false,
17
- "ignorePatterns": [
18
- "**/.vscode",
19
- "**/.github",
20
- "**/.turbo",
21
- "**/node_modules",
22
- "**/dist",
23
- "**/storybook-static",
24
- "**/src/constants/icons.ts",
25
- "**/src/constants/icons-pure.ts"
26
- ]
27
- }
package/.oxlintrc.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "plugins": ["react", "unicorn", "typescript", "oxc"],
4
- "categories": {
5
- "correctness": "warn"
6
- },
7
- "rules": {
8
- "no-unused-vars": "warn",
9
- "unicorn/no-thenable": "off",
10
- "react/no-array-index-key": "off",
11
- "react/exhaustive-deps": "off"
12
- },
13
- "ignorePatterns": [
14
- "**/.vscode",
15
- "**/.github",
16
- "**/.turbo",
17
- "**/node_modules",
18
- "**/dist",
19
- "**/storybook-static",
20
- "**/src/constants/icons.ts",
21
- "**/src/constants/icons-pure.ts"
22
- ]
23
- }
Binary file
Binary file
Binary file
Binary file
@@ -1,36 +0,0 @@
1
- {
2
- "languages": {
3
- "CSS": { "formatter": { "language_server": { "name": "biome" } } },
4
- "HTML": { "formatter": { "language_server": { "name": "biome" } } },
5
- "JSON": { "formatter": { "language_server": { "name": "biome" } } },
6
- "JSONC": { "formatter": { "language_server": { "name": "biome" } } },
7
- "JavaScript": {
8
- "formatter": { "language_server": { "name": "biome" } },
9
- "code_actions_on_format": {
10
- "source.fixAll.biome": true,
11
- "source.organizeImports.biome": true
12
- }
13
- },
14
- "TypeScript": {
15
- "formatter": { "language_server": { "name": "biome" } },
16
- "code_actions_on_format": {
17
- "source.fixAll.biome": true,
18
- "source.organizeImports.biome": true
19
- }
20
- },
21
- "TSX": {
22
- "formatter": { "language_server": { "name": "biome" } },
23
- "code_actions_on_format": {
24
- "source.fixAll.biome": true,
25
- "source.organizeImports.biome": true
26
- }
27
- }
28
- },
29
- "lsp": {
30
- "biome": {
31
- "settings": {
32
- "require_config_file": true
33
- }
34
- }
35
- }
36
- }
package/AGENTS.md DELETED
@@ -1,111 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This is `@surrealdb/ui` — the SurrealDB design system and UI component library, published to npm as a reusable package for all SurrealDB frontend projects.
4
-
5
- ## Tooling
6
-
7
- - **Runtime & package manager:** Bun (do NOT use npm, yarn, or pnpm)
8
- - **Build:** Vite 7 in library mode, targeting ES2022 with source maps
9
- - **Language:** TypeScript with `isolatedDeclarations` enabled — all exported types must be explicitly annotated
10
- - **UI framework:** React 19 with JSX transform (`react-jsx`)
11
- - **Component library:** Mantine v8 (peer dependency)
12
- - **Linter/formatter:** Biome 2.x — 4-space indentation, 100-character line width
13
- - **Storybook:** Storybook 10 with `@storybook/react-vite`
14
- - **Testing:** Vitest with Playwright browser provider for Storybook integration tests
15
-
16
- ## Commands
17
-
18
- | Command | Description |
19
- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
20
- | `bun install` | Install dependencies |
21
- | `bun run build` | Production build (outputs to `dist/`) |
22
- | `bun run storybook:dev` | Start Storybook dev server on port 6006 |
23
- | `bun run storybook:build` | Build static Storybook site |
24
- | `bun qc` | Run Biome lint/format check |
25
- | `bun qa` | Auto-fix Biome lint/format issues |
26
- | `bun qau` | Auto-fix including unsafe fixes |
27
- | `bun qts` | TypeScript type check (`tsc --noEmit`) |
28
- | `bun run test` | Run all Vitest projects (unit + e2e + storybook). Use `bun run test`, not `bun test`, since `bun test` invokes Bun's own test runner. |
29
- | `bun run test:unit` | Run jsdom-based unit tests in `tests/unit/` |
30
- | `bun run test:e2e` | Run browser-driven E2E tests in `tests/e2e/` (Playwright + Chromium) |
31
- | `bun run test:storybook` | Run in-story `play` interaction tests via the Storybook Vitest plugin |
32
- | `bun run test:watch` | Watch all projects |
33
- | `bun run icons` | Regenerate icon constants from `icons.zip` (requires `picosvg`) |
34
-
35
- ## Path Aliases
36
-
37
- `@src/*` maps to `./src/*` (configured in `tsconfig.json` and resolved by `vite-tsconfig-paths`).
38
-
39
- ## Styling
40
-
41
- - SCSS modules (`.module.scss`) with `dashesOnly` locals convention — access classes as `styles.myClass`, not `styles["my-class"]`
42
- - All `.scss` files auto-import `@surrealdb/ui/mixins` via Vite's `additionalData`, providing global access to theme-aware mixins:
43
- - `@include light { ... }` / `@include dark { ... }` — color scheme scoping
44
- - `@include sm-and-up { ... }`, `@include md-and-down { ... }`, etc. — responsive breakpoints
45
- - Global CSS variables are defined in `src/assets/styles/global.scss` (prefixed `--surreal-*`)
46
- - Mantine design tokens available as `--mantine-color-*` CSS variables
47
- - Build output CSS is automatically wrapped in `@layer surreal` by a custom Vite plugin
48
-
49
- ## Exports
50
-
51
- The package exposes three entry points:
52
-
53
- - `@surrealdb/ui` — all components, hooks, helpers, and constants (from `src/index.ts`)
54
- - `@surrealdb/ui/styles.css` — compiled CSS (wrapped in `@layer surreal`)
55
- - `@surrealdb/ui/mixins` — raw SCSS mixins (from `res/_mixins.scss`)
56
-
57
- ## Source Structure
58
-
59
- ```
60
- src/
61
- ├── assets/ # Static assets: brand SVGs, picto WebPs, global SCSS styles
62
- ├── constants/ # Generated/static constants (icons.ts, brands.ts, pictos.ts)
63
- ├── editor/ # CodeMirror editor setup: extensions, keybinds, commands, theme
64
- ├── helpers/ # Utility functions (clsx, CDN URL helper, ID generator)
65
- ├── hooks/ # React hooks (useEditor, useStable, useLater, useSort, useSwitch)
66
- ├── lib/
67
- │ ├── editor/ # Custom Code Mirror editor configuration and extensions
68
- │ └── markdown/ # Custom Code Mirror based markdown editor and renderer
69
- ├── primitives/ # React UI components (Icon, CodeBlock, Spinner, VideoPlayer, etc.)
70
- ├── stories/ # Storybook stories organized by category
71
- ├── syntax/ # Syntax highlighting: language definitions, highlighter, theme
72
- ├── theme/ # Mantine theme override (mantine.ts)
73
- └── types/ # TypeScript module augmentations for Mantine (colors, variants, spacing)
74
- ```
75
-
76
- Other top-level directories:
77
-
78
- - `res/` — SCSS mixins exported as `@surrealdb/ui/mixins`
79
- - `tests/` — Vitest test suites: `tests/unit/<Feature>/` (jsdom) and `tests/e2e/<Feature>/` (Playwright + Chromium); shared mount/composeStories helpers live in `tests/_setup/`
80
- - `tools/` — Icon parser script (`icon-parser.ts`)
81
- - `.storybook/` — Storybook configuration (main, preview, vitest setup)
82
- - `.github/workflows/` — CI (`check.yml`) and publish (`publish.yml`) workflows
83
- - `dist/` — Build output (gitignored)
84
-
85
- ## Peer Dependencies
86
-
87
- Consumers must provide: React 19, Mantine 8, CodeMirror 6 suite, and Slate. These are externalized during build.
88
-
89
- ## CI/CD
90
-
91
- - **check.yml** — Runs on push/PR to `main`: Biome lint, TypeScript check, build, and three independent test jobs (`test-unit`, `test-e2e`, `test-storybook`) on Bun 1.2.23. The two browser jobs install Playwright Chromium with `bunx playwright install --with-deps chromium`.
92
- - **publish.yml** — Triggered by GitHub release: asserts `package.json` version matches git tag, builds, packs, and publishes to npm
93
-
94
- ## Conventions
95
-
96
- - `useStable` hook is configured as returning a stable reference in Biome's `useExhaustiveDependencies` rule — do not list its return value in dependency arrays
97
- - The `src/constants/icons.ts` file is auto-generated — do not edit it manually
98
- - Biome excludes: `.vscode/`, `.github/`, `.storybook/`, `src/constants/icons.ts`, `dist/`, and `*.js` files
99
-
100
- ## Releasing
101
-
102
- See [release.md](doc/release.md)
103
-
104
- ## Variants
105
-
106
- When adding new variants, take the following into consideration:
107
-
108
- - Styling is defined in `src/assets/styles/variants.scss`
109
- - Types are defined in `src/types/variants.ts`
110
- - The default variant is configured in `src/theme/mantine.ts`
111
- - Update the relevant storybook story to show the new variant
package/CLAUDE.md DELETED
@@ -1,111 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This is `@surrealdb/ui` — the SurrealDB design system and UI component library, published to npm as a reusable package for all SurrealDB frontend projects.
4
-
5
- ## Tooling
6
-
7
- - **Runtime & package manager:** Bun (do NOT use npm, yarn, or pnpm)
8
- - **Build:** Vite 7 in library mode, targeting ES2022 with source maps
9
- - **Language:** TypeScript with `isolatedDeclarations` enabled — all exported types must be explicitly annotated
10
- - **UI framework:** React 19 with JSX transform (`react-jsx`)
11
- - **Component library:** Mantine v8 (peer dependency)
12
- - **Linter/formatter:** Biome 2.x — 4-space indentation, 100-character line width
13
- - **Storybook:** Storybook 10 with `@storybook/react-vite`
14
- - **Testing:** Vitest with Playwright browser provider for Storybook integration tests
15
-
16
- ## Commands
17
-
18
- | Command | Description |
19
- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
20
- | `bun install` | Install dependencies |
21
- | `bun run build` | Production build (outputs to `dist/`) |
22
- | `bun run storybook:dev` | Start Storybook dev server on port 6006 |
23
- | `bun run storybook:build` | Build static Storybook site |
24
- | `bun qc` | Run Biome lint/format check |
25
- | `bun qa` | Auto-fix Biome lint/format issues |
26
- | `bun qau` | Auto-fix including unsafe fixes |
27
- | `bun qts` | TypeScript type check (`tsc --noEmit`) |
28
- | `bun run test` | Run all Vitest projects (unit + e2e + storybook). Use `bun run test`, not `bun test`, since `bun test` invokes Bun's own test runner. |
29
- | `bun run test:unit` | Run jsdom-based unit tests in `tests/unit/` |
30
- | `bun run test:e2e` | Run browser-driven E2E tests in `tests/e2e/` (Playwright + Chromium) |
31
- | `bun run test:storybook` | Run in-story `play` interaction tests via the Storybook Vitest plugin |
32
- | `bun run test:watch` | Watch all projects |
33
- | `bun run icons` | Regenerate icon constants from `icons.zip` (requires `picosvg`) |
34
-
35
- ## Path Aliases
36
-
37
- `@src/*` maps to `./src/*` (configured in `tsconfig.json` and resolved by `vite-tsconfig-paths`).
38
-
39
- ## Styling
40
-
41
- - SCSS modules (`.module.scss`) with `dashesOnly` locals convention — access classes as `styles.myClass`, not `styles["my-class"]`
42
- - All `.scss` files auto-import `@surrealdb/ui/mixins` via Vite's `additionalData`, providing global access to theme-aware mixins:
43
- - `@include light { ... }` / `@include dark { ... }` — color scheme scoping
44
- - `@include sm-and-up { ... }`, `@include md-and-down { ... }`, etc. — responsive breakpoints
45
- - Global CSS variables are defined in `src/assets/styles/global.scss` (prefixed `--surreal-*`)
46
- - Mantine design tokens available as `--mantine-color-*` CSS variables
47
- - Build output CSS is automatically wrapped in `@layer surreal` by a custom Vite plugin
48
-
49
- ## Exports
50
-
51
- The package exposes three entry points:
52
-
53
- - `@surrealdb/ui` — all components, hooks, helpers, and constants (from `src/index.ts`)
54
- - `@surrealdb/ui/styles.css` — compiled CSS (wrapped in `@layer surreal`)
55
- - `@surrealdb/ui/mixins` — raw SCSS mixins (from `res/_mixins.scss`)
56
-
57
- ## Source Structure
58
-
59
- ```
60
- src/
61
- ├── assets/ # Static assets: brand SVGs, picto WebPs, global SCSS styles
62
- ├── constants/ # Generated/static constants (icons.ts, brands.ts, pictos.ts)
63
- ├── editor/ # CodeMirror editor setup: extensions, keybinds, commands, theme
64
- ├── helpers/ # Utility functions (clsx, CDN URL helper, ID generator)
65
- ├── hooks/ # React hooks (useEditor, useStable, useLater, useSort, useSwitch)
66
- ├── lib/
67
- │ ├── editor/ # Custom Code Mirror editor configuration and extensions
68
- │ └── markdown/ # Custom Code Mirror based markdown editor and renderer
69
- ├── primitives/ # React UI components (Icon, CodeBlock, Spinner, VideoPlayer, etc.)
70
- ├── stories/ # Storybook stories organized by category
71
- ├── syntax/ # Syntax highlighting: language definitions, highlighter, theme
72
- ├── theme/ # Mantine theme override (mantine.ts)
73
- └── types/ # TypeScript module augmentations for Mantine (colors, variants, spacing)
74
- ```
75
-
76
- Other top-level directories:
77
-
78
- - `res/` — SCSS mixins exported as `@surrealdb/ui/mixins`
79
- - `tests/` — Vitest test suites: `tests/unit/<Feature>/` (jsdom) and `tests/e2e/<Feature>/` (Playwright + Chromium); shared mount/composeStories helpers live in `tests/_setup/`
80
- - `tools/` — Icon parser script (`icon-parser.ts`)
81
- - `.storybook/` — Storybook configuration (main, preview, vitest setup)
82
- - `.github/workflows/` — CI (`check.yml`) and publish (`publish.yml`) workflows
83
- - `dist/` — Build output (gitignored)
84
-
85
- ## Peer Dependencies
86
-
87
- Consumers must provide: React 19, Mantine 8, CodeMirror 6 suite, and Slate. These are externalized during build.
88
-
89
- ## CI/CD
90
-
91
- - **check.yml** — Runs on push/PR to `main`: Biome lint, TypeScript check, build, and three independent test jobs (`test-unit`, `test-e2e`, `test-storybook`) on Bun 1.2.23. The two browser jobs install Playwright Chromium with `bunx playwright install --with-deps chromium`.
92
- - **publish.yml** — Triggered by GitHub release: asserts `package.json` version matches git tag, builds, packs, and publishes to npm
93
-
94
- ## Conventions
95
-
96
- - `useStable` hook is configured as returning a stable reference in Biome's `useExhaustiveDependencies` rule — do not list its return value in dependency arrays
97
- - The `src/constants/icons.ts` file is auto-generated — do not edit it manually
98
- - Biome excludes: `.vscode/`, `.github/`, `.storybook/`, `src/constants/icons.ts`, `dist/`, and `*.js` files
99
-
100
- ## Releasing
101
-
102
- See [release.md](doc/release.md)
103
-
104
- ## Variants
105
-
106
- When adding new variants, take the following into consideration:
107
-
108
- - Styling is defined in `src/assets/styles/variants.scss`
109
- - Types are defined in `src/types/variants.ts`
110
- - The default variant is configured in `src/theme/mantine.ts`
111
- - Update the relevant storybook story to show the new variant
package/REVIEW.md DELETED
@@ -1,81 +0,0 @@
1
- # Code Review Guidelines
2
-
3
- Before marking any task as done, verify every applicable section below.
4
-
5
- ## Code Quality
6
-
7
- - **Biome**: run `bun qc` and confirm zero errors. Do not suppress or ignore lint rules without justification.
8
- - **TypeScript**: run `bun qts` and confirm zero type errors. All exported functions and types must have explicit type annotations (`isolatedDeclarations` is enabled).
9
- - **Formatting**: 4-space indentation, 100-character line width, multiline JSX attributes. Run `bun qa` to auto-fix if needed.
10
- - **Unused imports**: Biome warns on unused imports — remove them before committing.
11
- - **Unused code**: do not leave behind dead code, commented-out blocks, or `console.log` statements.
12
-
13
- ## Components
14
-
15
- - **Mantine first**: use Mantine components (`Box`, `Text`, `Group`, `Stack`, etc.) over raw HTML elements. Use `<Box>` instead of `<div>`.
16
- - **Props interface**: extend `BoxProps` or the appropriate Mantine component props type. Export the props interface alongside the component.
17
- - **Prop spreading**: spread remaining props (`...rest`) onto the root element so consumers can pass through Mantine attributes.
18
- - **clsx**: use `clsx` from `@src/helpers/clsx` (the project's own implementation), not the npm `clsx` package.
19
- - **Return type**: use `ReactNode` for function declarations or `FC<Props>` for arrow functions — match the convention of surrounding code.
20
-
21
- ## Styling
22
-
23
- - **SCSS modules**: styles go in `style.module.scss` next to the component. Import as `import classes from "./style.module.scss"`.
24
- - **dashesOnly**: access class names as `classes.myClass`, never `classes["my-class"]`.
25
- - **Dynamic values**: use Mantine's `__vars` prop to pass CSS custom properties for dynamic size/color — not inline styles.
26
- - **Design tokens**: reference Mantine tokens (`--mantine-color-*`) and SurrealDB tokens (`--surreal-*`). Do not hardcode color hex values in SCSS unless defining a new token.
27
- - **Light/dark theme**: any color that differs between themes must use `@include light { ... }` and `@include dark { ... }` mixins. Verify the component looks correct in both color schemes.
28
- - **Responsive**: use the breakpoint mixins (`@include sm-and-up`, `@include md-and-down`, etc.) instead of raw `@media` queries.
29
- - **No global styles**: do not add styles to `global.scss` or `variants.scss` unless defining a new design token. Component styles belong in SCSS modules.
30
-
31
- ## Exports
32
-
33
- - **Re-export from index**: new components, hooks, helpers, or types must be re-exported from `src/index.ts`. Missing re-exports break the public API.
34
- - **Explicit type exports**: use `export type` for type-only exports (required by `isolatedDeclarations` and `verbatimModuleSyntax`).
35
-
36
- ## Storybook
37
-
38
- - **Story exists**: every primitive component must have a corresponding story in `src/stories/primitives/`. Mantine-themed component demos go in `src/stories/mantine/`.
39
- - **CSF3 format**: stories must use Component Story Format 3 with a typed `meta` default export and `StoryObj` named exports.
40
- - **Title convention**: use the correct prefix (`Primitives/`, `Mantine/`, `Catalog/`, or `Playground/`) in the story `title`.
41
- - **No providers in stories**: do not wrap stories in `MantineProvider` — this is handled globally by `.storybook/preview.tsx`.
42
- - **Shared arg types**: reuse `size` and `icon` from `src/stories/arg-types/` instead of redefining them.
43
-
44
- ## Testing
45
-
46
- - **Tests pass**: run `bun run test:unit` and `bun run test:e2e` and confirm all tests pass. Do not skip or disable tests without justification.
47
- - **Markdown parser**: changes to `src/lib/markdown/` must include tests. Markdown tests live under `tests/unit/MarkdownEditor`, `tests/unit/MarkdownViewer`, and `tests/unit/MarkdownConformance`; run `bun run test:unit` (and `bun run test:e2e` for the parity suites) to verify. Update snapshots only when the change is intentional.
48
- - **Snapshot review**: if snapshots are updated, verify the diff reflects the intended change — not unrelated side effects.
49
-
50
- ## Dependencies
51
-
52
- - **Justify new packages**: new external dependencies require justification. Prefer small helper functions over adding utility packages.
53
- - **Peer vs direct**: UI framework dependencies (React, Mantine, CodeMirror, Slate) are peer dependencies — never add them to `dependencies`.
54
- - **Package manager**: use `bun` exclusively. Do not use npm, yarn, or pnpm commands. Do not commit `package-lock.json`, `yarn.lock`, or `pnpm-lock.yaml`.
55
-
56
- ## Generated Files
57
-
58
- - **Do not edit**: `src/constants/icons.ts` is auto-generated by `bun run icons`. Never edit it manually.
59
- - **Do not edit**: `bun.lock` is managed by Bun. Do not manually modify it.
60
- - **Do not commit**: `dist/`, `node_modules/`, `storybook-static/`, and `.tgz` files are gitignored.
61
-
62
- ## Security
63
-
64
- - **No secrets**: credentials, tokens, and API keys must not appear in source code, console logs, or error messages.
65
- - **No `.env` files**: do not commit `.env` or any environment variable files.
66
-
67
- ## Build Compatibility
68
-
69
- - **ES2022 target**: do not use syntax or APIs that require a target newer than ES2022.
70
- - **Tree-shaking**: the package is marked `"sideEffects": false`. Ensure new modules do not introduce top-level side effects outside of style imports.
71
- - **CSS layer**: all component CSS is wrapped in `@layer surreal` at build time. Do not add `@layer` directives in SCSS modules — the Vite plugin handles this.
72
-
73
- ## Hooks
74
-
75
- - **useStable**: the return value of `useStable` is a stable reference — do not include it in React dependency arrays. Biome enforces this automatically.
76
- - **useExhaustiveDependencies**: Biome enforces exhaustive deps at error level. Do not suppress this rule; fix the dependency array instead.
77
-
78
- ## Skip
79
-
80
- - Formatting and linting auto-fixes (enforced by `bun qa` / `bun qau`).
81
- - Biome-excluded files: `.vscode/`, `.github/`, `.storybook/`, `src/constants/icons.ts`, `dist/`, `*.js`.