@qijenchen/design-system 0.1.0-beta.34 → 0.1.0-beta.36
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/ds-canonical/hooks/inject_deploy_url_after_push.sh +5 -1
- package/ds-canonical/hooks/tests/test_session_start_governance_check.sh +8 -4
- package/ds-story-manifest.json +1 -1
- package/package.json +3 -2
- package/src/styles/base.css +85 -0
- package/src/styles/tokens.css +5 -1
- package/src/tokens/color/primitives.css +7 -0
|
@@ -173,6 +173,10 @@ fi
|
|
|
173
173
|
[ -z "$URLS_FOUND" ] && exit 0
|
|
174
174
|
|
|
175
175
|
# Inject into AI context
|
|
176
|
-
|
|
176
|
+
# 2026-05-29 ROOT-CAUSE FIX:PostToolUse hook 的純 stdout **不會**注入 AI context(只進 transcript)→
|
|
177
|
+
# 原 `printf` 輸出讓 AI 看不到 URL → AI 每次 push 都沒 relay 給 user(user verbatim「部署完都沒給我 url」)。
|
|
178
|
+
# 必須輸出 JSON `hookSpecificOutput.additionalContext` 才會真注入 AI context。
|
|
179
|
+
MSG=$(printf '%b' "🚀 Deploy URLs auto-detected — RELAY 給 user(per user 2026-05-26「完成部署都自動回吐連結」+ 2026-05-27「不管 repo」):\n${URLS_FOUND}\n(AI:必須把上面 URL 貼給 user,不可省略)")
|
|
180
|
+
jq -n --arg ctx "$MSG" '{hookSpecificOutput:{hookEventName:"PostToolUse",additionalContext:$ctx}}'
|
|
177
181
|
|
|
178
182
|
exit 0
|
|
@@ -123,14 +123,18 @@ fi
|
|
|
123
123
|
teardown_proj
|
|
124
124
|
|
|
125
125
|
# Test 7: Hook count > hard cap → BLOCKER
|
|
126
|
-
|
|
126
|
+
# Cap 從 SSOT(session_start_governance_check.sh `HOOK_COUNT" -gt N`)動態讀,避免 cap 升級後測試 re-drift。
|
|
127
|
+
# Anchor:2026-05-29 cap 已升 45→60 但本測試寫死 46/「hard 45」→ CI hook-test 失敗 → 連帶 storybook
|
|
128
|
+
# build + GitHub Pages deploy 全卡(deploy-storybook job gated 在 Verify pass)。改動態讀後永不 drift。
|
|
129
|
+
HARD_CAP=$(grep -oE 'HOOK_COUNT" -gt [0-9]+' "$HOOK" | grep -oE '[0-9]+' | head -1)
|
|
130
|
+
echo "Test 7: hook count > hard cap ${HARD_CAP} → BLOCKER (cap 從 SSOT 讀)"
|
|
127
131
|
setup_proj
|
|
128
|
-
for i in $(seq 1
|
|
132
|
+
for i in $(seq 1 $((HARD_CAP + 5))); do
|
|
129
133
|
: > "$TMP_PROJ/.claude/hooks/check_fake_${i}.sh"
|
|
130
134
|
done
|
|
131
135
|
run_hook
|
|
132
|
-
if [ "$EXIT" = "0" ] && echo "$STDOUT_TEXT" | grep -q "BLOCKER" && echo "$STDOUT_TEXT" | grep -qE "hard
|
|
133
|
-
echo " PASS Test 7 hook count hard BLOCKER"; PASS=$((PASS+1))
|
|
136
|
+
if [ "$EXIT" = "0" ] && echo "$STDOUT_TEXT" | grep -q "BLOCKER" && echo "$STDOUT_TEXT" | grep -qE "hard ${HARD_CAP}"; then
|
|
137
|
+
echo " PASS Test 7 hook count hard BLOCKER (cap ${HARD_CAP})"; PASS=$((PASS+1))
|
|
134
138
|
else
|
|
135
139
|
echo " FAIL Test 7 (output: ${STDOUT_TEXT:0:200})"
|
|
136
140
|
FAIL=$((FAIL+1)); FAILED="${FAILED}\n - Test 7"
|
package/ds-story-manifest.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"scripts/composition-fidelity-visual-diff.mjs",
|
|
8
8
|
"product-workspace apps/template/src/AllDsComponents.stories.tsx (DsCanonicalPortal)"
|
|
9
9
|
],
|
|
10
|
-
"generatedAt": "2026-05-
|
|
10
|
+
"generatedAt": "2026-05-29T11:03:00.673Z"
|
|
11
11
|
},
|
|
12
12
|
"components": {
|
|
13
13
|
"accordion": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qijenchen/design-system",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.36",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "World-class design system — components, patterns, tokens, hooks (single source of truth for team distribution).",
|
|
6
6
|
"type": "module",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"./styles/tokens.css": "./src/styles/tokens.css",
|
|
42
42
|
"./styles/tokens": "./src/styles/tokens.css",
|
|
43
43
|
"./package.json": "./package.json",
|
|
44
|
-
"./ds-story-manifest.json": "./ds-story-manifest.json"
|
|
44
|
+
"./ds-story-manifest.json": "./ds-story-manifest.json",
|
|
45
|
+
"./styles/base": "./src/styles/base.css"
|
|
45
46
|
},
|
|
46
47
|
"bin": {
|
|
47
48
|
"qijenchen-ds-init": "./cli-init.mjs"
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* @qijenchen/design-system/styles/base — consumer runtime CSS SSOT
|
|
2
|
+
*
|
|
3
|
+
* Why(2026-05-29 fix:ds-product-template storybook 字體 drift,user「請你追根究底去解決」授權):
|
|
4
|
+
* `styles/tokens` is the single consumer import. It must include the runtime CSS
|
|
5
|
+
* needed by shipped DS components: base element styles plus custom utilities
|
|
6
|
+
* backed by DS-owned keyframes.
|
|
7
|
+
*
|
|
8
|
+
* 本檔抽出 base 層為單一 SSOT:DS `src/globals.css` + consumer 都 import,字體/reset 永不 drift。
|
|
9
|
+
* codex 2026-05-29 dual-track 共識 option (a)。
|
|
10
|
+
*
|
|
11
|
+
* 用法(consumer,放在 tokens import 之後):
|
|
12
|
+
* @import '@qijenchen/design-system/styles/tokens';
|
|
13
|
+
* @import '@qijenchen/design-system/styles/base';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/* lucide 全域 stroke width */
|
|
17
|
+
.lucide {
|
|
18
|
+
stroke-width: 1.75;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@layer base {
|
|
22
|
+
*,
|
|
23
|
+
::before,
|
|
24
|
+
::after {
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
border-color: var(--color-neutral-5);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
body {
|
|
30
|
+
background-color: var(--canvas);
|
|
31
|
+
color: var(--foreground);
|
|
32
|
+
font-family: var(--font-sans);
|
|
33
|
+
-webkit-font-smoothing: antialiased;
|
|
34
|
+
-moz-osx-font-smoothing: grayscale;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:focus-visible {
|
|
38
|
+
outline: 2px solid var(--ring);
|
|
39
|
+
outline-offset: 2px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Button pointer cursor(Tailwind v4 移除 v3 的 button cursor,補回符合 UX 直覺) */
|
|
43
|
+
button:not(:disabled),
|
|
44
|
+
[role="button"]:not(:disabled) {
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* Radix Collapsible height animation — consumed by TreeView. */
|
|
50
|
+
@keyframes collapsible-down {
|
|
51
|
+
from { height: 0; }
|
|
52
|
+
to { height: var(--radix-collapsible-content-height); }
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@keyframes collapsible-up {
|
|
56
|
+
from { height: var(--radix-collapsible-content-height); }
|
|
57
|
+
to { height: 0; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@utility animate-collapsible-down {
|
|
61
|
+
animation: collapsible-down 150ms ease-out;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@utility animate-collapsible-up {
|
|
65
|
+
animation: collapsible-up 150ms ease-out;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Radix Accordion height animation — Radix exposes a different content-height var. */
|
|
69
|
+
@keyframes accordion-down {
|
|
70
|
+
from { height: 0; }
|
|
71
|
+
to { height: var(--radix-accordion-content-height); }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@keyframes accordion-up {
|
|
75
|
+
from { height: var(--radix-accordion-content-height); }
|
|
76
|
+
to { height: 0; }
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@utility animate-accordion-down {
|
|
80
|
+
animation: accordion-down 200ms ease-out;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@utility animate-accordion-up {
|
|
84
|
+
animation: accordion-up 200ms ease-out;
|
|
85
|
+
}
|
package/src/styles/tokens.css
CHANGED
|
@@ -34,9 +34,13 @@
|
|
|
34
34
|
@import './../tokens/opacity/opacity.css';
|
|
35
35
|
@import './../tokens/motion/motion.css';
|
|
36
36
|
|
|
37
|
-
/* Non-token CSS (patterns/ + components/) containing
|
|
37
|
+
/* Non-token CSS (patterns/ + components/) containing token/runtime declarations
|
|
38
38
|
or component-internal styles — auto-detected by generator scan. Per 2026-05-27
|
|
39
39
|
root-cause fix: src/globals.css 已 import for DS internal, 但 consumer-facing
|
|
40
40
|
tokens.css aggregator 必須也包含, 不然 consumer 拿不到 → 跑版。 */
|
|
41
41
|
@import './../components/DataTable/data-table.css';
|
|
42
42
|
@import './../patterns/header-canonical/header-canonical.css';
|
|
43
|
+
|
|
44
|
+
/* Base layer — body typography(font-family var(--font-sans))+ reset + focus + button cursor。
|
|
45
|
+
必在 token 之後(依賴 token vars)。Consumer `@import tokens` 一次拿到。SSOT: styles/base.css。 */
|
|
46
|
+
@import './base.css';
|
|
@@ -245,6 +245,13 @@
|
|
|
245
245
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
+
/* Tailwind bridge for absolute anchors.
|
|
249
|
+
Keep the bridge in the primitive color SSOT so text-white/bg-white ship to consumers. */
|
|
250
|
+
@theme inline {
|
|
251
|
+
--color-white: oklch(1 0 0);
|
|
252
|
+
--color-black: oklch(0 0 0);
|
|
253
|
+
}
|
|
254
|
+
|
|
248
255
|
|
|
249
256
|
/* ── Layer 1 — Dark Mode Overrides ── */
|
|
250
257
|
[data-theme="dark"] {
|