@surrealdb/ui 1.2.13 → 1.2.15

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/AGENTS.md CHANGED
@@ -97,6 +97,10 @@ Consumers must provide: React 19, Mantine 8, CodeMirror 6 suite, and Slate. Thes
97
97
  - The `src/constants/icons.ts` file is auto-generated — do not edit it manually
98
98
  - Biome excludes: `.vscode/`, `.github/`, `.storybook/`, `src/constants/icons.ts`, `dist/`, and `*.js` files
99
99
 
100
+ ## Releasing
101
+
102
+ See [release.md](doc/release.md)
103
+
100
104
  ## Variants
101
105
 
102
106
  When adding new variants, take the following into consideration:
package/CLAUDE.md ADDED
@@ -0,0 +1,111 @@
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/dist/icons.d.ts CHANGED
@@ -225,6 +225,8 @@ export declare const KeyboardShift: string;
225
225
 
226
226
  export declare const LangC: string;
227
227
 
228
+ export declare const LangDart: string;
229
+
228
230
  export declare const LangDotNet: string;
229
231
 
230
232
  export declare const LangGo: string;
@@ -326,6 +328,8 @@ export declare const Routes: string;
326
328
 
327
329
  export declare const Sandbox: string;
328
330
 
331
+ export declare const Seal: string;
332
+
329
333
  export declare const Search: string;
330
334
 
331
335
  export declare const Send: string;