ksk-design-system 2.6.3 → 2.7.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/MIGRATION.md +16 -0
- package/README.md +27 -1
- package/UPDATING.md +5 -0
- package/bin/lint.js +1 -1
- package/bin/product-theme-override.js +1 -1
- package/contracts/component-docs-guidance.json +73 -0
- package/contracts/components.json +26 -3
- package/contracts/consumer-requests.json +20 -0
- package/contracts/native-device-verification.json +29 -0
- package/contracts/product-theme-overrides.json +9 -1
- package/contracts/token-hex-cache.json +1 -1
- package/dist/index.js +2532 -2491
- package/dist/native/ui.js +2006 -1864
- package/dist/{prompt-coordinator-DR5uqIaR.js → semantic-icons-CP9aRQ9C.js} +35 -1
- package/dist/types/components/ui/semantic-icon.d.ts +16 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/semantic-icons.d.ts +34 -0
- package/dist/types/native/components/Alert.d.ts +4 -1
- package/dist/types/native/components/SemanticIcon.d.ts +12 -0
- package/dist/types/native/components/Sheet.d.ts +2 -0
- package/dist/types/native/components/StatCard.d.ts +8 -1
- package/dist/types/native/components/index.d.ts +2 -1
- package/dist/types/native/sheet-snap-gesture.d.ts +2 -0
- package/dist/types/native/sheet-viewport-layout.d.ts +9 -0
- package/package.json +18 -3
- package/src/components/COMPONENT_LOOKUP.md +2 -1
- package/src/native/COMPONENT_LOOKUP.md +3 -1
- package/src/preset-core.css +252 -0
- package/src/preset.css +7 -232
- package/src/styles/product-theme.css +8 -0
- package/src/styles/source-safelist.css +5 -1
|
@@ -158,4 +158,38 @@ function b({ id: t, priority: n = 0, when: r, children: i }) {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
//#endregion
|
|
161
|
-
|
|
161
|
+
//#region src/lib/semantic-icons.ts
|
|
162
|
+
var x = {
|
|
163
|
+
selected: {
|
|
164
|
+
label: "選択済み",
|
|
165
|
+
glyph: "tick",
|
|
166
|
+
use: "選択対象が外枠を持つタイルや項目"
|
|
167
|
+
},
|
|
168
|
+
selectedSquare: {
|
|
169
|
+
label: "選択済み(四角)",
|
|
170
|
+
glyph: "TickSquare",
|
|
171
|
+
use: "独立した選択状態の表示"
|
|
172
|
+
},
|
|
173
|
+
success: {
|
|
174
|
+
label: "完了",
|
|
175
|
+
glyph: "TickCircle",
|
|
176
|
+
use: "処理の完了・成功"
|
|
177
|
+
},
|
|
178
|
+
close: {
|
|
179
|
+
label: "閉じる",
|
|
180
|
+
glyph: "Add rotated 45°",
|
|
181
|
+
use: "閉じる・選択解除(操作名はボタンへ指定)"
|
|
182
|
+
},
|
|
183
|
+
info: {
|
|
184
|
+
label: "情報",
|
|
185
|
+
glyph: "InfoCircleIcon",
|
|
186
|
+
use: "補足情報。警告とは区別する"
|
|
187
|
+
},
|
|
188
|
+
warning: {
|
|
189
|
+
label: "警告",
|
|
190
|
+
glyph: "Danger",
|
|
191
|
+
use: "注意が必要な状態。説明文を併記する"
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
//#endregion
|
|
195
|
+
export { m as a, v as c, _ as i, n as l, i as n, h as o, b as r, y as s, x as t, r as u };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type SemanticIconName } from "../../lib/semantic-icons";
|
|
3
|
+
export { SEMANTIC_ICONS, type SemanticIconName } from "../../lib/semantic-icons";
|
|
4
|
+
export interface SemanticIconProps extends React.ComponentProps<"svg"> {
|
|
5
|
+
name: SemanticIconName;
|
|
6
|
+
color?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
/** Cross-platform alias for aria-label; aria-label wins when both are supplied. */
|
|
9
|
+
accessibilityLabel?: string;
|
|
10
|
+
size?: number | string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 意味から選ぶ装飾アイコン。選択状態や操作名は親のコントロールで伝える。
|
|
14
|
+
* 単独の情報画像として使う場合は aria-label を指定する。
|
|
15
|
+
*/
|
|
16
|
+
export declare function SemanticIcon({ name, size, className, accessibilityLabel, color, style, ...props }: SemanticIconProps): React.JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -279,3 +279,5 @@ export { weddingCategories, projectCategories, getCategoricalColor, getCategoric
|
|
|
279
279
|
export type { CategoryPresetItem } from "./lib/category-presets";
|
|
280
280
|
export { CATEGORICAL_SURFACE_CLASS, CATEGORICAL_DOT_CLASS, categoricalSurfaceClass, categoricalVar, } from "./lib/categorical";
|
|
281
281
|
export type { CategoricalIndex } from "./lib/categorical";
|
|
282
|
+
export { SemanticIcon, SEMANTIC_ICONS } from "./components/ui/semantic-icon";
|
|
283
|
+
export type { SemanticIconProps, SemanticIconName } from "./components/ui/semantic-icon";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** Meaning first: Check is a checkbook; InfoCircle in iconsax is an exclamation mark. */
|
|
2
|
+
export declare const SEMANTIC_ICONS: {
|
|
3
|
+
readonly selected: {
|
|
4
|
+
readonly label: "選択済み";
|
|
5
|
+
readonly glyph: "tick";
|
|
6
|
+
readonly use: "選択対象が外枠を持つタイルや項目";
|
|
7
|
+
};
|
|
8
|
+
readonly selectedSquare: {
|
|
9
|
+
readonly label: "選択済み(四角)";
|
|
10
|
+
readonly glyph: "TickSquare";
|
|
11
|
+
readonly use: "独立した選択状態の表示";
|
|
12
|
+
};
|
|
13
|
+
readonly success: {
|
|
14
|
+
readonly label: "完了";
|
|
15
|
+
readonly glyph: "TickCircle";
|
|
16
|
+
readonly use: "処理の完了・成功";
|
|
17
|
+
};
|
|
18
|
+
readonly close: {
|
|
19
|
+
readonly label: "閉じる";
|
|
20
|
+
readonly glyph: "Add rotated 45°";
|
|
21
|
+
readonly use: "閉じる・選択解除(操作名はボタンへ指定)";
|
|
22
|
+
};
|
|
23
|
+
readonly info: {
|
|
24
|
+
readonly label: "情報";
|
|
25
|
+
readonly glyph: "InfoCircleIcon";
|
|
26
|
+
readonly use: "補足情報。警告とは区別する";
|
|
27
|
+
};
|
|
28
|
+
readonly warning: {
|
|
29
|
+
readonly label: "警告";
|
|
30
|
+
readonly glyph: "Danger";
|
|
31
|
+
readonly use: "注意が必要な状態。説明文を併記する";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type SemanticIconName = keyof typeof SEMANTIC_ICONS;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type AlertTone = "info" | "success" | "warning" | "caution";
|
|
3
|
+
export type AlertVariant = "inline-info" | "inline-warning" | "inline-caution";
|
|
3
4
|
export interface AlertProps {
|
|
5
|
+
/** Borderless inline presentation, matching the Web Alert variants. Overrides tone. */
|
|
6
|
+
variant?: AlertVariant;
|
|
4
7
|
tone?: AlertTone;
|
|
5
8
|
title?: string;
|
|
6
9
|
description?: string;
|
|
7
10
|
children?: React.ReactNode;
|
|
8
11
|
}
|
|
9
|
-
export declare function Alert({ tone, title, description, children }: AlertProps): React.JSX.Element;
|
|
12
|
+
export declare function Alert({ tone, variant, title, description, children }: AlertProps): React.JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type StyleProp, type ViewStyle } from "react-native";
|
|
2
|
+
import type { SemanticIconName } from "../../lib/semantic-icons";
|
|
3
|
+
export { SEMANTIC_ICONS, type SemanticIconName } from "../../lib/semantic-icons";
|
|
4
|
+
export interface SemanticIconProps {
|
|
5
|
+
name: SemanticIconName;
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
}
|
|
11
|
+
/** Meaning-compatible native glyphs. View geometry keeps SVG an optional dependency. */
|
|
12
|
+
export declare function SemanticIcon({ name, size, color, accessibilityLabel, style }: SemanticIconProps): import("react").JSX.Element;
|
|
@@ -20,6 +20,8 @@ export interface SheetProps {
|
|
|
20
20
|
* シート下端に固定で表示する要素(例:「つづける」ボタン)。
|
|
21
21
|
* children の ScrollView と分離されるためコンテンツのスクロールに
|
|
22
22
|
* 追従しない。snap mode(bottom + snapPoints)でのみ有効。
|
|
23
|
+
* ソフトキーボード表示中はその上に固定し、本文を一時拡張する。
|
|
24
|
+
* キーボード回避は Sheet が所有するため footer に追加 inset は不要。
|
|
23
25
|
*/
|
|
24
26
|
footer?: React.ReactNode;
|
|
25
27
|
/**
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type StyleProp, type ViewStyle, type TextProps } from "react-native";
|
|
2
3
|
export interface StatCardProps {
|
|
4
|
+
/** Card surface layout, including stretch within an equal-height row. */
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
/** Minimum label slot height; grows naturally when Dynamic Type needs more space. */
|
|
7
|
+
labelMinHeight?: number;
|
|
8
|
+
/** Reports natural label layout, independently of the label slot minimum. */
|
|
9
|
+
onLabelLayout?: TextProps["onLayout"];
|
|
3
10
|
label: string;
|
|
4
11
|
value: string | number;
|
|
5
12
|
delta?: string;
|
|
6
13
|
trend?: "up" | "down" | "neutral";
|
|
7
14
|
}
|
|
8
|
-
export declare function StatCard({ label, value, delta, trend }: StatCardProps): React.JSX.Element;
|
|
15
|
+
export declare function StatCard({ label, value, delta, trend, style, labelMinHeight, onLabelLayout }: StatCardProps): React.JSX.Element;
|
|
@@ -41,7 +41,7 @@ export { Slider, type SliderProps } from "./Slider";
|
|
|
41
41
|
export { NumberInput, type NumberInputProps } from "./NumberInput";
|
|
42
42
|
export { FormField, type FormFieldProps } from "./FormField";
|
|
43
43
|
export { FormRoot, FormSection, FormActions, type FormRootProps, type FormSectionProps, type FormActionsProps, } from "./Form";
|
|
44
|
-
export { Alert, type AlertProps, type AlertTone } from "./Alert";
|
|
44
|
+
export { Alert, type AlertProps, type AlertTone, type AlertVariant } from "./Alert";
|
|
45
45
|
export { Dialog, type DialogProps, type DialogPosition } from "./Dialog";
|
|
46
46
|
export { Scrim, type ScrimProps, type ScrimAlign } from "./Scrim";
|
|
47
47
|
export { AlertDialog, type AlertDialogProps } from "./AlertDialog";
|
|
@@ -133,3 +133,4 @@ export { ReviewCard, type ReviewCardProps } from "./ReviewCard";
|
|
|
133
133
|
export { ReviewSummary, type ReviewSummaryProps } from "./ReviewSummary";
|
|
134
134
|
export { AppShell, type AppShellProps } from "./AppShell";
|
|
135
135
|
export { MarketingShell, type MarketingShellProps } from "./MarketingShell";
|
|
136
|
+
export { SemanticIcon, SEMANTIC_ICONS, type SemanticIconProps, type SemanticIconName } from "./SemanticIcon";
|
|
@@ -51,3 +51,5 @@ export type ReleaseAction = {
|
|
|
51
51
|
};
|
|
52
52
|
/** 指を離した時の着地先。close は dismissible のときだけ返す。 */
|
|
53
53
|
export declare function resolveRelease(startTY: number, dy: number, startActive: number, config: SnapGestureConfig): ReleaseAction;
|
|
54
|
+
/** The dedicated handle is draggable even when body content is scrolled. */
|
|
55
|
+
export declare function shouldStartHandleDrag(animating: boolean, keyboardReducedViewport: boolean): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Receives the actual Modal working area after iOS keyboard avoidance or
|
|
3
|
+
* Android adjustResize. Never subtract keyboard height again here.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveSheetViewportLayout(fullHeight: number, panelHeight: number, measuredHeight: number | null, keyboardOpen: boolean): {
|
|
6
|
+
availableHeight: number;
|
|
7
|
+
panelHeight: number;
|
|
8
|
+
expandToViewport: boolean;
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ksk-design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "KSK Design System — フリーランス向けマルチテーマ対応デザインシステム",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"CLAUDE.md",
|
|
27
27
|
"DESIGN.md",
|
|
28
28
|
"src/preset.css",
|
|
29
|
+
"src/preset-core.css",
|
|
29
30
|
"src/styles",
|
|
30
31
|
"src/themes",
|
|
31
32
|
"src/components/COMPONENT_LOOKUP.md",
|
|
@@ -65,6 +66,14 @@
|
|
|
65
66
|
"import": "./src/preset.css",
|
|
66
67
|
"default": "./src/preset.css"
|
|
67
68
|
},
|
|
69
|
+
"./preset-core": {
|
|
70
|
+
"import": "./src/preset-core.css",
|
|
71
|
+
"default": "./src/preset-core.css"
|
|
72
|
+
},
|
|
73
|
+
"./safelist": {
|
|
74
|
+
"import": "./src/styles/source-safelist.css",
|
|
75
|
+
"default": "./src/styles/source-safelist.css"
|
|
76
|
+
},
|
|
68
77
|
"./styles": {
|
|
69
78
|
"import": "./src/preset.css",
|
|
70
79
|
"default": "./src/preset.css"
|
|
@@ -204,11 +213,16 @@
|
|
|
204
213
|
"test:watch": "vitest",
|
|
205
214
|
"test:interaction": "vitest run --config vitest.storybook.config.ts",
|
|
206
215
|
"test:a11y": "vitest run --config vitest.a11y.config.ts",
|
|
207
|
-
"check": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.type-tests.json --noEmit && bash scripts/lint-scratch.sh && bash scripts/check-deps.sh && node scripts/check-published-deps.mjs && node scripts/check-radix-floor.mjs && node scripts/check-css-setup.mjs && bash scripts/check-drift.sh && node scripts/check-screen-contracts.mjs && node scripts/check-docs-drift.mjs && node scripts/check-agents-docs-sync.mjs && node scripts/check-contrast.mjs && node scripts/check-design-md.mjs && node scripts/check-tailwind-v4.mjs && node scripts/check-prefix-order.mjs && node scripts/check-flex-shrink.mjs && node scripts/check-deprecations.mjs && node scripts/check-rules-contract.mjs && node scripts/sync-version.mjs --check && node scripts/generate-migration-doc.mjs --check && bash scripts/check-responsive.sh && node scripts/generate-component-lookup.mjs --check && node scripts/generate-platform-tokens.mjs --check && node scripts/generate-token-hex-cache.mjs --check && node scripts/generate-source-safelist.mjs --check && tsc -p tsconfig.native.json --noEmit && node scripts/check-native-parity.mjs && node scripts/generate-native-component-lookup.mjs --check",
|
|
216
|
+
"check": "tsc -p tsconfig.app.json --noEmit && tsc -p tsconfig.type-tests.json --noEmit && bash scripts/lint-scratch.sh && bash scripts/check-deps.sh && node scripts/check-published-deps.mjs && node scripts/check-radix-floor.mjs && node scripts/check-css-setup.mjs && bash scripts/check-drift.sh && node scripts/check-screen-contracts.mjs && node scripts/check-docs-drift.mjs && node scripts/check-agents-docs-sync.mjs && node scripts/check-contrast.mjs && node scripts/check-design-md.mjs && node scripts/check-tailwind-v4.mjs && node scripts/check-prefix-order.mjs && node scripts/check-flex-shrink.mjs && node scripts/check-deprecations.mjs && node scripts/check-rules-contract.mjs && node scripts/sync-version.mjs --check && node scripts/generate-migration-doc.mjs --check && bash scripts/check-responsive.sh && node scripts/generate-component-lookup.mjs --check && node scripts/generate-platform-tokens.mjs --check && node scripts/generate-token-hex-cache.mjs --check && node scripts/generate-source-safelist.mjs --check && tsc -p tsconfig.native.json --noEmit && node scripts/check-native-parity.mjs && node scripts/generate-native-component-lookup.mjs --check && npm run check:native-support",
|
|
208
217
|
"check:agent": "npm run lint && npm run check && npm test && npm run lint:story-reuse",
|
|
209
218
|
"version": "node scripts/sync-version.mjs",
|
|
210
219
|
"mcp:build": "cd mcp-server && npm install && npm run build",
|
|
211
|
-
"mcp:start": "node mcp-server/dist/index.js"
|
|
220
|
+
"mcp:start": "node mcp-server/dist/index.js",
|
|
221
|
+
"test:docs": "node scripts/check-storybook-docs.mjs",
|
|
222
|
+
"test:visual": "node scripts/check-visual.mjs",
|
|
223
|
+
"test:visual:guards": "node --test test/visual/*.test.mjs",
|
|
224
|
+
"generate:native-support": "node scripts/generate-native-support.mjs",
|
|
225
|
+
"check:native-support": "node scripts/generate-native-support.mjs --check"
|
|
212
226
|
},
|
|
213
227
|
"dependencies": {
|
|
214
228
|
"@radix-ui/react-slot": "^1.3.0",
|
|
@@ -279,6 +293,7 @@
|
|
|
279
293
|
"iconsax-reactjs": "^0.0.8",
|
|
280
294
|
"jsdom": "^25.0.1",
|
|
281
295
|
"playwright": "^1.62.0",
|
|
296
|
+
"pngjs": "^7.0.0",
|
|
282
297
|
"radix-ui": "^1.6.1",
|
|
283
298
|
"react": "^19.2.0",
|
|
284
299
|
"react-dom": "^19.2.0",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
| SectionNav | `@/components/ui/section-nav` | — | Vertical, Horizontal, StickyGuide |
|
|
62
62
|
| Section | `@/components/ui/section` | **spacing**: `sm`, `md`, `lg`, `xl`<br>**background**: `none`, `subtle`, `accent-subtle` | FullBleedBandWithContainedContent |
|
|
63
63
|
| Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue | `@/components/ui/select` | **size**: `sm`, `default`, `lg` | WithPlaceholder, WithGroups, WithDisabledItem, DisabledSelect, OpensAndSelectsOption, SelectsWithKeyboard |
|
|
64
|
+
| SEMANTIC_ICONS, SemanticIcon | `@/components/ui/semantic-icon` | — | — |
|
|
64
65
|
| Separator | `@/components/ui/separator` | — | Horizontal, Vertical |
|
|
65
66
|
| Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, SheetDragIndicator | `@/components/ui/sheet` | **side**: `top`, `bottom`, `left`, `right`, `float`, `float-glass`, `bottom-glass` | BottomSheet, FloatSheet, TopSheet, FloatSheetTallContent, RightSheet, A11yOptions, TitleAutoFocusAppearance, Float Glass (Liquid Glass), Bottom Glass (Liquid Glass), BottomSheet — swipeToClose, Float — 仮想キーボード追従, BottomSheet — swipeToClose (full height / scrollable), BottomSheet — Snap 0.4/0.9, BottomSheet — Snap (push-up layout), BottomSheet — nested (#158), OpensAndIsImmediatelyInteractive, ChildDescriptionIsLinked, ChildDescriptionIsLinkedWithSwipeToClose, NoDescriptionLeavesNoDescribedBy, ChildDescriptionIsLinkedWithSnapPoints, ChildDescriptionIsLinkedWithSwipeSideDrawer, DescriptionPropIsLinked, ExplicitDescribedByWins |
|
|
66
67
|
| Skeleton, SkeletonText | `@/components/ui/skeleton` | — | CardSkeleton, TextSkeleton, SkeletonText (5 lines) |
|
|
@@ -153,7 +154,7 @@
|
|
|
153
154
|
| Screen | `@/components/patterns/screen` | — | ScrollableWithFooter, WithHeader, FixedPhotoHero |
|
|
154
155
|
| SearchBar | `@/components/patterns/search-bar` | — | Default, WithValue, Disabled, WithOnSearch, AsForm |
|
|
155
156
|
| SectionHeader | `@/components/patterns/section-header` | — | WithAction, WithoutAction, TitleOnly, WithGhostButton |
|
|
156
|
-
| SettingsSection, SettingsListRow | `@/components/patterns/settings-section` | — | Group, Card, Danger |
|
|
157
|
+
| SettingsSection, SettingsListRow | `@/components/patterns/settings-section` | — | Group, Card, Danger, CompactSpacing |
|
|
157
158
|
| ShareButtons | `@/components/patterns/share-buttons` | — | Circle, Inline, SelectiveProviders, JapanDefault, ExtendedProviders, With onShare tracking |
|
|
158
159
|
| SideDrawerFrame | `@/components/patterns/side-drawer-frame` | — | RightDrawer, LeftDrawer, RightDrawer — swipeToClose, LeftDrawer — swipeToClose, Glass |
|
|
159
160
|
| SimplePagination | `@/components/patterns/simple-pagination` | — | アイテム数指定 (items), ページ数指定 (pages), compact (モバイル省略表示), 境界での disabled, 0 件 |
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
React Native / Expo consumer は、新規 UI を作る前にこの一覧で既存コンポーネントを確認してください。すべて `ksk-design-system/native/ui` から import します。
|
|
6
6
|
|
|
7
|
-
- Public native component exports:
|
|
7
|
+
- Public native component exports: 154
|
|
8
8
|
- Import: `import { Button, Screen } from "ksk-design-system/native/ui"`
|
|
9
9
|
|
|
10
10
|
| Component | Source | Section |
|
|
@@ -161,3 +161,5 @@ React Native / Expo consumer は、新規 UI を作る前にこの一覧で既
|
|
|
161
161
|
| `ReviewSummary` | `src/native/components/ReviewSummary.tsx` | Phase 7: Commerce |
|
|
162
162
|
| `AppShell` | `src/native/components/AppShell.tsx` | Phase 8: Shells |
|
|
163
163
|
| `MarketingShell` | `src/native/components/MarketingShell.tsx` | Phase 8: Shells |
|
|
164
|
+
| `SEMANTIC_ICONS` | `src/native/components/SemanticIcon.tsx` | Phase 8: Shells |
|
|
165
|
+
| `SemanticIcon` | `src/native/components/SemanticIcon.tsx` | Phase 8: Shells |
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/* =============================================================
|
|
2
|
+
KSK Design System — Preset Core CSS
|
|
3
|
+
|
|
4
|
+
preset から「DS 部品用の safelist(styles/source-safelist.css)」だけを
|
|
5
|
+
除いたもの。トークン・shadcn 互換ブリッジ・アニメーション・
|
|
6
|
+
container 幅・scrollbar-hide・base layer の保険はすべて含む。
|
|
7
|
+
|
|
8
|
+
使い方(DS 部品を使わないページだけの consumer):
|
|
9
|
+
@import "tailwindcss";
|
|
10
|
+
@import "ksk-design-system/preset-core";
|
|
11
|
+
@import "ksk-design-system/themes/default";
|
|
12
|
+
|
|
13
|
+
DS 部品(Button 等)を使う consumer は従来どおり
|
|
14
|
+
`ksk-design-system/preset`(= preset-core + safelist)を使うこと。
|
|
15
|
+
safelist が無いと、DS 部品内部でしか使わないユーティリティは
|
|
16
|
+
consumer の @source が DS の dist を走査したときにしか生成されない。
|
|
17
|
+
|
|
18
|
+
preset.css はこのファイルと safelist を読み込むだけの薄い入口。
|
|
19
|
+
トークンや base layer を足すときはこのファイルに書く。
|
|
20
|
+
============================================================= */
|
|
21
|
+
|
|
22
|
+
@import "./styles/primitive.css";
|
|
23
|
+
/* 角丸の意味別トークン(issue #553)。定義元は styles/radius.css の1箇所で、
|
|
24
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
25
|
+
@import "./styles/radius.css";
|
|
26
|
+
/* ページセクション間の縦リズム(issue #560)。定義元は
|
|
27
|
+
styles/section-spacing.css の1箇所で、product-theme.css からも読み込まれる
|
|
28
|
+
(個別 subpath 構成の消費側対策)。 */
|
|
29
|
+
@import "./styles/section-spacing.css";
|
|
30
|
+
/* 重なり順(issue #563)。定義元は styles/z-index.css の1箇所で、
|
|
31
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
32
|
+
@import "./styles/z-index.css";
|
|
33
|
+
/* 影(issue #563)。定義元は styles/shadow.css の1箇所で、
|
|
34
|
+
product-theme.css からも読み込まれる(個別 subpath 構成の消費側対策)。 */
|
|
35
|
+
@import "./styles/shadow.css";
|
|
36
|
+
@import "./styles/semantic.css";
|
|
37
|
+
@import "./styles/categorical.css";
|
|
38
|
+
@import "./styles/typography.css";
|
|
39
|
+
@import "./styles/glass.css";
|
|
40
|
+
@import "./styles/bottom-nav.css";
|
|
41
|
+
@import "./styles/motion.css";
|
|
42
|
+
@import "./styles/sheet-keyboard.css";
|
|
43
|
+
/* プロダクト単位で上書きしてよい寸法・面の公開変数(issue #364)。
|
|
44
|
+
許可リストの正本は contracts/product-theme-overrides.json。 */
|
|
45
|
+
@import "./styles/product-theme.css";
|
|
46
|
+
|
|
47
|
+
/* ─── Bridge Layer: shadcn/ui 互換マッピング ───
|
|
48
|
+
|
|
49
|
+
命名が 2 系統あるのは意図的な設計。統一しない。
|
|
50
|
+
|
|
51
|
+
- `--Surface-Primary` のような **PascalCase-ケバブ** は KSK の semantic 層。
|
|
52
|
+
UI を書くときに参照するのは常にこちら(CLAUDE.md のセルフチェック参照)。
|
|
53
|
+
- `--primary` / `--muted-foreground` のような **小文字ケバブ** は shadcn/ui
|
|
54
|
+
(および Radix ベースの外部コンポーネント)が決め打ちで参照する名前。
|
|
55
|
+
shadcn の CLI で追加したコンポーネントや、consumer が別途入れた
|
|
56
|
+
shadcn 資産をそのまま動かすための互換レイヤーであり、名前は
|
|
57
|
+
shadcn 側の仕様なので KSK 側では変えられない。
|
|
58
|
+
|
|
59
|
+
つまり小文字ケバブ側は「外部規約への適合」であって命名の揺れではない。
|
|
60
|
+
新しいトークンを増やすときは PascalCase 側(semantic.css)に足し、
|
|
61
|
+
shadcn 互換名が必要な場合だけここで var() でエイリアスすること。 */
|
|
62
|
+
:root {
|
|
63
|
+
--radius: 0.5rem;
|
|
64
|
+
|
|
65
|
+
--background: var(--Surface-Primary);
|
|
66
|
+
--foreground: var(--Text-High-Emphasis);
|
|
67
|
+
|
|
68
|
+
--card: var(--Surface-Primary);
|
|
69
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
70
|
+
|
|
71
|
+
--popover: var(--Surface-Primary);
|
|
72
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
73
|
+
|
|
74
|
+
--primary: var(--Brand-Primary);
|
|
75
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
76
|
+
|
|
77
|
+
--secondary: var(--Surface-Secondary);
|
|
78
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
79
|
+
|
|
80
|
+
--muted: var(--Surface-Tertiary);
|
|
81
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
82
|
+
|
|
83
|
+
--accent: var(--Surface-Secondary);
|
|
84
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
85
|
+
|
|
86
|
+
--destructive: var(--Caution-Base);
|
|
87
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
88
|
+
|
|
89
|
+
--border: var(--Border-Medium-Emphasis);
|
|
90
|
+
--input: var(--Border-Medium-Emphasis);
|
|
91
|
+
--ring: var(--Focus-High-Emphasis);
|
|
92
|
+
|
|
93
|
+
--sidebar-background: var(--Surface-Primary);
|
|
94
|
+
--sidebar-foreground: var(--Text-High-Emphasis);
|
|
95
|
+
--sidebar-primary: var(--Brand-Primary);
|
|
96
|
+
--sidebar-primary-foreground: var(--Text-on-Inverse);
|
|
97
|
+
--sidebar-accent: var(--Surface-Accent-Primary-Light);
|
|
98
|
+
--sidebar-accent-foreground: var(--Text-Accent-Primary);
|
|
99
|
+
--sidebar-border: var(--Border-Low-Emphasis);
|
|
100
|
+
--sidebar-ring: var(--Focus-High-Emphasis);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.dark {
|
|
104
|
+
--background: var(--Surface-Primary);
|
|
105
|
+
--foreground: var(--Text-High-Emphasis);
|
|
106
|
+
--card: var(--Surface-Secondary);
|
|
107
|
+
--card-foreground: var(--Text-High-Emphasis);
|
|
108
|
+
--popover: var(--Surface-Secondary);
|
|
109
|
+
--popover-foreground: var(--Text-High-Emphasis);
|
|
110
|
+
--primary: var(--Brand-Primary);
|
|
111
|
+
--primary-foreground: var(--Text-on-Inverse);
|
|
112
|
+
--secondary: var(--Surface-Tertiary);
|
|
113
|
+
--secondary-foreground: var(--Text-High-Emphasis);
|
|
114
|
+
--muted: var(--Surface-Tertiary);
|
|
115
|
+
--muted-foreground: var(--Text-Low-Emphasis);
|
|
116
|
+
--accent: var(--Surface-Tertiary);
|
|
117
|
+
--accent-foreground: var(--Text-High-Emphasis);
|
|
118
|
+
--destructive: var(--Caution-Base);
|
|
119
|
+
--destructive-foreground: var(--Text-on-Inverse);
|
|
120
|
+
--border: var(--Border-Medium-Emphasis);
|
|
121
|
+
--input: var(--Border-Medium-Emphasis);
|
|
122
|
+
--ring: var(--Focus-High-Emphasis);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* ─── Radius Tokens ───
|
|
126
|
+
定義はこのファイルから styles/radius.css へ切り出した(issue #553)。
|
|
127
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
128
|
+
|
|
129
|
+
/* ─── Section Spacing Tokens ───
|
|
130
|
+
定義はこのファイルから styles/section-spacing.css へ切り出した(issue #560)。
|
|
131
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
132
|
+
|
|
133
|
+
/* ─── Z-Index Scale ───
|
|
134
|
+
定義はこのファイルから styles/z-index.css へ切り出した(issue #563)。
|
|
135
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
136
|
+
|
|
137
|
+
/* ─── Shadow Tokens ───
|
|
138
|
+
定義はこのファイルから styles/shadow.css へ切り出した(issue #563)。
|
|
139
|
+
ファイル先頭の @import 群で読み込んでいる。 */
|
|
140
|
+
|
|
141
|
+
/* ─── Animation ─── */
|
|
142
|
+
@keyframes slide-in-right {
|
|
143
|
+
from { transform: translateX(100%); opacity: 0; }
|
|
144
|
+
to { transform: translateX(0); opacity: 1; }
|
|
145
|
+
}
|
|
146
|
+
@keyframes slide-in-left {
|
|
147
|
+
from { transform: translateX(-100%); opacity: 0; }
|
|
148
|
+
to { transform: translateX(0); opacity: 1; }
|
|
149
|
+
}
|
|
150
|
+
@keyframes fade-in {
|
|
151
|
+
from { opacity: 0; }
|
|
152
|
+
to { opacity: 1; }
|
|
153
|
+
}
|
|
154
|
+
@keyframes fade-in-up {
|
|
155
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
156
|
+
to { opacity: 1; transform: translateY(0); }
|
|
157
|
+
}
|
|
158
|
+
@keyframes scale-in {
|
|
159
|
+
from { opacity: 0; transform: scale(0.95); }
|
|
160
|
+
to { opacity: 1; transform: scale(1); }
|
|
161
|
+
}
|
|
162
|
+
@keyframes celebration-confetti-fall {
|
|
163
|
+
from {
|
|
164
|
+
opacity: 1;
|
|
165
|
+
transform: translate3d(0, -16px, 0) rotate(0deg);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
opacity: 0;
|
|
169
|
+
transform: translate3d(var(--celebration-drift, 0), 110vh, 0) rotate(var(--celebration-rotate, 360deg));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
@keyframes celebration-confetti-burst {
|
|
173
|
+
0% {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
transform: translate3d(0, 0, 0) rotate(0deg) scale(0.7);
|
|
176
|
+
}
|
|
177
|
+
60% {
|
|
178
|
+
opacity: 1;
|
|
179
|
+
transform: translate3d(var(--celebration-burst-mid-x, 0), var(--celebration-burst-mid-y, 0), 0)
|
|
180
|
+
rotate(calc(var(--celebration-rotate, 360deg) * 0.75)) scale(1);
|
|
181
|
+
}
|
|
182
|
+
80% {
|
|
183
|
+
opacity: 0.9;
|
|
184
|
+
}
|
|
185
|
+
100% {
|
|
186
|
+
opacity: 0;
|
|
187
|
+
transform: translate3d(var(--celebration-burst-x, 0), var(--celebration-burst-y, 0), 0)
|
|
188
|
+
rotate(var(--celebration-rotate, 360deg)) scale(1);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
@keyframes celebration-pop {
|
|
192
|
+
from { opacity: 0; transform: translateY(8px) scale(0.94); }
|
|
193
|
+
to { opacity: 1; transform: translateY(0) scale(1); }
|
|
194
|
+
}
|
|
195
|
+
@keyframes celebration-emoji-pop {
|
|
196
|
+
0% { transform: scale(0); }
|
|
197
|
+
50% { transform: scale(1.4); }
|
|
198
|
+
70% { transform: scale(0.9); }
|
|
199
|
+
100% { transform: scale(1); }
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
@theme inline {
|
|
203
|
+
/* duration / easing は src/styles/motion.css のトークンを参照する
|
|
204
|
+
(値は従来どおり slide/fade-up=200ms・fade/scale=150ms の ease-out)。 */
|
|
205
|
+
--animate-slide-in-right: slide-in-right var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
206
|
+
--animate-slide-in-left: slide-in-left var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
207
|
+
--animate-fade-in: fade-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
208
|
+
--animate-fade-in-up: fade-in-up var(--Motion-Duration-Base) var(--Motion-Easing-Standard);
|
|
209
|
+
--animate-scale-in: scale-in var(--Motion-Duration-Fast) var(--Motion-Easing-Standard);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ─── Container Query Breakpoints ───
|
|
213
|
+
@sm: / @md: などは viewport の sm: / md: と別スケール。
|
|
214
|
+
tokens.json の breakpoints.container と同じ値を publish 側にも固定し、
|
|
215
|
+
Tailwind の既定値変更や consumer 側設定に依存させない。 */
|
|
216
|
+
@theme {
|
|
217
|
+
--container-sm: 24rem; /* 384px */
|
|
218
|
+
--container-md: 28rem; /* 448px */
|
|
219
|
+
--container-xl: 36rem; /* 576px */
|
|
220
|
+
--container-2xl: 42rem; /* 672px */
|
|
221
|
+
--container-3xl: 48rem; /* 768px */
|
|
222
|
+
--container-4xl: 56rem; /* 896px */
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* ─── Scrollbar Hide Utility ─── */
|
|
226
|
+
@utility scrollbar-hide {
|
|
227
|
+
-ms-overflow-style: none;
|
|
228
|
+
scrollbar-width: none;
|
|
229
|
+
&::-webkit-scrollbar {
|
|
230
|
+
display: none;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* ─── Base Layer: ボーダー / アウトライン色のセーフティネット ───
|
|
235
|
+
Tailwind CSS v4 の破壊的変更で、border / outline の既定色は
|
|
236
|
+
gray-200 ではなく `currentColor`(=要素の文字色)になった。
|
|
237
|
+
そのため `border` `border-b` のように「幅だけで色を指定しない」
|
|
238
|
+
クラスは、消費側が親に濃い文字色(例: --Text-High-Emphasis = #1C1A1A)
|
|
239
|
+
を敷くと枠線が黒ずむ。これを防ぐため、shadcn / 多くの DS と同じく
|
|
240
|
+
全要素のフォールバック色をテーマ追従の --border / --ring に固定する。
|
|
241
|
+
|
|
242
|
+
※ これは「保険」。コンポーネント側は引き続き
|
|
243
|
+
border-[var(--Border-Low-Emphasis)] のように明示色を指定すること
|
|
244
|
+
(明示色を持つ要素は utilities レイヤが base を上書きするため不変)。 */
|
|
245
|
+
@layer base {
|
|
246
|
+
*,
|
|
247
|
+
::after,
|
|
248
|
+
::before {
|
|
249
|
+
border-color: var(--border);
|
|
250
|
+
outline-color: var(--ring);
|
|
251
|
+
}
|
|
252
|
+
}
|