Loading...
Loading...
Compare original and translation side by side
UNSAFE_styleUNSAFE_classNameget_code_connect_mapCardCardFlexBoxiconName="placeholder""placeholder"iconName"placeholder"iconName="placeholder""shield-dualtone""folder"iconName="placeholder"https://picsum.photos/seed/{identifier}/{width}/{height}resolve-library-id@alma-oss/spirit-design-systemquery-docs/alma-oss/spirit-design-systemUNSAFE_styleUNSAFE_classNameget_code_connect_mapCardCardFlexBoxiconName="placeholder""placeholder"iconName"placeholder"iconName="placeholder""shield-dualtone""folder"iconName="placeholder"https://picsum.photos/seed/{identifier}/{width}/{height}resolve-library-id@alma-oss/spirit-design-systemquery-docs/alma-oss/spirit-design-systemsize="xlarge"size="large"iconName="placeholder""placeholder"gapgap-[var(--global/spacing/space-1400,64px)]spacing="space-1400"accent-01-subtleaccent-02-subtlealign-itemsjustify-contentalign-self: stretchprplptpbpxpythemed/link/...Figma Layers: Spirit Components:
├── Section XLarge <Section size="xlarge">
│ └── Container XLarge (included in Section)
│ └── Content (gap: 32px) <Flex spacing="space-1000">
│ ├── Heading (max-w: 800px) <Box UNSAFE_style={{ maxWidth }}>
│ │ ├── Tag <Flex spacing="space-700">
│ │ └── Composition <Tag />
│ │ ├── Title <Flex spacing="space-900">
│ │ ├── Description <Heading />
│ │ └── ActionGroup <Text />
│ │ <ActionGroup />
│ └── Column (4 items) </Flex></Box>
│ ├── number <Grid cols={4}>
│ ├── number <StatCard />
│ ├── number ...
│ └── number </Grid>size="xlarge"size="large"iconName="placeholder""placeholder"gapgap-[var(--global/spacing/space-1400,64px)]spacing="space-1400"accent-01-subtleaccent-02-subtlealign-itemsjustify-contentalign-self: stretchprplptpbpxpythemed/link/...Figma Layers: Spirit Components:
├── Section XLarge <Section size="xlarge">
│ └── Container XLarge (包含在Section中)
│ └── Content (gap: 32px) <Flex spacing="space-1000">
│ ├── Heading (max-w: 800px) <Box UNSAFE_style={{ maxWidth }}>
│ │ ├── Tag <Flex spacing="space-700">
│ │ └── Composition <Tag />
│ │ ├── Title <Flex spacing="space-900">
│ │ ├── Description <Heading />
│ │ └── ActionGroup <Text />
│ │ <ActionGroup />
│ └── Column (4 items) </Flex></Box>
│ ├── number <Grid cols={4}>
│ ├── number <StatCard />
│ ├── number ...
│ └── number </Grid>| Figma Pattern | Spirit Component |
|---|---|
| "Design Block" or main page section | |
| Need to constrain content width | |
| Full-width section content | |
| Figma 模式 | Spirit 组件 |
|---|---|
| "设计区块"或主页面区域 | |
| 需要限制内容宽度 | |
| 全宽区域内容 | |
| Figma Pattern | Spirit Component | Notes |
|---|---|---|
| Uniform repeatable items (cards, stats) | | Set |
| Max-width centered content | | NOT Grid |
| Single row or column | | |
| Columns with different structures | Multiple | Horizontal Flex wrapping vertical Flex children |
| Vertical list with dividers | | Use |
| Only styling (background, border) | | No layout capabilities |
| Styling + layout combined | | Combines styling and layout |
| Figma 模式 | Spirit 组件 | 说明 |
|---|---|---|
| 统一可重复项(卡片、统计数据) | | 设置 |
| 居中的最大宽度内容 | | 不要使用Grid |
| 单行或单列 | | |
| 结构不同的列 | 多个 | 水平Flex包裹垂直Flex子元素 |
| 带有分隔线的垂直列表 | | 使用 |
| 仅用于样式(背景、边框) | | 无布局功能 |
| 样式+布局组合 | | 结合样式和布局功能 |
w-fullshrink-0 w-fullw-fullalignmentX="stretch"w-fullalignmentX="left"w-fullmax-widthalignmentX="stretch"// WRONG - alignmentX="left" prevents children from filling width even when Figma shows w-full
<Flex direction="vertical" spacing="space-1000" alignmentX="left">
<Box UNSAFE_style={{ maxWidth: "800px" }}>...</Box> {/* Won't stretch to 800px */}
<Grid cols={4}>...</Grid> {/* Won't fill container width */}
</Flex>
// CORRECT - alignmentX="stretch" lets children fill width (respecting their max-width if set)
<Flex direction="vertical" spacing="space-1000" alignmentX="stretch">
<Box UNSAFE_style={{ maxWidth: "800px" }}>...</Box> {/* Stretches up to 800px */}
<Grid cols={4}>...</Grid> {/* Fills container width */}
</Flex>w-fullshrink-0 w-fullw-fullalignmentX="stretch"w-fullalignmentX="left"w-fullmax-widthalignmentX="stretch"// 错误示例 - alignmentX="left"会阻止子元素填充宽度,即使Figma显示w-full
<Flex direction="vertical" spacing="space-1000" alignmentX="left">
<Box UNSAFE_style={{ maxWidth: "800px" }}>...</Box> {/* 无法拉伸到800px */}
<Grid cols={4}>...</Grid> {/* 无法填充容器宽度 */}
</Flex>
// 正确示例 - alignmentX="stretch"允许子元素填充宽度(同时遵守其最大宽度约束)
<Flex direction="vertical" spacing="space-1000" alignmentX="stretch">
<Box UNSAFE_style={{ maxWidth: "800px" }}>...</Box> {/* 拉伸至最大800px */}
<Grid cols={4}>...</Grid> {/* 填充容器宽度 */}
</Flex>| CSS Value | alignmentX | alignmentY |
|---|---|---|
| | |
| | |
| | |
| | |
align-itemsalignmentXjustify-contentalignmentYjustify-contentalignmentXalign-itemsalignmentYalignmentXstretchw-fullleft| CSS 值 | alignmentX | alignmentY |
|---|---|---|
| | |
| | |
| | |
| | |
align-itemsalignmentXjustify-contentalignmentYjustify-contentalignmentXalign-itemsalignmentYalignmentXw-fullstretchleft| Figma Text Style | Spirit Component | Key Props |
|---|---|---|
| Heading styles | | |
| Body text | | |
h1-h6elementType="div""span"marginBottom="space-0"| Figma 文本样式 | Spirit 组件 | 关键属性 |
|---|---|---|
| 标题样式 | | |
| 正文文本 | | |
h1-h6elementType="div""span"marginBottom="space-0"// WRONG - short form "accent-02" causes TypeScript lint error
<Heading elementType="div" size="xlarge" textColor="accent-02">300K+</Heading>
// CORRECT - use full token name "accent-02-basic"
<Heading elementType="div" size="xlarge" textColor="accent-02-basic" marginBottom="space-0">300K+</Heading>accent-01-basicaccent-01-subtleaccent-02-basicaccent-02-subtle// 错误示例 - 简写形式"accent-02"会导致TypeScript lint错误
<Heading elementType="div" size="xlarge" textColor="accent-02">300K+</Heading>
// 正确示例 - 使用完整令牌名称"accent-02-basic"
<Heading elementType="div" size="xlarge" textColor="accent-02-basic" marginBottom="space-0">300K+</Heading>accent-01-basicaccent-01-subtleaccent-02-basicaccent-02-subtle// Grid: reduce columns on smaller screens
<Grid cols={{ mobile: 1, tablet: 2, desktop: 4 }} />
// Flex: change direction on mobile
<Flex direction={{ mobile: 'vertical', tablet: 'horizontal' }} />
// Spacing: reduce on smaller screens
<Flex spacing={{ mobile: 'space-400', tablet: 'space-800', desktop: 'space-1200' }} />// Grid:在小屏幕上减少列数
<Grid cols={{ mobile: 1, tablet: 2, desktop: 4 }} />
// Flex:在移动端改变方向
<Flex direction={{ mobile: 'vertical', tablet: 'horizontal' }} />
// 间距:在小屏幕上缩小间距
<Flex spacing={{ mobile: 'space-400', tablet: 'space-800', desktop: 'space-1200' }} />iconName="placeholder""placeholder"iconName="placeholder""placeholder"| Token Range | Typical Use |
|---|---|
| Tight spacing (icons, inline) |
| Small (within components) |
| Medium (between components) |
| Large (section padding) |
| Extra large (page sections) |
| 令牌范围 | 典型用途 |
|---|---|
| 紧凑间距(图标、内联元素) |
| 小间距(组件内部) |
| 中等间距(组件之间) |
| 大间距(区域内边距) |
| 超大间距(页面区域) |
| Type | Examples |
|---|---|
| Background | |
| Text | |
| Border | |
accent-02-basicaccent-02| 类型 | 示例 |
|---|---|
| 背景色 | |
| 文本色 | |
| 边框色 | |
accent-02-basicaccent-02| Figma Token | Meaning |
|---|---|
| Primary link color - use CardLink for Card titles |
| Link hover state - CardLink handles automatically |
| Secondary link - use CardLink or Link component |
CardLinkCardTitle| Figma 令牌 | 含义 |
|---|---|
| 主链接颜色 - 卡片标题使用CardLink |
| 链接悬停状态 - CardLink会自动处理 |
| 次要链接 - 使用CardLink或Link组件 |
CardLinkiconName="placeholder""placeholder"alignmentXalignmentXalignmentYalignmentX="stretch"elementTypemarginBottom="space-0"accent-02-basicaccent-02UNSAFE_styleUNSAFE_style maxWidthprplptpbpxpyFlex elementType={Box}themed/link/...CardLinkisHeadingiconName="placeholder""placeholder"alignmentXalignmentXalignmentYalignmentX="stretch"elementTypemarginBottom="space-0"accent-02-basicaccent-02UNSAFE_style maxWidthprplptpbpxpyFlex elementType={Box}themed/link/...CardLinkisHeading// WRONG - Developer substituted "semantically appropriate" icons
<Icon name="shield-dualtone" /> // Was "placeholder" in Figma
<Icon name="folder" /> // Was "placeholder" in Figma
<Icon name="reload" /> // Was "placeholder" in Figma
// CORRECT - Use EXACTLY what Figma/CodeConnect specifies
<Icon name="placeholder" /> // Matches Figma exactly
<Icon name="placeholder" /> // Matches Figma exactly
<Icon name="placeholder" /> // Matches Figma exactlyiconName="placeholder"iconName="placeholder"// 错误示例 - 开发者替换了“语义上合适”的图标
<Icon name="shield-dualtone" /> // Figma中是"placeholder"
<Icon name="folder" /> // Figma中是"placeholder"
<Icon name="reload" /> // Figma中是"placeholder"
// 正确示例 - 严格使用Figma/CodeConnect指定的内容
<Icon name="placeholder" /> // 与Figma完全匹配
<Icon name="placeholder" /> // 与Figma完全匹配
<Icon name="placeholder" /> // 与Figma完全匹配iconName="placeholder"iconName="placeholder"