@cakejp/design-system 0.17.1 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +85 -0
- package/CLAUDE.md +16 -0
- package/bin/init.js +191 -28
- package/contracts/components.json +176 -17
- package/contracts/composition.json +1 -1
- package/contracts/rules.json +5 -1
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/admin-shell.js +7 -6
- package/dist/components/ec/order-summary.js +16 -15
- package/dist/components/ec/product-card.js +107 -102
- package/dist/components/ec/product-option.js +1 -0
- package/dist/components/ec/review-card.js +22 -20
- package/dist/components/ec/review-form.js +1 -0
- package/dist/components/foundations/accordion.js +23 -22
- package/dist/components/foundations/alert-dialog.js +7 -7
- package/dist/components/foundations/alert.js +1 -0
- package/dist/components/foundations/aspect-ratio.js +3 -2
- package/dist/components/foundations/avatar.js +1 -0
- package/dist/components/foundations/button.js +7 -1
- package/dist/components/foundations/calendar.js +1 -0
- package/dist/components/foundations/checkbox-group.js +1 -0
- package/dist/components/foundations/checkbox.js +1 -0
- package/dist/components/foundations/command.js +1 -0
- package/dist/components/foundations/context-menu.js +1 -0
- package/dist/components/foundations/data-table.js +489 -16
- package/dist/components/foundations/dialog.js +13 -13
- package/dist/components/foundations/drawer.js +6 -5
- package/dist/components/foundations/file-input.js +1 -0
- package/dist/components/foundations/form.js +26 -25
- package/dist/components/foundations/pagination.js +49 -46
- package/dist/components/foundations/popover.js +9 -8
- package/dist/components/foundations/radio-group.js +3 -2
- package/dist/components/foundations/responsive-dialog.js +1 -0
- package/dist/components/foundations/separator.js +7 -6
- package/dist/components/foundations/sheet.js +41 -34
- package/dist/components/foundations/slider.js +7 -6
- package/dist/components/foundations/social-icon.js +30 -10
- package/dist/components/foundations/sonner.js +5 -4
- package/dist/components/foundations/tabs.js +45 -25
- package/dist/components/foundations/toggle-group.js +6 -5
- package/dist/components/primitives/admin-header.js +1 -1
- package/dist/components/primitives/admin-side-nav.js +196 -86
- package/dist/components/primitives/bottom-tab-bar.js +20 -20
- package/dist/components/primitives/chat-composer.js +1 -0
- package/dist/components/primitives/combobox.js +1 -0
- package/dist/components/primitives/content-card.js +111 -0
- package/dist/components/primitives/content-carousel.js +9 -8
- package/dist/components/primitives/date-picker.js +9 -8
- package/dist/components/primitives/footer.js +169 -100
- package/dist/components/primitives/form-field.js +1 -0
- package/dist/components/primitives/header.js +226 -176
- package/dist/components/primitives/image-carousel.js +8 -7
- package/dist/components/primitives/image-gallery.js +15 -14
- package/dist/components/primitives/image-input.js +9 -8
- package/dist/components/primitives/list-item.js +9 -8
- package/dist/components/primitives/menu-drawer.js +60 -56
- package/dist/components/primitives/multi-select.js +7 -6
- package/dist/components/primitives/number-input.js +1 -0
- package/dist/components/primitives/prose.js +52 -0
- package/dist/components/primitives/search-bar.js +81 -66
- package/dist/components/primitives/section-header.js +58 -55
- package/dist/components/primitives/share-buttons.js +93 -85
- package/dist/components/primitives/status-count-tabs.js +8 -7
- package/dist/components/primitives/sticky-action-bar.js +2 -1
- package/dist/components/primitives/sub-nav.js +52 -52
- package/dist/index.css +1 -1
- package/dist/index.js +2027 -752
- package/dist/lib/field-labelling.js +7 -6
- package/dist/lib/link-component.js +6 -0
- package/dist/lib/use-value-length.js +1 -0
- package/dist/types/components/ec/product-card.d.ts +12 -19
- package/dist/types/components/ec/review-card.d.ts +6 -1
- package/dist/types/components/foundations/button.d.ts +1 -1
- package/dist/types/components/foundations/chip-variants.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +9 -1
- package/dist/types/components/foundations/pagination.d.ts +7 -1
- package/dist/types/components/foundations/sheet.d.ts +6 -1
- package/dist/types/components/foundations/social-icon.d.ts +1 -1
- package/dist/types/components/foundations/tabs.d.ts +2 -1
- package/dist/types/components/primitives/admin-side-nav.d.ts +3 -0
- package/dist/types/components/primitives/content-card.d.ts +67 -0
- package/dist/types/components/primitives/footer.d.ts +21 -1
- package/dist/types/components/primitives/header.d.ts +30 -2
- package/dist/types/components/primitives/menu-drawer.d.ts +7 -1
- package/dist/types/components/primitives/prose.d.ts +35 -0
- package/dist/types/components/primitives/search-bar.d.ts +14 -1
- package/dist/types/components/primitives/section-header.d.ts +2 -1
- package/dist/types/components/primitives/share-buttons.d.ts +26 -4
- package/dist/types/components/primitives/sub-nav.d.ts +16 -1
- package/dist/types/index.d.ts +7 -2
- package/dist/types/lib/link-component.d.ts +35 -0
- package/package.json +5 -4
- package/src/components/COMPONENT_LOOKUP.md +8 -6
- package/src/preset-standalone.css +3 -0
- package/src/preset.css +21 -3
- package/src/styles/semantic.css +11 -0
- package/templates/AGENTS.md +4 -2
- package/templates/AGENTS.stub.md +25 -0
- package/templates/CLAUDE.md +4 -2
- package/templates/CLAUDE.stub.md +25 -0
- package/tokens.json +17 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* リンクの描画に使うコンポーネント(#236)
|
|
4
|
+
*
|
|
5
|
+
* DS 内でリンクを複数描く部品(Footer / MenuDrawer / SubNav / Pagination)は
|
|
6
|
+
* 素の `<a>` を描くため、Next.js の `next/link` 等を差し込めずクライアント遷移に
|
|
7
|
+
* ならない。`asChild` は複数リンクを内部で描く部品には向かないため、
|
|
8
|
+
* 「リンク実装そのもの」を差し替える prop を共通の型で用意する。
|
|
9
|
+
*
|
|
10
|
+
* 例: `<Footer linkComponent={Link} … />`(next/link をそのまま渡せる)
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ `Footer` / `MenuDrawer` は Client Component。React Server Components では
|
|
13
|
+
* Server Component からこの prop を渡すと client 境界を越えて関数を渡すことに
|
|
14
|
+
* なり、`Functions cannot be passed directly to Client Components` で落ちる。
|
|
15
|
+
* Next.js App Router では、この prop を使う呼び出し側を `"use client"` にする
|
|
16
|
+
* (エラーメッセージは `"use server"` を示唆するが、正解は逆)。
|
|
17
|
+
*
|
|
18
|
+
* `Pagination` / `SubNav` / `ContentCard` は Server Component のまま使えるため、
|
|
19
|
+
* この prop を使うだけで呼び出し側を `"use client"` にする必要はない。
|
|
20
|
+
*/
|
|
21
|
+
export type LinkComponent = React.ComponentType<React.AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
22
|
+
href: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* 実際に使うリンク実装を決める。
|
|
26
|
+
*
|
|
27
|
+
* 外部リンク(`target="_blank"` を付けるもの)は framework のリンク部品に通す
|
|
28
|
+
* 意味が無いため、常に素の `<a>` にフォールバックする。
|
|
29
|
+
*
|
|
30
|
+
* `isExternal` を渡せるのは、項目に `external` フラグを持つ `Footer` だけ。
|
|
31
|
+
* MenuDrawer / SubNav / Pagination の項目に `external` は無く、渡した href は
|
|
32
|
+
* すべて `linkComponent` で描かれる(外部 URL を出し分けたい場合は consumer 側で
|
|
33
|
+
* ラップする)。
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveLinkComponent(linkComponent: LinkComponent | undefined, isExternal?: boolean): React.ElementType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cakejp/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cake.jp Design System — UI コンポーネント・カラートークン・タイポグラフィ",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -96,10 +96,11 @@
|
|
|
96
96
|
"generate:lint-rules": "node scripts/generate-lint-rules.mjs",
|
|
97
97
|
"generate:lookup": "node scripts/generate-component-lookup.mjs",
|
|
98
98
|
"lint:contrast": "node scripts/check-contrast.mjs",
|
|
99
|
-
"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 && npm run lint:contrast && bash scripts/lint-scratch.sh --components && bash scripts/check-generated-drift.sh",
|
|
99
|
+
"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 && npm run lint:contrast && bash scripts/lint-scratch.sh --components && bash scripts/check-generated-drift.sh && bash scripts/check-agents-mirror.sh",
|
|
100
100
|
"test": "vitest run --config vitest.config.ts",
|
|
101
101
|
"test:interaction": "vitest run --config vitest.storybook.config.ts",
|
|
102
|
-
"test:a11y": "vitest run --config vitest.a11y.config.ts"
|
|
102
|
+
"test:a11y": "vitest run --config vitest.a11y.config.ts",
|
|
103
|
+
"check:consumer-types": "node scripts/check-consumer-types.mjs"
|
|
103
104
|
},
|
|
104
105
|
"dependencies": {
|
|
105
106
|
"class-variance-authority": "^0.7.1",
|
|
@@ -110,6 +111,7 @@
|
|
|
110
111
|
"react-hook-form": "^7.0.0",
|
|
111
112
|
"sonner": "^2.0.0",
|
|
112
113
|
"tailwind-merge": "^3.5.0",
|
|
114
|
+
"tw-animate-css": "^1.4.0",
|
|
113
115
|
"vaul": "^1.0.0"
|
|
114
116
|
},
|
|
115
117
|
"peerDependencies": {
|
|
@@ -174,7 +176,6 @@
|
|
|
174
176
|
"storybook": "^10.3.3",
|
|
175
177
|
"tailwindcss": "^4.2.1",
|
|
176
178
|
"tsc-alias": "^1.8.16",
|
|
177
|
-
"tw-animate-css": "^1.4.0",
|
|
178
179
|
"typescript": "~5.9.3",
|
|
179
180
|
"typescript-eslint": "^8.48.0",
|
|
180
181
|
"vaul": "^1.1.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
| Spinner | `@/components/foundations/spinner` | — | Default, Small, Large, InlineWithText, FullPage |
|
|
58
58
|
| Switch | `@/components/foundations/switch` | — | Default, ON 状態, 無効, サイズ比較, ブロック型, 通知設定例(リスト型) |
|
|
59
59
|
| Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption | `@/components/foundations/table` | — | Default, フッター付き, 商品比較例, カート注文サマリー |
|
|
60
|
-
| Tabs, TabsList, TabsTrigger, TabsContent | `@/components/foundations/tabs` | **variant**: `underbar`, `segment`<br>**scrollable**: `true` | Default(Underbar), タブ数バリエーション, 横スクロール(多数タブ), PC モード(文字幅ベース), Segment(ピル型), Segment 3択, interaction: クリックと矢印キーでの切り替え |
|
|
60
|
+
| Tabs, TabsList, TabsTrigger, TabsContent | `@/components/foundations/tabs` | **variant**: `underbar`, `segment`<br>**scrollable**: `true`<br>**size**: `md`, `sm` | Default(Underbar), タブ数バリエーション, 横スクロール(多数タブ), PC モード(文字幅ベース), Segment(ピル型), Segment 3択, 狭幅(サイドバー 266px), interaction: クリックと矢印キーでの切り替え |
|
|
61
61
|
| Textarea | `@/components/foundations/textarea` | — | Default, 無効, メッセージカード入力例, エラーパターン, レビュー投稿例, 文字数カウンタ |
|
|
62
62
|
| ToggleGroup, ToggleGroupItem | `@/components/foundations/toggle-group` | **width**: `fit`, `full`<br>**variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg`<br>**variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg` | Default, 複数選択, サイズ, アイコン付き, アイコンのみ, 無効 |
|
|
63
63
|
| Toggle | `@/components/foundations/toggle` | **variant**: `default`, `outline`<br>**size**: `default`, `sm`, `lg` | Default, TextFormatting, FavoriteToggle, Outline, Sizes |
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
| Component | Import | Variants | Stories |
|
|
71
71
|
|-----------|--------|----------|---------|
|
|
72
72
|
| AdminHeader | `@/components/primitives/admin-header` | — | — |
|
|
73
|
-
| AdminSideNav | `@/components/primitives/admin-side-nav` | — |
|
|
73
|
+
| AdminSideNav | `@/components/primitives/admin-side-nav` | — | 下端寄り・多数項目・キーボード操作, interaction: flyout の開閉・フォーカス・viewport 境界 |
|
|
74
74
|
| BannerCarousel | `@/components/primitives/banner-carousel` | — | Default, SmallBanners, LargeBanners |
|
|
75
75
|
| BottomTabBar | `@/components/primitives/bottom-tab-bar` | — | Default(ホーム), アクティブ状態, バッジ付き, バッジオーバーフロー(99+), バナー付き, 記念日アクティブ |
|
|
76
76
|
| BulkActionBar | `@/components/primitives/bulk-action-bar` | — | — |
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
| CoachMark | `@/components/primitives/coach-mark` | — | オンボーディング, 全方向, オンボーディング各方向 |
|
|
82
82
|
| Combobox | `@/components/primitives/combobox` | — | Default |
|
|
83
83
|
| Container | `@/components/primitives/container` | — | Default(page / default gutter), サイズ比較, gutter 比較 |
|
|
84
|
+
| ContentCard, ContentList | `@/components/primitives/content-card` | — | 縦(グリッド一覧), 一覧での高さ揃え, 横(画像が左), リスト(Medium 型), 長いタグラベル |
|
|
84
85
|
| ContentCarousel | `@/components/primitives/content-carousel` | — | ヒーローバナー, 自動再生(5秒), peek表示, 多列カード(PC 3枚), 1枚のみ |
|
|
85
86
|
| DatePicker, DateTimePicker | `@/components/primitives/date-picker` | — | 日付ピッカー, 初期値あり, 選択範囲を制限, 特定日を無効化, FormField 連携, 無効化, クリア可能(任意項目) |
|
|
86
87
|
| EmptyState | `@/components/primitives/empty-state` | — | お気に入り商品(空), カート(空), ブックマーク(空), 検索結果なし, 汎用(説明のみ) |
|
|
@@ -89,7 +90,7 @@
|
|
|
89
90
|
| Footer | `@/components/primitives/footer` | — | Default, 最小構成, SNSリンク付き, 決済方法付き |
|
|
90
91
|
| FormField | `@/components/primitives/form-field` | — | — |
|
|
91
92
|
| FunnelShell | `@/components/primitives/funnel-shell` | — | 注文内容の確認(ご購入手続き) |
|
|
92
|
-
| Header | `@/components/primitives/header` | — | ロゴ+アクション, ロゴ+未ログイン, ロゴ+グローバルナビ+検索スロット(PC), ロゴ+長いナビ(中幅で自動退避), ロゴ+ナビ(navBreakpoint=lg), ロゴセンター(決済・申し込み用), 戻る+タイトル, 戻る+検索バー, 戻る+右側アクション, カスタムロゴ |
|
|
93
|
+
| Header | `@/components/primitives/header` | — | ロゴ+アクション, ロゴ+未ログイン, ロゴ+グローバルナビ+検索スロット(PC), ロゴ+長いナビ(中幅で自動退避), ロゴ+ナビ(navBreakpoint=lg), containerSize=page(本文と左端を揃える), ロゴセンター(決済・申し込み用), 戻る+タイトル, 戻る+検索バー, 戻る+右側アクション, カスタムロゴ |
|
|
93
94
|
| ImageCarousel | `@/components/primitives/image-carousel` | — | バナーカルーセル, 横長バナー, 正方形(商品画像), OGP比率, 自動再生(3秒), PC幅(ビューポート切替で確認), トップページ ヒーローバナー |
|
|
94
95
|
| ImageGallery | `@/components/primitives/image-gallery` | — | ドット付き, サムネイル付き, バナー(16:9), PC商品詳細, 単一画像 |
|
|
95
96
|
| ImageInput | `@/components/primitives/image-input` | **aspect**: `square`, `landscape`<br>**size**: `sm`, `md`, `lg` | 基本, 保存済み画像あり, 表示サイズ, FormField 連携, 検証エラー, クリア不可, 無効化 |
|
|
@@ -103,12 +104,13 @@
|
|
|
103
104
|
| NumberInput, QuantitySelector | `@/components/primitives/number-input` | — | Default, コンパクト型(sm), サイズ比較, 最小・最大値, 無効状態, エラー状態, ゴミ箱アイコン, ゴミ箱+削除確認ダイアログ, 直接入力パターン, 商品詳細での使用例, カート内での使用例, 価格・在庫入力(管理画面), interaction: 増減と min/max のクランプ |
|
|
104
105
|
| PriceDisplay | `@/components/primitives/price-display` | — | Default, セール価格, サイズ比較, セール × サイズ, 税込ラベルなし, 高額商品, 価格レンジ |
|
|
105
106
|
| ProgressSteps | `@/components/primitives/progress-steps` | — | ステップ1(カート), ステップ2(注文内容), ステップ3(確認), ステップ4(完了), 全ステップ一覧, 会員登録フロー |
|
|
106
|
-
|
|
|
107
|
+
| Prose | `@/components/primitives/prose` | — | 記事本文(Container narrow と組み合わせ), children を包む, 幅の広い表(ページを横に伸ばさない) |
|
|
108
|
+
| SearchBar | `@/components/primitives/search-bar` | — | Default, Small(ヘッダー向け), form モード(JS 不要・SEO 向け), カスタムプレースホルダー |
|
|
107
109
|
| SearchPanel | `@/components/primitives/search-panel` | — | — |
|
|
108
|
-
| SectionHeader | `@/components/primitives/section-header` | — | Default, サブタイトル付き, リンクなし, カスタムラベル, カルーセルナビ付き, ナビのみ, ナビ(先頭位置), アクションボタン付き, サブタイトル + アクション, サイズ一覧, キャプション付きサイズ比較, align=, LPヒーロー(SP 3xl / PC 5xl), align=, start / center 比較 |
|
|
110
|
+
| SectionHeader | `@/components/primitives/section-header` | — | Default, サブタイトル付き, リンクなし, カスタムラベル, カルーセルナビ付き, ナビのみ, ナビ(先頭位置), アクションボタン付き, サブタイトル + アクション, 狭幅のサブタイトル + アクション, サイズ一覧, キャプション付きサイズ比較, align=, LPヒーロー(SP 3xl / PC 5xl), align=, start / center 比較 |
|
|
109
111
|
| SectionNav | `@/components/primitives/section-nav` | — | Vertical, Horizontal |
|
|
110
112
|
| Section | `@/components/primitives/section` | — | 推奨: Section + Container, 背景画像 + scrim, 背景バリアント, 縦 spacing バリアント, 配下 Card のサーフェス伝播, ランディング見出し |
|
|
111
|
-
| ShareButtons | `@/components/primitives/share-buttons` | — | Default,
|
|
113
|
+
| ShareButtons | `@/components/primitives/share-buttons` | — | Default, コピーフィードバック, 共有先を指定(Facebook / はてブ), 組み込みに無い共有先を足す |
|
|
112
114
|
| SideNav | `@/components/primitives/side-nav` | — | Default, WithGroupLabels, MypageExample, PrefixMatch |
|
|
113
115
|
| SocialLoginButton | `@/components/primitives/social-login-button` | — | LINE, フルサイズ一覧, アイコンのみ |
|
|
114
116
|
| StandardPageShell | `@/components/primitives/standard-page-shell` | — | 検索結果ページ |
|
|
@@ -191,6 +191,7 @@
|
|
|
191
191
|
--Surface-Primary: #FFFFFF;
|
|
192
192
|
--Surface-Secondary: #FBF9F8;
|
|
193
193
|
--Surface-Tertiary: #F4F2F1;
|
|
194
|
+
--Surface-Elevated: #FFFFFF;
|
|
194
195
|
--Surface-Caution: #EC0000;
|
|
195
196
|
--Surface-Caution-Light: #FFE7E6;
|
|
196
197
|
--Surface-Accent-Primary: #E04B00;
|
|
@@ -266,12 +267,14 @@
|
|
|
266
267
|
--Third-Party-LINE: #06C755;
|
|
267
268
|
--Third-Party-Apple: #000000;
|
|
268
269
|
--Third-Party-X: #000000;
|
|
270
|
+
--Third-Party-Hatena: #00A4DE;
|
|
269
271
|
}
|
|
270
272
|
|
|
271
273
|
.dark {
|
|
272
274
|
--Surface-Primary: #000000E5;
|
|
273
275
|
--Surface-Secondary: #FFFFFF1A;
|
|
274
276
|
--Surface-Tertiary: #FFFFFF33;
|
|
277
|
+
--Surface-Elevated: #3A3736;
|
|
275
278
|
--Surface-Caution: #EC0000;
|
|
276
279
|
--Surface-Caution-Light: #FFE7E6;
|
|
277
280
|
--Surface-Accent-Primary: #E04B00;
|
package/src/preset.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - シャドウ・角丸トークン
|
|
20
20
|
* - モーショントークン(--Motion-Duration-* / --Motion-Easing-*)
|
|
21
21
|
* - 重なり順トークン(--Z-*)
|
|
22
|
-
* -
|
|
22
|
+
* - アニメーションユーティリティ(tw-animate-css の animate-in 系 + 独自 keyframes)
|
|
23
23
|
* - 見た目を変えず44pxの操作領域を確保する tap-target ユーティリティ
|
|
24
24
|
* ============================================ */
|
|
25
25
|
|
|
@@ -35,6 +35,16 @@
|
|
|
35
35
|
/* --- Layer 4: Motion Tokens (duration / easing) --- */
|
|
36
36
|
@import "./styles/motion.css";
|
|
37
37
|
|
|
38
|
+
/* --- Layer 5: Animation Utilities (tw-animate-css) ---
|
|
39
|
+
foundations の 12 部品(Dialog / Sheet / Popover / DropdownMenu / Select /
|
|
40
|
+
Tooltip / Drawer / AlertDialog / HoverCard / ContextMenu / Menubar /
|
|
41
|
+
NavigationMenu)が使う animate-in / zoom-in-* / slide-in-from-* は
|
|
42
|
+
Tailwind 本体ではなく tw-animate-css のユーティリティ。preset が配らないと、
|
|
43
|
+
自分で tw-animate-css を入れた consumer だけアニメーションが動く暗黙依存になる
|
|
44
|
+
(実例: cakejp-biz-mag のモバイルメニューが無言で無アニメーションだった)。
|
|
45
|
+
パッケージ解決で consumer の node_modules から読む(DS の dependency)。 */
|
|
46
|
+
@import "tw-animate-css";
|
|
47
|
+
|
|
38
48
|
/* --- Dark mode variant --- */
|
|
39
49
|
@custom-variant dark (&:is(.dark *));
|
|
40
50
|
|
|
@@ -52,6 +62,14 @@
|
|
|
52
62
|
--container-md: 48rem; /* 768px — SP/PC 境界(切替段。本番と一致) */
|
|
53
63
|
--container-lg: 60rem; /* 960px — PC 中段(切替段。本番と一致) */
|
|
54
64
|
--container-xl: 80rem; /* 1280px — コンテンツ上限段(DS 定義。本番の切替段ではない) */
|
|
65
|
+
|
|
66
|
+
/* ビューポート用(consumer の md: / lg: / xl:)。コンテナクエリ段と同じ値に揃える。
|
|
67
|
+
Tailwind v4 既定の --breakpoint-lg は 64rem(1024px) で、DS の PC 中段 960px と
|
|
68
|
+
64px ずれる。preset が配らないと全 consumer が @theme で書き直す必要があり、
|
|
69
|
+
書き忘れたプロダクトだけ切替位置がずれる(issue #242)。 */
|
|
70
|
+
--breakpoint-md: 48rem; /* 768px — SP/PC 境界 */
|
|
71
|
+
--breakpoint-lg: 60rem; /* 960px — PC 中段 */
|
|
72
|
+
--breakpoint-xl: 80rem; /* 1280px — コンテンツ上限段 */
|
|
55
73
|
}
|
|
56
74
|
|
|
57
75
|
/* --- Theme: Tailwind integration --- */
|
|
@@ -226,7 +244,7 @@
|
|
|
226
244
|
--foreground: var(--Text-High-Emphasis);
|
|
227
245
|
--card: var(--Surface-Secondary);
|
|
228
246
|
--card-foreground: var(--Text-High-Emphasis);
|
|
229
|
-
--popover: var(--Surface-
|
|
247
|
+
--popover: var(--Surface-Elevated);
|
|
230
248
|
--popover-foreground: var(--Text-High-Emphasis);
|
|
231
249
|
--primary: var(--Brand-Cake-Orange);
|
|
232
250
|
--primary-foreground: var(--Text-on-Inverse);
|
|
@@ -262,7 +280,7 @@
|
|
|
262
280
|
--foreground: var(--Text-High-Emphasis);
|
|
263
281
|
--card: var(--Surface-Secondary);
|
|
264
282
|
--card-foreground: var(--Text-High-Emphasis);
|
|
265
|
-
--popover: var(--Surface-
|
|
283
|
+
--popover: var(--Surface-Elevated);
|
|
266
284
|
--popover-foreground: var(--Text-High-Emphasis);
|
|
267
285
|
--primary: var(--Brand-Cake-Orange);
|
|
268
286
|
--primary-foreground: var(--Text-on-Inverse);
|
package/src/styles/semantic.css
CHANGED
|
@@ -16,6 +16,12 @@
|
|
|
16
16
|
--Surface-Primary: var(--Primitive-White-alpha-1000);
|
|
17
17
|
--Surface-Secondary: var(--Primitive-Gray-50);
|
|
18
18
|
--Surface-Tertiary: var(--Primitive-Gray-100);
|
|
19
|
+
/* 浮遊レイヤー(メニュー・ポップオーバー・ダイアログ・シート)と、
|
|
20
|
+
スクロール内容の上に重なるエッジ固定バー(Header / StickyActionBar /
|
|
21
|
+
BottomTabBar / AdminHeader / AdminSideNav / OrderSummary fixed)の地。
|
|
22
|
+
任意のコンテンツの上に重なるので必ず不透明にする(issue #262)。
|
|
23
|
+
light は Surface-Primary と同値(元から不透明)。 */
|
|
24
|
+
--Surface-Elevated: var(--Primitive-White-alpha-1000);
|
|
19
25
|
--Surface-Caution: var(--Primitive-Sun-800);
|
|
20
26
|
--Surface-Caution-Light: var(--Primitive-Sun-50);
|
|
21
27
|
--Surface-Accent-Primary: var(--Primitive-Orange-700);
|
|
@@ -116,6 +122,7 @@
|
|
|
116
122
|
--Third-Party-LINE: #06C755FF;
|
|
117
123
|
--Third-Party-Apple: #000000FF;
|
|
118
124
|
--Third-Party-X: #000000FF;
|
|
125
|
+
--Third-Party-Hatena: #00A4DEFF;
|
|
119
126
|
}
|
|
120
127
|
|
|
121
128
|
/* ============================================
|
|
@@ -128,6 +135,10 @@
|
|
|
128
135
|
--Surface-Primary: var(--Primitive-Gray-alpha-900);
|
|
129
136
|
--Surface-Secondary: var(--Primitive-White-alpha-100);
|
|
130
137
|
--Surface-Tertiary: var(--Primitive-White-alpha-200);
|
|
138
|
+
/* dark の Surface-Primary は #000000E5 でアルファ付き。ページ地としては
|
|
139
|
+
下地に合成される前提なので妥当だが、浮遊レイヤーに使うと後ろが透ける。
|
|
140
|
+
一段明るい不透明色を elevation として持つ(issue #262)。 */
|
|
141
|
+
--Surface-Elevated: var(--Primitive-Gray-800);
|
|
131
142
|
--Surface-Caution: var(--Primitive-Sun-800);
|
|
132
143
|
--Surface-Caution-Light: var(--Primitive-Sun-50);
|
|
133
144
|
--Surface-Accent-Primary: var(--Primitive-Orange-700);
|
package/templates/AGENTS.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DS 共通ルールの正本。npm package に同梱され、consumer からは
|
|
3
|
+
node_modules/@cakejp/design-system/templates/ 配下を参照して読む。
|
|
4
|
+
consumer のリポジトリへ本文をコピーしないこと(写しは必ず古くなる)。
|
|
5
|
+
consumer ルートに置かれるのは、この正本を指すポインタ(*.stub.md)だけ。
|
|
4
6
|
-->
|
|
5
7
|
|
|
6
8
|
# このプロジェクトは @cakejp/design-system に準拠する
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
このファイルは @cakejp/design-system の postinstall で自動設置されました。
|
|
3
|
+
DS 共通ルールは package 内の正本を参照します(このファイルへは複製しません)。
|
|
4
|
+
プロジェクト固有のルールは下の「プロジェクト固有ルール」以下へ自由に書けます。
|
|
5
|
+
DS 側の更新は npm install だけで反映されるため、書き写す必要はありません。
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# このプロジェクトは @cakejp/design-system に準拠する
|
|
9
|
+
|
|
10
|
+
Codex(および他の AI エージェント)は UI を作成・変更・レビューする前に、
|
|
11
|
+
**DS 共通ルールの正本を必ず読み込むこと**。
|
|
12
|
+
|
|
13
|
+
## 📖 DS 共通ルール(正本・必読)
|
|
14
|
+
|
|
15
|
+
- `node_modules/@cakejp/design-system/templates/AGENTS.md`
|
|
16
|
+
|
|
17
|
+
このファイルへ内容を書き写さないこと。**手元の写しは必ず古くなる**(DS 側にルールが
|
|
18
|
+
追加されても写しには反映されない)。正本は `npm install` のたびに最新へ更新される。
|
|
19
|
+
|
|
20
|
+
正本から辿る必読ファイル(`CLAUDE.md` / `contracts/*.json` / `tokens.json` 等)も
|
|
21
|
+
すべて `node_modules/@cakejp/design-system/` 配下にある。
|
|
22
|
+
|
|
23
|
+
## プロジェクト固有ルール
|
|
24
|
+
|
|
25
|
+
<!-- ここから下はプロジェクト固有。DS の更新で上書きされません。 -->
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
DS 共通ルールの正本。npm package に同梱され、consumer からは
|
|
3
|
+
node_modules/@cakejp/design-system/templates/ 配下を参照して読む。
|
|
4
|
+
consumer のリポジトリへ本文をコピーしないこと(写しは必ず古くなる)。
|
|
5
|
+
consumer ルートに置かれるのは、この正本を指すポインタ(*.stub.md)だけ。
|
|
4
6
|
-->
|
|
5
7
|
|
|
6
8
|
# このプロジェクトは @cakejp/design-system に準拠する
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
このファイルは @cakejp/design-system の postinstall で自動設置されました。
|
|
3
|
+
DS 共通ルールは package 内の正本を参照します(このファイルへは複製しません)。
|
|
4
|
+
プロジェクト固有のルールは下の「プロジェクト固有ルール」以下へ自由に書けます。
|
|
5
|
+
DS 側の更新は npm install だけで反映されるため、書き写す必要はありません。
|
|
6
|
+
-->
|
|
7
|
+
|
|
8
|
+
# このプロジェクトは @cakejp/design-system に準拠する
|
|
9
|
+
|
|
10
|
+
Claude Code(および他の AI エージェント)は UI を作成・変更・レビューする前に、
|
|
11
|
+
**DS 共通ルールの正本を必ず読み込むこと**。
|
|
12
|
+
|
|
13
|
+
## 📖 DS 共通ルール(正本・必読)
|
|
14
|
+
|
|
15
|
+
- `node_modules/@cakejp/design-system/templates/CLAUDE.md`
|
|
16
|
+
|
|
17
|
+
このファイルへ内容を書き写さないこと。**手元の写しは必ず古くなる**(DS 側にルールが
|
|
18
|
+
追加されても写しには反映されない)。正本は `npm install` のたびに最新へ更新される。
|
|
19
|
+
|
|
20
|
+
正本から辿る必読ファイル(`CLAUDE.md` / `contracts/*.json` / `tokens.json` 等)も
|
|
21
|
+
すべて `node_modules/@cakejp/design-system/` 配下にある。
|
|
22
|
+
|
|
23
|
+
## プロジェクト固有ルール
|
|
24
|
+
|
|
25
|
+
<!-- ここから下はプロジェクト固有。DS の更新で上書きされません。 -->
|
package/tokens.json
CHANGED
|
@@ -119,6 +119,11 @@
|
|
|
119
119
|
"hex": "#F4F2F1",
|
|
120
120
|
"usage": "ターシャリ背景"
|
|
121
121
|
},
|
|
122
|
+
"elevated": {
|
|
123
|
+
"value": "Primitive-White-alpha-1000",
|
|
124
|
+
"hex": "#FFFFFF",
|
|
125
|
+
"usage": "浮遊レイヤー(メニュー・ポップオーバー・ダイアログ・シート)と、スクロール内容の上に重なるエッジ固定バー(Header / StickyActionBar / BottomTabBar 等)の地。必ず不透明にする"
|
|
126
|
+
},
|
|
122
127
|
"caution": {
|
|
123
128
|
"value": "Primitive-Sun-800",
|
|
124
129
|
"hex": "#EC0000",
|
|
@@ -463,6 +468,10 @@
|
|
|
463
468
|
"x": {
|
|
464
469
|
"value": "#000000FF",
|
|
465
470
|
"usage": "Third-Party-X のCSS契約値"
|
|
471
|
+
},
|
|
472
|
+
"hatena": {
|
|
473
|
+
"value": "#00A4DEFF",
|
|
474
|
+
"usage": "Third-Party-Hatena のCSS契約値(はてなブックマーク)"
|
|
466
475
|
}
|
|
467
476
|
}
|
|
468
477
|
},
|
|
@@ -480,6 +489,10 @@
|
|
|
480
489
|
"value": "var(--Primitive-White-alpha-200)",
|
|
481
490
|
"usage": "Surface-Tertiary のCSS契約値"
|
|
482
491
|
},
|
|
492
|
+
"elevated": {
|
|
493
|
+
"value": "var(--Primitive-Gray-800)",
|
|
494
|
+
"usage": "Surface-Elevated のCSS契約値"
|
|
495
|
+
},
|
|
483
496
|
"caution": {
|
|
484
497
|
"value": "var(--Primitive-Sun-800)",
|
|
485
498
|
"usage": "Surface-Caution のCSS契約値"
|
|
@@ -931,11 +944,12 @@
|
|
|
931
944
|
}
|
|
932
945
|
},
|
|
933
946
|
"breakpoints": {
|
|
934
|
-
"comment": "役割は二層。(1) 切替段=md / lg の2つだけ(値は本番 cakejp.css の境界に一致させた正本。レイアウトの変形はこの2段でのみ行う)。(2) 上限段=xl(1280。「切替段」ではなく DS が定めるコンテンツ幅の上限段。本番に 1280 の切替段は無い=1025/1441 はある)。DS 内部はコンテナクエリ @md: / @lg: / @xl:(preset.css の --container-md / --container-lg / --container-xl)で参照し、生 CSS ではこの px 値をメディアクエリに直書きする(CSS
|
|
947
|
+
"comment": "役割は二層。(1) 切替段=md / lg の2つだけ(値は本番 cakejp.css の境界に一致させた正本。レイアウトの変形はこの2段でのみ行う)。(2) 上限段=xl(1280。「切替段」ではなく DS が定めるコンテンツ幅の上限段。本番に 1280 の切替段は無い=1025/1441 はある)。DS 内部はコンテナクエリ @md: / @lg: / @xl:(preset.css の --container-md / --container-lg / --container-xl)で参照し、生 CSS ではこの px 値をメディアクエリに直書きする(CSS 変数はメディアクエリに使えないため、値の配布は本トークンが担う)。consumer が書くビューポートの md: / lg: / xl: も preset.css の --breakpoint-md / --breakpoint-lg / --breakpoint-xl が同じ段に揃える(Tailwind v4 既定の lg は 1024px で DS の 960px と 64px ずれるため)。値を変えるときは tokens.json と preset.css の --container-* / --breakpoint-* を必ず同時に更新する。独自のブレイクポイント値を発明しない",
|
|
935
948
|
"md": {
|
|
936
949
|
"px": 768,
|
|
937
950
|
"rem": "48rem",
|
|
938
951
|
"container": "--container-md",
|
|
952
|
+
"viewport": "--breakpoint-md",
|
|
939
953
|
"role": "切替段",
|
|
940
954
|
"usage": "SP/PC 境界。767px 以下=SP / 768px 以上=PC。本番 cakejp.css の max-width:767px / min-width:768px と一致"
|
|
941
955
|
},
|
|
@@ -943,6 +957,7 @@
|
|
|
943
957
|
"px": 960,
|
|
944
958
|
"rem": "60rem",
|
|
945
959
|
"container": "--container-lg",
|
|
960
|
+
"viewport": "--breakpoint-lg",
|
|
946
961
|
"role": "切替段",
|
|
947
962
|
"usage": "PC 中段。本番 cakejp.css の min-width:960px 段と一致"
|
|
948
963
|
},
|
|
@@ -950,6 +965,7 @@
|
|
|
950
965
|
"px": 1280,
|
|
951
966
|
"rem": "80rem",
|
|
952
967
|
"container": "--container-xl",
|
|
968
|
+
"viewport": "--breakpoint-xl",
|
|
953
969
|
"role": "上限段",
|
|
954
970
|
"usage": "コンテンツ上限段(切替段ではない)。ページコンテナの標準上限で、1280px 以上では原則レイアウト変形を追加しない。本番 cakejp.css に 1280 の切替段は無い(1025 / 1441 はある)——DS が定める標準上限。実例: MypageShell の PC グリッド max-w-[1280px]"
|
|
955
971
|
}
|