一份 TypeScript 源码,多端原生 UI
transone-ui 基于 transone 的组件模型:组件全部为受控组件,状态由父级维护、交互通过自定义事件回传;一份源码经 transone-cli 静态编译为 Web 与微信 / 阿里 / 字节小程序原生产物。
状态由父级维护,click / change / input 等自定义事件回传,双端数据流一致。
开关、勾选框、单选框等全部 CSS 自绘,不依赖端上原生控件,双端渲染一致。
15 个设计令牌(--tu-*)开箱即用,Web 注入 :root、小程序在 wxss 覆盖。
source 字段约定 + 静态可分析 render,满足 transone-cli 小程序编译约束。
子文档
组件(17)
type / size / disabled / loading / block / plain / round。
自绘轨道 + 滑块,change 回传布尔值。
type / plain / round / closable,close 回传 name。
数字 / 文本 / 红点,超 max 显示 max+。
受控 value + 双端事件归一化,clearable。
自绘方框 + 对勾,round / square。
自绘圆形 + 圆心点。
输入 + 清空 + 取消,search / clear / cancel。
top / right / bottom / left 四向滑入滑出。
top / center / bottom,父级控制时长。
居中面板 + 遮罩,confirm / cancel / close。
底部选项列表 + 取消,select 回传索引。
选项条 + 指示线,equal 均分,change 回传索引。
左箭头 / 文案、居中标题、右文案,吸顶。
标题 / 说明 / 值 / 箭头 / 必填标记。
0.3s 过渡,textInside / showText。
图形占位 + 主副文案 + 操作插槽。
transone(>= 0.1.2,peerDependency);Bun + 纯 TypeScript,零其它运行时依赖。