@hlw-uni/mp-vue 2.1.31 → 2.1.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hlw-uni/mp-vue",
3
- "version": "2.1.31",
3
+ "version": "2.1.33",
4
4
  "description": "hlw-uni 小程序运行时 — Vue 组件 + composables + theme + http + 工具集(合并自原 mp-core)",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -2,7 +2,7 @@
2
2
  <view class="hlw-card-header" :class="{ 'hlw-card-header--divider': divider }">
3
3
  <view class="hlw-card-header__left">
4
4
  <slot name="left">
5
- <view v-if="icon" class="hlw-card-header__icon-box">
5
+ <view v-if="icon" class="hlw-card-header__icon-box" :class="iconBoxClass">
6
6
  <text class="hlw-card-header__icon" :class="icon" />
7
7
  </view>
8
8
  <text v-if="title" class="hlw-card-header__title">{{ title }}</text>
@@ -71,6 +71,21 @@ const slots = useSlots();
71
71
 
72
72
  const hasRight = computed(() => !!(slots.right || props.extra));
73
73
 
74
+ const iconToneClass = computed(() => {
75
+ const value = props.icon;
76
+ if (value.includes("text-rose") || value.includes("text-red")) return "rose";
77
+ if (value.includes("text-emerald") || value.includes("text-green")) return "emerald";
78
+ if (value.includes("text-blue")) return "blue";
79
+ if (value.includes("text-sky")) return "sky";
80
+ if (value.includes("text-cyan")) return "cyan";
81
+ if (value.includes("text-purple")) return "purple";
82
+ if (value.includes("text-pink")) return "pink";
83
+ if (value.includes("text-yellow") || value.includes("text-amber")) return "amber";
84
+ return "indigo";
85
+ });
86
+
87
+ const iconBoxClass = computed(() => `hlw-card-header__icon-box--${iconToneClass.value}`);
88
+
74
89
  defineOptions({
75
90
  name: "HlwCardHeader",
76
91
  });
@@ -108,15 +123,49 @@ defineOptions({
108
123
  width: 56rpx;
109
124
  height: 56rpx;
110
125
  border-radius: var(--radius-md, 16rpx);
111
- background: #eef2ff;
112
- color: #6366f1;
113
126
  display: flex;
114
127
  align-items: center;
115
128
  justify-content: center;
129
+
130
+ &--indigo {
131
+ background: #eef2ff;
132
+ }
133
+
134
+ &--rose {
135
+ background: #fff1f2;
136
+ }
137
+
138
+ &--emerald {
139
+ background: #ecfdf5;
140
+ }
141
+
142
+ &--blue {
143
+ background: #eff6ff;
144
+ }
145
+
146
+ &--sky {
147
+ background: #f0f9ff;
148
+ }
149
+
150
+ &--cyan {
151
+ background: #ecfeff;
152
+ }
153
+
154
+ &--purple {
155
+ background: #faf5ff;
156
+ }
157
+
158
+ &--pink {
159
+ background: #fdf2f8;
160
+ }
161
+
162
+ &--amber {
163
+ background: #fffbeb;
164
+ }
116
165
  }
117
166
 
118
167
  .hlw-card-header__icon {
119
- font-size: 22rpx;
168
+ font-size: 20rpx;
120
169
  }
121
170
 
122
171
  .hlw-card-header__title {