@doubao-apps/template 0.0.34 → 0.0.35
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 +58 -8
- package/assets/media-layout-card.png +0 -0
- package/dist/components/action-bar/index.d.ts +6 -0
- package/dist/components/action-bar/index.js +3 -3
- package/dist/components/action-bar/styles.css +15 -15
- package/dist/components/info-section/styles.css +25 -25
- package/dist/components/product-summary/styles.css +35 -35
- package/dist/components/route-section/styles.css +18 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/media-layout-card/index.d.ts +59 -0
- package/dist/media-layout-card/index.js +83 -0
- package/dist/media-layout-card/styles.css +131 -0
- package/dist/order-card/index.d.ts +5 -0
- package/dist/order-card/index.js +2 -2
- package/dist/single-item-card/index.d.ts +5 -0
- package/dist/single-item-card/index.js +2 -2
- package/dist/single-item-card/styles.css +2 -2
- package/dist/ticket-order-card/index.d.ts +5 -0
- package/dist/ticket-order-card/index.js +2 -2
- package/dist/transport-list-card/styles.css +6 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/price-text/index.d.ts +19 -0
- package/dist/ui/price-text/index.js +29 -0
- package/dist/ui/price-text/styles.css +74 -0
- package/dist/ui/tag/index.d.ts +20 -0
- package/dist/ui/tag/index.js +34 -0
- package/dist/ui/tag/styles.css +39 -0
- package/dist/utils/app-info.js +4 -2
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ import { ListCard } from '@doubao-apps/template';
|
|
|
38
38
|
|
|
39
39
|
效果图:
|
|
40
40
|
|
|
41
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
41
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/ask_human.png" alt="AskHumanCard 示例" width="400" />
|
|
42
42
|
|
|
43
43
|
<p />
|
|
44
44
|
|
|
@@ -127,7 +127,7 @@ import { ListCard } from '@doubao-apps/template';
|
|
|
127
127
|
|
|
128
128
|
效果图:
|
|
129
129
|
|
|
130
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
130
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/single-item-card.png" alt="SingleItemCard 示例" width="400" />
|
|
131
131
|
|
|
132
132
|
<p />
|
|
133
133
|
|
|
@@ -166,15 +166,57 @@ import { SingleItemCard } from '@doubao-apps/template';
|
|
|
166
166
|
- `pricePrefix`、`price` 和 `quantity` 用于配置商品操作态;不传时展示基础单项态。
|
|
167
167
|
- `image` 可以传入自定义图片节点,优先级高于 `imageSrc`。
|
|
168
168
|
- `primaryActionText` 和 `secondaryActionText` 可以配置底部操作按钮,不传时不展示操作区。
|
|
169
|
+
- 底部主/次按钮支持通过 `primaryActionButtonProps` 和 `secondaryActionButtonProps` 配置禁用、加载和点击节流状态。
|
|
169
170
|
- 如果需要完全自定义内容区域,可以传入 `children`,模板会保留标题栏和卡片外壳。
|
|
170
171
|
|
|
172
|
+
## MediaLayoutCard
|
|
173
|
+
|
|
174
|
+
`MediaLayoutCard` 是媒体布局卡模板,结构包含应用标题栏、左侧媒体、中间标题与信息行、右侧扩展内容和底部操作按钮,适合需要自定义布局内容的入口卡片。
|
|
175
|
+
|
|
176
|
+
效果图:
|
|
177
|
+
|
|
178
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/media-layout-card.png" alt="SingleItemCard 示例" width="400" />
|
|
179
|
+
|
|
180
|
+
<p />
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { MediaLayoutCard } from '@doubao-apps/template';
|
|
184
|
+
|
|
185
|
+
<MediaLayoutCard
|
|
186
|
+
moreText="更多"
|
|
187
|
+
title="小程序名称"
|
|
188
|
+
media={<image src="https://example.com/app-icon.png" mode="aspectFill" />}
|
|
189
|
+
infoRows={[
|
|
190
|
+
{
|
|
191
|
+
content: <text>提供小程序开发、构建、调试和发布能力。</text>
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
text: '辅助信息'
|
|
195
|
+
}
|
|
196
|
+
]}
|
|
197
|
+
extra={<text>右侧内容</text>}
|
|
198
|
+
primaryActionText="确认"
|
|
199
|
+
onPrimaryActionClick={() => {
|
|
200
|
+
console.log('confirm');
|
|
201
|
+
}}
|
|
202
|
+
/>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
说明:
|
|
206
|
+
|
|
207
|
+
- `infoRows` 最多展示前 2 行;纯文字可使用 `text`,需要自定义节点时使用 `content`。
|
|
208
|
+
- `extra` 用于配置右侧扩展内容,例如价格、标签、状态或自定义操作区。
|
|
209
|
+
- `primaryActionText` 和 `secondaryActionText` 用于配置底部操作按钮;只传主按钮时展示蓝色全宽按钮,只传次按钮时展示灰色全宽按钮,同时传入时展示左右双按钮。
|
|
210
|
+
- 底部主/次按钮支持通过 `primaryActionButtonProps` 和 `secondaryActionButtonProps` 配置禁用、加载和点击节流状态。
|
|
211
|
+
- 如果需要完全自定义内容区域,可以传入 `children`,模板会保留标题栏和底部操作区。
|
|
212
|
+
|
|
171
213
|
## PriceActionListCard
|
|
172
214
|
|
|
173
215
|
`PriceActionListCard` 是价格操作列表卡模板,结构包含应用标题栏、多条价格信息和底部操作按钮,适合展示多个可操作的报价、权益或结果项。
|
|
174
216
|
|
|
175
217
|
效果图:
|
|
176
218
|
|
|
177
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
219
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/price-action-list-card.png" alt="PriceActionListCard 示例" width="400" />
|
|
178
220
|
|
|
179
221
|
<p />
|
|
180
222
|
|
|
@@ -222,7 +264,7 @@ import { PriceActionListCard } from '@doubao-apps/template';
|
|
|
222
264
|
|
|
223
265
|
效果图:
|
|
224
266
|
|
|
225
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
267
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/task-action-card.png" alt="TaskActionCard 示例" width="400" />
|
|
226
268
|
|
|
227
269
|
<p />
|
|
228
270
|
|
|
@@ -247,7 +289,7 @@ import { TaskActionCard } from '@doubao-apps/template';
|
|
|
247
289
|
|
|
248
290
|
效果图:
|
|
249
291
|
|
|
250
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
292
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/order-card.png" alt="OrderCard 示例" width="400" />
|
|
251
293
|
|
|
252
294
|
<p />
|
|
253
295
|
|
|
@@ -300,6 +342,7 @@ import { OrderCard } from '@doubao-apps/template';
|
|
|
300
342
|
- `infoItems` 用于配置提单信息列表。
|
|
301
343
|
- `feeItems`、`discountText`、`totalLabel`、`totalPrice` 用于配置费用汇总。
|
|
302
344
|
- `primaryActionText` 和 `secondaryActionText` 可以自定义底部操作按钮文案。
|
|
345
|
+
- 底部主/次按钮支持通过 `primaryActionButtonProps` 和 `secondaryActionButtonProps` 配置禁用、加载和点击节流状态。
|
|
303
346
|
- 用在 widget 中时,推荐让 `render` 直接返回 `OrderCard`。
|
|
304
347
|
|
|
305
348
|
## TransportCard
|
|
@@ -308,7 +351,7 @@ import { OrderCard } from '@doubao-apps/template';
|
|
|
308
351
|
|
|
309
352
|
效果图:
|
|
310
353
|
|
|
311
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
354
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/transport-card.png" alt="TransportCard 示例" width="400" />
|
|
312
355
|
|
|
313
356
|
<p />
|
|
314
357
|
|
|
@@ -343,7 +386,7 @@ import { TransportCard } from '@doubao-apps/template';
|
|
|
343
386
|
|
|
344
387
|
效果图:
|
|
345
388
|
|
|
346
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
389
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/transport-list-card.png" alt="TransportListCard 示例" width="400" />
|
|
347
390
|
|
|
348
391
|
<p />
|
|
349
392
|
|
|
@@ -390,7 +433,7 @@ import { TransportListCard } from '@doubao-apps/template';
|
|
|
390
433
|
|
|
391
434
|
效果图:
|
|
392
435
|
|
|
393
|
-
<img src="https://unpkg.com/@doubao-apps/template@0.0.
|
|
436
|
+
<img src="https://unpkg.com/@doubao-apps/template@0.0.35/assets/ticket-order-card.png" alt="TicketOrderCard 示例" width="400" />
|
|
394
437
|
|
|
395
438
|
<p />
|
|
396
439
|
|
|
@@ -428,3 +471,10 @@ import { TicketOrderCard } from '@doubao-apps/template';
|
|
|
428
471
|
}}
|
|
429
472
|
/>
|
|
430
473
|
```
|
|
474
|
+
|
|
475
|
+
说明:
|
|
476
|
+
|
|
477
|
+
- `routeItems` 用于配置航程列表。
|
|
478
|
+
- `infoItems` 和 `feeItems` 用于配置订单信息与费用明细。
|
|
479
|
+
- `primaryActionText` 和 `secondaryActionText` 可以自定义底部操作按钮文案。
|
|
480
|
+
- 底部主/次按钮支持通过 `primaryActionButtonProps` 和 `secondaryActionButtonProps` 配置禁用、加载和点击节流状态。
|
|
Binary file
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type ButtonProps } from '@byted-doubao-apps/components';
|
|
1
2
|
import type { CSSProperties, TouchEvent } from '@lynx-js/types';
|
|
2
3
|
import type { ReactElement } from 'react';
|
|
3
4
|
import './styles.scss';
|
|
5
|
+
export type TemplateActionButtonProps = Pick<ButtonProps, 'disabled' | 'loading' | 'throttle'>;
|
|
4
6
|
export interface TemplateActionBarProps {
|
|
5
7
|
/** 操作区根节点自定义类名。 */
|
|
6
8
|
className?: string;
|
|
@@ -8,8 +10,12 @@ export interface TemplateActionBarProps {
|
|
|
8
10
|
style?: CSSProperties;
|
|
9
11
|
/** 主按钮文案。 */
|
|
10
12
|
primaryActionText?: string;
|
|
13
|
+
/** 主按钮配置,支持禁用、加载和点击节流。 */
|
|
14
|
+
primaryActionButtonProps?: TemplateActionButtonProps;
|
|
11
15
|
/** 次按钮文案。 */
|
|
12
16
|
secondaryActionText?: string;
|
|
17
|
+
/** 次按钮配置,支持禁用、加载和点击节流。 */
|
|
18
|
+
secondaryActionButtonProps?: TemplateActionButtonProps;
|
|
13
19
|
/** 点击主按钮时触发。 */
|
|
14
20
|
onPrimaryActionClick?: (event?: TouchEvent) => void;
|
|
15
21
|
/** 点击次按钮时触发。 */
|
|
@@ -2,14 +2,14 @@ import { Button } from "@byted-doubao-apps/components";
|
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
function TemplateActionBar(props) {
|
|
5
|
-
const { className, style, primaryActionText, secondaryActionText, onPrimaryActionClick, onSecondaryActionClick } = props;
|
|
5
|
+
const { className, style, primaryActionText, primaryActionButtonProps, secondaryActionText, secondaryActionButtonProps, onPrimaryActionClick, onSecondaryActionClick } = props;
|
|
6
6
|
const hasPrimaryAction = null != primaryActionText && primaryActionText.length > 0;
|
|
7
7
|
const hasSecondaryAction = null != secondaryActionText && secondaryActionText.length > 0;
|
|
8
8
|
const hasDefaultActions = hasPrimaryAction || hasSecondaryAction;
|
|
9
9
|
if (!hasDefaultActions) return null;
|
|
10
10
|
return <view className={clsx('doubao-template-action-bar', className)} style={style}>
|
|
11
|
-
{hasSecondaryAction ? <Button className="doubao-template-action-bar__action" type="default" text={secondaryActionText} onClick={onSecondaryActionClick}/> : null}
|
|
12
|
-
{hasPrimaryAction ? <Button className="doubao-template-action-bar__action" type="primary" text={primaryActionText} onClick={onPrimaryActionClick}/> : null}
|
|
11
|
+
{hasSecondaryAction ? <Button className="doubao-template-action-bar__action" type="default" text={secondaryActionText} {...secondaryActionButtonProps} onClick={onSecondaryActionClick}/> : null}
|
|
12
|
+
{hasPrimaryAction ? <Button className="doubao-template-action-bar__action" type="primary" text={primaryActionText} {...primaryActionButtonProps} onClick={onPrimaryActionClick}/> : null}
|
|
13
13
|
</view>;
|
|
14
14
|
}
|
|
15
15
|
export { TemplateActionBar };
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
.doubao-template-action-bar {
|
|
2
|
-
width: 100%;
|
|
3
|
-
padding: var(--doubao-template-action-bar-padding, 8px 12px 12px);
|
|
4
2
|
box-sizing: border-box;
|
|
5
3
|
flex-direction: row;
|
|
4
|
+
width: 100%;
|
|
5
|
+
padding: 8px 12px 12px;
|
|
6
6
|
display: flex;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.doubao-template-action-bar__action {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
--doubao-button-border-radius: var(--doubao-template-action-bar-button-radius, 8px);
|
|
14
|
-
--doubao-button-default-height: var(--doubao-template-action-bar-button-height, 44px);
|
|
15
|
-
--doubao-button-default-padding-x: var(--doubao-template-action-bar-button-padding-x, 12px);
|
|
10
|
+
--doubao-button-border-radius: 8px;
|
|
11
|
+
--doubao-button-default-height: 44px;
|
|
12
|
+
--doubao-button-default-padding-x: 12px;
|
|
16
13
|
--doubao-button-default-padding-y: 0;
|
|
17
|
-
--doubao-button-default-font-size:
|
|
18
|
-
--doubao-button-default-line-height:
|
|
19
|
-
--doubao-button-primary-bg: var(--
|
|
20
|
-
--doubao-button-primary-text: var(--
|
|
21
|
-
--doubao-button-default-bg: var(--
|
|
22
|
-
--doubao-button-default-text: var(--
|
|
14
|
+
--doubao-button-default-font-size: 16px;
|
|
15
|
+
--doubao-button-default-line-height: 22px;
|
|
16
|
+
--doubao-button-primary-bg: var(--primary-50);
|
|
17
|
+
--doubao-button-primary-text: var(--static-white);
|
|
18
|
+
--doubao-button-default-bg: var(--bg-base-2-overlay);
|
|
19
|
+
--doubao-button-default-text: var(--neutral-100);
|
|
20
|
+
border-radius: 8px;
|
|
23
21
|
flex: 1 1 0;
|
|
22
|
+
width: auto;
|
|
24
23
|
min-width: 0;
|
|
24
|
+
height: 44px;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.doubao-template-action-bar__action + .doubao-template-action-bar__action {
|
|
28
|
-
margin-left:
|
|
28
|
+
margin-left: 10px;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.doubao-template-info-section {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
border-top:
|
|
3
|
+
border-top: .5px solid var(--neutral-transparent-1);
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
width: 100%;
|
|
6
6
|
padding: 12px;
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
|
|
41
41
|
.doubao-template-info-section__info-label {
|
|
42
42
|
max-width: 100%;
|
|
43
|
-
color: var(--
|
|
44
|
-
font-size:
|
|
45
|
-
font-weight:
|
|
46
|
-
line-height:
|
|
43
|
+
color: var(--neutral-100);
|
|
44
|
+
font-size: 13px;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
line-height: 20px;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.doubao-template-info-section__info-value-wrap {
|
|
@@ -58,12 +58,12 @@
|
|
|
58
58
|
|
|
59
59
|
.doubao-template-info-section__info-value {
|
|
60
60
|
min-width: 0;
|
|
61
|
-
|
|
62
|
-
color: var(--doubao-template-info-section-value-text, var(--neutral-50));
|
|
63
|
-
font-size: var(--doubao-template-info-section-value-font-size, 13px);
|
|
64
|
-
font-weight: var(--doubao-template-info-section-value-font-weight, 400);
|
|
65
|
-
line-height: var(--doubao-template-info-section-value-line-height, 20px);
|
|
61
|
+
color: var(--neutral-50);
|
|
66
62
|
text-align: right;
|
|
63
|
+
margin-left: 6px;
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
font-weight: 400;
|
|
66
|
+
line-height: 20px;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
.doubao-template-info-section__info-value:first-child {
|
|
@@ -98,13 +98,13 @@
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
.doubao-template-info-section__fee {
|
|
101
|
-
flex-shrink: var(--doubao-template-info-section-fee-shrink, 1);
|
|
102
101
|
min-width: 0;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
font-
|
|
107
|
-
|
|
102
|
+
color: var(--neutral-50);
|
|
103
|
+
flex-shrink: 1;
|
|
104
|
+
margin-left: 6px;
|
|
105
|
+
font-size: 13px;
|
|
106
|
+
font-weight: 400;
|
|
107
|
+
line-height: 20px;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.doubao-template-info-section__fee:first-child {
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
.doubao-template-info-section__total {
|
|
115
|
-
margin-left: var(--doubao-template-info-section-total-gap, 6px);
|
|
116
115
|
flex-direction: row;
|
|
117
116
|
flex-shrink: 0;
|
|
118
117
|
align-items: center;
|
|
118
|
+
margin-left: 6px;
|
|
119
119
|
display: flex;
|
|
120
120
|
}
|
|
121
121
|
|
|
@@ -124,17 +124,17 @@
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
.doubao-template-info-section__total-label {
|
|
127
|
-
color: var(--
|
|
128
|
-
font-size:
|
|
129
|
-
font-weight:
|
|
130
|
-
line-height:
|
|
127
|
+
color: var(--neutral-100);
|
|
128
|
+
font-size: 13px;
|
|
129
|
+
font-weight: 500;
|
|
130
|
+
line-height: 20px;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
.doubao-template-info-section__total-price {
|
|
134
|
-
color: var(--
|
|
135
|
-
font-size: var(--doubao-template-info-section-total-price-font-size, 15px);
|
|
136
|
-
font-weight: var(--doubao-template-info-section-total-price-font-weight, 500);
|
|
137
|
-
line-height: var(--doubao-template-info-section-total-price-line-height, 22px);
|
|
134
|
+
color: var(--neutral-100);
|
|
138
135
|
margin-left: 2px;
|
|
136
|
+
font-size: 15px;
|
|
137
|
+
font-weight: 500;
|
|
138
|
+
line-height: 22px;
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.doubao-template-product-summary {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
background-color: var(--
|
|
3
|
+
background-color: var(--bg-base-1);
|
|
4
4
|
flex-direction: row;
|
|
5
5
|
align-items: center;
|
|
6
6
|
width: 100%;
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.doubao-template-product-summary__image {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
background-color: var(--doubao-template-product-summary-image-bg, var(--bg-base-1-overlay));
|
|
15
|
-
border-radius: var(--doubao-template-product-summary-image-radius, 5px);
|
|
12
|
+
background-color: var(--bg-base-1-overlay);
|
|
13
|
+
border-radius: 5px;
|
|
16
14
|
flex-shrink: 0;
|
|
15
|
+
width: 80px;
|
|
16
|
+
height: 80px;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.doubao-template-product-summary__line-main {
|
|
40
|
-
height:
|
|
40
|
+
height: 24px;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.doubao-template-product-summary__line-secondary {
|
|
44
|
-
height:
|
|
45
|
-
margin-top:
|
|
44
|
+
height: 20px;
|
|
45
|
+
margin-top: 2px;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
.doubao-template-product-summary__title-wrap {
|
|
49
|
-
min-width: 0;
|
|
50
|
-
margin-right: var(--doubao-template-product-summary-title-margin-right, 8px);
|
|
51
49
|
flex-direction: row;
|
|
52
50
|
flex: 1 1 0;
|
|
53
51
|
align-items: center;
|
|
52
|
+
min-width: 0;
|
|
53
|
+
margin-right: 8px;
|
|
54
54
|
display: flex;
|
|
55
55
|
}
|
|
56
56
|
|
|
@@ -64,25 +64,25 @@
|
|
|
64
64
|
|
|
65
65
|
.doubao-template-product-summary__title {
|
|
66
66
|
min-width: 0;
|
|
67
|
-
color: var(--
|
|
68
|
-
font-size:
|
|
69
|
-
font-weight:
|
|
70
|
-
line-height:
|
|
67
|
+
color: var(--neutral-100);
|
|
68
|
+
font-size: 16px;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
line-height: 24px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.doubao-template-product-summary__chevron {
|
|
74
|
-
width: var(--doubao-template-product-summary-chevron-size, 7px);
|
|
75
|
-
height: var(--doubao-template-product-summary-chevron-size, 7px);
|
|
76
|
-
margin-left: var(--doubao-template-product-summary-chevron-margin-left, 5px);
|
|
77
74
|
box-sizing: border-box;
|
|
78
|
-
border-top:
|
|
79
|
-
border-right:
|
|
75
|
+
border-top: 1.5px solid var(--neutral-30);
|
|
76
|
+
border-right: 1.5px solid var(--neutral-30);
|
|
80
77
|
flex-shrink: 0;
|
|
78
|
+
width: 7px;
|
|
79
|
+
height: 7px;
|
|
80
|
+
margin-left: 5px;
|
|
81
81
|
transform: rotate(45deg);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
.doubao-template-product-summary__price {
|
|
85
|
-
color: var(--
|
|
85
|
+
color: var(--neutral-100);
|
|
86
86
|
white-space: nowrap;
|
|
87
87
|
flex-direction: row;
|
|
88
88
|
flex-shrink: 0;
|
|
@@ -94,32 +94,32 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
.doubao-template-product-summary__price-prefix {
|
|
97
|
-
width:
|
|
98
|
-
font-size:
|
|
99
|
-
line-height:
|
|
97
|
+
width: 22px;
|
|
98
|
+
font-size: 11px;
|
|
99
|
+
line-height: 17px;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
.doubao-template-product-summary__price-value {
|
|
103
|
-
margin-left:
|
|
104
|
-
font-size:
|
|
105
|
-
line-height:
|
|
103
|
+
margin-left: 2px;
|
|
104
|
+
font-size: 13px;
|
|
105
|
+
line-height: 19px;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
.doubao-template-product-summary__spec {
|
|
109
109
|
min-width: 0;
|
|
110
|
-
color: var(--
|
|
111
|
-
font-size: var(--doubao-template-product-summary-spec-font-size, 12px);
|
|
112
|
-
font-weight: var(--doubao-template-product-summary-spec-font-weight, 400);
|
|
113
|
-
line-height: var(--doubao-template-product-summary-spec-line-height, 18px);
|
|
110
|
+
color: var(--neutral-50);
|
|
114
111
|
flex: 1 1 0;
|
|
112
|
+
font-size: 12px;
|
|
113
|
+
font-weight: 400;
|
|
114
|
+
line-height: 18px;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
.doubao-template-product-summary__quantity {
|
|
118
|
-
|
|
119
|
-
color: var(--doubao-template-product-summary-secondary-text, var(--neutral-50));
|
|
120
|
-
font-size: var(--doubao-template-product-summary-quantity-font-size, 13px);
|
|
121
|
-
font-weight: var(--doubao-template-product-summary-quantity-font-weight, 400);
|
|
122
|
-
line-height: var(--doubao-template-product-summary-quantity-line-height, 20px);
|
|
118
|
+
color: var(--neutral-50);
|
|
123
119
|
flex-shrink: 0;
|
|
120
|
+
margin-left: 8px;
|
|
121
|
+
font-size: 13px;
|
|
122
|
+
font-weight: 400;
|
|
123
|
+
line-height: 20px;
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.doubao-template-route-section__title {
|
|
13
|
-
width: 100%;
|
|
14
|
-
min-width: 0;
|
|
15
|
-
height: var(--doubao-template-route-section-title-height, 24px);
|
|
16
13
|
flex-direction: row;
|
|
17
14
|
align-items: center;
|
|
15
|
+
width: 100%;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
height: 24px;
|
|
18
18
|
display: flex;
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
}
|
|
@@ -29,30 +29,30 @@
|
|
|
29
29
|
|
|
30
30
|
.doubao-template-route-section__title-text {
|
|
31
31
|
min-width: 0;
|
|
32
|
-
color: var(--
|
|
33
|
-
font-size:
|
|
34
|
-
font-weight:
|
|
35
|
-
line-height:
|
|
32
|
+
color: var(--neutral-100);
|
|
33
|
+
font-size: 16px;
|
|
34
|
+
font-weight: 500;
|
|
35
|
+
line-height: 24px;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
.doubao-template-route-section__chevron {
|
|
39
|
-
width: var(--doubao-template-route-section-chevron-size, 7px);
|
|
40
|
-
height: var(--doubao-template-route-section-chevron-size, 7px);
|
|
41
|
-
margin-left: var(--doubao-template-route-section-chevron-margin-left, 5px);
|
|
42
39
|
box-sizing: border-box;
|
|
43
|
-
border-top:
|
|
44
|
-
border-right:
|
|
40
|
+
border-top: 1.5px solid var(--neutral-30);
|
|
41
|
+
border-right: 1.5px solid var(--neutral-30);
|
|
45
42
|
flex-shrink: 0;
|
|
43
|
+
width: 7px;
|
|
44
|
+
height: 7px;
|
|
45
|
+
margin-left: 5px;
|
|
46
46
|
transform: rotate(45deg);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.doubao-template-route-section__description {
|
|
50
50
|
width: 100%;
|
|
51
|
-
height:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
font-size:
|
|
55
|
-
font-weight:
|
|
56
|
-
line-height:
|
|
51
|
+
height: 20px;
|
|
52
|
+
color: var(--neutral-50);
|
|
53
|
+
margin-top: 2px;
|
|
54
|
+
font-size: 13px;
|
|
55
|
+
font-weight: 400;
|
|
56
|
+
line-height: 20px;
|
|
57
57
|
}
|
|
58
58
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { ListCard, type ListCardItem, type ListCardProps } from './list-card/ind
|
|
|
2
2
|
export { AskHumanCard, type AskHumanCardItem, type AskHumanCardProps } from './ask-human-card/index.js';
|
|
3
3
|
export { InvalidCard, type InvalidCardProps } from './invalid-card/index.js';
|
|
4
4
|
export { SingleItemCard, type SingleItemCardInfoItem, type SingleItemCardInfoRow, type SingleItemCardProps } from './single-item-card/index.js';
|
|
5
|
+
export { MediaLayoutCard, type MediaLayoutCardInfoRow, type MediaLayoutCardProps } from './media-layout-card/index.js';
|
|
6
|
+
export { PriceText, Tag, type PriceTextProps, type TagProps } from './ui/index.js';
|
|
5
7
|
export { OrderCard, type OrderCardFeeItem, type OrderCardInfoItem, type OrderCardProductItem, type OrderCardProps } from './order-card/index.js';
|
|
6
8
|
export { PriceActionListCard, type PriceActionListCardInfoRow, type PriceActionListCardItem, type PriceActionListCardProps } from './price-action-list-card/index.js';
|
|
7
9
|
export { TaskActionCard, type TaskActionCardProps } from './task-action-card/index.js';
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,8 @@ export { ListCard } from "./list-card/index.js";
|
|
|
2
2
|
export { AskHumanCard } from "./ask-human-card/index.js";
|
|
3
3
|
export { InvalidCard } from "./invalid-card/index.js";
|
|
4
4
|
export { SingleItemCard } from "./single-item-card/index.js";
|
|
5
|
+
export { MediaLayoutCard } from "./media-layout-card/index.js";
|
|
6
|
+
export { PriceText, Tag } from "./ui/index.js";
|
|
5
7
|
export { OrderCard } from "./order-card/index.js";
|
|
6
8
|
export { PriceActionListCard } from "./price-action-list-card/index.js";
|
|
7
9
|
export { TaskActionCard } from "./task-action-card/index.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { CSSProperties, TouchEvent } from '@lynx-js/types';
|
|
2
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
3
|
+
import { type TemplateActionButtonProps } from '../components/action-bar/index.js';
|
|
4
|
+
import type { TemplateKey, TemplateText } from '../types.js';
|
|
5
|
+
import './styles.scss';
|
|
6
|
+
export interface MediaLayoutCardProps {
|
|
7
|
+
/** 标题栏右侧「更多」入口的文案。 */
|
|
8
|
+
moreText?: string;
|
|
9
|
+
/** 是否展示标题栏右侧「更多」入口。 */
|
|
10
|
+
showMore?: boolean;
|
|
11
|
+
/** 主标题。字符串和数字会按默认单行标题样式渲染,传入节点时直接渲染自定义内容。 */
|
|
12
|
+
title?: ReactNode;
|
|
13
|
+
/** 是否展示主标题右侧箭头。 */
|
|
14
|
+
showChevron?: boolean;
|
|
15
|
+
/** 左侧媒体节点。 */
|
|
16
|
+
media?: ReactNode;
|
|
17
|
+
/** 中间信息行。最多展示前 2 行。 */
|
|
18
|
+
infoRows?: MediaLayoutCardInfoRow[];
|
|
19
|
+
/** 右侧扩展内容。 */
|
|
20
|
+
extra?: ReactNode;
|
|
21
|
+
/** 右侧次按钮文案;extra 为空时生效。 */
|
|
22
|
+
extraActionText?: string;
|
|
23
|
+
/** 主按钮文案。 */
|
|
24
|
+
primaryActionText?: string;
|
|
25
|
+
/** 主按钮配置,支持禁用、加载和点击节流。 */
|
|
26
|
+
primaryActionButtonProps?: TemplateActionButtonProps;
|
|
27
|
+
/** 次按钮文案。 */
|
|
28
|
+
secondaryActionText?: string;
|
|
29
|
+
/** 次按钮配置,支持禁用、加载和点击节流。 */
|
|
30
|
+
secondaryActionButtonProps?: TemplateActionButtonProps;
|
|
31
|
+
/** 自定义内容区;传入后不再渲染默认布局。 */
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
/** 卡片根节点自定义类名。 */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** 卡片根节点自定义样式。 */
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
/** 点击卡片根节点时触发。 */
|
|
38
|
+
onClick?: (event: TouchEvent) => void;
|
|
39
|
+
/** 点击标题栏右侧「更多」入口时触发。 */
|
|
40
|
+
onMoreClick?: (event: TouchEvent) => void;
|
|
41
|
+
/** 点击内容区时触发。 */
|
|
42
|
+
onContentClick?: (event: TouchEvent) => void;
|
|
43
|
+
/** 点击右侧次按钮时触发。 */
|
|
44
|
+
onExtraActionClick?: (event?: TouchEvent) => void;
|
|
45
|
+
/** 点击主按钮时触发。 */
|
|
46
|
+
onPrimaryActionClick?: (event?: TouchEvent) => void;
|
|
47
|
+
/** 点击次按钮时触发。 */
|
|
48
|
+
onSecondaryActionClick?: (event?: TouchEvent) => void;
|
|
49
|
+
}
|
|
50
|
+
export interface MediaLayoutCardInfoRow {
|
|
51
|
+
/** 信息行唯一标识;不传时使用数组下标。 */
|
|
52
|
+
key?: TemplateKey;
|
|
53
|
+
/** 信息行内容;优先级高于 text。字符串和数字会按默认信息样式渲染,传入节点时直接渲染自定义内容。 */
|
|
54
|
+
content?: ReactNode;
|
|
55
|
+
/** 信息行单字段文案;只需要传入文字时使用。 */
|
|
56
|
+
text?: TemplateText;
|
|
57
|
+
}
|
|
58
|
+
export declare function MediaLayoutCard(props: MediaLayoutCardProps): ReactElement;
|
|
59
|
+
//# sourceMappingURL=index.d.ts.map
|