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

組織作成ブロック

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


🚀 インストール

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

📖 使用方法

import {CreateOrganization} from '@nodeblocks/frontend-create-organization-block';
ライブエディター
function BasicCreateOrganization() {
  return (
    <CreateOrganization
      onCreateOrganization={(formData) => {
        console.log('組織が作成されました:', formData);
      }}>
      <CreateOrganization.Title>組織を作成</CreateOrganization.Title>
      <CreateOrganization.Description>
        以下のフォームにご記入いただき、貴社の組織を登録してください
      </CreateOrganization.Description>
      <CreateOrganization.Form>
        <CreateOrganization.Form.AccountHolder>
          <CreateOrganization.Form.AccountHolder.SectionTitle>
            アカウント責任者情報
          </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>
            会社情報
          </CreateOrganization.Form.CompanyInformation.SectionTitle>
          <CreateOrganization.Form.CompanyInformation.CompanyName />
          <CreateOrganization.Form.CompanyInformation.PostCode />
          <CreateOrganization.Form.CompanyInformation.Prefecture selectOptionValues={[
            {value: 'tokyo', label: '東京都'},
            {value: 'osaka', label: '大阪府'}
          ]} />
          <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: '100万円 - 1,000万円'},
            {value: '10m-100m', label: '1,000万円 - 1億円'}
          ]} />
          <CreateOrganization.Form.CompanyInformation.CompanySize selectOptionValues={[
            {value: '1-10', label: '1-10名'},
            {value: '11-50', label: '11-50名'}
          ]} />
          <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>
          組織を作成
        </CreateOrganization.Form.SubmitButton>
      </CreateOrganization.Form>
    </CreateOrganization>
  );
}
結果
Loading...

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

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

プロパティデフォルト説明
onCreateOrganization(data: T) => void必須組織データでフォームが送信されたときにトリガーされるコールバック関数
classNamestringundefinedフォームコンテナスタイリング用の追加CSSクラス名
childrenBlocksOverrideundefinedデフォルトブロックをオーバーライドまたはカスタムコンポーネントレンダリングするための関数
directionenum"column"アクションボタンのフレックス方向
alignItemsenum"stretch"コンテナ内のアイテムの整列
gapSizeenum"S"コンテナ内のアイテム間のギャップ
childrenBlocksOverrideundefinedデフォルトレンダリングをオーバーライドするカスタムブロックコンポーネント

サブコンポーネント

CreateOrganizationコンポーネントは複数のサブコンポーネントを提供します。すべてのサブコンポーネントは、メインコンポーネントのコンテキストからデフォルト値を受け取り、プロパティを通じてこれらの値をオーバーライドできます。

CreateOrganization.Title

プロパティデフォルト説明
childrenReactNode必須メインタイトルとして表示するコンテンツ
sizeenum"2XL"タイトルのタイポグラフィサイズ
typeenum"heading"タイポグラフィタイプ
colorenum"low-emphasis"タイトルのカラーテーマ
weightenum"bold"タイポグラフィの太さ
classNamestringundefinedスタイリング用の追加CSSクラス名

CreateOrganization.Description

プロパティデフォルト説明
childrenReactNode必須説明テキストとして表示するコンテンツ
classNamestringundefinedスタイリング用の追加CSSクラス名
sizeenum"L"タイトルのタイポグラフィサイズ
typeenum"heading"タイポグラフィタイプ
colorenum"low-emphasis"タイトルのカラーテーマ
weightenum"regular"タイポグラフィの太さ
classNamestringundefinedスタイリング用の追加CSSクラス名

CreateOrganization.Form

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

注意: このコンポーネントはすべてのHTML form 要素プロパティを継承します。

CreateOrganization.Form.AccountHolder

プロパティデフォルト説明
childrenBlocksOverrideundefinedデフォルトアカウント責任者フィールドをオーバーライドするカスタムコンテンツ
classNamestringundefinedスタイリング用の追加CSSクラス名
directionenum"column"アクションボタンのフレックス方向
alignItemsenum"stretch"コンテナ内のアイテムの整列
gapSizeenum"S"コンテナ内のアイテム間のギャップ

CreateOrganization.Form.AccountHolder.SectionTitle

プロパティデフォルト説明
childrenReactNode"Account Holder Contact Information"セクションタイトルテキスト
sizeenum"L"タイトルのタイポグラフィサイズ
typeenum"heading"タイポグラフィタイプ
colorenum"low-emphasis"タイトルのカラーテーマ
weightenum"bold"タイポグラフィの太さ
classNamestringundefinedスタイリング用の追加CSSクラス名

CreateOrganization.Form.AccountHolder.Name

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.AccountHolder.Email

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.AccountHolder.Contact

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation

プロパティデフォルト説明
childrenReactNodeundefinedデフォルト会社情報フィールドをオーバーライドするカスタムコンテンツ

CreateOrganization.Form.CompanyInformation.SectionTitle

プロパティデフォルト説明
childrenReactNode"Account Holder Contact Information"セクションタイトルテキスト
sizeenum"L"タイトルのタイポグラフィサイズ
typeenum"heading"タイポグラフィタイプ
colorenum"low-emphasis"タイトルのカラーテーマ
weightenum"bold"タイポグラフィの太さ
classNamestringundefinedスタイリング用の追加CSSクラス名

CreateOrganization.Form.CompanyInformation.CompanyName

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.PostCode

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.Prefecture

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

注意: このコンポーネントは追加で一般的なHTML select 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.City

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.TownAddress

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.RepresentativePersonName

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.RepresentativeContact

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.CompanyCapital

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

注意: このコンポーネントは追加で一般的なHTML select 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.CompanySize

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

注意: このコンポーネントは追加で一般的なHTML select 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.HomePageUrl

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

注意: このコンポーネントは追加で一般的なHTML input 要素プロパティを継承します。

CreateOrganization.Form.CompanyInformation.AdditionalInformation

プロパティデフォルト説明
namestring"additionalInformation"フォームデータのフィールド名
errorTextstringundefined入力のエラーテキスト
isDisabledbooleanundefined入力が無効かどうか
isRequiredbooleanundefined入力が必須かどうか
labelstring"Additional Information"入力フィールドのラベル
labelWeightenumundefinedラベルの太さ
classNamestringundefinedスタイリング用の追加CSSクラス名

注意: このコンポーネントは追加で一般的なHTML textarea 要素プロパティを継承します。

CreateOrganization.Form.Compliance

プロパティデフォルト説明
childrenReactNodeundefinedデフォルトコンプライアンスフィールドをオーバーライドするカスタムコンテンツ

注意: このコンポーネントはすべてのHTML div 要素プロパティを継承します。

CreateOrganization.Form.Compliance.CheckUserAgreement

プロパティデフォルト説明
namestring"userAgreement"フォームデータのフィールド名
labelstring"User Agreement"チェックボックスラベル
messagestring"Please check this box if you agree to the terms of service for this applications"チェックボックス説明メッセージ
showMessagebooleantrueメッセージを表示するかどうか
classNamestringundefinedスタイリング用の追加CSSクラス名

注意: このコンポーネントはすべてのHTML checkbox 要素プロパティを継承します。

CreateOrganization.Form.Compliance.CheckPrivacyAgreement

プロパティデフォルト説明
namestring"privacyPolicy"フォームデータのフィールド名
labelstring"Privacy Agreement"チェックボックスラベル
messagestring"Please check this box if you agree to and understand the terms described in the privacy policy"チェックボックス説明メッセージ
showMessagebooleantrueメッセージを表示するかどうか
classNamestringundefinedスタイリング用の追加CSSクラス名

注意: このコンポーネントはすべてのHTML checkbox 要素プロパティを継承します。

CreateOrganization.Form.SubmitButton

プロパティデフォルト説明
childrenReactNode"Submit"ボタン内に配置するテキスト
classNamestringundefinedスタイリング用の追加CSSクラス名
fillenum"fill"ボタンフィルスタイル
iconenumundefinedボタン左側のオプションアイコン
iconColorenumundefined左側アイコンの色。提供されない場合、フィルタイプのデフォルト色が使用されます。
isDisabledbooleanfalseボタンが無効で使用できないかどうか
onClickfunctionundefinedボタンクリックを処理する関数
sizeenum"M"ボタンの縦サイズ
textAlignenum"center"ボタン内でのアイコンとテキストの位置
textColorenum"default"ボタンテキストの色
textEmphasisbooleanfalseボタンテキストの太さ
textSizeenum"M"ボタンテキストのサイズ
typeenum"submit"ボタンの目的(htmlタイプに影響)

注意: このコンポーネントは追加で一般的なHTML button 要素プロパティを継承します。


🔧 TypeScript サポート

包括的な型定義による完全なTypeScriptサポート:

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

// メインコンポーネントインターフェース
interface CreateOrganizationProps extends Omit<ComponentProps<'div'>, 'children'> {
onCreateOrganization: (data: DefaultCreateOrganizationFormData) => void;
className?: string;
}

// デフォルトフォームデータインターフェース
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;
};

// 完全な型付けを使用した使用例
interface CustomOrganizationData extends DefaultCreateOrganizationFormData {
customField?: string;
}

const OrganizationRegistrationForm = () => {
const handleCreateOrganization = (formData: CustomOrganizationData) => {
console.log('組織データ:', formData);
// 型安全な組織データ処理
};

return (
<CreateOrganization onCreateOrganization={handleCreateOrganization}>
<CreateOrganization.Title>組織を登録</CreateOrganization.Title>
<CreateOrganization.Description>
以下のフォームにご記入いただき、組織プロフィールを作成してください
</CreateOrganization.Description>
<CreateOrganization.Form>
<CreateOrganization.Form.AccountHolder />
<CreateOrganization.Form.CompanyInformation />
<CreateOrganization.Form.Compliance.CheckPrivacyAgreement />
<CreateOrganization.Form.SubmitButton>組織を作成</CreateOrganization.Form.SubmitButton>
</CreateOrganization.Form>
</CreateOrganization>
);
};

React、TypeScript、モダンなウェブ標準を使用して❤️で構築されました。