# WorkspaceSettings

> Create and manage workspaces. A first-run onboarding page, a create dialog for the workspace switcher, a list of your workspaces, and a settings page with rename, address, picture, leave and type-to-confirm delete.

Source: https://docs.nasaqui.com/components/workspace-settings

## Install

```bash
npx shadcn@latest add https://docs.nasaqui.com/r/workspace-settings.json
```

Everything around the life of a workspace: the first one you create, the list of the ones you belong to, and the
page where an owner renames, re-addresses, leaves or deletes one.

## When to use

- First run of a signed-in person who has no workspace (`WorkspaceOnboarding`).
- The "Add workspace" item of `WorkspaceSwitcher` (`CreateWorkspaceDialog`).
- A workspace settings page (`WorkspaceSettings`) and a "your workspaces" page (`WorkspaceList`).

## When not to use

- Managing the people in it: use `MembersManager`.
- Personal account settings: use `AccountSettings`.

## Import

```tsx
import { WorkspaceOnboarding, WorkspaceSettings } from "@fadymondy/nasaq/web";
```

## Quick start

```tsx
<WorkspaceOnboarding
  slugPrefix="nasaq.app/"
  checkSlug={(slug) => api.slugAvailable(slug)}
  onSubmit={(v) => api.createWorkspace(v)}
/>

<WorkspaceSettings
  workspace={{ name: "Sahab Studio", slug: "sahab" }}
  canLeave={!isLastOwner}
  onRename={(v) => api.rename(v)}
  onLeave={() => api.leave()}
  onDelete={() => api.remove()}
/>
```

## Anatomy

```
WorkspaceOnboarding (AuthLayout or bare)  -> CreateWorkspaceForm   data-slot="create-workspace-form"
CreateWorkspaceDialog                     -> Dialog + CreateWorkspaceForm
WorkspaceList                             data-slot="workspace-list"
WorkspaceSettings                         data-slot="workspace-settings"
├─ SettingsSection General   picture, name, address
├─ SettingsSection Leave     confirm dialog; disabled with a reason for the last owner
└─ DangerZone Delete         type the workspace name to confirm
```

## API

| Prop | Component | Description |
| --- | --- | --- |
| `onSubmit(values)` | form, onboarding, dialog | `{ name, slug }`; resolve `{ error?, fieldErrors? }` to show a failure. |
| `checkSlug(slug)` | form, onboarding, dialog, settings | `boolean` or `{ available, message? }`; debounced and only for a valid address. |
| `slugPrefix` | same | Left-to-right text before the address, for example `nasaq.app/`. |
| `showSlug` | form, dialog | Hide the address field. The dialog hides it by default. |
| `bare` | onboarding | Render without `AuthLayout`. |
| `workspaces`, `onOpen`, `onCreate` | list | Items are `{ id, name, slug?, logo?, role?, members?, current? }`. |
| `workspace`, `canEdit`, `canDelete`, `canLeave` | settings | |
| `onRename`, `logo`, `onLeave`, `onDelete` | settings | Each section shows only when its handler is passed. |
| `labels` | all | English and Arabic built in. |

The address follows the name until edited; an Arabic-only name gives an empty address the person fills in.

## Examples

- **Switcher**: `<CreateWorkspaceDialog open={open} onOpenChange={setOpen} onSubmit={create} />` opened from `WorkspaceSwitcher`'s `onCreate`.

## Accessibility

Errors are tied to their fields; availability is announced in a status region and never by colour alone. Leave and
delete are alert dialogs.

## RTL & i18n

Addresses and prefixes are always left-to-right. The leave icon mirrors. Counts use locale digits.

## Styling & tokens

Built on `SettingsSection`, `DangerZone`, `Field` and `InputGroup`; follows the tokens.

## Do / Don't

- Do verify the address on the server; the check here is a hint.
- Do not delete without the typed confirmation.

## Related

- [MembersManager](https://docs.nasaqui.com/components/members-manager)
- [AccountSettings](https://docs.nasaqui.com/components/account-settings)

## Lab

https://docs.nasaqui.com/?path=/docs/components-account-workspace-settings--docs

## Code

### React

```tsx
<WorkspaceOnboarding
  slugPrefix="nasaq.app/"
  checkSlug={(slug) => api.slugAvailable(slug)}
  onSubmit={(v) => api.createWorkspace(v)}
/>

<WorkspaceSettings
  workspace={{ name: "Sahab Studio", slug: "sahab" }}
  canLeave={!isLastOwner}
  onRename={(v) => api.rename(v)}
  onLeave={() => api.leave()}
  onDelete={() => api.remove()}
/>
```

### shadcn

```tsx
<WorkspaceOnboarding
  slugPrefix="nasaq.app/"
  checkSlug={(slug) => api.slugAvailable(slug)}
  onSubmit={(v) => api.createWorkspace(v)}
/>

<WorkspaceSettings
  workspace={{ name: "Sahab Studio", slug: "sahab" }}
  canLeave={!isLastOwner}
  onRename={(v) => api.rename(v)}
  onLeave={() => api.leave()}
  onDelete={() => api.remove()}
/>
```

### Vue

```vue
<script setup lang="ts">
import { NqWorkspaceList, NqWorkspaceSettings, type WorkspaceListItem } from "@fadymondy/nasaq/vue";
import { ref } from "vue";

const workspace = ref({ name: "Acme Studio", slug: "acme-studio" });
const workspaces: WorkspaceListItem[] = [
  { id: "w1", name: "Acme Studio", slug: "acme-studio", role: "Owner", members: 12, current: true },
  { id: "w2", name: "Sahab Labs", slug: "sahab-labs", role: "Member", members: 1 },
];

async function checkSlug(slug: string) {
  return slug !== "taken";
}
async function onRename(values: { name: string; slug: string }) {
  workspace.value = values;
}
const noop = async () => undefined;
</script>

<template>
  <div class="flex flex-col gap-8">
    <NqWorkspaceList :workspaces="workspaces" :on-open="noop" :on-create="() => undefined" />
    <NqWorkspaceSettings :workspace="workspace" slug-prefix="nasaq.app/" :check-slug="checkSlug" :on-rename="onRename" :on-leave="noop" :on-delete="noop" />
  </div>
</template>
```

### Blade

```blade
@php
    $workspaces = [
        ['id' => 'w1', 'name' => 'Acme Studio', 'slug' => 'acme-studio', 'role' => 'Owner', 'members' => 12, 'current' => true],
        ['id' => 'w2', 'name' => 'Sahab Labs', 'slug' => 'sahab-labs', 'role' => 'Member', 'members' => 1],
    ];
@endphp
<div class="flex flex-col gap-8">
    <x-nq::workspace-settings.list :workspaces="$workspaces" can-create />
    <x-nq::workspace-settings :workspace="['name' => 'Acme Studio', 'slug' => 'acme-studio']" slug-prefix="nasaq.app/" check-slug has-leave has-delete />
    <x-nq::workspace-settings.create-dialog slug-prefix="nasaq.app/">
        <x-slot:trigger><x-nq::button variant="primary">New workspace</x-nq::button></x-slot:trigger>
    </x-nq::workspace-settings.create-dialog>
</div>
```

### HTML + Alpine

```html
<div class="flex flex-col gap-8">
    <section data-slot="workspace-list" aria-label="Your workspaces" x-data="nqWorkspaceList(JSON.parse('{\u0022workspaces\u0022:{\u0022w1\u0022:{\u0022id\u0022:\u0022w1\u0022,\u0022name\u0022:\u0022Acme Studio\u0022},\u0022w2\u0022:{\u0022id\u0022:\u0022w2\u0022,\u0022name\u0022:\u0022Sahab Labs\u0022}}}'))"
    class="flex flex-col gap-4">
    <div class="flex flex-wrap items-center justify-between gap-3">
        <h2 class="text-h3 text-foreground">Your workspaces</h2>
                    <button data-slot="button"
     type="button"                         x-on:click="create()" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-border bg-card text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)]">
        <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M5 12h14"/>
  <path d="M12 5v14"/>
</svg>New workspace</button>
            </div>
            <ul aria-label="Workspaces" class="flex flex-col divide-y divide-border rounded-card border border-border bg-card">
                            <li class="flex flex-wrap items-center gap-x-4 gap-y-2 px-4 py-3">
                    <span data-slot="avatar" x-data="nqAvatar(0)"
    class="inline-flex shrink-0 select-none items-center justify-center overflow-hidden bg-secondary align-middle font-medium text-secondary-foreground size-10 text-label rounded-control">
                    <span data-slot="avatar-fallback" class="flex size-full items-center justify-center" x-bind="fallback"
             role="img" aria-label="Acme Studio" >AS</span>
    </span>
                    <div class="flex min-w-0 flex-1 flex-col">
                        <span class="flex items-center gap-2 truncate text-label text-foreground">
                            Acme Studio
                                                            <span data-slot="badge"     class="inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[4px] border px-1.5 text-caption font-medium [&_svg]:size-3 border-nq-brand/40 bg-[color-mix(in_oklab,var(--nq-brand)_14%,transparent)] text-foreground"><svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M20 6 9 17l-5-5"/>
</svg>Current</span>
                                                    </span>
                        <span class="flex flex-wrap items-center gap-x-2 text-caption text-muted-foreground">
                            <bdi dir="ltr">acme-studio</bdi>                            <span>12 members</span>                        </span>
                    </div>
                    <span data-slot="badge"     class="inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[4px] border px-1.5 text-caption font-medium [&_svg]:size-3 border-border bg-secondary text-foreground">Owner</span>
                                            <button data-slot="button"
     type="button"                  disabled      data-disabled     class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover h-control-sm px-2.5">
        Open</button>
                                    </li>
                            <li class="flex flex-wrap items-center gap-x-4 gap-y-2 px-4 py-3">
                    <span data-slot="avatar" x-data="nqAvatar(0)"
    class="inline-flex shrink-0 select-none items-center justify-center overflow-hidden bg-secondary align-middle font-medium text-secondary-foreground size-10 text-label rounded-control">
                    <span data-slot="avatar-fallback" class="flex size-full items-center justify-center" x-bind="fallback"
             role="img" aria-label="Sahab Labs" >SL</span>
    </span>
                    <div class="flex min-w-0 flex-1 flex-col">
                        <span class="flex items-center gap-2 truncate text-label text-foreground">
                            Sahab Labs
                                                    </span>
                        <span class="flex flex-wrap items-center gap-x-2 text-caption text-muted-foreground">
                            <bdi dir="ltr">sahab-labs</bdi>                            <span>1 member</span>                        </span>
                    </div>
                    <span data-slot="badge"     class="inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[4px] border px-1.5 text-caption font-medium [&_svg]:size-3 border-border bg-secondary text-foreground">Member</span>
                                            <button data-slot="button"
     type="button"                         data-id="w2" x-on:click="open($el.dataset.id)" x-bind:aria-busy="isOpening($el.dataset.id) ? &#039;true&#039; : null" x-bind:data-disabled="isOpening($el.dataset.id) ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border-border bg-card text-foreground hover:bg-nq-hover h-control-sm px-2.5">
        <svg data-slot="spinner" aria-hidden="true" style="display: none;" x-show="isOpening($el.dataset.id)" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>                            Open</button>
                                    </li>
                    </ul>
    </section>
    <div data-slot="workspace-settings" x-data="nqWorkspaceSettings(JSON.parse('{\u0022name\u0022:\u0022Acme Studio\u0022,\u0022slug\u0022:\u0022acme-studio\u0022,\u0022hasCheck\u0022:true,\u0022labels\u0022:{\u0022nameRequired\u0022:\u0022Enter a name for the workspace.\u0022,\u0022slugHelp\u0022:\u0022Letters, numbers and dashes. You can change it later.\u0022,\u0022slugChecking\u0022:\u0022Checking availability\u0022,\u0022slugAvailable\u0022:\u0022This address is available.\u0022,\u0022slugTaken\u0022:\u0022That address is taken. Try another one.\u0022,\u0022slugCheckFailed\u0022:\u0022Availability could not be checked. It will be verified when you create it.\u0022,\u0022problemEmpty\u0022:\u0022Enter an address for the workspace.\u0022,\u0022problemShort\u0022:\u0022Use at least 3 characters.\u0022,\u0022problemLong\u0022:\u0022Use at most 40 characters.\u0022,\u0022problemFormat\u0022:\u0022Use lowercase letters, numbers and dashes. Start and end with a letter or number.\u0022,\u0022failed\u0022:\u0022That did not work. Try again.\u0022,\u0022saved\u0022:\u0022Workspace updated.\u0022,\u0022deleteFailed\u0022:\u0022The workspace could not be deleted. Try again.\u0022}}'))" x-on:nq-account-delete="onDelete($event)" class="flex flex-col gap-6">
    <div role="region" aria-labelledby="nq-settings-section-a9ef9c31-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-a9ef9c31-title" class="text-foreground text-h3">General</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">The name and address people see for this workspace.</div></div>
    <div data-slot="card-content" class="px-4"><form id="workspace-general" novalidate class="flex flex-col gap-5" x-on:submit.prevent="save()">
                        <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="nameBad" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  class="text-label text-foreground data-disabled:opacity-50">Workspace name</label>
                <input data-slot="input" type="text"
                    x-bind:value="name" x-on:input="onName($event.target.value)" x-bind:disabled="saving || false" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control">
                <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  class="text-caption text-nq-danger-text"><span x-text="nameMsg"></span></div>
</div>
            <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="slugBad" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  data-disabled  class="text-label text-foreground data-disabled:opacity-50">Workspace address</label>
    <div role="group" data-slot="input-group"
    dir="ltr" class="group/input-group flex h-control min-h-[var(--nq-touch-min,0px)] w-full min-w-0 items-center overflow-hidden rounded-control border border-input bg-card text-body text-foreground transition-colors duration-150 ease-nq focus-within:border-nq-focus focus-within:outline-1 focus-within:outline-nq-focus has-[[data-invalid]]:border-nq-danger has-[[aria-invalid=true]]:border-nq-danger has-[input:disabled]:cursor-not-allowed has-[input:disabled]:opacity-50"><div data-slot="input-group-addon" data-align="start"
    class="flex h-full shrink-0 items-center gap-1.5 text-body-sm text-muted-foreground [&_svg]:size-4 order-first ps-3 pe-1"><span data-slot="input-group-text" class="select-none whitespace-nowrap">nasaq.app/</span></div>
        <input data-slot="input-group-input"     autocapitalize="none" autocorrect="off" spellcheck="false" x-bind:value="slug" x-on:input="onSlug($event.target.value)" x-bind:disabled="saving || false" class="h-full min-w-0 flex-1 border-0 bg-transparent px-3 text-body text-foreground outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed pointer-coarse:text-[16px]" />
        <div data-slot="input-group-addon" data-align="end"
    x-show="check.status !== &#039;idle&#039;" style="display: none" class="flex h-full shrink-0 items-center gap-1.5 text-body-sm text-muted-foreground [&_svg]:size-4 order-last ps-1 pe-3"><template x-if="check.status === 'checking'"><svg data-slot="spinner" aria-hidden="true" class="animate-spin motion-reduce:animate-none size-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg></template>
            <template x-if="check.status === 'available'"><svg aria-hidden="true" class="size-4 text-nq-success-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m9 12 2 2 4-4"/>
</svg></template>
            <template x-if="check.status === 'taken'"><svg aria-hidden="true" class="size-4 text-nq-danger-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m15 9-6 6"/>
  <path d="m9 9 6 6"/>
</svg></template></div></div>
    <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  class="text-caption text-nq-danger-text"><span x-text="slugMsg"></span></div>
    <p x-show="! slugBad" style="display: none" data-slot="field-description" class="text-caption text-muted-foreground" x-text="hint"></p>
</div>
            <template x-if="notice !== null && notice.tone === 'success'">
                <div data-slot="alert" data-tone="success" role="status"
     x-data="nqAlert()" x-modelable="open" x-show="open"     x-on:nq:dismiss="notice = null" class="relative grid grid-cols-[auto_1fr_auto] items-start gap-x-3 rounded-card border p-3 text-start border-nq-success/30 bg-nq-success-soft">
    <svg aria-hidden="true" data-slot="alert-icon" class="mt-0.5 size-4 text-nq-success-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m9 12 2 2 4-4"/>
</svg>    <div data-slot="alert-body" class="flex min-w-0 flex-col gap-0.5">
                            <div data-slot="alert-description" class="text-body-sm text-foreground"><span x-text="notice.text"></span></div>
            </div>
            <div data-slot="alert-actions" class="ms-3 flex items-center gap-1">
                            <button data-slot="button"
     type="button"                         aria-label="Dismiss" x-on:click="dismiss()" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-nq-hover size-control-sm p-0 text-muted-foreground [&_svg]:size-3.5">
        <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M18 6 6 18"/>
  <path d="m6 6 12 12"/>
</svg></button>
                    </div>
    </div>
            </template>
            <template x-if="notice !== null && notice.tone === 'danger'">
                <div data-slot="alert" data-tone="danger" role="alert"
     x-data="nqAlert()" x-modelable="open" x-show="open"     x-on:nq:dismiss="notice = null" class="relative grid grid-cols-[auto_1fr_auto] items-start gap-x-3 rounded-card border p-3 text-start border-nq-danger/30 bg-nq-danger-soft">
    <svg aria-hidden="true" data-slot="alert-icon" class="mt-0.5 size-4 text-nq-danger-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m15 9-6 6"/>
  <path d="m9 9 6 6"/>
</svg>    <div data-slot="alert-body" class="flex min-w-0 flex-col gap-0.5">
                            <div data-slot="alert-description" class="text-body-sm text-foreground"><span x-text="notice.text"></span></div>
            </div>
            <div data-slot="alert-actions" class="ms-3 flex items-center gap-1">
                            <button data-slot="button"
     type="button"                         aria-label="Dismiss" x-on:click="dismiss()" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 hover:bg-nq-hover size-control-sm p-0 text-muted-foreground [&_svg]:size-3.5">
        <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M18 6 6 18"/>
  <path d="m6 6 12 12"/>
</svg></button>
                    </div>
    </div>
            </template>
        </form></div>
            <div data-slot="settings-section-footer" class="flex items-center px-4 flex-wrap justify-between gap-3 border-t border-border pt-4"><div class="min-w-0 text-caption text-muted-foreground"></div>
            <div class="flex flex-wrap items-center gap-2"><button data-slot="button"
     type="submit"                         form="workspace-general" x-bind:aria-busy="saving ? &#039;true&#039; : null" x-bind:data-disabled="cannotSave() ? &#039;&#039; : null" x-bind:disabled="cannotSave()" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--nq-action)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <svg data-slot="spinner" aria-hidden="true" style="display: none;" x-show="saving" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>                    Save changes</button></div></div>
    </div>
            <div role="region" aria-labelledby="nq-settings-section-beba738a-title" data-slot="settings-section" data-tone="default"
    class="flex flex-col rounded-card border border-border bg-card py-4 text-card-foreground gap-5">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-beba738a-title" class="text-foreground text-h3">Leave workspace</h2>
        <div data-slot="card-description" class="text-body-sm text-muted-foreground">You lose access until someone invites you again.</div></div>
    <div data-slot="card-content" class="px-4"><button data-slot="button"
     type="button"                         x-on:click="leaveOpen = true" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <svg aria-hidden="true" class="rtl:-scale-x-100" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="m16 17 5-5-5-5"/>
  <path d="M21 12H9"/>
  <path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/>
</svg>Leave workspace</button></div>
    </div>
        <div data-slot="alert-dialog" x-data="nqAlertDialog(false)" x-modelable="open" x-id="['nq-alert-dialog']" x-model="leaveOpen" class="contents">
    <template x-teleport="body">
    <div data-slot="alert-dialog-portal">
        <div data-slot="alert-dialog-backdrop" x-nq-presence="open" class="fixed inset-0 z-50 bg-nq-fg/15 dark:bg-nq-bg/60 transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0"></div>
        <div data-slot="alert-dialog-content" x-bind="popup" x-nq-presence="open" x-trap.noscroll="open"
            class="fixed inset-0 z-50 m-auto grid h-fit w-[calc(100%-2rem)] max-w-md gap-4 rounded-floating border border-border bg-popover p-6 text-popover-foreground outline-none max-h-[calc(100dvh-2rem)] overflow-y-auto transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0">
            <div data-slot="alert-dialog-header" class="flex flex-col gap-1.5 text-start"><h2 data-slot="alert-dialog-title" :id="$id('nq-alert-dialog', 'title')" class="text-h3 text-foreground">Leave Acme Studio?</h2>
                    <p data-slot="alert-dialog-description" :id="$id('nq-alert-dialog', 'description')" class="text-body-sm text-muted-foreground">You lose access to everything in this workspace. You can rejoin only if someone invites you.</p></div>
                <template x-if="leaveError !== null">
                    <div data-slot="alert" data-tone="danger" role="alert"
        class="relative grid grid-cols-[auto_1fr_auto] items-start gap-x-3 rounded-card border p-3 text-start border-nq-danger/30 bg-nq-danger-soft">
    <svg aria-hidden="true" data-slot="alert-icon" class="mt-0.5 size-4 text-nq-danger-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m15 9-6 6"/>
  <path d="m9 9 6 6"/>
</svg>    <div data-slot="alert-body" class="flex min-w-0 flex-col gap-0.5">
                            <div data-slot="alert-description" class="text-body-sm text-foreground"><span x-text="leaveError"></span></div>
            </div>
    </div>
                </template>
                <div data-slot="alert-dialog-footer" class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"><button data-slot="button"
     type="button"                         x-on:click="leaveOpen = false" x-bind:disabled="leaving ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)]">
        Cancel</button>
                    <button data-slot="button"
     type="button"                         x-on:click="leave()" x-bind:aria-busy="leaving ? &#039;true&#039; : null" x-bind:data-disabled="leaving ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <svg data-slot="spinner" aria-hidden="true" style="display: none;" x-show="leaving" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>                        Leave workspace</button></div>
        </div>
    </div>
</template>
</div>
            <div role="region" aria-labelledby="nq-settings-section-ed9f9b53-title" data-slot="danger-zone" data-tone="danger"
    class="flex flex-col rounded-card border bg-card py-4 text-card-foreground gap-5 border-nq-danger/40">
    <div data-slot="card-header" class="grid auto-rows-min items-start gap-1 px-4 has-data-[slot=card-action]:grid-cols-[1fr_auto]"><h2 data-slot="card-title" id="nq-settings-section-ed9f9b53-title" class="text-h3 text-nq-danger-text">Delete workspace</h2></div>
    <div data-slot="card-content" class="px-4"><div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between" x-data="nqDangerZone(JSON.parse('{\u0022phrase\u0022:\u0022Acme Studio\u0022,\u0022failed\u0022:\u0022The workspace could not be deleted. Try again.\u0022}'))">
        <div class="min-w-0">
            <p class="text-label text-foreground">Delete this workspace</p>
            <p class="text-body-sm text-muted-foreground">Permanently delete the workspace and everything in it for every member. This cannot be undone.</p>
        </div>
        <div data-slot="alert-dialog" x-data="nqAlertDialog(false)" x-modelable="open" x-id="['nq-alert-dialog']" x-model="confirming" class="contents">
    <button data-slot="alert-dialog-trigger"
     type="button"                         aria-haspopup="dialog" x-on:click="show()" :aria-expanded="open" class="inline-flex select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)] shrink-0">
        Delete workspace</button>
            <template x-teleport="body">
    <div data-slot="alert-dialog-portal">
        <div data-slot="alert-dialog-backdrop" x-nq-presence="open" class="fixed inset-0 z-50 bg-nq-fg/15 dark:bg-nq-bg/60 transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0"></div>
        <div data-slot="alert-dialog-content" x-bind="popup" x-nq-presence="open" x-trap.noscroll="open"
            class="fixed inset-0 z-50 m-auto grid h-fit w-[calc(100%-2rem)] max-w-md gap-4 rounded-floating border border-border bg-popover p-6 text-popover-foreground outline-none max-h-[calc(100dvh-2rem)] overflow-y-auto transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0">
            <form novalidate class="grid gap-4" x-on:submit.prevent="remove()">
                    <div data-slot="alert-dialog-header" class="flex flex-col gap-1.5 text-start"><h2 data-slot="alert-dialog-title" :id="$id('nq-alert-dialog', 'title')" class="text-h3 text-foreground">Delete Acme Studio?</h2>
                        <p data-slot="alert-dialog-description" :id="$id('nq-alert-dialog', 'description')" class="text-body-sm text-muted-foreground">Every member loses access and all of its data is removed for good.</p></div>
                    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="bad" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  class="text-label text-foreground data-disabled:opacity-50">Type ⁨Acme Studio⁩ to confirm</label>
                        <input data-slot="input" type="text"
     dir="ltr"      name="confirm-delete"             autocomplete="off" autocapitalize="none" autocorrect="off" spellcheck="false" x-bind:value="typed" x-on:input="type($event.target.value)" x-bind:disabled="busy" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control text-start">
                        <p data-slot="field-description" role="alert" x-show="bad" style="display: none" x-text="error" class="text-caption text-nq-danger-text"></p>
</div>
                    <div data-slot="alert-dialog-footer" class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end"><button data-slot="alert-dialog-cancel"
     type="button"                         autofocus="autofocus" x-on:click="close()" x-bind:disabled="busy" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)]">
        Cancel</button>
                        <button data-slot="button"
     type="submit"                         x-bind:disabled="! matches || busy" x-bind:data-disabled="(! matches || busy) ? &#039;&#039; : null" x-bind:aria-busy="busy ? &#039;true&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--nq-danger-solid)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <template x-if="busy"><svg data-slot="spinner" aria-hidden="true" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg></template>
                            Delete this workspace</button></div>
                </form>
        </div>
    </div>
</template>
</div>
    </div></div>
    </div>
    </div>
    <div data-slot="create-workspace-dialog" x-data="nqWorkspaceForm(JSON.parse('{\u0022showSlug\u0022:false,\u0022hasCheck\u0022:false,\u0022defaultName\u0022:\u0022\u0022,\u0022open\u0022:false,\u0022labels\u0022:{\u0022nameRequired\u0022:\u0022Enter a name for the workspace.\u0022,\u0022slugHelp\u0022:\u0022Letters, numbers and dashes. You can change it later.\u0022,\u0022slugChecking\u0022:\u0022Checking availability\u0022,\u0022slugAvailable\u0022:\u0022This address is available.\u0022,\u0022slugTaken\u0022:\u0022That address is taken. Try another one.\u0022,\u0022slugCheckFailed\u0022:\u0022Availability could not be checked. It will be verified when you create it.\u0022,\u0022problemEmpty\u0022:\u0022Enter an address for the workspace.\u0022,\u0022problemShort\u0022:\u0022Use at least 3 characters.\u0022,\u0022problemLong\u0022:\u0022Use at most 40 characters.\u0022,\u0022problemFormat\u0022:\u0022Use lowercase letters, numbers and dashes. Start and end with a letter or number.\u0022,\u0022failed\u0022:\u0022That did not work. Try again.\u0022}}'))" >
            <span x-on:click="open = true"><button data-slot="button"
     type="button"                         class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--nq-action)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        New workspace</button></span>
        <div data-slot="dialog" x-data="nqDialog(false)" x-modelable="open" x-id="['nq-dialog']" x-model="open" class="contents">
    <template x-teleport="body">
    <div data-slot="dialog-portal">
        <div data-slot="dialog-backdrop" x-nq-presence="open" x-on:click="close()" class="fixed inset-0 z-50 bg-nq-fg/15 dark:bg-nq-bg/60 transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0"></div>
        <div data-slot="dialog-content" x-bind="popup" x-nq-presence="open" x-trap.noscroll="open"
            class="fixed inset-0 z-50 m-auto grid h-fit w-[calc(100%-2rem)] gap-4 rounded-floating border border-border bg-popover p-6 text-popover-foreground outline-none max-h-[calc(100dvh-2rem)] overflow-y-auto transition-opacity duration-150 ease-nq data-starting-style:opacity-0 data-ending-style:opacity-0 max-w-md">
            <div data-slot="dialog-header" class="flex flex-col gap-1.5 pe-8 text-start"><h2 data-slot="dialog-title" :id="$id('nq-dialog', 'title')" class="text-h3 text-foreground">Create a workspace</h2>
                <p data-slot="dialog-description" :id="$id('nq-dialog', 'description')" class="text-body-sm text-muted-foreground">A separate space for a team, a client or a project.</p></div>
<form data-slot="create-workspace-form" novalidate x-on:submit.prevent="submit()"
        class="flex flex-col gap-4">
    <div data-slot="field" x-data="nqField(false)" x-modelable="invalid" x-id="['nq-field']"
         data-valid     x-model="nameBad" class="flex flex-col gap-1.5">
    <label data-slot="field-label"  class="text-label text-foreground data-disabled:opacity-50">Workspace name</label>
        <input data-slot="input" type="text"
                    autocomplete="organization" placeholder="Sahab Studio" x-bind:value="name" x-on:input="onName($event.target.value)" x-bind:disabled="busy" class="w-full min-w-0 rounded-control border border-input bg-card px-3 text-body text-foreground min-h-[var(--nq-touch-min,0px)] transition-colors duration-150 ease-nq outline-none placeholder:text-muted-foreground focus-visible:border-nq-focus focus-visible:outline-1 focus-visible:outline-nq-focus data-invalid:border-nq-danger aria-invalid:border-nq-danger disabled:cursor-not-allowed disabled:opacity-50 pointer-coarse:text-[16px] h-control">
        <div data-slot="field-error" role="alert" x-show="invalid"  style="display: none"  class="text-caption text-nq-danger-text"><span x-text="nameMsg"></span></div>
</div>
        <template x-if="formError !== null">
        <div data-slot="alert" data-tone="danger" role="alert"
        class="relative grid grid-cols-[auto_1fr_auto] items-start gap-x-3 rounded-card border p-3 text-start border-nq-danger/30 bg-nq-danger-soft">
    <svg aria-hidden="true" data-slot="alert-icon" class="mt-0.5 size-4 text-nq-danger-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <circle cx="12" cy="12" r="10"/>
  <path d="m15 9-6 6"/>
  <path d="m9 9 6 6"/>
</svg>    <div data-slot="alert-body" class="flex min-w-0 flex-col gap-0.5">
                            <div data-slot="alert-description" class="text-body-sm text-foreground"><span x-text="formError"></span></div>
            </div>
    </div>
    </template>
    <div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
                    <button data-slot="button"
     type="button"                         x-on:click="cancel()" x-bind:disabled="busy ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-foreground hover:bg-nq-hover h-control px-[var(--nq-control-pad)]">
        Cancel</button>
                <button data-slot="button"
     type="submit"                         x-bind:aria-busy="busy ? &#039;true&#039; : null" x-bind:data-disabled="busy ? &#039;&#039; : null" class="inline-flex shrink-0 select-none items-center justify-center gap-2 whitespace-nowrap rounded-control border border-transparent font-sans text-label transition-colors duration-150 ease-nq min-h-[var(--nq-touch-min,0px)] outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-nq-focus disabled:pointer-events-none disabled:opacity-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--nq-action)_88%,var(--nq-fg))] h-control px-[var(--nq-control-pad)]">
        <svg data-slot="spinner" aria-hidden="true" style="display: none;" x-show="busy" class="size-4 animate-spin motion-reduce:animate-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M21 12a9 9 0 1 1-6.219-8.56"/>
</svg>            Create workspace</button>
    </div>
</form>
                            <button type="button" data-slot="dialog-close" x-on:click="close()" aria-label="Close"
                    class="absolute end-3 top-3 inline-flex size-8 items-center justify-center rounded-control text-muted-foreground transition-colors duration-150 hover:bg-nq-hover hover:text-foreground focus-visible:outline-2 focus-visible:outline-nq-focus [&_svg]:size-4"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
  <path d="M18 6 6 18"/>
  <path d="m6 6 12 12"/>
</svg></button>
                    </div>
    </div>
</template>
</div>
</div>
</div>
```
