soma-kit 0.1.15 → 0.1.16
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/README.md +1 -1
- package/package.json +8 -5
- package/packs/ai/model-card.ts +3 -3
- package/packs/ops/error-budget-card.ts +3 -3
- package/packs/ops/release-readiness-card.ts +3 -3
- package/packs/security/control-evidence-card.ts +3 -3
- package/packs/security/finding-card.ts +3 -2
- package/packs/shared/card-util.ts +17 -0
- package/spec/generated/kit-app.schema.json +2148 -340
- package/spec/generated/kit-page.schema.json +1134 -139
- package/spec/kit-grammar.json +934 -92
- package/spec/kit-grammar.schema.json +167 -2
- package/src/app/app-config.ts +219 -186
- package/src/app/define-kit-actions.ts +126 -20
- package/src/app/define-kit-app.ts +49 -4
- package/src/app/index.ts +5 -0
- package/src/app/kit-view-context.ts +39 -1
- package/src/app/list-page-defaults.ts +14 -0
- package/src/app/server-pages.ts +239 -7
- package/src/app/server.ts +466 -25
- package/src/app/theme-endpoint.ts +67 -23
- package/src/app/theme-runtime.ts +414 -85
- package/src/app/theme-shards.ts +69 -0
- package/src/app/tier-compat.ts +107 -0
- package/src/base/action-busy.ts +215 -38
- package/src/base/affix.ts +137 -0
- package/src/base/alert.ts +104 -59
- package/src/base/anchored-layer.ts +7 -6
- package/src/base/avatar.ts +147 -61
- package/src/base/badge.ts +186 -0
- package/src/base/button-group.ts +227 -0
- package/src/base/button.ts +347 -50
- package/src/base/card.ts +233 -0
- package/src/base/cascader.ts +143 -32
- package/src/base/check-core.ts +193 -33
- package/src/base/checkbox.ts +67 -2
- package/src/base/choice.ts +132 -31
- package/src/base/collapse.ts +249 -0
- package/src/base/color-picker.ts +399 -27
- package/src/base/combobox.ts +6 -2
- package/src/base/command-palette.ts +148 -36
- package/src/base/context-menu.ts +23 -6
- package/src/base/countdown.ts +37 -15
- package/src/base/date-range.ts +114 -96
- package/src/base/date.ts +481 -74
- package/src/base/delta.ts +16 -9
- package/src/base/divider.ts +51 -33
- package/src/base/end-edge.ts +10 -4
- package/src/base/fab.ts +57 -21
- package/src/base/gap-value.ts +34 -15
- package/src/base/hint-tips.ts +99 -29
- package/src/base/identity-cells.ts +839 -0
- package/src/base/illustrations.ts +6 -4
- package/src/base/image.ts +40 -19
- package/src/base/index.ts +79 -22
- package/src/base/inline-error.ts +13 -7
- package/src/base/input.ts +135 -35
- package/src/base/kbd.ts +30 -17
- package/src/base/kit-contract.ts +400 -0
- package/src/base/link.ts +41 -20
- package/src/base/listbox-core.ts +282 -101
- package/src/base/loading-gate.ts +3 -0
- package/src/base/look.ts +197 -0
- package/src/base/mentions.ts +55 -22
- package/src/base/menu-button.ts +73 -22
- package/src/base/menu-core.ts +201 -24
- package/src/base/month-grid.ts +60 -3
- package/src/base/motion/aura.ts +52 -10
- package/src/base/motion/hover-3d.ts +7 -5
- package/src/base/motion/hover-gallery.ts +16 -12
- package/src/base/motion/limits.ts +10 -0
- package/src/base/motion/marquee.ts +18 -11
- package/src/base/motion/text-rotate.ts +34 -16
- package/src/base/notification.ts +292 -0
- package/src/base/number.ts +93 -12
- package/src/base/otp.ts +139 -27
- package/src/base/overlay-runtime.ts +30 -23
- package/src/base/overlay-shell.ts +59 -14
- package/src/base/period-picker.ts +868 -0
- package/src/base/popover.ts +624 -73
- package/src/base/popup.ts +187 -52
- package/src/base/portal-core.ts +99 -2
- package/src/base/price-text.ts +51 -17
- package/src/base/progress.ts +100 -18
- package/src/base/qr-code.ts +64 -17
- package/src/base/qty-stepper.ts +141 -22
- package/src/base/radio.ts +43 -2
- package/src/base/range.ts +194 -39
- package/src/base/rating.ts +117 -31
- package/src/base/reason-tip.ts +58 -16
- package/src/base/relation-cells.ts +541 -0
- package/src/base/resize-handle.ts +5 -3
- package/src/base/row-fresh.ts +84 -0
- package/src/base/section-spy.ts +79 -0
- package/src/base/segmented.ts +70 -26
- package/src/base/select.ts +8 -3
- package/src/base/shared.ts +482 -71
- package/src/base/spinner.ts +107 -0
- package/src/base/state-panel.ts +77 -22
- package/src/base/sticky-edge.ts +96 -29
- package/src/base/swap.ts +39 -21
- package/src/base/switch.ts +158 -38
- package/src/base/tabs.ts +292 -0
- package/src/base/tag-input.ts +123 -54
- package/src/base/tag.ts +184 -66
- package/src/base/text.ts +461 -71
- package/src/base/textarea.ts +88 -39
- package/src/base/time-picker.ts +335 -55
- package/src/base/time-range.ts +846 -0
- package/src/base/tree-select.ts +342 -88
- package/src/base/upload.ts +604 -158
- package/src/base/view-transition.ts +7 -3
- package/src/base/virtual-list.ts +49 -14
- package/src/biz/approval-desk/compile.ts +70 -5
- package/src/biz/approval-desk/index.ts +2 -0
- package/src/biz/approval-desk/shell.ts +52 -12
- package/src/biz/auth-panel/compile.ts +13 -3
- package/src/biz/auth-panel/shell.ts +27 -7
- package/src/biz/category-crud/compile.ts +51 -13
- package/src/biz/category-crud/index.ts +2 -0
- package/src/biz/category-crud/shell.ts +29 -9
- package/src/biz/checkout-page/compile.ts +37 -3
- package/src/biz/checkout-page/index.ts +1 -0
- package/src/biz/checkout-page/shell.ts +26 -9
- package/src/biz/compose.ts +6 -1
- package/src/biz/data-components.ts +2 -0
- package/src/biz/import-wizard/compile.ts +4 -1
- package/src/biz/import-wizard/index.ts +1 -0
- package/src/biz/import-wizard/shell.ts +32 -18
- package/src/biz/index.ts +1 -1
- package/src/biz/landing-page/compile.ts +3 -2
- package/src/biz/landing-page/shell.ts +22 -3
- package/src/biz/layout-contracts.ts +918 -0
- package/src/biz/link/hub.ts +199 -8
- package/src/biz/link/shared.ts +54 -15
- package/src/biz/master-sub/compile.ts +194 -57
- package/src/biz/master-sub/detail-head.ts +141 -18
- package/src/biz/master-sub/index.ts +3 -0
- package/src/biz/master-sub/shell.ts +186 -57
- package/src/biz/multi-board/compile.ts +87 -36
- package/src/biz/multi-board/composition.ts +7 -20
- package/src/biz/multi-board/index.ts +3 -2
- package/src/biz/multi-board/prose-fold.ts +15 -11
- package/src/biz/multi-board/shell.ts +148 -37
- package/src/biz/notification-center/compile.ts +20 -6
- package/src/biz/notification-center/index.ts +2 -0
- package/src/biz/notification-center/shell.ts +43 -10
- package/src/biz/page-templates/domain-templates.ts +145 -22
- package/src/biz/page-templates/result-page/compile.ts +4 -1
- package/src/biz/page-templates/result-page/index.ts +1 -0
- package/src/biz/page-templates/result-page/shell.ts +17 -4
- package/src/biz/page-templates/sign-in-page/compile.ts +19 -8
- package/src/biz/page-templates/sign-in-page/index.ts +1 -0
- package/src/biz/page-templates/sign-in-page/shell.ts +28 -12
- package/src/biz/record-detail/compile.ts +39 -11
- package/src/biz/record-detail/index.ts +1 -0
- package/src/biz/record-detail/shell.ts +41 -10
- package/src/biz/settings-center/compile.ts +4 -1
- package/src/biz/settings-center/index.ts +1 -0
- package/src/biz/settings-center/shell.ts +30 -9
- package/src/biz/shared/action-host.ts +137 -46
- package/src/biz/shared/compile-helpers.ts +130 -28
- package/src/biz/shared/coordinator.ts +628 -147
- package/src/biz/shared/focus-return.ts +180 -0
- package/src/biz/shared/object-aliases.ts +7 -1
- package/src/biz/shared/overlay-compile.ts +58 -10
- package/src/biz/shared/overlay-shell.ts +40 -10
- package/src/biz/shared/page-form-actions.ts +151 -0
- package/src/biz/shared/page-form.ts +255 -0
- package/src/biz/shared/pipeline.ts +74 -0
- package/src/biz/shared/runtime-hub.ts +101 -8
- package/src/biz/shared/verbs.ts +129 -0
- package/src/biz/single-form/compile.ts +4 -2
- package/src/biz/single-form/index.ts +2 -0
- package/src/biz/single-form/shell.ts +21 -11
- package/src/biz/standard-crud/compile.ts +206 -38
- package/src/biz/standard-crud/index.ts +2 -1
- package/src/biz/standard-crud/shell.ts +82 -22
- package/src/biz/standard-crud/summary.ts +2 -37
- package/src/biz/step-form/compile.ts +12 -3
- package/src/biz/step-form/hub.ts +165 -50
- package/src/biz/step-form/index.ts +1 -0
- package/src/biz/step-form/shell.ts +31 -15
- package/src/biz/types.ts +40 -4
- package/src/cli/kit-cli.ts +145 -26
- package/src/cli/kit-init.ts +3 -3
- package/src/cli/migrate/theme-map.ts +35 -28
- package/src/cli/migrate/ts-rules.ts +2 -2
- package/src/cli/migrate/types.ts +3 -3
- package/src/cli/migrate/yaml-rules.ts +11 -9
- package/src/cli/view-writes.ts +13 -0
- package/src/compile/closed-set.ts +102 -6
- package/src/compile/compile-page.ts +446 -53
- package/src/compile/component-candidates.ts +56 -4
- package/src/compile/danger-tier.ts +65 -0
- package/src/compile/hints.ts +1 -1
- package/src/compile/info-structure.ts +155 -0
- package/src/compile/layout-lint/rules-composition.ts +2 -1
- package/src/compile/layout-lint/rules-table.ts +4 -19
- package/src/compile/look-page.ts +551 -0
- package/src/compile/look.ts +376 -0
- package/src/compile/page-composition.ts +382 -46
- package/src/compile/page-hierarchy.ts +131 -0
- package/src/compile/page-pipeline-look.ts +156 -0
- package/src/compile/page-pipeline.ts +200 -0
- package/src/compile/parse.ts +12 -11
- package/src/compile/relation-render.ts +120 -0
- package/src/compile/remove-guard.ts +115 -41
- package/src/compile/stages.ts +645 -28
- package/src/compile/styles.ts +226 -26
- package/src/compile/types.ts +62 -5
- package/src/compile/view-check.ts +190 -1
- package/src/data/access-gate.ts +17 -9
- package/src/data/amount-breakdown.ts +49 -22
- package/src/data/anchor-nav.ts +73 -15
- package/src/data/approval-flow.ts +210 -124
- package/src/data/assignment-picker.ts +163 -85
- package/src/data/async-result-panel.ts +110 -46
- package/src/data/audit-log.ts +461 -0
- package/src/data/breadcrumbs.ts +141 -19
- package/src/data/calendar.ts +434 -96
- package/src/data/card-grid.ts +319 -0
- package/src/data/carousel.ts +72 -38
- package/src/data/cell-value.ts +253 -0
- package/src/data/chart.ts +904 -77
- package/src/data/checklist.ts +78 -35
- package/src/data/code-view.ts +106 -48
- package/src/data/comment-thread.ts +607 -87
- package/src/data/compare-view.ts +227 -0
- package/src/data/confirm-dialog.ts +198 -30
- package/src/data/context-menu.ts +95 -21
- package/src/data/d9-limits.ts +2 -0
- package/src/data/d9-util.ts +13 -5
- package/src/data/diff.ts +107 -50
- package/src/data/display-util.ts +9 -4
- package/src/data/dock.ts +33 -17
- package/src/data/embed.ts +142 -7
- package/src/data/engine-ports.ts +13 -4
- package/src/data/field-mapper.ts +104 -48
- package/src/data/file-list.ts +522 -0
- package/src/data/flow-editor.ts +603 -142
- package/src/data/flow-node-options.ts +24 -5
- package/src/data/flow-remote-options.ts +94 -19
- package/src/data/footer.ts +85 -27
- package/src/data/form-draft-registry.ts +183 -12
- package/src/data/gantt.ts +637 -117
- package/src/data/graph-view.ts +51 -0
- package/src/data/heat-calendar.ts +412 -0
- package/src/data/hero.ts +38 -15
- package/src/data/image-viewer.ts +261 -62
- package/src/data/index.ts +63 -1
- package/src/data/item-list.ts +217 -57
- package/src/data/json-view.ts +165 -100
- package/src/data/kanban.ts +339 -87
- package/src/data/kit-contract.ts +230 -0
- package/src/data/leaderboard.ts +343 -0
- package/src/data/level-class.ts +21 -0
- package/src/data/log-stream.ts +347 -0
- package/src/data/markdown-view.ts +155 -45
- package/src/data/matrix.ts +217 -112
- package/src/data/media-grid.ts +162 -38
- package/src/data/mega-menu.ts +39 -23
- package/src/data/menu-bar.ts +254 -0
- package/src/data/menu-dom.ts +50 -15
- package/src/data/menu.ts +131 -47
- package/src/data/mockup.ts +30 -22
- package/src/data/modal-dialog.ts +90 -13
- package/src/data/navbar.ts +143 -61
- package/src/data/notice-list.ts +100 -48
- package/src/data/notify-renderer.ts +61 -7
- package/src/data/object-form.ts +1389 -130
- package/src/data/org-chart.ts +544 -0
- package/src/data/outcome-watch.ts +90 -21
- package/src/data/pager.ts +122 -42
- package/src/data/panel-head.ts +237 -75
- package/src/data/permission-matrix.ts +371 -119
- package/src/data/permission-tree.ts +135 -80
- package/src/data/pricing-table.ts +106 -42
- package/src/data/prompt-dialog.ts +49 -21
- package/src/data/reaction-bar.ts +63 -31
- package/src/data/record-card.ts +239 -70
- package/src/data/record-picker.ts +56 -27
- package/src/data/redirect.ts +39 -15
- package/src/data/request-console.ts +131 -41
- package/src/data/resident.ts +11 -1
- package/src/data/result-panel.ts +65 -27
- package/src/data/rich-text.ts +206 -35
- package/src/data/row-confirm.ts +47 -0
- package/src/data/row-editor.ts +376 -102
- package/src/data/rule-builder.ts +129 -80
- package/src/data/schedule-grid.ts +238 -0
- package/src/data/segment-bar.ts +221 -0
- package/src/data/shape-util.ts +86 -43
- package/src/data/stage-flow.ts +244 -0
- package/src/data/staged-rows.ts +207 -24
- package/src/data/stat-group.ts +438 -86
- package/src/data/static-lazy.ts +18 -0
- package/src/data/static-registry.ts +38 -2
- package/src/data/status-strip.ts +171 -0
- package/src/data/steps.ts +63 -34
- package/src/data/summary-strip.ts +136 -0
- package/src/data/summary-util.ts +116 -0
- package/src/data/survey.ts +128 -47
- package/src/data/system-switcher.ts +40 -20
- package/src/data/target-progress.ts +208 -0
- package/src/data/text-action-button.ts +28 -7
- package/src/data/text-diff.ts +99 -31
- package/src/data/tile-grid.ts +343 -0
- package/src/data/timeline.ts +205 -36
- package/src/data/tour-guide.ts +110 -47
- package/src/data/transfer.ts +195 -47
- package/src/data/tree-table.ts +194 -112
- package/src/data/tree.ts +191 -70
- package/src/data/trend-line.ts +68 -12
- package/src/data/virtual-rows.ts +242 -102
- package/src/data/waterfall.ts +171 -0
- package/src/data/watermark.ts +35 -6
- package/src/data/wrap.ts +26 -4
- package/src/frames/blank-frame.ts +6 -4
- package/src/frames/index.ts +1 -2
- package/src/frames/inherited-shell.ts +54 -13
- package/src/frames/page-bar.ts +205 -27
- package/src/frames/page-status.ts +3 -2
- package/src/frames/resident-components.ts +0 -2
- package/src/frames/shared.ts +64 -21
- package/src/frames/single-frame.ts +20 -4
- package/src/frames/split-frame/shell.ts +11 -7
- package/src/frames/split-frame/wiring.ts +14 -10
- package/src/frames/tabs-frame/shell.ts +3 -2
- package/src/frames/tabs-frame/wiring.ts +2 -1
- package/src/frames/top-main-frame.ts +55 -3
- package/src/frames/types.ts +2 -0
- package/src/frames/workspace-frame/extras.ts +5 -3
- package/src/frames/workspace-frame/index.ts +1 -1
- package/src/frames/workspace-frame/pipeline-key.ts +6 -0
- package/src/frames/workspace-frame/shell.ts +22 -2
- package/src/frames/workspace-frame/state.ts +42 -14
- package/src/frames/workspace-frame/view.ts +697 -167
- package/src/generated/kit-grammar-runtime.ts +1015 -53
- package/src/generated/kit-page.ts +272 -0
- package/src/i18n/index.ts +2 -0
- package/src/i18n/kit-text.ts +96 -3
- package/src/object-renderer/action-group.ts +175 -23
- package/src/object-renderer/action-more.ts +48 -17
- package/src/object-renderer/arrange.ts +241 -29
- package/src/object-renderer/category-tone.ts +96 -0
- package/src/object-renderer/collapse-wiring.ts +19 -9
- package/src/object-renderer/collection-expand.ts +3 -3
- package/src/object-renderer/collection-parts.ts +432 -107
- package/src/object-renderer/collection-table.ts +347 -45
- package/src/object-renderer/collection.ts +291 -62
- package/src/object-renderer/compile-data.ts +12 -2
- package/src/object-renderer/defaults.ts +6 -5
- package/src/object-renderer/emit-events.ts +45 -19
- package/src/object-renderer/emit-object.ts +35 -9
- package/src/object-renderer/emit-static.ts +734 -159
- package/src/object-renderer/filter-plan.ts +3 -3
- package/src/object-renderer/filter-toolbar.ts +105 -18
- package/src/object-renderer/form-detail.ts +87 -2
- package/src/object-renderer/key-field.ts +21 -0
- package/src/object-renderer/layout-facts.ts +18 -2
- package/src/object-renderer/layout-plan.ts +6 -3
- package/src/object-renderer/overlay-decide.ts +44 -2
- package/src/object-renderer/pick-component.ts +8 -2
- package/src/object-renderer/pipeline-mode.ts +6 -0
- package/src/object-renderer/relation-field.ts +79 -0
- package/src/object-renderer/render-object.ts +71 -26
- package/src/object-renderer/request-actions.ts +119 -21
- package/src/object-renderer/table-actions.ts +424 -103
- package/src/object-renderer/table-gap.ts +2 -1
- package/src/object-renderer/table-reorder.ts +237 -0
- package/src/object-renderer/table-summary.ts +26 -12
- package/src/object-renderer/table-tools.ts +428 -128
- package/src/object-renderer/types.ts +91 -2
- package/src/object-renderer/value-present.ts +49 -0
- package/src/page-target/ai-surface.ts +15 -22
- package/src/page-target/compile.ts +5 -6
- package/src/page-target/drift.ts +0 -7
- package/src/page-target/intent-schema.ts +46 -43
- package/src/page-target/target.ts +4 -5
- package/src/page-target/writer-policy.ts +4 -5
- package/src/recipes/chrome-surface.ts +20 -0
- package/src/recipes/code-view.ts +15 -14
- package/src/recipes/color-role.ts +442 -0
- package/src/recipes/compact-group.ts +3 -2
- package/src/recipes/composition-projector.ts +321 -0
- package/src/recipes/container.ts +76 -19
- package/src/recipes/control.ts +64 -5
- package/src/recipes/desc-list.ts +101 -7
- package/src/recipes/divider.ts +30 -9
- package/src/recipes/emphasis.ts +90 -5
- package/src/recipes/field-text.ts +72 -0
- package/src/recipes/form-section.ts +177 -0
- package/src/recipes/frame-bleed.ts +3 -2
- package/src/recipes/index.ts +28 -4
- package/src/recipes/inherited-shell.ts +21 -15
- package/src/recipes/json-view.ts +6 -5
- package/src/recipes/look.ts +56 -0
- package/src/recipes/mark.ts +138 -0
- package/src/recipes/markdown.ts +16 -6
- package/src/recipes/overlay.ts +47 -19
- package/src/recipes/page-width.ts +31 -0
- package/src/recipes/pipeline-runtime.ts +366 -0
- package/src/recipes/placeholder.ts +37 -19
- package/src/recipes/rail-grid.ts +6 -3
- package/src/recipes/self-owned.ts +59 -0
- package/src/recipes/slot-align.ts +5 -3
- package/src/recipes/stat-state.ts +5 -5
- package/src/recipes/state.ts +54 -3
- package/src/recipes/status.ts +14 -14
- package/src/recipes/strip.ts +47 -5
- package/src/recipes/surface-edge.ts +3 -1
- package/src/recipes/surface.ts +33 -4
- package/src/recipes/table-gap.ts +3 -2
- package/src/recipes/table-native-edit.ts +22 -9
- package/src/recipes/table-row.ts +45 -12
- package/src/recipes/tabs.ts +54 -22
- package/src/recipes/text-diff.ts +15 -8
- package/src/recipes/text-fit.ts +132 -0
- package/src/recipes/title-row.ts +68 -3
- package/src/shared/action-func.ts +106 -0
- package/src/shared/color-scheme.ts +127 -0
- package/src/shared/confirm-decl.ts +5 -2
- package/src/shared/danger-facts.ts +55 -0
- package/src/shared/dom-attrs-registry.ts +1009 -0
- package/src/shared/dom-attrs.ts +743 -0
- package/src/shared/field-kind.ts +49 -0
- package/src/shared/field-value-format.ts +58 -12
- package/src/shared/glyphs.ts +127 -0
- package/src/shared/icons.ts +28 -1
- package/src/shared/identifier-field.ts +66 -0
- package/src/shared/list-pager.ts +23 -0
- package/src/shared/list-title.ts +29 -0
- package/src/shared/order-value.ts +15 -0
- package/src/shared/page-attrs-runtime.ts +327 -0
- package/src/shared/page-attrs.ts +262 -0
- package/src/shared/pipeline-mode.ts +64 -0
- package/src/shared/row-key.ts +15 -0
- package/src/shared/theme-runtime-shared.ts +165 -24
- package/src/shared/theme-usage.ts +16 -0
- package/src/shared/value-table-contract.ts +68 -0
- package/src/spatial/action-func.ts +4 -0
- package/src/spatial/declared-actions.ts +116 -0
- package/src/spatial/emit.ts +660 -0
- package/src/spatial/expand.ts +1482 -0
- package/src/spatial/field-types.ts +48 -0
- package/src/spatial/index.ts +82 -0
- package/src/spatial/layout.ts +697 -0
- package/src/spatial/look-apply.ts +206 -0
- package/src/spatial/page-decl.ts +44 -0
- package/src/spatial/page-object.ts +349 -0
- package/src/spatial/recognize.ts +491 -0
- package/src/spatial/self-report.ts +571 -0
- package/src/spatial/shape.ts +205 -0
- package/src/spatial/spatial-map.ts +136 -0
- package/src/spatial/tone.ts +145 -0
- package/src/theme/index.ts +11 -2
- package/src/theme/kit-theme-text.ts +1 -1
- package/src/theme/kit-theme.css +527 -16
- package/src/theme/kit-theme.tpl +491 -16
- package/src/theme/look-carrier.ts +65 -0
- package/src/theme/nine-dim-structure.ts +522 -185
- package/src/theme/private-vars.ts +153 -0
- package/src/theme/surface-layers.ts +3 -2
- package/src/theme/theme-tokens.ts +1601 -93
- package/src/theme/theme-types.ts +38 -59
- package/src/theme/value-table.ts +2379 -0
- package/src/frames/list-summary.ts +0 -123
- package/src/recipes/nowrap.ts +0 -16
- package/src/theme/block-theme.ts +0 -202
package/src/recipes/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// 与 data-kit-part 标准部件协议常量。
|
|
3
3
|
|
|
4
4
|
import { classCandidates } from '../shared/class-candidates';
|
|
5
|
+
import { KIT_ATTR_FACE, KIT_ATTR_FIXED, KIT_ATTR_PART } from '../shared/dom-attrs';
|
|
5
6
|
import { KIT_STATUS_RECIPE_CLASS_CANDIDATES } from './status';
|
|
6
7
|
import {
|
|
7
8
|
KIT_STATE_RECIPE_CLASS_CANDIDATES,
|
|
@@ -252,7 +253,7 @@ export type {
|
|
|
252
253
|
KitOverlayRecipeOptions,
|
|
253
254
|
};
|
|
254
255
|
|
|
255
|
-
export const KIT_PART_ATTRIBUTE =
|
|
256
|
+
export const KIT_PART_ATTRIBUTE = KIT_ATTR_PART;
|
|
256
257
|
|
|
257
258
|
/**
|
|
258
259
|
* 控件质感标记(质感维度的挂点):只标「有可见底色 / 边框」的控件,结构 CSS 的 `:where([data-kit-face=…])` 据此画浮雕线 / 内凹影。
|
|
@@ -260,7 +261,7 @@ export const KIT_PART_ATTRIBUTE = 'data-kit-part' as const;
|
|
|
260
261
|
* 幽灵钮、仅描边标签、状态点没有「面」,不带标记。
|
|
261
262
|
* 注意:`data-kit-surface`(card / flush / plain)是容器表面,与本标记是两个属性,互不混用。
|
|
262
263
|
*/
|
|
263
|
-
export const KIT_FACE_ATTRIBUTE =
|
|
264
|
+
export const KIT_FACE_ATTRIBUTE = KIT_ATTR_FACE;
|
|
264
265
|
export const KIT_FACE_RAISED = 'raised' as const;
|
|
265
266
|
export const KIT_FACE_FIELD = 'field' as const;
|
|
266
267
|
/** tab = 选中态有底色 / 描边的页签(药丸 / 卡片 / 分段式):静态标记,结构 CSS 按 aria-selected="true" 才画浮雕线;仅下划线式页签不标 */
|
|
@@ -280,7 +281,7 @@ export function setKitFace(el: Element, kind: KitFaceKind | null): void {
|
|
|
280
281
|
* 「在流内 position: fixed」标记:kit 自己渲染、没有经 mountKitOverlay / 浮层端口搬走的 fixed 元素(抽屉、弹层壳、浮动按钮)打此标记。
|
|
281
282
|
* 结构 CSS 的毛玻璃规则据此跳过「内含此类元素」的容器——backdrop-filter 会让容器成为 fixed 后代的包含块,fixed 元素会被困在容器里。
|
|
282
283
|
*/
|
|
283
|
-
export const KIT_FIXED_ATTRIBUTE =
|
|
284
|
+
export const KIT_FIXED_ATTRIBUTE = KIT_ATTR_FIXED;
|
|
284
285
|
|
|
285
286
|
/** 开 / 关在流内 fixed 标记(动态显隐的 fixed 元素只在真处于 fixed 时才打;幂等) */
|
|
286
287
|
export function setKitFixed(el: Element, on: boolean): void {
|
|
@@ -317,7 +318,8 @@ export const KIT_PARTS = Object.freeze({
|
|
|
317
318
|
export type KitPartValue = (typeof KIT_PARTS)[keyof typeof KIT_PARTS];
|
|
318
319
|
|
|
319
320
|
export * from './status';
|
|
320
|
-
export { kitEmphasisButtonRecipe, kitRowActionRecipe, kitStatusPillProps } from './emphasis';
|
|
321
|
+
export { kitActionRecipe, kitActionResolve, kitEmphasisButtonRecipe, kitRowActionRecipe, kitStatusPillProps } from './emphasis';
|
|
322
|
+
export type { KitActionFunction, KitActionRecipeOptions, KitActionRegion, KitActionRole } from './emphasis';
|
|
321
323
|
export * from './table-native-edit';
|
|
322
324
|
export * from './tabs';
|
|
323
325
|
import { KIT_TAB_RECIPE_CLASS_CANDIDATES } from './tabs';
|
|
@@ -326,9 +328,29 @@ import { KIT_FRAME_BLEED_CLASS_CANDIDATES } from './frame-bleed';
|
|
|
326
328
|
import { KIT_DIVIDER_CLASS_CANDIDATES } from './divider';
|
|
327
329
|
import { KIT_COMPACT_GROUP_CLASS_CANDIDATES } from './compact-group';
|
|
328
330
|
export * from './divider';
|
|
331
|
+
// 单一值输出与新模式标记(主题流水线:新模式下层级角色节点的底色 / 边框 / 圆角 / 阴影 / 内边距由取值表给)
|
|
332
|
+
export * from './pipeline-runtime';
|
|
333
|
+
export { kitLinkInkRecipe } from './control';
|
|
329
334
|
export * from './compact-group';
|
|
335
|
+
// 文本策略出口(含成段正文 kitProseFit / kitProseHtml):应用组件经 soma-kit/base/shared 取
|
|
336
|
+
export * from './text-fit';
|
|
337
|
+
import { KIT_TEXT_FIT_CLASS_CANDIDATES } from './text-fit';
|
|
338
|
+
// 行高档按内容形态(KT-D4 第 9 条:两行行取两行档、行高是下限):应用组件自画 <tr> / 行 div 时经 soma-kit/base 取行数标记
|
|
339
|
+
export { KIT_ROW_FLOOR_CLASS, KIT_ROW_LINES_ATTR, KIT_TWO_LINE_ROW_PX, kitRowLinesOf, kitRowLinesAttrHtml, markKitRowLines } from './strip';
|
|
340
|
+
export * from './color-role';
|
|
341
|
+
import { KIT_COLOR_ROLE_CLASS_CANDIDATES } from './color-role';
|
|
342
|
+
export {
|
|
343
|
+
KIT_COMPOSITION_PROJECTOR_CLASS_CANDIDATES,
|
|
344
|
+
projectComposition,
|
|
345
|
+
type CompositionRegionItem,
|
|
346
|
+
type CompositionRegionRole,
|
|
347
|
+
type ProjectCompositionInput,
|
|
348
|
+
type ProjectCompositionResult,
|
|
349
|
+
} from './composition-projector';
|
|
350
|
+
import { KIT_COMPOSITION_PROJECTOR_CLASS_CANDIDATES } from './composition-projector';
|
|
330
351
|
|
|
331
352
|
export const KIT_RECIPES_CLASS_CANDIDATES: readonly string[] = classCandidates(
|
|
353
|
+
KIT_TEXT_FIT_CLASS_CANDIDATES,
|
|
332
354
|
KIT_DIVIDER_CLASS_CANDIDATES,
|
|
333
355
|
KIT_COMPACT_GROUP_CLASS_CANDIDATES,
|
|
334
356
|
KIT_STATUS_RECIPE_CLASS_CANDIDATES,
|
|
@@ -342,4 +364,6 @@ export const KIT_RECIPES_CLASS_CANDIDATES: readonly string[] = classCandidates(
|
|
|
342
364
|
KIT_PANEL_TITLE_CLASS_CANDIDATES,
|
|
343
365
|
KIT_OVERLAY_RECIPE_CLASS_CANDIDATES,
|
|
344
366
|
KIT_TAB_RECIPE_CLASS_CANDIDATES,
|
|
367
|
+
KIT_COLOR_ROLE_CLASS_CANDIDATES,
|
|
368
|
+
KIT_COMPOSITION_PROJECTOR_CLASS_CANDIDATES,
|
|
345
369
|
);
|
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
// 应用级继承外壳(header / sidebar / footer)与产品旋钮(emphasis / surface)的类串配方。
|
|
2
2
|
// 组件 / 页面框不手写类串:frames/inherited-shell 只按角色取这里的出口(G101)。
|
|
3
3
|
|
|
4
|
+
import { mergeClass } from '../shared/merge-class';
|
|
5
|
+
import { kitWellRecipe } from './surface';
|
|
6
|
+
|
|
4
7
|
// in-data-kit-embed:hidden:嵌入工作台 iframe(文档根带 data-kit-embed,见 shared/theme-runtime-shared)时不画继承的应用顶栏(不出双顶栏);
|
|
5
8
|
// 规则归页面框配方,不写在主题 CSS 里(主题不认识外壳,接入核对 C6)
|
|
6
9
|
export const KIT_SHELL_HEADER_CLASS = 'border-b-hairline border-border-subtle bg-surface px-6 py-3 flex items-center justify-between gap-4 in-data-kit-embed:hidden';
|
|
7
|
-
export const KIT_SHELL_HEADER_LEFT_CLASS = 'flex items-center gap-6';
|
|
8
|
-
export const KIT_SHELL_BRAND_LINK_CLASS = 'font-semibold text-fg hover:text-
|
|
9
|
-
export const KIT_SHELL_BRAND_TEXT_CLASS = 'font-semibold text-fg';
|
|
10
|
-
export const KIT_SHELL_NAV_CLASS = 'flex items-center gap-4';
|
|
11
|
-
export const KIT_SHELL_NAV_LINK_CLASS = 'text-sm text-fg-muted hover:text-fg transition-colors';
|
|
12
|
-
export const KIT_SHELL_ACTIONS_CLASS = 'flex items-center gap-3';
|
|
13
|
-
export const KIT_SHELL_ACTION_LINK_CLASS = 'text-sm font-medium text-fg hover:text-primary-on-soft transition-colors';
|
|
10
|
+
export const KIT_SHELL_HEADER_LEFT_CLASS = 'flex min-w-0 flex-1 items-center gap-6';
|
|
11
|
+
export const KIT_SHELL_BRAND_LINK_CLASS = 'shrink-0 whitespace-nowrap font-semibold text-fg border-s-emphasis border-brand ps-2.5 hover:text-brand-on-soft transition-colors';
|
|
12
|
+
export const KIT_SHELL_BRAND_TEXT_CLASS = 'shrink-0 whitespace-nowrap font-semibold text-fg border-s-emphasis border-brand ps-2.5';
|
|
13
|
+
export const KIT_SHELL_NAV_CLASS = 'flex min-w-0 flex-1 items-center gap-4 overflow-x-auto scroll-smooth pe-4 mask-r-from-92%';
|
|
14
|
+
export const KIT_SHELL_NAV_LINK_CLASS = 'shrink-0 whitespace-nowrap text-sm text-fg-muted hover:text-fg transition-colors';
|
|
15
|
+
export const KIT_SHELL_ACTIONS_CLASS = 'flex shrink-0 items-center gap-3';
|
|
16
|
+
export const KIT_SHELL_ACTION_LINK_CLASS = 'shrink-0 whitespace-nowrap text-sm font-medium text-fg hover:text-primary-on-soft transition-colors';
|
|
14
17
|
|
|
15
|
-
export const KIT_SHELL_SIDEBAR_TITLE_CLASS = 'mb-4 text-xs font-semibold uppercase tracking-
|
|
18
|
+
export const KIT_SHELL_SIDEBAR_TITLE_CLASS = 'mb-4 text-xs font-semibold uppercase tracking-wide text-fg-muted';
|
|
16
19
|
export const KIT_SHELL_SIDEBAR_MENU_CLASS = 'flex flex-col gap-1';
|
|
17
|
-
export const KIT_SHELL_SIDEBAR_ITEM_CLASS = 'rounded px-2 py-1.5 text-sm text-fg hover:bg-surface transition-colors';
|
|
20
|
+
export const KIT_SHELL_SIDEBAR_ITEM_CLASS = 'rounded-item px-2 py-1.5 text-sm text-fg hover:bg-surface transition-colors';
|
|
18
21
|
export const KIT_SHELL_BODY_CLASS = 'flex min-h-screen';
|
|
19
22
|
export const KIT_SHELL_MAIN_CLASS = 'flex-1 min-w-0';
|
|
20
23
|
/** 侧栏外壳类(宽度类由调用方按档拼在前面) */
|
|
21
|
-
export const KIT_SHELL_SIDEBAR_CLASS = 'shrink-0 border-e-hairline border-border-subtle
|
|
24
|
+
export const KIT_SHELL_SIDEBAR_CLASS = mergeClass(mergeClass('shrink-0 border-e-hairline border-border-subtle', kitWellRecipe()), 'p-4');
|
|
22
25
|
|
|
23
|
-
export const KIT_SHELL_FOOTER_CLASS =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
export const KIT_SHELL_FOOTER_CLASS = mergeClass(
|
|
27
|
+
mergeClass('border-t-hairline border-border-subtle', kitWellRecipe()),
|
|
28
|
+
'px-6 py-3 text-xs text-fg-muted flex flex-wrap items-center justify-between gap-x-4 gap-y-2 in-data-kit-embed:hidden',
|
|
29
|
+
);
|
|
30
|
+
export const KIT_SHELL_FOOTER_LINKS_CLASS = 'flex shrink-0 items-center gap-4';
|
|
31
|
+
export const KIT_SHELL_FOOTER_LINK_CLASS = 'shrink-0 whitespace-nowrap hover:text-fg transition-colors';
|
|
26
32
|
|
|
27
33
|
export const KIT_PRODUCT_EMPHASIS_CLASSES: Readonly<Record<string, string>> = {
|
|
28
|
-
primary: 'rounded-
|
|
34
|
+
primary: 'rounded-card border border-primary bg-surface-raised p-4 shadow-sm',
|
|
29
35
|
// 容器外缘只读容器令牌(KT-B2:边界档、嵌套去框都管得到):圆角 rounded-card、宽 border-edge、色 border-border-container
|
|
30
36
|
normal: 'rounded-card border-edge border-border-container bg-surface p-4',
|
|
31
|
-
subtle: 'rounded-card border-edge border-border-container
|
|
37
|
+
subtle: 'rounded-card border-edge border-border-container sub-block p-3 text-fg-muted',
|
|
32
38
|
};
|
|
33
39
|
export const KIT_PRODUCT_SURFACE_CLASSES: Readonly<Record<string, string>> = {
|
|
34
40
|
card: 'rounded-card border-edge border-border-container bg-surface p-4 shadow-xs',
|
package/src/recipes/json-view.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// 记号色与 CodeView 同一张表(recipes/code-view.ts#TOKEN_CLASS)。
|
|
3
3
|
|
|
4
4
|
import { classCandidates } from '../shared/class-candidates';
|
|
5
|
+
import { KIT_FOCUS_RING } from './state';
|
|
5
6
|
import { mergeClass } from '../shared/merge-class';
|
|
6
7
|
import { kitControlRecipe } from './control';
|
|
7
8
|
import { kitShellRecipe } from './container';
|
|
@@ -16,14 +17,14 @@ export const KIT_JSON_SPACER_CLASS = 'flex-1';
|
|
|
16
17
|
export const KIT_JSON_SEARCH_CLASS = mergeClass(kitControlRecipe(), 'min-w-40 max-w-64 flex-1');
|
|
17
18
|
export const KIT_JSON_SEARCH_COUNT_CLASS = 'text-xs tabular-nums text-fg-subtle';
|
|
18
19
|
/** 代码井 = 凹槽面的壳配方(容器边,嵌套在面板里由层级规则去框) */
|
|
19
|
-
export const KIT_JSON_WELL_CLASS = mergeClass(WELL_EDGE, 'm-0 p-2 font-mono text-xs text-fg
|
|
20
|
+
export const KIT_JSON_WELL_CLASS = mergeClass(mergeClass(WELL_EDGE, 'm-0 p-2 font-mono text-xs text-fg'), KIT_FOCUS_RING.button);
|
|
20
21
|
export const KIT_JSON_HEIGHT_CLASS: Readonly<Record<string, string>> = Object.freeze({
|
|
21
22
|
none: 'overflow-x-auto',
|
|
22
23
|
sm: 'max-h-40 overflow-auto',
|
|
23
24
|
md: 'max-h-80 overflow-auto',
|
|
24
25
|
lg: 'max-h-96 overflow-auto',
|
|
25
26
|
});
|
|
26
|
-
export const KIT_JSON_ROW_CLASS = 'group flex cursor-pointer items-start gap-1 rounded-
|
|
27
|
+
export const KIT_JSON_ROW_CLASS = 'group flex cursor-pointer items-start gap-1 rounded-item px-1 py-0.5 hover:bg-state-layer-hover active:bg-state-layer-press ' + KIT_FOCUS_RING.item;
|
|
27
28
|
/** 每层 4 个间距单位,最多 11 层,更深保持同一缩进(与 Tree 的扁平缩进同一组字面量) */
|
|
28
29
|
export const KIT_JSON_INDENT: readonly string[] = Object.freeze(['ms-0', 'ms-4', 'ms-8', 'ms-12', 'ms-16', 'ms-20', 'ms-24', 'ms-28', 'ms-32', 'ms-36', 'ms-40', 'ms-44']);
|
|
29
30
|
export const KIT_JSON_TOGGLE_CLASS = 'inline-flex w-4 shrink-0 justify-center text-fg-subtle';
|
|
@@ -35,9 +36,9 @@ export const KIT_JSON_SUMMARY_CLASS = 'text-fg-subtle';
|
|
|
35
36
|
export const KIT_JSON_CLIP_NOTE_CLASS = 'ms-1 text-fg-subtle';
|
|
36
37
|
export const KIT_JSON_MORE_CLASS = 'text-primary-on-soft';
|
|
37
38
|
export const KIT_JSON_ACTIONS_CLASS = 'ms-auto flex shrink-0 gap-2 opacity-0 group-hover:opacity-100 group-focus:opacity-100 motion-safe:transition-opacity';
|
|
38
|
-
/**
|
|
39
|
-
export const KIT_JSON_HIT_CLASS = 'rounded-
|
|
40
|
-
export const KIT_JSON_HIT_CURRENT_CLASS = 'rounded-
|
|
39
|
+
/** 搜索命中:专用 highlight 底色(不再与警告黄混淆);当前命中加中粗与下划线(第二线索) */
|
|
40
|
+
export const KIT_JSON_HIT_CLASS = 'rounded-item bg-highlight px-0.5 text-fg';
|
|
41
|
+
export const KIT_JSON_HIT_CURRENT_CLASS = 'rounded-item bg-highlight px-0.5 font-medium text-fg underline';
|
|
41
42
|
export const KIT_JSON_ERROR_DETAIL_CLASS = 'text-xs text-fg-muted break-all';
|
|
42
43
|
export const KIT_JSON_FAIL_BOX_CLASS = 'flex flex-col gap-0.5';
|
|
43
44
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// 界面规则(look,KT-LK)的配方出口:部件角色 × 属性取值 → 类串(唯一实现;组件不再各自持有 tone → 类表)。
|
|
2
|
+
// 色调不按取值出类:部件打 data-kit-tone 载体,类固定为角色类(text-tone-ink / bg-tone-soft / bg-tone-mark / text-tone-mark),
|
|
3
|
+
// 色名 → 令牌只在载体规则一处(theme/look-carrier.ts),所以按数据换色不缺类、候选集不随色名个数膨胀。
|
|
4
|
+
|
|
5
|
+
import { KIT_GRAMMAR_RUNTIME as grammarJson } from '../generated/kit-grammar-runtime';
|
|
6
|
+
|
|
7
|
+
/** 色调载体属性名(真源 kit-grammar.json#look.carrier.attr):部件上写色名,载体规则把角色令牌指到该色 */
|
|
8
|
+
export const KIT_LOOK_TONE_ATTR: string = (grammarJson as unknown as { look: { carrier: { attr: string } } }).look.carrier.attr;
|
|
9
|
+
|
|
10
|
+
/** 色调落在各角色上的固定角色类(与取值无关) */
|
|
11
|
+
const TONE_CLASS: Readonly<Record<string, string>> = Object.freeze({
|
|
12
|
+
figure: 'text-tone-ink',
|
|
13
|
+
ink: 'text-tone-ink',
|
|
14
|
+
value: 'text-tone-ink',
|
|
15
|
+
row: 'text-tone-ink',
|
|
16
|
+
mark: 'bg-tone-soft text-tone-ink',
|
|
17
|
+
icon: 'text-tone-mark',
|
|
18
|
+
fill: 'bg-tone-mark',
|
|
19
|
+
surface: 'bg-tone-soft',
|
|
20
|
+
strip: 'bg-tone-soft',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** 墨级(工序 ⑤,KT-C2):只管墨色三级;字重归 text(旧写法 ink: strong 由规则引擎改写成 ink: default + text: strong) */
|
|
24
|
+
const INK_CLASS: Readonly<Record<string, string>> = Object.freeze({
|
|
25
|
+
default: 'text-fg',
|
|
26
|
+
muted: 'text-fg-muted',
|
|
27
|
+
subtle: 'text-fg-subtle',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/** 截断 / 换行(工序 ⑥,W05–W07:截断必带全文提示,由 applyLook 补 title);clamp2 = 至多两行 */
|
|
31
|
+
const OVERFLOW_CLASS: Readonly<Record<string, string>> = Object.freeze({
|
|
32
|
+
truncate: 'min-w-0 truncate',
|
|
33
|
+
wrap: 'whitespace-normal break-words',
|
|
34
|
+
clamp2: 'min-w-0 whitespace-normal break-words line-clamp-2',
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/** 文字强调档(工序 ⑥):strong = 排印的中字重,small = 说明字阶;normal 把上层规则的抬升压回常规 */
|
|
38
|
+
const TEXT_CLASS: Readonly<Record<string, string>> = Object.freeze({
|
|
39
|
+
normal: 'font-normal',
|
|
40
|
+
strong: 'font-medium',
|
|
41
|
+
small: 'text-xs',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/** 一个部件角色上一个属性取值的类串;不由类表达的属性(tone 的取值、show、mark、icon,以及交给求解器当输入的布局类属性)返回空串 */
|
|
45
|
+
export function kitLookRecipe(role: string, prop: string, value: unknown): string {
|
|
46
|
+
if (prop === 'tone') return TONE_CLASS[role] ?? '';
|
|
47
|
+
if (prop === 'ink' && typeof value === 'string') return INK_CLASS[value] ?? '';
|
|
48
|
+
if (prop === 'overflow' && typeof value === 'string') return OVERFLOW_CLASS[value] ?? '';
|
|
49
|
+
if (prop === 'text' && typeof value === 'string') return TEXT_CLASS[value] ?? '';
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** 本配方可能产出的全部类(一次登记;只在页面用了界面规则时并入候选,零规则页面候选不变) */
|
|
54
|
+
export const KIT_LOOK_CLASS_CANDIDATES: readonly string[] = Object.freeze([
|
|
55
|
+
...new Set([...Object.values(TONE_CLASS), ...Object.values(INK_CLASS), ...Object.values(OVERFLOW_CLASS), ...Object.values(TEXT_CLASS)].flatMap((s) => s.split(' '))),
|
|
56
|
+
]);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// 标记出口(knowledge/Kit主题规则与算法.md KT-B9 标记行 / 状态行、KT-R3 F1 小档、KT-K-tag-1…5、KT-K-status-1;第七批 I-2 / I-6):
|
|
2
|
+
// 一个标记一个出口,kit 构件与应用组件(经 soma-kit/base)都从这里取,不手写边框 / 胶囊。
|
|
3
|
+
// category 分类标签:F1 小档(条目圆角 rounded-item)淡底 + 同色字、无线;色名 c1…c8 经色调载体(CS20 缺省分配),无色名 = 中性淡底(引用值、超上限退化)
|
|
4
|
+
// tone 语气标记(新增 / 移除 / 提醒等变更标记):F1 小档语气淡底,无线(彩色字只配 -on-soft)
|
|
5
|
+
// level 等级(L1–L3、P0–P3、v2):弱化墨、等宽数字的纯文字,不成块、不描边(I-2)
|
|
6
|
+
// flag 标志(系统必备、锁定、内置、只读):图标 + 弱化墨文字,不成块(I-6);坐在带上也一样
|
|
7
|
+
// code 编号 / 代码:等宽弱化墨纯文字(引用值里名称后的弱化编码)
|
|
8
|
+
// ident 标识符(角色代码、接口编码这类独立成值的标识):F1 小档中性淡底 + 等宽弱化墨小块,无线(2026-11-25 数据着色第三段,打样「角色代码」)
|
|
9
|
+
// status 状态 = 带点的标签(§10.2 2026-11-26 裁决,KT-K-status-1「无底无框」作废):本类只出点旁文字的色与排布,
|
|
10
|
+
// 淡底壳由 tone 类(kitMarkRecipe('tone'))/ KIT_STATUS_BADGE_CLASS / Tag variant: dot 给;圆点取 kitMarkDotRecipe
|
|
11
|
+
// 禁止:border* / ring* / rounded-full(计数徽标、页头对象总状态另有出口,不走这里)——单测与 G101 标记族看守。
|
|
12
|
+
|
|
13
|
+
import { kitLookRecipe } from './look';
|
|
14
|
+
|
|
15
|
+
export type KitMarkKind = 'category' | 'tone' | 'level' | 'flag' | 'code' | 'ident' | 'status';
|
|
16
|
+
export type KitMarkTone = 'neutral' | 'primary' | 'info' | 'success' | 'warning' | 'danger';
|
|
17
|
+
/** 分类色名(色名表 kit-grammar.json#toneNames.categorical;CS18 三档令牌,CS20 缺省分配) */
|
|
18
|
+
export type KitMarkCategoryTone = `c${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8}`;
|
|
19
|
+
const isCategoryTone = (t: string): t is KitMarkCategoryTone => /^c[1-8]$/.test(t);
|
|
20
|
+
/**
|
|
21
|
+
* 分类色标签的角色类(2026-11-25 数据着色第二段:推翻「分类标签中性灰块」):淡底 + 同色字都经色调载体取——
|
|
22
|
+
* 元素上另打 data-kit-tone=cN(KIT_LOOK_TONE_ATTR),载体规则把 --kit-tone-soft / -ink 指到 --soma-cat-N-soft / -on(G82 CS18 判过 ≥ 4.5)。
|
|
23
|
+
* 类与色名无关(按数据换色不缺类);载体规则与分类令牌「用到才发」(页面编译汇总本页用到的色名补发)。
|
|
24
|
+
*/
|
|
25
|
+
const CATEGORY_TONED = kitLookRecipe('mark', 'tone', 'c1');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 缺省标签底的唯一出口(A3,公式册 §6.3 / §7):DSL 没写 tone 的闭集值、标识、标签、中性徽标 = tinted(N_canvas) 的底 + 中性次要字(N11),无线;
|
|
29
|
+
* 底取令牌 --soma-label-fill(参考实现 colorSchemeLabelFill:蓝白方案淡蓝,石墨 / 纯灰方案中性灰),写了 tone 的走 TONE_FILL 的淡底第 3 阶。
|
|
30
|
+
*/
|
|
31
|
+
export function kitLabelFillRecipe(): string {
|
|
32
|
+
return 'bg-label-fill text-fg-muted';
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const TONE_FILL: Readonly<Record<KitMarkTone, string>> = Object.freeze({
|
|
36
|
+
neutral: kitLabelFillRecipe(),
|
|
37
|
+
primary: 'bg-primary-soft text-primary-on-soft',
|
|
38
|
+
info: 'bg-info-soft text-info-on-soft',
|
|
39
|
+
success: 'bg-success-soft text-success-on-soft',
|
|
40
|
+
warning: 'bg-warning-soft text-warning-on-soft',
|
|
41
|
+
danger: 'bg-danger-soft text-danger-on-soft',
|
|
42
|
+
});
|
|
43
|
+
// 状态文字:常态中性墨,语气取 -on-soft(彩色文字只用 on-soft 角色)
|
|
44
|
+
const TONE_INK: Readonly<Record<KitMarkTone, string>> = Object.freeze({
|
|
45
|
+
neutral: 'text-fg-muted',
|
|
46
|
+
primary: 'text-primary-on-soft',
|
|
47
|
+
info: 'text-info-on-soft',
|
|
48
|
+
success: 'text-success-on-soft',
|
|
49
|
+
warning: 'text-warning-on-soft',
|
|
50
|
+
danger: 'text-danger-on-soft',
|
|
51
|
+
});
|
|
52
|
+
const DOT_FILL: Readonly<Record<KitMarkTone, string>> = Object.freeze({
|
|
53
|
+
neutral: 'bg-fg-subtle',
|
|
54
|
+
primary: 'bg-primary',
|
|
55
|
+
info: 'bg-info',
|
|
56
|
+
success: 'bg-success',
|
|
57
|
+
warning: 'bg-warning',
|
|
58
|
+
danger: 'bg-danger',
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// 闭集值 / 标识的块形(主题公式 F7):字号 S(−1)、字重 500;高 = 行高(S(−1) + 8)+ 上下各 1px = 22;左右 2u(px-2 随密度);
|
|
62
|
+
// 圆角 = 条目圆角 max(r0 − 2, 0)(rounded-item 随形状);gap-1 给可带的 6px 圆点留间距
|
|
63
|
+
const BLOCK = 'inline-flex items-center gap-1 rounded-item px-2 py-px text-xs font-medium whitespace-nowrap';
|
|
64
|
+
|
|
65
|
+
/** 标记的色对(只有底 + 字两项,不含尺寸):分类色名 c1…c8 → 色调载体角色类(元素另打 data-kit-tone),语气 → 语气淡底 + 同色字。 */
|
|
66
|
+
export function kitMarkToneRecipe(tone: KitMarkTone | KitMarkCategoryTone = 'neutral'): string {
|
|
67
|
+
return isCategoryTone(tone) ? CATEGORY_TONED : TONE_FILL[tone];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** 标记文字色(只有文字色,彩色文字只用 -on-soft 角色,常态 neutral 取 text-fg-muted)。 */
|
|
71
|
+
export function kitMarkInkRecipe(tone: KitMarkTone = 'neutral'): string {
|
|
72
|
+
return TONE_INK[tone];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** 标记类串(kind 见文件头;tone 只对 category / tone / status 有意义,缺省 neutral;category 收分类色名 c1…c8 → 载体角色类) */
|
|
76
|
+
export function kitMarkRecipe(kind: KitMarkKind, tone: KitMarkTone | KitMarkCategoryTone = 'neutral'): string {
|
|
77
|
+
switch (kind) {
|
|
78
|
+
case 'category':
|
|
79
|
+
return isCategoryTone(tone) ? `${BLOCK} ${CATEGORY_TONED}` : `${BLOCK} ${TONE_FILL.neutral}`;
|
|
80
|
+
case 'tone':
|
|
81
|
+
return `${BLOCK} ${TONE_FILL[isCategoryTone(tone) ? 'neutral' : tone]}`;
|
|
82
|
+
case 'level':
|
|
83
|
+
return 'inline-flex items-center font-mono text-xs tabular-nums text-fg-muted whitespace-nowrap';
|
|
84
|
+
case 'flag':
|
|
85
|
+
return 'inline-flex items-center gap-1 text-xs text-fg-muted whitespace-nowrap';
|
|
86
|
+
case 'code':
|
|
87
|
+
return 'font-mono text-xs text-fg-muted';
|
|
88
|
+
case 'ident':
|
|
89
|
+
return `${BLOCK} font-mono ${TONE_FILL.neutral}`;
|
|
90
|
+
case 'status':
|
|
91
|
+
return `inline-flex items-center gap-1.5 text-xs ${TONE_INK[isCategoryTone(tone) ? 'neutral' : tone]} whitespace-nowrap`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** 色表里的自动位前缀(编译期 object-renderer/category-tone.ts 写的 '@k',k = 对象内分类字段的接续位次,从 0 起) */
|
|
96
|
+
const AUTO_SLOT = '@';
|
|
97
|
+
const AUTO_SLOT_RE = /^@(?:0|[1-9]\d*)$/;
|
|
98
|
+
const isAutoSlot = (t: unknown): t is string => typeof t === 'string' && AUTO_SLOT_RE.test(t);
|
|
99
|
+
|
|
100
|
+
/** 色表里有没有未解析的自动位 '@k':legacy 编译期页尾一遍已全部换成色名(恒为 false);next 下编译期不解析,留给运行期(E→D) */
|
|
101
|
+
export function kitToneMapHasAuto(map: unknown): boolean {
|
|
102
|
+
if (map === null || typeof map !== 'object' || Array.isArray(map)) return false;
|
|
103
|
+
return Object.values(map as Record<string, unknown>).some(isAutoSlot);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* 标签色表(编译期 tag_tones { 选项值: cN | '@k' },CS20 分类色缺省分配推出)里某个值的分类色名;没命中 / 不是分类色名返回 undefined。
|
|
108
|
+
* Text 的分类标签、Tag 的浅底标签与树表 / 虚拟表单元格共用这一个取法。
|
|
109
|
+
* 自动位 '@k'(E→D):给了 auto(主题自动序列,已截到同容器色相上限,base/look.ts#kitCategoryAutoSequence 取)就按与编译期页尾一遍
|
|
110
|
+
* (object-renderer/category-tone.ts#kitResolveCategoryTones)同一规则解析:'@k' → c{auto[k mod n]};色表里的自动位数超过 n(或 n 为 0)时
|
|
111
|
+
* 这些自动位一律退中性。没给 auto 时自动位返回 undefined(中性)。
|
|
112
|
+
*/
|
|
113
|
+
export function kitCategoryToneFor(map: unknown, value: unknown, auto?: readonly number[]): KitMarkCategoryTone | undefined {
|
|
114
|
+
if (map === null || typeof map !== 'object' || Array.isArray(map)) return undefined;
|
|
115
|
+
const table = map as Record<string, unknown>;
|
|
116
|
+
const t = table[String(value)];
|
|
117
|
+
if (typeof t !== 'string') return undefined;
|
|
118
|
+
if (isCategoryTone(t)) return t;
|
|
119
|
+
if (auto === undefined || !isAutoSlot(t)) return undefined;
|
|
120
|
+
const k = Number(t.slice(AUTO_SLOT.length));
|
|
121
|
+
const n = auto.length;
|
|
122
|
+
if (!Number.isInteger(k) || k < 0 || n === 0 || Object.values(table).filter(isAutoSlot).length > n) return undefined;
|
|
123
|
+
const name = `c${auto[k % n]!}`;
|
|
124
|
+
return isCategoryTone(name) ? name : undefined;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** 状态圆点(F4 字形,6px;与 Tag variant: dot 同一档) */
|
|
128
|
+
export function kitMarkDotRecipe(tone: KitMarkTone = 'neutral'): string {
|
|
129
|
+
return `inline-block size-status-dot shrink-0 rounded-full ${DOT_FILL[tone]}`;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const KINDS: readonly KitMarkKind[] = ['category', 'tone', 'level', 'flag', 'code', 'ident', 'status'];
|
|
133
|
+
const TONES = Object.keys(TONE_FILL) as KitMarkTone[];
|
|
134
|
+
|
|
135
|
+
/** 本出口的全部类(并入基础组件候选类) */
|
|
136
|
+
export const KIT_MARK_CLASS_CANDIDATES: readonly string[] = Object.freeze([...new Set(
|
|
137
|
+
KINDS.flatMap((k) => TONES.map((t) => kitMarkRecipe(k, t))).concat(TONES.map((t) => kitMarkDotRecipe(t)), [kitMarkRecipe('category', 'c1')]).flatMap((s) => s.split(/\s+/)),
|
|
138
|
+
)].sort());
|
package/src/recipes/markdown.ts
CHANGED
|
@@ -2,19 +2,25 @@
|
|
|
2
2
|
// 依据:参考文本差异组件笔记 C.3 / E4;裁决 #4(顶层成段正文首行缩进两字;列表项、引用、表格单元格内的段落不缩进;
|
|
3
3
|
// 只有一句话的短内容不缩进;缩进后段间距取小档;行高 1.7;版心 ≤ 40 字)。
|
|
4
4
|
// 排印尺度(暂行,待令牌):行高 1.7、40 字版心、两字缩进、标题 1.5 / 1.3 / 1.15 倍需要主题单链上的排印尺度(handoff 需对方 N-3),
|
|
5
|
-
// 到位前暂借 kit-theme 已有阶梯里最接近的类(leading-6 = 1.5rem ≈ 1.7×14px、max-w-2xl = 48rem
|
|
5
|
+
// 到位前暂借 kit-theme 已有阶梯里最接近的类(leading-6 = 1.5rem ≈ 1.7×14px、max-w-2xl = 48rem),只在本文件的 MD_TYPE 一张表;到位后只改这张表。
|
|
6
|
+
// 段首缩进已改走成段正文出口(recipes/text-fit.ts#kitProseFit,真 2em,取值 kit-limits#content.prose),判定阈值同源。
|
|
6
7
|
|
|
7
8
|
import { classCandidates } from '../shared/class-candidates';
|
|
9
|
+
import { KIT_FOCUS_RING } from './state';
|
|
8
10
|
import { mergeClass } from '../shared/merge-class';
|
|
9
11
|
import { kitShellRecipe } from './container';
|
|
10
12
|
import { kitDividerRecipe } from './divider';
|
|
13
|
+
import { kitClosedValueTone } from './field-text';
|
|
14
|
+
import { kitWellRecipe } from './surface';
|
|
15
|
+
import { KIT_PROSE_INDENT_CLASS } from './text-fit';
|
|
11
16
|
|
|
12
17
|
const MD_TYPE = Object.freeze({
|
|
13
18
|
/** 正文容器:版心与行高 */
|
|
14
19
|
body: 'max-w-2xl text-sm leading-6 text-fg break-words',
|
|
15
20
|
/** 段落:缺省段距;首行缩进两字的段落段距取小档;紧凑列表 / 单元格里的段落无段距 */
|
|
16
21
|
p: 'my-3',
|
|
17
|
-
|
|
22
|
+
/** 首行缩进段落 = 成段正文出口(text-fit#KIT_PROSE_INDENT_CLASS:两字缩进、行高 1.7、段距 0),不另写一套 */
|
|
23
|
+
pIndent: KIT_PROSE_INDENT_CLASS,
|
|
18
24
|
pTight: 'my-0',
|
|
19
25
|
h1: 'mt-6 mb-2 text-xl font-semibold text-fg',
|
|
20
26
|
h2: 'mt-5 mb-2 text-lg font-semibold text-fg',
|
|
@@ -24,12 +30,13 @@ const MD_TYPE = Object.freeze({
|
|
|
24
30
|
li: 'my-1',
|
|
25
31
|
task: 'my-1 flex list-none items-start gap-2',
|
|
26
32
|
quote: `my-3 border-s-emphasis border-border-subtle ps-3 text-fg-muted`,
|
|
27
|
-
|
|
33
|
+
// 行内代码 = 标识:缺省标签底色对(kitClosedValueTone),不取井色
|
|
34
|
+
code: `rounded-item ${kitClosedValueTone('neutral')} px-1 py-0.5 font-mono text-xs`,
|
|
28
35
|
table: 'my-3 overflow-x-auto',
|
|
29
36
|
th: mergeClass(kitDividerRecipe('bottom'), 'px-3 py-1.5 align-top font-medium'),
|
|
30
37
|
td: mergeClass(kitDividerRecipe('bottom'), 'px-3 py-1.5 align-top'),
|
|
31
38
|
hr: mergeClass(kitDividerRecipe('top'), 'my-5'),
|
|
32
|
-
img: 'my-2 block max-w-full rounded-
|
|
39
|
+
img: 'my-2 block max-w-full rounded-item',
|
|
33
40
|
html: 'my-2 whitespace-pre-wrap font-mono text-xs text-fg-muted',
|
|
34
41
|
footnotes: mergeClass(kitDividerRecipe('top'), 'mt-6 pt-3 text-xs text-fg-muted'),
|
|
35
42
|
fnref: 'ms-0.5 align-super text-xs',
|
|
@@ -42,7 +49,10 @@ export const KIT_MD_ROOT_CLASS = 'flex flex-col gap-2';
|
|
|
42
49
|
/** 代码块井 = 凹槽面的壳配方 */
|
|
43
50
|
export const KIT_MD_CODE_WELL_CLASS = mergeClass(kitShellRecipe({ tone: 'sunken', shadow: false }), 'my-3 p-3 font-mono text-xs text-fg');
|
|
44
51
|
export const KIT_MD_CODE_HEAD_CLASS = 'mb-2 flex items-center justify-between gap-2';
|
|
45
|
-
export const KIT_MD_TASK_BOX_CLASS =
|
|
52
|
+
export const KIT_MD_TASK_BOX_CLASS = mergeClass(
|
|
53
|
+
mergeClass('mt-1 inline-flex size-4 shrink-0 items-center justify-center rounded-item', kitWellRecipe()),
|
|
54
|
+
'text-primary-on-soft',
|
|
55
|
+
);
|
|
46
56
|
export const KIT_MD_EXT_ICON_CLASS = 'ms-0.5 inline align-baseline';
|
|
47
57
|
export const KIT_MD_IMG_FAIL_CLASS = 'my-2 block text-xs text-fg-subtle';
|
|
48
58
|
export const KIT_MD_TOC_CLASS = 'flex flex-col gap-1 text-sm';
|
|
@@ -72,7 +82,7 @@ export const KIT_MD_IMG_CLASS = MD_TYPE.img;
|
|
|
72
82
|
export const KIT_MD_HTML_CLASS = MD_TYPE.html;
|
|
73
83
|
export const KIT_MD_FOOTNOTES_CLASS = MD_TYPE.footnotes;
|
|
74
84
|
export const KIT_MD_FNREF_CLASS = MD_TYPE.fnref;
|
|
75
|
-
export const KIT_MD_LINK_CLASS = 'text-primary-on-soft underline underline-offset-2 hover:opacity-80
|
|
85
|
+
export const KIT_MD_LINK_CLASS = 'text-primary-on-soft underline underline-offset-2 hover:opacity-80 rounded-item ' + KIT_FOCUS_RING.button;
|
|
76
86
|
export const KIT_MD_DEL_CLASS = 'line-through';
|
|
77
87
|
export const KIT_MD_LIST_STYLE: Readonly<Record<'ul' | 'ol', string>> = Object.freeze({ ul: 'list-disc', ol: 'list-decimal' });
|
|
78
88
|
|