ksk-design-system 1.35.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/AGENTS.md +190 -0
- package/CLAUDE.md +189 -0
- package/DESIGN.md +190 -0
- package/LICENSE +21 -0
- package/MIGRATION.md +107 -0
- package/PUBLISHING.md +160 -0
- package/README.md +59 -0
- package/RELEASE.md +82 -0
- package/bin/init.js +112 -0
- package/contracts/components.json +1443 -0
- package/contracts/rules.json +447 -0
- package/dist/class-names.js +4 -0
- package/dist/index.js +13157 -0
- package/dist/native/ui.js +4928 -0
- package/dist/native.js +1559 -0
- package/dist/server-variants-Dr_V3bDI.js +55 -0
- package/dist/types/class-names.d.ts +27 -0
- package/dist/types/components/patterns/admin/bulk-actions.d.ts +17 -0
- package/dist/types/components/patterns/admin/chart-controls.d.ts +16 -0
- package/dist/types/components/patterns/admin/data-table.d.ts +165 -0
- package/dist/types/components/patterns/admin/image-uploader.d.ts +14 -0
- package/dist/types/components/patterns/admin/kebab-menu.d.ts +17 -0
- package/dist/types/components/patterns/admin/notification-list.d.ts +16 -0
- package/dist/types/components/patterns/admin/search-panel.d.ts +9 -0
- package/dist/types/components/patterns/admin/status-tabs.d.ts +13 -0
- package/dist/types/components/patterns/app-header.d.ts +76 -0
- package/dist/types/components/patterns/banner-carousel.d.ts +25 -0
- package/dist/types/components/patterns/banner.d.ts +13 -0
- package/dist/types/components/patterns/bottom-sheet-form.d.ts +17 -0
- package/dist/types/components/patterns/category-nav.d.ts +43 -0
- package/dist/types/components/patterns/category-scroll.d.ts +53 -0
- package/dist/types/components/patterns/chip-selector.d.ts +20 -0
- package/dist/types/components/patterns/chip.d.ts +42 -0
- package/dist/types/components/patterns/coach-mark-overlay.d.ts +66 -0
- package/dist/types/components/patterns/commerce/bottom-tab-bar.d.ts +27 -0
- package/dist/types/components/patterns/commerce/filter-bar.d.ts +39 -0
- package/dist/types/components/patterns/commerce/image-carousel.d.ts +14 -0
- package/dist/types/components/patterns/commerce/order-summary.d.ts +26 -0
- package/dist/types/components/patterns/commerce/price-display.d.ts +20 -0
- package/dist/types/components/patterns/commerce/product-card.d.ts +50 -0
- package/dist/types/components/patterns/commerce/product-carousel.d.ts +15 -0
- package/dist/types/components/patterns/commerce/quantity-selector.d.ts +21 -0
- package/dist/types/components/patterns/commerce/rating-display.d.ts +15 -0
- package/dist/types/components/patterns/commerce/review-card.d.ts +22 -0
- package/dist/types/components/patterns/commerce/review-summary.d.ts +12 -0
- package/dist/types/components/patterns/confirm-dialog.d.ts +32 -0
- package/dist/types/components/patterns/cookie-consent.d.ts +62 -0
- package/dist/types/components/patterns/empty-state.d.ts +15 -0
- package/dist/types/components/patterns/error-state.d.ts +10 -0
- package/dist/types/components/patterns/file-upload.d.ts +31 -0
- package/dist/types/components/patterns/filter-chip.d.ts +26 -0
- package/dist/types/components/patterns/footer.d.ts +24 -0
- package/dist/types/components/patterns/form-field.d.ts +30 -0
- package/dist/types/components/patterns/form.d.ts +13 -0
- package/dist/types/components/patterns/list-item.d.ts +23 -0
- package/dist/types/components/patterns/list-skeletons.d.ts +43 -0
- package/dist/types/components/patterns/menu-drawer.d.ts +27 -0
- package/dist/types/components/patterns/notification-badge.d.ts +15 -0
- package/dist/types/components/patterns/progress-steps.d.ts +7 -0
- package/dist/types/components/patterns/review-overlay.d.ts +25 -0
- package/dist/types/components/patterns/search-bar.d.ts +6 -0
- package/dist/types/components/patterns/section-header.d.ts +8 -0
- package/dist/types/components/patterns/share-buttons.d.ts +13 -0
- package/dist/types/components/patterns/shells/admin-shell.d.ts +8 -0
- package/dist/types/components/patterns/shells/app-shell.d.ts +7 -0
- package/dist/types/components/patterns/shells/marketing-shell.d.ts +7 -0
- package/dist/types/components/patterns/simple-pagination.d.ts +69 -0
- package/dist/types/components/patterns/stat-card.d.ts +43 -0
- package/dist/types/components/patterns/sticky-action-bar.d.ts +27 -0
- package/dist/types/components/patterns/swipe-row.d.ts +17 -0
- package/dist/types/components/patterns/tag-input.d.ts +20 -0
- package/dist/types/components/patterns/tag.d.ts +7 -0
- package/dist/types/components/ui/accordion.d.ts +7 -0
- package/dist/types/components/ui/alert-dialog.d.ts +47 -0
- package/dist/types/components/ui/alert.d.ts +45 -0
- package/dist/types/components/ui/auto-grow-textarea.d.ts +40 -0
- package/dist/types/components/ui/avatar.d.ts +6 -0
- package/dist/types/components/ui/badge.d.ts +18 -0
- package/dist/types/components/ui/breadcrumb.d.ts +16 -0
- package/dist/types/components/ui/button.d.ts +29 -0
- package/dist/types/components/ui/calendar.d.ts +5 -0
- package/dist/types/components/ui/card.d.ts +28 -0
- package/dist/types/components/ui/checkbox-card.d.ts +29 -0
- package/dist/types/components/ui/checkbox-field.d.ts +24 -0
- package/dist/types/components/ui/checkbox-group.d.ts +33 -0
- package/dist/types/components/ui/checkbox.d.ts +44 -0
- package/dist/types/components/ui/coach-mark.d.ts +27 -0
- package/dist/types/components/ui/collapsible.d.ts +24 -0
- package/dist/types/components/ui/combobox.d.ts +19 -0
- package/dist/types/components/ui/countdown-timer.d.ts +39 -0
- package/dist/types/components/ui/date-picker.d.ts +53 -0
- package/dist/types/components/ui/dialog.d.ts +54 -0
- package/dist/types/components/ui/dropdown-filter.d.ts +35 -0
- package/dist/types/components/ui/dropdown-menu.d.ts +42 -0
- package/dist/types/components/ui/error-boundary.d.ts +66 -0
- package/dist/types/components/ui/form.d.ts +61 -0
- package/dist/types/components/ui/hover-card.d.ts +24 -0
- package/dist/types/components/ui/image-gallery.d.ts +28 -0
- package/dist/types/components/ui/input.d.ts +17 -0
- package/dist/types/components/ui/label.d.ts +4 -0
- package/dist/types/components/ui/multi-select.d.ts +21 -0
- package/dist/types/components/ui/navigation-bar.d.ts +58 -0
- package/dist/types/components/ui/number-input.d.ts +20 -0
- package/dist/types/components/ui/pagination.d.ts +26 -0
- package/dist/types/components/ui/pill-toggle.d.ts +16 -0
- package/dist/types/components/ui/popover.d.ts +7 -0
- package/dist/types/components/ui/progress-ring.d.ts +31 -0
- package/dist/types/components/ui/progress.d.ts +34 -0
- package/dist/types/components/ui/radio-group.d.ts +22 -0
- package/dist/types/components/ui/responsive-dialog.d.ts +31 -0
- package/dist/types/components/ui/scroll-area.d.ts +5 -0
- package/dist/types/components/ui/select.d.ts +22 -0
- package/dist/types/components/ui/separator.d.ts +4 -0
- package/dist/types/components/ui/sheet.d.ts +139 -0
- package/dist/types/components/ui/skeleton.d.ts +31 -0
- package/dist/types/components/ui/slider.d.ts +14 -0
- package/dist/types/components/ui/social-icon-data.d.ts +10 -0
- package/dist/types/components/ui/social-icon.d.ts +38 -0
- package/dist/types/components/ui/social-login-button.d.ts +10 -0
- package/dist/types/components/ui/spinner.d.ts +22 -0
- package/dist/types/components/ui/star-rating.d.ts +12 -0
- package/dist/types/components/ui/sub-nav.d.ts +17 -0
- package/dist/types/components/ui/switch.d.ts +4 -0
- package/dist/types/components/ui/sync-status-badge.d.ts +17 -0
- package/dist/types/components/ui/tabs.d.ts +15 -0
- package/dist/types/components/ui/textarea.d.ts +8 -0
- package/dist/types/components/ui/time-picker.d.ts +14 -0
- package/dist/types/components/ui/toast.d.ts +49 -0
- package/dist/types/components/ui/tooltip.d.ts +7 -0
- package/dist/types/index.d.ts +174 -0
- package/dist/types/lib/server-variants/button-variants.d.ts +20 -0
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/native/components/Accordion.d.ts +12 -0
- package/dist/types/native/components/Alert.d.ts +9 -0
- package/dist/types/native/components/AlertDialog.d.ts +11 -0
- package/dist/types/native/components/AppHeader.d.ts +10 -0
- package/dist/types/native/components/AppShell.d.ts +13 -0
- package/dist/types/native/components/AutoGrowTextarea.d.ts +8 -0
- package/dist/types/native/components/Avatar.d.ts +8 -0
- package/dist/types/native/components/Badge.d.ts +8 -0
- package/dist/types/native/components/Banner.d.ts +10 -0
- package/dist/types/native/components/BannerCarousel.d.ts +8 -0
- package/dist/types/native/components/BottomSheetForm.d.ts +10 -0
- package/dist/types/native/components/BottomTabBar.d.ts +8 -0
- package/dist/types/native/components/Breadcrumb.d.ts +12 -0
- package/dist/types/native/components/Button.d.ts +9 -0
- package/dist/types/native/components/Calendar.d.ts +8 -0
- package/dist/types/native/components/Card.d.ts +11 -0
- package/dist/types/native/components/CategoryNav.d.ts +13 -0
- package/dist/types/native/components/CategoryScroll.d.ts +12 -0
- package/dist/types/native/components/Checkbox.d.ts +7 -0
- package/dist/types/native/components/CheckboxCard.d.ts +8 -0
- package/dist/types/native/components/CheckboxField.d.ts +8 -0
- package/dist/types/native/components/CheckboxGroup.d.ts +12 -0
- package/dist/types/native/components/Chip.d.ts +17 -0
- package/dist/types/native/components/ChipSelector.d.ts +13 -0
- package/dist/types/native/components/CoachMark.d.ts +12 -0
- package/dist/types/native/components/CoachMarkOverlay.d.ts +19 -0
- package/dist/types/native/components/Collapsible.d.ts +7 -0
- package/dist/types/native/components/Combobox.d.ts +14 -0
- package/dist/types/native/components/ConfirmDialog.d.ts +7 -0
- package/dist/types/native/components/CountdownTimer.d.ts +7 -0
- package/dist/types/native/components/DatePicker.d.ts +10 -0
- package/dist/types/native/components/Dialog.d.ts +12 -0
- package/dist/types/native/components/DropdownFilter.d.ts +12 -0
- package/dist/types/native/components/DropdownMenu.d.ts +19 -0
- package/dist/types/native/components/EmptyState.d.ts +8 -0
- package/dist/types/native/components/ErrorState.d.ts +8 -0
- package/dist/types/native/components/FileUpload.d.ts +12 -0
- package/dist/types/native/components/FilterBar.d.ts +13 -0
- package/dist/types/native/components/FilterChip.d.ts +7 -0
- package/dist/types/native/components/Footer.d.ts +9 -0
- package/dist/types/native/components/FormField.d.ts +9 -0
- package/dist/types/native/components/GlassView.d.ts +25 -0
- package/dist/types/native/components/ImageCarousel.d.ts +8 -0
- package/dist/types/native/components/ImageGallery.d.ts +7 -0
- package/dist/types/native/components/Input.d.ts +9 -0
- package/dist/types/native/components/Label.d.ts +7 -0
- package/dist/types/native/components/ListItem.d.ts +11 -0
- package/dist/types/native/components/ListSkeletons.d.ts +6 -0
- package/dist/types/native/components/MarketingShell.d.ts +9 -0
- package/dist/types/native/components/MenuDrawer.d.ts +21 -0
- package/dist/types/native/components/MultiSelect.d.ts +13 -0
- package/dist/types/native/components/NavigationBar.d.ts +18 -0
- package/dist/types/native/components/NotificationBadge.d.ts +9 -0
- package/dist/types/native/components/NumberInput.d.ts +9 -0
- package/dist/types/native/components/OrderSummary.d.ts +10 -0
- package/dist/types/native/components/Pagination.d.ts +7 -0
- package/dist/types/native/components/PillToggle.d.ts +12 -0
- package/dist/types/native/components/Popover.d.ts +14 -0
- package/dist/types/native/components/PriceDisplay.d.ts +8 -0
- package/dist/types/native/components/ProductCard.d.ts +14 -0
- package/dist/types/native/components/ProductCarousel.d.ts +11 -0
- package/dist/types/native/components/Progress.d.ts +7 -0
- package/dist/types/native/components/ProgressRing.d.ts +12 -0
- package/dist/types/native/components/ProgressSteps.d.ts +9 -0
- package/dist/types/native/components/QuantitySelector.d.ts +6 -0
- package/dist/types/native/components/RadioGroup.d.ts +13 -0
- package/dist/types/native/components/RatingDisplay.d.ts +7 -0
- package/dist/types/native/components/ResponsiveDialog.d.ts +7 -0
- package/dist/types/native/components/ReviewCard.d.ts +11 -0
- package/dist/types/native/components/ReviewOverlay.d.ts +7 -0
- package/dist/types/native/components/ReviewSummary.d.ts +7 -0
- package/dist/types/native/components/ScrollArea.d.ts +9 -0
- package/dist/types/native/components/SearchBar.d.ts +9 -0
- package/dist/types/native/components/SectionHeader.d.ts +10 -0
- package/dist/types/native/components/Select.d.ts +14 -0
- package/dist/types/native/components/Separator.d.ts +5 -0
- package/dist/types/native/components/ShareButtons.d.ts +11 -0
- package/dist/types/native/components/Sheet.d.ts +20 -0
- package/dist/types/native/components/SimplePagination.d.ts +7 -0
- package/dist/types/native/components/Skeleton.d.ts +11 -0
- package/dist/types/native/components/Slider.d.ts +9 -0
- package/dist/types/native/components/SocialIcon.d.ts +12 -0
- package/dist/types/native/components/SocialLoginButton.d.ts +8 -0
- package/dist/types/native/components/Spinner.d.ts +6 -0
- package/dist/types/native/components/Stack.d.ts +13 -0
- package/dist/types/native/components/StarRating.d.ts +9 -0
- package/dist/types/native/components/StatCard.d.ts +7 -0
- package/dist/types/native/components/StickyActionBar.d.ts +6 -0
- package/dist/types/native/components/SubNav.d.ts +12 -0
- package/dist/types/native/components/SwipeRow.d.ts +14 -0
- package/dist/types/native/components/Switch.d.ts +4 -0
- package/dist/types/native/components/SyncStatusBadge.d.ts +6 -0
- package/dist/types/native/components/Tabs.d.ts +23 -0
- package/dist/types/native/components/Tag.d.ts +10 -0
- package/dist/types/native/components/TagInput.d.ts +7 -0
- package/dist/types/native/components/Text.d.ts +10 -0
- package/dist/types/native/components/Textarea.d.ts +7 -0
- package/dist/types/native/components/TimePicker.d.ts +12 -0
- package/dist/types/native/components/Toast.d.ts +18 -0
- package/dist/types/native/components/index.d.ts +99 -0
- package/dist/types/native/components/social-icon-data.d.ts +5 -0
- package/dist/types/native/index.d.ts +4 -0
- package/dist/types/native/theme/ThemeProvider.d.ts +21 -0
- package/dist/types/native/typography.d.ts +8 -0
- package/dist/types/tokens/native/index.d.ts +13 -0
- package/dist/types/tokens/native/primitives.d.ts +116 -0
- package/dist/types/tokens/native/scales.d.ts +270 -0
- package/dist/types/tokens/native/themes.d.ts +1147 -0
- package/eslint/deprecated.js +104 -0
- package/eslint/no-colorless-border.js +217 -0
- package/package.json +215 -0
- package/scripts/codemod/README.md +51 -0
- package/scripts/codemod/template.mjs +164 -0
- package/src/components/COMPONENT_LOOKUP.md +190 -0
- package/src/preset.css +168 -0
- package/src/styles/categorical.css +161 -0
- package/src/styles/glass.css +365 -0
- package/src/styles/primitive.css +161 -0
- package/src/styles/semantic.css +247 -0
- package/src/styles/typography.css +140 -0
- package/src/themes/README.md +44 -0
- package/src/themes/blue.css +21 -0
- package/src/themes/default.css +12 -0
- package/src/themes/green.css +22 -0
- package/src/themes/orange.css +21 -0
- package/src/themes/violet.css +22 -0
- package/templates/AGENTS.md +77 -0
- package/templates/CLAUDE.md +77 -0
- package/tokens.json +607 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const cardVariants: (props?: {
|
|
4
|
+
variant?: "default" | "media";
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) => string;
|
|
6
|
+
interface CardProps extends React.ComponentProps<"div">, VariantProps<typeof cardVariants> {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Card — 情報をまとめる汎用カード。
|
|
10
|
+
*
|
|
11
|
+
* バリアント:
|
|
12
|
+
* - `default`: `p-6` + `gap-6`。情報を持つカード(テキスト / ボタン構成)。
|
|
13
|
+
* - `media`: padding/gap なし。サムネを端まで広げる用途。オーバーレイ配置時に。
|
|
14
|
+
*
|
|
15
|
+
* 構成パーツ: `CardHeader` / `CardTitle` / `CardDescription` / `CardAction` /
|
|
16
|
+
* `CardContent` / `CardFooter`。`@container` クエリで内部レスポンシブ。
|
|
17
|
+
*
|
|
18
|
+
* Note: 商品の表示は `ProductCard`(patterns/commerce)を使う。
|
|
19
|
+
*/
|
|
20
|
+
declare function Card({ className, variant, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { Card, CardHeader, CardTitle, CardDescription, CardAction, CardContent, CardFooter, cardVariants };
|
|
28
|
+
export type { CardProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
3
|
+
/**
|
|
4
|
+
* CheckboxCardGroup / CheckboxCardItem — カード型チェックボックス
|
|
5
|
+
*
|
|
6
|
+
* 複数選択のカード型 UI に使用。単一選択には RadioGroup を使用。
|
|
7
|
+
*
|
|
8
|
+
* ### 使用例
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <CheckboxCardGroup>
|
|
11
|
+
* <CheckboxCardItem description="月500円">ライトプラン</CheckboxCardItem>
|
|
12
|
+
* <CheckboxCardItem description="月1,000円" badge={<Badge>人気</Badge>}>
|
|
13
|
+
* スタンダードプラン
|
|
14
|
+
* </CheckboxCardItem>
|
|
15
|
+
* </CheckboxCardGroup>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare function CheckboxCardGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function CheckboxCardItem({ className, children, description, expandedContent, badge, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root> & {
|
|
20
|
+
/** ラベルテキスト */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
/** 補足説明テキスト */
|
|
23
|
+
description?: React.ReactNode;
|
|
24
|
+
/** 選択時に展開表示するコンテンツ */
|
|
25
|
+
expandedContent?: React.ReactNode;
|
|
26
|
+
/** タグバッジ(例: "20%OFF") */
|
|
27
|
+
badge?: React.ReactNode;
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { CheckboxCardGroup, CheckboxCardItem };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
3
|
+
export interface CheckboxFieldProps extends React.ComponentProps<typeof CheckboxPrimitive.Root> {
|
|
4
|
+
/** インラインラベル(同意文・確認文など)。リンク等の ReactNode 可。 */
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
/** ラベル下の補足説明。 */
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
/** エラーメッセージ。指定時は aria-invalid + Caution 色で表示。 */
|
|
9
|
+
error?: string;
|
|
10
|
+
/** 外側コンテナのクラス(チェックボックス本体の整列スタイルは固定)。 */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* CheckboxField — フォーム内の単体チェックボックス(同意 / 確認用)。
|
|
15
|
+
*
|
|
16
|
+
* filter・設定行用の `<Checkbox label>`(hover 背景・行 padding・件数バッジ付き)とは
|
|
17
|
+
* 役割が別。フォームフィールドとして「チェック + インラインラベル + 任意の説明 / エラー」を
|
|
18
|
+
* DS 正準の縦整列(typo-body-md の行高 24.5px に 20px チェックを mt-0.5 で中央化)で出す。
|
|
19
|
+
* ラベルが折り返しても items-start で先頭行に整列する。
|
|
20
|
+
*
|
|
21
|
+
* 目的: checkbox と label を画面側で手組みして mt / 行高がズレるのを防ぐ正準コンポーネント。
|
|
22
|
+
*/
|
|
23
|
+
declare function CheckboxField({ label, description, error, className, id, ...props }: CheckboxFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export { CheckboxField };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
3
|
+
/**
|
|
4
|
+
* CheckboxGroup / CheckboxGroupItem — チェックボックスグループ
|
|
5
|
+
*
|
|
6
|
+
* 複数のチェックボックスをグリッドレイアウト + ラベル + エラー表示付きでまとめるラッパー。
|
|
7
|
+
*
|
|
8
|
+
* ### 使用例
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <CheckboxGroup label="配送方法" required columns={2}>
|
|
11
|
+
* <CheckboxGroupItem value="standard">通常配送</CheckboxGroupItem>
|
|
12
|
+
* <CheckboxGroupItem value="express" description="翌日届く">
|
|
13
|
+
* 速達配送
|
|
14
|
+
* </CheckboxGroupItem>
|
|
15
|
+
* </CheckboxGroup>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface CheckboxGroupProps {
|
|
19
|
+
label: string;
|
|
20
|
+
required?: boolean;
|
|
21
|
+
helpText?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
/** グリッドカラム数(デフォルト: 2) */
|
|
24
|
+
columns?: number;
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
declare function CheckboxGroup({ label, required, helpText, error, columns, children, className, }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function CheckboxGroupItem({ className, children, description, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root> & {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
description?: React.ReactNode;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { CheckboxGroup, CheckboxGroupItem };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Checkbox as CheckboxPrimitive } from "radix-ui";
|
|
3
|
+
type CheckboxRootProps = React.ComponentProps<typeof CheckboxPrimitive.Root>;
|
|
4
|
+
export interface CheckboxProps extends CheckboxRootProps {
|
|
5
|
+
/**
|
|
6
|
+
* 文字列または ReactNode を渡すと、Checkbox を `<label>` でラップして
|
|
7
|
+
* 行型レイアウトに切り替える。filter sidebar / 設定画面で典型的な
|
|
8
|
+
* 「行全体クリッカブル」パターン。未指定なら従来通り素のチェックボックス
|
|
9
|
+
* (外側で Label と組み合わせる使い方も継続可能)。
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode;
|
|
12
|
+
/** サブテキスト(label 指定時のみ有効) */
|
|
13
|
+
description?: React.ReactNode;
|
|
14
|
+
/** 右端に表示する件数バッジ(label 指定時のみ有効) */
|
|
15
|
+
count?: number;
|
|
16
|
+
/** label モード時の行コンテナに付けるクラス */
|
|
17
|
+
containerClassName?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Checkbox — チェックボックス
|
|
21
|
+
*
|
|
22
|
+
* 2 つの使い方:
|
|
23
|
+
*
|
|
24
|
+
* 1. **素の Checkbox** — `label` を渡さない場合
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Checkbox checked={...} onCheckedChange={...} />
|
|
27
|
+
* ```
|
|
28
|
+
* 外側で `<Label>` や `<FormField>` と組み合わせて使う。
|
|
29
|
+
*
|
|
30
|
+
* 2. **行型レイアウト** — `label` を渡すと自動で `<label>` ラップ + 行全体 hover
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <Checkbox
|
|
33
|
+
* label="正社員"
|
|
34
|
+
* count={1234}
|
|
35
|
+
* checked={...}
|
|
36
|
+
* onCheckedChange={...}
|
|
37
|
+
* />
|
|
38
|
+
* ```
|
|
39
|
+
* filter sidebar / 設定画面の典型パターン。行全体クリッカブル、hover で背景強調。
|
|
40
|
+
*
|
|
41
|
+
* カード型の選択肢には `CheckboxCard` を使用。
|
|
42
|
+
*/
|
|
43
|
+
declare function Checkbox({ label, description, count, containerClassName, className, id, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export { Checkbox };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type CoachMarkPlacement = "top" | "bottom" | "left" | "right";
|
|
3
|
+
type CoachMarkVariant = "default" | "brand";
|
|
4
|
+
interface CoachMarkProps {
|
|
5
|
+
/** バルーンに表示するコンテンツ */
|
|
6
|
+
content: React.ReactNode;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
placement?: CoachMarkPlacement;
|
|
9
|
+
variant?: CoachMarkVariant;
|
|
10
|
+
/** 制御モード: open を外から制御 */
|
|
11
|
+
open?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/** ステップ番号(オンボーディング用) */
|
|
14
|
+
step?: number;
|
|
15
|
+
/** 合計ステップ数 */
|
|
16
|
+
totalSteps?: number;
|
|
17
|
+
/** 次へボタンクリック */
|
|
18
|
+
onNext?: () => void;
|
|
19
|
+
/** 閉じるボタン表示 */
|
|
20
|
+
showClose?: boolean;
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
delayDuration?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
declare function CoachMark({ content, children, placement, variant, open, onOpenChange, step, totalSteps, onNext, showClose, onClose, delayDuration, className, }: CoachMarkProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export { CoachMark };
|
|
27
|
+
export type { CoachMarkProps, CoachMarkPlacement, CoachMarkVariant };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Collapsible as CollapsiblePrimitive } from "radix-ui";
|
|
3
|
+
/**
|
|
4
|
+
* Collapsible — 折りたたみパネル
|
|
5
|
+
*
|
|
6
|
+
* トリガーでコンテンツを表示/非表示に切り替える低レベルプリミティブ。
|
|
7
|
+
* アコーディオンと異なり単独の折りたたみに使用。
|
|
8
|
+
*
|
|
9
|
+
* ### 使用例
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Collapsible>
|
|
12
|
+
* <CollapsibleTrigger asChild>
|
|
13
|
+
* <Button variant="ghost">詳細を表示</Button>
|
|
14
|
+
* </CollapsibleTrigger>
|
|
15
|
+
* <CollapsibleContent>
|
|
16
|
+
* <p>折りたたまれたコンテンツ</p>
|
|
17
|
+
* </CollapsibleContent>
|
|
18
|
+
* </Collapsible>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function CollapsibleTrigger({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function CollapsibleContent({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ComboboxOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface ComboboxProps {
|
|
7
|
+
options: ComboboxOption[];
|
|
8
|
+
value?: string;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
searchPlaceholder?: string;
|
|
12
|
+
emptyLabel?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
/** トリガーボタンの aria-label */
|
|
16
|
+
triggerLabel?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyLabel, disabled, className, triggerLabel, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export { Combobox };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type Granularity = "day" | "hour" | "minute" | "second";
|
|
2
|
+
interface CountdownTimerProps {
|
|
3
|
+
/** カウントダウン先の日時 */
|
|
4
|
+
targetDate: Date;
|
|
5
|
+
/**
|
|
6
|
+
* 表示粒度(既定 "second")。
|
|
7
|
+
* - "day" : 日のみ表示 (結婚式 / 旅行 / 出産予定日まで N 日)。1日1回ペースで再計算。
|
|
8
|
+
* - "hour" : 時間まで (1分ごとに再計算)
|
|
9
|
+
* - "minute": 分まで (秒ごとに再計算)
|
|
10
|
+
* - "second": 秒まで (旧デフォルト、競技的カウントダウン)
|
|
11
|
+
*/
|
|
12
|
+
granularity?: Granularity;
|
|
13
|
+
/** ラベルテキスト(カウント中、既定 "残り") */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** 終了時テキスト(既定 "受付終了") */
|
|
16
|
+
endedLabel?: string;
|
|
17
|
+
/** 当日 (残り 0 日) 時のテキスト。granularity="day" で使用(既定 "本日") */
|
|
18
|
+
todayLabel?: string;
|
|
19
|
+
variant?: "filled" | "ghost";
|
|
20
|
+
/** [hh:mm:ss モードのみ] 時間を非表示にして 分:秒 のみ表示 */
|
|
21
|
+
compact?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
onEnd?: () => void;
|
|
24
|
+
/** 日単位ラベル。granularity="day" で使用。@default "日" */
|
|
25
|
+
dayUnit?: string;
|
|
26
|
+
/** 時間単位ラベル。@default "時間" */
|
|
27
|
+
hourUnit?: string;
|
|
28
|
+
/** 分単位ラベル。@default "分" */
|
|
29
|
+
minuteUnit?: string;
|
|
30
|
+
/** 秒単位ラベル。@default "秒" */
|
|
31
|
+
secondUnit?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* CountdownTimer — granularity に応じて day / time モードを描画。
|
|
35
|
+
* 各モードを別コンポーネントに分け、hooks を常に同じ順序で呼ぶ(Rules of Hooks 準拠)。
|
|
36
|
+
*/
|
|
37
|
+
declare function CountdownTimer(props: CountdownTimerProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export { CountdownTimer };
|
|
39
|
+
export type { CountdownTimerProps };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
interface DatePickerProps {
|
|
2
|
+
value?: Date;
|
|
3
|
+
onChange?: (date: Date | undefined) => void;
|
|
4
|
+
/**
|
|
5
|
+
* トリガーボタンのプレースホルダーテキスト。
|
|
6
|
+
* i18n 対応: 英語では "Select date"、日本語では "日付を選択" を渡す。
|
|
7
|
+
* @default "日付を選択"
|
|
8
|
+
*/
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
dateFormat?: string;
|
|
13
|
+
/**
|
|
14
|
+
* トリガーボタンのアクセシビリティラベル。
|
|
15
|
+
* カレンダーポップアップを開くボタンの読み上げテキスト。
|
|
16
|
+
* @default placeholder と同じ値
|
|
17
|
+
*/
|
|
18
|
+
triggerLabel?: string;
|
|
19
|
+
}
|
|
20
|
+
declare function DatePicker({ value, onChange, placeholder, disabled, className, dateFormat, triggerLabel, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
interface DateRangePickerProps {
|
|
22
|
+
value?: {
|
|
23
|
+
from?: Date;
|
|
24
|
+
to?: Date;
|
|
25
|
+
};
|
|
26
|
+
onChange?: (range: {
|
|
27
|
+
from?: Date;
|
|
28
|
+
to?: Date;
|
|
29
|
+
} | undefined) => void;
|
|
30
|
+
/**
|
|
31
|
+
* トリガーボタンのプレースホルダーテキスト。
|
|
32
|
+
* @default "期間を選択"
|
|
33
|
+
*/
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
/**
|
|
36
|
+
* 開始日フィールドのプレースホルダー(分割レイアウト用)。
|
|
37
|
+
* @default "開始日"
|
|
38
|
+
*/
|
|
39
|
+
fromPlaceholder?: string;
|
|
40
|
+
/**
|
|
41
|
+
* 終了日フィールドのプレースホルダー(分割レイアウト用)。
|
|
42
|
+
* @default "終了日"
|
|
43
|
+
*/
|
|
44
|
+
toPlaceholder?: string;
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
className?: string;
|
|
47
|
+
dateFormat?: string;
|
|
48
|
+
/** アクセシビリティラベル */
|
|
49
|
+
triggerLabel?: string;
|
|
50
|
+
}
|
|
51
|
+
declare function DateRangePicker({ value, onChange, placeholder, disabled, className, dateFormat, triggerLabel, }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export { DatePicker, DateRangePicker };
|
|
53
|
+
export type { DatePickerProps, DateRangePickerProps };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
|
+
declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive.Content> {
|
|
9
|
+
/**
|
|
10
|
+
* デフォルトの内側余白とセクション間レイアウトを制御。
|
|
11
|
+
* - true(既定): p-6 + `flex flex-col gap-4` を付与。ヘッダ/本文/フッタが
|
|
12
|
+
* 16px 間隔で縦に並ぶ(AlertDialog と同じ挙動)。本文セクションを
|
|
13
|
+
* 持たない確認ダイアログでも、ヘッダとフッタが詰まらない。
|
|
14
|
+
* - false : 余白・レイアウトを一切付与しない(素の要素)。タブ/スクロール
|
|
15
|
+
* 本体/固定フッタの3段構成など、内側を自前でレイアウトする
|
|
16
|
+
* 複雑モーダル向け。
|
|
17
|
+
*/
|
|
18
|
+
padding?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Optional screen-reader description for the dialog.
|
|
21
|
+
* - string / ReactNode: 自動で sr-only な <DialogDescription> を
|
|
22
|
+
* レンダリングし、`aria-describedby` に紐付ける
|
|
23
|
+
* - undefined(既定): `aria-describedby={undefined}` を明示して
|
|
24
|
+
* Radix の "Missing Description" 警告を抑制。description が
|
|
25
|
+
* 概念上不要なダイアログ用。
|
|
26
|
+
* 可視の description を出したい場合は、この prop を使わず子要素として
|
|
27
|
+
* `<DialogDescription>` を直接置く。
|
|
28
|
+
*/
|
|
29
|
+
description?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* 縦位置。
|
|
32
|
+
* - "center" (既定): 画面中央
|
|
33
|
+
* - "top": 上部寄せ (safe-area-inset-top + 2rem 下) — モバイルで縦長
|
|
34
|
+
* コンテンツ (チェックリスト等) を出すときに、コンテンツが
|
|
35
|
+
* スクロールしやすく操作しやすい
|
|
36
|
+
*/
|
|
37
|
+
position?: "center" | "top";
|
|
38
|
+
}
|
|
39
|
+
declare function DialogContent({ className, children, padding, description, position, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function DialogFooter({ className, orientation, ...props }: React.ComponentProps<"div"> & {
|
|
42
|
+
/**
|
|
43
|
+
* アクションボタンの並べ方。
|
|
44
|
+
* - "split"(既定): 均等幅で横並び(各ボタン flex-1)。2 ボタンを 50/50 で
|
|
45
|
+
* 並べる iOS 風レイアウト。モバイルでも横並びのまま。
|
|
46
|
+
* - "stacked": 旧挙動。モバイルは縦積み、sm 以上で右寄せ横並び(hug 幅)。
|
|
47
|
+
* 3 つ以上のアクションや、右寄せにしたいフォーム系ダイアログで使う。
|
|
48
|
+
*/
|
|
49
|
+
orientation?: "split" | "stacked";
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
|
|
54
|
+
export type { DialogContentProps };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface DropdownFilterOption<K extends string = string> {
|
|
3
|
+
key: K;
|
|
4
|
+
label: string;
|
|
5
|
+
/**
|
|
6
|
+
* label の左に表示する任意アイコン(iconsax 等)。色は currentColor を継承するため
|
|
7
|
+
* チップ active 時は自動で白抜きになる。サイズは要素側で指定すること(例: `<Element3 size={16} />`)。
|
|
8
|
+
* チップ(選択中 option)と選択肢リストの両方に表示される。未指定ならテキストのみ=従来挙動。
|
|
9
|
+
*/
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface DropdownFilterProps<K extends string = string> {
|
|
13
|
+
label: string;
|
|
14
|
+
value: K | "all";
|
|
15
|
+
options: DropdownFilterOption<K>[];
|
|
16
|
+
onSelect: (key: K | "all") => void;
|
|
17
|
+
/** "すべて" オプションを非表示にする */
|
|
18
|
+
hideAll?: boolean;
|
|
19
|
+
allLabel?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 選択 key を表示用テキストに変換する (例: enum key → 日本語ラベル)。
|
|
22
|
+
* 未指定なら options から label を引く。
|
|
23
|
+
*/
|
|
24
|
+
getDisplayLabel?: (key: K) => string;
|
|
25
|
+
/** 選択中は値のみ表示 (例: "カテゴリ別")。プレフィックス "ラベル: " を省略。 */
|
|
26
|
+
valueOnly?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* この値と一致するときは「未絞り込み」扱いとし、active 色を当てずラベルだけ表示する。
|
|
29
|
+
* 例: "追加順" を pristine とすれば、追加順のときは「並び替え」と表示し pristine 配色に。
|
|
30
|
+
*/
|
|
31
|
+
pristineValue?: K;
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
declare function DropdownFilter<K extends string = string>({ label, value, options, onSelect, hideAll, allLabel, getDisplayLabel, valueOnly, pristineValue, className, }: DropdownFilterProps<K>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export { DropdownFilter };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
/**
|
|
4
|
+
* DropdownMenu — ドロップダウンメニュー
|
|
5
|
+
*
|
|
6
|
+
* ### 使用例
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <DropdownMenu>
|
|
9
|
+
* <DropdownMenuTrigger asChild>
|
|
10
|
+
* <Button variant="ghost">メニュー</Button>
|
|
11
|
+
* </DropdownMenuTrigger>
|
|
12
|
+
* <DropdownMenuContent>
|
|
13
|
+
* <DropdownMenuItem>編集</DropdownMenuItem>
|
|
14
|
+
* <DropdownMenuSeparator />
|
|
15
|
+
* <DropdownMenuItem variant="destructive">削除</DropdownMenuItem>
|
|
16
|
+
* </DropdownMenuContent>
|
|
17
|
+
* </DropdownMenu>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
26
|
+
inset?: boolean;
|
|
27
|
+
variant?: "default" | "destructive";
|
|
28
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
33
|
+
inset?: boolean;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
39
|
+
inset?: boolean;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface ErrorBoundaryLabels {
|
|
3
|
+
/** ヒーロー絵文字 / アイコン代わり。既定 "😢" */
|
|
4
|
+
emoji?: string;
|
|
5
|
+
/** タイトル。既定 "Something went wrong" */
|
|
6
|
+
title?: string;
|
|
7
|
+
/** 説明文。既定 "Your data is safe. Use the buttons below to recover." */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** リロードボタン。既定 "Reload" */
|
|
10
|
+
reloadLabel?: string;
|
|
11
|
+
/** リセット (再試行) ボタン。onReset 指定時のみ表示。既定 "Try again" */
|
|
12
|
+
resetLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ErrorBoundaryProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** fallback 内で使う文言。i18n はアプリ側で解決して string を渡す。 */
|
|
17
|
+
labels?: ErrorBoundaryLabels;
|
|
18
|
+
/**
|
|
19
|
+
* onError コールバック。logger / error tracking 連携用。
|
|
20
|
+
* dev では console.error が常に呼ばれる (NODE_ENV !== "production")。
|
|
21
|
+
*/
|
|
22
|
+
onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
|
|
23
|
+
/**
|
|
24
|
+
* 指定すると fallback に "再試行" ボタンが出る。クリックで catch 状態
|
|
25
|
+
* (hasError) をリセットし、子をもう一度マウントする。
|
|
26
|
+
* 未指定なら reload ボタンのみ。
|
|
27
|
+
*/
|
|
28
|
+
onReset?: () => void;
|
|
29
|
+
/** 完全カスタム fallback を渡したい場合 (labels より優先) */
|
|
30
|
+
fallback?: React.ReactNode | ((error: Error | null, reset: () => void) => React.ReactNode);
|
|
31
|
+
/** fallback 外枠の追加 className */
|
|
32
|
+
className?: string;
|
|
33
|
+
}
|
|
34
|
+
interface ErrorBoundaryState {
|
|
35
|
+
hasError: boolean;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* ErrorBoundary — React の componentDidCatch をラップした汎用フォールバック。
|
|
40
|
+
*
|
|
41
|
+
* - labels prop で i18n 上書き
|
|
42
|
+
* - onError で logger / Sentry 等への連携
|
|
43
|
+
* - onReset 指定で「再試行」ボタンを表示 (hasError をリセットして再マウント)
|
|
44
|
+
* - fallback prop で完全カスタムレンダリングも可
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* <ErrorBoundary
|
|
48
|
+
* labels={{
|
|
49
|
+
* title: t("errors.generic_title"),
|
|
50
|
+
* description: t("errors.unexpected_reload"),
|
|
51
|
+
* reloadLabel: t("errors.reload"),
|
|
52
|
+
* }}
|
|
53
|
+
* onError={(e, info) => reportToSentry(e, info)}
|
|
54
|
+
* >
|
|
55
|
+
* <App />
|
|
56
|
+
* </ErrorBoundary>
|
|
57
|
+
*/
|
|
58
|
+
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
59
|
+
constructor(props: ErrorBoundaryProps);
|
|
60
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
61
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
62
|
+
handleReset: () => void;
|
|
63
|
+
handleReload: () => void;
|
|
64
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>> | import("react/jsx-runtime").JSX.Element;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { Label as LabelPrimitive } from "radix-ui";
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
4
|
+
import { type ControllerProps, type FieldPath, type FieldValues } from "react-hook-form";
|
|
5
|
+
/**
|
|
6
|
+
* Form — react-hook-form 統合フォームラッパー
|
|
7
|
+
*
|
|
8
|
+
* FormProvider のラッパー。useForm() の戻り値を渡すことで、
|
|
9
|
+
* ネストされた FormField が自動的にフォーム状態にアクセスできる。
|
|
10
|
+
*
|
|
11
|
+
* ### 使用例
|
|
12
|
+
* ```tsx
|
|
13
|
+
* const form = useForm<z.infer<typeof schema>>({ resolver: zodResolver(schema) })
|
|
14
|
+
*
|
|
15
|
+
* <Form {...form}>
|
|
16
|
+
* <form onSubmit={form.handleSubmit(onSubmit)}>
|
|
17
|
+
* <FormField
|
|
18
|
+
* control={form.control}
|
|
19
|
+
* name="email"
|
|
20
|
+
* render={({ field }) => (
|
|
21
|
+
* <FormItem>
|
|
22
|
+
* <FormLabel>メールアドレス</FormLabel>
|
|
23
|
+
* <FormControl>
|
|
24
|
+
* <Input placeholder="example@email.com" {...field} />
|
|
25
|
+
* </FormControl>
|
|
26
|
+
* <FormMessage />
|
|
27
|
+
* </FormItem>
|
|
28
|
+
* )}
|
|
29
|
+
* />
|
|
30
|
+
* <Button type="submit">送信</Button>
|
|
31
|
+
* </form>
|
|
32
|
+
* </Form>
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* ### AI 向け使用ルール
|
|
36
|
+
* - react-hook-form + zod での使用を推奨
|
|
37
|
+
* - FormControl でラップしたコンポーネントに自動的に aria-describedby / aria-invalid が付与される
|
|
38
|
+
* - FormMessage はエラー時のみ表示される
|
|
39
|
+
*/
|
|
40
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: import("react-hook-form").FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
41
|
+
declare function FormField<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare const useFormField: () => {
|
|
43
|
+
invalid: boolean;
|
|
44
|
+
isDirty: boolean;
|
|
45
|
+
isTouched: boolean;
|
|
46
|
+
isValidating: boolean;
|
|
47
|
+
error?: import("react-hook-form").FieldError;
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
formItemId: string;
|
|
51
|
+
formDescriptionId: string;
|
|
52
|
+
formMessageId: string;
|
|
53
|
+
};
|
|
54
|
+
declare function FormItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
declare function FormLabel({ className, required, children, ...props }: React.ComponentProps<typeof LabelPrimitive.Root> & {
|
|
56
|
+
required?: boolean;
|
|
57
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
declare function FormControl({ ...props }: React.ComponentProps<typeof Slot>): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
declare function FormDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
declare function FormMessage({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
3
|
+
/**
|
|
4
|
+
* HoverCard — ホバー情報カード
|
|
5
|
+
*
|
|
6
|
+
* トリガー要素にホバーしたとき詳細情報をポップアップ表示する。
|
|
7
|
+
* ユーザープロフィールのプレビューや補足説明に使用。
|
|
8
|
+
*
|
|
9
|
+
* ### 使用例
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <HoverCard>
|
|
12
|
+
* <HoverCardTrigger asChild>
|
|
13
|
+
* <Button variant="link">@username</Button>
|
|
14
|
+
* </HoverCardTrigger>
|
|
15
|
+
* <HoverCardContent>
|
|
16
|
+
* <p>プロフィール詳細...</p>
|
|
17
|
+
* </HoverCardContent>
|
|
18
|
+
* </HoverCard>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function HoverCard({ openDelay, closeDelay, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
declare function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface GalleryImage {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ImageGalleryProps {
|
|
6
|
+
images: GalleryImage[];
|
|
7
|
+
indicatorType?: "thumbnail" | "dot";
|
|
8
|
+
aspectRatio?: "square" | "4/3" | "16/9" | "3/4";
|
|
9
|
+
onImageClick?: (index: number) => void;
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* 前の画像ボタンの aria-label。i18n 対応: 英語では "Previous image" を渡す。@default "前の画像"
|
|
13
|
+
*/
|
|
14
|
+
prevLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 次の画像ボタンの aria-label。i18n 対応: 英語では "Next image" を渡す。@default "次の画像"
|
|
17
|
+
*/
|
|
18
|
+
nextLabel?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 画像インデックスラベル生成関数。サムネイル / ドットの aria-label と alt テキストに使用。
|
|
21
|
+
* i18n 対応: 英語では `(i) => \`Image ${i + 1}\`` を渡す。
|
|
22
|
+
* @default (i) => `画像 ${i + 1}`
|
|
23
|
+
*/
|
|
24
|
+
imageLabel?: (index: number) => string;
|
|
25
|
+
}
|
|
26
|
+
declare function ImageGallery({ images, indicatorType, aspectRatio, onImageClick, className, prevLabel, nextLabel, imageLabel, }: ImageGalleryProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export { ImageGallery };
|
|
28
|
+
export type { ImageGalleryProps, GalleryImage };
|