@ptengine/design-components 0.7.0 → 0.7.1

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/components/ui/search-input.d.ts +1 -1
  3. package/dist/components/ui/select.d.ts +1 -1
  4. package/dist/components/ui/select.d.ts.map +1 -1
  5. package/dist/index.cjs +2 -2
  6. package/dist/index.js +90 -90
  7. package/package.json +1 -1
  8. package/src/components/ui/alert-dialog.tsx +2 -2
  9. package/src/components/ui/alert.tsx +1 -1
  10. package/src/components/ui/attachment.tsx +4 -4
  11. package/src/components/ui/bubble.tsx +1 -1
  12. package/src/components/ui/button-group.tsx +1 -1
  13. package/src/components/ui/button.tsx +7 -7
  14. package/src/components/ui/calendar.tsx +3 -3
  15. package/src/components/ui/chart.tsx +1 -1
  16. package/src/components/ui/checkbox.tsx +1 -1
  17. package/src/components/ui/command.tsx +3 -3
  18. package/src/components/ui/context-menu.tsx +6 -6
  19. package/src/components/ui/dialog.tsx +4 -4
  20. package/src/components/ui/drawer.tsx +1 -1
  21. package/src/components/ui/dropdown-menu.tsx +6 -6
  22. package/src/components/ui/empty.tsx +2 -2
  23. package/src/components/ui/hover-card.tsx +1 -1
  24. package/src/components/ui/input-group.tsx +1 -1
  25. package/src/components/ui/input-otp.tsx +1 -1
  26. package/src/components/ui/input.tsx +1 -1
  27. package/src/components/ui/item.tsx +3 -3
  28. package/src/components/ui/kbd.tsx +1 -1
  29. package/src/components/ui/menubar.tsx +8 -8
  30. package/src/components/ui/native-select.tsx +1 -1
  31. package/src/components/ui/navigation-menu.tsx +3 -3
  32. package/src/components/ui/popover.tsx +1 -1
  33. package/src/components/ui/prompt-picker.tsx +7 -7
  34. package/src/components/ui/resizable.tsx +1 -1
  35. package/src/components/ui/search-input.tsx +1 -1
  36. package/src/components/ui/select.tsx +3 -3
  37. package/src/components/ui/sheet.tsx +2 -2
  38. package/src/components/ui/sidebar.tsx +9 -9
  39. package/src/components/ui/skeleton.tsx +1 -1
  40. package/src/components/ui/tabs.tsx +2 -2
  41. package/src/components/ui/textarea.tsx +1 -1
  42. package/src/components/ui/toggle.tsx +2 -2
  43. package/src/components/ui/tooltip.tsx +1 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,30 @@
4
4
 
5
5
  ---
6
6
 
7
+ ## 0.7.1 — 修 0.7.0 的圆角/遮罩/文字色失效
8
+
9
+ **0.7.0 有个必须升级的缺陷**:任意值 utility 的**类名本身**含变量名
10
+ (`rounded-[var(--pt-radius-md)]`),它既是 class 名、也是样式值。0.7.0 只在
11
+ 编译产物上把变量改成了私有名,源码里的类名没跟着改,于是:
12
+
13
+ ```
14
+ 组件发的类名: ptx-rounded-[var(--pt-radius-md)]
15
+ CSS 里的选择器: .ptx-rounded-\[var\(--ptx-radius-md\)\]
16
+ ↑ 对不上,规则永远不生效
17
+ ```
18
+
19
+ **19 种类名因此静默失效**,其中包括全部圆角、弹窗/抽屉遮罩底色、
20
+ 三档文字色(`text-[rgb(var(--pt-text-strong/standard/tage))]`)、
21
+ 状态层的悬停与按下底色。表现是**组件看起来都是方的**,且零报错。
22
+
23
+ 已在源码里把类名内的变量一并改名(100 处 / 36 个文件),宿主契约那 9 种
24
+ (层级三档 + 侧栏宽度)保持公共名不动。
25
+
26
+ `pnpm check:css` **新增第三条断言**专防这个坑:组件产物里凡出现在任意值括号内的
27
+ `--pt-*`,只能是宿主契约那几个。已做反向验证 —— 撤掉修复它立刻报出 14 个。
28
+
29
+ ---
30
+
7
31
  ## 0.7.0 — 库自带样式,不再受宿主配置影响
8
32
 
9
33
  ### 破坏性变更:必须多引一行样式
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  declare const SIZE_CLASSES: {
3
- readonly sm: "ptx-h-[24px] ptx-px-[8px] ptx-rounded-[var(--pt-radius-sm)] [&_input]:ptx-text-2xs";
3
+ readonly sm: "ptx-h-[24px] ptx-px-[8px] ptx-rounded-[var(--ptx-radius-sm)] [&_input]:ptx-text-2xs";
4
4
  readonly default: "ptx-h-[32px] ptx-px-[10px]";
5
5
  readonly lg: "ptx-h-[40px] ptx-px-[12px] [&_input]:ptx-text-sm";
6
6
  };
@@ -17,7 +17,7 @@ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.Selec
17
17
  *
18
18
  * `ptx-w-full` 不在里面:Select 自己要撑满容器,而筛选器通常按内容宽。各自加。
19
19
  */
20
- export declare const selectTriggerClassName = "ptx-flex ptx-h-[32px] ptx-items-center ptx-justify-between ptx-whitespace-nowrap ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-border-input ptx-bg-transparent ptx-px-[12px] ptx-py-[8px] ptx-text-xs ptx-ring-offset-background ptx-transition-colors placeholder:ptx-text-muted-foreground enabled:hover:ptx-border-neutral focus-visible:ptx-outline-none focus-visible:ptx-ring-1 focus-visible:ptx-ring-ring disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50 aria-[invalid=true]:ptx-border-destructive aria-[invalid=true]:ptx-text-destructive aria-[invalid=true]:enabled:hover:ptx-border-destructive aria-[invalid=true]:focus-visible:ptx-ring-destructive/30 [&>span]:ptx-line-clamp-1";
20
+ export declare const selectTriggerClassName = "ptx-flex ptx-h-[32px] ptx-items-center ptx-justify-between ptx-whitespace-nowrap ptx-rounded-[var(--ptx-radius-md)] ptx-border ptx-border-input ptx-bg-transparent ptx-px-[12px] ptx-py-[8px] ptx-text-xs ptx-ring-offset-background ptx-transition-colors placeholder:ptx-text-muted-foreground enabled:hover:ptx-border-neutral focus-visible:ptx-outline-none focus-visible:ptx-ring-1 focus-visible:ptx-ring-ring disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50 aria-[invalid=true]:ptx-border-destructive aria-[invalid=true]:ptx-text-destructive aria-[invalid=true]:enabled:hover:ptx-border-destructive aria-[invalid=true]:focus-visible:ptx-ring-destructive/30 [&>span]:ptx-line-clamp-1";
21
21
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
22
22
  declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
23
23
  declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,krBACgpB,CAAC;AAEprB,QAAA,MAAM,aAAa,oKAejB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACH,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACzB,CAAC"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/components/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAK1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,mrBACipB,CAAC;AAErrB,QAAA,MAAM,aAAa,oKAejB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JA6BjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAmBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACH,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACzB,CAAC"}