Compare commits

...

30 Commits

Author SHA1 Message Date
Guido D'Orsi
f0ae3ace13 Merge pull request #1398 from garden-co/changeset-release/main
Version Packages
2025-02-17 12:45:07 +01:00
github-actions[bot]
cc973137b7 Version Packages 2025-02-17 11:43:44 +00:00
Guido D'Orsi
7fff0e0b36 Merge pull request #1397 from garden-co/fix/existing-account-migration
fix: correct the account migration execution on existing accounts
2025-02-17 12:42:14 +01:00
Guido D'Orsi
6909357f64 test: cover existing account migration with a test on jazz-tools 2025-02-17 12:41:58 +01:00
Guido D'Orsi
59ff77e0dc fix: correct the account migration execution on existing accounts 2025-02-17 12:27:05 +01:00
Benjamin S. Leveritt
a7590d14d6 Merge pull request #1392 from garden-co/jazz-712-delete-hr-onboarding-example
Delete HR Onboarding example
2025-02-17 11:12:52 +00:00
Guido D'Orsi
a5347b613b Merge pull request #1358 from garden-co/fix/dropdown-alignment
Alignment fixes
2025-02-17 10:51:45 +01:00
Guido D'Orsi
9de58bb098 Merge pull request #1387 from garden-co/jazz-510-indicate-activevisible-items-on-table-of-contents
Highlight table of contents active item, styling for side nav active item
2025-02-17 10:49:53 +01:00
Trisha Lim
de1be9ac18 Delete HR Onboarding example 2025-02-17 15:05:58 +07:00
Trisha Lim
43df7f2b48 Fix chat demo section alignment 2025-02-17 11:30:50 +07:00
Trisha Lim
5f4f70d06d Fix side nav error 2025-02-17 11:26:29 +07:00
Trisha Lim
a9aa61c2c0 Set max width on docs body 2025-02-17 11:13:47 +07:00
Trisha Lim
bc0d2fcd23 Use code group in jazz-run command code snippet 2025-02-17 11:06:46 +07:00
Trisha Lim
f5675c49a2 Fix horizontal overflow in docs on mobile 2025-02-17 11:03:01 +07:00
Trisha Lim
da13e9cf7c Dropdown adjustments 2025-02-17 11:02:46 +07:00
Trisha Lim
ab2546ca71 Fix copy button alignment 2025-02-17 11:02:46 +07:00
Trisha Lim
43c36a8c20 Fix dropdown alignment 2025-02-17 11:02:46 +07:00
Trisha Lim
24ad5f42b5 Indicate that examples is outside docs 2025-02-17 10:46:52 +07:00
Trisha Lim
c620d9c87c Make active nav item styling more prominent 2025-02-17 10:38:13 +07:00
Trisha Lim
59121a1f52 Styling for active item on docs side nav 2025-02-17 10:32:51 +07:00
Trisha Lim
f766de8d9e Indicate active/visible items on table of contents 2025-02-17 09:55:52 +07:00
Trisha Lim
eb8621550a Increase space between content and main nav 2025-02-17 09:53:09 +07:00
Trisha Lim
5d28413648 Increase space between side bars and content 2025-02-17 09:53:09 +07:00
Trisha Lim
d0ed7177a3 Reduce font size on headings 2025-02-17 09:53:09 +07:00
Guido D'Orsi
091d753ab4 Merge pull request #1362 from garden-co/fix/missing-focus-styles
Add global focus styles
2025-02-16 11:32:22 +01:00
Guido D'Orsi
87f917d297 Merge pull request #1386 from antoniel/tony/fix-contributing-md
tony/fix-contributing-md
2025-02-16 06:30:17 +01:00
Guido D'Orsi
88acea362a Merge pull request #1382 from boorad/fix/crypto-provider
fix: Add back ability to use different crypto providers for RN
2025-02-16 06:28:38 +01:00
antoniel
0107f4939d docs: update CONTRIBUTING.md with homepage and build steps 2025-02-15 15:49:15 -03:00
Brad Anderson
f468b89994 fix: Add back ability to use different crypto providers for RN 2025-02-15 10:55:55 -05:00
Trisha Lim
302a1e6660 Add global focus styles 2025-02-12 20:23:56 +07:00
139 changed files with 688 additions and 2022 deletions

View File

@@ -19,7 +19,6 @@ jobs:
"pets",
"reactions",
"todo",
"onboarding",
]
steps:

View File

@@ -13,7 +13,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "examples/onboarding", "starters/react-passkey-auth"]
project: ["tests/e2e", "examples/chat", "examples/file-share-svelte", "examples/form", "examples/music-player", "examples/pets", "starters/react-passkey-auth"]
steps:
- uses: actions/checkout@v4

View File

@@ -48,7 +48,19 @@ You'll need Node.js 20.x or 22.x installed (we're working on support for 23.x),
pnpm install
```
3. **Run tests** to verify everything is working:
3. **Install homepage dependencies**:
```bash
cd homepage && pnpm install
```
4. **Build the packages**:
```bash
pnpm build
```
5. **Run tests** to verify everything is working:
```bash
pnpm test
```

View File

@@ -1,5 +1,15 @@
# chat-rn-clerk
## 1.0.70
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react-native@0.10.5
- jazz-react-native-auth-clerk@0.10.5
- jazz-react-native-media-images@0.10.5
## 1.0.69
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "chat-rn-clerk",
"main": "index.js",
"version": "1.0.69",
"version": "1.0.70",
"scripts": {
"build": "expo export -p ios",
"start": "expo start",

View File

@@ -1,5 +1,13 @@
# chat-rn
## 1.0.67
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react-native@0.10.5
## 1.0.66
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-rn",
"version": "1.0.66",
"version": "1.0.67",
"main": "index.js",
"scripts": {
"build": "expo export -p ios",
@@ -23,7 +23,6 @@
"expo-build-properties": "~0.13.1",
"expo-clipboard": "~7.0.0",
"expo-constants": "~17.0.3",
"expo-crypto": "~14.0.1",
"expo-dev-client": "~5.0.5",
"expo-linking": "~7.0.3",
"expo-secure-store": "~14.0.0",
@@ -36,7 +35,9 @@
"react-native": "~0.76.3",
"react-native-fetch-api": "^3.0.0",
"react-native-get-random-values": "^1.11.0",
"react-native-nitro-modules": "0.21.0",
"react-native-polyfill-globals": "^3.1.0",
"react-native-quick-crypto": "1.0.0-beta.12",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "4.1.0",
"react-native-url-polyfill": "^2.0.0",

View File

@@ -9,7 +9,7 @@ import * as Linking from "expo-linking";
import React, { StrictMode, useEffect, useState } from "react";
import HandleInviteScreen from "./invite";
import { JazzProvider } from "jazz-react-native";
import { JazzProvider, RNQuickCrypto } from "jazz-react-native";
import { apiKey } from "./apiKey";
import ChatScreen from "./chat";
@@ -50,6 +50,7 @@ function App() {
sync={{
peer: `wss://cloud.jazz.tools/?key=${apiKey}`,
}}
CryptoProvider={RNQuickCrypto}
>
<NavigationContainer linking={linking} ref={navigationRef}>
<Stack.Navigator initialRouteName={initialRoute}>

View File

@@ -6,8 +6,10 @@
set -e
# build and install the app
echo "Building and installing Android app."
echo "If it fails, its output will be in artifact: android-install.log..."
cd ./android/
./gradlew installRelease
./gradlew installRelease >> ~/output/android-install.log 2>&1
cd ..
# run the e2e tests

View File

@@ -1,5 +1,14 @@
# chat-vue
## 0.0.54
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser@0.10.5
- jazz-vue@0.10.5
## 0.0.53
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "chat-vue",
"version": "0.0.53",
"version": "0.0.54",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,14 @@
# jazz-example-chat
## 0.0.150
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser-media-images@0.10.5
- jazz-react@0.10.5
## 0.0.149
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-chat",
"private": true,
"version": "0.0.149",
"version": "0.0.150",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# minimal-auth-clerk
## 0.0.49
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
- jazz-react-auth-clerk@0.10.5
## 0.0.48
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "clerk",
"private": true,
"version": "0.0.48",
"version": "0.0.49",
"type": "module",
"scripts": {
"dev": "vite",
@@ -13,7 +13,7 @@
"dependencies": {
"@clerk/clerk-react": "^5.4.1",
"jazz-react": "workspace:*",
"jazz-react-auth-clerk": "workspace:0.10.4",
"jazz-react-auth-clerk": "workspace:0.10.5",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"

View File

@@ -1,5 +1,13 @@
# file-share-svelte
## 0.0.34
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-svelte@0.10.5
## 0.0.33
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "file-share-svelte",
"version": "0.0.33",
"version": "0.0.34",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,14 @@
# form
## 0.0.45
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser-media-images@0.10.5
- jazz-react@0.10.5
## 0.0.44
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "form",
"private": true,
"version": "0.0.44",
"version": "0.0.45",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# image-upload
## 0.0.47
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser-media-images@0.10.5
- jazz-react@0.10.5
## 0.0.46
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "image-upload",
"private": true,
"version": "0.0.46",
"version": "0.0.47",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# jazz-example-musicplayer
## 0.0.71
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-inspector@0.10.5
- jazz-react@0.10.5
## 0.0.70
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-music-player",
"private": true,
"version": "0.0.70",
"version": "0.0.71",
"type": "module",
"scripts": {
"dev": "vite",
@@ -22,8 +22,8 @@
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-inspector": "workspace:*",
"jazz-react": "workspace:0.10.4",
"jazz-tools": "workspace:0.10.4",
"jazz-react": "workspace:0.10.5",
"jazz-tools": "workspace:0.10.5",
"lucide-react": "^0.274.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",

View File

@@ -1,26 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
playwright-report

View File

@@ -1,420 +0,0 @@
# jazz-example-onboarding
## 0.0.50
### Patch Changes
- jazz-react@0.10.4
- jazz-tools@0.10.4
- jazz-browser-media-images@0.10.4
## 0.0.49
### Patch Changes
- Updated dependencies [d8582fc]
- jazz-tools@0.10.3
- jazz-browser-media-images@0.10.3
- jazz-react@0.10.3
## 0.0.48
### Patch Changes
- jazz-react@0.10.2
- jazz-tools@0.10.2
- jazz-browser-media-images@0.10.2
## 0.0.47
### Patch Changes
- Updated dependencies [5a63cba]
- jazz-tools@0.10.1
- jazz-browser-media-images@0.10.1
- jazz-react@0.10.1
## 0.0.46
### Patch Changes
- Updated dependencies [498954f]
- Updated dependencies [d42c2aa]
- Updated dependencies [dd03464]
- Updated dependencies [b426342]
- jazz-react@0.10.0
- jazz-tools@0.10.0
- jazz-browser-media-images@0.10.0
## 0.0.45
### Patch Changes
- jazz-react@0.9.23
- jazz-tools@0.9.23
- jazz-browser-media-images@0.9.23
## 0.0.44
### Patch Changes
- jazz-browser-media-images@0.9.22
- jazz-react@0.9.22
## 0.0.43
### Patch Changes
- Updated dependencies [1be017d]
- jazz-tools@0.9.21
- jazz-browser-media-images@0.9.21
- jazz-react@0.9.21
## 0.0.42
### Patch Changes
- Updated dependencies [b01cc1f]
- jazz-tools@0.9.20
- jazz-browser-media-images@0.9.20
- jazz-react@0.9.20
## 0.0.41
### Patch Changes
- jazz-react@0.9.19
- jazz-tools@0.9.19
- jazz-browser-media-images@0.9.19
## 0.0.40
### Patch Changes
- jazz-react@0.9.18
- jazz-tools@0.9.18
- jazz-browser-media-images@0.9.18
## 0.0.39
### Patch Changes
- Updated dependencies [c2ca1fe]
- Updated dependencies [1227047]
- jazz-tools@0.9.17
- jazz-browser-media-images@0.9.17
- jazz-react@0.9.17
## 0.0.38
### Patch Changes
- Updated dependencies [24b3b6a]
- jazz-tools@0.9.16
- jazz-browser-media-images@0.9.16
- jazz-react@0.9.16
## 0.0.37
### Patch Changes
- Updated dependencies [7491711]
- jazz-tools@0.9.15
- jazz-browser-media-images@0.9.15
- jazz-react@0.9.15
## 0.0.36
### Patch Changes
- Updated dependencies [3df93cc]
- jazz-tools@0.9.14
- jazz-browser-media-images@0.9.14
- jazz-react@0.9.14
## 0.0.35
### Patch Changes
- jazz-react@0.9.13
- jazz-tools@0.9.13
- jazz-browser-media-images@0.9.13
## 0.0.34
### Patch Changes
- jazz-react@0.9.12
- jazz-tools@0.9.12
- jazz-browser-media-images@0.9.12
## 0.0.33
### Patch Changes
- jazz-react@0.9.11
- jazz-tools@0.9.11
- jazz-browser-media-images@0.9.11
## 0.0.32
### Patch Changes
- Updated dependencies [5e83864]
- jazz-react@0.9.10
- jazz-tools@0.9.10
- jazz-browser-media-images@0.9.10
## 0.0.31
### Patch Changes
- Updated dependencies [8eb9247]
- jazz-tools@0.9.9
- jazz-browser-media-images@0.9.9
- jazz-react@0.9.9
## 0.0.30
### Patch Changes
- Updated dependencies [d1d773b]
- jazz-tools@0.9.8
- jazz-react@0.9.8
- jazz-browser-media-images@0.9.8
## 0.0.29
### Patch Changes
- jazz-react@0.9.4
## 0.0.28
### Patch Changes
- Updated dependencies [1b71969]
- jazz-react@0.9.1
- jazz-tools@0.9.1
- jazz-browser-media-images@0.9.1
## 0.0.27
### Patch Changes
- Updated dependencies [956a4d1]
- Updated dependencies [8eda792]
- jazz-react@0.9.0
- jazz-tools@0.9.0
- jazz-browser-media-images@0.9.0
## 0.0.26
### Patch Changes
- Updated dependencies [dc62b95]
- Updated dependencies [1de26f8]
- jazz-tools@0.8.51
- jazz-browser-media-images@0.8.51
- jazz-react@0.8.51
## 0.0.25
### Patch Changes
- jazz-react@0.8.50
- jazz-tools@0.8.50
- jazz-browser-media-images@0.8.50
## 0.0.24
### Patch Changes
- jazz-react@0.8.49
- jazz-tools@0.8.49
- jazz-browser-media-images@0.8.49
## 0.0.23
### Patch Changes
- Updated dependencies [635e824]
- Updated dependencies [0a85982]
- jazz-tools@0.8.48
- jazz-browser-media-images@0.8.48
- jazz-react@0.8.48
## 0.0.22
### Patch Changes
- Updated dependencies [fa41f8e]
- Updated dependencies [88d7d9a]
- Updated dependencies [60e35ea]
- jazz-tools@0.8.45
- jazz-react@0.8.45
- jazz-browser-media-images@0.8.45
## 0.0.21
### Patch Changes
- jazz-react@0.8.44
- jazz-tools@0.8.44
- jazz-browser-media-images@0.8.44
## 0.0.20
### Patch Changes
- jazz-react@0.8.41
- jazz-tools@0.8.41
- jazz-browser-media-images@0.8.41
## 0.0.19
### Patch Changes
- jazz-browser-media-images@0.8.40
- jazz-react@0.8.40
## 0.0.18
### Patch Changes
- Updated dependencies [249eecb]
- jazz-tools@0.8.39
- jazz-browser-media-images@0.8.39
- jazz-react@0.8.39
## 0.0.17
### Patch Changes
- jazz-react@0.8.38
- jazz-tools@0.8.38
- jazz-browser-media-images@0.8.38
## 0.0.16
### Patch Changes
- jazz-react@0.8.37
- jazz-tools@0.8.37
- jazz-browser-media-images@0.8.37
## 0.0.15
### Patch Changes
- Updated dependencies [441fe27]
- jazz-tools@0.8.36
- jazz-react@0.8.36
- jazz-browser-media-images@0.8.36
## 0.0.14
### Patch Changes
- Updated dependencies [9212ab8]
- Updated dependencies [8b87117]
- jazz-react@0.8.35
- jazz-tools@0.8.35
- jazz-browser-media-images@0.8.35
## 0.0.13
### Patch Changes
- jazz-react@0.8.34
- jazz-tools@0.8.34
- jazz-browser-media-images@0.8.34
## 0.0.12
### Patch Changes
- jazz-browser-media-images@0.8.33
- jazz-react@0.8.33
## 0.0.11
### Patch Changes
- Updated dependencies [df42b2b]
- jazz-tools@0.8.32
- jazz-react@0.8.32
- jazz-browser-media-images@0.8.32
## 0.0.10
### Patch Changes
- jazz-react@0.8.31
- jazz-tools@0.8.31
- jazz-browser-media-images@0.8.31
## 0.0.9
### Patch Changes
- jazz-react@0.8.30
- jazz-tools@0.8.30
- jazz-browser-media-images@0.8.30
## 0.0.8
### Patch Changes
- jazz-react@0.8.29
- jazz-tools@0.8.29
- jazz-browser-media-images@0.8.29
## 0.0.7
### Patch Changes
- jazz-react@0.8.28
- jazz-tools@0.8.28
- jazz-browser-media-images@0.8.28
## 0.0.6
### Patch Changes
- jazz-react@0.8.27
- jazz-tools@0.8.27
- jazz-browser-media-images@0.8.27
## 0.0.5
### Patch Changes
- Updated dependencies [59d37df]
- jazz-react@0.8.26
## 0.0.4
### Patch Changes
- jazz-browser-media-images@0.8.24
- jazz-react@0.8.24
## 0.0.3
### Patch Changes
- Updated dependencies [d348c2d]
- Updated dependencies [6902b5b]
- Updated dependencies [1a0cd3d]
- jazz-tools@0.8.23
- jazz-react@0.8.23
- jazz-browser-media-images@0.8.23
## 0.0.2
### Patch Changes
- Updated dependencies [59cc64d]
- jazz-react@0.8.22
- jazz-browser-media-images@0.8.22

View File

@@ -1,4 +0,0 @@
FROM caddy:2.7.3-alpine
LABEL org.opencontainers.image.source="https://github.com/garden-co/jazz"
COPY ./dist /usr/share/caddy/

View File

@@ -1,60 +0,0 @@
# Onboarding example with Jazz and React
## Getting started
You can either
1. Clone the jazz repository, and run the app within the monorepo.
2. Or create a new Jazz project using this example as a template.
### Using the example as a template
Create a new Jazz project, and use this example as a template.
```bash
npx create-jazz-app@latest --example onboarding --project-name onboarding
```
Go to the new project directory.
```bash
cd onboarding
```
Run the dev server.
```bash
npm run dev
```
### Using the monorepo
This requires `pnpm` to be installed, see [https://pnpm.io/installation](https://pnpm.io/installation).
Clone the jazz repository.
```bash
git clone https://github.com/garden-co/jazz.git
```
Install and build dependencies.
```bash
pnpm i && npx turbo build
```
Go to the example directory.
```bash
cd jazz/examples/onboarding/
```
Start the dev server.
```bash
pnpm dev
```
Open [http://localhost:5173](http://localhost:5173) with your browser to see the result.
## Questions / problems / feedback
If you have feedback, let us know on [Discord](https://discord.gg/utDMjHYg42) or open an issue or PR to fix something that seems wrong.
## Configuration: sync server
By default, the example app uses [Jazz Cloud](https://jazz.tools/cloud) (`wss://cloud.jazz.tools`) - so cross-device use, invites and collaboration should just work.
You can also run a local sync server by running `npx cojson-simple-sync` and adding the query param `?sync=ws://localhost:4200` to the URL of the example app (for example: `http://localhost:5173/?peer=ws://localhost:4200`), or by setting the `sync` parameter of the `<JazzProvider>` provider component in [./src/main.tsx](./src/main.tsx).

View File

@@ -1,12 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Jazz onboarding example</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

View File

@@ -1,36 +0,0 @@
{
"name": "jazz-example-onboarding",
"private": true,
"version": "0.0.50",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"format-and-lint": "biome check .",
"format-and-lint:fix": "biome check . --write",
"preview": "vite preview",
"test": "playwright test",
"test:ui": "playwright test --ui",
"sync": "jazz-run sync"
},
"dependencies": {
"jazz-browser-media-images": "workspace:*",
"jazz-react": "workspace:*",
"jazz-tools": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"jazz-run": "workspace:*",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",
"vite": "^6.0.11"
}
}

View File

@@ -1,46 +0,0 @@
import { defineConfig, devices } from "@playwright/test";
import isCI from "is-ci";
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: isCI,
/* Retry on CI only */
retries: isCI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: isCI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: "http://localhost:5173/",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
permissions: ["clipboard-read", "clipboard-write"],
},
/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},
],
/* Run your local dev server before starting the tests */
webServer: [
{
command: "pnpm preview --port 5173",
url: "http://localhost:5173/",
reuseExistingServer: !isCI,
},
],
});

View File

@@ -1,6 +0,0 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 820 B

View File

@@ -1,100 +0,0 @@
import { Button } from "@/components/Button.tsx";
import { EmployeeList } from "@/pages/EmployeeList.tsx";
import { EmployeeOnboading } from "@/pages/EmployeeOnboarding.tsx";
import { NewEmployee } from "@/pages/NewEmployee.tsx";
import { CoEmployee, EmployeeCoList } from "@/schema.ts";
import { useAcceptInvite, useAccount, useCoState } from "jazz-react";
import { ID } from "jazz-tools";
import { useEffect } from "react";
import {
RouterProvider,
createHashRouter,
useNavigate,
useParams,
} from "react-router-dom";
function ImportEmployee({
employeeListCoId,
}: { employeeListCoId: ID<EmployeeCoList> }) {
const { employeeCoId } = useParams();
const navigate = useNavigate();
const employees = useCoState(EmployeeCoList, employeeListCoId, [{}]);
const employee = useCoState(CoEmployee, employeeCoId as ID<CoEmployee>, {});
useEffect(() => {
if (!employee || !employees) return;
const exists = employees.find((employee) => employeeCoId === employee.id);
if (!exists) {
employees.push(employee);
}
navigate("/");
}, [employee, employees, navigate]);
return <div>Importing Employee ${employeeCoId} ...</div>;
}
function AcceptInvite() {
const navigate = useNavigate();
useAcceptInvite({
invitedObjectSchema: CoEmployee,
onAccept: (employeeCoId) => {
navigate(`/import/${employeeCoId}`);
},
});
return <p>Accepting invite...</p>;
}
function App() {
const { me, logOut } = useAccount();
const employeeCoListId = me.profile?._refs.employees.id;
const router = createHashRouter([
{
path: "/",
element: <EmployeeList employeeListCoId={employeeCoListId} />,
},
{
path: "employee/new",
element: <NewEmployee employeeListCoId={employeeCoListId} />,
},
{
path: "/employee/:employeeCoId",
element: <EmployeeOnboading />,
},
{
path: "/import/:employeeCoId",
element: <ImportEmployee employeeListCoId={employeeCoListId} />,
},
{
path: "/invite/*",
element: <AcceptInvite />,
},
]);
return (
<>
<header className="flex flex-wrap space-x-8 max-w-screen-lg m-2">
<h1 className="text-3xl font-extrabold">
Jazz Onboarding Flow example
</h1>
<Button
onClick={() => {
window.location.href = "/";
logOut();
}}
text="Log Out"
/>
</header>
<main className="ml-2">
{employeeCoListId && <RouterProvider router={router} />}
</main>
</>
);
}
export default App;

View File

@@ -1 +0,0 @@
export const apiKey = "onboarding-example-jazz@garden.co";

View File

@@ -1,31 +0,0 @@
const disabledClasses =
"text-white bg-gray-400 dark:bg-gray-500 cursor-not-allowed";
const regularClasses =
"text-white bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:outline-none focus:ring-green-300 dark:focus:ring-green-800";
export function Button({
text,
onClick,
disabled,
type = "button",
...props
}: {
text: string;
type?: "button" | "submit";
onClick?: () => void;
disabled?: boolean;
}) {
return (
<button
{...props}
onClick={onClick}
type={type}
disabled={disabled}
className={`${
disabled ? disabledClasses : regularClasses
} text-base font-medium rounded-lg text-sm px-5 py-2.5 text-center me-2 mb-2`}
>
{text}
</button>
);
}

View File

@@ -1,19 +0,0 @@
import React from "react";
import { Link } from "react-router-dom";
export function ButtonLink({
to,
children,
}: {
to: string;
children: React.ReactNode;
}) {
return (
<Link
className="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 dark:bg-blue-600 dark:hover:bg-blue-700 focus:outline-none dark:focus:ring-blue-800"
to={to}
>
{children}
</Link>
);
}

View File

@@ -1,19 +0,0 @@
import React from "react";
import { Link } from "react-router-dom";
export function NavLink({
to,
children,
}: {
to: string;
children: React.ReactNode;
}) {
return (
<Link
className="font-medium text-blue-600 dark:text-blue-500 hover:underline"
to={to}
>
{children}
</Link>
);
}

View File

@@ -1,24 +0,0 @@
import { useNavigate } from "react-router-dom";
import { Button } from "./Button.tsx";
export function NavigateBack() {
const navigate = useNavigate();
const canGoBack = window.history.state.idx !== 0;
if (!canGoBack) return null;
return (
<div>
<Button onClick={() => navigate(-1)} text="< Back" />
</div>
);
}
export function NavigateButton({ text, to }: { text: string; to: string }) {
const navigate = useNavigate();
return (
<div>
<Button onClick={() => navigate(to)} text={text} />
</div>
);
}

View File

@@ -1,19 +0,0 @@
import React from "react";
export function Stack({
children,
horizontal,
}: {
children: React.ReactNode;
horizontal?: boolean;
}) {
return (
<div
className={`container flex ${
horizontal ? "flex-row" : "flex-col"
} col ${horizontal ? "space-x-4 flex-wrap" : "space-y-4"} p-4`}
>
{children}
</div>
);
}

View File

@@ -1,36 +0,0 @@
import { ChangeEvent } from "react";
export function TextInput({
id,
value,
label,
onChange,
disabled,
}: {
id: string;
label: string;
value: string;
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
disabled?: boolean;
}) {
return (
<div>
<label
htmlFor={id}
className="block mb-2 font-medium text-gray-900 dark:text-white"
>
{label}
</label>
<input
value={value}
onChange={onChange}
type="text"
id={id}
disabled={disabled}
className="disabled:cursor-not-allowed bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
placeholder="John"
required
/>
</div>
);
}

View File

@@ -1,3 +0,0 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@@ -1,31 +0,0 @@
import App from "@/App.tsx";
import "@/index.css";
import { HRAccount } from "@/schema.ts";
import { JazzProvider } from "jazz-react";
import React from "react";
import ReactDOM from "react-dom/client";
import { apiKey } from "./apiKey";
const peer =
(new URL(window.location.href).searchParams.get(
"peer",
) as `ws://${string}`) ?? `wss://cloud.jazz.tools/?key=${apiKey}`;
declare module "jazz-react" {
interface Register {
Account: HRAccount;
}
}
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<JazzProvider
AccountSchema={HRAccount}
sync={{
peer,
}}
>
<App />
</JazzProvider>
</React.StrictMode>,
);

View File

@@ -1,50 +0,0 @@
import { NavLink } from "@/components/NavLink.tsx";
import { NavigateButton } from "@/components/NavigateBack.tsx";
import { Stack } from "@/components/Stack.tsx";
import { CoEmployee, EmployeeCoList } from "@/schema.ts";
import { useCoState } from "jazz-react";
import { ID } from "jazz-tools";
export function EmployeeList({
employeeListCoId,
}: {
employeeListCoId: ID<EmployeeCoList>;
}) {
const employees = useCoState(EmployeeCoList, employeeListCoId, [{}]);
if (!employees) {
return <div>Loading...</div>;
}
return (
<Stack>
<NavigateButton to="/employee/new" text={"Add New Employee"} />
<ul className="max-w-md">
{employees.map((employee: CoEmployee) =>
employee.deleted ? null : (
<li key={employee.id} className="flex flex-row space-x-8 w-full">
<span>{employee._owner.myRole()}</span>
<span className="w-1/3">
<NavLink to={`/employee/${employee.id}`}>
{employee.name}
</NavLink>
</span>
{employee.finalStep?.done && <span></span>}
{employee._owner.myRole() === "admin" &&
!employee.finalStep?.done && (
<span
onClick={() => {
employee.deleted = true;
}}
className="cursor-pointer"
>
🗑
</span>
)}
</li>
),
)}
</ul>
</Stack>
);
}

View File

@@ -1,240 +0,0 @@
import { Button } from "@/components/Button.tsx";
import { NavigateBack } from "@/components/NavigateBack.tsx";
import { Stack } from "@/components/Stack.tsx";
import { TextInput } from "@/components/TextInput.tsx";
import { createImage } from "jazz-browser-media-images";
import { useCoState } from "jazz-react";
import { ProgressiveImg, createInviteLink } from "jazz-react";
import { CoMap, ID } from "jazz-tools";
import { ChangeEvent, ReactNode, useCallback } from "react";
import { useParams } from "react-router";
import {
CoDocUploadStep,
CoEmployee,
CoFinalStep,
CoInitialStep,
} from "../schema.ts";
const Card = ({
children,
title,
isDone,
isActive,
}: {
children: ReactNode;
title: string;
isDone: boolean;
isActive?: boolean;
}) => (
<div
className={`w-full p-4 bg-white border border-gray-200 rounded-lg shadow max-w-md ${
isActive ? "border-gray-900 hover:bg-green-50 shadow-xl" : ""
}`}
>
<Stack horizontal={true}>
<h5 className="mb-2 text-2xl text-gray-900">{title}</h5>
<h6 className="mb-2 text-2xl">
{isDone ? "✅" : isActive ? "❓" : "⌛"}
</h6>
</Stack>
{children}
</div>
);
const InfoCard = ({
initialStep,
canWrite,
}: {
initialStep: CoInitialStep;
canWrite: boolean;
}) => {
const isDisabled = !initialStep.isCurrentStep() || !canWrite;
return (
<Card
title="Personal Info"
isDone={initialStep?.done}
isActive={initialStep.isCurrentStep()}
>
<Stack>
<TextInput
disabled={isDisabled}
id="ssn"
label="Social Security Number"
value={initialStep.ssn || ""}
onChange={({ target: { value } }) => (initialStep.ssn = value)}
/>
<TextInput
disabled={isDisabled}
id="address"
label="Address"
value={initialStep.address || ""}
onChange={({ target: { value } }) => (initialStep.address = value)}
/>
{!initialStep.done && (
<Button
text={"Upload step >"}
disabled={!initialStep.ssn || !initialStep.address || isDisabled}
onClick={() => (initialStep.done = true)}
/>
)}
</Stack>
</Card>
);
};
const UploadCard = ({
uploadStep,
canWrite,
}: {
uploadStep: CoDocUploadStep;
canWrite: boolean;
}) => {
const isDisabled = !uploadStep.isCurrentStep() || !canWrite;
const onImageSelected = useCallback(
async (event: ChangeEvent<HTMLInputElement>) => {
if (!event.target.files) return;
const image = await createImage(event.target.files[0], {
owner: uploadStep._owner,
});
uploadStep.photo = image;
},
[uploadStep],
);
return (
<Card
title="Uploads"
isDone={uploadStep?.done}
isActive={uploadStep.isCurrentStep()}
>
<Stack>
{uploadStep.photo && (
<ProgressiveImg image={uploadStep.photo}>
{({ src }) => (
<img
className="max-h-full max-w-full rounded-l-sm rounded-r-md shadow-lg p-2"
src={src}
/>
)}
</ProgressiveImg>
)}
{!uploadStep.done && (
<>
<input
type="file"
disabled={isDisabled}
onChange={onImageSelected}
data-testid="file-upload"
/>
<Button
text={"Confirmation step >"}
disabled={isDisabled || !uploadStep.photo}
onClick={() => (uploadStep.done = true)}
/>
</>
)}
</Stack>
</Card>
);
};
const ConfirmationCard = ({
finalStep,
editable,
}: {
finalStep: CoFinalStep;
editable: boolean;
}) => {
const isDisabled = !finalStep.isCurrentStep() || !editable;
return (
<Card
title="Confirmation by admin"
isDone={finalStep?.done}
isActive={finalStep.isCurrentStep()}
>
<Stack>
{!finalStep.done && (
<Button
text="Confirmation by admin"
disabled={isDisabled}
onClick={() => (finalStep.done = true)}
/>
)}
</Stack>
</Card>
);
};
export function EmployeeOnboading() {
const { employeeCoId } = useParams();
const employee = useCoState(CoEmployee, employeeCoId as ID<CoEmployee>, {});
const handleInviteLinkCreation = useCallback(
(role: "reader" | "writer") => {
if (!employee) return;
const link = createInviteLink(employee, role);
navigator.clipboard.writeText(link);
alert("Invite link copied to clipboard!");
},
[employee],
);
const isMeWriter = (step: CoMap): boolean => {
return ["writer", "admin"].includes(step._owner.myRole() || "");
};
return (
<>
<Stack>
<Stack horizontal={true}>
<NavigateBack />
{employee?._owner.myRole() === "admin" && (
<Button
text={"Invite a co-worker"}
onClick={() => handleInviteLinkCreation("writer")}
/>
)}
</Stack>
<h2 className="mb-2 text-2xl text-gray-900 font-semibold">
{employee ? employee.name : "Loading..."}
</h2>
</Stack>
{employee && (
<Stack>
{employee.initialStep ? (
<InfoCard
initialStep={employee.initialStep}
canWrite={isMeWriter(employee.initialStep)}
/>
) : (
<div>Loading...</div>
)}
{employee.docUploadStep ? (
<UploadCard
uploadStep={employee.docUploadStep}
canWrite={isMeWriter(employee.docUploadStep)}
/>
) : (
<div>Loading...</div>
)}
{employee.finalStep ? (
<ConfirmationCard
finalStep={employee.finalStep}
editable={isMeWriter(employee.finalStep)}
/>
) : (
<div>Loading...</div>
)}
</Stack>
)}
</>
);
}

View File

@@ -1,89 +0,0 @@
import { Button } from "@/components/Button.tsx";
import { NavigateBack } from "@/components/NavigateBack.tsx";
import { Stack } from "@/components/Stack.tsx";
import { TextInput } from "@/components/TextInput.tsx";
import { useAccount, useCoState } from "jazz-react";
import { Group, ID } from "jazz-tools";
import { useCallback, useState } from "react";
import { useNavigate } from "react-router-dom";
import {
CoDocUploadStep,
CoEmployee,
CoFinalStep,
CoInitialStep,
EmployeeCoList,
} from "../schema.ts";
export function NewEmployee({
employeeListCoId,
}: {
employeeListCoId: ID<EmployeeCoList>;
}) {
const navigate = useNavigate();
const { me } = useAccount();
const employees = useCoState(EmployeeCoList, employeeListCoId, [{}]);
const [employeeName, setEmployeeName] = useState<string>("");
const createEmployee = useCallback(() => {
if (!employees) return;
const writerGroup = Group.create({ owner: me });
const readerGroup = Group.create({ owner: me });
readerGroup.addMember("everyone", "reader");
const initialStep = CoInitialStep.create(
{ done: false, type: "initial" },
{ owner: writerGroup },
);
const docUploadStep = CoDocUploadStep.create(
{ done: false, prevStep: initialStep, type: "upload" },
{ owner: writerGroup },
);
const finalStep = CoFinalStep.create(
{ done: false, prevStep: docUploadStep, type: "final" },
{ owner: readerGroup },
);
const employee = CoEmployee.create(
{
name: employeeName,
initialStep,
docUploadStep,
finalStep,
},
{ owner: writerGroup },
);
employees.push(employee);
setEmployeeName("");
}, [employeeName, employees]);
return (
<div className="w-96">
<Stack>
<NavigateBack />
<form className="grid gap-3">
<TextInput
label="Employee name"
id="employee-name"
value={employeeName}
onChange={({ target: { value } }) => setEmployeeName(value)}
/>
<Button
type="submit"
disabled={!employeeName}
onClick={() => {
createEmployee();
navigate("/");
}}
text="Create Employee"
/>
</form>
</Stack>
</div>
);
}

View File

@@ -1,76 +0,0 @@
import {
Account,
CoList,
CoMap,
ImageDefinition,
Profile,
co,
} from "jazz-tools";
type Steps = "initial" | "upload" | "final";
interface Step {
type: Steps;
prevStep: ReturnType<typeof co.ref> | undefined;
done: boolean;
isCurrentStep(): boolean;
}
export class CoInitialStep extends CoMap implements Step {
type = co.literal("initial");
ssn? = co.string;
address? = co.string;
done = co.boolean;
prevStep = co.null;
isCurrentStep() {
return !this.done;
}
}
export class CoDocUploadStep extends CoMap implements Step {
type = co.literal("upload");
prevStep = co.ref(CoInitialStep);
photo = co.ref(ImageDefinition, { optional: true });
done = co.boolean;
isCurrentStep() {
return !!(this.prevStep?.done && !this.done);
}
}
export class CoFinalStep extends CoMap implements Step {
type = co.literal("final");
prevStep = co.ref(CoDocUploadStep);
done = co.boolean;
isCurrentStep() {
return !!(this.prevStep?.done && !this.done);
}
}
export class CoEmployee extends CoMap {
name = co.string;
deleted? = co.boolean;
initialStep = co.ref(CoInitialStep);
docUploadStep = co.ref(CoDocUploadStep);
finalStep = co.ref(CoFinalStep);
}
export class EmployeeCoList extends CoList.Of(co.ref(CoEmployee)) {}
export class HRProfile extends Profile {
employees = co.ref(EmployeeCoList);
}
export class HRAccount extends Account {
profile = co.ref(HRProfile)!;
migrate() {
if (!this.profile._refs.employees) {
this.profile.employees = EmployeeCoList.create([], {
owner: this.profile._owner,
});
}
}
}

View File

@@ -1 +0,0 @@
/// <reference types="vite/client" />

View File

@@ -1,11 +0,0 @@
import type { Config } from "tailwindcss";
const config: Config = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [],
};
export default config;

View File

@@ -1,96 +0,0 @@
import {
Browser,
BrowserContext,
Page,
chromium,
expect,
test,
} from "@playwright/test";
import { EmployeeOnboardingPage } from "./pages/EmployeeOnboardingPage";
import { HomePage } from "./pages/HomePage";
import { LoginPage } from "./pages/LoginPage";
async function scrollToBottom(page: Page) {
await page.evaluate(() => {
window.scrollTo(0, document.body.scrollHeight);
});
}
test.describe("Admin onboarding flow", () => {
let browser: Browser;
let adminContext: BrowserContext;
let writerContext: BrowserContext;
test.beforeAll(async () => {
browser = await chromium.launch();
adminContext = await browser.newContext();
writerContext = await browser.newContext();
});
test.afterAll(async () => {
await adminContext.close();
await writerContext.close();
await browser.close();
});
test("Create and delete flow", async () => {
const adminPage = await adminContext.newPage();
await adminPage.goto("/");
const adminHomePage = new HomePage(adminPage);
await adminHomePage.createEmployee("Paul");
await adminHomePage.createEmployee("Sean");
await adminHomePage.expectEmployee(["Sean", "admin"]);
await adminHomePage.expectEmployee(["Paul", "admin"]);
await adminHomePage.deleteEmployee("Sean");
await adminHomePage.expectEmployeeDeleted("Sean");
await adminPage.close();
});
test("Onboard flow", async () => {
const adminPage = await adminContext.newPage();
const writerPage = await writerContext.newPage();
await adminPage.goto("/");
await writerPage.goto("/");
const adminHomePage = new HomePage(adminPage);
await adminHomePage.createEmployee("Paul");
await adminHomePage.expectEmployee(["Paul", "admin"]);
await adminHomePage.navigateToEmployeeOnboardingPage("Paul");
const adminOnboardingPage = new EmployeeOnboardingPage(adminPage);
// create invitation
const invitation = await adminOnboardingPage.getShareLink();
// Wait for the invitation to be synced
await writerPage.waitForTimeout(3000);
//fill out by invitee (writer)
await writerPage.goto(invitation);
const writerHomePage = new HomePage(writerPage);
await writerHomePage.expectEmployee(["Paul", "write"]);
await writerHomePage.navigateToEmployeeOnboardingPage("Paul");
const writerOnboardingPage = new EmployeeOnboardingPage(writerPage);
await writerOnboardingPage.expectEmployeeName("Paul");
await writerOnboardingPage.fillPersonalDetailsCardAndSave(
"123-45-6789",
"123 Elm Street",
);
await writerOnboardingPage.fillUploadCardAndSave(
"./public/jazz-logo-low-res.jpg",
);
// invitee cannot confirm the onboarding completion
expect(
writerOnboardingPage.finalConfirmationButton.isDisabled(),
).toBeTruthy();
// final confirmation step by admin
await scrollToBottom(adminPage);
await adminOnboardingPage.finalConfirmationButton.click();
await adminOnboardingPage.backButton.click();
await adminHomePage.expectOnboardingCompleteForEmployee("Paul");
});
});

View File

@@ -1,92 +0,0 @@
import { Locator, Page, expect } from "@playwright/test";
export class EmployeeOnboardingPage {
readonly page: Page;
readonly shareButton: Locator;
readonly backButton: Locator;
readonly logoutButton: Locator;
readonly finalConfirmationButton: Locator;
readonly fileInput: Locator;
constructor(page: Page) {
this.page = page;
this.shareButton = page.getByRole("button", {
name: /invite a co-worker/i,
});
this.backButton = page.getByRole("button", {
name: /back/i,
});
this.logoutButton = page.getByRole("button", {
name: /log out/i,
});
this.finalConfirmationButton = this.page.getByRole("button", {
name: /confirmation by admin/i,
});
this.fileInput = page.getByTestId("file-upload");
}
async uploadFile(value: string) {
// Start waiting for file chooser before clicking. Note no await.
const fileChooserPromise = this.page.waitForEvent("filechooser");
await this.fileInput.click();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(value);
}
async expectEmployeeName(name: string) {
await expect(
this.page.getByRole("heading", {
name: name,
}),
).toBeVisible();
}
async fillPersonalDetailsCardAndSave(ssn: string, address: string) {
const nextStepButton = this.page.getByRole("button", {
name: /upload step >/i,
});
await expect(nextStepButton).toBeDisabled();
const ssnInput = this.page.getByLabel(/Social Security Number/i);
await ssnInput.fill(ssn);
const addressInput = this.page.getByLabel(/Address/i);
await addressInput.fill(address);
// save and hide the button
await expect(nextStepButton).toBeEnabled();
await nextStepButton.click();
await expect(nextStepButton).not.toBeVisible();
}
async fillUploadCardAndSave(file: string) {
const nextStepButton = this.page.getByRole("button", {
name: /confirmation step >/i,
});
await expect(nextStepButton).toBeDisabled();
await this.uploadFile(file);
await expect(nextStepButton).toBeEnabled();
await nextStepButton.click();
await expect(nextStepButton).not.toBeVisible();
}
async getShareLink() {
await this.shareButton.click();
const inviteUrl = await this.page.evaluate(() =>
navigator.clipboard.readText(),
);
expect(inviteUrl).toBeTruthy();
return inviteUrl;
}
async logout() {
await this.logoutButton.click();
}
}

View File

@@ -1,66 +0,0 @@
import { Locator, Page, expect } from "@playwright/test";
import { NewEmployeePage } from "./NewEmployeePage";
export class HomePage {
readonly page: Page;
readonly newEmployeeLink: Locator;
readonly logoutButton: Locator;
constructor(page: Page) {
this.page = page;
this.newEmployeeLink = page.getByRole("button", {
name: "Add New Employee",
});
this.logoutButton = page.getByRole("button", {
name: "Log Out",
});
}
async expectEmployee([name, role]: [string, string]) {
const liElement = this.page.locator(
`li:has-text("${name}"):has-text("${role}")`,
);
await expect(liElement).toBeVisible();
}
async deleteEmployee(name: string) {
const liElement = this.page.locator(`li:has-text("${name}")`);
const deleteIcon = liElement.locator('span:has-text("🗑")');
await deleteIcon.click();
}
async expectOnboardingCompleteForEmployee(name: string) {
const liElement = this.page.locator(`li:has-text("${name}")`);
const completionIcon = liElement.locator('span:has-text("✅")');
await expect(completionIcon).toBeVisible();
}
async expectEmployeeDeleted(name: string) {
const liElement = this.page.locator(`li:has-text("${name}")`);
await expect(liElement).not.toBeVisible();
}
async navigateToEmployeeOnboardingPage(name: string) {
await this.page
.getByRole("link", {
name,
})
.click();
}
async navigateToNewEmployee() {
await this.newEmployeeLink.click();
}
async createEmployee(name: string) {
await this.navigateToNewEmployee();
const newEmployeePage = new NewEmployeePage(this.page);
await newEmployeePage.fillEmployeeName(name);
await newEmployeePage.submit();
}
async logout() {
await this.logoutButton.click();
}
}

View File

@@ -1,40 +0,0 @@
import { Locator, Page, expect } from "@playwright/test";
export class LoginPage {
readonly page: Page;
readonly usernameInput: Locator;
readonly signupButton: Locator;
constructor(page: Page) {
this.page = page;
this.usernameInput = page.getByRole("textbox");
this.signupButton = page.getByRole("button", {
name: "Sign up",
});
}
async goto(url: string) {
await this.page.goto(url);
}
async fillUsername(value: string) {
await this.usernameInput.clear();
await this.usernameInput.fill(value);
}
async loginAs(value: string) {
await this.page
.getByRole("button", {
name: value,
})
.click();
}
async signup() {
await this.signupButton.click();
}
async expectLoaded() {
await expect(this.signupButton).toBeVisible();
}
}

View File

@@ -1,24 +0,0 @@
import { Locator, Page } from "@playwright/test";
export class NewEmployeePage {
readonly page: Page;
readonly employeeNameInput: Locator;
readonly submitButton: Locator;
constructor(page: Page) {
this.page = page;
this.employeeNameInput = page.getByLabel(/employee name/i);
this.submitButton = page.getByRole("button", {
name: /create employee/i,
});
}
async fillEmployeeName(value: string) {
await this.employeeNameInput.clear();
await this.employeeNameInput.fill(value);
}
async submit() {
await this.submitButton.click();
}
}

View File

@@ -1,27 +0,0 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

View File

@@ -1,11 +0,0 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts"]
}

View File

@@ -1,17 +0,0 @@
import path from "path";
import react from "@vitejs/plugin-react-swc";
import { defineConfig } from "vite";
import topLevelAwait from "vite-plugin-top-level-await";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), topLevelAwait()],
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
build: {
minify: false,
},
});

View File

@@ -1,20 +0,0 @@
// vite.config.ts
import path from "path";
import react from "file:///Users/brad/dev/jazz/node_modules/@vitejs/plugin-react-swc/index.mjs";
import topLevelAwait from "file:///Users/brad/dev/jazz/node_modules/vite-plugin-top-level-await/exports/import.mjs";
import { defineConfig } from "file:///Users/brad/dev/jazz/node_modules/vite/dist/node/index.js";
var __vite_injected_original_dirname =
"/Users/brad/dev/jazz/examples/onboarding";
var vite_config_default = defineConfig({
plugins: [react(), topLevelAwait()],
resolve: {
alias: {
"@": path.resolve(__vite_injected_original_dirname, "./src"),
},
},
build: {
minify: false,
},
});
export { vite_config_default as default };
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCIvVXNlcnMvYnJhZC9kZXYvamF6ei9leGFtcGxlcy9vbmJvYXJkaW5nXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCIvVXNlcnMvYnJhZC9kZXYvamF6ei9leGFtcGxlcy9vbmJvYXJkaW5nL3ZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9Vc2Vycy9icmFkL2Rldi9qYXp6L2V4YW1wbGVzL29uYm9hcmRpbmcvdml0ZS5jb25maWcudHNcIjtpbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xuaW1wb3J0IHJlYWN0IGZyb20gXCJAdml0ZWpzL3BsdWdpbi1yZWFjdC1zd2NcIjtcbmltcG9ydCB7IGRlZmluZUNvbmZpZyB9IGZyb20gXCJ2aXRlXCI7XG5pbXBvcnQgdG9wTGV2ZWxBd2FpdCBmcm9tIFwidml0ZS1wbHVnaW4tdG9wLWxldmVsLWF3YWl0XCI7XG5cbi8vIGh0dHBzOi8vdml0ZWpzLmRldi9jb25maWcvXG5leHBvcnQgZGVmYXVsdCBkZWZpbmVDb25maWcoe1xuICBwbHVnaW5zOiBbcmVhY3QoKSwgdG9wTGV2ZWxBd2FpdCgpXSxcbiAgcmVzb2x2ZToge1xuICAgIGFsaWFzOiB7XG4gICAgICBcIkBcIjogcGF0aC5yZXNvbHZlKF9fZGlybmFtZSwgXCIuL3NyY1wiKSxcbiAgICB9LFxuICB9LFxuICBidWlsZDoge1xuICAgIG1pbmlmeTogZmFsc2UsXG4gIH0sXG59KTtcbiJdLAogICJtYXBwaW5ncyI6ICI7QUFBMFMsT0FBTyxVQUFVO0FBQzNULE9BQU8sV0FBVztBQUNsQixTQUFTLG9CQUFvQjtBQUM3QixPQUFPLG1CQUFtQjtBQUgxQixJQUFNLG1DQUFtQztBQU16QyxJQUFPLHNCQUFRLGFBQWE7QUFBQSxFQUMxQixTQUFTLENBQUMsTUFBTSxHQUFHLGNBQWMsQ0FBQztBQUFBLEVBQ2xDLFNBQVM7QUFBQSxJQUNQLE9BQU87QUFBQSxNQUNMLEtBQUssS0FBSyxRQUFRLGtDQUFXLE9BQU87QUFBQSxJQUN0QztBQUFBLEVBQ0Y7QUFBQSxFQUNBLE9BQU87QUFBQSxJQUNMLFFBQVE7QUFBQSxFQUNWO0FBQ0YsQ0FBQzsiLAogICJuYW1lcyI6IFtdCn0K

View File

@@ -1,5 +1,13 @@
# organization
## 0.0.43
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.42
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "organization",
"private": true,
"version": "0.0.42",
"version": "0.0.43",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,11 @@
# passkey-svelte
## 0.0.38
### Patch Changes
- jazz-svelte@0.10.5
## 0.0.37
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "passkey-svelte",
"version": "0.0.37",
"version": "0.0.38",
"type": "module",
"private": true,
"scripts": {

View File

@@ -1,5 +1,13 @@
# minimal-auth-passkey
## 0.0.48
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.47
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passkey",
"private": true,
"version": "0.0.47",
"version": "0.0.48",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# passphrase
## 0.0.45
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.44
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "passphrase",
"private": true,
"version": "0.0.44",
"version": "0.0.45",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,13 @@
# jazz-password-manager
## 0.0.69
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.68
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-password-manager",
"private": true,
"version": "0.0.68",
"version": "0.0.69",
"type": "module",
"scripts": {
"dev": "vite",
@@ -12,8 +12,8 @@
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
},
"dependencies": {
"jazz-react": "workspace:0.10.4",
"jazz-tools": "workspace:0.10.4",
"jazz-react": "workspace:0.10.5",
"jazz-tools": "workspace:0.10.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-hook-form": "^7.41.5",

View File

@@ -1,5 +1,14 @@
# jazz-example-pets
## 0.0.167
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser-media-images@0.10.5
- jazz-react@0.10.5
## 0.0.166
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-pets",
"private": true,
"version": "0.0.166",
"version": "0.0.167",
"type": "module",
"scripts": {
"dev": "vite",
@@ -19,9 +19,9 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-browser-media-images": "workspace:0.10.4",
"jazz-react": "workspace:0.10.4",
"jazz-tools": "workspace:0.10.4",
"jazz-browser-media-images": "workspace:0.10.5",
"jazz-react": "workspace:0.10.5",
"jazz-tools": "workspace:0.10.5",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",
@@ -41,7 +41,7 @@
"@vitejs/plugin-react-swc": "^3.3.2",
"autoprefixer": "^10.4.20",
"is-ci": "^3.0.1",
"jazz-run": "workspace:0.10.4",
"jazz-run": "workspace:0.10.5",
"postcss": "^8.4.27",
"tailwindcss": "^3.4.17",
"typescript": "~5.6.2",

View File

@@ -1,5 +1,14 @@
# reactions
## 0.0.47
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser-media-images@0.10.5
- jazz-react@0.10.5
## 0.0.46
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "reactions",
"private": true,
"version": "0.0.46",
"version": "0.0.47",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -1,5 +1,14 @@
# todo-vue
## 0.0.52
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-browser@0.10.5
- jazz-vue@0.10.5
## 0.0.51
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "todo-vue",
"version": "0.0.51",
"version": "0.0.52",
"private": true,
"type": "module",
"scripts": {

View File

@@ -1,5 +1,13 @@
# jazz-example-todo
## 0.0.166
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.165
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "jazz-example-todo",
"private": true,
"version": "0.0.165",
"version": "0.0.166",
"type": "module",
"scripts": {
"dev": "vite",
@@ -16,8 +16,8 @@
"@radix-ui/react-toast": "^1.1.4",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"jazz-react": "workspace:0.10.4",
"jazz-tools": "workspace:0.10.4",
"jazz-react": "workspace:0.10.5",
"jazz-tools": "workspace:0.10.5",
"lucide-react": "^0.274.0",
"qrcode": "^1.5.3",
"react": "^18.3.1",

View File

@@ -1,5 +1,13 @@
# version-history
## 0.0.44
### Patch Changes
- Updated dependencies [59ff77e]
- jazz-tools@0.10.5
- jazz-react@0.10.5
## 0.0.43
### Patch Changes

View File

@@ -1,7 +1,7 @@
{
"name": "version-history",
"private": true,
"version": "0.0.43",
"version": "0.0.44",
"type": "module",
"scripts": {
"dev": "vite",

View File

@@ -8,7 +8,6 @@ import {
ChevronRight,
CodeIcon,
CopyIcon,
FileLock2Icon,
FileTextIcon,
FingerprintIcon,
FolderArchiveIcon,
@@ -24,21 +23,18 @@ import {
MonitorSmartphoneIcon,
MoonIcon,
MousePointerSquareDashedIcon,
PencilLineIcon,
ScanFace,
ScrollIcon,
SunIcon,
TrashIcon,
UploadCloudIcon,
UserIcon,
UserPlusIcon,
UsersIcon,
WifiOffIcon,
XIcon,
} from "lucide-react";
const icons = {
addUser: UserPlusIcon,
arrowDown: ArrowDownIcon,
arrowRight: ArrowRightIcon,
auth: UserIcon,
@@ -65,13 +61,11 @@ const icons = {
newsletter: MailIcon,
offline: WifiOffIcon,
package: BoxIcon,
permissions: FileLock2Icon,
social: UsersIcon,
spatialPresence: MousePointerSquareDashedIcon,
tableOfContents: ScrollIcon,
touchId: FingerprintIcon,
upload: UploadCloudIcon,
write: PencilLineIcon,
zip: FolderArchiveIcon,
};

View File

@@ -24,12 +24,11 @@ function CopyButton({ code, size }: { code: string; size: "md" | "lg" }) {
type="button"
className={clsx(
"group/button absolute overflow-hidden rounded text-2xs font-medium md:opacity-0 backdrop-blur transition md:focus:opacity-100 group-hover:opacity-100",
"right-[9px] top-[9px]",
copied
? "bg-emerald-400/10 ring-1 ring-inset ring-emerald-400/20"
: "bg-white/5 hover:bg-white/7.5 dark:bg-white/2.5 dark:hover:bg-white/5",
size == "md"
? "right-[8px] top-[8px] py-[2px] pl-1 pr-2"
? "right-[8.5px] top-[8.5px] py-[2px] pl-1 pr-2"
: "right-2 top-2 py-1 pl-2 pr-3 ",
)}
onClick={() => {

View File

@@ -30,9 +30,9 @@ export function DropdownMenu({
className={clsx(
className,
// Anchor positioning
"[--anchor-gap:theme(spacing.2)] [--anchor-padding:theme(spacing.1)] data-[anchor~=start]:[--anchor-offset:-6px] data-[anchor~=end]:[--anchor-offset:6px] sm:data-[anchor~=start]:[--anchor-offset:-4px] sm:data-[anchor~=end]:[--anchor-offset:4px]",
"[--anchor-gap:theme(spacing.2)] [--anchor-padding:theme(spacing.1.5)]",
// Base styles
"isolate w-max rounded-xl p-1",
"isolate rounded-lg p-1.5",
// Invisible border that is only visible in `forced-colors` mode for accessibility purposes
"outline outline-1 outline-transparent focus:outline-none",
// Handle scrolling when menu won't fit in viewport
@@ -60,9 +60,9 @@ export function DropdownItem({
let classes = clsx(
className,
// Base styles
"group rounded-lg space-x-2 px-3.5 py-2.5 focus:outline-none sm:px-3 sm:py-1.5",
"group rounded-md space-x-2 focus:outline-none px-2.5 py-1.5",
// Text styles
"text-left text-stone-600 text-sm/6 dark:text-white forced-colors:text-[CanvasText]",
"text-left text-sm/6 dark:text-white forced-colors:text-[CanvasText]",
// Focus
"data-[focus]:bg-stone-100 dark:data-[focus]:bg-stone-900 ",
// Disabled state

View File

@@ -6,8 +6,7 @@ const plugin = require("tailwindcss/plugin");
const stonePalette = {
50: "oklch(0.988281 0.002 75)",
75: "oklch(0.980563 0.002 75)",
100: "oklch(0.964844 0.002 75)",
100: "oklch(0.980563 0.002 75)",
200: "oklch(0.917969 0.002 75)",
300: "oklch(0.853516 0.002 75)",
400: "oklch(0.789063 0.002 75)",
@@ -106,25 +105,25 @@ const config = {
fontFamily: theme("fontFamily.display"),
letterSpacing: theme("letterSpacing.tight"),
fontWeight: theme("fontWeight.semibold"),
fontSize: theme("fontSize.4xl"),
fontSize: theme("fontSize.3xl"),
},
h2: {
fontFamily: theme("fontFamily.display"),
letterSpacing: theme("letterSpacing.tight"),
fontWeight: theme("fontWeight.semibold"),
fontSize: theme("fontSize.3xl"),
fontSize: theme("fontSize.2xl"),
},
h3: {
fontFamily: theme("fontFamily.display"),
letterSpacing: theme("letterSpacing.tight"),
fontWeight: theme("fontWeight.semibold"),
fontSize: theme("fontSize.2xl"),
fontSize: theme("fontSize.xl"),
},
h4: {
fontFamily: theme("fontFamily.display"),
letterSpacing: theme("letterSpacing.tight"),
fontWeight: theme("fontWeight.semibold"),
fontSize: theme("fontSize.xl"),
fontSize: theme("fontSize.lg"),
},
"code::before": {
content: "none",

View File

@@ -9,7 +9,7 @@ export default function RootLayout({
}) {
return (
<DocsLayout nav={<ApiNav />} navIcon="package" navName="API Ref">
<Prose className="overflow-x-hidden lg:flex-1 py-8">{children}</Prose>
<Prose className="overflow-x-hidden lg:flex-1 py-10">{children}</Prose>
</DocsLayout>
);
}

View File

@@ -9,7 +9,7 @@ export default function Layout({
}) {
return (
<DocsLayout nav={<DocNav />}>
<Prose className="max-w-3xl mx-auto lg:flex-1 py-8">{children}</Prose>
<Prose className="max-w-3xl mx-auto lg:flex-1 py-10">{children}</Prose>
</DocsLayout>
);
}

View File

@@ -1,4 +1,6 @@
import { CodeGroup, ContentByFramework } from '@/components/forMdx'
import { CodeGroup, ContentByFramework, JazzLogo } from '@/components/forMdx'
# Learn some <span className="sr-only">Jazz</span> <JazzLogo className="h-[41px] -ml-0.5 -mt-[3px] inline" />
Welcome to the Jazz documentation!
@@ -47,7 +49,7 @@ Many of the packages provided are documented in the [API Reference](/api-referen
We support the [llms.txt](https://llmstxt.org/) convention for making documentation available to large language models and the applications that make use of them.
We currently have:
We currently have:
- [/llms.txt](/llms.txt) - A overview listing of the available packages and their documentation
- [/llms-full.txt](/llms-full.txt) - Full documentation for our packages
@@ -55,4 +57,4 @@ We currently have:
## Get support
If you have any questions or need assistance, please don't hesitate to reach out to us on [Discord](https://discord.gg/utDMjHYg42).
We would love to help you get started.
We would love to help you get started.

View File

@@ -1,30 +0,0 @@
import { JazzLogo } from "gcmp-design-system/src/app/components/atoms/logos/JazzLogo";
import { HeroHeader } from "gcmp-design-system/src/app/components/molecules/HeroHeader";
import { Prose } from "gcmp-design-system/src/app/components/molecules/Prose";
import MdxSource from "../../../../../components/docs/docs-intro.mdx";
import { frameworks } from "../../../../../lib/framework";
export default function Page() {
return (
<>
<div className="not-prose">
<h1 className="sr-only">Getting started</h1>
<HeroHeader
title={
<>
Learn some{" "}
<JazzLogo className="h-[1.3em] relative -top-0.5 inline-block -ml-[0.1em] -mr-[0.1em]" />
</>
}
slogan=""
pt={false}
/>
</div>
<MdxSource />
</>
);
}
export function generateStaticParams() {
return frameworks.map((framework) => ({ framework }));
}

View File

@@ -1,5 +1,4 @@
import DocsLayout from "@/components/docs/DocsLayout";
import { TableOfContents } from "@/components/docs/TableOfContents";
import ComingSoonPage from "@/components/docs/coming-soon.mdx";
import { DocNav } from "@/components/docs/nav";
import { docNavigationItems } from "@/lib/docNavigationItems.js";
@@ -11,6 +10,7 @@ export default async function Page({
params: { slug, framework },
}: { params: { slug: string[]; framework: string } }) {
const slugPath = slug.join("/");
const bodyClassName = "overflow-x-hidden lg:flex-1 py-10 max-w-3xl mx-auto";
try {
let mdxSource;
@@ -27,7 +27,7 @@ export default async function Page({
return (
<DocsLayout toc={tocItems} nav={<DocNav />}>
<Prose className="overflow-x-hidden lg:flex-1 py-8">
<Prose className={bodyClassName}>
<Content />
</Prose>
</DocsLayout>
@@ -35,8 +35,8 @@ export default async function Page({
} catch (error) {
return (
<DocsLayout nav={<DocNav />}>
<Prose className="overflow-x-hidden lg:flex-1 py-8">
<ComingSoonPage className="max-w-3xl mx-auto" />
<Prose className={bodyClassName}>
<ComingSoonPage />
</Prose>
</DocsLayout>
);

View File

@@ -193,7 +193,7 @@ Wrap your app components with the `JazzProvider:
>
{children}
</JazzProvider>
);
);
}
// Register the Account schema so `useAccount` returns our custom `MyAppAccount`
@@ -205,7 +205,15 @@ Wrap your app components with the `JazzProvider:
```
</CodeGroup>
You can optionally pass a custom `kvStore` and `AccountSchema` to `createJazzRNApp()`, otherwise, it defaults to `ExpoSecureStoreAdapter` and `Account`.
You can optionally pass a few custom attributes to `<JazzProvider>`:
- `kvStore`
- `ExpoSecureStoreAdapter` (default)
- example: `MMKVStore` - roll your own, using MMKV
- `AccountSchema`
- `Account` (default)
- `CryptoProvider`
- `PureJSCrypto` (default)
- `RNQuickCrypto` - C++ accelerated crypto provider
### Choosing an auth method

View File

@@ -1,3 +1,5 @@
import { ContentByFramework, CodeGroup } from '@/components/forMdx'
export const metadata = { title: "Sync and storage" };
# Sync and storage
@@ -29,9 +31,11 @@ Jazz Cloud will
You can run your own sync server using:
<CodeGroup>
```sh
npx jazz-run sync
```
</CodeGroup>
And then use `ws://localhost:4200` as the sync server URL.

View File

@@ -59,28 +59,6 @@ const FormIllustration = () => (
</div>
);
const OnboardingIllustration = () => (
<div className="flex h-full flex-col justify-center text-sm dark:bg-transparent">
<div className="mx-auto grid gap-3">
{[
{ icon: "addUser", text: "Add new employee" },
{
icon: "write",
text: "Invite employee to fill in their profile",
},
{ icon: "permissions", text: "Get confirmation from admin" },
].map(({ text, icon }, index) => (
<div className="flex items-center gap-2">
<span className="text-xs text-green-800 bg-green-100 leading-none font-medium text-center p-1.5 block rounded-full dark:bg-green-800 dark:text-green-200">
<Icon name={icon} size="xs" />
</span>
{text}
</div>
))}
</div>
</div>
);
const OrganizationRow = ({
name,
members,
@@ -435,15 +413,6 @@ const reactExamples: Example[] = [
demoUrl: "https://form-demo.jazz.tools",
illustration: <FormIllustration />,
},
{
name: "HR Onboarding",
slug: "onboarding",
description:
"See how admin and writer permissions work while onboarding new employees",
tech: [tech.react],
features: [features.imageUpload, features.inviteLink],
illustration: <OnboardingIllustration />,
},
{
name: "Organization/Team",
slug: "organization",

View File

@@ -2,6 +2,16 @@
@tailwind components;
@tailwind utilities;
@layer base {
:focus {
@apply outline-none;
}
:focus-visible {
@apply ring-2 ring-blue/75 dark:ring-blue-400/75;
}
}
@layer components {
@import "shiki.css";
}

View File

@@ -26,7 +26,7 @@ export function SideNav({
footer?: React.ReactNode;
}) {
return (
<div className={clsx(className, "text-sm space-y-5")}>
<div className={clsx(className, "text-sm space-y-5 px-2")}>
{children}
<div className="flex items-center gap-2">

View File

@@ -7,7 +7,8 @@ export function SideNavHeader({
href?: string;
children: React.ReactNode;
}) {
const className = "block font-medium text-stone-900 py-1 dark:text-white";
const className =
"block font-medium text-stone-900 py-1 dark:text-white mb-1";
if (href) {
return (

View File

@@ -1,6 +1,7 @@
"use client";
import { clsx } from "clsx";
import { Icon } from "gcmp-design-system/src/app/components/atoms/Icon";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { ReactNode } from "react";
@@ -16,7 +17,7 @@ export function SideNavItem({
}) {
const classes = clsx(
className,
"py-1 flex items-center hover:transition-colors",
"py-1.5 px-2 -mx-2 group rounded-md flex items-center transition-colors",
);
const path = usePathname();
@@ -26,14 +27,20 @@ export function SideNavItem({
href={href}
className={clsx(
classes,
href &&
"hover:text-stone-900 dark:hover:text-stone-200 transition-colors hover:transition-none",
{
"text-stone-900 dark:text-white": path === href,
},
path === href
? "text-stone-900 font-medium bg-stone-100 dark:text-white dark:bg-stone-900"
: "hover:text-stone-900 dark:hover:text-stone-200",
)}
>
{children}
{!href.startsWith("/docs") && (
<Icon
name="arrowRight"
size="2xs"
className="ml-2 text-stone-500 invisible group-hover:visible"
></Icon>
)}
</Link>
);
}

View File

@@ -35,27 +35,23 @@ export default function DocsLayout({
<div className="flex-1 w-full">
<JazzNav sections={navSections} />
<main>
<div className="container relative grid grid-cols-12 gap-5">
<div className="container relative md:grid md:grid-cols-12 md:gap-12">
<div
className={clsx(
"py-8",
"pr-3 md:col-span-4 lg:col-span-3",
"sticky align-start top-[65px] h-[calc(100vh-65px)] overflow-y-auto overflow-x-hidden",
"sticky align-start top-[72px] h-[calc(100vh-72px)] overflow-y-auto",
"hidden md:block",
)}
>
{nav}
</div>
<div
className={clsx(
"col-span-12 md:col-span-8 lg:col-span-9 flex gap-3",
)}
>
<div className={clsx("md:col-span-8 lg:col-span-9 flex gap-12")}>
{children}
{toc && (
<>
<TableOfContents
className="pl-3 py-6 shrink-0 text-sm sticky align-start top-[65px] w-[16rem] h-[calc(100vh-65px)] overflow-y-auto overflow-x-hidden hidden lg:block"
className="pl-3 py-6 shrink-0 text-sm sticky align-start top-[72px] w-[16rem] h-[calc(100vh-72px)] overflow-y-auto hidden lg:block"
items={toc as Toc}
/>
</>

View File

@@ -3,6 +3,7 @@
import { Framework } from "@/lib/framework";
import { useFramework } from "@/lib/use-framework";
import { Button } from "gcmp-design-system/src/app/components/atoms/Button";
import { Icon } from "gcmp-design-system/src/app/components/atoms/Icon";
import {
Dropdown,
DropdownButton,
@@ -37,7 +38,7 @@ const frameworks: Record<
},
};
export function FrameworkSelect({ className }: { className?: string }) {
export function FrameworkSelect() {
const router = useRouter();
const defaultFramework = useFramework();
const [selectedFramework, setSelectedFramework] =
@@ -53,14 +54,18 @@ export function FrameworkSelect({ className }: { className?: string }) {
return (
<Dropdown>
<DropdownButton
icon="chevronDown"
className="flex-row-reverse w-full justify-between"
className="w-full justify-between"
as={Button}
variant="secondary"
>
{frameworks[selectedFramework].label}
<Icon
name="chevronDown"
size="sm"
className="text-stone-400 dark:text-stone-600"
/>
</DropdownButton>
<DropdownMenu anchor="bottom start" className="z-50">
<DropdownMenu className="w-[--button-width] z-50" anchor="bottom start">
{Object.entries(frameworks).map(([key, framework]) => (
<DropdownItem
className="items-baseline"

View File

@@ -1,14 +1,47 @@
"use client";
import type { Toc, TocEntry } from "@stefanprobst/rehype-extract-toc";
import { clsx } from "clsx";
import Link from "next/link";
import { useCallback, useEffect, useState } from "react";
const TocList = ({
items,
level,
currentId,
}: { items: TocEntry[]; level: number; currentId: string }) => {
const isActive = (item: TocEntry) => {
if (!item.id) return false;
if (item.id === currentId) return true;
if (item.children) {
return item.children.some(isActive);
}
return false;
};
const TocList = ({ items, level }: { items: TocEntry[]; level: number }) => {
return (
<ul className="space-y-3" style={{ paddingLeft: `${level * 1}rem` }}>
{items.map((item) => (
<li key={item.id} className="space-y-3">
<Link href={`#${item.id}`}>{item.value}</Link>
{item.children && <TocList items={item.children} level={level + 1} />}
{item.id && (
<Link
href={`#${item.id}`}
className={clsx(
isActive(item)
? "text-stone-900 font-medium dark:text-white"
: "text-stone-600 hover:text-stone-900 dark:text-stone-400 dark:hover:text-white",
)}
>
{item.value}
</Link>
)}
{item.children && (
<TocList
items={item.children}
level={level + 1}
currentId={currentId}
/>
)}
</li>
))}
</ul>
@@ -22,6 +55,60 @@ export function TableOfContents({
items: Toc;
className?: string;
}) {
const [currentId, setCurrentId] = useState<string>("");
const getHeadings = useCallback(() => {
return items
.flatMap((node) => {
const headings = [node];
if (node.children) {
headings.push(...node.children);
}
return headings;
})
.filter((item): item is TocEntry & { id: string } => Boolean(item.id))
.map((item) => {
const el = document.getElementById(item.id);
if (!el) return null;
const style = window.getComputedStyle(el);
const scrollMt = parseFloat(style.scrollMarginTop);
const top = window.scrollY + el.getBoundingClientRect().top - scrollMt;
return { id: item.id, top };
})
.filter((x): x is { id: string; top: number } => x !== null);
}, [items]);
useEffect(() => {
if (items.length === 0) return;
const onScroll = () => {
const headings = getHeadings();
if (headings.length === 0) return;
const top = window.scrollY;
let current = headings[0].id;
for (const heading of headings) {
if (top >= heading.top - 500) {
current = heading.id;
} else {
break;
}
}
setCurrentId(current);
};
window.addEventListener("scroll", onScroll, { passive: true });
onScroll();
return () => {
window.removeEventListener("scroll", onScroll);
};
}, [getHeadings, items]);
if (!items.length) return null;
return (
@@ -29,7 +116,7 @@ export function TableOfContents({
<p className="font-medium text-stone-900 dark:text-white mb-3">
On this page
</p>
<TocList items={items} level={0} />
<TocList items={items} level={0} currentId={currentId} />
</div>
);
}

View File

@@ -73,7 +73,7 @@ export function ClassOrInterface({
<div className="relative not-prose">
<div
id={name}
className="peer sticky top-0 mt-4 md:top-[65px] md:pt-8 bg-white dark:bg-stone-950 z-20"
className="peer sticky top-0 mt-4 md:top-[72px] md:pt-8 bg-white dark:bg-stone-950 z-20"
>
<Link
href={"#" + name}

View File

@@ -7,6 +7,7 @@ import {
ContentByFramework as ContentByFrameworkClient,
ContentByFrameworkProps,
} from "@/components/docs/ContentByFramework";
import { JazzLogo as JazzLogoClient } from "gcmp-design-system/src/app/components/atoms/logos/JazzLogo";
import { CodeGroup as CodeGroupClient } from "gcmp-design-system/src/app/components/molecules/CodeGroup";
import { ComingSoon as ComingSoonClient } from "./docs/ComingSoon";
import { IssueTrackerPreview as IssueTrackerPreviewClient } from "./docs/IssueTrackerPreview";
@@ -30,3 +31,7 @@ export function ContentByFramework(props: ContentByFrameworkProps) {
export function IssueTrackerPreview() {
return <IssueTrackerPreviewClient />;
}
export function JazzLogo(props: { className?: string }) {
return <JazzLogoClient {...props} />;
}

View File

@@ -147,7 +147,7 @@ export function ChatDemoSection() {
)}
<div className="col-span-2 md:col-span-full lg:col-span-2">
{chatId && shareUrl && (
<div className="flex h-full flex-col justify-between gap-3 text-center md:gap-5">
<div className="flex h-full flex-col justify-between gap-3 text-center">
<H3 className="font-medium text-stone-900 dark:text-white !mb-0">
Join the chat
</H3>

View File

@@ -57,26 +57,26 @@ export const docNavigationItems = [
items: [
{
// upgrade guides
name: "Jazz 0.10.0 - New authentication flow",
name: "0.10.0 - New authentication flow",
href: "/docs/upgrade/0-10-0",
done: 100,
},
{
// upgrade guides
name: "Jazz 0.9.8 - Without me!",
name: "0.9.8 - Without me!",
href: "/docs/upgrade/0-9-8",
done: 100,
},
{
// upgrade guides
name: "Jazz 0.9.2 - Local persistence on React Native",
name: "0.9.2 - Local persistence on React Native",
href: "/docs/upgrade/react-native-local-persistence",
done: 100,
framework: "react-native",
},
{
// upgrade guides
name: "Jazz 0.9.0 - Top level imports",
name: "0.9.0 - Top level imports",
href: "/docs/upgrade/0-9-0",
done: 100,
},

Some files were not shown because too many files have changed in this diff Show More