@noemaru1011/ui 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +256 -2
  2. package/dist/components/elements/Accordion/Accordion.d.ts +21 -0
  3. package/dist/components/elements/Blockquote/Blockquote.d.ts +6 -0
  4. package/dist/components/elements/Checkbox/Checkbox.d.ts +18 -0
  5. package/dist/components/elements/Combobox/Combobox.d.ts +20 -0
  6. package/dist/components/elements/ComboboxMultiple/ComboboxMultiple.d.ts +20 -0
  7. package/dist/components/elements/DatePicker/DatePicker.d.ts +16 -0
  8. package/dist/components/elements/DateRange/DateRange.d.ts +18 -0
  9. package/dist/components/elements/DescriptionList/DescriptionList.d.ts +13 -0
  10. package/dist/components/elements/Disclosure/Disclosure.d.ts +10 -0
  11. package/dist/components/elements/FileUpload/FileUpload.d.ts +24 -0
  12. package/dist/components/elements/FileUploadButton/FileUploadButton.d.ts +33 -0
  13. package/dist/components/elements/HamburgerMenu/HamburgerMenu.d.ts +7 -0
  14. package/dist/components/elements/Heading/Heading.d.ts +8 -0
  15. package/dist/components/elements/Image/Image.d.ts +10 -0
  16. package/dist/components/elements/Input/Input.d.ts +18 -0
  17. package/dist/components/elements/Input/PasswordInput.d.ts +18 -0
  18. package/dist/components/elements/Link/Link.d.ts +10 -0
  19. package/dist/components/elements/List/List.d.ts +15 -0
  20. package/dist/components/elements/Loading/Loading.d.ts +6 -0
  21. package/dist/components/elements/Radio/Radio.d.ts +18 -0
  22. package/dist/components/elements/Select/LanguageSelect.d.ts +9 -0
  23. package/dist/components/elements/Select/Select.d.ts +21 -0
  24. package/dist/components/elements/Switch/Switch.d.ts +15 -0
  25. package/dist/components/elements/Switch/ThemeSwitch.d.ts +1 -0
  26. package/dist/components/elements/Text/Text.d.ts +14 -0
  27. package/dist/components/elements/Textarea/Textarea.d.ts +16 -0
  28. package/dist/components/elements/index.d.ts +26 -0
  29. package/dist/components/layouts/AppLayout/AppLayout.d.ts +9 -0
  30. package/dist/components/layouts/Center/Center.d.ts +8 -0
  31. package/dist/components/layouts/Cluster/Cluster.d.ts +21 -0
  32. package/dist/components/layouts/Container/Container.d.ts +8 -0
  33. package/dist/components/layouts/Error/Forbidden.d.ts +5 -0
  34. package/dist/components/layouts/Error/InternalServerError.d.ts +5 -0
  35. package/dist/components/layouts/Error/NotFound.d.ts +5 -0
  36. package/dist/components/layouts/Stack/Stack.d.ts +8 -0
  37. package/dist/components/layouts/index.d.ts +8 -0
  38. package/dist/components/providers/theme-provider.d.ts +15 -0
  39. package/dist/components/types/Option.d.ts +5 -0
  40. package/dist/components/types/WithoutExternalStyle.d.ts +8 -0
  41. package/dist/components/ui/accordion.d.ts +6 -0
  42. package/dist/components/ui/alert-dialog.d.ts +18 -0
  43. package/dist/components/ui/alert.d.ts +10 -0
  44. package/dist/components/ui/badge.d.ts +7 -0
  45. package/dist/components/ui/breadcrumb.d.ts +10 -0
  46. package/dist/components/ui/button.d.ts +10 -0
  47. package/dist/components/ui/calendar.d.ts +10 -0
  48. package/dist/components/ui/card.d.ts +11 -0
  49. package/dist/components/ui/carousel.d.ts +28 -0
  50. package/dist/components/ui/checkbox.d.ts +3 -0
  51. package/dist/components/ui/combobox.d.ts +24 -0
  52. package/dist/components/ui/dialog.d.ts +17 -0
  53. package/dist/components/ui/drawer.d.ts +16 -0
  54. package/dist/components/ui/field.d.ts +24 -0
  55. package/dist/components/ui/index.d.ts +29 -0
  56. package/dist/components/ui/input-group.d.ts +18 -0
  57. package/dist/components/ui/input.d.ts +3 -0
  58. package/dist/components/ui/label.d.ts +3 -0
  59. package/dist/components/ui/pagination.d.ts +17 -0
  60. package/dist/components/ui/popover.d.ts +9 -0
  61. package/dist/components/ui/radio-group.d.ts +5 -0
  62. package/dist/components/ui/select.d.ts +15 -0
  63. package/dist/components/ui/separator.d.ts +3 -0
  64. package/dist/components/ui/spinner.d.ts +2 -0
  65. package/dist/components/ui/switch.d.ts +5 -0
  66. package/dist/components/ui/table.d.ts +10 -0
  67. package/dist/components/ui/tabs.d.ts +10 -0
  68. package/dist/components/ui/textarea.d.ts +3 -0
  69. package/dist/components/ui/toast.d.ts +16 -0
  70. package/dist/components/ui/tooltip.d.ts +6 -0
  71. package/dist/i18n/index.d.ts +2 -0
  72. package/dist/index.d.ts +7 -0
  73. package/dist/index.js +25451 -0
  74. package/dist/lib/data-table-features.d.ts +16 -0
  75. package/dist/lib/utils.d.ts +1 -0
  76. package/dist/style.css +3 -0
  77. package/package.json +117 -5
package/README.md CHANGED
@@ -1,3 +1,257 @@
1
- # Temporary Holding Version
1
+ <div align="center">
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <img src="my-icon.jpg" alt="UI Catalog" width="180" />
4
+
5
+ # UI Catalog
6
+
7
+ ## 概要
8
+
9
+ このプロジェクトは、React と TypeScript で構築した、個人開発の UI コンポーネントカタログです。
10
+ Storybook を活用し、コンポーネントの表示・動作・バリエーションを一元管理します。
11
+
12
+ [**カタログを確認する**](https://noemaru1011.github.io/my-ui-catalog/)
13
+ <!-- Tech Stack -->
14
+ <p align="center">
15
+ <img src="https://img.shields.io/badge/React-61DAFB?style=for-the-badge&logo=react&logoColor=black" />
16
+ <img src="https://img.shields.io/badge/TypeScript-3178C6?style=for-the-badge&logo=typescript&logoColor=white" />
17
+ <img src="https://img.shields.io/badge/Storybook-FF4785?style=for-the-badge&logo=storybook&logoColor=white" />
18
+ <img src="https://img.shields.io/badge/Vite-646CFF?style=for-the-badge&logo=vite&logoColor=white" />
19
+ <img src="https://img.shields.io/badge/Tailwind_CSS-06B6D4?style=for-the-badge&logo=tailwindcss&logoColor=white" />
20
+ <img src="https://img.shields.io/badge/shadcn%2Fui-000000?style=for-the-badge&logo=shadcnui&logoColor=white" />
21
+ <img src="https://img.shields.io/badge/i18next-26A69A?style=for-the-badge&logo=i18next&logoColor=white" />
22
+ <img src="https://img.shields.io/badge/react--i18next-26A69A?style=for-the-badge&logo=react&logoColor=white" />
23
+ <img src="https://img.shields.io/badge/i18next--cli-26A69A?style=for-the-badge&logo=i18next&logoColor=white" />
24
+ </p>
25
+ <p align="center">
26
+ <img src="https://img.shields.io/badge/React_Hook_Form-EC5990?style=for-the-badge&logo=reacthookform&logoColor=white" />
27
+ <img src="https://img.shields.io/badge/Zod-3E67B1?style=for-the-badge&logo=zod&logoColor=white" />
28
+ <img src="https://img.shields.io/badge/Biome-60A5FA?style=for-the-badge&logo=biome&logoColor=white" />
29
+ <img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" />
30
+ <img src="https://img.shields.io/badge/Vitest-6E9F18?style=for-the-badge&logo=vitest&logoColor=white" />
31
+ <img src="https://img.shields.io/badge/Testing_Library-E33332?style=for-the-badge&logo=testinglibrary&logoColor=white" />
32
+ <img src="https://img.shields.io/badge/Playwright-2EAD33?style=for-the-badge&logo=playwright&logoColor=white" />
33
+ <img src="https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=githubactions&logoColor=white" />
34
+ <img src="https://img.shields.io/badge/GitHub_Pages-222222?style=for-the-badge&logo=githubpages&logoColor=white" />
35
+ </p>
36
+
37
+ </div>
38
+
39
+ ### 技術スタック
40
+
41
+ | カテゴリー | 技術名 |
42
+ | -------------------- | ----------------------------------- |
43
+ | Framework | React |
44
+ | Language | TypeScript |
45
+ | UI Catalog | Storybook |
46
+ | Build Tool | Vite |
47
+ | Styling | Tailwind CSS |
48
+ | UI Primitives | shadcn/ui |
49
+ | Internationalization | i18next, react-i18next, i18next-cli |
50
+ | Form (Sample) | React Hook Form, Zod |
51
+ | Linter / Formatter | Biome |
52
+ | Package Manager | npm |
53
+ | Test | Vitest, Testing Library, Playwright |
54
+ | CI/CD | GitHub Actions |
55
+ | Deployment | GitHub Pages |
56
+
57
+ ## インストール及びスタート方法
58
+
59
+ ### 1. 環境準備
60
+
61
+ | Tool | Version |
62
+ | ---------- | ----------- |
63
+ | Node.js | `>=24.22.2` |
64
+ | npm | Required |
65
+ | Git | Required |
66
+ | GitHub CLI | Required |
67
+
68
+ Node.js のバージョンは `.nvmrc` と `package.json` の `engines` で管理しています。
69
+
70
+ ### 2. Repositoryをクローン
71
+
72
+ ```bash
73
+ git clone https://github.com/noemaru1011/my-ui-catalog.git
74
+
75
+ cd my-ui-catalog
76
+ ```
77
+
78
+ ### 3. Node.jsの環境構築
79
+
80
+ nvm を使用している場合、プロジェクトで指定された Node.js のバージョンを適用します。
81
+
82
+ ```bash
83
+ nvm use
84
+ ```
85
+
86
+ ### 4. 依存関係のインストール
87
+
88
+ ```bash
89
+ npm ci
90
+ ```
91
+
92
+ インストール時には `prepare` スクリプトによって、Git フックの参照先が `.github/hooks` に設定されます。
93
+
94
+ ### 5. Storybookの起動
95
+
96
+ ```bash
97
+ npm run storybook
98
+ ```
99
+
100
+ ブラウザで以下にアクセスします。
101
+
102
+ <http://localhost:6006>
103
+
104
+ ### 6. Storybookのビルド
105
+
106
+ ```bash
107
+ npm run build-storybook
108
+ ```
109
+
110
+ ビルド成果物は `storybook-static/` に出力されます。
111
+
112
+ ## 使い方
113
+
114
+ ### 1. プロジェクトを実行するコマンド
115
+
116
+ ```bash
117
+ # Biome による Lint
118
+ npm run lint
119
+
120
+ # Biome によるフォーマット
121
+ npm run format
122
+
123
+ # Biome によるチェック
124
+ npm run check
125
+
126
+ # Biome によるチェックと自動修正
127
+ npm run check:fix
128
+
129
+ # Vitest の Watch モードでテストを実行
130
+ npm run test
131
+
132
+ # 全 Vitest プロジェクトのテストを一括実行
133
+ npm run test:run
134
+
135
+ # コンポーネントテストを実行
136
+ npm run test:components
137
+
138
+ # Storybook の Story テストを実行
139
+ npm run test:storybook
140
+
141
+ # カバレッジ付きでテストを実行
142
+ npm run test:coverage
143
+
144
+ # Playwright E2E テストを実行
145
+ npm run test:e2e
146
+
147
+ # 日本語・英語の翻訳キーが揃っているか確認
148
+ npm run i18n:check
149
+
150
+ # 使用されていない翻訳キーがないか確認
151
+ npm run i18n:check:unused
152
+ ```
153
+
154
+ ### 2. プロジェクトの主な機能の使い方を説明
155
+
156
+ #### Elements
157
+
158
+ 自作したアプリケーションの UI を構成する、再利用可能なコンポーネントを管理します。
159
+
160
+ #### Layouts
161
+
162
+ コンポーネントの配置やレイアウトを制御するためのコンポーネントを管理します。
163
+
164
+ #### UI Primitives
165
+
166
+ `src/components/ui/` では、shadcn/ui をベースとした UI プリミティブを管理します。
167
+
168
+ ボタン、入力欄、ラベル、ポップオーバーなど、上位のコンポーネントを構成する基本的な UI 要素を配置します。
169
+
170
+ #### Examples
171
+
172
+ 複数のコンポーネントを組み合わせた使用例を管理します。
173
+
174
+ - `src/components/example/form/`:フォームの実装例
175
+ - `src/components/example/table/`:テーブルの実装例
176
+
177
+ ### 3. コード例
178
+
179
+ #### Layouts
180
+
181
+ - **Center**:子要素を中央に配置する
182
+ - **Cluster**:子要素を横方向にまとめて配置する
183
+ - **Container**:コンテンツの最大幅などを制御する
184
+ - **Stack**:子要素を縦方向に積み重ねて配置する
185
+
186
+ #### Form
187
+
188
+ `src/components/example/form/`
189
+
190
+ 以下の技術を組み合わせたフォームの実装例です。
191
+
192
+ - Zod:入力値のバリデーション
193
+ - React Hook Form:フォーム状態の管理
194
+ - カスタムフック:フォーム処理の共通化
195
+ - フォーム UI:入力画面の構築
196
+ - ページ:フォームの利用例
197
+
198
+ #### Table
199
+
200
+ `src/components/example/table/`
201
+
202
+ TanStack Table v9 を使用したテーブルの実装例です。
203
+
204
+ - ソート
205
+ - 絞り込み
206
+ - ページネーション
207
+ - 行編集
208
+
209
+ ## 運用
210
+
211
+ 本リポジトリでは、品質の担保と開発効率の向上を目的に、以下のルールと自動化ツールを導入しています。
212
+
213
+ ### 1. 開発フローと GitHub Projects 連携
214
+
215
+ すべての作業は **Issue** を起点とし、GitHub Projects 上でステータスを管理します。
216
+
217
+ 1. **Issue の作成**
218
+ - `.github/ISSUE_TEMPLATE/issue.md` のテンプレートに従ってタスクを起票します。
219
+ - 起票された Issue はプロジェクトボードの `Todo` に追加されます。
220
+ 2. **ブランチ作成・実装**
221
+ - Issue 画面の「Create a branch」から作業用ブランチを作成し、ステータスを `In Progress` に変更します。
222
+ - コミット時には Git Hooks(`pre-commit` / `commit-msg`)が自動実行され、コードフォーマットやコミットメッセージの規約チェックが行われます。
223
+ 3. **Pull Request(PR)の作成**
224
+ - 実装完了後、`.github/PULL_REQUEST_TEMPLATE.md` に従って PR を作成し、ステータスを `In Review` に変更します。
225
+ - PR の説明欄に `Closes #<Issue番号>` を記載し、Issue と紐付けます。
226
+ 4. **レビュー・マージ**
227
+ - CI の通過およびレビュアーの承認後、マージを行います。
228
+ - マージされると紐づいた Issue が自動的にクローズされ、プロジェクトボードのステータスも `Done` へ移行します。
229
+
230
+ ### 2. ローカル開発環境(Git Hooks)
231
+
232
+ - **`pre-commit`**: コミット前に Lint やフォーマットチェック等を実行します。
233
+ - **`commit-msg`**: コミットメッセージが規約(Conventional Commits 等)に沿っているか検証します。
234
+
235
+ ### 3. CI / CD(GitHub Actions)
236
+
237
+ `.github/workflows` に定義された以下のワークフローが自動実行されます。
238
+
239
+ - **`ci.yml`**: 自動テスト、ビルド、静的解析を実行します。**CI がすべてパスすることがマージの必須条件です。**
240
+ - **`check-node-version.yml`**: .nvmrcを変更した際に、package.jsonのバージョンに差異がないか検証します。
241
+ - **`cd.yml`**: `master` ブランチへのマージをトリガーに、本番環境への自動デプロイを実行します。
242
+
243
+ ### 4. 依存パッケージの自動更新(Dependabot)
244
+
245
+ - `.github/dependabot.yml` の設定に基づき、依存ライブラリのアップデートやセキュリティパッチの PR が定期的に自動作成されます。
246
+ - Dependabot による PR も通常の PR と同様に CI の通過を確認したうえでマージします。
247
+
248
+ ### 5. コードオーナーとブランチ保護(CODEOWNERS)
249
+
250
+ 品質担保および開発ルール維持のため、`.github/CODEOWNERS` とブランチ保護ルール(Rulesets)により、重要ファイルの変更にはコードオーナーの承認を必須としています。
251
+
252
+ - **保護対象ファイル・ディレクトリ**
253
+ - **`.github/`・`.agents/`**: CI/CD ワークフロー、Git Hooks、AI 向け指示書などの開発ルール・自動化基盤
254
+ - **`*.test.ts(x)`・`*.spec.ts(x)`・`/e2e/`**: 単体テストおよび E2E テストコード(テスト削除・改ざんによる CI 突破の防止)
255
+ - **変更・削除時の運用ルール**
256
+ - 上記ファイルを含む PR を作成すると、自動的にコードオーナー(`@noemaru1011`)がレビュアーに割り当てられます。
257
+ - テストの削除やルールの変更が正当な理由に基づく場合は、PR 上で理由を明記し、コードオーナーの承認(Approve)を得た
@@ -0,0 +1,21 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ type AccordionItemProps = {
3
+ value: string;
4
+ trigger: string;
5
+ children: ReactNode;
6
+ disabled?: boolean;
7
+ };
8
+ type AccordionProps = {
9
+ /** AccordionItemPropsのみ有効です。 */
10
+ children: ReactElement<AccordionItemProps, typeof AccordionItem> | ReactElement<AccordionItemProps, typeof AccordionItem>[];
11
+ defaultValue?: string[];
12
+ multiple?: boolean;
13
+ };
14
+ /** アコーディオンは、単に表示領域をコンパクトにすることだけを目的として使用しない。
15
+ * ユーザーが必要に応じて詳細情報を展開できるような用途で使用。 */
16
+ declare function AccordionItem({ value, trigger, children, disabled }: AccordionItemProps): import('react').JSX.Element;
17
+ export declare function Accordion({ children, defaultValue, multiple }: AccordionProps): import('react').JSX.Element;
18
+ export declare namespace Accordion {
19
+ var Item: typeof AccordionItem;
20
+ }
21
+ export {};
@@ -0,0 +1,6 @@
1
+ type BlockquoteProps = {
2
+ children: React.ReactNode;
3
+ };
4
+ /** 引用する際に用いる。見た目の為には用いない。 */
5
+ export declare function Blockquote({ children }: BlockquoteProps): import('react').JSX.Element;
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Option } from '../../types/Option';
3
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
4
+ import { Checkbox as BaseCheckbox } from '../../ui/checkbox';
5
+ type CheckboxProps = WithoutExternalStyle<ComponentProps<typeof BaseCheckbox>, 'value' | 'checked' | 'onCheckedChange' | 'disabled'> & {
6
+ label: string;
7
+ options: Option[];
8
+ value: string[];
9
+ onChange: (value: string[]) => void;
10
+ /** 編集不可の理由などを記載。 */
11
+ description?: string;
12
+ error?: string;
13
+ required?: boolean;
14
+ /** 極力使用せず、表示できるか検討する。 */
15
+ disabled?: boolean;
16
+ };
17
+ export declare function Checkbox({ label, options, value, onChange, description, error, required, disabled, ...rawProps }: CheckboxProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
2
+ import { Option } from '../../types/Option';
3
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
4
+ type ComboboxProps = WithoutExternalStyle<ComboboxPrimitive.Root.Props<Option>, 'items' | 'disabled' | 'value' | 'onValueChange' | 'onChange'> & {
5
+ /** idは指定しなかったら場合、自動採番。 */
6
+ id?: string;
7
+ label: string;
8
+ options: Option[];
9
+ value?: string;
10
+ onChange?: (value: string) => void;
11
+ /** 編集不可の理由などを記載。 */
12
+ description?: string;
13
+ error?: string;
14
+ required?: boolean;
15
+ /** 極力使用せず、表示できるか検討する。 */
16
+ disabled?: boolean;
17
+ inputSize?: 'sm' | 'md' | 'lg';
18
+ };
19
+ export declare function Combobox({ id, label, options, value, onChange, description, error, required, disabled, inputSize, ...rawProps }: ComboboxProps): import('react').JSX.Element;
20
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Combobox as ComboboxPrimitive } from '@base-ui/react';
2
+ import { Option } from '../../types/Option';
3
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
4
+ type ComboboxMultipleProps = WithoutExternalStyle<ComboboxPrimitive.Root.Props<Option, true>, 'items' | 'multiple' | 'disabled' | 'value' | 'onValueChange' | 'onChange'> & {
5
+ /** idは指定しなかったら場合、自動採番。 */
6
+ id?: string;
7
+ label: string;
8
+ options: Option[];
9
+ value?: string[];
10
+ onChange?: (value: string[]) => void;
11
+ /** 編集不可の理由などを記載。 */
12
+ description?: string;
13
+ error?: string;
14
+ required?: boolean;
15
+ /** 極力使用せず、表示できるか検討する。 */
16
+ disabled?: boolean;
17
+ inputSize?: 'sm' | 'md' | 'lg';
18
+ };
19
+ export declare function ComboboxMultiple({ id, label, options, value, onChange, description, error, required, disabled, inputSize, ...rawProps }: ComboboxMultipleProps): import('react').JSX.Element;
20
+ export {};
@@ -0,0 +1,16 @@
1
+ type DatePickerProps = {
2
+ /** idは指定しなかったら場合、自動採番。 */
3
+ id?: string;
4
+ label: string;
5
+ value?: Date;
6
+ onChange?: (date: Date | undefined) => void;
7
+ /** 編集不可の理由などを記載。 */
8
+ description?: string;
9
+ error?: string;
10
+ required?: boolean;
11
+ /** disabledはアクセシビリティの観点で使わない、readonlyも極力使用せず、表示できるか検討する。 */
12
+ readOnly?: boolean;
13
+ inputSize?: 'sm' | 'md' | 'lg';
14
+ };
15
+ export declare function DatePicker({ id, label, value, onChange, description, error, required, readOnly, inputSize, }: DatePickerProps): import('react').JSX.Element;
16
+ export {};
@@ -0,0 +1,18 @@
1
+ import { DateRange as DateRangeType } from 'react-day-picker';
2
+ type DateRangeProps = {
3
+ /** idは指定しなかったら場合、自動採番。 */
4
+ id?: string;
5
+ label: string;
6
+ value?: DateRangeType;
7
+ onChange?: (range: DateRangeType | undefined) => void;
8
+ /** 編集不可の理由などを記載。 */
9
+ description?: string;
10
+ error?: string;
11
+ required?: boolean;
12
+ /** disabledはアクセシビリティの観点で使わない、readonlyも極力使用せず、表示できるか検討する。 */
13
+ readOnly?: boolean;
14
+ inputSize?: 'sm' | 'md' | 'lg';
15
+ numberOfMonths?: number;
16
+ };
17
+ export declare function DateRange({ id, label, value, onChange, description, error, required, readOnly, inputSize, numberOfMonths, }: DateRangeProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,13 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ type DescriptionListItemProps = {
3
+ term: ReactNode;
4
+ children: ReactNode;
5
+ };
6
+ type DescriptionListProps = {
7
+ /** DescriptionListItemPropsのみ有効です。 */
8
+ children: ReactElement<DescriptionListItemProps, typeof DescriptionListItem> | ReactElement<DescriptionListItemProps, typeof DescriptionListItem>[];
9
+ };
10
+ export declare function DescriptionListItem({ term, children }: DescriptionListItemProps): import('react').JSX.Element;
11
+ /** 「説明したいこと」と「その説明文」のペアを1つの項目として数え、それが複数連なるようなコンテンツの時に使用します。 */
12
+ export declare function DescriptionList({ children }: DescriptionListProps): import('react').JSX.Element;
13
+ export {};
@@ -0,0 +1,10 @@
1
+ type DisclosureProps = {
2
+ triggerText: string;
3
+ children: React.ReactNode;
4
+ defaultOpen?: boolean;
5
+ };
6
+ /** メイン情報に対する追加情報を折りたたんで提示するときに使用します。
7
+ * 大事な項目には使用しない、表示領域をコンパクトを目的とはしない。
8
+ */
9
+ export declare function Disclosure({ triggerText, children, defaultOpen }: DisclosureProps): import('react').JSX.Element;
10
+ export {};
@@ -0,0 +1,24 @@
1
+ import { FocusEventHandler, Ref } from 'react';
2
+ type FileUploadProps = {
3
+ /** idは指定しなかったら場合、自動採番。 */
4
+ id?: string;
5
+ name: string;
6
+ label?: string;
7
+ /** 編集不可の理由などを記載。 */
8
+ description?: string;
9
+ required?: boolean;
10
+ accept?: string;
11
+ multiple?: boolean;
12
+ maxFiles: number;
13
+ /** 単位はMiB(1 MiB = 1024 * 1024 bytes) */
14
+ maxSize: number;
15
+ /** 極力使用せず、表示できるか検討する。 */
16
+ disabled?: boolean;
17
+ value?: File[];
18
+ error?: string;
19
+ onFilesChange?: (files: File[]) => void;
20
+ onBlur?: FocusEventHandler<HTMLInputElement>;
21
+ inputRef?: Ref<HTMLInputElement>;
22
+ };
23
+ export declare function FileUpload({ id, name, label, description, required, accept, multiple, maxFiles, maxSize, disabled, value, error, onFilesChange, onBlur, inputRef, }: FileUploadProps): import('react').JSX.Element;
24
+ export {};
@@ -0,0 +1,33 @@
1
+ import { FocusEventHandler, Ref } from 'react';
2
+ type FileUploadButtonProps = {
3
+ /** idは指定しなかった場合、自動採番。 */
4
+ id?: string;
5
+ name: string;
6
+ /** ボタン上部に表示するラベル。 */
7
+ fieldLabel: string;
8
+ /** ボタン内部に表示するラベル。
9
+ * コンポーネントの内部で指定済み。変更も可能です。
10
+ */
11
+ label?: string;
12
+ /** 編集不可の理由などを記載。 */
13
+ description?: string;
14
+ required?: boolean;
15
+ accept?: string;
16
+ multiple?: boolean;
17
+ maxFiles: number;
18
+ /** 単位はMiB(1 MiB = 1024 * 1024 bytes) */
19
+ maxSize: number;
20
+ /** 極力使用せず、表示できるか検討する。 */
21
+ disabled?: boolean;
22
+ value?: File[];
23
+ error?: string;
24
+ onFilesChange?: (files: File[]) => void;
25
+ onBlur?: FocusEventHandler<HTMLInputElement>;
26
+ inputRef?: Ref<HTMLInputElement>;
27
+ };
28
+ /**
29
+ * D&Dができないファイル添付コンポーネントであり、領域が小さいことで、
30
+ * ユーザーが次の項目を見逃さない(視線に入りやすくする)ようにすることを目的としています。
31
+ */
32
+ export declare function FileUploadButton({ id, name, fieldLabel, label, description, required, accept, multiple, maxFiles, maxSize, disabled, value, error, onFilesChange, onBlur, inputRef, }: FileUploadButtonProps): import('react').JSX.Element;
33
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type HamburgerMenuProps = {
3
+ children: ReactNode;
4
+ };
5
+ /** 子要素にはドロワーコンポーネントを推奨する。 */
6
+ export declare function HamburgerMenu({ children }: HamburgerMenuProps): import('react').JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ type HeadingProps = {
3
+ children: ReactNode;
4
+ type?: 'sectionTitle' | 'blockTitle' | 'subBlockTitle' | 'subSubBlockTitle';
5
+ };
6
+ /** デザインの一貫性の観点からも見出しもコンポーネントにする。 */
7
+ export declare function Heading({ children, type }: HeadingProps): import('react').JSX.Element;
8
+ export {};
@@ -0,0 +1,10 @@
1
+ export type ImageProps = {
2
+ src: string;
3
+ /** アクセシビリティの観点から必ず指定する。 */
4
+ alt: string;
5
+ description?: string;
6
+ /** リンク先のURL。指定した場合、画像がリンクとして表示される。*/
7
+ to?: string;
8
+ width?: string;
9
+ };
10
+ export declare function Image({ src, alt, description, to, width }: ImageProps): import('react').JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ComponentProps } from 'react';
2
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
3
+ import { Input as BaseInput } from '../../ui/input';
4
+ type InputProps = WithoutExternalStyle<ComponentProps<typeof BaseInput>, 'type' | 'disabled'> & {
5
+ /** idは指定しなかったら場合、自動採番。 */
6
+ id?: string;
7
+ label: string;
8
+ type?: 'text' | 'email' | 'number' | 'tel' | 'url' | 'search';
9
+ /** 編集不可の理由や文字数制限などを記載。 */
10
+ description?: string;
11
+ error?: string;
12
+ required?: boolean;
13
+ /** disabledはアクセシビリティの観点で使わない、readonlyも極力使用せず、表示できるか検討する。 */
14
+ readOnly?: boolean;
15
+ inputSize?: 'sm' | 'md' | 'lg';
16
+ };
17
+ export declare function Input({ id, label, description, error, required, readOnly, inputSize, ...rawProps }: InputProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ComponentProps } from 'react';
2
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
3
+ import { InputGroupInput } from '../../ui/input-group';
4
+ type PasswordInputProps = WithoutExternalStyle<ComponentProps<typeof InputGroupInput>, 'type' | 'disabled'> & {
5
+ /** idは指定しなかったら場合、自動採番。 */
6
+ id?: string;
7
+ label: string;
8
+ /** 編集不可の理由や文字数制限などを記載。 */
9
+ description?: string;
10
+ error?: string;
11
+ required?: boolean;
12
+ /** disabledはアクセシビリティの観点で使わない、readonlyも極力使用せず、表示できるか検討する。 */
13
+ readOnly?: boolean;
14
+ inputSize?: 'sm' | 'md' | 'lg';
15
+ };
16
+ /** Inputタグ type=Password の専用コンポーネント、アイコンを押すことで type=text に切り替えができる。(確認が目的)*/
17
+ export declare function PasswordInput({ id, label, description, error, required, readOnly, inputSize, ...rawProps }: PasswordInputProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Link as RouterLink } from 'react-router-dom';
3
+ type LinkProps = {
4
+ to: ComponentProps<typeof RouterLink>['to'];
5
+ label?: string;
6
+ size?: 'md' | 'lg';
7
+ };
8
+ /** SPAなので、ただのaタグは使わない。また、デフォルトとvisitedで色を指定済み。*/
9
+ export declare function Link({ to, label, size }: LinkProps): import('react').JSX.Element;
10
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ type ListVariant = 'disc' | 'none' | 'number';
3
+ type ListItemProps = {
4
+ children: ReactNode;
5
+ number?: number;
6
+ };
7
+ export declare function ListItem({ children, number }: ListItemProps): import('react').JSX.Element;
8
+ type ListProps = {
9
+ /** ListItemPropsのみ有効です。(入れ子可) */
10
+ children: ReactElement<ListItemProps, typeof ListItem>[];
11
+ variant?: ListVariant;
12
+ };
13
+ /** variant=number の際は、番号をテキストとして出力する。コピペできるように番号はタグやCSSでは当てない。 */
14
+ export declare function List({ children, variant }: ListProps): import('react').JSX.Element;
15
+ export {};
@@ -0,0 +1,6 @@
1
+ type LoadingProps = {
2
+ message?: string;
3
+ };
4
+ /** データ生成中や読み込み中の表示に使用します。(時間がかかるときに用いる) */
5
+ export declare function Loading({ message }: LoadingProps): import('react').JSX.Element;
6
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Option } from '../../types/Option';
3
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
4
+ import { RadioGroup } from '../../ui/radio-group';
5
+ type RadioProps = WithoutExternalStyle<ComponentProps<typeof RadioGroup>, 'disabled' | 'value' | 'onValueChange' | 'onChange'> & {
6
+ label: string;
7
+ options: Option[];
8
+ value?: string;
9
+ onChange?: (value: string) => void;
10
+ /** 編集不可の理由や文字数制限などを記載。 */
11
+ description?: string;
12
+ error?: string;
13
+ required?: boolean;
14
+ /** 極力使用せず、表示できるか検討する。 */
15
+ disabled?: boolean;
16
+ };
17
+ export declare function Radio({ label, options, value, onChange, description, error, required, disabled, ...rawProps }: RadioProps): import('react').JSX.Element;
18
+ export {};
@@ -0,0 +1,9 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Select } from './Select';
3
+ export type Language = 'ja' | 'en';
4
+ type Props = Omit<ComponentProps<typeof Select>, 'options' | 'value' | 'onChange' | 'label'> & {
5
+ value?: Language;
6
+ onChange?: (value: Language) => void;
7
+ };
8
+ export declare function LanguageSelect(props: Props): import('react').JSX.Element;
9
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ComponentProps } from 'react';
2
+ import { Option } from '../../types/Option';
3
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
4
+ import { Select as BaseSelect } from '../../ui/select';
5
+ type SelectProps = WithoutExternalStyle<ComponentProps<typeof BaseSelect>, 'disabled' | 'value' | 'onValueChange'> & {
6
+ /** idは指定しなかったら場合、自動採番。 */
7
+ id?: string;
8
+ label: string;
9
+ options: Option[];
10
+ value?: string;
11
+ onChange?: (value: string) => void;
12
+ /** 編集不可の理由や文字数制限などを記載。 */
13
+ description?: string;
14
+ error?: string;
15
+ required?: boolean;
16
+ /** 極力使用せず、表示できるか検討する。 */
17
+ disabled?: boolean;
18
+ inputSize?: 'sm' | 'md' | 'lg';
19
+ };
20
+ export declare function Select({ id, label, options, value, onChange, description, error, required, disabled, inputSize, ...rawProps }: SelectProps): import('react').JSX.Element;
21
+ export {};
@@ -0,0 +1,15 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { WithoutExternalStyle } from '../../types/WithoutExternalStyle';
3
+ import { Switch as BaseSwitch } from '../../ui/switch';
4
+ type SwitchProps = WithoutExternalStyle<ComponentProps<typeof BaseSwitch>, 'id' | 'aria-label' | 'disabled'> & {
5
+ /** idを指定しない場合は自動採番。 */
6
+ id?: string;
7
+ label?: ReactNode;
8
+ /** アクセシビリティの観点から必ず指定する。 */
9
+ 'aria-label': string;
10
+ labelPosition?: 'left' | 'right';
11
+ /** 極力使用せず、表示できるか検討する。 */
12
+ disabled?: boolean;
13
+ };
14
+ export declare function Switch({ id, label, labelPosition, 'aria-label': ariaLabel, disabled, ...rawProps }: SwitchProps): import('react').JSX.Element;
15
+ export {};
@@ -0,0 +1 @@
1
+ export declare function ThemeSwitch(): import('react').JSX.Element;