メインコンテンツまでスキップ

組織作成ブロック

CreateOrganization コンポーネント は、React と TypeScript で構築された、完全にカスタマイズ可能でアクセシブルな組織登録フォームです。フォーム検証、複数セクションの組織情報入力、柔軟なカスタマイズオプションを備えた、完全なビジネス登録インターフェースを提供します。


🚀 インストール

npm install @nodeblocks/frontend-create-organization-block@0.1.6

📖 使用方法

import {CreateOrganization} from '@nodeblocks/frontend-create-organization-block';
function BasicCreateOrganization() {
return (
<CreateOrganization
onCreateOrganization={(formData) => {
console.log('Organization created:', formData);
}}>
<CreateOrganization.Title>Create Your Organization</CreateOrganization.Title>
<CreateOrganization.Description>
Please fill out the form below to register your organization
</CreateOrganization.Description>
<CreateOrganization.Form>
<CreateOrganization.Form.AccountHolder>
<CreateOrganization.Form.AccountHolder.SectionTitle>
Account Holder Information
</CreateOrganization.Form.AccountHolder.SectionTitle>
<CreateOrganization.Form.AccountHolder.Name />
<CreateOrganization.Form.AccountHolder.Email />
<CreateOrganization.Form.AccountHolder.Contact />
</CreateOrganization.Form.AccountHolder>
<CreateOrganization.Form.CompanyInformation>
<CreateOrganization.Form.CompanyInformation.SectionTitle>
Company Information
</CreateOrganization.Form.CompanyInformation.SectionTitle>
<CreateOrganization.Form.CompanyInformation.CompanyName />
<CreateOrganization.Form.CompanyInformation.PostCode />
<CreateOrganization.Form.CompanyInformation.Prefecture selectOptionValues={[
{value: 'tokyo', label: 'Tokyo'},
{value: 'osaka', label: 'Osaka'}
]} />
<CreateOrganization.Form.CompanyInformation.City />
<CreateOrganization.Form.CompanyInformation.TownAddress />
<CreateOrganization.Form.CompanyInformation.RepresentativePersonName />
<CreateOrganization.Form.CompanyInformation.RepresentativeContact />
<CreateOrganization.Form.CompanyInformation.CompanyCapital selectOptionValues={[
{value: '1m-10m', label: '1M - 10M JPY'},
{value: '10m-100m', label: '10M - 100M JPY'}
]} />
<CreateOrganization.Form.CompanyInformation.CompanySize selectOptionValues={[
{value: '1-10', label: '1-10 employees'},
{value: '11-50', label: '11-50 employees'}
]} />
<CreateOrganization.Form.CompanyInformation.HomePageUrl />
<CreateOrganization.Form.CompanyInformation.AdditionalInformation />
</CreateOrganization.Form.CompanyInformation>

<CreateOrganization.Form.Compliance>
<CreateOrganization.Form.Compliance.CheckUserAgreement />
<CreateOrganization.Form.Compliance.CheckPrivacyAgreement />
</CreateOrganization.Form.Compliance>

<CreateOrganization.Form.SubmitButton>
Create Organization
</CreateOrganization.Form.SubmitButton>
</CreateOrganization.Form>
</CreateOrganization>
);
}

🔧 プロパティリファレンス

メインコンポーネントのプロパティ

プロパティデフォルト説明
onCreateOrganization(data: T) => void必須組織データでフォームが送信されたときに呼び出されるコールバック関数
classNamestringundefinedフォームコンテナのスタイル用の追加 CSS クラス名
childrenBlocksOverrideundefinedデフォルトブロックやカスタムコンポーネント描画を上書きする関数
directionenum"column"アクションボタンの flex 方向
alignItemsenum"stretch"コンテナ内アイテムの配置
gapSizeenum"S"コンテナ内アイテム間の間隔
childrenBlocksOverrideundefinedデフォルト描画を上書きするカスタムブロックコンポーネント

サブコンポーネント

CreateOrganization コンポーネントは複数のサブコンポーネントを提供します。すべてのサブコンポーネントはメインコンポーネントのコンテキストからデフォルト値を受け取り、props でそれらを上書きできます。

CreateOrganization.Title

プロパティデフォルト説明
childrenReactNode必須メインタイトルとして表示する内容
sizeenum"2XL"タイトルの Typography サイズ
typeenum"heading"Typography の種類
colorenum"low-emphasis"タイトルの配色テーマ
weightenum"bold"Typography のウェイト
classNamestringundefinedスタイル用の追加 CSS クラス名

CreateOrganization.Description

プロパティデフォルト説明
childrenReactNode必須説明文として表示する内容
classNamestringundefinedスタイル用の追加 CSS クラス名
sizeenum"L"タイトルの Typography サイズ
typeenum"heading"Typography の種類
colorenum"low-emphasis"タイトルの配色テーマ
weightenum"regular"Typography のウェイト
classNamestringundefinedスタイル用の追加 CSS クラス名

CreateOrganization.Form

プロパティデフォルト説明
childrenBlocksOverrideundefinedアカウント保持者、会社情報、コンプライアンス各セクションを含むフォーム内容
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは HTML form 要素のすべての props を継承します。

CreateOrganization.Form.AccountHolder

プロパティデフォルト説明
childrenBlocksOverrideundefinedデフォルトのアカウント保持者フィールドを上書きするカスタム内容
classNamestringundefinedスタイル用の追加 CSS クラス名
directionenum"column"アクションボタンの flex 方向
alignItemsenum"stretch"コンテナ内アイテムの配置
gapSizeenum"S"コンテナ内アイテム間の間隔

CreateOrganization.Form.AccountHolder.SectionTitle

プロパティデフォルト説明
childrenReactNode"アカウント保持者連絡先情報"セクションタイトルのテキスト
sizeenum"L"タイトルの Typography サイズ
typeenum"heading"Typography の種類
colorenum"low-emphasis"タイトルの配色テーマ
weightenum"bold"Typography のウェイト
classNamestringundefinedスタイル用の追加 CSS クラス名

CreateOrganization.Form.AccountHolder.Name

プロパティデフォルト説明
namestring"applicationUserEmail"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"契約者名"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.AccountHolder.Email

プロパティデフォルト説明
namestring"applicationUserEmail"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"契約者メールアドレス"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.AccountHolder.Contact

プロパティデフォルト説明
namestring"applicationUserPhoneNumber"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"契約者電話番号"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation

プロパティデフォルト説明
childrenReactNodeundefinedデフォルトの会社情報フィールドを上書きするカスタム内容

CreateOrganization.Form.CompanyInformation.SectionTitle

プロパティデフォルト説明
childrenReactNode"会社情報"セクションタイトルのテキスト
sizeenum"L"タイトルの Typography サイズ
typeenum"heading"Typography の種類
colorenum"low-emphasis"タイトルの配色テーマ
weightenum"bold"Typography のウェイト
classNamestringundefinedスタイル用の追加 CSS クラス名

CreateOrganization.Form.CompanyInformation.CompanyName

プロパティデフォルト説明
namestring"companyName"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"会社名"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.PostCode

プロパティデフォルト説明
namestring"postcode"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"郵便番号"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.Prefecture

プロパティデフォルト説明
namestring"prefecture"フォームデータのフィールド名
labelstring"都道府県"フィールドラベル
labelWeightenum"bold"ラベルの太さ
selectOptionValuesArray<{value: string, label: string}>[]都道府県オプションの配列
isRequiredbooleanundefinedフィールドが必須かどうか
isDisabledbooleanundefined入力が無効かどうか
errorTextstringundefined入力のエラーテキスト
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは、共通の HTML select 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.City

プロパティデフォルト説明
namestring"cityTownVillage"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"市区町村"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.TownAddress

プロパティデフォルト説明
namestring"townStreetBuilding"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"町名・番地・建物"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.RepresentativePersonName

プロパティデフォルト説明
namestring"representivePersonName"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"代表者名"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.RepresentativeContact

プロパティデフォルト説明
namestring"representativePhoneNumber"フォームデータのフィールド名
classNamestringundefinedスタイル用の追加 CSS クラス名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"代表者電話番号"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.CompanyCapital

プロパティデフォルト説明
namestring"capitalRange"フォームデータのフィールド名
labelstring"資本金額"フィールドラベル
labelWeightenum"bold"ラベルの太さ
selectOptionValuesArray<{value: string, label: string}>[]資本金額の選択肢配列
isRequiredbooleantrueフィールドが必須かどうか
isDisabledbooleanundefined入力が無効かどうか
errorTextstringundefined入力のエラーテキスト
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは、共通の HTML select 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.CompanySize

プロパティデフォルト説明
namestring"numberOfEmployees"フォームデータのフィールド名
labelstring"企業規模"フィールドラベル
labelWeightenum"bold"ラベルの太さ
selectOptionValuesArray<{value: string, label: string}>[]資本金額の選択肢配列
isRequiredbooleantrueフィールドが必須かどうか
isDisabledbooleanundefined入力が無効かどうか
errorTextstringundefined入力のエラーテキスト
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは、共通の HTML select 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.HomePageUrl

プロパティデフォルト説明
namestring"companyUrl"フォームデータのフィールド名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"ホームページ URL"入力フィールドのラベル
labelWeightenum"bold"ラベルの太さ
onOperationClick() => voidundefined操作用 onClick コールバック
postfixTextstringundefinedコンポーネントの後ろに配置するテキスト
showPasswordbooleanundefinedパスワードを表示するかどうか

注: このコンポーネントは、共通の HTML input 要素 props も追加で継承します。

CreateOrganization.Form.CompanyInformation.AdditionalInformation

プロパティデフォルト説明
namestring"additionalInformation"フォームデータのフィールド名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"追加情報"入力フィールドのラベル
labelWeight`enum
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは、共通の HTML textarea 要素 props も追加で継承します。

CreateOrganization.Form.Compliance

プロパティデフォルト説明
childrenReactNodeundefinedデフォルトのコンプライアンス項目を上書きするカスタム内容

注: このコンポーネントは HTML div 要素のすべての props を継承します。

CreateOrganization.Form.Compliance.CheckUserAgreement

プロパティデフォルト説明
namestring"userAgreement"フォームデータのフィールド名
labelstring"利用規約への同意"チェックボックスのラベル
messagestring"このアプリケーションの利用規約に同意する場合は、このボックスにチェックしてください"チェックボックスの説明メッセージ
showMessagebooleantrueメッセージを表示するかどうか
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは HTML checkbox 要素のすべての props を継承します。

CreateOrganization.Form.Compliance.CheckPrivacyAgreement

プロパティデフォルト説明
namestring"privacyPolicy"フォームデータのフィールド名
labelstring"プライバシーポリシーへの同意"チェックボックスのラベル
messagestring"プライバシーポリシーに記載された条件に同意し、理解する場合はこのボックスにチェックしてください"チェックボックスの説明メッセージ
showMessagebooleantrueメッセージを表示するかどうか
classNamestringundefinedスタイル用の追加 CSS クラス名

注: このコンポーネントは HTML checkbox 要素のすべての props を継承します。

CreateOrganization.Form.SubmitButton

プロパティデフォルト説明
childrenReactNode"送信"ボタン内に配置するテキスト
classNamestringundefinedスタイル用の追加 CSS クラス名
fillenum"fill"ボタンの塗りつぶしスタイル
iconenumundefinedボタン左側に表示する任意のアイコン
iconColorenumundefined左側アイコンの色。指定されない場合は、fill タイプのデフォルト色が使用されます。
isDisabledbooleanfalseボタンが無効で使用できないかどうか
onClickfunctionundefinedボタンクリックを処理する関数
sizeenum"M"ボタンの縦サイズ
textAlignenum"center"ボタン内のアイコンとテキストの配置
textColorenum"default"ボタンのテキスト色
textEmphasisbooleanfalseボタンのテキストの太さ
textSizeenum"M"ボタンのテキストサイズ
typeenum"submit"ボタンの用途(HTML の type に影響します)

注: このコンポーネントは、共通の HTML button 要素 props も追加で継承します。


🔧 TypeScript サポート

包括的な型定義を備えた完全な TypeScript サポート:

import {CreateOrganization} from '@nodeblocks/frontend-create-organization-block';
import {ComponentProps} from 'react';

// Main component interface
interface CreateOrganizationProps extends Omit<ComponentProps<'div'>, 'children'> {
onCreateOrganization: (data: DefaultCreateOrganizationFormData) => void;
className?: string;
}

// Default form data interface
export type DefaultCreateOrganizationFormData = {
applicationUserName?: string;
applicationUserEmail?: string;
applicationUserPhoneNumber?: string;
companyName?: string;
postcode?: string;
cityTownVillage?: string;
townStreetBuilding?: string;
representivePersonName?: string;
representativePhoneNumber?: string;
companyUrl?: string;
additionalInformation?: string;
prefecture?: string;
capitalRange?: string;
numberOfEmployees?: string;
userAgreement?: string;
privacyPolicy?: string;
};

// Usage example with full typing
interface CustomOrganizationData extends DefaultCreateOrganizationFormData {
customField?: string;
}

const OrganizationRegistrationForm = () => {
const handleCreateOrganization = (formData: CustomOrganizationData) => {
console.log('Organization data:', formData);
// Type-safe organization data handling
};

return (
<CreateOrganization onCreateOrganization={handleCreateOrganization}>
<CreateOrganization.Title>Register Your Organization</CreateOrganization.Title>
<CreateOrganization.Description>
Complete the form below to create your organization profile
</CreateOrganization.Description>
<CreateOrganization.Form>
<CreateOrganization.Form.AccountHolder />
<CreateOrganization.Form.CompanyInformation />
<CreateOrganization.Form.Compliance.CheckPrivacyAgreement />
<CreateOrganization.Form.SubmitButton>Create Organization</CreateOrganization.Form.SubmitButton>
</CreateOrganization.Form>
</CreateOrganization>
);
};

React、TypeScript、そして最新の Web 標準で構築されています。