Enhance component API with responsive props, color propagation, and typography utilities
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- react, typescript
调研方向
首先阅读现有的 layout、visual component、Text、Headline 和 Button API,以识别当前的 prop 和颜色模式。盘点受影响的组件,并根据所请求的响应式 props、间距简写、颜色传递、对比度行为、排版工具以及 Section 尺寸变体定义完成标准;该 issue 未指定具体文件或测试。
由索引模型根据 Issue 内容生成。
描述
Summary
Enhance Apsara's component-level APIs to improve developer experience, reduce boilerplate, and provide consistent patterns across the library.
1. Responsive Props on Layout Components
Add responsive object syntax to all layout prop values (gap, direction, padding, etc.):
<Flex gap={{ initial: "3", md: "5" }} direction={{ initial: "column", sm: "row" }}>
Support breakpoints: initial, sm, md, lg, xl.
2. Inline Spacing Props
Add shorthand padding/margin props (p, px, py, pt, pr, pb, pl, m, mx, my, mt, mr, mb, ml) to layout components that map to the space scale:
<Box p="4" mx="auto" mt="6">
3. Systematic color Prop
Extend the color prop to all visual components (Badge, Callout, Text, Avatar, Chip, etc.), not just Button. Color should propagate to children through nesting, automatically adjusting internal tokens.
4. highContrast Prop
Add a highContrast boolean to all components that accept a color prop. This shifts colors to steps 9–12 of the scale for better contrast against the page background.
5. Typography Utility Props
Add the following props to Text and Headline:
trim— remove leading/trailing whitespace for precise vertical alignmenttruncate— single-line ellipsis truncationwrap— control text wrapping (wrap,nowrap,balance,pretty)align— text alignment (left,center,right)- Expand font weight options to 4 levels: light (300), regular (400), medium (500), bold (700)
6. Section Layout Component
Add a Section component for consistent vertical spacing between major page sections, with predefined size variants (small, medium, large).
- 主要语言
- TypeScript
- 星标
- 70
- 派生
- 13
- 平均合并
- 8 天 56 分钟
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
raystack/apsara 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 3/5 1-2 天 新手友好度 75/100
-
Docs: hand-duplicated props tables drift risk, missing a11y sections, no per-component changelog 未关闭enhancement global
难度 4/5 3-5 天 新手友好度 48/100
-
bug global
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 条评论 ·
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
refactor
难度 2/5 1-3 小时 新手友好度 84/100