@starci/skills 1.1.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/INDEX.md +74 -0
- package/INDEX.vi.md +75 -0
- package/README.md +44 -0
- package/README.vi.md +43 -0
- package/SKILL.md +135 -0
- package/SKILL.vi.md +128 -0
- package/alias/INDEX.md +104 -0
- package/alias/INDEX.vi.md +104 -0
- package/alias/alias.json +297 -0
- package/bin/starci-skills.mjs +219 -0
- package/knowledge/INDEX.md +22 -0
- package/knowledge/INDEX.vi.md +22 -0
- package/knowledge/grammars/starci/DNA.md +146 -0
- package/knowledge/grammars/starci/DNA.vi.md +146 -0
- package/knowledge/grammars/starci/INDEX.md +25 -0
- package/knowledge/grammars/starci/INDEX.vi.md +25 -0
- package/knowledge/grammars/starci/family.md +50 -0
- package/knowledge/grammars/starci/family.vi.md +50 -0
- package/knowledge/grammars/starci/idioms.md +120 -0
- package/knowledge/grammars/starci/idioms.vi.md +121 -0
- package/knowledge/grammars/starci/playbook.md +36 -0
- package/knowledge/grammars/starci/playbook.vi.md +35 -0
- package/knowledge/patterns/be/INDEX.md +29 -0
- package/knowledge/patterns/be/INDEX.vi.md +29 -0
- package/knowledge/patterns/be/comment.md +80 -0
- package/knowledge/patterns/be/comment.vi.md +80 -0
- package/knowledge/patterns/be/error.md +86 -0
- package/knowledge/patterns/be/error.vi.md +86 -0
- package/knowledge/patterns/be/folder.md +87 -0
- package/knowledge/patterns/be/folder.vi.md +86 -0
- package/knowledge/patterns/be/function.md +80 -0
- package/knowledge/patterns/be/function.vi.md +80 -0
- package/knowledge/patterns/be/imports.md +79 -0
- package/knowledge/patterns/be/imports.vi.md +79 -0
- package/knowledge/patterns/be/naming.md +87 -0
- package/knowledge/patterns/be/naming.vi.md +87 -0
- package/knowledge/patterns/be/test.md +79 -0
- package/knowledge/patterns/be/test.vi.md +79 -0
- package/knowledge/patterns/be/typing.md +73 -0
- package/knowledge/patterns/be/typing.vi.md +73 -0
- package/knowledge/patterns/fe/INDEX.md +29 -0
- package/knowledge/patterns/fe/INDEX.vi.md +29 -0
- package/knowledge/patterns/fe/comment.md +70 -0
- package/knowledge/patterns/fe/comment.vi.md +70 -0
- package/knowledge/patterns/fe/error.md +61 -0
- package/knowledge/patterns/fe/error.vi.md +61 -0
- package/knowledge/patterns/fe/folder.md +98 -0
- package/knowledge/patterns/fe/folder.vi.md +95 -0
- package/knowledge/patterns/fe/function.md +70 -0
- package/knowledge/patterns/fe/function.vi.md +70 -0
- package/knowledge/patterns/fe/imports.md +87 -0
- package/knowledge/patterns/fe/imports.vi.md +87 -0
- package/knowledge/patterns/fe/naming.md +77 -0
- package/knowledge/patterns/fe/naming.vi.md +77 -0
- package/knowledge/patterns/fe/test.md +73 -0
- package/knowledge/patterns/fe/test.vi.md +73 -0
- package/knowledge/patterns/fe/typing.md +67 -0
- package/knowledge/patterns/fe/typing.vi.md +67 -0
- package/knowledge/ui/INDEX.md +101 -0
- package/knowledge/ui/INDEX.vi.md +101 -0
- package/knowledge/ui/composition/INDEX.md +60 -0
- package/knowledge/ui/composition/INDEX.vi.md +63 -0
- package/knowledge/ui/composition/accent.md +73 -0
- package/knowledge/ui/composition/accent.vi.md +74 -0
- package/knowledge/ui/composition/action.md +55 -0
- package/knowledge/ui/composition/action.vi.md +56 -0
- package/knowledge/ui/composition/coverage.md +37 -0
- package/knowledge/ui/composition/coverage.vi.md +37 -0
- package/knowledge/ui/composition/cta.md +79 -0
- package/knowledge/ui/composition/cta.vi.md +79 -0
- package/knowledge/ui/composition/feedback.md +55 -0
- package/knowledge/ui/composition/feedback.vi.md +56 -0
- package/knowledge/ui/composition/hierarchy.md +83 -0
- package/knowledge/ui/composition/hierarchy.vi.md +82 -0
- package/knowledge/ui/composition/layout.md +91 -0
- package/knowledge/ui/composition/layout.vi.md +93 -0
- package/knowledge/ui/composition/responsive.md +67 -0
- package/knowledge/ui/composition/responsive.vi.md +67 -0
- package/knowledge/ui/composition/state.md +105 -0
- package/knowledge/ui/composition/state.vi.md +106 -0
- package/knowledge/ui/presentation/INDEX.md +94 -0
- package/knowledge/ui/presentation/INDEX.vi.md +69 -0
- package/knowledge/ui/presentation/boundary.md +170 -0
- package/knowledge/ui/presentation/boundary.vi.md +169 -0
- package/knowledge/ui/presentation/font.md +155 -0
- package/knowledge/ui/presentation/font.vi.md +156 -0
- package/knowledge/ui/presentation/gap.md +181 -0
- package/knowledge/ui/presentation/gap.vi.md +181 -0
- package/knowledge/ui/presentation/margin.md +168 -0
- package/knowledge/ui/presentation/margin.vi.md +171 -0
- package/knowledge/ui/presentation/measure.md +174 -0
- package/knowledge/ui/presentation/measure.vi.md +178 -0
- package/knowledge/ui/presentation/overflow.md +142 -0
- package/knowledge/ui/presentation/overflow.vi.md +142 -0
- package/knowledge/ui/presentation/padding.md +293 -0
- package/knowledge/ui/presentation/padding.vi.md +292 -0
- package/knowledge/ui/presentation/surface.md +166 -0
- package/knowledge/ui/presentation/surface.vi.md +166 -0
- package/knowledge/ui/presentation/text-flow.md +123 -0
- package/knowledge/ui/presentation/text-flow.vi.md +123 -0
- package/knowledge/ui/presentation/tone.md +114 -0
- package/knowledge/ui/presentation/tone.vi.md +113 -0
- package/knowledge/ui/proof/INDEX.md +55 -0
- package/knowledge/ui/proof/INDEX.vi.md +55 -0
- package/knowledge/ui/proof/accessibility.md +67 -0
- package/knowledge/ui/proof/accessibility.vi.md +68 -0
- package/knowledge/ui/proof/contrast.md +58 -0
- package/knowledge/ui/proof/contrast.vi.md +57 -0
- package/knowledge/ui/proof/focus.md +76 -0
- package/knowledge/ui/proof/focus.vi.md +76 -0
- package/knowledge/ui/proof/motion.md +63 -0
- package/knowledge/ui/proof/motion.vi.md +64 -0
- package/knowledge/ui/proof/render-truth.md +63 -0
- package/knowledge/ui/proof/render-truth.vi.md +63 -0
- package/operators/INDEX.md +199 -0
- package/operators/INDEX.vi.md +199 -0
- package/operators/architecture-decide/errors.json +115 -0
- package/operators/architecture-decide/operator.json +20 -0
- package/operators/architecture-decide/operator.md +133 -0
- package/operators/architecture-decide/operator.vi.md +130 -0
- package/operators/architecture-decide/self-test.mjs +221 -0
- package/operators/architecture-decide/validate.mjs +112 -0
- package/operators/backend-source-apply/errors.json +66 -0
- package/operators/backend-source-apply/operator.json +20 -0
- package/operators/backend-source-apply/operator.md +189 -0
- package/operators/backend-source-apply/operator.vi.md +185 -0
- package/operators/backend-source-apply/self-test.mjs +257 -0
- package/operators/backend-source-apply/validate.mjs +240 -0
- package/operators/business-decide/errors.json +78 -0
- package/operators/business-decide/operator.json +20 -0
- package/operators/business-decide/operator.md +176 -0
- package/operators/business-decide/operator.vi.md +174 -0
- package/operators/business-decide/self-test.mjs +225 -0
- package/operators/business-decide/validate.mjs +277 -0
- package/operators/content-generate/errors.json +106 -0
- package/operators/content-generate/operator.json +21 -0
- package/operators/content-generate/operator.md +155 -0
- package/operators/content-generate/operator.vi.md +155 -0
- package/operators/content-generate/self-test.mjs +288 -0
- package/operators/content-generate/validate.mjs +196 -0
- package/operators/errors.json +178 -0
- package/operators/frontend-direction-decide/errors.json +135 -0
- package/operators/frontend-direction-decide/operator.json +21 -0
- package/operators/frontend-direction-decide/operator.md +167 -0
- package/operators/frontend-direction-decide/operator.vi.md +167 -0
- package/operators/frontend-direction-decide/self-test.mjs +226 -0
- package/operators/frontend-direction-decide/validate.mjs +146 -0
- package/operators/frontend-presentation-resolve/errors.json +42 -0
- package/operators/frontend-presentation-resolve/operator.json +19 -0
- package/operators/frontend-presentation-resolve/operator.md +142 -0
- package/operators/frontend-presentation-resolve/operator.vi.md +140 -0
- package/operators/frontend-presentation-resolve/self-test.mjs +163 -0
- package/operators/frontend-presentation-resolve/validate.mjs +143 -0
- package/operators/frontend-source-apply/errors.json +30 -0
- package/operators/frontend-source-apply/operator.json +20 -0
- package/operators/frontend-source-apply/operator.md +127 -0
- package/operators/frontend-source-apply/operator.vi.md +126 -0
- package/operators/frontend-source-apply/self-test.mjs +214 -0
- package/operators/frontend-source-apply/validate.mjs +133 -0
- package/operators/frontend-surface-audit/errors.json +5 -0
- package/operators/frontend-surface-audit/operator.json +22 -0
- package/operators/frontend-surface-audit/operator.md +121 -0
- package/operators/frontend-surface-audit/operator.vi.md +121 -0
- package/operators/frontend-surface-audit/self-test.mjs +185 -0
- package/operators/frontend-surface-audit/validate.mjs +127 -0
- package/operators/git-publish/errors.json +54 -0
- package/operators/git-publish/operator.json +20 -0
- package/operators/git-publish/operator.md +180 -0
- package/operators/git-publish/operator.vi.md +178 -0
- package/operators/git-publish/self-test.mjs +177 -0
- package/operators/git-publish/validate.mjs +106 -0
- package/operators/platform-operate/errors.json +90 -0
- package/operators/platform-operate/operator.json +22 -0
- package/operators/platform-operate/operator.md +162 -0
- package/operators/platform-operate/operator.vi.md +160 -0
- package/operators/platform-operate/self-test.mjs +202 -0
- package/operators/platform-operate/validate.mjs +193 -0
- package/operators/quality-verify/errors.json +54 -0
- package/operators/quality-verify/operator.json +20 -0
- package/operators/quality-verify/operator.md +185 -0
- package/operators/quality-verify/operator.vi.md +177 -0
- package/operators/quality-verify/self-test.mjs +210 -0
- package/operators/quality-verify/validate.mjs +197 -0
- package/operators/release-deploy/errors.json +158 -0
- package/operators/release-deploy/operator.json +23 -0
- package/operators/release-deploy/operator.md +183 -0
- package/operators/release-deploy/operator.vi.md +181 -0
- package/operators/release-deploy/self-test.mjs +235 -0
- package/operators/release-deploy/validate.mjs +129 -0
- package/operators/uat-verify/errors.json +78 -0
- package/operators/uat-verify/operator.json +25 -0
- package/operators/uat-verify/operator.md +162 -0
- package/operators/uat-verify/operator.vi.md +161 -0
- package/operators/uat-verify/self-test.mjs +270 -0
- package/operators/uat-verify/validate.mjs +202 -0
- package/operators/workspace-bind/errors.json +90 -0
- package/operators/workspace-bind/operator.json +21 -0
- package/operators/workspace-bind/operator.md +148 -0
- package/operators/workspace-bind/operator.vi.md +148 -0
- package/operators/workspace-bind/self-test.mjs +205 -0
- package/operators/workspace-bind/validate.mjs +152 -0
- package/package.json +50 -0
- package/readiness/initialization/workspaces/commit-policy.json +91 -0
- package/readiness/initialization/workspaces/config.schema.json +35 -0
- package/readiness/initialization/workspaces/device-state.schema.json +54 -0
- package/readiness/initialization/workspaces/local-route.schema.json +206 -0
- package/readiness/initialization/workspaces/portable-route.schema.json +200 -0
- package/resources/INDEX.md +96 -0
- package/resources/INDEX.vi.md +99 -0
- package/resources/agents/profiles/claude.json +131 -0
- package/resources/agents/profiles/openai.json +131 -0
- package/resources/orchestrator.json +71 -0
- package/resources/tools.json +85 -0
- package/routing.json +272 -0
- package/scripts/alias-registry.mjs +31 -0
- package/scripts/device-state.mjs +497 -0
- package/scripts/device-state.spec.mjs +18 -0
- package/scripts/errors-registry.mjs +68 -0
- package/scripts/generate-alias-doc.mjs +66 -0
- package/scripts/generate-grammar-dna.mjs +387 -0
- package/scripts/generate-operators-index.mjs +95 -0
- package/scripts/generate-presentation-owned.mjs +681 -0
- package/scripts/install-cli.spec.mjs +74 -0
- package/scripts/json-schema.mjs +94 -0
- package/scripts/operator-md.mjs +96 -0
- package/scripts/run-operator-self-tests.mjs +36 -0
- package/scripts/validate-alias.mjs +165 -0
- package/scripts/validate-defaults.mjs +72 -0
- package/scripts/validate-knowledge-citations.mjs +90 -0
- package/scripts/validate-operator.mjs +125 -0
- package/scripts/validate-request.mjs +80 -0
- package/scripts/validate-resources.mjs +117 -0
- package/scripts/validate-response.mjs +141 -0
- package/scripts/validate-routing.mjs +91 -0
- package/scripts/validate-step.mjs +50 -0
- package/scripts/validate-templates.mjs +226 -0
- package/scripts/validate-templates.spec.mjs +144 -0
- package/scripts/validate-workflows.mjs +106 -0
- package/scripts/workspace-portable.mjs +389 -0
- package/scripts/workspace-portable.spec.mjs +246 -0
- package/templates/README.md +47 -0
- package/templates/README.vi.md +45 -0
- package/templates/changes.example.md +27 -0
- package/templates/grammars.template.md +34 -0
- package/templates/kinds/architecture-decision.contract.json +14 -0
- package/templates/kinds/architecture-decision.skeleton.md +52 -0
- package/templates/kinds/backend-source-application.contract.json +10 -0
- package/templates/kinds/backend-source-application.skeleton.md +34 -0
- package/templates/kinds/business-promise-authority.contract.json +13 -0
- package/templates/kinds/business-promise-authority.skeleton.md +67 -0
- package/templates/kinds/capture.schema.json +33 -0
- package/templates/kinds/changes.contract.json +10 -0
- package/templates/kinds/changes.skeleton.md +26 -0
- package/templates/kinds/checks.schema.json +44 -0
- package/templates/kinds/claims.schema.json +165 -0
- package/templates/kinds/conformance.schema.json +15 -0
- package/templates/kinds/content-brief.contract.json +12 -0
- package/templates/kinds/content-brief.skeleton.md +45 -0
- package/templates/kinds/content-generation-receipt.contract.json +11 -0
- package/templates/kinds/content-generation-receipt.skeleton.md +40 -0
- package/templates/kinds/content-review.contract.json +11 -0
- package/templates/kinds/content-review.skeleton.md +45 -0
- package/templates/kinds/contract.schema.json +28 -0
- package/templates/kinds/coverage-matrix.schema.json +86 -0
- package/templates/kinds/coverage.schema.json +62 -0
- package/templates/kinds/current-state.schema.json +40 -0
- package/templates/kinds/delta.schema.json +95 -0
- package/templates/kinds/e2e.schema.json +63 -0
- package/templates/kinds/frontend-direction-decision.contract.json +93 -0
- package/templates/kinds/frontend-direction-decision.skeleton.md +68 -0
- package/templates/kinds/frontend-presentation-resolution.contract.json +11 -0
- package/templates/kinds/frontend-presentation-resolution.skeleton.md +32 -0
- package/templates/kinds/frontend-source-application.contract.json +10 -0
- package/templates/kinds/frontend-source-application.skeleton.md +30 -0
- package/templates/kinds/frontend-surface-audit.contract.json +52 -0
- package/templates/kinds/frontend-surface-audit.skeleton.md +32 -0
- package/templates/kinds/gate-result.schema.json +64 -0
- package/templates/kinds/git-publication.contract.json +82 -0
- package/templates/kinds/git-publication.skeleton.md +61 -0
- package/templates/kinds/independent-critique.contract.json +9 -0
- package/templates/kinds/independent-critique.skeleton.md +28 -0
- package/templates/kinds/inventory.schema.json +35 -0
- package/templates/kinds/model.schema.json +99 -0
- package/templates/kinds/mutations.schema.json +65 -0
- package/templates/kinds/platform-operation-receipt.contract.json +76 -0
- package/templates/kinds/platform-operation-receipt.skeleton.md +54 -0
- package/templates/kinds/probes.schema.json +130 -0
- package/templates/kinds/proof.schema.json +17 -0
- package/templates/kinds/quality-verification.contract.json +87 -0
- package/templates/kinds/quality-verification.skeleton.md +58 -0
- package/templates/kinds/release-deployment.contract.json +85 -0
- package/templates/kinds/release-deployment.skeleton.md +67 -0
- package/templates/kinds/route.schema.json +293 -0
- package/templates/kinds/stack-model.schema.json +90 -0
- package/templates/kinds/uat-capture.schema.json +35 -0
- package/templates/kinds/uat-flow-verification.contract.json +11 -0
- package/templates/kinds/uat-flow-verification.skeleton.md +47 -0
- package/templates/kinds/uat-snapshot.schema.json +96 -0
- package/templates/kinds/uat-verdicts.schema.json +41 -0
- package/templates/kinds/ui-coverage.schema.json +77 -0
- package/templates/kinds/verdicts.schema.json +39 -0
- package/templates/kinds/workspace-route-binding.contract.json +12 -0
- package/templates/kinds/workspace-route-binding.skeleton.md +60 -0
- package/templates/kinds/writes.schema.json +37 -0
- package/templates/operator.template.md +73 -0
- package/templates/patterns.template.md +31 -0
- package/templates/step/request.schema.json +42 -0
- package/templates/step/response.schema.json +144 -0
- package/templates/ui-composition.template.md +36 -0
- package/templates/ui-presentation.template.md +57 -0
- package/templates/ui-proof.template.md +34 -0
- package/workflows/README.md +37 -0
- package/workflows/README.vi.md +37 -0
- package/workflows/backend-feature.json +59 -0
- package/workflows/content-unit.json +19 -0
- package/workflows/frontend-new-surface.json +81 -0
- package/workflows/frontend-reconstruct.json +67 -0
- package/workflows/frontend-refine.json +67 -0
- package/workflows/frontend-with-uat.json +78 -0
- package/workflows/full-feature.json +104 -0
- package/workflows/release.json +29 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Knowledge
|
|
2
|
+
|
|
3
|
+
This tree contains decision authority, not workflow.
|
|
4
|
+
|
|
5
|
+
| Branch | Owns | Must not own |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| [`ui/`](ui/INDEX.md) | Cross-family condition-to-Grammar rules, practical Core examples, measurable UI relationships, and review falsifiers | Business facts, page copy, routes, artwork identity, one-off effects, or operator orchestration |
|
|
8
|
+
| [`grammars/starci/`](grammars/starci/INDEX.md) | Exact StarCi public exports, component/state/composition contracts, direct consumption, and derived-family extension rules | Product truth, local substitutes, or app-owned repairs of Grammar output |
|
|
9
|
+
|
|
10
|
+
Load the smallest canonical English `.md` file and indexed rule that can change the current decision.
|
|
11
|
+
Same-stem `.vi.md` files are human mirrors and must not enter runtime context. Knowledge files omit
|
|
12
|
+
per-topic routing metadata; Grammar operators own lookup and orchestration.
|
|
13
|
+
|
|
14
|
+
`@starci/grammar/core` is the reference compatibility contract. A published derived Grammar may
|
|
15
|
+
override family-scoped CSS, replace existing Core renderers/elements, and add elements through
|
|
16
|
+
declared extension points while preserving public props, meaning, state behavior, accessibility,
|
|
17
|
+
ownership, and substitutability. The application selects one family and supplies product truth; it
|
|
18
|
+
does not patch CSS or import a parallel primitive.
|
|
19
|
+
|
|
20
|
+
When both branches apply, UI knowledge selects the relationship and the selected Grammar binds it to
|
|
21
|
+
an exact published interface. Missing typed family registration or a missing component/prop remains
|
|
22
|
+
`grammar-gap`; neither branch may invent a runnable API or silently override the other.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Knowledge
|
|
2
|
+
|
|
3
|
+
Cây này chứa decision authority, không chứa workflow.
|
|
4
|
+
|
|
5
|
+
| Nhánh | Sở hữu | Không được sở hữu |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| [`ui/`](ui/INDEX.vi.md) | Rule condition-to-Grammar dùng chung giữa family, ví dụ Core thực dụng, quan hệ UI đo được và review falsifier | Business fact, copy page, route, identity artwork, effect một lần hay operator orchestration |
|
|
8
|
+
| [`grammars/starci/`](grammars/starci/INDEX.vi.md) | Exact public export của StarCi, contract component/state/composition, direct consumption và luật extension của derived family | Product truth, substitute cục bộ hay sửa Grammar output ở app |
|
|
9
|
+
|
|
10
|
+
Chỉ load file `.md` tiếng Anh canonical và indexed rule nhỏ nhất có thể đổi quyết định hiện tại. File
|
|
11
|
+
`.vi.md` cùng stem là mirror cho người đọc, không được vào runtime context. Knowledge file bỏ routing
|
|
12
|
+
metadata riêng theo topic; Grammar operator sở hữu lookup và orchestration.
|
|
13
|
+
|
|
14
|
+
`@starci/grammar/core` là reference compatibility contract. Derived Grammar đã publish được override
|
|
15
|
+
CSS có scope theo family, thay renderer/element Core hiện có và thêm element qua extension point đã
|
|
16
|
+
khai báo, đồng thời giữ public prop, meaning, state behavior, accessibility, ownership và
|
|
17
|
+
substitutability. Application chọn đúng một family và truyền product truth; không patch CSS hay
|
|
18
|
+
import primitive song song.
|
|
19
|
+
|
|
20
|
+
Khi cả hai nhánh cùng áp dụng, UI knowledge chọn quan hệ và Grammar đã chọn bind quan hệ đó vào public
|
|
21
|
+
interface chính xác. Typed family registration hoặc component/prop còn thiếu vẫn là `grammar-gap`;
|
|
22
|
+
không nhánh nào được bịa API runnable hay âm thầm override nhánh kia.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# StarCi Core — DNA
|
|
2
|
+
|
|
3
|
+
`@starci/grammar@0.4.1` · checkout `f7167fa78d4c5edb847b16354403aec1c9d5476b` · generated 2026-09-03
|
|
4
|
+
|
|
5
|
+
This file is generated from the live `@starci/grammar` package, never written by hand: identity, tokens, renderers, published props, `data-contract` claims, and emitted classes are read out of `src/`, and the gap list is copied from the `## Gaps` table in [Family and DNA](family.md). Prime a direction agent with this file: it says what exists. [Idioms](idioms.md) says how StarCi composes it, and [Playbook](playbook.md) says which idioms a business shape needs. Regenerate with `node scripts/generate-grammar-dna.mjs`, and verify with `--check`; it needs the routed FE checkout, so it is not part of `npm test`.
|
|
6
|
+
|
|
7
|
+
## Identity
|
|
8
|
+
|
|
9
|
+
| Fact | Value |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Package | `@starci/grammar` |
|
|
12
|
+
| Version | `0.4.1` |
|
|
13
|
+
| Checkout head | `f7167fa78d4c5edb847b16354403aec1c9d5476b` |
|
|
14
|
+
| Family id | `core` |
|
|
15
|
+
| Root component | `CoreGrammarRoot` |
|
|
16
|
+
| Family scope | `data-grammar-family="core"` |
|
|
17
|
+
| Style entrypoint | `@starci/grammar/core/styles.css` |
|
|
18
|
+
| Counts | 41 renderers · 59 tokens · 104 claim entries · 13 gaps |
|
|
19
|
+
|
|
20
|
+
## Tokens
|
|
21
|
+
|
|
22
|
+
| Token | Default |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `--starci-core-accent` | `#7547ff` |
|
|
25
|
+
| `--starci-core-accent-foreground` | `oklch(100% 0 0)` |
|
|
26
|
+
| `--starci-core-border` | `oklch(90% 0.0015 354.13)` |
|
|
27
|
+
| `--starci-core-canvas` | `oklch(97.02% 0.0015 354.13)` |
|
|
28
|
+
| `--starci-core-contained-max-height` | `calc(100dvh - 3rem)` |
|
|
29
|
+
| `--starci-core-control-radius` | `0.75rem` |
|
|
30
|
+
| `--starci-core-copy-gap` | `0.25rem` |
|
|
31
|
+
| `--starci-core-danger` | `oklch(65.32% 0.2335 37.78)` |
|
|
32
|
+
| `--starci-core-danger-foreground` | `oklch(99.11% 0 0)` |
|
|
33
|
+
| `--starci-core-disabled-opacity` | `0.55` |
|
|
34
|
+
| `--starci-core-field-gap` | `0.5rem` |
|
|
35
|
+
| `--starci-core-focus` | `#7248ff` |
|
|
36
|
+
| `--starci-core-foreground` | `oklch(21.03% 0.0015 354.13)` |
|
|
37
|
+
| `--starci-core-form-compact-measure` | `28rem` |
|
|
38
|
+
| `--starci-core-form-measure` | `30rem` |
|
|
39
|
+
| `--starci-core-highlight-angle` | `360deg` |
|
|
40
|
+
| `--starci-core-highlight-inset` | `0` |
|
|
41
|
+
| `--starci-core-info` | `oklch(72% 0.17 250)` |
|
|
42
|
+
| `--starci-core-info-foreground` | `oklch(21.03% 0.0059 250)` |
|
|
43
|
+
| `--starci-core-inline-gap` | `var(--grammar-inline-gap)` |
|
|
44
|
+
| `--starci-core-motion-duration` | `180ms` |
|
|
45
|
+
| `--starci-core-motion-easing` | `cubic-bezier(0.2, 0, 0, 1)` |
|
|
46
|
+
| `--starci-core-muted` | `oklch(55.17% 0.003 354.13)` |
|
|
47
|
+
| `--starci-core-navbar-z` | `50` |
|
|
48
|
+
| `--starci-core-page-inset` | `var(--grammar-page-inset)` |
|
|
49
|
+
| `--starci-core-page-measure` | `80rem` |
|
|
50
|
+
| `--starci-core-pill-radius` | `999px` |
|
|
51
|
+
| `--starci-core-rail-collapsed` | `4rem` |
|
|
52
|
+
| `--starci-core-rail-compact` | `16rem` |
|
|
53
|
+
| `--starci-core-rail-gap` | `1rem` |
|
|
54
|
+
| `--starci-core-rail-gap-compact` | `0.75rem` |
|
|
55
|
+
| `--starci-core-rail-offset` | `5.5rem` |
|
|
56
|
+
| `--starci-core-rail-standard` | `20rem` |
|
|
57
|
+
| `--starci-core-rail-wide` | `24rem` |
|
|
58
|
+
| `--starci-core-reading-measure` | `72ch` |
|
|
59
|
+
| `--starci-core-region-gap` | `var(--grammar-region-gap)` |
|
|
60
|
+
| `--starci-core-row-gap` | `var(--grammar-row-gap)` |
|
|
61
|
+
| `--starci-core-row-gap-compact` | `0.5rem` |
|
|
62
|
+
| `--starci-core-row-inset` | `1rem` |
|
|
63
|
+
| `--starci-core-section-gap` | `var(--grammar-section-gap)` |
|
|
64
|
+
| `--starci-core-separator` | `oklch(92% 0.0015 354.13)` |
|
|
65
|
+
| `--starci-core-subnav-offset` | `4rem` |
|
|
66
|
+
| `--starci-core-subnav-z` | `40` |
|
|
67
|
+
| `--starci-core-success` | `oklch(73.29% 0.1941 162.85)` |
|
|
68
|
+
| `--starci-core-success-foreground` | `oklch(21.03% 0.0059 162.85)` |
|
|
69
|
+
| `--starci-core-surface` | `oklch(100% 0.0008 354.13)` |
|
|
70
|
+
| `--starci-core-surface-inset` | `1rem` |
|
|
71
|
+
| `--starci-core-surface-radius` | `1rem` |
|
|
72
|
+
| `--starci-core-surface-secondary` | `oklch(95.24% 0.0012 354.13)` |
|
|
73
|
+
| `--starci-core-surface-shadow` | `0 8px 28px oklch(21.03% 0.0059 354.13 / 0.07)` |
|
|
74
|
+
| `--starci-core-warning` | `oklch(78.19% 0.159 84.37)` |
|
|
75
|
+
| `--starci-core-warning-foreground` | `oklch(21.03% 0.0059 84.37)` |
|
|
76
|
+
| `--starci-core-workspace-floating-inset` | `1rem` |
|
|
77
|
+
| `--starci-core-workspace-floating-max` | `22rem` |
|
|
78
|
+
| `--starci-core-workspace-floating-z` | `40` |
|
|
79
|
+
| `--starci-core-workspace-leading-seam` | `2rem` |
|
|
80
|
+
| `--starci-core-workspace-navigation-track` | `minmax(14rem, var(--starci-core-workspace-navigation-width, 18rem))` |
|
|
81
|
+
| `--starci-core-workspace-navigation-width` | `18rem` |
|
|
82
|
+
| `--starci-core-workspace-rail-track` | `minmax(16rem, var(--starci-core-rail-standard, 20rem))` |
|
|
83
|
+
|
|
84
|
+
## Renderers
|
|
85
|
+
|
|
86
|
+
| Renderer | Kind | Props with closed values | Claims | Classes |
|
|
87
|
+
| --- | --- | --- | --- | --- |
|
|
88
|
+
| `GrammarRoot` `GrammarRootProps` | primitive | theme: `system` \| `light` \| `dark` | — | — |
|
|
89
|
+
| `PageContainer` `PageContainerProps` | primitive | measure: `reading` \| `product` \| `full` | computed: MARGIN-AUTO MEASURE-1 | `starci-core-page-container` |
|
|
90
|
+
| `Badge` `BadgeProps` | primitive | tone: `neutral` \| `accent` \| `success` \| `warning` \| `danger` | — | — |
|
|
91
|
+
| `Button` `ButtonProps` | primitive | variant: `primary` \| `secondary` \| `tertiary` \| `outline` \| `ghost`; size: `sm` \| `md` \| `lg`; target: `_blank` \| `_self`; type: `button` \| `submit` \| `reset` | — | — |
|
|
92
|
+
| `Divider` `DividerProps` | primitive | — | BOUNDARY-5 GAP-3 | — |
|
|
93
|
+
| `Heading` `HeadingProps` | primitive | level: `1` \| `2` \| `3` \| `4`; scale: `standard` \| `display` | computed: FONT-1 FONT-2 FONT-3 FONT-4 FONT-6 TONE-2 | — |
|
|
94
|
+
| `Icon` `IconProps` | primitive | usage: `heading` \| `leading` \| `chip` | — | — |
|
|
95
|
+
| `IconTile` `IconTileProps` | primitive | source: IconSource; tone: `neutral` \| `accent` \| `success` \| `warning` \| `danger`; size: `sm` \| `md` | computed: OVERFLOW-2 SURFACE-4 SURFACE-5 TONE-2 | — |
|
|
96
|
+
| `IconButton` `IconButtonProps` | primitive | source: IconSource | — | — |
|
|
97
|
+
| `Label` `LabelProps` | primitive | depth: `top` \| `nested`; as: `span` \| `h3` | computed: FONT-1 FONT-2 MARGIN-0 | `starci-core-label` |
|
|
98
|
+
| `Input` `InputProps` | primitive | kind: `email` \| `password` \| `newPassword` \| `code` \| `text`; variant: `primary` \| `secondary` | FONT-1 GAP-2 TONE-2 | — |
|
|
99
|
+
| `Progress` `ProgressProps` | primitive | — | MEASURE-2 | — |
|
|
100
|
+
| `Text` `TextProps` | primitive | as: `div` \| `p` \| `span`; size: `xs` \| `sm` \| `md` \| `metric-lead`; tone: `default` \| `muted` \| `accent`; weight: `normal` \| `medium` \| `semibold`; live: `off` \| `polite` \| `assertive` | computed: FONT-1 FONT-2 FONT-3 FONT-5 GAP-2 TONE-1 TONE-2 TONE-3 | — |
|
|
101
|
+
| `TextAction` `TextActionProps` | primitive | appearance: ActionAppearance; size: ActionTextSize; target: `_blank` \| `_self` | computed: FONT-1 FONT-2 FONT-3 GAP-2 MEASURE-3 PADDING-1 PADDING-2 PADDING-3 SURFACE-4 TONE-1 TONE-2 TONE-3 | — |
|
|
102
|
+
| `SectionHeader` `SectionHeaderProps` | primitive | level: `1` \| `2` \| `3` \| `4`; composition: `section-header` \| `context-intro` | FLOW-3 GAP-2 GAP-5 MARGIN-0 | `starci-core-section-action` `starci-core-section-description` `starci-core-section-eyebrow` `starci-core-section-header` `starci-core-section-header-copy` `starci-core-section-title` |
|
|
103
|
+
| `MediaFrame` `MediaFrameProps` | primitive | aspect: `landscape` \| `portrait` \| `square` \| `auto`; fit: `cover` \| `contain`; treatment: `framed` \| `plain` | FLOW-3 GAP-2 MARGIN-0 computed: BOUNDARY-5 OVERFLOW-2 SURFACE-1 SURFACE-3 | `starci-core-media-caption` `starci-core-media-frame` `starci-core-media-viewport` |
|
|
104
|
+
| `IncludedMark` `IncludedMarkProps` | primitive | — | — | `starci-core-included-mark` |
|
|
105
|
+
| `RankArtwork` `RankArtworkProps` | primitive | kind: `first` \| `second` \| `third` \| `cup` | — | `starci-core-rank-artwork` |
|
|
106
|
+
| `SurfaceCopyGroup` `SurfaceCopyGroupProps` | primitive | density: `compact` \| `comfortable` | computed: GAP-2 GAP-3 | `starci-core-surface-copy-group` |
|
|
107
|
+
| `PrimaryRailLayout` `PrimaryRailLayoutProps` | composition | railWidth: `compact` \| `standard` \| `wide`; align: `start` \| `stretch` | GAP-5 | `starci-core-primary-rail-container` `starci-core-primary-rail-layout` `starci-core-primary-region` `starci-core-rail-region` |
|
|
108
|
+
| `NavigationFeatureNav` `NavigationFeatureNavProps` | composition | position: `static` \| `sticky` | BOUNDARY-1 GAP-2 GAP-3 MEASURE-2 PADDING-3 | `starci-core-navigation-feature-nav` `starci-core-navigation-feature-nav-actions` `starci-core-navigation-feature-nav-compact-navigation` `starci-core-navigation-feature-nav-feature` `starci-core-navigation-feature-nav-identity` `starci-core-navigation-feature-nav-navigation` `starci-core-navigation-feature-nav-primary` |
|
|
109
|
+
| `Sidebar` `SidebarProps` | composition | source: IconSource; presentation: `rail` \| `drawer`; toggleSource: IconSource | FLOW-4 FONT-1 FONT-2 GAP-1 PADDING-0 PADDING-1 PADDING-2 PADDING-3 TONE-2 computed: GAP-3 MEASURE-2 MEASURE-6 OVERFLOW-2 SURFACE-4 TONE-1 | — |
|
|
110
|
+
| `WorkspaceShell` `WorkspaceShellProps` | composition | navigationTrack: `fixed` \| `intrinsic`; navigationVisibility: `always` \| `wide`; railMode: `flow` \| `sticky`; railWidth: `compact` \| `standard` \| `wide`; railInset: `none` \| `content`; railPosition: `leading` \| `trailing`; align: `start` \| `stretch` | BOUNDARY-1 BOUNDARY-4 GAP-5 MARGIN-5 MEASURE-1 OVERFLOW-4 | `starci-core-workspace-shell` `starci-core-workspace-shell-compact-header` `starci-core-workspace-shell-compact-navigation` `starci-core-workspace-shell-floating-layer` `starci-core-workspace-shell-header` `starci-core-workspace-shell-layout` `starci-core-workspace-shell-leading-rule` `starci-core-workspace-shell-navigation` `starci-core-workspace-shell-primary` `starci-core-workspace-shell-rail` |
|
|
111
|
+
| `ChatWorkspace` `ChatWorkspaceProps` | composition | railWidth: `compact` \| `standard` \| `wide` | BOUNDARY-1 FONT-2 GAP-5 OVERFLOW-2 OVERFLOW-4 OVERFLOW-5 PADDING-0 PADDING-2 PADDING-3 PADDING-4 SURFACE-2 TONE-1 | `starci-core-chat-workspace` `starci-core-chat-workspace-composer` `starci-core-chat-workspace-conversation` `starci-core-chat-workspace-drawer-body` `starci-core-chat-workspace-drawer-close` `starci-core-chat-workspace-drawer-content` `starci-core-chat-workspace-drawer-dialog` `starci-core-chat-workspace-header` `starci-core-chat-workspace-inline-rail` `starci-core-chat-workspace-layout` `starci-core-chat-workspace-layout-without-rail` `starci-core-chat-workspace-overlay-rail` `starci-core-chat-workspace-primary` `starci-core-chat-workspace-rail-trigger` `starci-core-chat-workspace-rail-trigger-boundary` |
|
|
112
|
+
| `StateMark` `StateMarkProps` | core | state: PresentationState | — | — |
|
|
113
|
+
| `LeadingNumber` `LeadingNumberProps` | core | — | — | — |
|
|
114
|
+
| `OtpInput` `OtpInputProps` | core | — | OVERFLOW-3 OVERFLOW-5 PADDING-1 | — |
|
|
115
|
+
| `StaticStateRow` `StaticStateRowProps` | composite | state: PresentationState | BOUNDARY-3 GAP-1 GAP-3 PADDING-4 | — |
|
|
116
|
+
| `EmptyNotice` `EmptyNoticeProps` | composite | iconSource: IconSource; actionVariant: ButtonVariant | GAP-3 PADDING-4 | — |
|
|
117
|
+
| `HorizontalScrollRegion` `HorizontalScrollRegionProps` | composite | — | MEASURE-3 OVERFLOW-3 OVERFLOW-5 PADDING-1 | `starci-core-horizontal-scroll-region` |
|
|
118
|
+
| `VerticalScrollRegion` `VerticalScrollRegionProps` | composite | — | MEASURE-7 OVERFLOW-3 | — |
|
|
119
|
+
| `SurfaceCard` `SurfaceCardProps` | branch | depth: `top` \| `nested`; state: PresentationState; frame: `bounded` \| `frameless`; scroll: `page` \| `contained`; composition: `single` \| `joined`; measure: `content` \| `form` \| `formCompact`; height: `auto` \| `fill` | GAP-2 computed: BOUNDARY-5 BOUNDARY-6 GAP-0 OVERFLOW-1 OVERFLOW-2 PADDING-0 PADDING-4 SURFACE-1 SURFACE-2 SURFACE-4 | `starci-core-frameless-surface` `starci-core-surface` `starci-core-surface-card` `starci-core-surface-card--fill` `starci-core-surface-content` `starci-core-surface-highlight` `starci-core-surface-highlight-sweep` `starci-core-surface-label` |
|
|
120
|
+
| `SurfaceListCard` `SurfaceListCardProps` | branch | depth: `top` \| `nested` | GAP-2 OVERFLOW-2 PADDING-0 SURFACE-2 computed: FONT-1 FONT-2 TONE-2 | `starci-core-list-shell` `starci-core-owned-collection` `starci-core-surface` `starci-core-surface-footer` `starci-core-surface-label` `starci-core-surface-list` |
|
|
121
|
+
| `FencedCodeBlock` `FencedCodeBlockProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
122
|
+
| `MarkdownArticle` `MarkdownArticleProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
123
|
+
| `MarkdownTableFrame` `MarkdownTableFrameProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
124
|
+
| `SurfaceAccordionCard` `SurfaceAccordionCardProps` | branch | depth: `top` \| `nested` | BOUNDARY-3 GAP-2 MARGIN-0 PADDING-0 PADDING-4 PADDING-8 TONE-1 computed: BOUNDARY-5 BOUNDARY-6 OVERFLOW-1 OVERFLOW-2 SURFACE-1 SURFACE-2 | `starci-core-accordion-body` `starci-core-accordion-heading` `starci-core-accordion-panel` `starci-core-accordion-row` `starci-core-accordion-scroll-region` `starci-core-accordion-shell` `starci-core-accordion-trigger` `starci-core-surface-accordion-card` |
|
|
125
|
+
| `Rail` `RailProps` | branch | height: `content` \| `fill`; mode: `flow` \| `sticky`; width: `compact` \| `standard` \| `wide`; state: PresentationState; collapse: `expanded` \| `collapsed`; motion: `static` \| `animated` \| `reduced`; inset: `none` \| `content` | GAP-4 computed: MEASURE-6 OVERFLOW-3 PADDING-3 PADDING-5 | `starci-core-rail` `starci-core-rail-body` `starci-core-rail-footer` `starci-core-rail-frame` `starci-core-visually-hidden` |
|
|
126
|
+
| `Subnav` `SubnavProps` | branch | position: `static` \| `sticky`; visibility: `always` \| `compact` | BOUNDARY-1 FLOW-4 GAP-2 GAP-3 PADDING-3 | `starci-core-subnav` `starci-core-subnav-identity` `starci-core-subnav-leading` `starci-core-subnav-title` `starci-core-subnav-toggle` |
|
|
127
|
+
| `Tabs` `TabsProps` | branch | labelVisibility: `responsive` \| `always`; inset: `page` \| `none` | FLOW-2 GAP-2 OVERFLOW-4 PADDING-3 computed: PADDING-5 | `starci-core-tab-content` `starci-core-tab-label` `starci-core-tabs` `starci-core-tabs-frame` `starci-core-tabs-scroll` |
|
|
128
|
+
| `Tooltip` `TooltipProps` | branch | placement: `top` \| `bottom` | FLOW-2 FONT-1 PADDING-1 PADDING-2 | `starci-core-tooltip` `starci-core-tooltip-content` |
|
|
129
|
+
|
|
130
|
+
## Gaps
|
|
131
|
+
|
|
132
|
+
| Component | Missing capability | Evidence |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `SurfaceCard`, `SurfaceListCard`, `SurfaceAccordionCard` | no typed heading level and no labelled-by-external-heading capability, so a surface whose correct level is not 3 has no owner | `packages/grammar/src/core/primitive/Label/index.tsx`; `packages/grammar/src/core/branch/SurfaceCard/index.tsx` |
|
|
135
|
+
| Common overlay owner | Common publishes no general overlay or elevation prop | `packages/grammar/src/core/branch/Tooltip/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
136
|
+
| `Badge` | `Badge` accepts absent `children` and renders a non-breaking space, so a glyph-only chip is representable and word presence is not enforced by the type | `packages/grammar/src/core/primitive/Badge/index.tsx` |
|
|
137
|
+
| `Tabs` | `leading` is an optional `ReactNode`, not a typed `Icon`, so nothing forces a glyph or its `usage` on each peer | `packages/grammar/src/core/branch/Tabs/index.tsx` |
|
|
138
|
+
| `Button`, `TextAction` | neither action publishes a motion anchor or attribute for its adornment, so a family has nothing to animate beyond `data-component` | `packages/grammar/src/core/primitive/Button/index.tsx`; `packages/grammar/src/core/primitive/TextAction/index.tsx` |
|
|
139
|
+
| `Icon` | `Icon` has no direction-aware mirroring contract; the app's registry chooses the literal glyph | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
140
|
+
| `IconButton` | `isActive` emits `data-active="true"` only, with no `aria-pressed`, so an active utility is visual-only | `packages/grammar/src/core/primitive/IconButton/index.tsx` |
|
|
141
|
+
| `Tooltip` | `aria-describedby` is placed on the tooltip's wrapper `span`, not on the focusable control, so the description is not programmatically attached to the button | `packages/grammar/src/core/branch/Tooltip/index.tsx` |
|
|
142
|
+
| `Icon` | `Icon` accepts only `source`; there is no fallback or error contract, so a missing registry mapping must be resolved by the app before render | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
143
|
+
| `MediaFrame` | no `object-position` or focal prop, and `className` reaches the figure rather than the viewport child, so a required off-centre crop has no owner | `packages/grammar/src/core/primitive/MediaFrame/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
144
|
+
| `MediaFrame` | `MediaFrame` publishes no loading or error prop and renders no state | `packages/grammar/src/core/primitive/MediaFrame/index.tsx` |
|
|
145
|
+
| `OtpInput` | `OtpInput` publishes `disabled` and `invalid` (not the `isDisabled`/`isError` names) and no skeleton input, so its unresolved state has no owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
146
|
+
| `OtpInput` | `OtpInput` publishes no `label`, `hint`, or `errorMessage` slot; only `describedBy` links outside text, so its visible identity has no Common owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# StarCi Core — DNA
|
|
2
|
+
|
|
3
|
+
`@starci/grammar@0.4.1` · checkout `f7167fa78d4c5edb847b16354403aec1c9d5476b` · sinh ngày 2026-09-03
|
|
4
|
+
|
|
5
|
+
File này được sinh ra từ package `@starci/grammar` đang chạy, không viết tay: danh tính, token, renderer, prop công bố, claim `data-contract` và class phát ra đều đọc thẳng từ `src/`, còn danh sách gap được chép từ bảng `## Gap` trong [Family và DNA](family.vi.md). Hãy mồi cho agent định hướng bằng đúng file này: nó nói cái gì đang tồn tại. [Idiom](idioms.vi.md) nói StarCi ghép chúng ra sao, còn [Playbook](playbook.vi.md) nói hình dạng nghiệp vụ nào cần chuỗi idiom nào. Sinh lại bằng `node scripts/generate-grammar-dna.mjs`, kiểm bằng `--check`; lệnh này cần checkout FE đã định tuyến nên không nằm trong `npm test`.
|
|
6
|
+
|
|
7
|
+
## Danh tính
|
|
8
|
+
|
|
9
|
+
| Dữ kiện | Giá trị |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| Package | `@starci/grammar` |
|
|
12
|
+
| Phiên bản | `0.4.1` |
|
|
13
|
+
| Head của checkout | `f7167fa78d4c5edb847b16354403aec1c9d5476b` |
|
|
14
|
+
| Family id | `core` |
|
|
15
|
+
| Component gốc | `CoreGrammarRoot` |
|
|
16
|
+
| Phạm vi family | `data-grammar-family="core"` |
|
|
17
|
+
| Điểm vào CSS | `@starci/grammar/core/styles.css` |
|
|
18
|
+
| Số đếm | 41 renderer · 59 token · 104 mục claim · 13 gap |
|
|
19
|
+
|
|
20
|
+
## Token
|
|
21
|
+
|
|
22
|
+
| Token | Mặc định |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `--starci-core-accent` | `#7547ff` |
|
|
25
|
+
| `--starci-core-accent-foreground` | `oklch(100% 0 0)` |
|
|
26
|
+
| `--starci-core-border` | `oklch(90% 0.0015 354.13)` |
|
|
27
|
+
| `--starci-core-canvas` | `oklch(97.02% 0.0015 354.13)` |
|
|
28
|
+
| `--starci-core-contained-max-height` | `calc(100dvh - 3rem)` |
|
|
29
|
+
| `--starci-core-control-radius` | `0.75rem` |
|
|
30
|
+
| `--starci-core-copy-gap` | `0.25rem` |
|
|
31
|
+
| `--starci-core-danger` | `oklch(65.32% 0.2335 37.78)` |
|
|
32
|
+
| `--starci-core-danger-foreground` | `oklch(99.11% 0 0)` |
|
|
33
|
+
| `--starci-core-disabled-opacity` | `0.55` |
|
|
34
|
+
| `--starci-core-field-gap` | `0.5rem` |
|
|
35
|
+
| `--starci-core-focus` | `#7248ff` |
|
|
36
|
+
| `--starci-core-foreground` | `oklch(21.03% 0.0015 354.13)` |
|
|
37
|
+
| `--starci-core-form-compact-measure` | `28rem` |
|
|
38
|
+
| `--starci-core-form-measure` | `30rem` |
|
|
39
|
+
| `--starci-core-highlight-angle` | `360deg` |
|
|
40
|
+
| `--starci-core-highlight-inset` | `0` |
|
|
41
|
+
| `--starci-core-info` | `oklch(72% 0.17 250)` |
|
|
42
|
+
| `--starci-core-info-foreground` | `oklch(21.03% 0.0059 250)` |
|
|
43
|
+
| `--starci-core-inline-gap` | `var(--grammar-inline-gap)` |
|
|
44
|
+
| `--starci-core-motion-duration` | `180ms` |
|
|
45
|
+
| `--starci-core-motion-easing` | `cubic-bezier(0.2, 0, 0, 1)` |
|
|
46
|
+
| `--starci-core-muted` | `oklch(55.17% 0.003 354.13)` |
|
|
47
|
+
| `--starci-core-navbar-z` | `50` |
|
|
48
|
+
| `--starci-core-page-inset` | `var(--grammar-page-inset)` |
|
|
49
|
+
| `--starci-core-page-measure` | `80rem` |
|
|
50
|
+
| `--starci-core-pill-radius` | `999px` |
|
|
51
|
+
| `--starci-core-rail-collapsed` | `4rem` |
|
|
52
|
+
| `--starci-core-rail-compact` | `16rem` |
|
|
53
|
+
| `--starci-core-rail-gap` | `1rem` |
|
|
54
|
+
| `--starci-core-rail-gap-compact` | `0.75rem` |
|
|
55
|
+
| `--starci-core-rail-offset` | `5.5rem` |
|
|
56
|
+
| `--starci-core-rail-standard` | `20rem` |
|
|
57
|
+
| `--starci-core-rail-wide` | `24rem` |
|
|
58
|
+
| `--starci-core-reading-measure` | `72ch` |
|
|
59
|
+
| `--starci-core-region-gap` | `var(--grammar-region-gap)` |
|
|
60
|
+
| `--starci-core-row-gap` | `var(--grammar-row-gap)` |
|
|
61
|
+
| `--starci-core-row-gap-compact` | `0.5rem` |
|
|
62
|
+
| `--starci-core-row-inset` | `1rem` |
|
|
63
|
+
| `--starci-core-section-gap` | `var(--grammar-section-gap)` |
|
|
64
|
+
| `--starci-core-separator` | `oklch(92% 0.0015 354.13)` |
|
|
65
|
+
| `--starci-core-subnav-offset` | `4rem` |
|
|
66
|
+
| `--starci-core-subnav-z` | `40` |
|
|
67
|
+
| `--starci-core-success` | `oklch(73.29% 0.1941 162.85)` |
|
|
68
|
+
| `--starci-core-success-foreground` | `oklch(21.03% 0.0059 162.85)` |
|
|
69
|
+
| `--starci-core-surface` | `oklch(100% 0.0008 354.13)` |
|
|
70
|
+
| `--starci-core-surface-inset` | `1rem` |
|
|
71
|
+
| `--starci-core-surface-radius` | `1rem` |
|
|
72
|
+
| `--starci-core-surface-secondary` | `oklch(95.24% 0.0012 354.13)` |
|
|
73
|
+
| `--starci-core-surface-shadow` | `0 8px 28px oklch(21.03% 0.0059 354.13 / 0.07)` |
|
|
74
|
+
| `--starci-core-warning` | `oklch(78.19% 0.159 84.37)` |
|
|
75
|
+
| `--starci-core-warning-foreground` | `oklch(21.03% 0.0059 84.37)` |
|
|
76
|
+
| `--starci-core-workspace-floating-inset` | `1rem` |
|
|
77
|
+
| `--starci-core-workspace-floating-max` | `22rem` |
|
|
78
|
+
| `--starci-core-workspace-floating-z` | `40` |
|
|
79
|
+
| `--starci-core-workspace-leading-seam` | `2rem` |
|
|
80
|
+
| `--starci-core-workspace-navigation-track` | `minmax(14rem, var(--starci-core-workspace-navigation-width, 18rem))` |
|
|
81
|
+
| `--starci-core-workspace-navigation-width` | `18rem` |
|
|
82
|
+
| `--starci-core-workspace-rail-track` | `minmax(16rem, var(--starci-core-rail-standard, 20rem))` |
|
|
83
|
+
|
|
84
|
+
## Renderer
|
|
85
|
+
|
|
86
|
+
| Renderer | Loại | Prop có tập giá trị đóng | Claim | Class |
|
|
87
|
+
| --- | --- | --- | --- | --- |
|
|
88
|
+
| `GrammarRoot` `GrammarRootProps` | primitive | theme: `system` \| `light` \| `dark` | — | — |
|
|
89
|
+
| `PageContainer` `PageContainerProps` | primitive | measure: `reading` \| `product` \| `full` | computed: MARGIN-AUTO MEASURE-1 | `starci-core-page-container` |
|
|
90
|
+
| `Badge` `BadgeProps` | primitive | tone: `neutral` \| `accent` \| `success` \| `warning` \| `danger` | — | — |
|
|
91
|
+
| `Button` `ButtonProps` | primitive | variant: `primary` \| `secondary` \| `tertiary` \| `outline` \| `ghost`; size: `sm` \| `md` \| `lg`; target: `_blank` \| `_self`; type: `button` \| `submit` \| `reset` | — | — |
|
|
92
|
+
| `Divider` `DividerProps` | primitive | — | BOUNDARY-5 GAP-3 | — |
|
|
93
|
+
| `Heading` `HeadingProps` | primitive | level: `1` \| `2` \| `3` \| `4`; scale: `standard` \| `display` | computed: FONT-1 FONT-2 FONT-3 FONT-4 FONT-6 TONE-2 | — |
|
|
94
|
+
| `Icon` `IconProps` | primitive | usage: `heading` \| `leading` \| `chip` | — | — |
|
|
95
|
+
| `IconTile` `IconTileProps` | primitive | source: IconSource; tone: `neutral` \| `accent` \| `success` \| `warning` \| `danger`; size: `sm` \| `md` | computed: OVERFLOW-2 SURFACE-4 SURFACE-5 TONE-2 | — |
|
|
96
|
+
| `IconButton` `IconButtonProps` | primitive | source: IconSource | — | — |
|
|
97
|
+
| `Label` `LabelProps` | primitive | depth: `top` \| `nested`; as: `span` \| `h3` | computed: FONT-1 FONT-2 MARGIN-0 | `starci-core-label` |
|
|
98
|
+
| `Input` `InputProps` | primitive | kind: `email` \| `password` \| `newPassword` \| `code` \| `text`; variant: `primary` \| `secondary` | FONT-1 GAP-2 TONE-2 | — |
|
|
99
|
+
| `Progress` `ProgressProps` | primitive | — | MEASURE-2 | — |
|
|
100
|
+
| `Text` `TextProps` | primitive | as: `div` \| `p` \| `span`; size: `xs` \| `sm` \| `md` \| `metric-lead`; tone: `default` \| `muted` \| `accent`; weight: `normal` \| `medium` \| `semibold`; live: `off` \| `polite` \| `assertive` | computed: FONT-1 FONT-2 FONT-3 FONT-5 GAP-2 TONE-1 TONE-2 TONE-3 | — |
|
|
101
|
+
| `TextAction` `TextActionProps` | primitive | appearance: ActionAppearance; size: ActionTextSize; target: `_blank` \| `_self` | computed: FONT-1 FONT-2 FONT-3 GAP-2 MEASURE-3 PADDING-1 PADDING-2 PADDING-3 SURFACE-4 TONE-1 TONE-2 TONE-3 | — |
|
|
102
|
+
| `SectionHeader` `SectionHeaderProps` | primitive | level: `1` \| `2` \| `3` \| `4`; composition: `section-header` \| `context-intro` | FLOW-3 GAP-2 GAP-5 MARGIN-0 | `starci-core-section-action` `starci-core-section-description` `starci-core-section-eyebrow` `starci-core-section-header` `starci-core-section-header-copy` `starci-core-section-title` |
|
|
103
|
+
| `MediaFrame` `MediaFrameProps` | primitive | aspect: `landscape` \| `portrait` \| `square` \| `auto`; fit: `cover` \| `contain`; treatment: `framed` \| `plain` | FLOW-3 GAP-2 MARGIN-0 computed: BOUNDARY-5 OVERFLOW-2 SURFACE-1 SURFACE-3 | `starci-core-media-caption` `starci-core-media-frame` `starci-core-media-viewport` |
|
|
104
|
+
| `IncludedMark` `IncludedMarkProps` | primitive | — | — | `starci-core-included-mark` |
|
|
105
|
+
| `RankArtwork` `RankArtworkProps` | primitive | kind: `first` \| `second` \| `third` \| `cup` | — | `starci-core-rank-artwork` |
|
|
106
|
+
| `SurfaceCopyGroup` `SurfaceCopyGroupProps` | primitive | density: `compact` \| `comfortable` | computed: GAP-2 GAP-3 | `starci-core-surface-copy-group` |
|
|
107
|
+
| `PrimaryRailLayout` `PrimaryRailLayoutProps` | composition | railWidth: `compact` \| `standard` \| `wide`; align: `start` \| `stretch` | GAP-5 | `starci-core-primary-rail-container` `starci-core-primary-rail-layout` `starci-core-primary-region` `starci-core-rail-region` |
|
|
108
|
+
| `NavigationFeatureNav` `NavigationFeatureNavProps` | composition | position: `static` \| `sticky` | BOUNDARY-1 GAP-2 GAP-3 MEASURE-2 PADDING-3 | `starci-core-navigation-feature-nav` `starci-core-navigation-feature-nav-actions` `starci-core-navigation-feature-nav-compact-navigation` `starci-core-navigation-feature-nav-feature` `starci-core-navigation-feature-nav-identity` `starci-core-navigation-feature-nav-navigation` `starci-core-navigation-feature-nav-primary` |
|
|
109
|
+
| `Sidebar` `SidebarProps` | composition | source: IconSource; presentation: `rail` \| `drawer`; toggleSource: IconSource | FLOW-4 FONT-1 FONT-2 GAP-1 PADDING-0 PADDING-1 PADDING-2 PADDING-3 TONE-2 computed: GAP-3 MEASURE-2 MEASURE-6 OVERFLOW-2 SURFACE-4 TONE-1 | — |
|
|
110
|
+
| `WorkspaceShell` `WorkspaceShellProps` | composition | navigationTrack: `fixed` \| `intrinsic`; navigationVisibility: `always` \| `wide`; railMode: `flow` \| `sticky`; railWidth: `compact` \| `standard` \| `wide`; railInset: `none` \| `content`; railPosition: `leading` \| `trailing`; align: `start` \| `stretch` | BOUNDARY-1 BOUNDARY-4 GAP-5 MARGIN-5 MEASURE-1 OVERFLOW-4 | `starci-core-workspace-shell` `starci-core-workspace-shell-compact-header` `starci-core-workspace-shell-compact-navigation` `starci-core-workspace-shell-floating-layer` `starci-core-workspace-shell-header` `starci-core-workspace-shell-layout` `starci-core-workspace-shell-leading-rule` `starci-core-workspace-shell-navigation` `starci-core-workspace-shell-primary` `starci-core-workspace-shell-rail` |
|
|
111
|
+
| `ChatWorkspace` `ChatWorkspaceProps` | composition | railWidth: `compact` \| `standard` \| `wide` | BOUNDARY-1 FONT-2 GAP-5 OVERFLOW-2 OVERFLOW-4 OVERFLOW-5 PADDING-0 PADDING-2 PADDING-3 PADDING-4 SURFACE-2 TONE-1 | `starci-core-chat-workspace` `starci-core-chat-workspace-composer` `starci-core-chat-workspace-conversation` `starci-core-chat-workspace-drawer-body` `starci-core-chat-workspace-drawer-close` `starci-core-chat-workspace-drawer-content` `starci-core-chat-workspace-drawer-dialog` `starci-core-chat-workspace-header` `starci-core-chat-workspace-inline-rail` `starci-core-chat-workspace-layout` `starci-core-chat-workspace-layout-without-rail` `starci-core-chat-workspace-overlay-rail` `starci-core-chat-workspace-primary` `starci-core-chat-workspace-rail-trigger` `starci-core-chat-workspace-rail-trigger-boundary` |
|
|
112
|
+
| `StateMark` `StateMarkProps` | core | state: PresentationState | — | — |
|
|
113
|
+
| `LeadingNumber` `LeadingNumberProps` | core | — | — | — |
|
|
114
|
+
| `OtpInput` `OtpInputProps` | core | — | OVERFLOW-3 OVERFLOW-5 PADDING-1 | — |
|
|
115
|
+
| `StaticStateRow` `StaticStateRowProps` | composite | state: PresentationState | BOUNDARY-3 GAP-1 GAP-3 PADDING-4 | — |
|
|
116
|
+
| `EmptyNotice` `EmptyNoticeProps` | composite | iconSource: IconSource; actionVariant: ButtonVariant | GAP-3 PADDING-4 | — |
|
|
117
|
+
| `HorizontalScrollRegion` `HorizontalScrollRegionProps` | composite | — | MEASURE-3 OVERFLOW-3 OVERFLOW-5 PADDING-1 | `starci-core-horizontal-scroll-region` |
|
|
118
|
+
| `VerticalScrollRegion` `VerticalScrollRegionProps` | composite | — | MEASURE-7 OVERFLOW-3 | — |
|
|
119
|
+
| `SurfaceCard` `SurfaceCardProps` | branch | depth: `top` \| `nested`; state: PresentationState; frame: `bounded` \| `frameless`; scroll: `page` \| `contained`; composition: `single` \| `joined`; measure: `content` \| `form` \| `formCompact`; height: `auto` \| `fill` | GAP-2 computed: BOUNDARY-5 BOUNDARY-6 GAP-0 OVERFLOW-1 OVERFLOW-2 PADDING-0 PADDING-4 SURFACE-1 SURFACE-2 SURFACE-4 | `starci-core-frameless-surface` `starci-core-surface` `starci-core-surface-card` `starci-core-surface-card--fill` `starci-core-surface-content` `starci-core-surface-highlight` `starci-core-surface-highlight-sweep` `starci-core-surface-label` |
|
|
120
|
+
| `SurfaceListCard` `SurfaceListCardProps` | branch | depth: `top` \| `nested` | GAP-2 OVERFLOW-2 PADDING-0 SURFACE-2 computed: FONT-1 FONT-2 TONE-2 | `starci-core-list-shell` `starci-core-owned-collection` `starci-core-surface` `starci-core-surface-footer` `starci-core-surface-label` `starci-core-surface-list` |
|
|
121
|
+
| `FencedCodeBlock` `FencedCodeBlockProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
122
|
+
| `MarkdownArticle` `MarkdownArticleProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
123
|
+
| `MarkdownTableFrame` `MarkdownTableFrameProps` | branch | measure: `reading` \| `compact` | OVERFLOW-4 | — |
|
|
124
|
+
| `SurfaceAccordionCard` `SurfaceAccordionCardProps` | branch | depth: `top` \| `nested` | BOUNDARY-3 GAP-2 MARGIN-0 PADDING-0 PADDING-4 PADDING-8 TONE-1 computed: BOUNDARY-5 BOUNDARY-6 OVERFLOW-1 OVERFLOW-2 SURFACE-1 SURFACE-2 | `starci-core-accordion-body` `starci-core-accordion-heading` `starci-core-accordion-panel` `starci-core-accordion-row` `starci-core-accordion-scroll-region` `starci-core-accordion-shell` `starci-core-accordion-trigger` `starci-core-surface-accordion-card` |
|
|
125
|
+
| `Rail` `RailProps` | branch | height: `content` \| `fill`; mode: `flow` \| `sticky`; width: `compact` \| `standard` \| `wide`; state: PresentationState; collapse: `expanded` \| `collapsed`; motion: `static` \| `animated` \| `reduced`; inset: `none` \| `content` | GAP-4 computed: MEASURE-6 OVERFLOW-3 PADDING-3 PADDING-5 | `starci-core-rail` `starci-core-rail-body` `starci-core-rail-footer` `starci-core-rail-frame` `starci-core-visually-hidden` |
|
|
126
|
+
| `Subnav` `SubnavProps` | branch | position: `static` \| `sticky`; visibility: `always` \| `compact` | BOUNDARY-1 FLOW-4 GAP-2 GAP-3 PADDING-3 | `starci-core-subnav` `starci-core-subnav-identity` `starci-core-subnav-leading` `starci-core-subnav-title` `starci-core-subnav-toggle` |
|
|
127
|
+
| `Tabs` `TabsProps` | branch | labelVisibility: `responsive` \| `always`; inset: `page` \| `none` | FLOW-2 GAP-2 OVERFLOW-4 PADDING-3 computed: PADDING-5 | `starci-core-tab-content` `starci-core-tab-label` `starci-core-tabs` `starci-core-tabs-frame` `starci-core-tabs-scroll` |
|
|
128
|
+
| `Tooltip` `TooltipProps` | branch | placement: `top` \| `bottom` | FLOW-2 FONT-1 PADDING-1 PADDING-2 | `starci-core-tooltip` `starci-core-tooltip-content` |
|
|
129
|
+
|
|
130
|
+
## Gap
|
|
131
|
+
|
|
132
|
+
| Component | Năng lực còn thiếu | Bằng chứng |
|
|
133
|
+
| --- | --- | --- |
|
|
134
|
+
| `SurfaceCard`, `SurfaceListCard`, `SurfaceAccordionCard` | không có cấp heading có kiểu và không có khả năng gắn nhãn bằng heading bên ngoài, nên một surface mà cấp đúng không phải 3 thì không có owner | `packages/grammar/src/core/primitive/Label/index.tsx`; `packages/grammar/src/core/branch/SurfaceCard/index.tsx` |
|
|
135
|
+
| Owner overlay của Common | Common không công bố prop overlay hay độ nâng tổng quát nào | `packages/grammar/src/core/branch/Tooltip/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
136
|
+
| `Badge` | `Badge` chấp nhận thiếu `children` và render một khoảng trắng không ngắt, nên chip chỉ có glyph vẫn biểu diễn được và sự hiện diện của chữ không được kiểu dữ liệu ép | `packages/grammar/src/core/primitive/Badge/index.tsx` |
|
|
137
|
+
| `Tabs` | `leading` là `ReactNode` tuỳ chọn, không phải `Icon` có kiểu, nên không gì ép glyph hay `usage` của nó lên từng mục | `packages/grammar/src/core/branch/Tabs/index.tsx` |
|
|
138
|
+
| `Button`, `TextAction` | không action nào công bố neo hay thuộc tính chuyển động cho phần trang trí của nó, nên family không có gì để animate ngoài `data-component` | `packages/grammar/src/core/primitive/Button/index.tsx`; `packages/grammar/src/core/primitive/TextAction/index.tsx` |
|
|
139
|
+
| `Icon` | `Icon` không có hợp đồng soi gương theo hướng; registry của app chọn glyph nguyên nghĩa | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
140
|
+
| `IconButton` | `isActive` chỉ phát `data-active="true"`, không có `aria-pressed`, nên một tiện ích đang active chỉ là thị giác | `packages/grammar/src/core/primitive/IconButton/index.tsx` |
|
|
141
|
+
| `Tooltip` | `aria-describedby` được đặt lên `span` bọc của tooltip, không lên control nhận focus, nên mô tả không được gắn theo chương trình vào nút | `packages/grammar/src/core/branch/Tooltip/index.tsx` |
|
|
142
|
+
| `Icon` | `Icon` chỉ nhận `source`; không có hợp đồng dự phòng hay lỗi, nên một ánh xạ registry thiếu phải được app giải quyết trước khi render | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
143
|
+
| `MediaFrame` | không có prop `object-position` hay tiêu điểm, và `className` chạm tới figure chứ không tới con của viewport, nên một crop lệch tâm bắt buộc không có owner | `packages/grammar/src/core/primitive/MediaFrame/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
144
|
+
| `MediaFrame` | `MediaFrame` không công bố prop loading hay error và không render state nào | `packages/grammar/src/core/primitive/MediaFrame/index.tsx` |
|
|
145
|
+
| `OtpInput` | `OtpInput` công bố `disabled` và `invalid` (không phải tên `isDisabled`/`isError`) và không có đầu vào skeleton, nên state chưa phân giải của nó không có owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
146
|
+
| `OtpInput` | `OtpInput` không công bố slot `label`, `hint` hay `errorMessage`; chỉ `describedBy` nối tới chữ bên ngoài, nên danh tính nhìn thấy của nó không có owner Common | `packages/grammar/src/core/OtpInput.tsx` |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# StarCi Core Grammar — reading index
|
|
2
|
+
|
|
3
|
+
This branch documents one visual family: StarCi Core, and the taste that directs how it is composed. Universal UI law remains canonical in [knowledge/ui](../../ui/INDEX.md); this branch maps those X-n rules to the live Core family and records the idioms StarCi actually builds with. It never re-narrates renderer anatomy — [DNA](DNA.md), generated from the package, already says what exists and what each renderer owns.
|
|
4
|
+
|
|
5
|
+
## Authority chain
|
|
6
|
+
|
|
7
|
+
`knowledge/ui X-n → @starci/grammar/common props/anatomy/state → @starci/grammar/core DNA and scoped CSS → product adapter`
|
|
8
|
+
|
|
9
|
+
- Common owns public renderers, props, semantic DOM, accessibility, presentation states, universal spacing, `COMMON_GRAMMAR_COMPONENTS`, and `defineGrammarFamily`.
|
|
10
|
+
- Core is a sibling family with id `core`; `CoreGrammarRoot` installs `data-grammar-family="core"`, and the `@starci/grammar/core` entry re-exports every Common renderer, so a Core consumer imports from one entry.
|
|
11
|
+
- Feature code owns domain facts, routes, copy, permissions, persistence, and effects.
|
|
12
|
+
- Product names such as Learn, Console, Dashboard, Navbar, or Course never become Grammar identities.
|
|
13
|
+
|
|
14
|
+
## Read order
|
|
15
|
+
|
|
16
|
+
0. [DNA](DNA.md) — generated from the package: what exists. Prime a direction agent with this file.
|
|
17
|
+
1. [Idioms](idioms.md) — how StarCi composes what exists, each idiom evidenced at least twice in the live blocks.
|
|
18
|
+
2. [Playbook](playbook.md) — which idiom sequence a business shape asks for, and what a supplied reference may contribute.
|
|
19
|
+
3. [Family and DNA](family.md) — the visual family's own identity, tokens, CSS direction, theme binding, and the one gap table the whole family publishes.
|
|
20
|
+
|
|
21
|
+
Read 0 through 2 to decide what to build; read 3 when a row raises a question about the family itself. How the package is consumed in code (imports, one family root, forbidden clones) is FE-IMPORTS-5 and FE-IMPORTS-7 in knowledge/patterns/fe.
|
|
22
|
+
|
|
23
|
+
## Review gates
|
|
24
|
+
|
|
25
|
+
A valid change has no renderer import from `@starci/grammar/core`, no Common CSS import of Core CSS, no feature-named component in Grammar, no duplicated X-n law, and no EN/VI drift. Core-specific claims must resolve to live source or be named as a gap.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# StarCi Core Grammar — mục lục đọc
|
|
2
|
+
|
|
3
|
+
Nhánh này mô tả một visual family: StarCi Core, và cái gu chỉ đạo cách ghép nó. Luật UI universal vẫn canonical tại [knowledge/ui](../../ui/INDEX.vi.md); nhánh này map các luật X-n đó vào family Core đang chạy và ghi lại những idiom StarCi thực sự dựng bằng. Nó không kể lại giải phẫu renderer — [DNA](DNA.vi.md), sinh ra từ package, đã nói cái gì tồn tại và mỗi renderer sở hữu cái gì.
|
|
4
|
+
|
|
5
|
+
## Chuỗi authority
|
|
6
|
+
|
|
7
|
+
`knowledge/ui X-n → @starci/grammar/common props/anatomy/state → @starci/grammar/core DNA và scoped CSS → product adapter`
|
|
8
|
+
|
|
9
|
+
- Common sở hữu public renderer, props, semantic DOM, accessibility, presentation state, universal spacing, `COMMON_GRAMMAR_COMPONENTS` và `defineGrammarFamily`.
|
|
10
|
+
- Core là sibling family có id `core`; `CoreGrammarRoot` cài `data-grammar-family="core"`.
|
|
11
|
+
- Feature code sở hữu domain fact, route, copy, permission, persistence và effect.
|
|
12
|
+
- Tên product như Learn, Console, Dashboard, Navbar hay Course không bao giờ trở thành Grammar identity.
|
|
13
|
+
|
|
14
|
+
## Thứ tự đọc
|
|
15
|
+
|
|
16
|
+
0. [DNA](DNA.vi.md) — sinh ra từ package: cái gì đang tồn tại. Mồi cho agent định hướng bằng đúng file này.
|
|
17
|
+
1. [Idiom](idioms.vi.md) — StarCi ghép những thứ đang tồn tại ra sao, mỗi idiom có ít nhất hai bằng chứng trong block đang chạy.
|
|
18
|
+
2. [Playbook](playbook.vi.md) — hình dạng nghiệp vụ nào đòi chuỗi idiom nào, và tham chiếu được góp gì.
|
|
19
|
+
3. [Family và DNA](family.vi.md) — danh tính riêng của visual family, token, hướng CSS, binding theme, và bảng gap duy nhất mà cả family công bố.
|
|
20
|
+
|
|
21
|
+
Đọc 0 tới 2 để quyết định dựng gì; đọc 3 khi một dòng đặt câu hỏi về chính family. Cách tiêu thụ gói trong code (import, một root family, cấm clone) là FE-IMPORTS-5 và FE-IMPORTS-7 trong knowledge/patterns/fe.
|
|
22
|
+
|
|
23
|
+
## Gate review
|
|
24
|
+
|
|
25
|
+
Thay đổi hợp lệ không import renderer từ `@starci/grammar/core`, Common CSS không import Core CSS, Grammar không có feature-named component, không lặp luật X-n và không drift EN/VI. Claim riêng của Core phải resolve được tới source đang chạy hoặc ghi rõ là gap.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# StarCi Core family and DNA
|
|
2
|
+
|
|
3
|
+
## Family identity
|
|
4
|
+
|
|
5
|
+
StarCi Core is defined by `coreGrammar` and selected by `CoreGrammarRoot`. It implements the Common contract; it is not the parent of Common or of any other family. `CORE_GRAMMAR_COMPONENTS` remains only a compatibility alias to `COMMON_GRAMMAR_COMPONENTS`.
|
|
6
|
+
|
|
7
|
+
Applicable universal rules: [TONE-1..3](../../ui/presentation/tone.md), [ACCENT-1..5](../../ui/composition/accent.md), [BOUNDARY-1..6](../../ui/presentation/boundary.md), [FONT-1..6](../../ui/presentation/font.md), [GAP-0..6](../../ui/presentation/gap.md), and [PADDING-0..8](../../ui/presentation/padding.md).
|
|
8
|
+
|
|
9
|
+
## CSS dependency direction
|
|
10
|
+
|
|
11
|
+
`core/styles.css` imports `common/styles.css`. Common supplies renderer anatomy, geometry, state structure, responsive composition, and universal `--grammar-*` spacing. Core supplies only family-scoped values and theme bindings. Common never imports Core; another family never imports Core.
|
|
12
|
+
|
|
13
|
+
## Core DNA
|
|
14
|
+
|
|
15
|
+
`STARCI_CORE_DNA`, token names, light/dark defaults, and legacy spacing aliases are published only by `@starci/grammar/core`. Core binds semantic variables including canvas/background, surface, foreground, muted, border/separator, accent/focus, success/warning/danger/info pairs, fields, radii, shadow, and motion.
|
|
16
|
+
|
|
17
|
+
The universal spacing source is Common: `COMMON_SPACING_SCALE` and `COMMON_SPACING_TOKENS`. `--starci-core-page-inset`, `--starci-core-region-gap`, `--starci-core-section-gap`, `--starci-core-row-gap`, and `--starci-core-inline-gap` are compatibility aliases to `--grammar-*`, not a second scale.
|
|
18
|
+
|
|
19
|
+
## Theme and accessibility binding
|
|
20
|
+
|
|
21
|
+
Core supports light, explicit dark, system dark, forced colors, focus-visible, and reduced motion under the Core root. It preserves Common semantics and cannot use palette or motion to change business truth. Applicable rules: [A11Y-1..4](../../ui/proof/accessibility.md), [FOCUS-1..4](../../ui/proof/focus.md), [MOTION-1..4](../../ui/proof/motion.md), and [STATE-1..3](../../ui/composition/state.md).
|
|
22
|
+
|
|
23
|
+
## Source-backed family behavior and gaps
|
|
24
|
+
|
|
25
|
+
- Core keeps the Common `SurfaceCard` renderer/props/semantics and uses family-scoped CSS plus the neutral `data-grammar-surface-labelled` hook to paint the outer labelled card as one material box. The inner bounded frame becomes transparent/no-shadow, so the label is visually inside Core material. Heritage's symmetric test paints only its inner frame, keeping the label outside without creating a second contract.
|
|
26
|
+
- `ButtonVariant` has no destructive/danger variant ([CTA-4](../../ui/composition/cta.md)).
|
|
27
|
+
- Common has no general modal focus-containment/restoration owner ([FOCUS-3](../../ui/proof/focus.md)).
|
|
28
|
+
|
|
29
|
+
## Gaps
|
|
30
|
+
|
|
31
|
+
Capabilities the live package does not publish, read out of the renderer source named in each row.
|
|
32
|
+
This table is the one gap inventory of the family: `scripts/generate-grammar-dna.mjs` copies it into
|
|
33
|
+
[DNA](DNA.md), so a gap recorded anywhere else is not published. A row states what is missing, never
|
|
34
|
+
which rule it once hung on.
|
|
35
|
+
|
|
36
|
+
| Component | Missing capability | Evidence |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `SurfaceCard`, `SurfaceListCard`, `SurfaceAccordionCard` | no typed heading level and no labelled-by-external-heading capability, so a surface whose correct level is not 3 has no owner | `packages/grammar/src/core/primitive/Label/index.tsx`; `packages/grammar/src/core/branch/SurfaceCard/index.tsx` |
|
|
39
|
+
| Common overlay owner | Common publishes no general overlay or elevation prop | `packages/grammar/src/core/branch/Tooltip/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
40
|
+
| `Badge` | `Badge` accepts absent `children` and renders a non-breaking space, so a glyph-only chip is representable and word presence is not enforced by the type | `packages/grammar/src/core/primitive/Badge/index.tsx` |
|
|
41
|
+
| `Tabs` | `leading` is an optional `ReactNode`, not a typed `Icon`, so nothing forces a glyph or its `usage` on each peer | `packages/grammar/src/core/branch/Tabs/index.tsx` |
|
|
42
|
+
| `Button`, `TextAction` | neither action publishes a motion anchor or attribute for its adornment, so a family has nothing to animate beyond `data-component` | `packages/grammar/src/core/primitive/Button/index.tsx`; `packages/grammar/src/core/primitive/TextAction/index.tsx` |
|
|
43
|
+
| `Icon` | `Icon` has no direction-aware mirroring contract; the app's registry chooses the literal glyph | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
44
|
+
| `IconButton` | `isActive` emits `data-active="true"` only, with no `aria-pressed`, so an active utility is visual-only | `packages/grammar/src/core/primitive/IconButton/index.tsx` |
|
|
45
|
+
| `Tooltip` | `aria-describedby` is placed on the tooltip's wrapper `span`, not on the focusable control, so the description is not programmatically attached to the button | `packages/grammar/src/core/branch/Tooltip/index.tsx` |
|
|
46
|
+
| `Icon` | `Icon` accepts only `source`; there is no fallback or error contract, so a missing registry mapping must be resolved by the app before render | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
47
|
+
| `MediaFrame` | no `object-position` or focal prop, and `className` reaches the figure rather than the viewport child, so a required off-centre crop has no owner | `packages/grammar/src/core/primitive/MediaFrame/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
48
|
+
| `MediaFrame` | `MediaFrame` publishes no loading or error prop and renders no state | `packages/grammar/src/core/primitive/MediaFrame/index.tsx` |
|
|
49
|
+
| `OtpInput` | `OtpInput` publishes `disabled` and `invalid` (not the `isDisabled`/`isError` names) and no skeleton input, so its unresolved state has no owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
50
|
+
| `OtpInput` | `OtpInput` publishes no `label`, `hint`, or `errorMessage` slot; only `describedBy` links outside text, so its visible identity has no Common owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# StarCi Core family và DNA
|
|
2
|
+
|
|
3
|
+
## Family identity
|
|
4
|
+
|
|
5
|
+
StarCi Core được định nghĩa bởi `coreGrammar` và được chọn bằng `CoreGrammarRoot`. Nó hiện thực Common contract; nó không phải parent của Common hay family khác. `CORE_GRAMMAR_COMPONENTS` chỉ còn là compatibility alias tới `COMMON_GRAMMAR_COMPONENTS`.
|
|
6
|
+
|
|
7
|
+
Luật universal áp dụng: [TONE-1..3](../../ui/presentation/tone.vi.md), [ACCENT-1..5](../../ui/composition/accent.vi.md), [BOUNDARY-1..6](../../ui/presentation/boundary.vi.md), [FONT-1..6](../../ui/presentation/font.vi.md), [GAP-0..6](../../ui/presentation/gap.vi.md) và [PADDING-0..8](../../ui/presentation/padding.vi.md).
|
|
8
|
+
|
|
9
|
+
## Hướng dependency CSS
|
|
10
|
+
|
|
11
|
+
`core/styles.css` import `common/styles.css`. Common cung cấp renderer anatomy, geometry, cấu trúc state, responsive composition và spacing universal `--grammar-*`. Core chỉ cung cấp value theo scope family và theme binding. Common không import Core; family khác không import Core.
|
|
12
|
+
|
|
13
|
+
## Core DNA
|
|
14
|
+
|
|
15
|
+
`STARCI_CORE_DNA`, token name, default light/dark và legacy spacing alias chỉ được publish từ `@starci/grammar/core`. Core bind các semantic variable gồm canvas/background, surface, foreground, muted, border/separator, accent/focus, cặp success/warning/danger/info, field, radius, shadow và motion.
|
|
16
|
+
|
|
17
|
+
Nguồn spacing universal là Common: `COMMON_SPACING_SCALE` và `COMMON_SPACING_TOKENS`. `--starci-core-page-inset`, `--starci-core-region-gap`, `--starci-core-section-gap`, `--starci-core-row-gap` và `--starci-core-inline-gap` là compatibility alias tới `--grammar-*`, không phải scale thứ hai.
|
|
18
|
+
|
|
19
|
+
## Binding theme và accessibility
|
|
20
|
+
|
|
21
|
+
Core hỗ trợ light, explicit dark, system dark, forced colors, focus-visible và reduced motion dưới Core root. Nó giữ semantics Common và không được dùng palette hay motion để đổi business truth. Luật áp dụng: [A11Y-1..4](../../ui/proof/accessibility.vi.md), [FOCUS-1..4](../../ui/proof/focus.vi.md), [MOTION-1..4](../../ui/proof/motion.vi.md) và [STATE-1..3](../../ui/composition/state.vi.md).
|
|
22
|
+
|
|
23
|
+
## Behavior family và gap có bằng chứng source
|
|
24
|
+
|
|
25
|
+
- Core giữ Common `SurfaceCard` renderer/props/semantics và dùng family-scoped CSS cùng hook neutral `data-grammar-surface-labelled` để paint outer labelled card thành một material box. Inner bounded frame trở thành transparent/không shadow nên label visually inside Core material. Test đối xứng của Heritage chỉ paint inner frame, giữ label ở ngoài mà không tạo contract thứ hai.
|
|
26
|
+
- `ButtonVariant` chưa có destructive/danger variant ([CTA-4](../../ui/composition/cta.vi.md)).
|
|
27
|
+
- Common chưa có owner tổng quát cho modal focus containment/restoration ([FOCUS-3](../../ui/proof/focus.vi.md)).
|
|
28
|
+
|
|
29
|
+
## Gap
|
|
30
|
+
|
|
31
|
+
Những năng lực package đang chạy không công bố, đọc từ đúng source renderer mà mỗi dòng nêu tên. Bảng
|
|
32
|
+
này là bản kiểm kê gap duy nhất của family: `scripts/generate-grammar-dna.mjs` chép nó sang
|
|
33
|
+
[DNA](DNA.vi.md), nên một gap ghi ở chỗ khác là chưa được công bố. Mỗi dòng nói cái gì đang thiếu,
|
|
34
|
+
không nói nó từng treo vào luật nào.
|
|
35
|
+
|
|
36
|
+
| Component | Năng lực còn thiếu | Bằng chứng |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| `SurfaceCard`, `SurfaceListCard`, `SurfaceAccordionCard` | không có cấp heading có kiểu và không có khả năng gắn nhãn bằng heading bên ngoài, nên một surface mà cấp đúng không phải 3 thì không có owner | `packages/grammar/src/core/primitive/Label/index.tsx`; `packages/grammar/src/core/branch/SurfaceCard/index.tsx` |
|
|
39
|
+
| Owner overlay của Common | Common không công bố prop overlay hay độ nâng tổng quát nào | `packages/grammar/src/core/branch/Tooltip/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
40
|
+
| `Badge` | `Badge` chấp nhận thiếu `children` và render một khoảng trắng không ngắt, nên chip chỉ có glyph vẫn biểu diễn được và sự hiện diện của chữ không được kiểu dữ liệu ép | `packages/grammar/src/core/primitive/Badge/index.tsx` |
|
|
41
|
+
| `Tabs` | `leading` là `ReactNode` tuỳ chọn, không phải `Icon` có kiểu, nên không gì ép glyph hay `usage` của nó lên từng mục | `packages/grammar/src/core/branch/Tabs/index.tsx` |
|
|
42
|
+
| `Button`, `TextAction` | không action nào công bố neo hay thuộc tính chuyển động cho phần trang trí của nó, nên family không có gì để animate ngoài `data-component` | `packages/grammar/src/core/primitive/Button/index.tsx`; `packages/grammar/src/core/primitive/TextAction/index.tsx` |
|
|
43
|
+
| `Icon` | `Icon` không có hợp đồng soi gương theo hướng; registry của app chọn glyph nguyên nghĩa | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
44
|
+
| `IconButton` | `isActive` chỉ phát `data-active="true"`, không có `aria-pressed`, nên một tiện ích đang active chỉ là thị giác | `packages/grammar/src/core/primitive/IconButton/index.tsx` |
|
|
45
|
+
| `Tooltip` | `aria-describedby` được đặt lên `span` bọc của tooltip, không lên control nhận focus, nên mô tả không được gắn theo chương trình vào nút | `packages/grammar/src/core/branch/Tooltip/index.tsx` |
|
|
46
|
+
| `Icon` | `Icon` chỉ nhận `source`; không có hợp đồng dự phòng hay lỗi, nên một ánh xạ registry thiếu phải được app giải quyết trước khi render | `packages/grammar/src/core/primitive/Icon/index.tsx` |
|
|
47
|
+
| `MediaFrame` | không có prop `object-position` hay tiêu điểm, và `className` chạm tới figure chứ không tới con của viewport, nên một crop lệch tâm bắt buộc không có owner | `packages/grammar/src/core/primitive/MediaFrame/index.tsx`; `packages/grammar/src/common/styles.css` |
|
|
48
|
+
| `MediaFrame` | `MediaFrame` không công bố prop loading hay error và không render state nào | `packages/grammar/src/core/primitive/MediaFrame/index.tsx` |
|
|
49
|
+
| `OtpInput` | `OtpInput` công bố `disabled` và `invalid` (không phải tên `isDisabled`/`isError`) và không có đầu vào skeleton, nên state chưa phân giải của nó không có owner | `packages/grammar/src/core/OtpInput.tsx` |
|
|
50
|
+
| `OtpInput` | `OtpInput` không công bố slot `label`, `hint` hay `errorMessage`; chỉ `describedBy` nối tới chữ bên ngoài, nên danh tính nhìn thấy của nó không có owner Common | `packages/grammar/src/core/OtpInput.tsx` |
|