a1-migration
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseA1 Design System Migration
A1设计系统迁移
When to Use
适用场景
- Migrating an Angular app from NDBX/old design system to One Allianz (A1) Design System
- Applying One Allianz theme (,
spacious, orcompact)dense - Replacing /
nx-circle-togglewithnx-circle-toggle-group/nx-tilenx-tile-group - Replacing info buttons with popovers to use the new
NxInfoIconComponent - Updating layout from center-aligned to left-aligned (A1 standard)
- Adjusting components, eyebrows and attention-color headlines
nx-small-stage
- 将Angular应用从NDBX/旧设计系统迁移至One Allianz (A1)设计系统
- 应用One Allianz主题(、
spacious或compact)dense - 将/
nx-circle-toggle替换为nx-circle-toggle-group/nx-tilenx-tile-group - 将信息按钮替换为弹出框,使用新的
NxInfoIconComponent - 将布局从居中对齐更新为左对齐(A1标准)
- 调整组件、眉栏和醒目颜色标题
nx-small-stage
How to Apply Changes
如何应用更改
- if css is required, add to the component's CSS file. If the component is standalone, add the CSS to the component's array in the
stylesdecorator.@Component - write style definitions into components style file. Do not use inline styles in the HTML template.
IMPORTANT: Before starting, tell the user the skill version "0.1.3" and that it's in beta phase. This is important for tracking and future updates.
- 如果需要CSS,添加到组件的CSS文件中。如果是独立组件,将CSS添加到装饰器的
@Component数组中。styles - 将样式定义写入组件样式文件。不要在HTML模板中使用内联样式。
重要提示: 开始前,请告知用户该技能版本为"0.1.3"且处于测试阶段。这对追踪和后续更新至关重要。
Step 1: Apply A1 Theme
步骤1:应用A1主题
Important: check if package is installed.
@allianz/ngx-brand-kit- if not installed, do not try to install, do not ask the user to install and skip this step and continue with Step 2.
- if installed, continue with the Procedure as described below.
重要: 检查是否已安装包。
@allianz/ngx-brand-kit- 如果未安装,请勿尝试安装,也不要要求用户安装,跳过此步骤直接进入步骤2。
- 如果已安装,请按照以下步骤操作。
Procedure
操作流程
- If theme is not specified, ask the user which theme they want: ,
spacious, orcompact.dense
- spacious for end customer-facing apps with more white space and larger touch targets
- compact for internal tools and dashboards where more information density is needed
- dense for data-heavy applications where maximum information density is required (e.g. tables, analytics)
- Run the schematic from the project root (where lives):
angular.jsonbashng g @allianz/ngx-brand-kit:apply-a1-theme --type=<THEME>
- 如果未指定主题,请询问用户想要哪种主题:、
spacious或compact。dense
- spacious适用于面向终端客户的应用,具有更多留白和更大的触控目标
- compact适用于内部工具和仪表板,需要更高的信息密度
- dense适用于数据密集型应用,需要最大化信息密度(如表格、分析类应用)
- 从项目根目录(所在位置)运行原理图:
angular.jsonbashng g @allianz/ngx-brand-kit:apply-a1-theme --type=<THEME>
Step 2: Migrate Circle Toggles → Tiles
步骤2:将圆形切换组件迁移为卡片组件
Stack: Angular standalone components, TypeScript,
@allianz/ng-aquila技术栈:Angular独立组件、TypeScript、
@allianz/ng-aquilaImports
导入
ts
import { NxTileComponent, NxTileGroupComponent } from '@allianz/ng-aquila/tile';If used in a Standalone Component, add the to the components array.
NxTileComponent, NxTileGroupComponentimportsts
import { NxTileComponent, NxTileGroupComponent } from '@allianz/ng-aquila/tile';如果在独立组件中使用,需将添加到组件的数组中。
NxTileComponent, NxTileGroupComponentimportsDecision Rules
决策规则
| Scenario | Action |
|---|---|
| Multi-select → use |
| Single-select → use |
| Remove it; add |
| 场景 | 操作 |
|---|---|
| 多选场景 → 使用 |
| 单选场景 → 使用 |
存在 | 删除该属性;添加 |
Selection / Forms Pattern
选择/表单模式
Before (checked-based):
html
<nx-circle-toggle-group>
<nx-circle-toggle
[checked]="sel==='a'"
value="a"
label="Label A"
icon="icon-name"
></nx-circle-toggle>
<nx-circle-toggle
[checked]="sel==='b'"
value="b"
label="Label B"
icon="icon-name"
></nx-circle-toggle>
</nx-circle-toggle-group>After (value-based on group):
html
<nx-tile-group [value]="sel">
<nx-tile value="a" label="Label A" icon="icon-name"></nx-tile>
<nx-tile value="b" label="Label B" icon="icon-name"></nx-tile>
</nx-tile-group>IMPORTANT: Do NOT put content inside. Use only<nx-tile>,label, andvalueattributes.icon
迁移前(基于选中状态):
html
<nx-circle-toggle-group>
<nx-circle-toggle
[checked]="sel==='a'"
value="a"
label="Label A"
icon="icon-name"
></nx-circle-toggle>
<nx-circle-toggle
[checked]="sel==='b'"
value="b"
label="Label B"
icon="icon-name"
></nx-circle-toggle>
</nx-circle-toggle-group>迁移后(基于组的数值):
html
<nx-tile-group [value]="sel">
<nx-tile value="a" label="Label A" icon="icon-name"></nx-tile>
<nx-tile value="b" label="Label B" icon="icon-name"></nx-tile>
</nx-tile-group>重要提示: 不要在内部添加内容。仅使用<nx-tile>、label和value属性。icon
Layout Rules
布局规则
| Layout found | What to do |
|---|---|
| No wrapper, no layout CSS | Replace group directly; no extra layout needed |
| Derive |
| Custom CSS | Translate to |
| 2–3 tiles total | Wrap |
For each occurrence found, output a short decision log: what was there, what you chose and why.
| 现有布局 | 操作 |
|---|---|
| 无包装器,无布局CSS | 直接替换组;无需额外布局 |
| 从最小的 |
| 自定义CSS | 转换为 |
| 总计2–3个卡片 | 将 |
对于每个发现的实例,输出简短的决策日志:原有内容、选择的方案及原因。
Step 3: Migrate Info Popups → new Info Icon Component
步骤3:将信息弹出框迁移为新的信息图标组件
- Identify info buttons with popups: look for buttons (e.g. buttons with directive ) that trigger popovers and just have an info icon inside.
nxPopoverTrigger - Replace with : use the new component for consistent styling and behavior.
NxInfoIconComponent - Example:
html
<nx-info-icon
nxFormfieldAppendix
buttonAriaLabel="Additional information"
popoverDirection="bottom"
popoverWidth="300px"
>
<span>
This is an info icon with a popover. Click the icon to see additional information. Sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</span>
</nx-info-icon>And the corresponding import:
ts
import { NxInfoIconComponent } from '@allianz/ng-aquila/info-icon';If used in a Standalone Component, add the to the components array.
NxInfoIconComponentimports- Important: Do not change buttons inside Formfields (). Only replace standalone info buttons that trigger popovers.
<nx-formfield>
- 识别带弹出框的信息按钮:查找带有弹出框触发指令(如)且内部仅包含信息图标的按钮。
nxPopoverTrigger - 替换为:使用新组件以确保样式和行为的一致性。
NxInfoIconComponent - 示例:
html
<nx-info-icon
nxFormfieldAppendix
buttonAriaLabel="Additional information"
popoverDirection="bottom"
popoverWidth="300px"
>
<span>
This is an info icon with a popover. Click the icon to see additional information. Sadipscing
elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua.
</span>
</nx-info-icon>对应的导入语句:
ts
import { NxInfoIconComponent } from '@allianz/ng-aquila/info-icon';如果在独立组件中使用,需将添加到组件的数组中。
NxInfoIconComponentimports- 重要提示: 不要更改内部的按钮。仅替换触发弹出框的独立信息按钮。
<nx-formfield>
Step 4: Update Layout — Left Alignment
步骤4:更新布局——左对齐
A1 uses left-alignment throughout for accessibility and consistency.
A1设计系统全程使用左对齐,以提升可访问性和一致性。
Checklist
检查清单
- Remove centering on rows: Change or remove → use
rowJustify="center"or remove entirely.rowJustify="start" - Remove text centering: Remove ,
class="text-center", and similar on headings and paragraphs.style="text-align: center" - Bottom navigation buttons (Back / Next):
- Must be right-aligned ()
rowJustify="end" - Must be side-by-side (same , not stacked in separate rows)
nxRow - Must use sentence case ("Back", "Next") not ALL CAPS
- only accepts numbers — warning
nxColwill break; usenxCol="auto",nxCol="12"or similarnxCol="12,12,6" - info on : breakpoints are defined as
nxColnxCol="<tiny>, <small>, <medium>, <large>, <xlarge>, <2xlarge>, <3xlarge>" - must be vertically centered within the row — if is used, add
nxRow.rowAlignItems="center"
- Must be right-aligned (
- Margins / padding: Remove , horizontal centering, and ensure content aligns to the left edge.
margin: auto
- 移除行的居中设置:修改或移除→ 使用
rowJustify="center"或直接移除。rowJustify="start" - 移除文本居中:移除标题和段落上的、
class="text-center"及类似设置。style="text-align: center" - 底部导航按钮(返回/下一步):
- 必须右对齐()
rowJustify="end" - 必须并排显示(在同一个中,不要分开展示在不同行)
nxRow - 必须使用句首大写("Back"、"Next")而非全大写
- 仅接受数字 — 注意
nxCol会导致问题;使用nxCol="auto"、nxCol="12"或类似值nxCol="12,12,6" - 关于的说明:断点定义为
nxColnxCol="<tiny>, <small>, <medium>, <large>, <xlarge>, <2xlarge>, <3xlarge>" - 必须在行内垂直居中 — 如果使用,添加
nxRow。rowAlignItems="center"
- 必须右对齐(
- 边距/内边距:移除、水平居中设置,确保内容与左边缘对齐。
margin: auto
Vertical Spacing Adjustments
垂直间距调整
- Important: Skip this step if the is not installed and continue with
ngx-brand-kitbelow. The spacing values below rely on CSS variables from the A1 brand kit, so if it's not installed, leave spacing as-is.Headline Sizes - Find Dividers (,
<hr>,nx-divideror similar) divider lines that span the full width of the page and add vertical spacing above and below them. UsenxCol="12" class="section-divider"for this spacing to ensure consistency with A1 design standards.var(--semantic-gap-all-static-1600) - Headlines that are used standalone (outside of other components) should have a spacing below them. Use the mapping below
- →
nxHeadline size="3xl"var(--semantic-gap-all-static-1200) - →
nxHeadline size="2xl"var(--semantic-gap-all-static-1000) - →
nxHeadline size="xl"var(--semantic-gap-all-static-800)
- If the element underneath the headline has a top spacing (e.g. or
margin-top), remove it to avoid double spacing or subtract the headline spacing from it.padding-top
- 重要提示: 如果未安装,跳过此步骤直接进入下方的「标题尺寸」部分。以下间距值依赖于A1品牌工具包中的CSS变量,因此如果未安装该工具包,请保持原有间距不变。
ngx-brand-kit - 查找跨页面全宽的分隔线(、
<hr>、nx-divider或类似元素),并在其上下添加垂直间距。使用nxCol="12" class="section-divider"作为间距值,以确保符合A1设计标准。var(--semantic-gap-all-static-1600) - 独立使用的标题(不在其他组件内部)下方应添加间距。使用以下映射关系:
- →
nxHeadline size="3xl"var(--semantic-gap-all-static-1200) - →
nxHeadline size="2xl"var(--semantic-gap-all-static-1000) - →
nxHeadline size="xl"var(--semantic-gap-all-static-800)
- 如果标题下方的元素有顶部间距(如或
margin-top),请移除该间距,或从其中减去标题的间距以避免双重间距。padding-top
Headline Sizes
标题尺寸
Hierarchy rule — applies after the mapping table and overrides it where needed:
The mapping table below is a starting point, not a final answer. After applying it, verify that the resulting sizes form a clear visual hierarchy on the page. If a primary section heading (e.g. an that is the main title of a page section) maps to a small size like or , override the mapped value to restore the hierarchy. A page with an at should use for its primary sections, for sub-sections, and so on — regardless of what the old assignment was.
<h2>smh1size="3xl"size="2xl"h2size="xl"- if you find with type assignments (e.g.
nxHeadline), translate to<h1 nxHeadline="page">attribute. For example,sizebecomes<h1 nxHeadline="page">. Ensure the main headline in<h1 nxHeadline size="3xl">usesnx-small-stagefor A1 consistency.size="3xl"
| old assignment | size attribute | use for |
|---|---|---|
| nxHeadline="page-bold-caps" | nxHeadline size="4xl" | huge page headlines, only for marketing pages, not for product UIs |
| nxHeadline="page" | nxHeadline size="3xl" | main page headlines |
| nxHeadline="section" | nxHeadline size="2xl" | section headlines |
| nxHeadline="subsection-large" | nxHeadline size="xl" | large subsection headlines |
| nxHeadline="subsection-medium" | nxHeadline size="l" | medium subsection headlines |
| nxHeadline="subsection-small" | nxHeadline size="m" | small subsection headlines |
| nxHeadline="subsection-xsmall" | nxHeadline size="s" | extra small subsection headlines |
After applying the table, check: does the result make sense in context? A primary section heading should never end up at just because the old code used . Promote it to the correct level in the page hierarchy.
<h2>size="s"subsection-xsmall层级规则——适用于映射表之后,必要时覆盖映射表结果:
以下映射表为起点,而非最终结果。应用映射后,请验证最终尺寸在页面上形成清晰的视觉层级。如果主章节标题(如作为页面章节主标题的)映射到或等小尺寸,请覆盖映射值以恢复层级。例如,页面主标题使用时,其主章节应使用,子章节使用,依此类推——无论旧代码中的设置是什么。
<h2>sm<h1>size="3xl"<h2>size="2xl"size="xl"- 如果发现带有类型赋值的(例如
nxHeadline),请转换为<h1 nxHeadline="page">属性。例如,size变为<h1 nxHeadline="page">。确保<h1 nxHeadline size="3xl">中的主标题使用nx-small-stage以符合A1设计一致性要求。size="3xl"
| 旧赋值 | size属性 | 适用场景 |
|---|---|---|
| nxHeadline="page-bold-caps" | nxHeadline size="4xl" | 超大页面标题,仅用于营销页面,不用于产品UI |
| nxHeadline="page" | nxHeadline size="3xl" | 主页面标题 |
| nxHeadline="section" | nxHeadline size="2xl" | 章节标题 |
| nxHeadline="subsection-large" | nxHeadline size="xl" | 大型子章节标题 |
| nxHeadline="subsection-medium" | nxHeadline size="l" | 中型子章节标题 |
| nxHeadline="subsection-small" | nxHeadline size="m" | 小型子章节标题 |
| nxHeadline="subsection-xsmall" | nxHeadline size="s" | 超小型子章节标题 |
应用映射表后,请检查:结果在上下文环境中是否合理?主章节标题绝不应因为旧代码使用而最终设置为。请将其提升至页面层级中的正确级别。
<h2>subsection-xsmallsize="s"Step 5: Adjust Small Stages
步骤5:调整小型阶段组件
5.1 Subline → Eyebrow
5.1 副标题 → 眉栏
Move any inside to an eyebrow above the :
<p nxCopytext="large">Subline</p>nx-small-stage<h1>html
<nx-eyebrow size="s">Subline Text</nx-eyebrow>
<h1 nxHeadline size="3xl">...</h1>Use the eyebrow size for nxHeadline size 3xl and smaller. If the user wants a nxHeadline larger than 3xl, use for the eyebrow.
size="s"size="m"ts
import { NxEyebrowComponent } from '@allianz/ng-aquila/eyebrow';If used in a Standalone Component, add the to the components array.
NxEyebrowComponentimports将内部的任何移动到上方的眉栏中:
nx-small-stage<p nxCopytext="large">Subline</p><h1>html
<nx-eyebrow size="s">Subline Text</nx-eyebrow>
<h1 nxHeadline size="3xl">...</h1>对于及更小的标题,使用的眉栏尺寸。如果用户需要大于的,则使用的眉栏。
nxHeadline size="3xl"size="s"3xlnxHeadlinesize="m"ts
import { NxEyebrowComponent } from '@allianz/ng-aquila/eyebrow';如果在独立组件中使用,需将添加到组件的数组中。
NxEyebrowComponentimports5.2 Partial Headline Coloring (required)
5.2 标题部分着色(必填)
Always wrap the most meaningful word or short phrase in the with an attention-color span. This is a required A1 design standard for headlines — do not skip it. Choose the word or phrase that carries the most semantic weight (the product, the action, or the subject — not filler words like "your" or "and").
<h1>nx-small-stagehtml
<h1 nxHeadline size="3xl">Enter your <span [nx-attention-color]="'aqua'">property details</span></h1>ts
import { NxAttentionColorComponent } from '@allianz/ng-aquila/text';If used in a Standalone Component, add the to the components array.
NxAttentionColorComponentimports务必将中最具意义的单词或短语用醒目颜色的span包裹。这是标题的A1设计强制标准——请勿跳过。选择承载最多语义权重的单词或短语(产品、操作或主题——而非诸如"your"或"and"之类的填充词)。
<h1>nx-small-stagehtml
<h1 nxHeadline size="3xl">Enter your <span [nx-attention-color]="'aqua'">property details</span></h1>ts
import { NxAttentionColorComponent } from '@allianz/ng-aquila/text';如果在独立组件中使用,需将添加到组件的数组中。
NxAttentionColorComponentimports5.3 Headline Size
5.3 标题尺寸
- remove assignments to in HTML headline elements (e.g.
nxHeadline) and replace with<h1 nxHeadline="page">for all small stage headlines. Ensure the main headline in<h1 nxHeadline size="3xl">usesnx-small-stagefor A1 consistency.size="3xl"
- 移除HTML标题元素中的赋值(例如
nxHeadline),并替换为<h1 nxHeadline="page">,适用于所有小型阶段组件的标题。确保<h1 nxHeadline size="3xl">中的主标题使用nx-small-stage以符合A1设计一致性要求。size="3xl"
Migration Tracking
迁移追踪
After completing each step, record the migration so adoption can be tracked across teams via GitHub search.
完成每个步骤后,请记录迁移情况,以便通过GitHub搜索跨团队追踪采用情况。
Project-level metadata in package.json
package.jsonpackage.json
中的项目级元数据
package.jsonAfter Step 1 (theme applied), add an key to . After each subsequent step completes, append the step name to the array:
a1Migrationpackage.jsonstepsjson
"a1Migration": {
"skillVersion": "0.1.3",
"appliedAt": "YYYY-MM-DD",
"theme": "<spacious|compact|dense>",
"steps": ["theme"]
}Append step names as they complete: , , , , .
"theme""tiles""info-icons""layout""small-stage"A fully migrated project looks like:
json
"a1Migration": {
"skillVersion": "0.1.3",
"appliedAt": "YYYY-MM-DD",
"theme": "<spacious|compact|dense>",
"steps": ["theme", "tiles", "info-icons", "layout", "small-stage"]
}完成步骤1(主题应用)后,在中添加键。后续每个步骤完成后,将步骤名称追加到数组中:
package.jsona1Migrationstepsjson
"a1Migration": {
"skillVersion": "0.1.3",
"appliedAt": "YYYY-MM-DD",
"theme": "<spacious|compact|dense>",
"steps": ["theme"]
}完成步骤后追加步骤名称:、、、、。
"theme""tiles""info-icons""layout""small-stage"完全迁移后的项目示例:
json
"a1Migration": {
"skillVersion": "0.1.3",
"appliedAt": "YYYY-MM-DD",
"theme": "<spacious|compact|dense>",
"steps": ["theme", "tiles", "info-icons", "layout", "small-stage"]
}tracking of additional migration runs
追踪额外的迁移运行
If already has an key, add the steps to the array for steps that ran in the current session.
package.jsona1Migration如果已存在键,请将当前会话中完成的步骤添加到数组中。
package.jsona1Migration