@ptengine/design-components 0.3.0 → 0.5.0
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 +117 -65
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts +3 -0
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/input-otp.d.ts +4 -2
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/prompt-picker.d.ts +100 -0
- package/dist/components/ui/prompt-picker.d.ts.map +1 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3650 -3199
- package/llms.txt +20 -2
- package/package.json +8 -13
- package/src/components/ui/breadcrumb.tsx +3 -1
- package/src/components/ui/calendar.tsx +33 -33
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/dialog.tsx +44 -9
- package/src/components/ui/prompt-picker.tsx +243 -0
- package/src/components/ui/select.tsx +18 -4
- package/src/components/ui/sidebar.tsx +1 -1
- package/src/index.ts +16 -6
- package/src/styles/tokens.css +24 -1
- package/tailwind.preset.js +8 -1
package/src/styles/tokens.css
CHANGED
|
@@ -124,9 +124,32 @@
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.pt-ui {
|
|
127
|
-
|
|
127
|
+
/* 圆角六档 6 / 8 / 10 / 12 / 16 / 20(lin 定,2026-08-25 由三档扩到六档)。
|
|
128
|
+
* px 硬值:rem 会被宿主根字号缩放。
|
|
129
|
+
*
|
|
130
|
+
* 命名分两套,**都要留着**:
|
|
131
|
+
* · 语义名(--pt-radius / -md / -sm):既有 89 处在用,是控件档位的既定接口,不动。
|
|
132
|
+
* · px 名(--pt-radius-12 / -16 / -20):新增的大档位。**没有沿用 t 恤码**,因为
|
|
133
|
+
* Tailwind 默认 rounded-xl=12px、2xl=16px,而我们要的是 xl=16、2xl=20 —— 同名不同值,
|
|
134
|
+
* 从 shadcn 抄代码过来会静默偏移几 px,极难自查。px 名不撞任何既有语义,大小关系
|
|
135
|
+
* 也一眼可见。
|
|
136
|
+
*
|
|
137
|
+
* 选档:控件用 sm/md(6/8);卡片、弹层等大容器用 10(--pt-radius);
|
|
138
|
+
* 需要更柔和的面板/外壳用 12/16/20。
|
|
139
|
+
*
|
|
140
|
+
* ⚠️ 两种产生方式**有意混用**,不是漏改:
|
|
141
|
+
* · sm / md 是 calc 派生(来自 shadcn:一个 --radius 旋钮整体缩放,档间恒差 2px)
|
|
142
|
+
* · 12 / 16 / 20 是**固定值,不跟随基准**
|
|
143
|
+
* 原因:后加这三档要的是「更细的尺子」,不是「可整体缩放的比例」——基准从建库至今
|
|
144
|
+
* 没调过一次,那个旋钮实际没人用。代价要知道:**若哪天真去调基准,前三档会动、
|
|
145
|
+
* 后三档不动**。真要统一,该做的是把前三档也写死,而不是把后三档改成 calc
|
|
146
|
+
* (那会让 rounded-16 在基准变化后不再是 16px,类名开始撒谎)。 */
|
|
147
|
+
--pt-radius: 10px;
|
|
128
148
|
--pt-radius-md: calc(var(--pt-radius) - 2px); /* 8px:default/lg 档控件 */
|
|
129
149
|
--pt-radius-sm: calc(var(--pt-radius) - 4px); /* 6px:sm 档控件 */
|
|
150
|
+
--pt-radius-12: 12px;
|
|
151
|
+
--pt-radius-16: 16px;
|
|
152
|
+
--pt-radius-20: 20px;
|
|
130
153
|
|
|
131
154
|
/* ── ② PTEngine 语义层(Light)· 未包裹形态,全部引用原语 ──── */
|
|
132
155
|
/* role(角色:补齐 shadcn 别名所需的语义映射,纯通道或通道+alpha) */
|
package/tailwind.preset.js
CHANGED
|
@@ -146,10 +146,17 @@ export default {
|
|
|
146
146
|
ring: 'rgb(var(--pt-sidebar-ring))'
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
|
+
/* 圆角六档 6/8/10/12/16/20。
|
|
150
|
+
* lg/md/sm 是 shadcn 既有约定(值已按本库改成 10/8/6),89 处在用,不动。
|
|
151
|
+
* 大档位用 **px 命名**而不是 xl/2xl —— Tailwind 默认 rounded-xl=12、2xl=16,
|
|
152
|
+
* 与我们要的 16/20 同名不同值,沿用 t 恤码会让抄来的代码静默偏移。 */
|
|
149
153
|
borderRadius: {
|
|
150
154
|
lg: 'var(--pt-radius)',
|
|
151
155
|
md: 'calc(var(--pt-radius) - 2px)',
|
|
152
|
-
sm: 'calc(var(--pt-radius) - 4px)'
|
|
156
|
+
sm: 'calc(var(--pt-radius) - 4px)',
|
|
157
|
+
12: 'var(--pt-radius-12)',
|
|
158
|
+
16: 'var(--pt-radius-16)',
|
|
159
|
+
20: 'var(--pt-radius-20)'
|
|
153
160
|
},
|
|
154
161
|
/* 语义层描边 Token 的工具类(如 hover:border-strong)。
|
|
155
162
|
* 值自带 alpha,只包一层 rgb()。 */
|