@cakejp/design-system 0.7.0 → 0.9.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 +44 -0
- package/CLAUDE.md +2 -0
- package/contracts/components.json +112 -10
- package/contracts/composition.json +135 -0
- package/contracts/screen-patterns.json +224 -0
- package/dist/index.css +1 -1
- package/dist/index.js +2698 -2232
- package/dist/types/components/ec/admin-layout.d.ts +8 -1
- package/dist/types/components/{pages/cake/_mypage-shell.d.ts → ec/mypage-shell.d.ts} +1 -1
- package/dist/types/components/primitives/admin-header.d.ts +29 -0
- package/dist/types/components/primitives/admin-side-nav.d.ts +67 -0
- package/dist/types/components/primitives/category-scroll.d.ts +1 -1
- package/dist/types/components/primitives/ec-page-shell.d.ts +47 -0
- package/dist/types/components/primitives/filter-bar.d.ts +1 -1
- package/dist/types/components/primitives/funnel-shell.d.ts +52 -0
- package/dist/types/components/primitives/section-nav.d.ts +60 -0
- package/dist/types/components/primitives/workspace-layout.d.ts +42 -0
- package/dist/types/index.d.ts +17 -3
- package/package.json +3 -2
- package/templates/CLAUDE.md +2 -0
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* AdminLayout — 管理画面の共通レイアウト
|
|
3
3
|
*
|
|
4
4
|
* 本番の shop_layout.ctp を参考に、Header + SideNav + Main Content の構造を再現。
|
|
5
|
+
* 汎用の枠は primitives(AdminSideNav / AdminHeader)に切り出し、
|
|
6
|
+
* Cake.jp 管理メニュー等のドメイン既定値はこの ec レイヤーで束ねる。
|
|
5
7
|
* 参照元:
|
|
6
8
|
* - admin-test-htdocs/app/views/layouts/shop_layout.ctp
|
|
7
9
|
* - admin-test-htdocs/app/views/elements/shop_layout/header.ctp
|
|
@@ -9,6 +11,7 @@
|
|
|
9
11
|
* - CSS: admin_shops/layout/nav_layout.css
|
|
10
12
|
*/
|
|
11
13
|
import * as React from "react";
|
|
14
|
+
import { type AdminNavItem } from "../../components/primitives/admin-side-nav";
|
|
12
15
|
export declare function MissingComponent({ name, children, className, }: {
|
|
13
16
|
name: string;
|
|
14
17
|
children: React.ReactNode;
|
|
@@ -27,5 +30,9 @@ export interface AdminLayoutProps {
|
|
|
27
30
|
}[];
|
|
28
31
|
/** ショップ名 */
|
|
29
32
|
shopName?: string;
|
|
33
|
+
/** サイドナビ項目(既定=Cake.jp 管理メニュー。利用側で差し替え可) */
|
|
34
|
+
navItems?: AdminNavItem[];
|
|
35
|
+
/** ヘッダー右側のアクション slot(既定=通知ベル+プロフィール) */
|
|
36
|
+
headerActions?: React.ReactNode;
|
|
30
37
|
}
|
|
31
|
-
export declare function AdminLayout({ children, activeNav, title, breadcrumbs, shopName, }: AdminLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function AdminLayout({ children, activeNav, title, breadcrumbs, shopName, navItems, headerActions, }: AdminLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* 上記の例外は意図的な別パターンなのでこのシェルを使わない。
|
|
19
19
|
*/
|
|
20
20
|
import React from "react";
|
|
21
|
-
import { type BottomTabBarItem } from "
|
|
21
|
+
import { type BottomTabBarItem } from "../../components/primitives/bottom-tab-bar";
|
|
22
22
|
export interface MypageShellBreadcrumb {
|
|
23
23
|
label: string;
|
|
24
24
|
href?: string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AdminHeaderProps {
|
|
3
|
+
/** ヘッダー左側に表示するブランド/タイトル(文言合成は利用側の責務) */
|
|
4
|
+
brand?: React.ReactNode;
|
|
5
|
+
/** SP ハンバーガー押下ハンドラ(省略時はハンバーガー非表示) */
|
|
6
|
+
onMenuClick?: () => void;
|
|
7
|
+
/** ヘッダー右側のアクション slot(通知ベル・プロフィール等) */
|
|
8
|
+
actions?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 管理画面向け固定ヘッダー
|
|
12
|
+
*
|
|
13
|
+
* 上端に fixed 配置される横バー。左に SP ハンバーガー+ブランド、右にアクション slot を持つ。
|
|
14
|
+
* 「{shopName}管理」のような文言合成は行わない(利用側が `brand` に組み立てて渡す)。
|
|
15
|
+
*
|
|
16
|
+
* ### インポート
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { AdminHeader } from '../../components/primitives/admin-header'
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* ### Props
|
|
22
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
23
|
+
* |------|-----|-----------|------|
|
|
24
|
+
* | brand | ReactNode | — | 左側のブランド/タイトル |
|
|
25
|
+
* | onMenuClick | () => void | — | SP ハンバーガー押下ハンドラ(省略で非表示) |
|
|
26
|
+
* | actions | ReactNode | — | 右側アクション slot |
|
|
27
|
+
*/
|
|
28
|
+
declare function AdminHeader({ brand, onMenuClick, actions }: AdminHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export { AdminHeader };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface AdminNavSubItem {
|
|
3
|
+
/** サブメニューのラベル */
|
|
4
|
+
label: string;
|
|
5
|
+
/** リンク先 URL */
|
|
6
|
+
href: string;
|
|
7
|
+
}
|
|
8
|
+
/** アイコン描画時のコンテキスト(レール=PC 縦レール / drawer=SP ドロワー) */
|
|
9
|
+
export interface AdminNavIconContext {
|
|
10
|
+
/** この項目が現在アクティブか */
|
|
11
|
+
active: boolean;
|
|
12
|
+
/** 描画される場所 */
|
|
13
|
+
placement: "rail" | "drawer";
|
|
14
|
+
}
|
|
15
|
+
export interface AdminNavItem {
|
|
16
|
+
/** アクティブ判定・React key に使う一意なキー */
|
|
17
|
+
key: string;
|
|
18
|
+
/** メニューラベル */
|
|
19
|
+
label: string;
|
|
20
|
+
/**
|
|
21
|
+
* アイコン。ReactNode を直接渡すか、描画コンテキスト
|
|
22
|
+
* (active / placement)に応じて出し分ける関数を渡す。
|
|
23
|
+
*/
|
|
24
|
+
icon?: React.ReactNode | ((ctx: AdminNavIconContext) => React.ReactNode);
|
|
25
|
+
/** リンク先 URL(サブメニューを持たない項目用) */
|
|
26
|
+
href?: string;
|
|
27
|
+
/** ホバー / アコーディオンで展開するサブメニュー */
|
|
28
|
+
subMenus?: AdminNavSubItem[];
|
|
29
|
+
}
|
|
30
|
+
export interface AdminSideNavProps {
|
|
31
|
+
/** メニュー項目(必須・全て props で受ける。固有メニューを部品側に焼き込まない) */
|
|
32
|
+
items: AdminNavItem[];
|
|
33
|
+
/** 現在アクティブな項目の key */
|
|
34
|
+
activeKey?: string;
|
|
35
|
+
/** ドロワー(SP)のヘッダーに表示するタイトル */
|
|
36
|
+
drawerTitle?: React.ReactNode;
|
|
37
|
+
/** モバイルドロワーの開閉状態(制御コンポーネント) */
|
|
38
|
+
open?: boolean;
|
|
39
|
+
/** モバイルドロワーの開閉要求ハンドラ */
|
|
40
|
+
onOpenChange?: (open: boolean) => void;
|
|
41
|
+
/** nav の aria-label */
|
|
42
|
+
ariaLabel?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 管理画面向けサイドナビゲーション
|
|
46
|
+
*
|
|
47
|
+
* PC は左端固定の縦型アイコンレール(ホバーでサブメニューをポップアップ)、
|
|
48
|
+
* SP は制御された左スライドドロワー(サブメニューはアコーディオン)で表示する。
|
|
49
|
+
* メニュー定義・文言・データは全て `items` prop で受け取り、部品側には焼き込まない。
|
|
50
|
+
*
|
|
51
|
+
* ### インポート
|
|
52
|
+
* ```tsx
|
|
53
|
+
* import { AdminSideNav } from '../../components/primitives/admin-side-nav'
|
|
54
|
+
* ```
|
|
55
|
+
*
|
|
56
|
+
* ### Props
|
|
57
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
58
|
+
* |------|-----|-----------|------|
|
|
59
|
+
* | items | AdminNavItem[] | — | メニュー項目(必須) |
|
|
60
|
+
* | activeKey | string | — | アクティブ項目の key |
|
|
61
|
+
* | drawerTitle | ReactNode | — | SP ドロワーヘッダーのタイトル |
|
|
62
|
+
* | open | boolean | false | SP ドロワーの開閉状態 |
|
|
63
|
+
* | onOpenChange | (open) => void | — | 開閉要求ハンドラ |
|
|
64
|
+
* | ariaLabel | string | "管理メニュー" | nav の aria-label |
|
|
65
|
+
*/
|
|
66
|
+
declare function AdminSideNav({ items, activeKey, drawerTitle, open, onOpenChange, ariaLabel, }: AdminSideNavProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export { AdminSideNav };
|
|
@@ -66,5 +66,5 @@ export interface CategoryScrollProps {
|
|
|
66
66
|
* - thumbnailShape="circle" + thumbnailSize="sm" でクイックアクセスアイコン風に
|
|
67
67
|
* - 横スクロールは scrollbar-hide でスクロールバー非表示
|
|
68
68
|
*/
|
|
69
|
-
declare function CategoryScroll({ title, moreHref, headerSize, items, thumbnailSize, thumbnailShape, layout, gridRows,
|
|
69
|
+
declare function CategoryScroll({ title, moreHref, headerSize, items, thumbnailSize, thumbnailShape, layout, gridRows, pcGridCols, className, }: CategoryScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
70
70
|
export { CategoryScroll };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface EcPageShellProps {
|
|
3
|
+
/**
|
|
4
|
+
* ページ上端に固定するヘッダー。通常は DS の `Header`(variant="logo" / "back" 等)を渡す。
|
|
5
|
+
* 未指定時はヘッダーなし(枠だけ)。
|
|
6
|
+
*/
|
|
7
|
+
header?: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* SP 時のみ表示する下部固定ナビ。通常は DS の `BottomTabBar` を渡す。
|
|
10
|
+
* `@md:hidden` 相当のレスポンシブ制御は BottomTabBar 側が担う。
|
|
11
|
+
* これを渡すと main に BottomTabBar 分の下余白(pb-20 相当)をシェルが自動付与する
|
|
12
|
+
* = **pb-20 の付け忘れ/二重がけを構造的に防ぐ**。ページ側で pb-20 を書かない。
|
|
13
|
+
*/
|
|
14
|
+
bottomTab?: React.ReactNode;
|
|
15
|
+
/** ページ最下部のフッター(任意)。 */
|
|
16
|
+
footer?: React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* main コンテンツ。ページ側は Section / Container で組む前提。
|
|
19
|
+
* シェルは左右 padding を持たない(= Container の責務を侵さない)。
|
|
20
|
+
*/
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
/** ルート要素の追加クラス。 */
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* EcPageShell — EC 標準ページ(standard-page-view / standard-page-edit)の骨格。
|
|
27
|
+
*
|
|
28
|
+
* `contracts/composition.json` の pageSkeletons(mobile / desktop)を構造的に保証する
|
|
29
|
+
* 実装体。`min-h-dvh flex flex-col` の全高コンテナに、上端ヘッダー・伸縮する main・
|
|
30
|
+
* 下部固定 BottomTabBar(SP のみ)・フッターを積む。
|
|
31
|
+
*
|
|
32
|
+
* 設計上の約束(あくまで「枠」— ページ固有の中身は焼き込まない):
|
|
33
|
+
* - Cake.jp のロゴ・タブ項目・ナビ項目・文言を **一切内蔵しない**。それらは
|
|
34
|
+
* 利用側が `header` / `bottomTab` に組み立てて渡す(ec 層が Cake.jp 既定値を束ねる役割)。
|
|
35
|
+
* - `bottomTab` を渡すと main に BottomTabBar 分の下余白をシェルが付与する
|
|
36
|
+
* (pb の付け忘れ/二重がけを構造的に防ぐ)。ページ側で pb-20 を書かない。
|
|
37
|
+
* - 左右 padding は持たない。中身は Section(全幅背景帯)+ Container(中央寄せ・左右余白)で組む。
|
|
38
|
+
*
|
|
39
|
+
* 使い分け:
|
|
40
|
+
* - 管理画面のシェルは `AdminLayout`。
|
|
41
|
+
* - 複数情報をまたぐ集中編集は `WorkspaceLayout`。
|
|
42
|
+
* - マイページ配下の固有ページは `MypageShell`。
|
|
43
|
+
*
|
|
44
|
+
* 判断基準は contracts/composition.json(pageSkeletons)/ contracts/screen-patterns.json を参照。
|
|
45
|
+
*/
|
|
46
|
+
declare function EcPageShell({ header, bottomTab, footer, children, className, }: EcPageShellProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export { EcPageShell };
|
|
@@ -52,5 +52,5 @@ export interface FilterBarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
52
52
|
* - SP では並び替えは結果行の右側にソートボタンとして表示(本番同様)
|
|
53
53
|
* - PC では並び替えは select 風ドロップダウンとして表示(本番 m_sort_pc 同様)
|
|
54
54
|
*/
|
|
55
|
-
declare function FilterBar({ filters, resultCount, sortLabel, onSortClick, onMoreFilters, onBack, activeFilterCount,
|
|
55
|
+
declare function FilterBar({ filters, resultCount, sortLabel, onSortClick, onMoreFilters, onBack, activeFilterCount, className, variant, ...props }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
56
56
|
export { FilterBar };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface FunnelStep {
|
|
3
|
+
/** ステップ識別子(activeStep との照合に使う) */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 表示ラベル */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FunnelShellProps {
|
|
9
|
+
/** ファネルのタイトル(集中ヘッダーのタイトル。例: 「ご購入手続き」) */
|
|
10
|
+
title: string;
|
|
11
|
+
/** 戻る導線のクリックハンドラ。離脱確認は利用側が onBack 内で行う想定 */
|
|
12
|
+
onBack?: () => void;
|
|
13
|
+
/** 戻るボタンのラベル */
|
|
14
|
+
backLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 進捗インジケータのステップ定義(任意)。
|
|
17
|
+
* ステップ名・数はドメインの責務なので利用側が渡す(シェルに焼き込まない)。
|
|
18
|
+
*/
|
|
19
|
+
steps?: FunnelStep[];
|
|
20
|
+
/** 現在のステップ(steps[].key と照合)。未指定 or 不一致時はインジケータをハイライトしない */
|
|
21
|
+
activeStep?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 各ステップのコンテンツ本体。
|
|
24
|
+
* 左右 padding は Container の責務なのでシェルは持たない。
|
|
25
|
+
*/
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* 下部固定アクションの slot(StickyActionBar 等を受ける)。
|
|
29
|
+
* 渡された場合、本文が隠れないための下余白はシェルが管理する
|
|
30
|
+
* (EcPageShell の bottomTab と同じ思想。ページ側で pb を書かない)。
|
|
31
|
+
*/
|
|
32
|
+
bottomAction?: React.ReactNode;
|
|
33
|
+
/** ルート要素の追加クラス */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* FunnelShell — EC 購入導線等のファネル用集中モード(Full Page)のシェル。
|
|
38
|
+
*
|
|
39
|
+
* カート → お届け先 → 支払い → 確認 のような一直線の購入フローに集中させる骨格。
|
|
40
|
+
* グローバルナビ・BottomTabBar・パンくずを構造的に持たない(離脱を誘う導線を置けなくする)。
|
|
41
|
+
*
|
|
42
|
+
* 設計上の約束:
|
|
43
|
+
* - ヘッダーは既存 `Header`(variant="back")を使う。左上=戻る導線、中央=タイトル。
|
|
44
|
+
* - 進捗インジケータ(`steps` / `activeStep`)は完了=Brand 色・現在=強調・未来=Low-Emphasis
|
|
45
|
+
* の点+ラベルで表す。SP ではラベルを省略し点のみにする簡易レスポンシブ。
|
|
46
|
+
* - `bottomAction` を渡すと本文の下余白はシェルが管理する(二重がけ/付け忘れの構造的防止)。
|
|
47
|
+
*
|
|
48
|
+
* 管理画面の集中編集は `WorkspaceLayout`(EC 購入導線=本コンポーネント)。
|
|
49
|
+
* 判断基準は contracts/screen-patterns.json(focused-workspace)を参照。
|
|
50
|
+
*/
|
|
51
|
+
declare function FunnelShell({ title, onBack, backLabel, steps, activeStep, children, bottomAction, className, }: FunnelShellProps): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export { FunnelShell };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SectionNavItem {
|
|
3
|
+
/** アクティブ判定・onItemClick 用キー */
|
|
4
|
+
key: string;
|
|
5
|
+
/** メニューラベル */
|
|
6
|
+
label: string;
|
|
7
|
+
/** リンク先アンカー(`#section-id` 形式を想定) */
|
|
8
|
+
href: string;
|
|
9
|
+
/** Lucide / iconsax アイコン等の ReactNode(任意) */
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export interface SectionNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
13
|
+
/** 目次項目(アンカー) */
|
|
14
|
+
items: SectionNavItem[];
|
|
15
|
+
/** アクティブなセクションの key(利用側が scrollspy 等で制御。本体では監視しない) */
|
|
16
|
+
activeKey?: string;
|
|
17
|
+
/** aria-label */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** 項目クリック時のコールバック(任意) */
|
|
20
|
+
onItemClick?: (key: string) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* SectionNav — ページ内セクション移動(アンカー/目次)専用ナビ。
|
|
24
|
+
*
|
|
25
|
+
* 現在のページの中を移動する TOC(目次)型ナビ。`href="#section-id"` の
|
|
26
|
+
* ページ内アンカースクロールに使う。**ページ間遷移には使わない(→ `SideNav`)**。
|
|
27
|
+
*
|
|
28
|
+
* ### アフォーダンス設計
|
|
29
|
+
* - チェブロン・矢印を**付けない**。「別ページへ遷移する」印象を与えず、
|
|
30
|
+
* 同一画面内の位置移動であることを見た目で示す(aria-current="location")。
|
|
31
|
+
* - 固有幅・背景・境界を持たない(`w-full`)。パネル化・幅決定はシェル/利用側の責務。
|
|
32
|
+
* (SideNav の `w-64` 固定が WorkspaceLayout で幅ミスマッチを起こした反省)
|
|
33
|
+
* - IntersectionObserver は内包しない。`activeKey` を利用側が渡す。
|
|
34
|
+
*
|
|
35
|
+
* ### インポート
|
|
36
|
+
* ```tsx
|
|
37
|
+
* import { SectionNav } from '../../components/primitives/section-nav'
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* ### 使い方
|
|
41
|
+
* ```tsx
|
|
42
|
+
* <SectionNav
|
|
43
|
+
* activeKey="basic"
|
|
44
|
+
* items={[
|
|
45
|
+
* { key: "basic", label: "基本情報", href: "#basic", icon: <Cake size={18} /> },
|
|
46
|
+
* { key: "price", label: "価格・在庫", href: "#price" },
|
|
47
|
+
* ]}
|
|
48
|
+
* />
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* ### Props
|
|
52
|
+
* | Prop | 型 | デフォルト | 説明 |
|
|
53
|
+
* |------|-----|-----------|------|
|
|
54
|
+
* | items | SectionNavItem[] | — | 目次項目(アンカー、必須) |
|
|
55
|
+
* | activeKey | string | — | アクティブなセクションの key |
|
|
56
|
+
* | ariaLabel | string | "ページ内セクション" | aria-label |
|
|
57
|
+
* | onItemClick | (key: string) => void | — | 項目クリック時のコールバック |
|
|
58
|
+
*/
|
|
59
|
+
declare function SectionNav({ items, activeKey, ariaLabel, onItemClick, className, ...props }: SectionNavProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export { SectionNav };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface WorkspaceLayoutProps {
|
|
3
|
+
/** 編集対象名(編集ヘッダーのタイトル) */
|
|
4
|
+
title: string;
|
|
5
|
+
/** 戻る導線のクリックハンドラ。未保存確認は利用側が onBack 内で行う想定 */
|
|
6
|
+
onBack?: () => void;
|
|
7
|
+
/** 戻るボタンのラベル */
|
|
8
|
+
backLabel?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 右上のワークスペース全体の上位アクション(例: 「公開申請」ボタン)。
|
|
11
|
+
* 任意 prop = 「ある場合のみ設置する」ルールの表現。
|
|
12
|
+
* セクション/行単位の操作はここに置かず、対象コンテンツの近くに置く。
|
|
13
|
+
*/
|
|
14
|
+
primaryAction?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* 編集内のセクションナビ/ステップナビ(任意)。
|
|
17
|
+
* PC(@md+)ではコンテンツ左のサイドに、SP では非表示にする。
|
|
18
|
+
* 通常は `SectionNav`(ページ内アンカー移動専用)を渡す。ページ間遷移用の `SideNav` は流用しない。
|
|
19
|
+
*/
|
|
20
|
+
sectionNav?: React.ReactNode;
|
|
21
|
+
/** 編集コンテンツ本体 */
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
/** ルート要素の追加クラス */
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* WorkspaceLayout — Focused Workspace(全画面集中編集)のシェル。
|
|
28
|
+
*
|
|
29
|
+
* 複数情報をまたぐ複雑な編集に集中させるための骨格。
|
|
30
|
+
* グローバルナビ・パンくずを構造的に持たない(集中を妨げる導線を置けなくする)。
|
|
31
|
+
*
|
|
32
|
+
* 設計上の約束:
|
|
33
|
+
* - ヘッダーは既存 `Header`(variant="back")を使う。左上=戻る導線、
|
|
34
|
+
* 右上=`primaryAction`(ワークスペース全体の上位アクションがある場合のみ)。
|
|
35
|
+
* - `sectionNav` は編集内ナビのみ。グロナビは置かない。
|
|
36
|
+
* - `sectionNav` は Surface-Secondary から浮いた独立パネルとして、シェル側で角丸パネルにラップされる。
|
|
37
|
+
* - 標準的な編集は `AdminLayout`(Standard Page(Edit)/旧 Form Page)。複雑・集中編集・没入執筆のみ本コンポーネント。
|
|
38
|
+
*
|
|
39
|
+
* 判断基準は contracts/screen-patterns.json / guidelines/foundations/screen-patterns.md を参照。
|
|
40
|
+
*/
|
|
41
|
+
declare function WorkspaceLayout({ title, onBack, backLabel, primaryAction, sectionNav, children, className, }: WorkspaceLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export { WorkspaceLayout };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export { NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, Navigat
|
|
|
30
30
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious } from "./components/foundations/pagination";
|
|
31
31
|
export { Popover, PopoverContent, PopoverTrigger } from "./components/foundations/popover";
|
|
32
32
|
export { Progress } from "./components/foundations/progress";
|
|
33
|
+
export { ResponsiveDialog, ResponsiveDialogClose, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogHeader, ResponsiveDialogTitle, ResponsiveDialogTrigger, useIsMobile } from "./components/foundations/responsive-dialog";
|
|
33
34
|
export { RadioGroup, RadioGroupItem } from "./components/foundations/radio-group";
|
|
34
35
|
export { ScrollArea, ScrollBar } from "./components/foundations/scroll-area";
|
|
35
36
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from "./components/foundations/select";
|
|
@@ -46,6 +47,10 @@ export { Toaster } from "./components/foundations/sonner";
|
|
|
46
47
|
export { Toggle, toggleVariants } from "./components/foundations/toggle";
|
|
47
48
|
export { ToggleGroup, ToggleGroupItem } from "./components/foundations/toggle-group";
|
|
48
49
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./components/foundations/tooltip";
|
|
50
|
+
export { AdminSideNav } from "./components/primitives/admin-side-nav";
|
|
51
|
+
export type { AdminSideNavProps, AdminNavItem, AdminNavSubItem, AdminNavIconContext } from "./components/primitives/admin-side-nav";
|
|
52
|
+
export { AdminHeader } from "./components/primitives/admin-header";
|
|
53
|
+
export type { AdminHeaderProps } from "./components/primitives/admin-header";
|
|
49
54
|
export { CoachMark } from "./components/primitives/coach-mark";
|
|
50
55
|
export { BannerCarousel } from "./components/primitives/banner-carousel";
|
|
51
56
|
export { StickyActionBar } from "./components/primitives/sticky-action-bar";
|
|
@@ -57,11 +62,16 @@ export { CategoryScroll } from "./components/primitives/category-scroll";
|
|
|
57
62
|
export type { CategoryScrollProps, CategoryItem } from "./components/primitives/category-scroll";
|
|
58
63
|
export { Chip, chipVariants } from "./components/primitives/chip";
|
|
59
64
|
export type { ChipProps } from "./components/primitives/chip";
|
|
65
|
+
export { EcPageShell } from "./components/primitives/ec-page-shell";
|
|
66
|
+
export type { EcPageShellProps } from "./components/primitives/ec-page-shell";
|
|
60
67
|
export { EmptyState } from "./components/primitives/empty-state";
|
|
61
68
|
export { ErrorState } from "./components/primitives/error-state";
|
|
62
69
|
export { FilterBar } from "./components/primitives/filter-bar";
|
|
63
70
|
export { Footer } from "./components/primitives/footer";
|
|
64
71
|
export { FormField as CakeFormField } from "./components/primitives/form-field";
|
|
72
|
+
export { FunnelShell } from "./components/primitives/funnel-shell";
|
|
73
|
+
export type { FunnelShellProps, FunnelStep } from "./components/primitives/funnel-shell";
|
|
74
|
+
export { Header } from "./components/primitives/header";
|
|
65
75
|
export { ImageCarousel } from "./components/primitives/image-carousel";
|
|
66
76
|
export { ImageGallery } from "./components/primitives/image-gallery";
|
|
67
77
|
export { ImageUploader } from "./components/primitives/image-uploader";
|
|
@@ -79,15 +89,20 @@ export { SearchPanel } from "./components/primitives/search-panel";
|
|
|
79
89
|
export { Container, containerVariants } from "./components/primitives/container";
|
|
80
90
|
export { Section, sectionVariants } from "./components/primitives/section";
|
|
81
91
|
export { SectionHeader } from "./components/primitives/section-header";
|
|
92
|
+
export { SectionNav } from "./components/primitives/section-nav";
|
|
93
|
+
export type { SectionNavProps, SectionNavItem } from "./components/primitives/section-nav";
|
|
82
94
|
export { ShareButtons } from "./components/primitives/share-buttons";
|
|
83
95
|
export { SideNav } from "./components/primitives/side-nav";
|
|
84
96
|
export type { SideNavProps, SideNavGroup, SideNavItem } from "./components/primitives/side-nav";
|
|
85
97
|
export { SocialLoginButton } from "./components/primitives/social-login-button";
|
|
86
98
|
export { StatusCountTabs } from "./components/primitives/status-count-tabs";
|
|
87
99
|
export { Tag, tagVariants } from "./components/primitives/tag";
|
|
100
|
+
export { WorkspaceLayout } from "./components/primitives/workspace-layout";
|
|
101
|
+
export type { WorkspaceLayoutProps } from "./components/primitives/workspace-layout";
|
|
88
102
|
export { AdminLayout, MissingComponent } from "./components/ec/admin-layout";
|
|
89
103
|
export { AnniversaryCard } from "./components/ec/anniversary-card";
|
|
90
104
|
export { CakeLogo } from "./components/ec/cake-logo";
|
|
105
|
+
export { ChartControls } from "./components/ec/chart-controls";
|
|
91
106
|
export { CountdownTimer } from "./components/ec/countdown-timer";
|
|
92
107
|
export { CouponCard } from "./components/ec/coupon-card";
|
|
93
108
|
export { DeliveryCalendar } from "./components/ec/delivery-calendar";
|
|
@@ -106,8 +121,7 @@ export { RatingStars, SparkleIcon } from "./components/ec/rating-stars";
|
|
|
106
121
|
export { ReviewCard } from "./components/ec/review-card";
|
|
107
122
|
export { ReviewForm } from "./components/ec/review-form";
|
|
108
123
|
export { ReviewSummary, ReviewItem } from "./components/ec/review-summary";
|
|
124
|
+
export { MypageShell } from "./components/ec/mypage-shell";
|
|
125
|
+
export type { MypageShellProps, MypageShellBreadcrumb } from "./components/ec/mypage-shell";
|
|
109
126
|
export { ShopCard } from "./components/ec/shop-card";
|
|
110
127
|
export { StatCard } from "./components/ec/stat-card";
|
|
111
|
-
export { Header } from "./components/primitives/header";
|
|
112
|
-
export { MypageShell } from "./components/pages/cake/_mypage-shell";
|
|
113
|
-
export type { MypageShellProps, MypageShellBreadcrumb } from "./components/pages/cake/_mypage-shell";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cakejp/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cake.jp Design System — UI コンポーネント・カラートークン・タイポグラフィ",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -86,9 +86,10 @@
|
|
|
86
86
|
"lint:scratch": "bash scripts/lint-scratch.sh",
|
|
87
87
|
"lint:reuse": "bash scripts/check-story-reuse.sh",
|
|
88
88
|
"lint:border": "node scripts/check-border-color.mjs",
|
|
89
|
+
"lint:docs": "bash scripts/check-docs-drift.sh",
|
|
89
90
|
"generate:lint-rules": "node scripts/generate-lint-rules.mjs",
|
|
90
91
|
"generate:lookup": "node scripts/generate-component-lookup.mjs",
|
|
91
|
-
"check": "tsc --noEmit && bash scripts/check-deps.sh && bash scripts/check-drift.sh && bash scripts/lint-scratch.sh && bash scripts/check-story-reuse.sh && bash scripts/check-responsive.sh && node scripts/check-border-color.mjs && bash scripts/lint-scratch.sh --components && bash scripts/check-generated-drift.sh",
|
|
92
|
+
"check": "tsc --noEmit && bash scripts/check-deps.sh && bash scripts/check-drift.sh && bash scripts/check-docs-drift.sh && bash scripts/lint-scratch.sh && bash scripts/check-story-reuse.sh && bash scripts/check-responsive.sh && node scripts/check-border-color.mjs && bash scripts/lint-scratch.sh --components && bash scripts/check-generated-drift.sh",
|
|
92
93
|
"test": "vitest run --config vitest.config.ts"
|
|
93
94
|
},
|
|
94
95
|
"dependencies": {
|
package/templates/CLAUDE.md
CHANGED
|
@@ -13,6 +13,8 @@ Codex(および他の AI エージェント)は UI 作業を始める前に
|
|
|
13
13
|
|---------|------|
|
|
14
14
|
| `node_modules/@cakejp/design-system/CLAUDE.md` | DS 利用ガイド・禁止パターン |
|
|
15
15
|
| `node_modules/@cakejp/design-system/contracts/components.json` | 全コンポーネントの定義・バリアント |
|
|
16
|
+
| `node_modules/@cakejp/design-system/contracts/screen-patterns.json` | 画面パターン判断基準(CRUD・編集/作成/削除UIの選択) |
|
|
17
|
+
| `node_modules/@cakejp/design-system/contracts/composition.json` | ページ骨格・余白リズム・視覚階層の組み方 |
|
|
16
18
|
| `node_modules/@cakejp/design-system/contracts/rules.json` | 禁止パターン・アクセシビリティ要件 |
|
|
17
19
|
| `node_modules/@cakejp/design-system/tokens.json` | カラー・余白・角丸・影・タイポ |
|
|
18
20
|
|