@clerk/mosaic 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Clerk, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ <p align="center">
2
+ <a href="https://clerk.com?utm_source=github&utm_medium=clerk_mosaic" target="_blank" rel="noopener noreferrer">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: dark)" srcset="https://images.clerk.com/static/logo-dark-mode-400x400.png">
5
+ <img src="https://images.clerk.com/static/logo-light-mode-400x400.png" height="64">
6
+ </picture>
7
+ </a>
8
+ <br />
9
+ <h1 align="center">@clerk/mosaic</h1>
10
+ </p>
11
+
12
+ <div align="center">
13
+
14
+ [![Clerk documentation](https://img.shields.io/badge/documentation-clerk-green.svg)](https://clerk.com/docs?utm_source=github&utm_medium=clerk_mosaic)
15
+ [![Follow on X](https://img.shields.io/twitter/follow/clerk?style=social)](https://x.com/intent/follow?screen_name=clerk)
16
+
17
+ [Changelog](https://github.com/clerk/javascript/blob/main/packages/mosaic/CHANGELOG.md)
18
+ ·
19
+ [Report a Bug](https://github.com/clerk/javascript/issues/new?assignees=&labels=needs-triage&projects=&template=BUG_REPORT.yml)
20
+ ·
21
+ [Request a Feature](https://feedback.clerk.com/roadmap)
22
+ ·
23
+ [Get help](https://clerk.com/contact/support?utm_source=github&utm_medium=clerk_mosaic)
24
+
25
+ </div>
26
+
27
+ ## Getting started
28
+
29
+ `@clerk/mosaic` provides Clerk's experimental next-generation React components.
30
+
31
+ This package lets you preview and provide feedback on Clerk's next generation of components.
32
+
33
+ When stable, components will move to be exported through the regular packages.
34
+
35
+ > :construction: We reserve the right to make breaking changes in minors, please pin your version.
36
+
37
+ ### Prerequisites
38
+
39
+ - Node.js `>=20.9.0` or later
40
+ - A supported React-based Clerk SDK that renders a `ClerkProvider`
41
+ - `@clerk/react` version 6 or later
42
+ - `@clerk/nextjs` version 7 or later
43
+ - Other React-based Clerk SDKs may also work, but are currently untested
44
+ - React 18 or 19
45
+
46
+ ### Installation
47
+
48
+ ```shell
49
+
50
+ npm install --save-exact @clerk/mosaic
51
+ pnpm add --save-exact @clerk/mosaic
52
+ yarn add --exact @clerk/mosaic
53
+ ```
54
+
55
+ ## Usage
56
+
57
+ Import the stylesheet and render Mosaic components beneath the SDK `ClerkProvider`:
58
+
59
+ ```tsx
60
+ import { ClerkProvider } from '@clerk/react';
61
+ import { UserButton } from '@clerk/mosaic';
62
+ import '@clerk/mosaic/styles.css';
63
+
64
+ export function App({ children }) {
65
+ return (
66
+ <ClerkProvider publishableKey={process.env.CLERK_PUBLISHABLE_KEY}>
67
+ <UserButton />
68
+ {children}
69
+ </ClerkProvider>
70
+ );
71
+ }
72
+ ```
73
+
74
+ If you want to use custom CSS to theme the components, instead import the stylesheet into a cascade layer:
75
+
76
+ ```css
77
+ @import '@clerk/mosaic/styles.css' layer(components);
78
+ ```
79
+
80
+ This ensures your unlayered custom CSS takes priority. Expect more documentation on custom theming soon.
81
+
82
+ ## Troubleshooting
83
+
84
+ ### A Clerk hook says it can only be used within `<ClerkProvider />`
85
+
86
+ Mosaic and your Clerk framework SDK must resolve the same copy of `@clerk/shared`. If `<ClerkProvider />` is present but you still see this error, deduplicate your dependencies:
87
+
88
+ ```shell
89
+ npm dedupe
90
+ pnpm dedupe
91
+ yarn dedupe @clerk/shared
92
+ ```
93
+
94
+ Check the installed versions:
95
+
96
+ ```shell
97
+ npm ls @clerk/shared
98
+ pnpm why @clerk/shared
99
+ yarn why @clerk/shared
100
+ ```
101
+
102
+ If multiple versions remain, the supported ranges are likely incompatible. Update Mosaic and your Clerk framework SDK to the latest versions, then deduplicate again.
103
+
104
+ ## License
105
+
106
+ This project is licensed under the **MIT license**.
107
+
108
+ See [LICENSE](https://github.com/clerk/javascript/blob/main/packages/mosaic/LICENSE) for more information.
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@clerk/mosaic",
3
+ "version": "0.0.1",
4
+ "description": "Clerk Mosaic UI components",
5
+ "keywords": [
6
+ "clerk",
7
+ "auth",
8
+ "authentication",
9
+ "react",
10
+ "mosaic",
11
+ "ui"
12
+ ],
13
+ "homepage": "https://clerk.com/",
14
+ "bugs": {
15
+ "url": "https://github.com/clerk/javascript/issues"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/clerk/javascript.git",
20
+ "directory": "packages/mosaic"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Clerk",
24
+ "sideEffects": [
25
+ "./dist/styles.css"
26
+ ],
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "default": "./dist/index.js"
33
+ },
34
+ "./styles.css": {
35
+ "types": "./styles.css.d.ts",
36
+ "default": "./dist/styles.css"
37
+ },
38
+ "./package.json": "./package.json"
39
+ },
40
+ "types": "dist/index.d.ts",
41
+ "files": [
42
+ "dist",
43
+ "styles.css.d.ts"
44
+ ],
45
+ "dependencies": {
46
+ "@clerk/shared": "^4.33.0"
47
+ },
48
+ "devDependencies": {
49
+ "@floating-ui/react": "0.27.20",
50
+ "@stylexjs/eslint-plugin": "0.19.0",
51
+ "@stylexjs/rollup-plugin": "0.19.0",
52
+ "@stylexjs/stylex": "0.19.0",
53
+ "@stylexjs/unplugin": "0.19.0",
54
+ "@types/react": "18.3.28",
55
+ "@types/react-dom": "18.3.7",
56
+ "bundlewatch": "^0.4.2",
57
+ "react": "18.3.1",
58
+ "react-dom": "18.3.1",
59
+ "tsdown": "0.22.2",
60
+ "@clerk/headless": "^0.0.34"
61
+ },
62
+ "peerDependencies": {
63
+ "react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0",
64
+ "react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0"
65
+ },
66
+ "engines": {
67
+ "node": ">=20.9.0"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "scripts": {
73
+ "build": "pnpm build:js && pnpm build:css && pnpm check:bundle && pnpm typecheck",
74
+ "build:css": "tsdown --config tsdown.css.config.mts",
75
+ "build:js": "tsdown --config tsdown.config.mts",
76
+ "bundlewatch": "FORCE_COLOR=1 bundlewatch --config bundlewatch.config.json",
77
+ "check:bundle": "node ./scripts/check-bundle.mjs",
78
+ "clean": "rimraf ./dist ./dist-css",
79
+ "dev": "tsdown --config tsdown.config.mts --watch",
80
+ "format": "node ../../scripts/format-package.mjs",
81
+ "format:check": "node ../../scripts/format-package.mjs --check",
82
+ "lint": "eslint src",
83
+ "lint:attw": "attw --pack . --exclude-entrypoints styles.css --profile esm-only",
84
+ "lint:publint": "publint",
85
+ "test": "vitest run",
86
+ "test:ci": "vitest run --maxWorkers=70%",
87
+ "typecheck": "tsc --noEmit"
88
+ }
89
+ }
@@ -0,0 +1 @@
1
+ export {};