@cakejp/design-system 0.11.0 → 0.13.0
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.
- package/CHANGELOG.md +85 -1
- package/CLAUDE.md +22 -1
- package/README.md +48 -0
- package/UPDATING.md +9 -0
- package/bin/check-duplicates.mjs +256 -0
- package/bin/exports-parser.mjs +54 -0
- package/bin/init.js +11 -0
- package/contracts/components.json +395 -37
- package/contracts/composition.json +10 -7
- package/contracts/rules.json +21 -3
- package/dist/index.css +1 -1
- package/dist/index.js +6134 -3475
- package/dist/types/components/ec/admin-shell.d.ts +39 -2
- package/dist/types/components/ec/mypage-shell.d.ts +10 -1
- package/dist/types/components/ec/product-card.d.ts +3 -1
- package/dist/types/components/ec/product-list-item.d.ts +8 -1
- package/dist/types/components/foundations/alert.d.ts +5 -1
- package/dist/types/components/foundations/button.d.ts +1 -1
- package/dist/types/components/foundations/card.d.ts +36 -2
- package/dist/types/components/foundations/chip-variants.d.ts +17 -0
- package/dist/types/components/foundations/field.d.ts +81 -0
- package/dist/types/components/foundations/file-input.d.ts +75 -0
- package/dist/types/components/foundations/icon-badge.d.ts +2 -2
- package/dist/types/components/foundations/input.d.ts +11 -1
- package/dist/types/components/foundations/radio-group.d.ts +12 -2
- package/dist/types/components/foundations/skip-link.d.ts +39 -0
- package/dist/types/components/foundations/textarea.d.ts +11 -1
- package/dist/types/components/primitives/chat-composer.d.ts +87 -0
- package/dist/types/components/primitives/chip.d.ts +2 -7
- package/dist/types/components/primitives/content-carousel.d.ts +58 -0
- package/dist/types/components/primitives/date-picker.d.ts +44 -0
- package/dist/types/components/primitives/error-state.d.ts +43 -16
- package/dist/types/components/primitives/funnel-shell.d.ts +12 -1
- package/dist/types/components/primitives/header.d.ts +15 -1
- package/dist/types/components/primitives/image-input.d.ts +119 -0
- package/dist/types/components/primitives/section-header.d.ts +9 -2
- package/dist/types/components/primitives/section-nav.d.ts +28 -2
- package/dist/types/components/primitives/section.d.ts +35 -2
- package/dist/types/components/primitives/share-buttons.d.ts +8 -2
- package/dist/types/components/primitives/standard-page-shell.d.ts +11 -1
- package/dist/types/components/primitives/timeline.d.ts +23 -0
- package/dist/types/components/primitives/workspace-shell.d.ts +21 -1
- package/dist/types/index.d.ts +80 -4
- package/dist/types/lib/pagination-range.d.ts +16 -0
- package/dist/types/lib/use-value-length.d.ts +31 -0
- package/package.json +2 -1
- package/src/preset-standalone.css +322 -4
- package/src/preset.css +17 -0
- package/src/styles/semantic.css +7 -0
- package/src/styles/typography.css +15 -1
- package/templates/AGENTS.md +11 -0
- package/templates/CLAUDE.md +11 -0
- package/tokens.json +18 -2
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
* 本番の shop_layout.ctp を参考に、Header + SideNav + Main Content の構造を再現。
|
|
5
5
|
* 汎用の枠は primitives(AdminSideNav / AdminHeader)に切り出し、
|
|
6
6
|
* Cake.jp 管理メニュー等のドメイン既定値はこの ec レイヤーで束ねる。
|
|
7
|
+
*
|
|
8
|
+
* ## サイドナビの構造(採用前に確認すること)
|
|
9
|
+
*
|
|
10
|
+
* - **PC**: 左端固定の **72px アイコンレール**(アイコン + 短いラベル、サブメニューは hover ポップアップ)。
|
|
11
|
+
* 幅が無いため、バッジ・見出し・説明文からなる**ブランドブロックをレール上部に置くことはできない**。
|
|
12
|
+
* 他ブランドの管理画面でブランドを出したい場合は `brand`(ヘッダー左側)を使う。
|
|
13
|
+
* - **SP**: ドロワー。上部見出しは `sidebarHeader`(未指定なら `shopName`)で差し替えられる。
|
|
14
|
+
*
|
|
15
|
+
* 「幅の広いブランド付きサイドバー」を前提にした画面は、この骨格とは別パターンなので
|
|
16
|
+
* そのまま置き換えられない(DS に issue を立てること)。
|
|
17
|
+
*
|
|
18
|
+
* ## 配下 Card のサーフェス
|
|
19
|
+
*
|
|
20
|
+
* 地が Surface-Secondary なので、シェルが配下 `Card` の既定サーフェスを白にする文脈
|
|
21
|
+
* (`--card-surface`)を宣言する。`Card` は `surface` 未指定のまま地から浮く(#150)。
|
|
22
|
+
*
|
|
7
23
|
* 参照元:
|
|
8
24
|
* - admin-test-htdocs/app/views/layouts/shop_layout.ctp
|
|
9
25
|
* - admin-test-htdocs/app/views/elements/shop_layout/header.ctp
|
|
@@ -28,8 +44,20 @@ export interface AdminShellProps {
|
|
|
28
44
|
label: string;
|
|
29
45
|
href?: string;
|
|
30
46
|
}[];
|
|
31
|
-
/**
|
|
47
|
+
/** ショップ名。ヘッダーの `{shopName}管理` と SP ドロワー見出しの既定値になる */
|
|
32
48
|
shopName?: string;
|
|
49
|
+
/**
|
|
50
|
+
* ヘッダー左側のブランド表示を差し替える(既定=`{shopName}管理` の文字列)。
|
|
51
|
+
* ロゴ画像・バッジ付きブランドブロック等、文字列で表せない表現に使う。
|
|
52
|
+
* ※ PC の左サイドナビは 72px のアイコンレールでブランドブロックを置く領域が無いため、
|
|
53
|
+
* 他ブランドの管理画面はここ(ヘッダー)でブランドを表現する。
|
|
54
|
+
*/
|
|
55
|
+
brand?: React.ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* SP ドロワー上部の見出しを差し替える(既定=`shopName` の文字列)。
|
|
58
|
+
* バッジ+見出し+説明のようなブランドブロックを置ける。
|
|
59
|
+
*/
|
|
60
|
+
sidebarHeader?: React.ReactNode;
|
|
33
61
|
/** サイドナビ項目(既定=Cake.jp 管理メニュー。利用側で差し替え可) */
|
|
34
62
|
navItems?: AdminNavItem[];
|
|
35
63
|
/** ヘッダー右側のアクション slot(既定=通知ベル+プロフィール) */
|
|
@@ -42,5 +70,14 @@ export interface AdminShellProps {
|
|
|
42
70
|
onBack?: () => void;
|
|
43
71
|
/** 戻るボタンのラベル(既定="戻る") */
|
|
44
72
|
backLabel?: string;
|
|
73
|
+
/**
|
|
74
|
+
* `<main>` の id(既定 "main-content")。内蔵の SkipLink の飛び先(`#${mainId}`)と対になる。
|
|
75
|
+
*/
|
|
76
|
+
mainId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* DOM 先頭に SkipLink(キーボードで本文へ飛ぶ a11y リンク)を標準内蔵する。
|
|
79
|
+
* `sr-only` なので視覚には影響しない。`false` で無効化。
|
|
80
|
+
*/
|
|
81
|
+
skipLink?: false;
|
|
45
82
|
}
|
|
46
|
-
export declare function AdminShell({ children, activeNav, title, breadcrumbs, shopName, navItems, headerActions, onBack, backLabel, }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
|
|
83
|
+
export declare function AdminShell({ children, activeNav, title, breadcrumbs, shopName, brand, sidebarHeader, navItems, headerActions, onBack, backLabel, mainId, skipLink, }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -81,6 +81,15 @@ export interface MypageShellProps {
|
|
|
81
81
|
navItems?: HeaderNavItem[];
|
|
82
82
|
/** SP の戻るボタン押下時のハンドラ(Header variant="back" に委譲) */
|
|
83
83
|
onBack?: () => void;
|
|
84
|
+
/**
|
|
85
|
+
* メインコンテンツ `<main>` の id(既定 "main-content")。内蔵の SkipLink の飛び先(`#${mainId}`)と対になる。
|
|
86
|
+
*/
|
|
87
|
+
mainId?: string;
|
|
88
|
+
/**
|
|
89
|
+
* DOM 先頭に SkipLink(キーボードで本文へ飛ぶ a11y リンク)を標準内蔵する。
|
|
90
|
+
* `sr-only` なので視覚には影響しない。`false` で無効化。
|
|
91
|
+
*/
|
|
92
|
+
skipLink?: false;
|
|
84
93
|
}
|
|
85
|
-
declare function MypageShell({ title, activeMenu, currentPath, activeMatch, isActiveMenuItem, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, logo, navItems, onBack, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
declare function MypageShell({ title, activeMenu, currentPath, activeMatch, isActiveMenuItem, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, logo, navItems, onBack, mainId, skipLink, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
|
|
86
95
|
export { MypageShell };
|
|
@@ -11,6 +11,8 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
11
11
|
price: number;
|
|
12
12
|
/** 元の金額(割引表示用) */
|
|
13
13
|
originalPrice?: number;
|
|
14
|
+
/** 規格・仕様の短い自由記述(例: "1kg / 冷蔵")。価格表示の直下に表示。tags(配送方法等のenum)とは別物 */
|
|
15
|
+
caption?: string;
|
|
14
16
|
/** 評価値 (0〜5) */
|
|
15
17
|
rating?: number;
|
|
16
18
|
/** レビュー件数 */
|
|
@@ -73,5 +75,5 @@ export declare function BookmarkRibbonIcon({ size, filled }: {
|
|
|
73
75
|
* - `showCartButton` で「カートに追加」ボタン表示(verticalのみ)
|
|
74
76
|
* - ランキングバッジ、お気に入り、割引バッジなどEC必須要素を統合提供
|
|
75
77
|
*/
|
|
76
|
-
declare function ProductCard({ className, name, imageUrl, imageAlt, price, originalPrice, rating, reviewCount, shopName, shopHref, tags, isFavorite, onFavoriteToggle, onCardClick, href, ranking, deliveryDate, orientation, showDiscountBadge, showCartButton, onCartAdd, cartButtonLabel, ...props }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
declare function ProductCard({ className, name, imageUrl, imageAlt, price, originalPrice, caption, rating, reviewCount, shopName, shopHref, tags, isFavorite, onFavoriteToggle, onCardClick, href, ranking, deliveryDate, orientation, showDiscountBadge, showCartButton, onCartAdd, cartButtonLabel, ...props }: ProductCardProps): import("react/jsx-runtime").JSX.Element;
|
|
77
79
|
export { ProductCard };
|
|
@@ -10,6 +10,8 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
10
10
|
imageUrl?: string;
|
|
11
11
|
/** 価格 */
|
|
12
12
|
price?: number;
|
|
13
|
+
/** 規格・仕様の短い自由記述(例: "1kg / 冷蔵")。価格表示の直下に表示。tags(配送方法等のenum)とは別物 */
|
|
14
|
+
caption?: string;
|
|
13
15
|
/** ショップ名 */
|
|
14
16
|
shopName?: string;
|
|
15
17
|
/** ショップリンクURL */
|
|
@@ -64,6 +66,10 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
64
66
|
onSaveForLater?: () => void;
|
|
65
67
|
/** 画像サイズクラス(cart variant、デフォルト: "size-20") */
|
|
66
68
|
imageSize?: string;
|
|
69
|
+
/** 商品ごとの小計(cart variantのみ)。数量セレクタ行の右側(収まらなければ下)に表示 */
|
|
70
|
+
subtotal?: number;
|
|
71
|
+
/** 小計のラベル(cart variantのみ、既定: "小計") */
|
|
72
|
+
subtotalLabel?: string;
|
|
67
73
|
/** 左側スロット(画像の代わりに任意コンテンツ) */
|
|
68
74
|
leftSlot?: React.ReactNode;
|
|
69
75
|
/** 右側スロット(ブックマークの代わりに任意コンテンツ) */
|
|
@@ -82,9 +88,10 @@ export interface ProductListItemProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
82
88
|
* - 注文履歴: `<ListItem variant="order-history" />`
|
|
83
89
|
* - カート内: `<ListItem variant="cart" quantity={1} price={4980} onQuantityChange={...} />`
|
|
84
90
|
* - cart variant は `CartItem` ラッパーコンポーネント経由でも使用可能
|
|
91
|
+
* - ロット購入等で商品ごとの小計を出す場合: `subtotal={4980 * quantity}`(既定ラベル「小計」、`subtotalLabel` で変更可)
|
|
85
92
|
* - レビュー画面: `<ListItem variant="review" showDetailButton showCartButton />`
|
|
86
93
|
* - 小さい: `<ListItem variant="small" />`
|
|
87
94
|
* - 極小: `<ListItem variant="xsm" />`
|
|
88
95
|
*/
|
|
89
|
-
declare function ProductListItem({ name, imageUrl, price, shopName, shopHref, brandName, tags, hashTags, statusLabel, variant, showCartButton, onAddToCart, showDetailButton, onViewDetail, showBookmark, href, orderDate, deliveryInfo, totalPrice, showReviewButton, optionInfo, quantity, onQuantityChange, quantitySize, originalPrice, priceLabel, deliveryText, onDelete, onSaveForLater, imageSize, leftSlot, rightSlot, bottomSlot, className, ...props }: ProductListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
+
declare function ProductListItem({ name, imageUrl, price, caption, shopName, shopHref, brandName, tags, hashTags, statusLabel, variant, showCartButton, onAddToCart, showDetailButton, onViewDetail, showBookmark, href, orderDate, deliveryInfo, totalPrice, showReviewButton, optionInfo, quantity, onQuantityChange, quantitySize, originalPrice, priceLabel, deliveryText, onDelete, onSaveForLater, imageSize, subtotal, subtotalLabel, leftSlot, rightSlot, bottomSlot, className, ...props }: ProductListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
90
97
|
export { ProductListItem };
|
|
@@ -14,9 +14,13 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
14
14
|
* - Tinted background, no border
|
|
15
15
|
* - Compact: padding 8px 12px, rounded-sm (3px), gap 4px
|
|
16
16
|
* - Icon (20px) + content column layout
|
|
17
|
+
* - **prop-based API 対応**(#109): title / description / icon / action を直接渡せる
|
|
17
18
|
*
|
|
18
19
|
* 旧 `<Banner>` の用途は bordered variant + prop-based API で完全カバー:
|
|
19
20
|
* <Alert variant="warning" title="..." description="..." action={<Button />} />
|
|
21
|
+
*
|
|
22
|
+
* フォーム内・セクション内の軽量な補足情報は inline variant + prop-based API で組める:
|
|
23
|
+
* <Alert variant="inline-info" title="..." description="..." />
|
|
20
24
|
*/
|
|
21
25
|
declare const alertVariants: (props?: {
|
|
22
26
|
variant?: "success" | "info" | "error" | "warning" | "inline-info" | "inline-caution" | "inline-warning";
|
|
@@ -24,7 +28,7 @@ declare const alertVariants: (props?: {
|
|
|
24
28
|
type AlertProps = React.ComponentProps<"div"> & VariantProps<typeof alertVariants> & {
|
|
25
29
|
/**
|
|
26
30
|
* prop-based API のタイトル(旧 Banner.title 相当)。
|
|
27
|
-
* children と排他(children 優先)。bordered variant
|
|
31
|
+
* children と排他(children 優先)。bordered / inline 両 variant で有効。
|
|
28
32
|
*/
|
|
29
33
|
title?: React.ReactNode;
|
|
30
34
|
/** prop-based API の説明テキスト(旧 Banner.description 相当) */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: {
|
|
4
|
-
variant?: "link" | "default" | "secondary" | "tertiary" | "destructive" | "ghost" | "inverse" | "ghost-inverse";
|
|
4
|
+
variant?: "link" | "default" | "secondary" | "tertiary" | "destructive" | "ghost" | "inverse" | "ghost-inverse" | "overlay";
|
|
5
5
|
size?: "default" | "icon" | "xs" | "sm" | "lg" | "xl" | "hero" | "icon-xs" | "icon-sm" | "icon-lg";
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
@@ -1,9 +1,43 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
/**
|
|
4
|
+
* Card の背景サーフェス。
|
|
5
|
+
* - `default`: `--card-surface`(親から伝播したサーフェス文脈)→ 無ければ `--card`
|
|
6
|
+
* (= Surface-Secondary)。通常の白/明るい地の上ではこれまで通り `bg-card` と同値。
|
|
7
|
+
* - `primary`: `Surface-Primary`(白)。文脈に関係なく白で固定したいときに明示指定する。
|
|
8
|
+
*
|
|
9
|
+
* ## サーフェス文脈の伝播(#150)
|
|
10
|
+
*
|
|
11
|
+
* `Section background="subtle" | "accent-subtle"` は配下に `--card-surface: var(--Surface-Primary)`
|
|
12
|
+
* を流す。そのため**グレー地の Section に置いた Card は `surface` 未指定でも自動で白**になり、
|
|
13
|
+
* 「あとからカードを1枚足したら prop を付け忘れてグレー地に沈む」事故が構造的に起きない。
|
|
14
|
+
*
|
|
15
|
+
* 伝播は CSS カスタムプロパティのカスケードだけで成立する(React context 不使用)。
|
|
16
|
+
* したがって Card / Section は Server Component のまま使え、DS の `Section` を使わない
|
|
17
|
+
* 自前のグレー地でも同じ効果を得られる:
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // 任意の要素にサーフェス文脈を宣言する(consumer 側の escape hatch)
|
|
21
|
+
* <div className="bg-[var(--Surface-Tertiary)] [--card-surface:var(--Surface-Primary)]">
|
|
22
|
+
* <Card /> // 白になる
|
|
23
|
+
* </div>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* dark では `Section` は伝播値を `Surface-Secondary` に据え置く(dark のカードは半透明白で
|
|
27
|
+
* 地に重なり一段明るく浮くため、白の強制は elevation の反転になる)。自前で文脈を宣言する
|
|
28
|
+
* ときも dark に配慮するなら `dark:[--card-surface:var(--Surface-Secondary)]` を併記する。
|
|
29
|
+
*
|
|
30
|
+
* 逆に文脈を無視して Surface-Secondary に固定したい 1 枚だけは
|
|
31
|
+
* `<Card className="bg-card">` で上書きする(className が最後に勝つ)。
|
|
32
|
+
*/
|
|
33
|
+
declare const cardVariants: (props?: {
|
|
34
|
+
surface?: "default" | "primary";
|
|
35
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
36
|
+
declare function Card({ className, surface, ...props }: React.ComponentProps<"div"> & VariantProps<typeof cardVariants>): import("react/jsx-runtime").JSX.Element;
|
|
3
37
|
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
38
|
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
39
|
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
6
40
|
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
7
41
|
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
42
|
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
43
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, cardVariants, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
/**
|
|
3
|
+
* Chip / choice-chip の共有バリアント(CVA)。
|
|
4
|
+
*
|
|
5
|
+
* foundations 層に置くことで、Chip(primitives)と RadioGroup の
|
|
6
|
+
* `variant="chip"`(foundations)の双方が同じ意匠を import して再利用できる
|
|
7
|
+
* (primitives→foundations / foundations→foundations はいずれも正方向の依存)。
|
|
8
|
+
*
|
|
9
|
+
* ここが chip 意匠の単一の正典。size / shape / typo / focus リング等を変更すると
|
|
10
|
+
* Chip と RadioGroup の chip variant の両方へ自動追従する。
|
|
11
|
+
*/
|
|
12
|
+
export declare const chipVariants: (props?: {
|
|
13
|
+
variant?: "filled" | "accent";
|
|
14
|
+
size?: "sm" | "lg" | "md" | "tile";
|
|
15
|
+
shape?: "pill" | "square";
|
|
16
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
17
|
+
export type ChipVariantProps = VariantProps<typeof chipVariants>;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## Field 群 / フォームレイアウト primitive
|
|
3
|
+
*
|
|
4
|
+
* `FormField`(Label + 入力 + エラーのセット)を核に、フォーム全体の
|
|
5
|
+
* レイアウト(見出し・グループ・説明・エラー・区切り)を組む補助群。
|
|
6
|
+
* shadcn の field パターンを DS の Label / Separator / トークンに合わせて実装。
|
|
7
|
+
*
|
|
8
|
+
* ### インポート
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { Field, FieldLabel, FieldSet, FieldLegend, FieldGroup, FieldDescription, FieldError, FieldSeparator } from "../../components/foundations/field"
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* ### 構成要素
|
|
14
|
+
* | 要素 | DOM | 役割 |
|
|
15
|
+
* |------|-----|------|
|
|
16
|
+
* | `Field` | `<div role="group">` | **1 フィールド分の箱**(縦リズムの最小単位)。`orientation` で vertical / horizontal / responsive |
|
|
17
|
+
* | `FieldLabel` | `<Label>` ラップ | Field 内のラベル(`htmlFor` で入力と関連付け) |
|
|
18
|
+
* | `FieldSet` | `<fieldset>` | フォーム全体 or 大セクション。legend + 複数グループを縦リズム gap-6 で並べる |
|
|
19
|
+
* | `FieldLegend` | `<legend>` | FieldSet の見出し |
|
|
20
|
+
* | `FieldGroup` | `<div role="group">` | 関連する複数フィールドを section-content リズム gap-4 で束ねる |
|
|
21
|
+
* | `FieldDescription` | `<p>` | 補足テキスト(FormField の description と同意匠) |
|
|
22
|
+
* | `FieldError` | `<p role="alert">` | エラーメッセージ(children が空なら描画しない) |
|
|
23
|
+
* | `FieldSeparator` | `<Separator>` ラップ | フィールド群の区切り。children を渡すと中央ラベル付き |
|
|
24
|
+
*
|
|
25
|
+
* ### AI 向け使用ルール
|
|
26
|
+
* - ラベル + 入力 + エラーが一体で済むなら `FormField`(primitives)が最短。
|
|
27
|
+
* ラベル・入力・説明・エラーを個別に組み立てたいときは `Field` + `FieldLabel` を使う
|
|
28
|
+
* - `Field` は `FieldGroup` の中に置く(`orientation="responsive"` は `FieldGroup` の
|
|
29
|
+
* `@container/field-group` を基準に、狭いと縦・広いと横へ切り替わる)
|
|
30
|
+
* - 余白は composition.json の縦リズムに従う(FieldSet=gap-6 / FieldGroup=gap-4)。手で mt-/mb- を足さない
|
|
31
|
+
* - 見出しは `FieldLegend`、グループ横断の区切りは `FieldSeparator` を使う
|
|
32
|
+
*/
|
|
33
|
+
import * as React from "react";
|
|
34
|
+
import { type VariantProps } from "class-variance-authority";
|
|
35
|
+
import { Label } from "../../components/foundations/label";
|
|
36
|
+
/**
|
|
37
|
+
* Field — 1 フィールド分の箱(ラベル + 入力 + 説明/エラー)。
|
|
38
|
+
* `FieldGroup`(gap-4)の中に並べる**縦リズムの最小単位**。
|
|
39
|
+
* これが無いと「1 フィールドの内側の並べ方」が consumer 実装依存になる。
|
|
40
|
+
*/
|
|
41
|
+
declare const fieldVariants: (props?: {
|
|
42
|
+
orientation?: "horizontal" | "vertical" | "responsive";
|
|
43
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
44
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
|
|
45
|
+
/**
|
|
46
|
+
* FieldLabel — Field 内のラベル。DS の `Label` に DS のタイポ(typo-label-md)と
|
|
47
|
+
* 無効時の色を当てたもの。`htmlFor` で入力と関連付ける。
|
|
48
|
+
*/
|
|
49
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* FieldSet — フォーム全体 or 大きなセクションの枠。
|
|
52
|
+
* `<fieldset>` の既定スタイル(ブラウザ枠線・padding)をリセットし、
|
|
53
|
+
* legend + 複数 `FieldGroup` を gap-6 の縦リズムで並べる。
|
|
54
|
+
*/
|
|
55
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* FieldLegend — FieldSet の見出し。`<legend>` として描画。
|
|
58
|
+
*/
|
|
59
|
+
declare function FieldLegend({ className, ...props }: React.ComponentProps<"legend">): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* FieldGroup — 関連する複数フィールドを束ねるコンテナ。
|
|
62
|
+
* section-content リズム(gap-4)で縦に並べる。
|
|
63
|
+
*/
|
|
64
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
/**
|
|
66
|
+
* FieldDescription — 補足テキスト。FormField の description と同じ意匠。
|
|
67
|
+
*/
|
|
68
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
69
|
+
/**
|
|
70
|
+
* FieldError — エラーメッセージ。children が空なら何も描画しない。
|
|
71
|
+
* `role="alert"` でスクリーンリーダーに即時通知する。
|
|
72
|
+
*/
|
|
73
|
+
declare function FieldError({ className, children, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
/**
|
|
75
|
+
* FieldSeparator — フィールド群の区切り。DS の Separator をラップし
|
|
76
|
+
* 上下に余白を持たせる。children を渡すと中央にラベル(「または」等)を表示。
|
|
77
|
+
*/
|
|
78
|
+
declare function FieldSeparator({ className, children, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
79
|
+
export { Field, FieldLabel, FieldSet, FieldLegend, FieldGroup, FieldDescription, FieldError, FieldSeparator, };
|
|
80
|
+
export { fieldVariants };
|
|
81
|
+
export type FieldProps = React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/** maxSize 超過などの理由でファイルが受理されなかったときのコールバック引数。 */
|
|
2
|
+
export interface FileInputError {
|
|
3
|
+
/** エラー種別。現状は maxSize 超過のみ。 */
|
|
4
|
+
code: "max-size";
|
|
5
|
+
/** 対象ファイル */
|
|
6
|
+
file: File;
|
|
7
|
+
/** 上限バイト数 */
|
|
8
|
+
maxSize: number;
|
|
9
|
+
}
|
|
10
|
+
export interface FileInputProps {
|
|
11
|
+
/** `<input>` の id。外側 Label の htmlFor と揃えて紐付ける。 */
|
|
12
|
+
id?: string;
|
|
13
|
+
/** input name(フォーム送信用) */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** 受け付ける MIME/拡張子(例: "image/*,.pdf") */
|
|
16
|
+
accept?: string;
|
|
17
|
+
/** 複数選択を許可。true のとき選択済みは「n件選択」で集約表示する。 */
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
/** 1ファイルあたりの上限バイト数。超過ファイルは受理せず onError を呼ぶ。 */
|
|
20
|
+
maxSize?: number;
|
|
21
|
+
/** 無効化 */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** 未選択時のプレースホルダ文言 */
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/** 「ファイルを選択」ボタンの文言 */
|
|
26
|
+
buttonLabel?: string;
|
|
27
|
+
/**
|
|
28
|
+
* 制御用の選択ファイル。指定すると表示はこの値に従う(controlled)。
|
|
29
|
+
* 未指定なら内部 state で保持する(uncontrolled)。
|
|
30
|
+
*/
|
|
31
|
+
value?: File[];
|
|
32
|
+
/** 選択ファイルが変わったときのコールバック(受理されたファイルのみ)。 */
|
|
33
|
+
onFilesChange?: (files: File[]) => void;
|
|
34
|
+
/** maxSize 超過など、ファイルが受理されなかったときのコールバック。 */
|
|
35
|
+
onError?: (error: FileInputError) => void;
|
|
36
|
+
/** Field 群のエラー表示等と紐付ける(`<input>` に付与) */
|
|
37
|
+
"aria-describedby"?: string;
|
|
38
|
+
/** エラー状態(`<input>` に付与) */
|
|
39
|
+
"aria-invalid"?: boolean | "true" | "false";
|
|
40
|
+
/** 追加クラス(ルート要素) */
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 選択ファイルの表示名を組み立てる。0件=空文字、1件=ファイル名、複数=「n件選択」。
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatFileNames(files: File[]): string;
|
|
47
|
+
/**
|
|
48
|
+
* maxSize でファイルを受理/非受理に振り分ける。maxSize 未指定なら全件受理。
|
|
49
|
+
*/
|
|
50
|
+
export declare function validateFileSize(files: File[], maxSize?: number): {
|
|
51
|
+
accepted: File[];
|
|
52
|
+
rejected: File[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* ## FileInput / ファイル入力
|
|
56
|
+
*
|
|
57
|
+
* 汎用ファイル添付の1行フォーム部品。「ファイルを選択」ボタン + 選択済みファイル名 + クリアボタン。
|
|
58
|
+
* ネイティブ `<input type="file">` を visually-hidden で内包し、キーボード・スクリーンリーダーで操作可能。
|
|
59
|
+
*
|
|
60
|
+
* ### ImageUploader との使い分け
|
|
61
|
+
* - プレビュー付きの画像管理(並び替え・複数サムネイル)→ `ImageUploader`
|
|
62
|
+
* - 画像以外も含む汎用の添付(PDF・CSV 等)→ `FileInput`
|
|
63
|
+
*
|
|
64
|
+
* ### インポート
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { FileInput } from '../../components/foundations/file-input'
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* ### AI 向け使用ルール
|
|
70
|
+
* - `<input type="file">` を直接書かず FileInput を使う
|
|
71
|
+
* - `id` を外側の Label / FormField の htmlFor と揃えて紐付ける
|
|
72
|
+
* - エラー表示は `aria-describedby` で FieldError と接続する
|
|
73
|
+
*/
|
|
74
|
+
declare function FileInput({ id, name, accept, multiple, maxSize, disabled, placeholder, buttonLabel, value, onFilesChange, onError, className, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, }: FileInputProps): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
export { FileInput };
|
|
@@ -9,10 +9,10 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
9
9
|
* バッジ側に `mt-/mb-` を内蔵すると Card の gap と二重がけになり間延びするため。
|
|
10
10
|
* - アイコン色は `currentColor`(= `--Object-Accent-Primary`)を継承する。
|
|
11
11
|
* 中の Lucide / iconsax アイコンに `color` を渡す必要はない。
|
|
12
|
-
* - 内部 SVG のサイズはバッジが固定する(md=20px / lg=38px)。アイコン側の `size` は不要。
|
|
12
|
+
* - 内部 SVG のサイズはバッジが固定する(md=20px / ml=24px / lg=38px)。アイコン側の `size` は不要。
|
|
13
13
|
*/
|
|
14
14
|
declare const iconBadgeVariants: (props?: {
|
|
15
|
-
size?: "lg" | "md";
|
|
15
|
+
size?: "lg" | "md" | "ml";
|
|
16
16
|
} & import("class-variance-authority/types").ClassProp) => string;
|
|
17
17
|
declare function IconBadge({ className, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof iconBadgeVariants>): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export { IconBadge, iconBadgeVariants };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
export interface InputProps extends React.ComponentProps<"input"> {
|
|
3
|
+
/**
|
|
4
|
+
* 文字数カウンタを表示する。`maxLength` とセットで使い、入力欄の
|
|
5
|
+
* 右下に `{現在}/{max}` を表示する。上限に達すると Text-Caution 色になる。
|
|
6
|
+
* 制御(`value`)/ 非制御(`defaultValue`)どちらでも追従する。
|
|
7
|
+
* 非制御時は実際の DOM の値を数えるため、react-hook-form の `register()` の
|
|
8
|
+
* ように `ref` 経由で外部から値が入るケースでも初期表示から正しく数える。
|
|
9
|
+
*/
|
|
10
|
+
showCount?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function Input({ className, type, showCount, maxLength, value, defaultValue, onChange, ref, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
3
13
|
export { Input };
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { RadioGroup as RadioGroupPrimitive } from "radix-ui";
|
|
3
|
-
|
|
3
|
+
/** RadioGroup の描画スタイル。tile=タイル型(既定)/ chip=チップ型(choice chip)。 */
|
|
4
|
+
export type RadioGroupVariant = "tile" | "chip";
|
|
5
|
+
declare function RadioGroup({ className, variant, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Root> & {
|
|
6
|
+
/**
|
|
7
|
+
* 描画スタイル。
|
|
8
|
+
* - `"tile"`(既定): タイル型。ラジオ丸 + ラベル + 補足説明 + 展開コンテンツ。
|
|
9
|
+
* - `"chip"`: choice chip 型。ラベルを内包した Chip 意匠で排他選択を組む(タグ選択・絞り込み等)。
|
|
10
|
+
* Radix RadioGroup のキーボード操作・a11y はそのまま維持される。
|
|
11
|
+
*/
|
|
12
|
+
variant?: RadioGroupVariant;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
4
14
|
declare function RadioGroupItem({ className, children, description, expandedContent, ...props }: React.ComponentProps<typeof RadioGroupPrimitive.Item> & {
|
|
5
15
|
description?: React.ReactNode;
|
|
6
|
-
/**
|
|
16
|
+
/** 選択時に展開表示するコンテンツ(tile variant のみ) */
|
|
7
17
|
expandedContent?: React.ReactNode;
|
|
8
18
|
}): import("react/jsx-runtime").JSX.Element;
|
|
9
19
|
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SkipLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
3
|
+
/** スキップ先アンカー(既定 `#main-content`。シェルの `mainId` と対応させる) */
|
|
4
|
+
href?: string;
|
|
5
|
+
/** リンクの文言(既定「コンテンツへ移動」) */
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* SkipLink — キーボード操作でグローバルナビを飛ばして本文へ移動する a11y リンク。
|
|
10
|
+
*
|
|
11
|
+
* 通常は視覚的に隠れており(`sr-only`)、Tab フォーカスが当たった瞬間だけ
|
|
12
|
+
* 左上に可視化される。スクリーンリーダー/キーボードユーザーがヘッダーの
|
|
13
|
+
* 反復リンクをスキップして `#main-content`(= シェルの `<main id>`)へ直接
|
|
14
|
+
* 到達できるようにする。WCAG 2.4.1(Bypass Blocks)対応の定番部品。
|
|
15
|
+
*
|
|
16
|
+
* 各シェル(StandardPageShell / FunnelShell / WorkspaceShell / AdminShell /
|
|
17
|
+
* MypageShell)は本コンポーネントを DOM 先頭に標準内蔵するため、シェルを使う限り
|
|
18
|
+
* 個別ページで手組みする必要はない(`skipLink={false}` で無効化可能)。
|
|
19
|
+
*
|
|
20
|
+
* ### インポート
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { SkipLink } from '../../components/foundations/skip-link'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* ### 使い方(シェルを使わず素の DOM に置く場合)
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <SkipLink />
|
|
28
|
+
* <main id="main-content">…</main>
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* ### Props
|
|
32
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
33
|
+
* |------|-----|-----------|------|
|
|
34
|
+
* | href | string | "#main-content" | スキップ先アンカー |
|
|
35
|
+
* | label | string | "コンテンツへ移動" | リンク文言 |
|
|
36
|
+
* | className | string | — | 追加CSSクラス |
|
|
37
|
+
*/
|
|
38
|
+
declare function SkipLink({ href, label, className, ...props }: SkipLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export { SkipLink };
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
2
|
+
export interface TextareaProps extends React.ComponentProps<"textarea"> {
|
|
3
|
+
/**
|
|
4
|
+
* 文字数カウンタを表示する。`maxLength` とセットで使い、入力欄の
|
|
5
|
+
* 右下に `{現在}/{max}` を表示する。上限に達すると Text-Caution 色になる。
|
|
6
|
+
* 制御(`value`)/ 非制御(`defaultValue`)どちらでも追従する。
|
|
7
|
+
* 非制御時は実際の DOM の値を数えるため、react-hook-form の `register()` の
|
|
8
|
+
* ように `ref` 経由で外部から値が入るケースでも初期表示から正しく数える。
|
|
9
|
+
*/
|
|
10
|
+
showCount?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare function Textarea({ className, showCount, maxLength, value, defaultValue, onChange, ref, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
3
13
|
export { Textarea };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** 添付が受理されなかったときのコールバック引数。 */
|
|
2
|
+
export interface ChatComposerAttachmentError {
|
|
3
|
+
/** `max-files`: 件数上限超過 / `max-size`: サイズ上限超過 */
|
|
4
|
+
code: "max-files" | "max-size";
|
|
5
|
+
/** 受理されなかったファイル */
|
|
6
|
+
file: File;
|
|
7
|
+
/** 超過した上限値(max-files は件数、max-size は MB) */
|
|
8
|
+
limit: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ChatComposerProps {
|
|
11
|
+
/** 入力値(制御) */
|
|
12
|
+
value: string;
|
|
13
|
+
/** 入力変更(制御) */
|
|
14
|
+
onChange: (value: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* 送信。本文と添付ファイルを受け取る。
|
|
17
|
+
* 本文と添付がどちらも空のときは呼ばれない。
|
|
18
|
+
*/
|
|
19
|
+
onSubmit: (value: string, files: File[]) => void;
|
|
20
|
+
/**
|
|
21
|
+
* 送信キー。
|
|
22
|
+
* - `enter`(既定): Enter で送信 / Shift+Enter で改行
|
|
23
|
+
* - `mod-enter`: ⌘/Ctrl+Enter で送信 / Enter は改行
|
|
24
|
+
*
|
|
25
|
+
* どちらでも IME 変換確定の Enter では送信しない。
|
|
26
|
+
*/
|
|
27
|
+
submitKey?: "enter" | "mod-enter";
|
|
28
|
+
/**
|
|
29
|
+
* 添付ファイル(制御)。指定すると表示はこの値に従う。
|
|
30
|
+
* 未指定なら内部 state で保持する。
|
|
31
|
+
*/
|
|
32
|
+
attachments?: File[];
|
|
33
|
+
/** 添付が変わったときのコールバック */
|
|
34
|
+
onAttachmentsChange?: (files: File[]) => void;
|
|
35
|
+
/** 受け付ける MIME/拡張子(例: "image/*,.pdf") */
|
|
36
|
+
accept?: string;
|
|
37
|
+
/** 添付できる最大件数。超過分は受理せず onAttachmentError を呼ぶ。 */
|
|
38
|
+
maxFiles?: number;
|
|
39
|
+
/** 1ファイルあたりの上限サイズ(MB)。超過ファイルは受理せず onAttachmentError を呼ぶ。 */
|
|
40
|
+
maxSizeMb?: number;
|
|
41
|
+
/** 添付が受理されなかったときのコールバック */
|
|
42
|
+
onAttachmentError?: (error: ChatComposerAttachmentError) => void;
|
|
43
|
+
/** 無効化(入力・添付・送信すべて) */
|
|
44
|
+
disabled?: boolean;
|
|
45
|
+
/** 送信中。送信ボタンを無効化し二重送信を防ぐ。 */
|
|
46
|
+
isSubmitting?: boolean;
|
|
47
|
+
/** 入力欄のプレースホルダ */
|
|
48
|
+
placeholder?: string;
|
|
49
|
+
/** 入力欄の最大文字数。指定すると文字数カウンタを表示する。 */
|
|
50
|
+
maxLength?: number;
|
|
51
|
+
/** 入力欄の visually-hidden ラベル(スクリーンリーダー向け) */
|
|
52
|
+
label?: string;
|
|
53
|
+
/** 入力欄の初期表示行数 */
|
|
54
|
+
rows?: number;
|
|
55
|
+
/** 入力欄の id。未指定なら自動採番。 */
|
|
56
|
+
id?: string;
|
|
57
|
+
/** マウント時に入力欄へフォーカスする */
|
|
58
|
+
autoFocus?: boolean;
|
|
59
|
+
/** 追加クラス(ルート要素) */
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* ## ChatComposer / メッセージコンポーザ
|
|
64
|
+
*
|
|
65
|
+
* テキスト入力 + 添付 + 送信を1つの枠にまとめた汎用コンポーザ。
|
|
66
|
+
* チャット・問い合わせ・レビュー返信など「短文を繰り返し送る」UI に使う。
|
|
67
|
+
*
|
|
68
|
+
* 中身は DS の既存部品の組み合わせ(Textarea / FileInput / Chip / Button)で、
|
|
69
|
+
* 送信キーの挙動・添付の見せ方・送信ボタンの意匠を DS 側で標準化する。
|
|
70
|
+
*
|
|
71
|
+
* ### インポート
|
|
72
|
+
* ```tsx
|
|
73
|
+
* import { ChatComposer } from "../../components/primitives/chat-composer"
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* ### 送信キー
|
|
77
|
+
* 既定は Enter 送信 / Shift+Enter 改行。長文入力が主なら `submitKey="mod-enter"`。
|
|
78
|
+
* どちらでも **IME 変換中の Enter では送信しない**(日本語入力での誤送信防止)。
|
|
79
|
+
*
|
|
80
|
+
* ### AI 向け使用ルール
|
|
81
|
+
* - チャット入力欄を Textarea + Button で手組みしない。ChatComposer を使う
|
|
82
|
+
* - 添付は `attachments` / `onAttachmentsChange` で制御し、Chip の removable で表示される
|
|
83
|
+
* - 送信中は `isSubmitting` を立てる(送信ボタンが無効化され二重送信を防げる)
|
|
84
|
+
* - `<form>` は内包しない。フォーム内に置いても入れ子にならない
|
|
85
|
+
*/
|
|
86
|
+
declare function ChatComposer({ value, onChange, onSubmit, submitKey, attachments, onAttachmentsChange, accept, maxFiles, maxSizeMb, onAttachmentError, disabled, isSubmitting, placeholder, maxLength, label, rows, id, autoFocus, className, }: ChatComposerProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
export { ChatComposer };
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type
|
|
3
|
-
|
|
4
|
-
variant?: "filled" | "accent";
|
|
5
|
-
size?: "sm" | "lg" | "md" | "tile";
|
|
6
|
-
shape?: "square" | "pill";
|
|
7
|
-
} & import("class-variance-authority/types").ClassProp) => string;
|
|
8
|
-
export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof chipVariants> {
|
|
2
|
+
import { chipVariants, type ChipVariantProps } from "../../components/foundations/chip-variants";
|
|
3
|
+
export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, ChipVariantProps {
|
|
9
4
|
/** リンクとして使う場合のURL */
|
|
10
5
|
href?: string;
|
|
11
6
|
/** 選択状態 */
|