@cakejp/design-system 0.15.0 → 0.17.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 +63 -0
- package/CLAUDE.md +1 -0
- package/bin/init.js +29 -6
- package/contracts/components.json +45 -8
- package/contracts/composition.json +8 -2
- package/contracts/rules.json +14 -2
- package/contracts/screen-patterns.json +1 -1
- package/dist/components/ec/_mypage-menu-data.js +166 -0
- package/dist/components/ec/admin-shell.js +202 -0
- package/dist/components/ec/anniversary-card.js +63 -0
- package/dist/components/ec/cake-logo.js +38 -0
- package/dist/components/ec/chart-controls.js +91 -0
- package/dist/components/ec/countdown-timer.js +50 -0
- package/dist/components/ec/coupon-card.js +136 -0
- package/dist/components/ec/delivery-calendar.js +105 -0
- package/dist/components/ec/mypage-shell.js +98 -0
- package/dist/components/ec/order-section.js +53 -0
- package/dist/components/ec/order-summary.js +78 -0
- package/dist/components/ec/payment-method.js +81 -0
- package/dist/components/ec/product-card.js +235 -0
- package/dist/components/ec/product-carousel.js +106 -0
- package/dist/components/ec/product-cta.js +80 -0
- package/dist/components/ec/product-detail-bar.js +86 -0
- package/dist/components/ec/product-detail-sidebar.js +296 -0
- package/dist/components/ec/product-list-item.js +266 -0
- package/dist/components/ec/product-option.js +165 -0
- package/dist/components/ec/rating-stars.js +74 -0
- package/dist/components/ec/review-card.js +126 -0
- package/dist/components/ec/review-form.js +181 -0
- package/dist/components/ec/review-summary.js +95 -0
- package/dist/components/ec/shop-card.js +179 -0
- package/dist/components/ec/stat-card.js +50 -0
- package/dist/components/foundations/accordion.js +67 -0
- package/dist/components/foundations/alert-dialog.js +165 -0
- package/dist/components/foundations/alert.js +218 -0
- package/dist/components/foundations/aspect-ratio.js +10 -0
- package/dist/components/foundations/avatar.js +58 -0
- package/dist/components/foundations/badge.js +54 -0
- package/dist/components/foundations/breadcrumb.js +104 -0
- package/dist/components/foundations/button.js +99 -0
- package/dist/components/foundations/calendar.js +173 -0
- package/dist/components/foundations/card.js +109 -0
- package/dist/components/foundations/checkbox-card.js +111 -0
- package/dist/components/foundations/checkbox-group.js +92 -0
- package/dist/components/foundations/checkbox.js +90 -0
- package/dist/components/foundations/chip-variants.js +41 -0
- package/dist/components/foundations/collapsible.js +34 -0
- package/dist/components/foundations/command.js +171 -0
- package/dist/components/foundations/context-menu.js +225 -0
- package/dist/components/foundations/data-table.js +59 -0
- package/dist/components/foundations/dialog.js +148 -0
- package/dist/components/foundations/drawer.js +129 -0
- package/dist/components/foundations/dropdown-menu.js +232 -0
- package/dist/components/foundations/field.js +150 -0
- package/dist/components/foundations/file-input.js +116 -0
- package/dist/components/foundations/form.js +101 -0
- package/dist/components/foundations/hover-card.js +41 -0
- package/dist/components/foundations/icon-badge.js +41 -0
- package/dist/components/foundations/input.js +74 -0
- package/dist/components/foundations/label.js +29 -0
- package/dist/components/foundations/menubar.js +252 -0
- package/dist/components/foundations/navigation-menu.js +171 -0
- package/dist/components/foundations/pagination.js +120 -0
- package/dist/components/foundations/popover.js +45 -0
- package/dist/components/foundations/progress.js +34 -0
- package/dist/components/foundations/radio-group.js +134 -0
- package/dist/components/foundations/responsive-dialog.js +76 -0
- package/dist/components/foundations/scroll-area.js +62 -0
- package/dist/components/foundations/select.js +190 -0
- package/dist/components/foundations/separator.js +27 -0
- package/dist/components/foundations/sheet.js +130 -0
- package/dist/components/foundations/skeleton.js +15 -0
- package/dist/components/foundations/skip-link.js +27 -0
- package/dist/components/foundations/slider.js +81 -0
- package/dist/components/foundations/social-icon.js +36 -0
- package/dist/components/foundations/sonner.js +49 -0
- package/dist/components/foundations/spinner.js +28 -0
- package/dist/components/foundations/switch.js +54 -0
- package/dist/components/foundations/table.js +115 -0
- package/dist/components/foundations/tabs.js +102 -0
- package/dist/components/foundations/textarea.js +65 -0
- package/dist/components/foundations/toggle-group.js +107 -0
- package/dist/components/foundations/toggle.js +44 -0
- package/dist/components/foundations/tooltip.js +56 -0
- package/dist/components/primitives/admin-header.js +31 -0
- package/dist/components/primitives/admin-side-nav.js +135 -0
- package/dist/components/primitives/banner-carousel.js +97 -0
- package/dist/components/primitives/bottom-tab-bar.js +81 -0
- package/dist/components/primitives/bulk-action-bar.js +27 -0
- package/dist/components/primitives/category-scroll.js +110 -0
- package/dist/components/primitives/category-shortcuts.js +66 -0
- package/dist/components/primitives/chat-composer.js +141 -0
- package/dist/components/primitives/chip.js +123 -0
- package/dist/components/primitives/coach-mark.js +102 -0
- package/dist/components/primitives/combobox.js +88 -0
- package/dist/components/primitives/container.js +50 -0
- package/dist/components/primitives/content-carousel.js +144 -0
- package/dist/components/primitives/date-picker.js +175 -0
- package/dist/components/primitives/empty-state.js +32 -0
- package/dist/components/primitives/error-state.js +115 -0
- package/dist/components/primitives/filter-bar.js +144 -0
- package/dist/components/primitives/footer.js +247 -0
- package/dist/components/primitives/form-field.js +38 -0
- package/dist/components/primitives/funnel-shell.js +99 -0
- package/dist/components/primitives/header.js +257 -0
- package/dist/components/primitives/image-carousel.js +156 -0
- package/dist/components/primitives/image-gallery.js +177 -0
- package/dist/components/primitives/image-input.js +207 -0
- package/dist/components/primitives/image-uploader.js +69 -0
- package/dist/components/primitives/kebab-menu.js +40 -0
- package/dist/components/primitives/list-item.js +80 -0
- package/dist/components/primitives/menu-drawer.js +154 -0
- package/dist/components/primitives/multi-select.js +93 -0
- package/dist/components/primitives/notification-badge.js +61 -0
- package/dist/components/primitives/notification-list.js +72 -0
- package/dist/components/primitives/number-input.js +235 -0
- package/dist/components/primitives/price-display.js +101 -0
- package/dist/components/primitives/progress-steps.js +62 -0
- package/dist/components/primitives/search-bar.js +81 -0
- package/dist/components/primitives/search-panel.js +43 -0
- package/dist/components/primitives/section-header.js +148 -0
- package/dist/components/primitives/section-nav.js +85 -0
- package/dist/components/primitives/section.js +78 -0
- package/dist/components/primitives/share-buttons.js +102 -0
- package/dist/components/primitives/side-nav.js +98 -0
- package/dist/components/primitives/social-login-button.js +53 -0
- package/dist/components/primitives/standard-page-shell.js +34 -0
- package/dist/components/primitives/status-count-tabs.js +42 -0
- package/dist/components/primitives/sticky-action-bar.js +26 -0
- package/dist/components/primitives/sub-nav.js +67 -0
- package/dist/components/primitives/tag.js +57 -0
- package/dist/components/primitives/timeline.js +55 -0
- package/dist/components/primitives/workspace-shell.js +57 -0
- package/dist/index.css +1 -1
- package/dist/index.js +22961 -13082
- package/dist/lib/field-labelling.js +29 -0
- package/dist/lib/focus-ring.js +6 -0
- package/dist/lib/pagination-range.js +42 -0
- package/dist/lib/use-value-length.js +63 -0
- package/dist/lib/utils.js +33 -0
- package/dist/types/components/ec/_mypage-menu-data.d.ts +3 -3
- package/dist/types/components/ec/admin-shell.d.ts +1 -1
- package/dist/types/components/ec/anniversary-card.d.ts +1 -1
- package/dist/types/components/ec/mypage-shell.d.ts +3 -3
- package/dist/types/components/ec/product-card.d.ts +1 -1
- package/dist/types/components/ec/product-carousel.d.ts +3 -3
- package/dist/types/components/ec/stat-card.d.ts +1 -1
- package/dist/types/components/foundations/accordion.d.ts +8 -1
- package/dist/types/components/foundations/alert-dialog.d.ts +1 -1
- package/dist/types/components/foundations/calendar.d.ts +1 -1
- package/dist/types/components/foundations/checkbox-group.d.ts +1 -1
- package/dist/types/components/foundations/command.d.ts +1 -1
- package/dist/types/components/foundations/data-table.d.ts +6 -1
- package/dist/types/components/foundations/field.d.ts +2 -2
- package/dist/types/components/foundations/file-input.d.ts +1 -1
- package/dist/types/components/foundations/pagination.d.ts +1 -1
- package/dist/types/components/foundations/responsive-dialog.d.ts +1 -1
- package/dist/types/components/foundations/skip-link.d.ts +1 -1
- package/dist/types/components/foundations/slider.d.ts +13 -1
- package/dist/types/components/primitives/admin-header.d.ts +11 -1
- package/dist/types/components/primitives/admin-side-nav.d.ts +19 -1
- package/dist/types/components/primitives/banner-carousel.d.ts +2 -2
- package/dist/types/components/primitives/category-scroll.d.ts +2 -2
- package/dist/types/components/primitives/category-shortcuts.d.ts +1 -1
- package/dist/types/components/primitives/chat-composer.d.ts +1 -1
- package/dist/types/components/primitives/chip.d.ts +1 -1
- package/dist/types/components/primitives/combobox.d.ts +9 -1
- package/dist/types/components/primitives/content-carousel.d.ts +1 -1
- package/dist/types/components/primitives/form-field.d.ts +1 -1
- package/dist/types/components/primitives/image-input.d.ts +1 -1
- package/dist/types/components/primitives/kebab-menu.d.ts +1 -1
- package/dist/types/components/primitives/menu-drawer.d.ts +0 -16
- package/dist/types/components/primitives/multi-select.d.ts +9 -1
- package/dist/types/components/primitives/notification-list.d.ts +1 -1
- package/dist/types/components/primitives/search-panel.d.ts +1 -1
- package/dist/types/components/primitives/section-nav.d.ts +1 -1
- package/dist/types/components/primitives/side-nav.d.ts +1 -1
- package/dist/types/components/primitives/social-login-button.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/field-labelling.d.ts +66 -0
- package/dist/types/lib/focus-ring.d.ts +42 -0
- package/package.json +2 -2
- package/scripts/codemod/README.md +9 -0
- package/src/components/COMPONENT_LOOKUP.md +1 -1
- package/src/preset-standalone.css +15 -0
- package/src/preset.css +15 -1
|
@@ -43,7 +43,7 @@ export interface SectionNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
43
43
|
*
|
|
44
44
|
* ### インポート
|
|
45
45
|
* ```tsx
|
|
46
|
-
* import { SectionNav } from '
|
|
46
|
+
* import { SectionNav } from '../../../components/primitives/section-nav'
|
|
47
47
|
* ```
|
|
48
48
|
*
|
|
49
49
|
* ### 使い方(vertical=既定)
|
|
@@ -51,7 +51,7 @@ export interface SideNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
51
51
|
*
|
|
52
52
|
* ### インポート
|
|
53
53
|
* ```tsx
|
|
54
|
-
* import { SideNav } from '
|
|
54
|
+
* import { SideNav } from '../../../components/primitives/side-nav'
|
|
55
55
|
* ```
|
|
56
56
|
*
|
|
57
57
|
* ### 使い方
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { type SocialPlatform } from "
|
|
2
|
+
import { type SocialPlatform } from "../../../components/foundations/social-icon";
|
|
3
3
|
export type SocialProvider = Extract<SocialPlatform, "line" | "amazon" | "google" | "apple">;
|
|
4
4
|
export interface SocialLoginButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
5
|
/** ソーシャルプロバイダー */
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
export { cn } from "./lib/utils";
|
|
3
|
+
export { FOCUS_RING, FOCUS_RING_WITHIN, FOCUS_RING_INSET } from "./lib/focus-ring";
|
|
3
4
|
export { toast } from "sonner";
|
|
4
5
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/foundations/accordion";
|
|
5
6
|
export { Alert, AlertDescription, AlertTitle } from "./components/foundations/alert";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ## フィールドのラベル関連付け(DS 全体の方針 / issue #202)
|
|
3
|
+
*
|
|
4
|
+
* Radix ベースのコントロール(Select / Switch / Checkbox / Slider 等)は
|
|
5
|
+
* `<button>` や `<span role="...">` として描画されるため、**隣に `<Label htmlFor>` を
|
|
6
|
+
* 置いてもアクセシブルネームにならない**(`<label for>` が名前を与えるのは
|
|
7
|
+
* labelable な要素だけで、`<button>` は対象外)。
|
|
8
|
+
*
|
|
9
|
+
* そこで DS は次の方針を採る:
|
|
10
|
+
*
|
|
11
|
+
* 1. フィールドのラッパー(`FormField`)がラベル要素に **id を採番**し、
|
|
12
|
+
* その id を context で配下のコントロールへ渡す。
|
|
13
|
+
* 2. コントロール側は `aria-labelledby` を **既定値として** その id にする。
|
|
14
|
+
* 利用側が `aria-label` / `aria-labelledby` を明示した場合はそちらを優先する。
|
|
15
|
+
* 3. ラッパー無しで単体利用するときは、利用側が `aria-label`(日本語)を書く。
|
|
16
|
+
*
|
|
17
|
+
* `<label for>` が有効なネイティブ入力(Input / Textarea)は従来どおり
|
|
18
|
+
* `htmlFor` ↔ `id` の関連付けで足りるため、context の `controlId` を使う。
|
|
19
|
+
*/
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
export interface FieldLabellingValue {
|
|
22
|
+
/** ラベル要素の id。コントロールの aria-labelledby 既定値になる */
|
|
23
|
+
labelId: string;
|
|
24
|
+
/** コントロールに割り当てる id(ネイティブ入力の htmlFor 対応用) */
|
|
25
|
+
controlId: string;
|
|
26
|
+
/** 説明文の id。存在するときだけ設定される */
|
|
27
|
+
descriptionId?: string;
|
|
28
|
+
/** エラーメッセージの id。存在するときだけ設定される */
|
|
29
|
+
errorId?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* ラッパー(FormField 等)が配下のコントロールへ id を渡す context。
|
|
33
|
+
* Provider は利用側で `<FieldLabellingContext.Provider value={...}>` として使う
|
|
34
|
+
* (このファイルはコンポーネントを export しない = fast refresh の制約に合わせる)。
|
|
35
|
+
*/
|
|
36
|
+
declare const FieldLabellingContext: React.Context<FieldLabellingValue>;
|
|
37
|
+
/** ラッパー内かどうかを問わず使える。ラッパー外では null。 */
|
|
38
|
+
declare function useFieldLabelling(): FieldLabellingValue | null;
|
|
39
|
+
/**
|
|
40
|
+
* Radix トリガー系コントロール向けの aria 属性を解決する。
|
|
41
|
+
*
|
|
42
|
+
* 利用側の明示指定(aria-label / aria-labelledby / id / aria-describedby)を必ず優先し、
|
|
43
|
+
* 何も指定が無いときだけラッパーの id を当てる。
|
|
44
|
+
*/
|
|
45
|
+
declare function resolveFieldAria(props: {
|
|
46
|
+
id?: string;
|
|
47
|
+
"aria-label"?: string;
|
|
48
|
+
"aria-labelledby"?: string;
|
|
49
|
+
"aria-describedby"?: string;
|
|
50
|
+
}, field: FieldLabellingValue | null): {
|
|
51
|
+
id?: string;
|
|
52
|
+
"aria-labelledby"?: string;
|
|
53
|
+
"aria-describedby"?: string;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* ネイティブ入力(Input / Textarea)向け。
|
|
57
|
+
* 名前は `<label for>` ↔ `id` で付くので、ここでは id と説明の関連付けだけ行う。
|
|
58
|
+
*/
|
|
59
|
+
declare function resolveNativeFieldAria(props: {
|
|
60
|
+
id?: string;
|
|
61
|
+
"aria-describedby"?: string;
|
|
62
|
+
}, field: FieldLabellingValue | null): {
|
|
63
|
+
id?: string;
|
|
64
|
+
"aria-describedby"?: string;
|
|
65
|
+
};
|
|
66
|
+
export { FieldLabellingContext, useFieldLabelling, resolveFieldAria, resolveNativeFieldAria, };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DS 正規のフォーカス可視化(フォーカスリング)。
|
|
3
|
+
*
|
|
4
|
+
* 入力系・操作系のコンポーネントは **必ず**このどちらかを適用する。
|
|
5
|
+
* 意匠は `--Focus-High-Emphasis`(緑)の 3px リング + 同色ボーダーで統一され、
|
|
6
|
+
* Button / Input / Select / Checkbox / RadioGroup / Switch / Slider /
|
|
7
|
+
* NumberInput / SearchBar / FileInput すべてが同じ見え方になる。
|
|
8
|
+
*
|
|
9
|
+
* ## hover と focus の優先順位
|
|
10
|
+
* Tailwind v4 の variant 出力順は `focus-within` → `hover` → `focus` →
|
|
11
|
+
* `focus-visible` の並びで固定されている。つまり
|
|
12
|
+
*
|
|
13
|
+
* - `focus-visible:*` は同一プロパティの `hover:*` を**常に上書きする**(後勝ち)
|
|
14
|
+
* - `focus-within:*` は `hover:*` に**負ける**
|
|
15
|
+
*
|
|
16
|
+
* そのため {@link FOCUS_RING_WITHIN} を使う(=ラッパーが枠を描く)
|
|
17
|
+
* コンポーネントでは、同じプロパティを触る hover を
|
|
18
|
+
* `hover:not-focus-within:*` と書いてフォーカス中は hover を抑制すること。
|
|
19
|
+
* この順序は `__tests__/focus-visible-contract.test.ts` で固定している。
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* 要素自身がフォーカスを受け取るコントロール用(input / button / trigger 等)。
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <input className={cn("border ...", FOCUS_RING)} />
|
|
26
|
+
*/
|
|
27
|
+
export declare const FOCUS_RING = "focus-visible:border-[var(--Focus-High-Emphasis)] focus-visible:ring-[3px] focus-visible:ring-[var(--Focus-High-Emphasis)]/50";
|
|
28
|
+
/**
|
|
29
|
+
* ラッパーが枠を描き、内側の要素がフォーカスを受け取る合成コントロール用
|
|
30
|
+
* (SearchBar の枠、FileInput の label 等)。
|
|
31
|
+
*
|
|
32
|
+
* hover で同じプロパティを変える場合は `hover:not-focus-within:*` で書くこと。
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* <div className={cn("border hover:not-focus-within:border-x", FOCUS_RING_WITHIN)}>
|
|
36
|
+
*/
|
|
37
|
+
export declare const FOCUS_RING_WITHIN = "focus-within:border-[var(--Focus-High-Emphasis)] focus-within:ring-[3px] focus-within:ring-[var(--Focus-High-Emphasis)]/50";
|
|
38
|
+
/**
|
|
39
|
+
* `overflow-hidden` なコンテナの内側にある要素用(リングが外にはみ出すと
|
|
40
|
+
* 切り取られてしまうため内側に描く)。SearchBar の検索ボタン等。
|
|
41
|
+
*/
|
|
42
|
+
export declare const FOCUS_RING_INSET = "focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-[var(--Focus-High-Emphasis)]/50";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cakejp/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Cake.jp Design System — UI コンポーネント・カラートークン・タイポグラフィ",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"scripts": {
|
|
81
81
|
"dev": "vite",
|
|
82
82
|
"build": "tsc -b && vite build",
|
|
83
|
-
"build:lib": "vite build --config vite.config.lib.ts && tsc --project tsconfig.lib.json && tsc-alias --project tsconfig.lib.json",
|
|
83
|
+
"build:lib": "vite build --config vite.config.lib.ts && node scripts/append-tailwind-source-manifest.mjs && tsc --project tsconfig.lib.json && tsc-alias --project tsconfig.lib.json",
|
|
84
84
|
"prepack": "npm run build:lib",
|
|
85
85
|
"prepare": "npm run build:lib",
|
|
86
86
|
"postinstall": "node ./bin/init.js postinstall",
|
|
@@ -9,6 +9,15 @@ node scripts/codemod/v1-to-v2.mjs --dry ./src
|
|
|
9
9
|
node scripts/codemod/v1-to-v2.mjs ./src
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
+
ここに置いたファイル名がそのまま consumer 側の codemod 名になります(dispatch の
|
|
13
|
+
書き換えは不要)。`template.mjs` と `check-migration.mjs` は一覧から除外されます。
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx cakejp-ds codemod # 使える codemod 名の一覧
|
|
17
|
+
npx cakejp-ds codemod v1-to-v2 --dry ./src
|
|
18
|
+
npx cakejp-ds codemod v1-to-v2 ./src
|
|
19
|
+
```
|
|
20
|
+
|
|
12
21
|
正規表現ベースのため、必ずコミット済みの利用側で `--dry` を先に実行し、
|
|
13
22
|
適用後は `git diff` と ESLint の `@cakejp/design-system/eslint/deprecated`
|
|
14
23
|
で残件を確認してください。
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
| OrderSection | `@/components/ec/order-section` | — | 入力済み, 未入力, エラー, 購入確認画面 |
|
|
137
137
|
| OrderSummary | `@/components/ec/order-summary` | — | カート合計, チェックアウト合計, クーポン適用時, 合計のみ |
|
|
138
138
|
| PaymentMethodDisplay, CreditCardIcon | `@/components/ec/payment-method` | — | 登録済み, 未登録, 期限切れ, 対応ブランド一覧, カードブランドアイコン |
|
|
139
|
-
| ProductCard, BookmarkRibbonIcon | `@/components/ec/product-card` | — | ストロベリーショートケーキ 5号(15cm), お気に入りボタン付き, タグ付き, ランキング, 配送日表示, 規格・仕様キャプション, 横向き, グリッドレイアウト(標準コンテナクエリ), 割引バッジ, カートボタン付き, ショップ名リンク付き,
|
|
139
|
+
| ProductCard, BookmarkRibbonIcon | `@/components/ec/product-card` | — | ストロベリーショートケーキ 5号(15cm), お気に入りボタン付き, タグ付き, ランキング, 配送日表示, 規格・仕様キャプション, 横向き, グリッドレイアウト(標準コンテナクエリ), 割引バッジ, カートボタン付き, ショップ名リンク付き, 最小構成, 回帰: 列はみ出し / 価格の縦位置揃え (#210) |
|
|
140
140
|
| ProductCarousel | `@/components/ec/product-carousel` | — | Default, WithRanking, LargeCards, WithSectionImage, WithDescription, WithCartButton |
|
|
141
141
|
| ProductCTA | `@/components/ec/product-cta` | — | カートに追加, タイムセール中, 完売, 全バリエーション |
|
|
142
142
|
| ProductDetailBar | `@/components/ec/product-detail-bar` | — | — |
|
|
@@ -480,3 +480,18 @@
|
|
|
480
480
|
height: max(100%, 2.75rem);
|
|
481
481
|
transform: translate(-50%, -50%);
|
|
482
482
|
}
|
|
483
|
+
|
|
484
|
+
/* --- Base layer(ルート地色 / #208) ---
|
|
485
|
+
* Tailwind を使わない consumer でも、html を透明のままにしない。
|
|
486
|
+
* 透明だとダークモード設定のブラウザでキャンバス既定色(黒)が透け、
|
|
487
|
+
* ページ全体が真っ黒に見える。preset.css の @layer base と同じ宣言。
|
|
488
|
+
* 背景を body ではなく html にだけ置く理由も preset.css 側のコメント参照。
|
|
489
|
+
* @layer に入れているのは、consumer 側の非レイヤー CSS が常に勝つようにするため。 */
|
|
490
|
+
@layer base {
|
|
491
|
+
html {
|
|
492
|
+
background-color: var(--background);
|
|
493
|
+
}
|
|
494
|
+
body {
|
|
495
|
+
color: var(--foreground);
|
|
496
|
+
}
|
|
497
|
+
}
|
package/src/preset.css
CHANGED
|
@@ -374,7 +374,21 @@
|
|
|
374
374
|
* {
|
|
375
375
|
@apply border-border outline-ring/50;
|
|
376
376
|
}
|
|
377
|
+
/* ルート地色(#208)
|
|
378
|
+
* html を透明のままにすると、ダークモード設定のブラウザではキャンバス既定色(黒)が
|
|
379
|
+
* 透けてページ全体が真っ黒になる。面トークンで明示的に確定させる。
|
|
380
|
+
*
|
|
381
|
+
* 背景は html にだけ置き、body には置かない。ルート要素に背景があれば
|
|
382
|
+
* キャンバスへはそこから伝播するので body で塗り直す必要が無く、
|
|
383
|
+
* ダークの面トークン(--Surface-Primary が半透明の黒)を二重に重ねて
|
|
384
|
+
* body の高さで濃さが変わる継ぎ目が出るのを避けられる。
|
|
385
|
+
*
|
|
386
|
+
* @apply ではなく素の CSS で書くのは、Tailwind を通さない経路
|
|
387
|
+
* (preset-standalone.css)と同じ宣言を両ファイルで保てるようにするため。 */
|
|
388
|
+
html {
|
|
389
|
+
background-color: var(--background);
|
|
390
|
+
}
|
|
377
391
|
body {
|
|
378
|
-
|
|
392
|
+
color: var(--foreground);
|
|
379
393
|
}
|
|
380
394
|
}
|