@cakejp/design-system 0.7.0 → 0.10.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.
@@ -0,0 +1,46 @@
1
+ /**
2
+ * AdminShell — 管理画面の共通レイアウト
3
+ *
4
+ * 本番の shop_layout.ctp を参考に、Header + SideNav + Main Content の構造を再現。
5
+ * 汎用の枠は primitives(AdminSideNav / AdminHeader)に切り出し、
6
+ * Cake.jp 管理メニュー等のドメイン既定値はこの ec レイヤーで束ねる。
7
+ * 参照元:
8
+ * - admin-test-htdocs/app/views/layouts/shop_layout.ctp
9
+ * - admin-test-htdocs/app/views/elements/shop_layout/header.ctp
10
+ * - admin-test-htdocs/app/views/elements/shop_layout/side_menu.ctp
11
+ * - CSS: admin_shops/layout/nav_layout.css
12
+ */
13
+ import * as React from "react";
14
+ import { type AdminNavItem } from "../../components/primitives/admin-side-nav";
15
+ export declare function MissingComponent({ name, children, className, }: {
16
+ name: string;
17
+ children: React.ReactNode;
18
+ className?: string;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ export interface AdminShellProps {
21
+ children: React.ReactNode;
22
+ /** 現在アクティブなナビアイテム */
23
+ activeNav?: string;
24
+ /** ページタイトル(ヘッダー表示用) */
25
+ title?: string;
26
+ /** パンくず */
27
+ breadcrumbs?: {
28
+ label: string;
29
+ href?: string;
30
+ }[];
31
+ /** ショップ名 */
32
+ shopName?: string;
33
+ /** サイドナビ項目(既定=Cake.jp 管理メニュー。利用側で差し替え可) */
34
+ navItems?: AdminNavItem[];
35
+ /** ヘッダー右側のアクション slot(既定=通知ベル+プロフィール) */
36
+ headerActions?: React.ReactNode;
37
+ /**
38
+ * 戻る導線のクリックハンドラ。渡されたときのみ、main 内のパンくずより上に戻るボタンを描画する。
39
+ * 編集系ページの戻る導線はパンくずより上に置く(シェルが位置を保証する)。
40
+ * 子コンテンツ内に戻るリンクを手書きしないこと。未指定なら何も出ない。
41
+ */
42
+ onBack?: () => void;
43
+ /** 戻るボタンのラベル(既定="戻る") */
44
+ backLabel?: string;
45
+ }
46
+ export declare function AdminShell({ children, activeNav, title, breadcrumbs, shopName, navItems, headerActions, onBack, backLabel, }: AdminShellProps): import("react/jsx-runtime").JSX.Element;
@@ -16,9 +16,17 @@
16
16
  * ❌ マイページトップ (Dashboard) — メインカラムに白背景を持たず、セクションごとにカード化
17
17
  *
18
18
  * 上記の例外は意図的な別パターンなのでこのシェルを使わない。
19
+ *
20
+ * ## 事業横断での再利用
21
+ *
22
+ * 骨格(ヘッダー+2カラム+BottomTabBar)は事業横断で再利用できる。
23
+ * ジョブボード等の他事業では `menuGroups` / `breadcrumbs` / `bottomNavItems` / `headerActions`
24
+ * を差し替えて骨格を再利用する。既定値は Cake.jp EC のマイページメニュー。
19
25
  */
20
26
  import React from "react";
21
- import { type BottomTabBarItem } from "../../../components/primitives/bottom-tab-bar";
27
+ import { type HeaderAction } from "../../components/primitives/header";
28
+ import { type SideNavGroup } from "../../components/primitives/side-nav";
29
+ import { type BottomTabBarItem } from "../../components/primitives/bottom-tab-bar";
22
30
  export interface MypageShellBreadcrumb {
23
31
  label: string;
24
32
  href?: string;
@@ -34,8 +42,18 @@ export interface MypageShellProps {
34
42
  breadcrumbs?: MypageShellBreadcrumb[];
35
43
  /** BottomTabBar items(省略時はデフォルト。isActive 等を渡したい場合はこちら) */
36
44
  bottomNavItems?: BottomTabBarItem[];
45
+ /**
46
+ * PC サイドバーのメニューグループ(既定=Cake.jp EC のマイページメニュー)。
47
+ * ジョブボード等の他事業では差し替えて骨格を再利用する。
48
+ */
49
+ menuGroups?: SideNavGroup[];
50
+ /**
51
+ * PC ヘッダー右側のアクション(既定=検索/マイページ/カート)。
52
+ * 他事業では差し替えて骨格を再利用する。
53
+ */
54
+ headerActions?: HeaderAction[];
37
55
  /** SP の戻るボタン押下時のハンドラ(Header variant="back" に委譲) */
38
56
  onBack?: () => void;
39
57
  }
40
- declare function MypageShell({ title, activeMenu, children, breadcrumbs, bottomNavItems, onBack, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
58
+ declare function MypageShell({ title, activeMenu, children, breadcrumbs, bottomNavItems, menuGroups, headerActions, onBack, }: MypageShellProps): import("react/jsx-runtime").JSX.Element;
41
59
  export { MypageShell };
@@ -33,10 +33,11 @@ declare function DataTableCheckboxCell({ className, checked, onCheckedChange, in
33
33
  indeterminate?: boolean;
34
34
  "aria-label"?: string;
35
35
  }): import("react/jsx-runtime").JSX.Element;
36
- declare function DataTableActionCell({ className, actions, ...props }: Omit<React.ComponentProps<"td">, "children" | "width" | "align"> & {
36
+ declare function DataTableActionCell({ className, actions, onClick, ...props }: Omit<React.ComponentProps<"td">, "children" | "width" | "align"> & {
37
37
  actions: Array<{
38
38
  label: string;
39
- onClick?: () => void;
39
+ /** メニュー項目選択時。Radix DropdownMenuItem から MouseEvent が渡る */
40
+ onClick?: (event: React.MouseEvent<HTMLElement>) => void;
40
41
  destructive?: boolean;
41
42
  separator?: boolean;
42
43
  }>;
@@ -0,0 +1,31 @@
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 配置される横バー(z-40)。左に SP ハンバーガー+ブランド、
14
+ * 右にアクション slot を持つ。PC ではこのヘッダーの下端(top-16)から `AdminSideNav`
15
+ * のレール(z-30)が始まる=ヘッダーが最前面・全幅で、レールはヘッダー帯に重ならない。
16
+ * 「{shopName}管理」のような文言合成は行わない(利用側が `brand` に組み立てて渡す)。
17
+ *
18
+ * ### インポート
19
+ * ```tsx
20
+ * import { AdminHeader } from '../../components/primitives/admin-header'
21
+ * ```
22
+ *
23
+ * ### Props
24
+ * | Prop | 型 | デフォルト | 説明 |
25
+ * |------|-----|-----------|------|
26
+ * | brand | ReactNode | — | 左側のブランド/タイトル |
27
+ * | onMenuClick | () => void | — | SP ハンバーガー押下ハンドラ(省略で非表示) |
28
+ * | actions | ReactNode | — | 右側アクション slot |
29
+ */
30
+ declare function AdminHeader({ brand, onMenuClick, actions }: AdminHeaderProps): import("react/jsx-runtime").JSX.Element;
31
+ 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, gridCols, pcGridCols, className, }: CategoryScrollProps): import("react/jsx-runtime").JSX.Element;
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 };
@@ -39,6 +39,8 @@ export interface ChipProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
39
39
  * - 売り切れタイル: `<Chip shape="square" size="tile" soldOut>5号</Chip>`
40
40
  * - カウント付き: `<Chip selected count={156}>すべて</Chip>`
41
41
  * - ステータスフィルター: Chip + count でステータス別件数タブを構成
42
+ *
43
+ * removable 時は本体(`data-slot="chip-trigger"`)と削除ボタンが兄弟の2タブストップ構造(ルートは `span[data-slot="chip"]`)。
42
44
  */
43
45
  declare function Chip({ className, variant, size, shape, href, selected, soldOut, removable, onRemove, count, children, ...props }: ChipProps): import("react/jsx-runtime").JSX.Element;
44
46
  export { Chip, chipVariants };
@@ -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, variant, className, ...props }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
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,85 @@
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
+ * ヘッダーのロゴ(`CakeLogo` 等)。**基本形はこちら**。
11
+ * 渡すとヘッダーを `Header variant="logo-center"`(中央ロゴのみ)で描画する。
12
+ * ライブ本番の購入導線(/carts_v2/ = cart_layout.ctp の cartHeader)に準拠し、
13
+ * 戻る・タイトルを持たず離脱導線をロゴのみに絞る。`logo` と `title` は
14
+ * どちらか一方を渡す(`logo` が優先)。
15
+ */
16
+ logo?: React.ReactNode;
17
+ /**
18
+ * ファネルのタイトル(集中ヘッダーのタイトル。例: 「ご購入手続き」)。
19
+ * `logo` 未指定時の**代替形**(`Header variant="back"` の中央タイトル)。
20
+ * 多段申込などタイトル・戻るが要るファネル向け。`logo` 使用時は不要。
21
+ */
22
+ title?: string;
23
+ /** 戻る導線のクリックハンドラ(title 使用時)。離脱確認は利用側が onBack 内で行う想定 */
24
+ onBack?: () => void;
25
+ /** 戻るボタンのラベル(title 使用時) */
26
+ backLabel?: string;
27
+ /**
28
+ * 進捗インジケータのステップ定義(任意)。
29
+ * ステップ名・数はドメインの責務なので利用側が渡す(シェルに焼き込まない)。
30
+ */
31
+ steps?: FunnelStep[];
32
+ /** 現在のステップ(steps[].key と照合)。未指定 or 不一致時はインジケータをハイライトしない */
33
+ activeStep?: string;
34
+ /**
35
+ * 各ステップのコンテンツ本体。
36
+ * 左右 padding は Container の責務なのでシェルは持たない。
37
+ */
38
+ children: React.ReactNode;
39
+ /**
40
+ * 下部固定アクションの slot(StickyActionBar 等を受ける)。
41
+ * 渡された場合、本文が隠れないための下余白はシェルが管理する
42
+ * (StandardPageShell の bottomTab と同じ思想。ページ側で pb を書かない)。
43
+ */
44
+ bottomAction?: React.ReactNode;
45
+ /** ルート要素の追加クラス */
46
+ className?: string;
47
+ }
48
+ /**
49
+ * FunnelShell — EC 購入導線等のファネル用集中モード(Full Page)のシェル。
50
+ *
51
+ * カート → お届け先 → 支払い → 確認 のような一直線の購入フローに集中させる骨格。
52
+ * グローバルナビ・BottomTabBar・パンくずを構造的に持たない(離脱を誘う導線を置けなくする)。
53
+ *
54
+ * ## なぜ購入導線は中央ロゴのヘッダーなのか(理由)
55
+ *
56
+ * 購入導線は **戻り・離脱をしづらくして途中離脱を抑制する** ため、グロナビ・戻る・
57
+ * タイトルを持たない中央ロゴのヘッダーを基本形にする。根拠は2つ:
58
+ *
59
+ * 1. **DS の Header の既定用途** — `Header` の docstring が
60
+ * `variant="logo-center": ロゴ中央配置(決済・申し込みページ用)` と規定している
61
+ * (src/components/primitives/header.tsx の `variant` prop)。決済・申込ページ向けの
62
+ * バリアントを購入導線でそのまま使う。
63
+ * 2. **ライブ本番の購入導線ヘッダー** — `www-test-htdocs/app/views/layouts/cart_layout.ctp`
64
+ * の cartHeader は中央ロゴのみで、ロゴクリックのリンク先も `/cart/` と thanks に限定
65
+ * (=カート/完了以外へは飛ばさず、離脱導線を最小化している)。本シェルはこの実挙動に
66
+ * 準拠する。
67
+ *
68
+ * 設計上の約束:
69
+ * - ヘッダーは既存 `Header` を使う。
70
+ * - **基本形=中央ロゴ**: `logo` を渡すと `Header variant="logo-center"`(中央ロゴのみ)で
71
+ * 描画する。ライブ本番の購入導線(cart_layout.ctp の cartHeader)準拠で、離脱導線は
72
+ * ロゴのみ(戻る・タイトルを持たない)=上記のとおり途中離脱の抑制が目的。
73
+ * - **代替形=back+title**: `logo` を渡さず `title` を渡すと `Header variant="back"`
74
+ * (左上=戻る・中央=タイトル)で描画する。多段申込などタイトル・戻るが要るファネル向け。
75
+ * - `logo` と `title` はどちらか一方を渡す(`logo` が優先)。両方無い場合はヘッダーを描画しない。
76
+ * - 進捗インジケータ(`steps` / `activeStep`)は完了=Brand 色・現在=強調・未来=Low-Emphasis
77
+ * で表す。各ステップはドット(上)+ラベル(下)の縦積みで、コネクタ線はドット中心の
78
+ * 高さで隣ステップ中心まで引く。ラベルは SP でも省略しない。
79
+ * - `bottomAction` を渡すと本文の下余白はシェルが管理する(二重がけ/付け忘れの構造的防止)。
80
+ *
81
+ * 管理画面の集中編集は `WorkspaceShell`(EC 購入導線=本コンポーネント)。
82
+ * 判断基準は contracts/screen-patterns.json(focused-workspace)を参照。
83
+ */
84
+ declare function FunnelShell({ logo, title, onBack, backLabel, steps, activeStep, children, bottomAction, className, }: FunnelShellProps): import("react/jsx-runtime").JSX.Element;
85
+ 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` 固定が WorkspaceShell で幅ミスマッチを起こした反省)
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,51 @@
1
+ import * as React from "react";
2
+ export interface StandardPageShellProps {
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
+ * StandardPageShell — 消費者向け標準ページ(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
+ * 名前はプロダクト・ドメインに依存しない(旧名 `EcPageShell` は deprecated alias として残置)。
33
+ * 骨格自体に EC 固有の要素は無く、Cake.jp の EC ページも求人検索(jobboard)の
34
+ * 「検索と結果の表示」のような消費者向けページも、同じこのシェルで組む。
35
+ *
36
+ * 設計上の約束(あくまで「枠」— ページ固有の中身は焼き込まない):
37
+ * - プロダクトのロゴ・タブ項目・ナビ項目・文言を **一切内蔵しない**。それらは
38
+ * 利用側が `header` / `bottomTab` に組み立てて渡す(ec 層が Cake.jp 既定値を束ねる役割)。
39
+ * - `bottomTab` を渡すと main に BottomTabBar 分の下余白をシェルが付与する
40
+ * (pb の付け忘れ/二重がけを構造的に防ぐ)。ページ側で pb-20 を書かない。
41
+ * - 左右 padding は持たない。中身は Section(全幅背景帯)+ Container(中央寄せ・左右余白)で組む。
42
+ *
43
+ * 使い分け:
44
+ * - 管理画面のシェルは `AdminShell`。
45
+ * - 複数情報をまたぐ集中編集は `WorkspaceShell`。
46
+ * - マイページ配下の固有ページは `MypageShell`。
47
+ *
48
+ * 判断基準は contracts/composition.json(pageSkeletons)/ contracts/screen-patterns.json を参照。
49
+ */
50
+ declare function StandardPageShell({ header, bottomTab, footer, children, className, }: StandardPageShellProps): import("react/jsx-runtime").JSX.Element;
51
+ export { StandardPageShell };
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ export interface WorkspaceShellProps {
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
+ * 注意: セクション数が少ない編集では、ページ遷移に見える左レールを置くより
21
+ * `asidePanel`(右メタパネル)だけを使う構成(Shopify 型)を推奨する。
22
+ */
23
+ sectionNav?: React.ReactNode;
24
+ /**
25
+ * コンテンツ右のメタ情報/上位アクションパネル(任意)。
26
+ * 公開状態・スケジュール・プレビュー等「編集そのものではない付帯情報と操作」を集約する。
27
+ * PC(@md+)では右に sticky 表示、SP ではメイン本体の下に縦積み。
28
+ * ページ内アンカーではないため、左レールのような「別ページ風」の誤認を生まない。
29
+ */
30
+ asidePanel?: React.ReactNode;
31
+ /** 編集コンテンツ本体 */
32
+ children: React.ReactNode;
33
+ /** ルート要素の追加クラス */
34
+ className?: string;
35
+ }
36
+ /**
37
+ * WorkspaceShell — Focused Workspace(全画面集中編集)のシェル。
38
+ *
39
+ * 複数情報をまたぐ複雑な編集に集中させるための骨格。
40
+ * グローバルナビ・パンくずを構造的に持たない(集中を妨げる導線を置けなくする)。
41
+ *
42
+ * 設計上の約束:
43
+ * - ヘッダーは既存 `Header`(variant="back")を使う。左上=戻る導線、
44
+ * 右上=`primaryAction`(ワークスペース全体の上位アクションがある場合のみ)。
45
+ * - `sectionNav` は編集内ナビのみ。グロナビは置かない。
46
+ * - `sectionNav` は Surface-Secondary から浮いた独立パネルとして、シェル側で角丸パネルにラップされる。
47
+ * - 標準的な編集は `AdminShell`(Standard Page(Edit)/旧 Form Page)。複雑・集中編集・没入執筆のみ本コンポーネント。
48
+ *
49
+ * 判断基準は contracts/screen-patterns.json / guidelines/foundations/screen-patterns.md を参照。
50
+ */
51
+ declare function WorkspaceShell({ title, onBack, backLabel, primaryAction, sectionNav, asidePanel, children, className, }: WorkspaceShellProps): import("react/jsx-runtime").JSX.Element;
52
+ export { WorkspaceShell };
@@ -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,24 @@ 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 { StandardPageShell } from "./components/primitives/standard-page-shell";
66
+ export type { StandardPageShellProps } from "./components/primitives/standard-page-shell";
67
+ /**
68
+ * @deprecated 旧名。`StandardPageShell` を使うこと。
69
+ * この骨格は EC 専用ではなく、求人検索など消費者向けの標準ページ全般で使うため中立名に改称した。
70
+ * 次のメジャーで削除する。
71
+ */
72
+ export { StandardPageShell as EcPageShell } from "./components/primitives/standard-page-shell";
73
+ /** @deprecated 旧名。`StandardPageShellProps` を使うこと。次のメジャーで削除する。 */
74
+ export type { StandardPageShellProps as EcPageShellProps } from "./components/primitives/standard-page-shell";
60
75
  export { EmptyState } from "./components/primitives/empty-state";
61
76
  export { ErrorState } from "./components/primitives/error-state";
62
77
  export { FilterBar } from "./components/primitives/filter-bar";
63
78
  export { Footer } from "./components/primitives/footer";
64
79
  export { FormField as CakeFormField } from "./components/primitives/form-field";
80
+ export { FunnelShell } from "./components/primitives/funnel-shell";
81
+ export type { FunnelShellProps, FunnelStep } from "./components/primitives/funnel-shell";
82
+ export { Header } from "./components/primitives/header";
65
83
  export { ImageCarousel } from "./components/primitives/image-carousel";
66
84
  export { ImageGallery } from "./components/primitives/image-gallery";
67
85
  export { ImageUploader } from "./components/primitives/image-uploader";
@@ -79,15 +97,37 @@ export { SearchPanel } from "./components/primitives/search-panel";
79
97
  export { Container, containerVariants } from "./components/primitives/container";
80
98
  export { Section, sectionVariants } from "./components/primitives/section";
81
99
  export { SectionHeader } from "./components/primitives/section-header";
100
+ export { SectionNav } from "./components/primitives/section-nav";
101
+ export type { SectionNavProps, SectionNavItem } from "./components/primitives/section-nav";
82
102
  export { ShareButtons } from "./components/primitives/share-buttons";
83
103
  export { SideNav } from "./components/primitives/side-nav";
84
104
  export type { SideNavProps, SideNavGroup, SideNavItem } from "./components/primitives/side-nav";
85
105
  export { SocialLoginButton } from "./components/primitives/social-login-button";
86
106
  export { StatusCountTabs } from "./components/primitives/status-count-tabs";
87
107
  export { Tag, tagVariants } from "./components/primitives/tag";
88
- export { AdminLayout, MissingComponent } from "./components/ec/admin-layout";
108
+ export { WorkspaceShell } from "./components/primitives/workspace-shell";
109
+ export type { WorkspaceShellProps } from "./components/primitives/workspace-shell";
110
+ /**
111
+ * @deprecated 旧名。`WorkspaceShell` を使うこと。
112
+ * `kind:"shell"` の一級概念・Shells セクションに合わせ、接尾辞を Shell に統一した。
113
+ * 次のメジャーで削除する。
114
+ */
115
+ export { WorkspaceShell as WorkspaceLayout } from "./components/primitives/workspace-shell";
116
+ /** @deprecated 旧名。`WorkspaceShellProps` を使うこと。次のメジャーで削除する。 */
117
+ export type { WorkspaceShellProps as WorkspaceLayoutProps } from "./components/primitives/workspace-shell";
118
+ export { AdminShell, MissingComponent } from "./components/ec/admin-shell";
119
+ export type { AdminShellProps } from "./components/ec/admin-shell";
120
+ /**
121
+ * @deprecated 旧名。`AdminShell` を使うこと。
122
+ * `kind:"shell"` の一級概念・Shells セクションに合わせ、接尾辞を Shell に統一した。
123
+ * 次のメジャーで削除する。
124
+ */
125
+ export { AdminShell as AdminLayout } from "./components/ec/admin-shell";
126
+ /** @deprecated 旧名。`AdminShellProps` を使うこと。次のメジャーで削除する。 */
127
+ export type { AdminShellProps as AdminLayoutProps } from "./components/ec/admin-shell";
89
128
  export { AnniversaryCard } from "./components/ec/anniversary-card";
90
129
  export { CakeLogo } from "./components/ec/cake-logo";
130
+ export { ChartControls } from "./components/ec/chart-controls";
91
131
  export { CountdownTimer } from "./components/ec/countdown-timer";
92
132
  export { CouponCard } from "./components/ec/coupon-card";
93
133
  export { DeliveryCalendar } from "./components/ec/delivery-calendar";
@@ -106,8 +146,7 @@ export { RatingStars, SparkleIcon } from "./components/ec/rating-stars";
106
146
  export { ReviewCard } from "./components/ec/review-card";
107
147
  export { ReviewForm } from "./components/ec/review-form";
108
148
  export { ReviewSummary, ReviewItem } from "./components/ec/review-summary";
149
+ export { MypageShell } from "./components/ec/mypage-shell";
150
+ export type { MypageShellProps, MypageShellBreadcrumb } from "./components/ec/mypage-shell";
109
151
  export { ShopCard } from "./components/ec/shop-card";
110
152
  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.7.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Cake.jp Design System — UI コンポーネント・カラートークン・タイポグラフィ",
6
6
  "license": "UNLICENSED",
@@ -35,6 +35,7 @@
35
35
  "CLAUDE.md",
36
36
  "CLAUDE_PRODUCTION.md",
37
37
  "MIGRATION.md",
38
+ "UPDATING.md",
38
39
  "bin",
39
40
  "contracts",
40
41
  "dist",
@@ -86,9 +87,11 @@
86
87
  "lint:scratch": "bash scripts/lint-scratch.sh",
87
88
  "lint:reuse": "bash scripts/check-story-reuse.sh",
88
89
  "lint:border": "node scripts/check-border-color.mjs",
90
+ "lint:docs": "bash scripts/check-docs-drift.sh",
91
+ "typecheck:stories": "tsc --noEmit -p tsconfig.stories.json",
89
92
  "generate:lint-rules": "node scripts/generate-lint-rules.mjs",
90
93
  "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",
94
+ "check": "tsc --noEmit -p tsconfig.app.json && npm run typecheck:stories && 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
95
  "test": "vitest run --config vitest.config.ts"
93
96
  },
94
97
  "dependencies": {
package/src/preset.css CHANGED
@@ -32,6 +32,22 @@
32
32
  /* --- Dark mode variant --- */
33
33
  @custom-variant dark (&:is(.dark *));
34
34
 
35
+ /* --- Container query breakpoints ---
36
+ md / lg は本番(cakejp.css)の「切替段」に合わせる。xl は役割が違い、
37
+ DS が定める「コンテンツ上限段」(本番に対応する切替段は無い)。
38
+ Tailwind v4 既定の --container-md は 28rem(448px) で、本番の SP/PC 境界
39
+ (max-width:767px / min-width:768px)と大きくズレる。DS 内の @md: は
40
+ 「SP/PC の切り替え」の意図で使われているため 768px に再定義する。
41
+ @lg は本番の PC 中段(min-width:960px。既存の @[960px] 群と同じ意図)。
42
+ @xl は本番に対応する切替段が無い DS 独自の「コンテンツ上限段」
43
+ (ページコンテナの標準上限。1280px 以上では原則レイアウト変形を追加しない)。 */
44
+ @theme {
45
+ /* 正本の値は tokens.json(breakpoints)にも記載。変更時は両方を更新する。 */
46
+ --container-md: 48rem; /* 768px — SP/PC 境界(切替段。本番と一致) */
47
+ --container-lg: 60rem; /* 960px — PC 中段(切替段。本番と一致) */
48
+ --container-xl: 80rem; /* 1280px — コンテンツ上限段(DS 定義。本番の切替段ではない) */
49
+ }
50
+
35
51
  /* --- Theme: Tailwind integration --- */
36
52
  @theme inline {
37
53
  /* Radius */
@@ -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