> ## Documentation Index
> Fetch the complete documentation index at: https://translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Web で組織の詳細を編集する

> 名前、表示名、ブランドカラー、ロゴなど、organization の詳細を編集します。

export const ReleaseStageNotice = ({feature, stage, plans, contact, terms}) => {
  const stageTextMap = {
    "beta": "Beta",
    "ea": "早期アクセス"
  };
  const stageText = stageTextMap[stage] || "製品リリース段階";
  const prsLink = "/docs/troubleshoot/product-lifecycle/product-release-stages";
  const linkify = (text, url) => {
    return <a href={url} target="_blank" rel="noreferrer" class="link">{text}</a>;
  };
  const includeDetails = (plans, contact, terms) => {
    const hasDetails = terms || plans || contact;
    if (!hasDetails) return null;
    return <span data-as="p">
            {plans && <>この機能は{linkify(`${plans}プラン`, "https://auth0.com/pricing")}でご利用いただけます。 </>}
            {contact && "参加をご希望の場合は、" + contact + "までお問い合わせください。 "}
            {terms && <>この機能を使用することにより、Oktaの該当する無料トライアル規約および{linkify("Master Subscription Agreement", "https://www.okta.com/legal")}に同意したものとみなされます。</>}
        </span>;
  };
  return <Warning>
            <span data-as="p">
                <strong>{feature}機能は現在、{linkify(stageText, prsLink)}です。</strong>
            </span>

            {includeDetails(plans, contact, terms)}
        </Warning>;
};

export const ComponentLoader = props => {
  const themePref = window?.localStorage?.getItem?.("isDarkMode");
  const theme = themePref === "dark" || themePref === "light" ? themePref : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
  const lang = {
    i18n: {
      currentLanguage: props.lang || "en-US"
    }
  };
  return <div style={{
    minHeight: "400px",
    marginTop: "40px",
    background: theme === "light" ? "rgb(var(--gray-950)/.03)" : "rgb(255 255 255/.1)",
    display: "flex",
    alignItems: "center",
    justifyContent: "center",
    position: "relative",
    backgroundSize: "16px 16px",
    borderRadius: "10px",
    boxShadow: "0 1px 4px 0 rgba(16,30,54,0.04)",
    display: "flex",
    flexDirection: "column"
  }}>
      <div style={{
    minWidth: "320px",
    width: "96.5%",
    maxWidth: "1200px",
    margin: "12px 12px 0",
    background: theme === "light" ? "#ffffff" : "#101011",
    borderRadius: "10px",
    boxShadow: "0 2px 8px 0 rgba(16,30,54,0.04)",
    padding: "24px",
    minHeight: "400px"
  }} data-uc-component={props.componentSelector} data-uc-props={JSON.stringify(lang)}>
        <Spinner size={40} color="#8A94A6" style={{
    position: "absolute",
    top: "50%",
    left: "50%",
    transform: "translate(-50%, -50%)",
    zIndex: 1
  }} />
      </div>
      <div style={{
    width: "100%",
    textAlign: "center",
    color: theme === "light" ? "#6B7280" : "ffffff",
    fontSize: "12px",
    marginTop: "8px",
    marginBottom: "8px",
    letterSpacing: "0.01em",
    fontWeight: 400
  }}>
        {props.componentPreviewText}
      </div>
    </div>;
};

export const Spinner = ({size = 40, color = "#8A94A6", style = {}}) => <div style={{
  display: "flex",
  alignItems: "center",
  justifyContent: "center",
  ...style
}} aria-label="読み込み中" role="status">
    <svg width={size} height={size} viewBox="0 0 50 50" style={{
  display: "block"
}}>
      <circle cx="25" cy="25" r="20" fill="none" stroke={color} strokeWidth="5" strokeDasharray="90 150" strokeLinecap="round">
        <animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite" />
      </circle>
    </svg>
  </div>;

<ReleaseStageNotice feature="Auth0 Universal Components" stage="ea" terms="true" contact="Auth0 Support" />

`OrganizationDetailsEdit` コンポーネントは、[組織](/docs/ja-jp/manage-users/organizations)の詳細を編集するための統合インターフェースを提供します。

<ComponentLoader componentSelector="organization-details-edit" componentPreviewText="組織の詳細編集コンポーネントのプレビュー" />

<Tabs>
  <Tab title="React">
    ## 設定の要件

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      **Auth0 Configuration が必要です**—tenant で
      My Organization API が設定されていることを確認してください。[設定ガイドを表示
      →](/docs/ja-jp/get-started/universal-components/web/components/build-delegated-admin#enable-the-my-organization-api)
    </Callout>

    ## インストール

    <CodeGroup>
      ```bash pnpm  wrap lines theme={null}
      pnpm add @auth0/universal-components-react
      ```

      ```bash npm wrap lines theme={null}
      npm install @auth0/universal-components-react
      ```
    </CodeGroup>

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      どちらのコマンドを実行しても、共有ユーティリティとAuth0連携に必要な@auth0/universal-components-core
      依存パッケージもインストールされます。
    </Callout>

    ## はじめに

    ```tsx wrap lines theme={null}
    import { OrganizationDetailsEdit } from "@auth0/universal-components-react";
    import { useNavigate } from "react-router-dom";

    export function OrganizationSettingsPage() {
      const navigate = useNavigate();

      return (
        <OrganizationDetailsEdit
          saveAction={{
            onAfter: () => navigate("/organization"),
          }}
          backButton={{
            onClick: () => navigate("/organization"),
          }}
        />
      );
    }
    ```

    <Accordion title="連携の完全な例">
      ```tsx wrap lines theme={null}
      import React from "react";
      import { OrganizationDetailsEdit } from "@auth0/universal-components-react";
      import { Auth0Provider } from "@auth0/auth0-react";
      import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
      import { useNavigate } from "react-router-dom";
      import { analytics } from "./lib/analytics";

      function OrganizationSettingsPage() {
        const navigate = useNavigate();

        const handleSaveSuccess = (org) => {
          analytics.track("Organization Updated", {
            name: org.name,
            displayName: org.display_name,
          });
          navigate("/organization");
        };

        return (
          <div className="max-w-2xl mx-auto p-6">
            <OrganizationDetailsEdit
              schema={{
                details: {
                  displayName: {
                    required: true,
                    maxLength: 100,
                  },
                  color: {
                    regex: /^#[0-9A-Fa-f]{6}$/,
                    errorMessage: "有効な16進数カラーコードを入力してください",
                  },
                },
              }}
              saveAction={{
                onBefore: (org) => {
                  return confirm(`"${org.display_name}" への変更を保存しますか?`);
                },
                onAfter: handleSaveSuccess,
              }}
              cancelAction={{
                onBefore: () => confirm("保存されていない変更を破棄しますか?"),
                onAfter: () => navigate("/organization"),
              }}
              backButton={{
                onClick: () => navigate("/organization"),
              }}
              customMessages={{
                header: {
                  title: "組織の設定",
                },
                notifications: {
                  save_success: "設定が正常に保存されました!",
                },
              }}
              styling={{
                variables: {
                  common: {
                    "--color-primary": "#059669",
                  },
                },
                classes: {
                  "OrganizationDetailsEdit-form": "shadow-xl rounded-lg",
                },
              }}
            />
          </div>
        );
      }

      export default function App() {
        const domain = "your-domain.auth0.com";
        const clientId = "your-client-id";

        return (
          <Auth0Provider
            domain={domain}
            clientId={clientId}
            authorizationParams={{
              redirect_uri: window.location.origin,
            }}
            interactiveErrorHandler="popup" // Universal Loginのポップアップでステップアップ認証のチャレンジを処理するために必要
          >
            <Auth0ComponentProvider domain={domain}>
              <OrganizationSettingsPage />
            </Auth0ComponentProvider>
          </Auth0Provider>
        );
      }

      ```
    </Accordion>

    ## プロップス

    ### 必須のプロップス

    必須プロップスはコンポーネントの動作に不可欠です。`OrganizationDetailsEdit` に必須プロップスはなく、現在の organization の詳細は My Organization API から自動的に読み込まれます。

    ***

    ### 表示関連のプロップス

    表示用のプロップスは、コンポーネントの動作に影響を与えることなく、その表示方法を制御します。セクションを非表示にしたり、読み取り専用モードを有効にしたりする際に使用します。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>readOnly</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            すべてのフォーム入力を無効にします。デフォルト: <code>false</code>
          </td>
        </tr>

        <tr>
          <td>
            <code>hideHeader</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            ヘッダーセクションを非表示にします。デフォルト: <code>false</code>
          </td>
        </tr>
      </tbody>
    </table>

    ***

    ### Action のプロップス

    Actionのプロップスはユーザー操作を処理し、ユーザーが変更を保存またはキャンセルしたときの動作を定義します。ライフサイクルフック (`onBefore`、`onAfter`) を使用すると、アプリケーションのルーティングや分析と連携できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>saveAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更を保存するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>cancelAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更をキャンセルまたは破棄するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>backButton</code>
          </td>

          <td>
            <code>Object</code>
          </td>

          <td>
            戻るボタンの設定。
          </td>
        </tr>
      </tbody>
    </table>

    **saveAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    ユーザーが organization の変更を送信した際の保存フローを制御します。保存の成功後に別の画面へ遷移させるには `onAfter` を使用します。

    **プロパティ:**

    * `disabled`—保存ボタンを無効にします (たとえば、別の操作の実行中) 。
    * `onBefore(data)`—保存処理の前に実行されます。保存を中止するには`false`を返します (たとえば、先に確認ダイアログを表示する場合) 。
    * `onAfter(data)`—organizationが正常に保存された後に実行されます。画面遷移やイベントの追跡に使用します。

    **例:**

    ```tsx wrap lines theme={null}
    // 保存後に前の画面へ戻る
    saveAction={{
      onAfter: () => navigate("/organization"),
    }}

    // 保存前に確認ダイアログを表示する
    saveAction={{
      onBefore: (org) => {
        return confirm(`Save changes to "${org.display_name}"?`);
      },
      onAfter: () => navigate("/organization"),
    }}

    // 保存時に分析イベントを記録する
    saveAction={{
      onAfter: (org) => {
        analytics.track("Organization Updated", {
          name: org.name,
          displayName: org.display_name,
        });
        navigate("/organization");
      },
    }}
    ```

    ***

    **cancelAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    キャンセル/破棄のフローを制御します。破棄された変更の管理には、このアクションを使用します。

    **プロパティ:**

    * `disabled`—キャンセルボタンを無効にします
    * `onBefore(data)`—キャンセル操作の前に実行されます。キャンセルを中止するには `false` を返します (例：未保存の変更を破棄する前に確認する場合) 。
    * `onAfter(data)`—キャンセルが確定した後に実行されます。Form から移動する際に使用します。

    **例：**

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      cancelAction={{
        onBefore: (org) => {
          return confirm("Discard unsaved changes?");
        },
        onAfter: () => navigate("/organization"),
      }}
    />
    ```

    ***

    **backButton**

    **型:** `{ icon?: LucideIcon; onClick: (e: MouseEvent) => void }`

    コンポーネントヘッダー内の戻るボタンを設定します。organizationの概要ページや前のページに戻る導線として使用します。

    **プロパティ:**

    * `icon`—カスタム Lucide アイコンコンポーネント (任意。デフォルトは ArrowLeft)
    * `onClick`—ナビゲーション用のクリックハンドラー

    **例:**

    ```tsx wrap lines theme={null}
    import { ChevronLeft } from "lucide-react";

    <OrganizationDetailsEdit
      backButton={{
        icon: ChevronLeft,
        onClick: () => navigate("/organization"),
      }}
    />;
    ```

    ***

    ### カスタマイズ用プロップス

    カスタマイズ用のプロップスを使えば、ソースコードを変更せずに、ブランド、ロケール、バリデーションの要件に合わせてコンポーネントを調整できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>schema</code>
          </td>

          <td>
            <code>OrganizationDetailsEditSchemas</code>
          </td>

          <td>
            フィールドのバリデーションルール。
          </td>
        </tr>

        <tr>
          <td>
            <code>customMessages</code>
          </td>

          <td>
            <code>Partial\<OrganizationDetailsEditMessages></code>
          </td>

          <td>
            i18nテキストのオーバーライド。
          </td>
        </tr>

        <tr>
          <td>
            <code>styling</code>
          </td>

          <td>
            <code>ComponentStyling\<OrganizationEditClasses></code>
          </td>

          <td>
            CSS変数とクラスのオーバーライド。
          </td>
        </tr>
      </tbody>
    </table>

    **スキーマ**

    organizationの詳細フィールドにカスタムのバリデーションルールを設定します。

    <Accordion title="利用可能なスキーマフィールド">
      すべての schema フィールドでサポート: `regex`, `errorMessage`, `minLength`, `maxLength`, `required`

      **details.name**—組織の内部名
      **details.displayName**—組織の表示名
      **details.color**—ブランドカラー (16進数形式)
      **details.logoURL**—ロゴ URL
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      schema={{
        details: {
          name: {
            minLength: 3,
            maxLength: 50,
            regex: /^[a-zA-Z0-9-_]+$/,
            errorMessage: "Name must be alphanumeric with hyphens/underscores",
          },
          displayName: {
            required: true,
            maxLength: 100,
          },
          color: {
            regex: /^#[0-9A-Fa-f]{6}$/,
            errorMessage: "Enter a valid hex color (e.g., #FF5500)",
          },
          logoURL: {
            regex: /^https:\/\/.+/,
            errorMessage: "Logo URL must use HTTPS",
          },
        },
      }}
    />
    ```

    ***

    **customMessages**

    すべてのテキストと翻訳をカスタマイズできます。すべてのフィールドは任意で、指定しない場合はデフォルト値が使用されます。

    <Accordion title="利用可能なメッセージ">
      **header**—コンポーネントヘッダー

      * `title`, `description`, `back_button_text`

      **form**—フォームのフィールド

      * `fields.name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.display_name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.color`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.logo_url`—`label`, `placeholder`, `helper_text`, `error`

      **actions**—ボタンのラベル

      * `save_button_text`, `cancel_button_text`

      **notifications**—APIレスポンス

      * `save_success`, `save_error`, `general_error`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      customMessages={{
        header: {
          title: "Edit Organization",
          description: "Update your organization's settings",
        },
        form: {
          fields: {
            name: {
              label: "Organization ID",
              helper_text: "Internal identifier (cannot be changed after creation)",
            },
            display_name: {
              label: "Organization Name",
              placeholder: "Enter display name",
            },
          },
        },
        notifications: {
          save_success: "Organization updated successfully!",
        },
      }}
    />
    ```

    ***

    **スタイリング**

    CSS変数とクラスのオーバーライドで外観をカスタマイズできます。テーマに応じたスタイリングにも対応しています。

    <Accordion title="利用可能なスタイリングオプション">
      **変数**—CSS カスタムプロパティ

      * `common`—すべてのテーマに適用
      * `light`—ライトテーマにのみ適用
      * `dark`—ダークテーマにのみ適用

      **クラス**—コンポーネントクラスのオーバーライド

      * `OrganizationDetailsEdit-header`
      * `OrganizationDetailsEdit-form`
      * `OrganizationDetailsEdit-actions`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      styling={{
        variables: {
          common: {
            "--font-size-title": "1.5rem",
          },
          light: {
            "--color-primary": "#059669",
          },
        },
        classes: {
          "OrganizationDetailsEdit-form": "shadow-lg rounded-xl p-6",
        },
      }}
    />
    ```

    ***

    ## 高度なカスタマイズ

    `OrganizationDetailsEdit` コンポーネントは、より小さなサブコンポーネントとフックで構成されています。shadcn を使用している場合は、これらを個別に import して、独自の organization 編集ワークフローを構築できます。

    ### 利用可能なサブコンポーネント

    高度なユースケースでは、個々のサブコンポーネントをインポートして、独自のorganization編集インターフェースを構築できます。

    <table class="table">
      <thead>
        <tr>
          <th>コンポーネント</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>OrganizationForm</code>
          </td>

          <td>すべてのフィールドを含むメインのフォームコンポーネント</td>
        </tr>

        <tr>
          <td>
            <code>ColorPickerField</code>
          </td>

          <td>ブランドカラーを選択するフィールド</td>
        </tr>

        <tr>
          <td>
            <code>LogoUploadField</code>
          </td>

          <td>プレビュー付きのロゴ URL 入力フィールド</td>
        </tr>
      </tbody>
    </table>

    ### 利用可能なHooks

    これらのフックは、UIを持たない基盤ロジックのみを提供します。Auth0 APIとの連携を活用しつつ、完全に独自のインターフェースを構築したい場合にご利用ください。

    <table class="table">
      <thead>
        <tr>
          <th>Hook</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>useOrganizationDetailsEdit</code>
          </td>

          <td>組織の編集ロジックと API 連携</td>
        </tr>
      </tbody>
    </table>
  </Tab>

  <Tab title="Next.js">
    ## 設定の要件

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      **Auth0 Configuration が必要です**—tenant が
      My Organization API で構成されていることを確認してください。[設定ガイドを表示
      →](/docs/ja-jp/get-started/universal-components/web/components/build-delegated-admin#configure-auth0-dashboard)
    </Callout>

    ## インストール

    <CodeGroup>
      ```bash npm (Recommended) wrap lines theme={null}
      npm install @auth0/universal-components-react
      ```

      ```bash pnpm wrap lines theme={null}
      pnpm add @auth0/universal-components-react
      ```
    </CodeGroup>

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      npm または pnpm コマンドを実行すると、共通ユーティリティと Auth0 連携用の @auth0/universal-components-core
      依存パッケージがインストールされます。
    </Callout>

    ## はじめに

    ```tsx page.tsx wrap lines theme={null}
    import { OrganizationDetailsEdit } from "@auth0/universal-components-react";
    import { useRouter } from "next/navigation";

    export function OrganizationSettingsPage() {
      const router = useRouter();

      return (
        <OrganizationDetailsEdit
          saveAction={{
            onAfter: () => router.push("/organization"),
          }}
          backButton={{
            onClick: () => router.push("/organization"),
          }}
        />
      );
    }
    ```

    <Accordion title="連携の完全な例">
      ```tsx wrap lines theme={null}
      import React from "react";
      import { OrganizationDetailsEdit } from "@auth0/universal-components-react";
      import { useRouter } from "next/navigation";
      import { analytics } from "./lib/analytics";

      function OrganizationSettingsPage() {
        const router = useRouter();

        const handleSaveSuccess = (org) => {
          analytics.track("Organization Updated", {
            name: org.name,
            displayName: org.display_name,
          });
          router.push("/organization");
        };

        return (
          <div className="max-w-2xl mx-auto p-6">
            <OrganizationDetailsEdit
              schema={{
                details: {
                  displayName: {
                    required: true,
                    maxLength: 100,
                  },
                  color: {
                    regex: /^#[0-9A-Fa-f]{6}$/,
                    errorMessage: "Enter a valid hex color",
                  },
                },
              }}
              saveAction={{
                onBefore: (org) => {
                  return confirm(`Save changes to "${org.display_name}"?`);
                },
                onAfter: handleSaveSuccess,
              }}
              cancelAction={{
                onBefore: () => confirm("Discard unsaved changes?"),
                onAfter: () => router.push("/organization"),
              }}
              backButton={{
                onClick: () => router.push("/organization"),
              }}
              customMessages={{
                header: {
                  title: "Organization Settings",
                },
                notifications: {
                  save_success: "Settings saved successfully!",
                },
              }}
              styling={{
                variables: {
                  common: {
                    "--color-primary": "#059669",
                  },
                },
                classes: {
                  "OrganizationDetailsEdit-form": "shadow-xl rounded-lg",
                },
              }}
            />
          </div>
        );
      }

      export default OrganizationSettingsPage;
      ```
    </Accordion>

    ## プロップス

    ### 主要なプロップス

    コアプロップスは、コンポーネントの動作に欠かせないものです。`OrganizationDetailsEdit` には必須のプロップスはなく、現在の organization の詳細を My Organization API から自動的に読み込みます。

    ***

    ### 表示関連のプロップス

    表示用のプロップスは、コンポーネントの動作に影響を与えずに、その表示方法を制御します。セクションを非表示にしたり、読み取り専用モードを有効にしたりする場合に使用します。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>readOnly</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            すべてのフォーム入力を無効にします。デフォルト: <code>false</code>
          </td>
        </tr>

        <tr>
          <td>
            <code>hideHeader</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            ヘッダーセクションを非表示にします。デフォルト: <code>false</code>
          </td>
        </tr>
      </tbody>
    </table>

    ***

    ### Action のプロップス

    Actionのプロップスは、ユーザー操作を処理し、ユーザーが変更を保存またはキャンセルしたときの動作を定義します。ライフサイクルフック (`onBefore`、`onAfter`) を使用すると、アプリケーションのルーティングや分析と連携できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>saveAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更を保存するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>cancelAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更をキャンセルまたは破棄するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>backButton</code>
          </td>

          <td>
            <code>Object</code>
          </td>

          <td>
            戻るボタンの設定。
          </td>
        </tr>
      </tbody>
    </table>

    **saveAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    ユーザーがorganizationの変更を送信した際の保存フローを制御します。保存が成功した後に別の画面へ遷移させるには `onAfter` を使用します。

    **プロパティ:**

    * `disabled`—保存ボタンを無効にします (たとえば、別の操作の実行中など) 。
    * `onBefore(data)`—保存操作の前に実行されます。保存を中止するには `false` を返します (たとえば、先に確認ダイアログを表示する場合) 。
    * `onAfter(data)`—organization が正常に保存された後に実行されます。画面遷移やイベントの追跡に使用します。

    **よくあるパターン:**

    ```tsx wrap lines theme={null}
    // 保存後に前の画面へ戻る
    saveAction={{
      onAfter: () => router.push("/organization"),
    }}

    // 保存前に確認ダイアログを表示する
    saveAction={{
      onBefore: (org) => {
        return confirm(`Save changes to "${org.display_name}"?`);
      },
      onAfter: () => router.push("/organization"),
    }}

    // 保存時に分析イベントを記録する
    saveAction={{
      onAfter: (org) => {
        analytics.track("Organization Updated", {
          name: org.name,
          displayName: org.display_name,
        });
        router.push("/organization");
      },
    }}
    ```

    ***

    **cancelAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    キャンセル/破棄のフローを制御します。破棄された変更を管理するには、このアクションを使用します。

    **プロパティ:**

    * `disabled`—キャンセルボタンを無効にします
    * `onBefore(data)`—キャンセル操作の前に実行されます。キャンセルを中止するには `false` を返します (例: 未保存の変更を破棄するか確認する場合) 。
    * `onAfter(data)`—キャンセルが確定した後に実行されます。Form から移動するには、これを使用します。

    **例:**

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      cancelAction={{
        onBefore: (org) => {
          return confirm("Discard unsaved changes?");
        },
        onAfter: () => router.push("/organization"),
      }}
    />
    ```

    ***

    **backButton**

    **型:** `{ icon?: LucideIcon; onClick: (e: MouseEvent) => void }`

    コンポーネントのヘッダーにある戻るボタンを設定します。organizationの概要ページや前のページに戻るために使用します。

    **プロパティ:**

    * `icon`—カスタム Lucide アイコンコンポーネント (省略可、デフォルトは ArrowLeft)
    * `onClick`—ナビゲーション用のクリックハンドラー

    **例:**

    ```tsx wrap lines theme={null}
    import { ChevronLeft } from "lucide-react";

    <OrganizationDetailsEdit
      backButton={{
        icon: ChevronLeft,
        onClick: () => router.push("/organization"),
      }}
    />;
    ```

    ***

    ### カスタマイズ用プロップス

    カスタマイズ用のプロップスを使えば、ソースコードを変更せずに、ブランド、ロケール、バリデーションの要件に合わせてコンポーネントを調整できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>schema</code>
          </td>

          <td>
            <code>OrganizationDetailsEditSchemas</code>
          </td>

          <td>
            フィールドのバリデーションルール。
          </td>
        </tr>

        <tr>
          <td>
            <code>customMessages</code>
          </td>

          <td>
            <code>Partial\<OrganizationDetailsEditMessages></code>
          </td>

          <td>
            i18n テキストの上書き。
          </td>
        </tr>

        <tr>
          <td>
            <code>styling</code>
          </td>

          <td>
            <code>ComponentStyling\<OrganizationEditClasses></code>
          </td>

          <td>
            CSS 変数とクラスの上書き。
          </td>
        </tr>
      </tbody>
    </table>

    **スキーマ**

    organizationの詳細フィールドにカスタムのバリデーションルールを設定します。

    <Accordion title="利用可能なスキーマフィールド">
      すべての schema フィールドでサポートされる項目: `regex`、`errorMessage`、`minLength`、`maxLength`、`required`

      **details.name**—組織の内部名
      **details.displayName**—組織の表示名
      **details.color**—ブランドカラー (16進数形式)
      **details.logoURL**—ロゴ URL
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      schema={{
        details: {
          name: {
            minLength: 3,
            maxLength: 50,
            regex: /^[a-zA-Z0-9-_]+$/,
            errorMessage: "Name must be alphanumeric with hyphens/underscores",
          },
          displayName: {
            required: true,
            maxLength: 100,
          },
          color: {
            regex: /^#[0-9A-Fa-f]{6}$/,
            errorMessage: "Enter a valid hex color (e.g., #FF5500)",
          },
          logoURL: {
            regex: /^https:\/\/.+/,
            errorMessage: "Logo URL must use HTTPS",
          },
        },
      }}
    />
    ```

    ***

    **customMessages**

    すべてのテキストと翻訳をカスタマイズできます。すべてのフィールドは任意で、指定しない場合はデフォルト値が使用されます。

    <Accordion title="利用可能なメッセージ">
      **header**—コンポーネントのヘッダー

      * `title`, `description`, `back_button_text`

      **form**—Formのフィールド

      * `fields.name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.display_name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.color`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.logo_url`—`label`, `placeholder`, `helper_text`, `error`

      **actions**—ボタンのラベル

      * `save_button_text`, `cancel_button_text`

      **notifications**—APIレスポンス

      * `save_success`, `save_error`, `general_error`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      customMessages={{
        header: {
          title: "Edit Organization",
          description: "Update your organization's settings",
        },
        form: {
          fields: {
            name: {
              label: "Organization ID",
              helper_text: "Internal identifier (cannot be changed after creation)",
            },
            display_name: {
              label: "Organization Name",
              placeholder: "Enter display name",
            },
          },
        },
        notifications: {
          save_success: "Organization updated successfully!",
        },
      }}
    />
    ```

    ***

    **スタイリング**

    CSS変数とクラスのオーバーライドで外観をカスタマイズできます。テーマに応じたスタイリングにも対応しています。

    <Accordion title="利用可能なスタイル設定">
      **変数**—CSS カスタムプロパティ

      * `common`—すべてのテーマに適用
      * `light`—ライトテーマのみ
      * `dark`—ダークテーマのみ

      **クラス**—コンポーネントクラスのオーバーライド

      * `OrganizationDetailsEdit-header`
      * `OrganizationDetailsEdit-form`
      * `OrganizationDetailsEdit-actions`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      styling={{
        variables: {
          common: {
            "--font-size-title": "1.5rem",
          },
          light: {
            "--color-primary": "#059669",
          },
        },
        classes: {
          "OrganizationDetailsEdit-form": "shadow-lg rounded-xl p-6",
        },
      }}
    />
    ```

    ***

    ## 高度なカスタマイズ

    `OrganizationDetailsEdit` コンポーネントは、より小さなサブコンポーネントとフックで構成されています。これらを個別にインポートすることで、独自の organization 編集ワークフローを構築できます。

    ### 利用可能なサブコンポーネント

    高度なユースケースでは、個々のサブコンポーネントをインポートして、独自の organization 編集インターフェースを構築できます。

    <table class="table">
      <thead>
        <tr>
          <th>コンポーネント</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>OrganizationForm</code>
          </td>

          <td>すべてのフィールドを含むメインのフォームコンポーネント</td>
        </tr>

        <tr>
          <td>
            <code>ColorPickerField</code>
          </td>

          <td>ブランドカラーを選択するフィールド</td>
        </tr>

        <tr>
          <td>
            <code>LogoUploadField</code>
          </td>

          <td>プレビュー付きのロゴ URL 入力欄</td>
        </tr>
      </tbody>
    </table>

    ### 利用可能なHooks

    これらのフックは、UIを持たない基盤ロジックのみを提供します。Auth0 APIとの連携を活用しつつ、完全に独自のインターフェイスを構築したい場合にご利用ください。

    <table class="table">
      <thead>
        <tr>
          <th>Hook</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>useOrganizationDetailsEdit</code>
          </td>

          <td>組織の編集ロジックとAPI連携</td>
        </tr>
      </tbody>
    </table>
  </Tab>

  <Tab title="shadcn">
    ## 設定の要件

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      **Auth0 の設定が必要です**—tenant が
      My Organization API 用に設定されていることを確認してください。[設定ガイドを表示
      →](/docs/ja-jp/get-started/universal-components/web/components/build-delegated-admin#configure-auth0-dashboard)
    </Callout>

    ## インストール

    ```bash wrap lines theme={null}
    npx shadcn@latest add https://auth0-universal-components.vercel.app/r/my-organization/organization-details-edit.json
    ```

    <Callout icon="file-lines" color="#0EA5E9" iconType="regular">
      shadcn コマンドを実行すると、共有ユーティリティと Auth0 連携に必要な @auth0/universal-components-core
      依存関係もインストールされます。
    </Callout>

    ## はじめに

    ```tsx wrap lines theme={null}
    import { OrganizationDetailsEdit } from "@/components/auth0/my-organization/organization-details-edit";

    export function OrganizationSettingsPage() {
      const navigate = useNavigate();

      return (
        <OrganizationDetailsEdit
          saveAction={{
            onAfter: () => navigate("/organization"),
          }}
          backButton={{
            onClick: () => navigate("/organization"),
          }}
        />
      );
    }
    ```

    <Accordion title="連携の完全な例">
      ```tsx wrap lines theme={null}
      import React from "react";
      import { OrganizationDetailsEdit } from "@/components/auth0/my-organization/organization-details-edit";
      import { Auth0Provider } from "@auth0/auth0-react";
      import { Auth0ComponentProvider } from "@auth0/universal-components-react/spa";
      import { useNavigate } from "react-router-dom";
      import { analytics } from "./lib/analytics";

      function OrganizationSettingsPage() {
        const navigate = useNavigate();

        const handleSaveSuccess = (org) => {
          analytics.track("Organization Updated", {
            name: org.name,
            displayName: org.display_name,
          });
          navigate("/organization");
        };

        return (
          <div className="max-w-2xl mx-auto p-6">
            <OrganizationDetailsEdit
              schema={{
                details: {
                  displayName: {
                    required: true,
                    maxLength: 100,
                  },
                  color: {
                    regex: /^#[0-9A-Fa-f]{6}$/,
                    errorMessage: "Enter a valid hex color",
                  },
                },
              }}
              saveAction={{
                onBefore: (org) => {
                  return confirm(`Save changes to "${org.display_name}"?`);
                },
                onAfter: handleSaveSuccess,
              }}
              cancelAction={{
                onBefore: () => confirm("Discard unsaved changes?"),
                onAfter: () => navigate("/organization"),
              }}
              backButton={{
                onClick: () => navigate("/organization"),
              }}
              customMessages={{
                header: {
                  title: "Organization Settings",
                },
                notifications: {
                  save_success: "Settings saved successfully!",
                },
              }}
              styling={{
                variables: {
                  common: {
                    "--color-primary": "#059669",
                  },
                },
                classes: {
                  "OrganizationDetailsEdit-form": "shadow-xl rounded-lg",
                },
              }}
            />
          </div>
        );
      }

      export default function App() {
        const domain = "your-domain.auth0.com";
        const clientId = "your-client-id";

        return (
          <Auth0Provider
            domain={domain}
            clientId={clientId}
            authorizationParams={{
              redirect_uri: window.location.origin,
            }}
            interactiveErrorHandler="popup" // Universal Login のポップアップでステップアップ認証のチャレンジを処理するために必要
          >
            <Auth0ComponentProvider domain={domain}>
              <OrganizationSettingsPage />
            </Auth0ComponentProvider>
          </Auth0Provider>
        );
      }

      ```
    </Accordion>

    ## プロップス

    ### 主要なプロップス

    コアプロップスはコンポーネントの動作に不可欠です。`OrganizationDetailsEdit` に必須のプロップスはありません。現在の organization の詳細は、My Organization API から自動的に読み込まれます。

    ***

    ### 表示関連のプロップス

    表示用プロップスは、コンポーネントの動作に影響を与えずに、レンダリングのされ方を制御します。セクションを非表示にしたり、読み取り専用モードを有効にしたりする場合に使用します。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>readOnly</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            すべてのフォーム入力を無効にします。デフォルト: <code>false</code>
          </td>
        </tr>

        <tr>
          <td>
            <code>hideHeader</code>
          </td>

          <td>
            <code>boolean</code>
          </td>

          <td>
            ヘッダーセクションを非表示にします。デフォルト: <code>false</code>
          </td>
        </tr>
      </tbody>
    </table>

    ***

    ### Action のプロップス

    Actionのプロップスは、ユーザー操作を処理し、ユーザーが変更を保存またはキャンセルしたときの動作を定義します。ライフサイクルフック (`onBefore`、`onAfter`) を使用すれば、アプリケーションのルーティングや分析と連携できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>saveAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更を保存するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>cancelAction</code>
          </td>

          <td>
            <code>ComponentAction\<OrganizationPrivate></code>
          </td>

          <td>
            変更をキャンセルまたは破棄するアクション。
          </td>
        </tr>

        <tr>
          <td>
            <code>backButton</code>
          </td>

          <td>
            <code>Object</code>
          </td>

          <td>
            戻るボタンの設定。
          </td>
        </tr>
      </tbody>
    </table>

    **saveAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    ユーザーが organization の変更を送信した際の保存フローを制御します。保存の成功後に別の画面へ遷移させるには `onAfter` を使用します。

    **プロパティ:**

    * `disabled`—保存ボタンを無効にします (たとえば、別の操作の実行中) 。
    * `onBefore(data)`—保存操作の前に実行されます。`false` を返すと保存を中止できます (たとえば、先に確認ダイアログを表示する場合) 。
    * `onAfter(data)`—organization が正常に保存された後に実行されます。画面遷移やイベントの追跡に使用します。

    **よくあるパターン:**

    ```tsx wrap lines theme={null}
    // 保存後に元の画面へ戻る
    saveAction={{
      onAfter: () => navigate("/organization"),
    }}

    // 保存前に確認ダイアログを表示する
    saveAction={{
      onBefore: (org) => {
        return confirm(`Save changes to "${org.display_name}"?`);
      },
      onAfter: () => navigate("/organization"),
    }}

    // 保存時に分析イベントを記録する
    saveAction={{
      onAfter: (org) => {
        analytics.track("Organization Updated", {
          name: org.name,
          displayName: org.display_name,
        });
        navigate("/organization");
      },
    }}
    ```

    ***

    **cancelAction**

    **型:** `ComponentAction<OrganizationPrivate>`

    キャンセル/破棄のフローを制御します。破棄された変更の管理には、このアクションを使用します。

    **プロパティ:**

    * `disabled`—キャンセルボタンを無効にします
    * `onBefore(data)`—キャンセル操作の前に実行されます。キャンセルを中止するには、`false` を返します (例：未保存の変更を破棄する前に確認する場合) 。
    * `onAfter(data)`—キャンセルが確定した後に実行されます。Formから移動する際に使用します。

    **例:**

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      cancelAction={{
        onBefore: (org) => {
          return confirm("Discard unsaved changes?");
        },
        onAfter: () => navigate("/organization"),
      }}
    />
    ```

    ***

    **backButton**

    **型:** `{ icon?: LucideIcon; onClick: (e: MouseEvent) => void }`

    コンポーネントのヘッダーにある戻るボタンを設定します。organization の概要ページや前のページに戻る導線として使用します。

    **プロパティ:**

    * `icon`—カスタム Lucide アイコンコンポーネント (省略可。デフォルトは ArrowLeft)
    * `onClick`—ナビゲーション用のクリックハンドラー

    **例:**

    ```tsx wrap lines theme={null}
    import { ChevronLeft } from "lucide-react";

    <OrganizationDetailsEdit
      backButton={{
        icon: ChevronLeft,
        onClick: () => navigate("/organization"),
      }}
    />;
    ```

    ***

    ### カスタマイズ用プロップス

    カスタマイズ用のプロップスを使えば、ソースコードを変更せずに、ブランド、ロケール、バリデーションの要件に合わせてコンポーネントを調整できます。

    <table class="table">
      <thead>
        <tr>
          <th>プロパティ</th>
          <th>型</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>schema</code>
          </td>

          <td>
            <code>OrganizationDetailsEditSchemas</code>
          </td>

          <td>
            フィールドのバリデーションルール。
          </td>
        </tr>

        <tr>
          <td>
            <code>customMessages</code>
          </td>

          <td>
            <code>Partial\<OrganizationDetailsEditMessages></code>
          </td>

          <td>
            i18n テキストの上書き。
          </td>
        </tr>

        <tr>
          <td>
            <code>styling</code>
          </td>

          <td>
            <code>ComponentStyling\<OrganizationEditClasses></code>
          </td>

          <td>
            CSS 変数およびクラスの上書き。
          </td>
        </tr>
      </tbody>
    </table>

    **スキーマ**

    organizationの詳細フィールドにカスタムのバリデーションルールを設定します。

    <Accordion title="使用可能なスキーマフィールド">
      すべてのschemaフィールドでサポートされる項目: `regex`, `errorMessage`, `minLength`, `maxLength`, `required`

      **details.name**—組織の内部名
      **details.displayName**—組織の表示名
      **details.color**—ブランドカラー (16進数形式)
      **details.logoURL**—ロゴのURL
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      schema={{
        details: {
          name: {
            minLength: 3,
            maxLength: 50,
            regex: /^[a-zA-Z0-9-_]+$/,
            errorMessage: "Name must be alphanumeric with hyphens/underscores",
          },
          displayName: {
            required: true,
            maxLength: 100,
          },
          color: {
            regex: /^#[0-9A-Fa-f]{6}$/,
            errorMessage: "Enter a valid hex color (e.g., #FF5500)",
          },
          logoURL: {
            regex: /^https:\/\/.+/,
            errorMessage: "Logo URL must use HTTPS",
          },
        },
      }}
    />
    ```

    ***

    **customMessages**

    すべてのテキストと翻訳をカスタマイズできます。すべてのフィールドは任意で、指定しない場合はデフォルト値が使用されます。

    <Accordion title="利用可能なメッセージ">
      **header**—コンポーネントヘッダー

      * `title`, `description`, `back_button_text`

      **form**—Formのフィールド

      * `fields.name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.display_name`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.color`—`label`, `placeholder`, `helper_text`, `error`
      * `fields.logo_url`—`label`, `placeholder`, `helper_text`, `error`

      **actions**—ボタンラベル

      * `save_button_text`, `cancel_button_text`

      **notifications**—APIレスポンス

      * `save_success`, `save_error`, `general_error`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      customMessages={{
        header: {
          title: "Edit Organization",
          description: "Update your organization's settings",
        },
        form: {
          fields: {
            name: {
              label: "Organization ID",
              helper_text: "Internal identifier (cannot be changed after creation)",
            },
            display_name: {
              label: "Organization Name",
              placeholder: "Enter display name",
            },
          },
        },
        notifications: {
          save_success: "Organization updated successfully!",
        },
      }}
    />
    ```

    ***

    **スタイリング**

    CSS変数とクラスのオーバーライドで外観をカスタマイズできます。テーマに応じたスタイリングにも対応しています。

    <Accordion title="利用可能なスタイル設定">
      **変数**—CSS カスタムプロパティ

      * `common`—すべてのテーマに適用
      * `light`—ライトテーマにのみ適用
      * `dark`—ダークテーマにのみ適用

      **クラス**—コンポーネントクラスのオーバーライド

      * `OrganizationDetailsEdit-header`
      * `OrganizationDetailsEdit-form`
      * `OrganizationDetailsEdit-actions`
    </Accordion>

    ```tsx wrap lines theme={null}
    <OrganizationDetailsEdit
      styling={{
        variables: {
          common: {
            "--font-size-title": "1.5rem",
          },
          light: {
            "--color-primary": "#059669",
          },
        },
        classes: {
          "OrganizationDetailsEdit-form": "shadow-lg rounded-xl p-6",
        },
      }}
    />
    ```

    ***

    ## 高度なカスタマイズ

    `OrganizationDetailsEdit` コンポーネントは、より小さなサブコンポーネントとフックで構成されています。shadcn を使用している場合は、それらを個別に import して、独自の organization 編集ワークフローを構築できます。

    ### 利用可能なサブコンポーネント

    高度なユースケースでは、個々のサブコンポーネントをインポートして、独自の organization 編集インターフェースを構築できます。

    <table class="table">
      <thead>
        <tr>
          <th>コンポーネント</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>OrganizationForm</code>
          </td>

          <td>すべてのフィールドを含むメインフォームコンポーネント</td>
        </tr>

        <tr>
          <td>
            <code>ColorPickerField</code>
          </td>

          <td>ブランドカラーを選択するためのカラーピッカー</td>
        </tr>

        <tr>
          <td>
            <code>LogoUploadField</code>
          </td>

          <td>ロゴのアップロードと管理用フィールド</td>
        </tr>
      </tbody>
    </table>

    ### 利用可能なHooks

    これらのフックは、UIを持たない基盤ロジックのみを提供します。Auth0 APIとの連携を活用しつつ、完全に独自のインターフェースを構築したい場合にご利用ください。

    <table class="table">
      <thead>
        <tr>
          <th>Hook</th>
          <th>説明</th>
        </tr>
      </thead>

      <tbody>
        <tr>
          <td>
            <code>useOrganizationDetailsEdit</code>
          </td>

          <td>Organization データの取得・編集ロジック</td>
        </tr>

        <tr>
          <td>
            <code>useOrganizationDetailsEditLogic</code>
          </td>

          <td>Form の状態とアクションハンドラー</td>
        </tr>
      </tbody>
    </table>
  </Tab>
</Tabs>
