@doubao-dev/template 0.7.1 → 0.8.0-canary-99e80cd87-20261106061422

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 (49) hide show
  1. package/README.md +8 -4
  2. package/dist/checkout-card/index.js +2 -2
  3. package/dist/checkout-card/styles.css +1 -1
  4. package/dist/components/footer/index.d.ts +3 -0
  5. package/dist/components/footer/index.js +9 -3
  6. package/dist/components/header/index.d.ts +9 -1
  7. package/dist/components/header/index.js +12 -5
  8. package/dist/components/header/styles.css +1 -1
  9. package/dist/components/info-section/styles.css +1 -1
  10. package/dist/components/transport-summary/index.js +2 -1
  11. package/dist/components/transport-summary/styles.css +1 -1
  12. package/dist/composite-card/index.d.ts +15 -2
  13. package/dist/composite-card/index.js +7 -2
  14. package/dist/composite-card/styles.css +1 -1
  15. package/dist/content-card/index.js +2 -2
  16. package/dist/content-card/styles.css +1 -1
  17. package/dist/coupon-card/styles.css +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/map-card/index.d.ts +1 -1
  20. package/dist/map-card/index.js +1 -1
  21. package/dist/map-card/styles.css +1 -1
  22. package/dist/price-action-card/index.d.ts +3 -0
  23. package/dist/price-action-card/index.js +5 -4
  24. package/dist/price-action-card/styles.css +1 -1
  25. package/dist/primitives/agreement/index.d.ts +5 -0
  26. package/dist/primitives/agreement/index.js +18 -0
  27. package/dist/primitives/agreement/styles.css +1 -0
  28. package/dist/primitives/agreement/types.d.ts +17 -0
  29. package/dist/primitives/agreement/types.js +0 -0
  30. package/dist/primitives/checkbox/index.d.ts +5 -0
  31. package/dist/primitives/checkbox/index.js +17 -0
  32. package/dist/primitives/checkbox/styles.css +1 -0
  33. package/dist/primitives/checkbox/types.d.ts +10 -0
  34. package/dist/primitives/checkbox/types.js +0 -0
  35. package/dist/primitives/index.d.ts +3 -1
  36. package/dist/primitives/index.js +2 -0
  37. package/dist/primitives/price/styles.css +1 -1
  38. package/dist/primitives/price/types.d.ts +2 -2
  39. package/dist/primitives/tag/index.js +3 -2
  40. package/dist/primitives/tag/styles.css +1 -1
  41. package/dist/primitives/tag/types.d.ts +5 -2
  42. package/dist/primitives/title/index.d.ts +1 -1
  43. package/dist/primitives/title/index.js +3 -1
  44. package/dist/primitives/title/styles.css +1 -1
  45. package/dist/primitives/title/types.d.ts +8 -2
  46. package/dist/transit-card/index.d.ts +2 -2
  47. package/dist/transit-card/index.js +2 -2
  48. package/dist/transit-card/styles.css +1 -1
  49. package/package.json +1 -1
package/README.md CHANGED
@@ -44,11 +44,15 @@ export default function ProductCard() {
44
44
  | 人工确认选项 | [AskHumanCard](../../../docs/templates/ask-human-card.mdx) |
45
45
  | 多种内容组成一张卡片 | [CompositeCard](../../../docs/templates/composite-card.mdx) |
46
46
 
47
- 标题、标签、价格、选项和数量调节组件见 [Primitives](../../../docs/templates/shared-components.mdx#primitives)。
47
+ 标题、标签、价格、选项、数量调节、勾选框和协议声明见 [Primitives](../../../docs/templates/shared-components.mdx#primitives)。
48
+
49
+ `Checkbox`、`Agreement` 从 `@doubao-dev/template/primitives` 导入。
50
+ `PriceActionCardItem.checkbox` 配置右侧勾选框,替换该项操作按钮;不传时保持按钮布局。
51
+ 所有使用共享 footer 的卡片可通过 `footer.agreement` 配置按钮下方的协议声明。
48
52
 
49
53
  ## 使用约定
50
54
 
51
- - 对话流 Widget 必须使用平台模板,只使用公开的结构化 Props 和受限的具名内容槽位;组合多个已知模块时使用 `CompositeCard`,不通过 `children` 自定义整张卡片布局。
55
+ - 对话流 Widget 必须使用平台模板。组合多个已知模块或定制内容区时使用 `CompositeCard` 的 `sections`,卡片外壳、header 和 footer 仍由模板管理;不通过 `children` 自定义整张卡片布局。
52
56
  - `header`、内容区和 `footer` 独立配置;`onClick` 作用于卡片根节点。
53
57
  - 模板和 Primitives 不声明或暴露组件级 CSS 变量,可以直接使用已有的全局主题 token。
54
58
 
@@ -63,11 +67,11 @@ Web 和 Lynx 的 JSX 构建流程会对可静态确定的违规节点输出 `[
63
67
  - `ContentCardItem.title / subtitle / description`、`TransitCardItem.title`:支持字符串、数字、直接传入的 primitive `Tag` / `Title`。
64
68
  - `ContentCardItem.thumbnail`、`CheckoutCardProductItem.image`:支持直接传入的 `<image />` 或 `<svg />`,也可使用对应 URL 字段。
65
69
  - `ContentCardItem.action` 仅支持标准操作配置;`TransitCardItem.price` 支持标准价格配置、字符串或数字;中转信息使用 `transferTop / transferBottom`。
66
- - `CompositeCard` 复用上述内容规则。业务组件、fragment、数组或额外包装节点不属于支持的槽位内容。
70
+ - `CompositeCard` 的 `transit`、`content`、`option-group` section 复用上述内容规则;仅 `custom.content` 可传入业务组件,业务组件不能塞入其他受控槽位。
67
71
  - 文本槽位类型为 `string | number | ReactElement`,媒体槽位类型为 `ReactElement`。类型只约束值的类别;具体元素白名单由构建检查根据 import 来源校验。
68
72
 
69
73
  检查支持公共/内部包导入、别名、命名空间、当前文件常量、对象成员、对象/数组展开、条件表达式及表达式形式的 map 回调。跨文件数据、动态函数返回值、复杂数据流和无法解析的展开内容会跳过;不对这些值宣称检查通过。检查允许空值或条件表达式不展示内容。
70
74
 
71
75
  卡片、列表项和 footer 不提供 `style` / `className`,构建检查会对这些字段提示 warning。Primitives 同样不提供 `style` / `className`。宿主背景色和模板内部布局仍由模板管理。
72
76
 
73
- 卡片不能通过导入自定义样式文件覆盖模板。构建检查沿已注册 Widget 的模块依赖链检查 CSS、SCSS、Sass、Less、Stylus 文件(含 CSS Modules),对直接引入、共享组件间接引入和构建器可解析的动态引入输出 `widget.styles` warning。平台模板、组件及框架包自身的样式依赖放行;仅由普通 Page 引入的样式不告警。此检查基于构建模块图,不覆盖运行时通过 URL 加载的样式或脚本动态注入的样式。
77
+ 卡片不能通过导入自定义样式文件覆盖模板。构建检查沿已注册 Widget 的模块依赖链检查 CSS、SCSS、Sass、Less、Stylus 文件(含 CSS Modules),对直接引入、共享组件间接引入和构建器可解析的动态引入输出 `widget.styles` warning。`CompositeCard` 中静态可识别的 `custom.content` 业务组件及其依赖链可维护内容区样式,但不能覆盖模板外壳、header、footer 或模板类名;Widget 入口和无关依赖的样式仍会报警。平台模板、组件及框架包自身的样式依赖放行;仅由普通 Page 引入的样式不告警。此检查基于构建模块图,无法证明样式选择器没有覆盖模板,也不覆盖运行时通过 URL 加载的样式或脚本动态注入的样式。
@@ -29,13 +29,13 @@ function CheckoutCard(props) {
29
29
  index
30
30
  })).filter((node)=>null != node);
31
31
  return <view className={useThemeClassName('doubao-checkout-card')} style={cardStyle} bindtap={onClick} clip-radius="true">
32
- <TemplateCardHeader actionText={header?.actionText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
32
+ <TemplateCardHeader actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
33
33
 
34
34
  {productNodes.length > 0 && <view className="doubao-checkout-card__products">{productNodes}</view>}
35
35
 
36
36
  <TemplateInfoSection infoItems={infoItems} feeItems={feeItems} totalLabel={totalLabel} totalPrice={totalPrice} valueLayout="column"/>
37
37
 
38
- <TemplateCardFooter secondaryActionButton={footer?.secondaryActionButton} primaryActionButton={footer?.primaryActionButton}/>
38
+ <TemplateCardFooter secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement} primaryActionButton={footer?.primaryActionButton}/>
39
39
  </view>;
40
40
  }
41
41
  export { CheckoutCard };
@@ -1 +1 @@
1
- .doubao-checkout-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-checkout-card__products{display:flex;flex-direction:column;align-items:stretch;width:100%}.doubao-checkout-card__product{position:relative}.doubao-checkout-card__product+.doubao-checkout-card__product::before{position:absolute;top:0;right:16px;left:16px;height:1px;background-color:var(--neutral-transparent-1);content:""}
1
+ .doubao-checkout-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-checkout-card__products{display:flex;flex-direction:column;align-items:stretch;width:100%}.doubao-checkout-card__product{position:relative}.doubao-checkout-card__product+.doubao-checkout-card__product::before{position:absolute;top:0;right:16px;left:16px;height:1px;background-color:var(--neutral-transparent-1);content:""}
@@ -1,5 +1,6 @@
1
1
  import type { TouchEvent } from '@lynx-js/types';
2
2
  import type { ReactElement } from 'react';
3
+ import { type AgreementProps } from '../../primitives/agreement/index.js';
3
4
  import './styles.scss';
4
5
  export interface TemplateCardFooterActionButton {
5
6
  /** 按钮文案。 */
@@ -18,6 +19,8 @@ export interface TemplateCardFooterProps {
18
19
  primaryActionButton?: TemplateCardFooterActionButton;
19
20
  /** 底部次按钮;只传一个按钮时占据整行。 */
20
21
  secondaryActionButton?: TemplateCardFooterActionButton;
22
+ /** 按钮下方的非阻断式协议声明。 */
23
+ agreement?: AgreementProps;
21
24
  }
22
25
  export declare function TemplateCardFooter(props: TemplateCardFooterProps): ReactElement | null;
23
26
  //# sourceMappingURL=index.d.ts.map
@@ -1,14 +1,20 @@
1
1
  import { Button } from "@byted-doubao-apps/components";
2
+ import { Agreement } from "../../primitives/agreement/index.js";
2
3
  import "./styles.css";
3
4
  function TemplateCardFooter(props) {
4
- const { primaryActionButton, secondaryActionButton } = props;
5
+ const { primaryActionButton, secondaryActionButton, agreement } = props;
5
6
  const hasPrimaryAction = primaryActionButton?.text != null && primaryActionButton.text.length > 0;
6
7
  const hasSecondaryAction = secondaryActionButton?.text != null && secondaryActionButton.text.length > 0;
7
8
  const hasDefaultActions = hasPrimaryAction || hasSecondaryAction;
8
- if (!hasDefaultActions) return null;
9
- return <view className="doubao-template-action-bar">
9
+ if (!hasDefaultActions) return agreement ? <Agreement {...agreement}/> : null;
10
+ const actionBar = <view className="doubao-template-action-bar">
10
11
  {hasSecondaryAction && <Button className="doubao-template-action-bar__action" type="default" disabled={secondaryActionButton.disabled} loading={secondaryActionButton.loading} throttle={secondaryActionButton.throttle} text={secondaryActionButton.text} onClick={secondaryActionButton.onClick}/>}
11
12
  {hasPrimaryAction && <Button className="doubao-template-action-bar__action" type="primary" disabled={primaryActionButton.disabled} loading={primaryActionButton.loading} throttle={primaryActionButton.throttle} text={primaryActionButton.text} onClick={primaryActionButton.onClick}/>}
12
13
  </view>;
14
+ if (!agreement) return actionBar;
15
+ return <>
16
+ {actionBar}
17
+ <Agreement {...agreement}/>
18
+ </>;
13
19
  }
14
20
  export { TemplateCardFooter };
@@ -4,10 +4,18 @@ import './styles.scss';
4
4
  export interface TemplateCardHeaderProps {
5
5
  /** 标题栏右侧操作文案。 */
6
6
  actionText?: string;
7
+ /** 标题栏右侧的静态警告状态文案;传入时优先于 actionText 展示。 */
8
+ statusText?: string;
7
9
  /** 是否展示标题栏右侧操作;默认根据 actionText 是否存在决定。 */
8
10
  showAction?: boolean;
9
11
  /** 点击标题栏右侧操作时触发。 */
10
12
  onActionClick?: (event: TouchEvent) => void;
11
13
  }
12
- export declare function TemplateCardHeader(props: TemplateCardHeaderProps): ReactElement;
14
+ interface TemplateCardHeaderRenderProps extends TemplateCardHeaderProps {
15
+ variant?: 'default' | 'floating';
16
+ title?: string;
17
+ iconSrc?: string;
18
+ }
19
+ export declare function TemplateCardHeader(props: TemplateCardHeaderRenderProps): ReactElement;
20
+ export {};
13
21
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { clsx } from "clsx";
1
2
  import { getAppInfo } from "../../utils/app-info.js";
2
3
  import { TemplateChevronRightIcon } from "../chevron-right-icon/index.js";
3
4
  import "./styles.css";
@@ -6,16 +7,22 @@ function TemplateCardHeaderIcon({ appIconSrc }) {
6
7
  return <view className="doubao-template-title-bar__app-icon"/>;
7
8
  }
8
9
  function TemplateCardHeader(props) {
9
- const { actionText, showAction = true, onActionClick } = props;
10
+ const { variant = 'default', title, iconSrc, actionText, statusText, showAction = true, onActionClick } = props;
10
11
  const appInfo = getAppInfo();
11
- const hasAction = showAction && null != actionText && actionText.length > 0;
12
- return <view className="doubao-template-title-bar">
12
+ const hasStatus = 'default' === variant && null != statusText && statusText.length > 0;
13
+ const hasAction = !hasStatus && showAction && null != actionText && actionText.length > 0;
14
+ return <view className={clsx('doubao-template-title-bar', 'floating' === variant && 'doubao-template-title-bar--floating')}>
13
15
  <view className="doubao-template-title-bar__app">
14
- <TemplateCardHeaderIcon appIconSrc={appInfo.appIconSrc}/>
16
+ <TemplateCardHeaderIcon appIconSrc={iconSrc ?? appInfo.appIconSrc}/>
15
17
  <text className="doubao-template-title-bar__app-name" text-maxline="1">
16
- {appInfo.appName}
18
+ {title ?? appInfo.appName}
17
19
  </text>
18
20
  </view>
21
+ {hasStatus && <view className="doubao-template-title-bar__status">
22
+ <text className="doubao-template-title-bar__status-text" text-maxline="1">
23
+ {statusText}
24
+ </text>
25
+ </view>}
19
26
  {hasAction && <view className="doubao-template-title-bar__more" catchtap={onActionClick}>
20
27
  <text className="doubao-template-title-bar__more-text" text-maxline="1">
21
28
  {actionText}
@@ -1 +1 @@
1
- .doubao-template-title-bar{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:40px;padding:12px;box-sizing:border-box;border-bottom:.5px solid var(--neutral-transparent-1)}.doubao-template-title-bar__app{display:flex;flex-direction:row;align-items:center}.doubao-template-title-bar__app-icon{width:16px;height:16px;flex-shrink:0;overflow:hidden;border-radius:4px}.doubao-template-title-bar__app-name,.doubao-template-title-bar__more-text{overflow:hidden;color:var(--neutral-50);font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.doubao-template-title-bar__app-name{margin-left:6px;font-weight:500}.doubao-template-title-bar__more{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;flex-shrink:0;min-width:62.5px}.doubao-template-title-bar__more-text{font-weight:400}.doubao-template-title-bar__more-chevron{width:12px;height:12px;flex-shrink:0;margin-left:2px}
1
+ .doubao-template-title-bar{display:flex;flex-direction:row;align-items:center;justify-content:space-between;width:100%;height:40px;padding:12px;box-sizing:border-box;border-bottom:1px solid var(--neutral-transparent-1)}.doubao-template-title-bar--floating{position:absolute;z-index:1;top:8px;left:8px;width:auto;max-width:calc(100% - 16px);height:auto;padding:6px 8px;border:0;border-radius:8px;background:var(--bg-base-1);box-shadow:0 4px 10px rgba(0,0,0,.04)}.doubao-template-title-bar__app{display:flex;flex-direction:row;align-items:center;min-width:0}.doubao-template-title-bar__app-icon{width:16px;height:16px;flex-shrink:0;overflow:hidden;border-radius:4px}.doubao-template-title-bar__app-name,.doubao-template-title-bar__more-text{overflow:hidden;color:var(--neutral-50);font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;line-height:18px;text-overflow:ellipsis;white-space:nowrap}.doubao-template-title-bar__app-name{margin-left:6px;font-weight:500}.doubao-template-title-bar__more{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;flex-shrink:0;min-width:62.5px}.doubao-template-title-bar__status{display:flex;align-items:center;flex-shrink:0;max-width:50%;height:24px;padding:5px 8px;box-sizing:border-box;overflow:hidden;border-radius:12px;background-color:#fff3e6}.doubao-template-title-bar__status-text{overflow:hidden;color:#e66805;font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;font-weight:500;line-height:14px;text-overflow:ellipsis;white-space:nowrap}.doubao-template-title-bar__more-text{font-weight:400}.doubao-template-title-bar__more-chevron{width:12px;height:12px;flex-shrink:0;margin-left:2px}.doubao-theme-dark .doubao-template-title-bar__status{background-color:#523e23}.doubao-theme-dark .doubao-template-title-bar__status-text{color:var(--warning-500)}
@@ -1 +1 @@
1
- .doubao-template-info-section{display:flex;flex-direction:column;width:100%;padding:12px;box-sizing:border-box;border-top:.5px solid var(--neutral-transparent-1)}.doubao-template-info-section__info{display:flex;flex-direction:column;width:100%}.doubao-template-info-section__info-row{display:flex;flex-direction:row;align-items:flex-start;width:100%}.doubao-template-info-section__info-row+.doubao-template-info-section__info-row{margin-top:8px}.doubao-template-info-section__info-label-wrap{display:flex;flex:0 0 66px;flex-direction:row;align-items:center;width:66px;overflow:hidden}.doubao-template-info-section__info-label,.doubao-template-info-section__info-value,.doubao-template-info-section__fee,.doubao-template-info-section__total-label,.doubao-template-info-section__total-price{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-info-section__info-label{width:100%;max-width:100%;min-width:0;color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-info-section__info-value-wrap{display:flex;flex:1 1 0;flex-direction:row;align-items:center;justify-content:flex-end;min-width:0;overflow:hidden}.doubao-template-info-section__info-value{min-width:0;margin-left:6px;color:var(--neutral-70);font-size:13px;font-weight:400;line-height:20px;text-align:right}.doubao-template-info-section__info-value:first-child{margin-left:0}.doubao-template-info-section--value-column .doubao-template-info-section__info-value-wrap{flex-direction:column;align-items:flex-end}.doubao-template-info-section--value-column .doubao-template-info-section__info-value{max-width:100%;margin-left:0}.doubao-template-info-section__summary{display:flex;flex-direction:row;justify-content:flex-end;width:100%;margin-top:8px}.doubao-template-info-section__summary-content{display:flex;flex:1 1 0;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:flex-end;gap:0 6px;max-width:100%;max-height:42px;min-width:0;overflow:hidden}.doubao-template-info-section__fees{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;gap:0 6px;max-width:100%;min-width:0;overflow:hidden}.doubao-template-info-section__fee{flex:0 1 auto;max-width:100%;min-width:0;color:var(--neutral-70);font-size:13px;font-weight:400;line-height:20px}.doubao-template-info-section__total{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;justify-content:flex-end;max-width:100%;min-width:0;overflow:hidden}.doubao-template-info-section__total-label{flex:0 1 auto;max-width:100%;min-width:0;color:var(--neutral-100);font-size:13px;font-weight:500;line-height:20px}.doubao-template-info-section__total-price{flex:0 1 auto;max-width:100%;min-width:0;margin-left:2px;color:var(--neutral-100);font-size:15px;font-weight:500;line-height:22px}
1
+ .doubao-template-info-section{display:flex;flex-direction:column;width:100%;padding:12px;box-sizing:border-box;border-top:1px solid var(--neutral-transparent-1)}.doubao-template-info-section__info{display:flex;flex-direction:column;width:100%}.doubao-template-info-section__info-row{display:flex;flex-direction:row;align-items:flex-start;width:100%}.doubao-template-info-section__info-row+.doubao-template-info-section__info-row{margin-top:8px}.doubao-template-info-section__info-label-wrap{display:flex;flex:0 0 66px;flex-direction:row;align-items:center;width:66px;overflow:hidden}.doubao-template-info-section__info-label,.doubao-template-info-section__info-value,.doubao-template-info-section__fee,.doubao-template-info-section__total-label,.doubao-template-info-section__total-price{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-info-section__info-label{width:100%;max-width:100%;min-width:0;color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-info-section__info-value-wrap{display:flex;flex:1 1 0;flex-direction:row;align-items:center;justify-content:flex-end;min-width:0;overflow:hidden}.doubao-template-info-section__info-value{min-width:0;margin-left:6px;color:var(--neutral-70);font-size:13px;font-weight:400;line-height:20px;text-align:right}.doubao-template-info-section__info-value:first-child{margin-left:0}.doubao-template-info-section--value-column .doubao-template-info-section__info-value-wrap{flex-direction:column;align-items:flex-end}.doubao-template-info-section--value-column .doubao-template-info-section__info-value{max-width:100%;margin-left:0}.doubao-template-info-section__summary{display:flex;flex-direction:row;justify-content:flex-end;width:100%;margin-top:8px}.doubao-template-info-section__summary-content{display:flex;flex:1 1 0;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:flex-end;gap:0 6px;max-width:100%;max-height:42px;min-width:0;overflow:hidden}.doubao-template-info-section__fees{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;gap:0 6px;max-width:100%;min-width:0;overflow:hidden}.doubao-template-info-section__fee{flex:0 1 auto;max-width:100%;min-width:0;color:var(--neutral-70);font-size:13px;font-weight:400;line-height:20px}.doubao-template-info-section__total{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;justify-content:flex-end;max-width:100%;min-width:0;overflow:hidden}.doubao-template-info-section__total-label{flex:0 1 auto;max-width:100%;min-width:0;color:var(--neutral-100);font-size:13px;font-weight:500;line-height:20px}.doubao-template-info-section__total-price{flex:0 1 auto;max-width:100%;min-width:0;margin-left:2px;color:var(--neutral-100);font-size:15px;font-weight:500;line-height:22px}
@@ -36,11 +36,12 @@ function renderTemplateTransportSummaryTextField(content, wrapperClassName, text
36
36
  }
37
37
  function renderTemplateTransportSummaryPriceAction(actionText, actionTone, showActionIcon, isDark) {
38
38
  if (isTemplateTransportSummaryTextEmpty(actionText)) return null;
39
+ const actionColor = 'highlight' === actionTone ? isDark ? '#3385ff' : '#0066ff' : isDark ? '#bababa' : '#666666';
39
40
  return <view className="doubao-template-transport-summary__price-action">
40
41
  <text className={clsx('doubao-template-transport-summary__price-action-text', `doubao-template-transport-summary__price-action-text--${actionTone}`)} text-maxline="1">
41
42
  {actionText}
42
43
  </text>
43
- {showActionIcon ? <TemplateChevronRightIcon className="doubao-template-transport-summary__price-action-icon" color={'highlight' === actionTone ? '#ff375f' : isDark ? '#bababa' : '#666666'}/> : null}
44
+ {showActionIcon ? <TemplateChevronRightIcon className="doubao-template-transport-summary__price-action-icon" color={actionColor}/> : null}
44
45
  </view>;
45
46
  }
46
47
  function renderTemplateTransportSummaryPrice(price, tag, actionText, actionTone, showActionIcon, loading, tagTone, isDark, onPriceClick) {
@@ -1 +1 @@
1
- .doubao-template-transport-summary{position:relative;display:flex;flex-direction:column;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box;padding:12px 12px 16px}.doubao-template-transport-summary__price-extra{position:relative;display:flex;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content--loading{visibility:hidden}.doubao-template-transport-summary__price-extra-loading-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:flex-end}.doubao-template-transport-summary__price-extra-loading{position:relative;width:16px;height:16px;flex-shrink:0}.doubao-template-transport-summary__price-extra-loading-spoke{position:absolute;top:1.333px;left:7.167px;width:1.667px;height:4.167px;border-radius:999px;transform-origin:50% 6.667px;animation:doubao-template-price-extra-loading-fade 1s linear infinite}.doubao-template-transport-summary__price-extra-loading--highlight .doubao-template-transport-summary__price-extra-loading-spoke,.doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#ff375f}.doubao-template-transport-summary__price-extra-loading--muted .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--neutral-70)}.doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#666}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#ff5c7c}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#bababa}.doubao-template-transport-summary__price-extra-loading-spoke--0{transform:rotate(0deg);animation-delay:0s}.doubao-template-transport-summary__price-extra-loading-spoke--1{transform:rotate(45deg);animation-delay:-0.125s}.doubao-template-transport-summary__price-extra-loading-spoke--2{transform:rotate(90deg);animation-delay:-0.25s}.doubao-template-transport-summary__price-extra-loading-spoke--3{transform:rotate(135deg);animation-delay:-0.375s}.doubao-template-transport-summary__price-extra-loading-spoke--4{transform:rotate(180deg);animation-delay:-0.5s}.doubao-template-transport-summary__price-extra-loading-spoke--5{transform:rotate(225deg);animation-delay:-0.625s}.doubao-template-transport-summary__price-extra-loading-spoke--6{transform:rotate(270deg);animation-delay:-0.75s}.doubao-template-transport-summary__price-extra-loading-spoke--7{transform:rotate(315deg);animation-delay:-0.875s}.doubao-template-transport-summary__route-hit-area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.doubao-template-transport-summary__title,.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub,.doubao-template-transport-summary__transfer-label,.doubao-template-transport-summary__price{display:flex;flex-direction:row;align-items:center;min-width:0;overflow:hidden;flex-shrink:0}.doubao-template-transport-summary__title{height:20px;max-width:100%;box-sizing:border-box}.doubao-template-transport-summary__title-text,.doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__arrival-day-offset-text,.doubao-template-transport-summary__route-point-sub-text,.doubao-template-transport-summary__transfer-label-text{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__title-text{color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-transport-summary__route-row{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;justify-content:space-between;width:100%;height:46px;min-width:0;margin-top:2px;overflow:hidden}.doubao-template-transport-summary__route-point{display:flex;flex-shrink:0;flex-direction:column;justify-content:center;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__route-point--arrival{align-items:flex-end}.doubao-template-transport-summary__arrival{position:relative;display:flex;flex-shrink:0;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__arrival .doubao-template-transport-summary__route-point{width:100%;height:42px}.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub{width:100%}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub{justify-content:flex-end}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub-text{text-align:right}.doubao-template-transport-summary__route-point-main{height:22px}.doubao-template-transport-summary__route-point-sub{height:16px;margin-top:2px}.doubao-template-transport-summary__route-point-main-text{min-width:0;color:var(--neutral-100);font-family:"SF Pro",sans-serif;font-size:17px;font-weight:600;line-height:22px}.doubao-template-transport-summary__arrival-day-offset{position:absolute;top:2px;left:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;height:14px}.doubao-template-transport-summary__arrival-day-offset-text{color:var(--neutral-100);font-size:10px;font-weight:400;line-height:normal}.doubao-template-transport-summary__route-point-sub-text{color:var(--neutral-70);font-size:12px;font-weight:400;line-height:16px}.doubao-template-transport-summary__transfer-label-text{color:var(--neutral-50);font-size:10px;font-weight:400;line-height:14px}.doubao-template-transport-summary__transfer{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:center;width:56px;min-width:0;height:42px;box-sizing:border-box}.doubao-template-transport-summary__transfer-inner{display:flex;flex-direction:column;align-items:center;justify-content:center;width:56px;min-width:0;height:38px}.doubao-template-transport-summary__transfer-label{height:14px}.doubao-template-transport-summary__transfer-arrow{display:flex;flex-direction:row;align-items:center;justify-content:center;width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__transfer-arrow-icon{width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__price{position:relative;z-index:2;flex:0 0 88px;flex-direction:column;align-items:flex-end;justify-content:center;width:88px;height:42px;box-sizing:border-box}.doubao-template-transport-summary__price>.doubao-price{justify-content:flex-end;width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__amount,.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group,.doubao-template-transport-summary__price .doubao-price__integer{flex-shrink:1}.doubao-template-transport-summary__price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-template-transport-summary__price--with-action{gap:1px;height:39px}.doubao-template-transport-summary__price-action{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0;height:16px;overflow:hidden}.doubao-template-transport-summary__price-action-text{min-width:0;overflow:hidden;font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__price-action-text--highlight{color:#ff375f}.doubao-template-transport-summary__price-action-text--muted{color:var(--neutral-70)}.doubao-template-transport-summary__price-action-icon{width:10px;height:10px;margin-right:-3px;flex-shrink:0;opacity:.34}.doubao-template-transport-summary__price--with-tag{gap:4px;height:46px}@keyframes doubao-template-price-extra-loading-fade{0%{opacity:1}100%{opacity:.2}}
1
+ .doubao-template-transport-summary{position:relative;display:flex;flex-direction:column;justify-content:flex-start;width:100%;min-width:0;box-sizing:border-box;padding:12px 12px 16px}.doubao-template-transport-summary__price-extra{position:relative;display:flex;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0}.doubao-template-transport-summary__price-extra-content--loading{visibility:hidden}.doubao-template-transport-summary__price-extra-loading-overlay{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:flex-end}.doubao-template-transport-summary__price-extra-loading{position:relative;width:16px;height:16px;flex-shrink:0}.doubao-template-transport-summary__price-extra-loading-spoke{position:absolute;top:1.333px;left:7.167px;width:1.667px;height:4.167px;border-radius:999px;transform-origin:50% 6.667px;animation:doubao-template-price-extra-loading-fade 1s linear infinite}.doubao-template-transport-summary__price-extra-loading--highlight .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--theme-default-link)}.doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#e66805}.doubao-template-transport-summary__price-extra-loading--muted .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--neutral-70)}.doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#666}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-marketing .doubao-template-transport-summary__price-extra-loading-spoke{background-color:var(--warning-500)}.doubao-theme-dark .doubao-template-transport-summary__price-extra-loading--tag-neutral .doubao-template-transport-summary__price-extra-loading-spoke{background-color:#bababa}.doubao-template-transport-summary__price-extra-loading-spoke--0{transform:rotate(0deg);animation-delay:0s}.doubao-template-transport-summary__price-extra-loading-spoke--1{transform:rotate(45deg);animation-delay:-0.125s}.doubao-template-transport-summary__price-extra-loading-spoke--2{transform:rotate(90deg);animation-delay:-0.25s}.doubao-template-transport-summary__price-extra-loading-spoke--3{transform:rotate(135deg);animation-delay:-0.375s}.doubao-template-transport-summary__price-extra-loading-spoke--4{transform:rotate(180deg);animation-delay:-0.5s}.doubao-template-transport-summary__price-extra-loading-spoke--5{transform:rotate(225deg);animation-delay:-0.625s}.doubao-template-transport-summary__price-extra-loading-spoke--6{transform:rotate(270deg);animation-delay:-0.75s}.doubao-template-transport-summary__price-extra-loading-spoke--7{transform:rotate(315deg);animation-delay:-0.875s}.doubao-template-transport-summary__route-hit-area{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1}.doubao-template-transport-summary__title,.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub,.doubao-template-transport-summary__transfer-label,.doubao-template-transport-summary__price{display:flex;flex-direction:row;align-items:center;min-width:0;overflow:hidden;flex-shrink:0}.doubao-template-transport-summary__title{height:20px;max-width:100%;box-sizing:border-box}.doubao-template-transport-summary__title-text,.doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__arrival-day-offset-text,.doubao-template-transport-summary__route-point-sub-text,.doubao-template-transport-summary__transfer-label-text{overflow:hidden;font-family:"PingFang SC",sans-serif;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__title-text{color:var(--neutral-100);font-size:13px;font-weight:400;line-height:20px}.doubao-template-transport-summary__route-row{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;align-content:flex-start;justify-content:space-between;width:100%;height:46px;min-width:0;margin-top:2px;overflow:hidden}.doubao-template-transport-summary__route-point{display:flex;flex-shrink:0;flex-direction:column;justify-content:center;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__route-point--arrival{align-items:flex-end}.doubao-template-transport-summary__arrival{position:relative;display:flex;flex-shrink:0;width:66px;min-width:0;height:42px}.doubao-template-transport-summary__arrival .doubao-template-transport-summary__route-point{width:100%;height:42px}.doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point-sub{width:100%}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub{justify-content:flex-end}.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-main-text,.doubao-template-transport-summary__route-point--arrival .doubao-template-transport-summary__route-point-sub-text{text-align:right}.doubao-template-transport-summary__route-point-main{height:22px}.doubao-template-transport-summary__route-point-sub{height:16px;margin-top:2px}.doubao-template-transport-summary__route-point-main-text{min-width:0;color:var(--neutral-100);font-family:"SF Pro",sans-serif;font-size:17px;font-weight:600;line-height:22px}.doubao-template-transport-summary__arrival-day-offset{position:absolute;top:2px;left:100%;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;height:14px}.doubao-template-transport-summary__arrival-day-offset-text{color:var(--neutral-100);font-size:10px;font-weight:400;line-height:normal}.doubao-template-transport-summary__route-point-sub-text{color:var(--neutral-70);font-size:12px;font-weight:400;line-height:16px}.doubao-template-transport-summary__transfer-label-text{color:var(--neutral-50);font-size:10px;font-weight:400;line-height:14px}.doubao-template-transport-summary__transfer{display:flex;flex:none;flex-direction:row;align-items:center;justify-content:center;width:56px;min-width:0;height:42px;box-sizing:border-box}.doubao-template-transport-summary__transfer-inner{display:flex;flex-direction:column;align-items:center;justify-content:center;width:56px;min-width:0;height:38px}.doubao-template-transport-summary__transfer-label{height:14px}.doubao-template-transport-summary__transfer-arrow{display:flex;flex-direction:row;align-items:center;justify-content:center;width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__transfer-arrow-icon{width:36px;height:6px;flex-shrink:0}.doubao-template-transport-summary__price{position:relative;z-index:2;flex:0 0 88px;flex-direction:column;align-items:flex-end;justify-content:center;width:88px;height:42px;box-sizing:border-box}.doubao-template-transport-summary__price>.doubao-price{justify-content:flex-end;width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__amount,.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-template-transport-summary__price .doubao-price__main,.doubao-template-transport-summary__price .doubao-price__integer-group,.doubao-template-transport-summary__price .doubao-price__integer{flex-shrink:1}.doubao-template-transport-summary__price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-template-transport-summary__price--with-action{gap:1px;height:39px}.doubao-template-transport-summary__price-action{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:100%;min-width:0;height:16px;overflow:hidden}.doubao-template-transport-summary__price-action-text{min-width:0;overflow:hidden;font-family:"PingFang SC",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:16px;text-align:right;text-overflow:ellipsis;white-space:nowrap}.doubao-template-transport-summary__price-action-text--highlight{color:var(--theme-default-link)}.doubao-template-transport-summary__price-action-text--muted{color:var(--neutral-70)}.doubao-template-transport-summary__price-action-icon{width:10px;height:10px;margin-right:-3px;flex-shrink:0;opacity:.34}.doubao-template-transport-summary__price--with-tag{gap:4px;height:46px}@keyframes doubao-template-price-extra-loading-fade{0%{opacity:1}100%{opacity:.2}}
@@ -24,10 +24,23 @@ export interface CompositeCardOptionGroupSection {
24
24
  /** 选项组模块配置。 */
25
25
  props: OptionGroupProps;
26
26
  }
27
- export type CompositeCardSection = CompositeCardTransitSection | CompositeCardContentSection | CompositeCardOptionGroupSection;
27
+ export interface CompositeCardCustomSection {
28
+ /** 由业务维护的内容区,仍由组合卡管理外壳与标准操作区。 */
29
+ type: 'custom';
30
+ content: ReactElement;
31
+ }
32
+ export interface CompositeCardHeaderProps extends TemplateCardHeaderProps {
33
+ /** 浮层模式覆盖在首个内容区左上角;默认保持独立标题栏。 */
34
+ placement?: 'default' | 'floating';
35
+ /** 浮层品牌名称,不传时使用应用插件名称。 */
36
+ title?: string;
37
+ /** 浮层品牌图标,不传时使用应用插件图标。 */
38
+ iconSrc?: string;
39
+ }
40
+ export type CompositeCardSection = CompositeCardTransitSection | CompositeCardContentSection | CompositeCardOptionGroupSection | CompositeCardCustomSection;
28
41
  export interface CompositeCardProps {
29
42
  /** 标题栏配置。 */
30
- header?: TemplateCardHeaderProps;
43
+ header?: CompositeCardHeaderProps;
31
44
  /** 按顺序展示的卡片模块。 */
32
45
  sections: CompositeCardSection[];
33
46
  /** 底部操作区配置。 */
@@ -14,6 +14,8 @@ function isCompositeCardSectionVisible(section) {
14
14
  return (section.props.items?.length ?? 0) > 0;
15
15
  case 'option-group':
16
16
  return section.props.items.length > 0;
17
+ case 'custom':
18
+ return null != section.content;
17
19
  default:
18
20
  return false;
19
21
  }
@@ -28,6 +30,8 @@ function renderCompositeCardSectionContent(section) {
28
30
  return <view className="doubao-composite-card__option-group">
29
31
  <OptionGroup {...section.props}/>
30
32
  </view>;
33
+ case 'custom':
34
+ return section.content;
31
35
  default:
32
36
  return null;
33
37
  }
@@ -42,12 +46,13 @@ function CompositeCard(props) {
42
46
  const { header, sections, footer, onClick } = props;
43
47
  const cardStyle = useHostCardStyle();
44
48
  const visibleSections = sections.filter(isCompositeCardSectionVisible);
49
+ const floatingHeader = header?.placement === 'floating';
45
50
  return <view className={useThemeClassName('doubao-composite-card')} style={cardStyle} bindtap={onClick}>
46
- <TemplateCardHeader actionText={header?.actionText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
51
+ <TemplateCardHeader variant={floatingHeader ? 'floating' : 'default'} title={floatingHeader ? header?.title : void 0} iconSrc={floatingHeader ? header?.iconSrc : void 0} actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
47
52
  {visibleSections.length > 0 && <view className="doubao-composite-card__sections">
48
53
  {visibleSections.map(renderCompositeCardSection)}
49
54
  </view>}
50
- <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton}/>
55
+ <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement}/>
51
56
  </view>;
52
57
  }
53
58
  export { CompositeCard };
@@ -1 +1 @@
1
- .doubao-composite-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-composite-card__sections{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.doubao-composite-card__section{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.doubao-composite-card__option-group{width:100%;min-width:0;padding:0 12px 16px;box-sizing:border-box}
1
+ .doubao-composite-card{display:flex;flex-direction:column;align-items:stretch;width:100%;position:relative;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-composite-card__sections{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.doubao-composite-card__section{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box}.doubao-composite-card__option-group{width:100%;min-width:0;padding:0 12px 16px;box-sizing:border-box}
@@ -68,9 +68,9 @@ function ContentCard(props) {
68
68
  const { header, items, footer, onClick } = props;
69
69
  const cardStyle = useHostCardStyle();
70
70
  return <view className={useThemeClassName('doubao-content-card')} style={cardStyle} bindtap={onClick} clip-radius="true">
71
- <TemplateCardHeader actionText={header?.actionText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
71
+ <TemplateCardHeader actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
72
72
  <ContentCardContent items={items}/>
73
- <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton}/>
73
+ <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement}/>
74
74
  </view>;
75
75
  }
76
76
  export { ContentCard, ContentCardContent };
@@ -1 +1 @@
1
- .doubao-content-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-content-card__body{width:100%;box-sizing:border-box}.doubao-content-card__item{position:relative;width:100%;padding:12px;box-sizing:border-box}.doubao-content-card__item--without-thumbnail{padding-top:16px;padding-bottom:16px}.doubao-content-card__item::after{position:absolute;right:0;bottom:0;left:104px;height:.5px;content:"";background-color:var(--neutral-transparent-1)}.doubao-content-card__item--without-thumbnail::after{left:12px}.doubao-content-card__item--last::after{display:none}.doubao-content-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;min-width:0}.doubao-content-card__main{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:12px;min-width:0}.doubao-content-card__thumbnail{align-self:flex-start;width:80px;height:80px;flex-shrink:0;overflow:hidden;background-color:var(--bg-base-1-overlay);border-radius:5px}.doubao-content-card__thumbnail-image{width:100%;height:100%}.doubao-content-card__text{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}.doubao-content-card__title{width:100%;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__title-custom,.doubao-content-card__subtitle-custom,.doubao-content-card__description-custom{display:flex;flex-direction:row;align-items:center;width:100%;max-width:100%;overflow:hidden}.doubao-content-card__secondary,.doubao-content-card__tertiary{display:flex;flex-direction:row;align-items:center;width:100%;min-width:0;overflow:hidden}.doubao-content-card__subtitle,.doubao-content-card__description{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__item-action{display:flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__content{align-items:flex-start}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__item-action{height:80px}.doubao-content-card__item-action-button{width:auto;min-width:60px;max-width:100px}.doubao-content-card__item-action-switch{flex-shrink:0}.doubao-content-card__item-action-playback{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px}.doubao-content-card__item-action-playback--disabled{opacity:.4}.doubao-content-card__item-action-playback-icon{width:32px;height:32px}
1
+ .doubao-content-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-content-card__body{width:100%;box-sizing:border-box}.doubao-content-card__item{position:relative;width:100%;padding:12px;box-sizing:border-box}.doubao-content-card__item--without-thumbnail{padding-top:16px;padding-bottom:16px}.doubao-content-card__item::after{position:absolute;right:0;bottom:0;left:104px;height:1px;content:"";background-color:var(--neutral-transparent-1)}.doubao-content-card__item--without-thumbnail::after{left:12px}.doubao-content-card__item--last::after{display:none}.doubao-content-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;min-width:0}.doubao-content-card__main{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:12px;min-width:0}.doubao-content-card__thumbnail{align-self:flex-start;width:80px;height:80px;flex-shrink:0;overflow:hidden;background-color:var(--bg-base-1-overlay);border-radius:5px}.doubao-content-card__thumbnail-image{width:100%;height:100%}.doubao-content-card__text{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}.doubao-content-card__title{width:100%;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__title-custom,.doubao-content-card__subtitle-custom,.doubao-content-card__description-custom{display:flex;flex-direction:row;align-items:center;width:100%;max-width:100%;overflow:hidden}.doubao-content-card__secondary,.doubao-content-card__tertiary{display:flex;flex-direction:row;align-items:center;width:100%;min-width:0;overflow:hidden}.doubao-content-card__subtitle,.doubao-content-card__description{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-content-card__item-action{display:flex;flex-shrink:0;flex-direction:row;align-items:center;justify-content:center}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__content{align-items:flex-start}.doubao-content-card__item:not(.doubao-content-card__item--without-thumbnail) .doubao-content-card__item-action{height:80px}.doubao-content-card__item-action-button{width:auto;min-width:60px;max-width:100px}.doubao-content-card__item-action-switch{flex-shrink:0}.doubao-content-card__item-action-playback{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:32px;height:32px}.doubao-content-card__item-action-playback--disabled{opacity:.4}.doubao-content-card__item-action-playback-icon{width:32px;height:32px}
@@ -1 +1 @@
1
- .doubao-coupon-card{width:100%;min-width:0;box-sizing:border-box}.doubao-coupon-card--single{max-width:400px}.doubao-coupon-card--double{max-width:408px}.doubao-coupon-card__items{display:flex;flex-direction:row;align-items:stretch;gap:8px;width:100%;box-sizing:border-box}.doubao-coupon-card__item{position:relative;display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:4px;min-width:0;height:80px;padding:0 12px 0 8px;box-sizing:border-box;overflow:hidden;background-color:#fff3ee;border:.5px solid #fae5dc;border-radius:10px}.doubao-coupon-card__item--disabled{opacity:.5}.doubao-coupon-card__item--pressed::after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";pointer-events:none;background-color:var(--neutral-transparent-1)}.doubao-coupon-card__content{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:4px;min-width:0}.doubao-coupon-card__value-area{display:flex;align-items:center;justify-content:center;width:74px;height:74px;flex-shrink:0;overflow:hidden}.doubao-coupon-card__prize{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:100%;min-width:0}.doubao-coupon-card__amount{display:flex;flex-direction:row;align-items:flex-end;justify-content:center;gap:1px;max-width:100%;height:22px}.doubao-coupon-card__value,.doubao-coupon-card__unit,.doubao-coupon-card__condition,.doubao-coupon-card__source,.doubao-coupon-card__title,.doubao-coupon-card__validity,.doubao-coupon-card__compact-source{display:block;min-width:0;overflow:hidden;font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-style:normal;white-space:nowrap;text-overflow:ellipsis}.doubao-coupon-card__value{flex-shrink:1;color:#ff375f;font-family:"SF Pro",sans-serif;font-size:24px;font-weight:600;line-height:24px;letter-spacing:-0.48px}.doubao-coupon-card__unit{flex-shrink:0;color:#ff375f;font-size:11px;font-weight:600;line-height:17px}.doubao-coupon-card__condition,.doubao-coupon-card__compact-source{max-width:100%;color:#ff375f;font-size:11px;font-weight:400;line-height:17px;letter-spacing:-0.22px;text-align:center}.doubao-coupon-card__info{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:8px;min-width:0}.doubao-coupon-card__divider-slot{position:relative;width:0;height:26px;flex-shrink:0}.doubao-coupon-card__divider{position:absolute;top:12.5px;left:-13px;width:26px;height:1px;transform:rotate(90deg)}.doubao-coupon-card__details{display:flex;flex:1 1 0;flex-direction:column;gap:4px;min-width:0}.doubao-coupon-card__heading{display:flex;flex-direction:row;align-items:center;gap:6px;width:100%;min-width:0;height:21px;overflow:hidden}.doubao-coupon-card__source,.doubao-coupon-card__title{flex:0 1 auto;color:var(--neutral-100);font-size:15px;font-weight:500;line-height:21px}.doubao-coupon-card__title-separator{width:.6px;height:9.6px;flex-shrink:0}.doubao-coupon-card__validity{width:100%;color:var(--neutral-80-transparent);font-size:11px;font-weight:400;line-height:15px;letter-spacing:-0.22px}.doubao-coupon-card__compact-info{display:flex;flex:1 1 0;flex-direction:column;align-items:center;justify-content:center;min-width:0;overflow:hidden}.doubao-coupon-card__compact-source{color:var(--neutral-50)}.doubao-coupon-card__action.doubao-button{width:auto;min-width:60px;max-width:100px;height:28px;padding:0 12px;flex-shrink:0;background-color:rgba(0,0,0,0);border:.5px solid var(--neutral-transparent-2);border-radius:40px}.doubao-coupon-card__action.doubao-button .doubao-button-text{min-width:0;flex-shrink:1;overflow:hidden;color:var(--neutral-100);font-size:12px;font-weight:500;line-height:17px;text-overflow:ellipsis}.doubao-coupon-card--double .doubao-coupon-card__item{gap:8px;max-width:200px}.doubao-coupon-card--double .doubao-coupon-card__amount,.doubao-coupon-card--multiple .doubao-coupon-card__amount{height:18px}.doubao-coupon-card--double .doubao-coupon-card__value,.doubao-coupon-card--multiple .doubao-coupon-card__value{line-height:18px}.doubao-coupon-card__scroll{width:100%;height:112px}.doubao-coupon-card--multiple .doubao-coupon-card__items{gap:4px}.doubao-coupon-card--multiple .doubao-coupon-card__item{flex:1 0 0;flex-direction:column;justify-content:center;gap:8px;min-width:96px;max-width:150px;height:112px;padding:16px 4px 8px;border-color:#fae6dd}.doubao-coupon-card--multiple .doubao-coupon-card__compact-info{flex:0 1 auto;width:100%}.doubao-coupon-card--multiple .doubao-coupon-card__action.doubao-button{max-width:100%;height:24px}.doubao-coupon-card.doubao-theme-dark .doubao-coupon-card__item{background-color:var(--bg-base-2-overlay);border-color:var(--neutral-transparent-2)}
1
+ .doubao-coupon-card{width:100%;min-width:0;box-sizing:border-box}.doubao-coupon-card--single{max-width:400px}.doubao-coupon-card--double{max-width:408px}.doubao-coupon-card__items{display:flex;flex-direction:row;align-items:stretch;gap:8px;width:100%;box-sizing:border-box}.doubao-coupon-card__item{position:relative;display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:4px;min-width:0;height:80px;padding:0 12px 0 8px;box-sizing:border-box;overflow:hidden;background-color:#fff3ee;border:.5px solid #fae5dc}.doubao-coupon-card__item--disabled{opacity:.5}.doubao-coupon-card__item--pressed::after{position:absolute;top:0;right:0;bottom:0;left:0;content:"";pointer-events:none;background-color:var(--neutral-transparent-1)}.doubao-coupon-card__content{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:4px;min-width:0}.doubao-coupon-card__value-area{display:flex;align-items:center;justify-content:center;width:74px;height:74px;flex-shrink:0;overflow:hidden}.doubao-coupon-card__prize{display:flex;flex-direction:column;align-items:center;gap:4px;max-width:100%;min-width:0}.doubao-coupon-card__amount{display:flex;flex-direction:row;align-items:flex-end;justify-content:center;gap:1px;max-width:100%;height:22px}.doubao-coupon-card__value,.doubao-coupon-card__unit,.doubao-coupon-card__condition,.doubao-coupon-card__source,.doubao-coupon-card__title,.doubao-coupon-card__validity,.doubao-coupon-card__compact-source{display:block;min-width:0;overflow:hidden;font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-style:normal;white-space:nowrap;text-overflow:ellipsis}.doubao-coupon-card__value{flex-shrink:1;color:#ff375f;font-family:"SF Pro",sans-serif;font-size:24px;font-weight:600;line-height:24px;letter-spacing:-0.48px}.doubao-coupon-card__unit{flex-shrink:0;color:#ff375f;font-size:11px;font-weight:600;line-height:17px}.doubao-coupon-card__condition,.doubao-coupon-card__compact-source{max-width:100%;color:#ff375f;font-size:11px;font-weight:400;line-height:17px;letter-spacing:-0.22px;text-align:center}.doubao-coupon-card__info{display:flex;flex:1 1 0;flex-direction:row;align-items:center;gap:8px;min-width:0}.doubao-coupon-card__divider-slot{position:relative;width:0;height:26px;flex-shrink:0}.doubao-coupon-card__divider{position:absolute;top:12.5px;left:-13px;width:26px;height:1px;transform:rotate(90deg)}.doubao-coupon-card__details{display:flex;flex:1 1 0;flex-direction:column;gap:4px;min-width:0}.doubao-coupon-card__heading{display:flex;flex-direction:row;align-items:center;gap:6px;width:100%;min-width:0;height:21px;overflow:hidden}.doubao-coupon-card__source,.doubao-coupon-card__title{flex:0 1 auto;color:var(--neutral-100);font-size:15px;font-weight:500;line-height:21px}.doubao-coupon-card__title-separator{width:.6px;height:9.6px;flex-shrink:0}.doubao-coupon-card__validity{width:100%;color:var(--neutral-80-transparent);font-size:11px;font-weight:400;line-height:15px;letter-spacing:-0.22px}.doubao-coupon-card__compact-info{display:flex;flex:1 1 0;flex-direction:column;align-items:center;justify-content:center;min-width:0;overflow:hidden}.doubao-coupon-card__compact-source{color:var(--neutral-50)}.doubao-coupon-card__action.doubao-button{width:auto;min-width:60px;max-width:100px;height:28px;padding:0 12px;flex-shrink:0;background-color:rgba(0,0,0,0);border:.5px solid var(--neutral-transparent-2);border-radius:40px}.doubao-coupon-card__action.doubao-button .doubao-button-text{min-width:0;flex-shrink:1;overflow:hidden;color:var(--neutral-100);font-size:12px;font-weight:500;line-height:17px;text-overflow:ellipsis}.doubao-coupon-card--double .doubao-coupon-card__item{gap:8px;max-width:200px}.doubao-coupon-card--double .doubao-coupon-card__amount,.doubao-coupon-card--multiple .doubao-coupon-card__amount{height:18px}.doubao-coupon-card--double .doubao-coupon-card__value,.doubao-coupon-card--multiple .doubao-coupon-card__value{line-height:18px}.doubao-coupon-card__scroll{width:100%;height:112px}.doubao-coupon-card--multiple .doubao-coupon-card__items{gap:4px}.doubao-coupon-card--multiple .doubao-coupon-card__item{flex:1 0 0;flex-direction:column;justify-content:center;gap:8px;min-width:96px;max-width:150px;height:112px;padding:16px 4px 8px;border-color:#fae6dd}.doubao-coupon-card--multiple .doubao-coupon-card__compact-info{flex:0 1 auto;width:100%}.doubao-coupon-card--multiple .doubao-coupon-card__action.doubao-button{max-width:100%;height:24px}.doubao-coupon-card.doubao-theme-dark .doubao-coupon-card__item{background-color:var(--bg-base-2-overlay);border-color:var(--neutral-transparent-2)}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { ContentCard, type ContentCardItem, type ContentCardProps } from './content-card/index.js';
2
2
  export { CouponCard, type CouponCardItem, type CouponCardProps } from './coupon-card/index.js';
3
- export { CompositeCard, type CompositeCardContentSection, type CompositeCardOptionGroupSection, type CompositeCardProps, type CompositeCardSection, type CompositeCardTransitSection } from './composite-card/index.js';
3
+ export { CompositeCard, type CompositeCardContentSection, type CompositeCardOptionGroupSection, type CompositeCardCustomSection, type CompositeCardHeaderProps, type CompositeCardProps, type CompositeCardSection, type CompositeCardTransitSection } from './composite-card/index.js';
4
4
  export type { TemplateCardHeaderProps } from './components/header/index.js';
5
5
  export type { TemplateCardFooterActionButton, TemplateCardFooterProps } from './components/footer/index.js';
6
6
  export type { TemplateExtraAction, TemplateExtraActionAdd, TemplateExtraActionButton, TemplateExtraActionPlayback, TemplateExtraActionStepper, TemplateExtraActionSwitch } from './components/extra-action/index.js';
@@ -10,7 +10,7 @@ export interface MapCardMetaItem {
10
10
  key?: TemplateKey;
11
11
  /** 辅助信息文案。 */
12
12
  text: TemplateText;
13
- /** 文案色调。@defaultValue default */
13
+ /** 文案色调。highlight 为豆包蓝。@defaultValue default */
14
14
  tone?: MapCardMetaTone;
15
15
  }
16
16
  export interface MapCardProps {
@@ -38,7 +38,7 @@ function MapCardImpl(props, ref) {
38
38
  </view> : null}
39
39
  </view> : null}
40
40
 
41
- <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton}/>
41
+ <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement}/>
42
42
  </view>;
43
43
  }
44
44
  const MapCard = forwardRef(MapCardImpl);
@@ -1 +1 @@
1
- .doubao-map-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-map-card__viewport{position:relative;width:100%;height:168px;flex-shrink:0;box-sizing:border-box;overflow:hidden;border:1px solid var(--bg-base-2-overlay)}.doubao-map-card__map{width:100%;height:100%}.doubao-map-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;padding:12px;box-sizing:border-box;border-radius:8px}.doubao-map-card__text-content{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;overflow:hidden}.doubao-map-card__meta{display:flex;flex-direction:row;align-items:center;width:100%;height:22px;flex-shrink:0;min-width:0;overflow:hidden}.doubao-map-card__meta-entry{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;min-width:0;overflow:hidden}.doubao-map-card__meta-separator{margin:0 4px;flex-shrink:0;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-weight:400;line-height:1.5}.doubao-map-card__meta-text{min-width:0;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.doubao-map-card__meta-text--highlight{color:#ff375f}.doubao-map-card__inline-actions{display:flex;flex-shrink:0;flex-direction:row;align-items:center;gap:8px}.doubao-map-card__inline-action{width:auto;min-width:60px;max-width:100px}
1
+ .doubao-map-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-map-card__viewport{position:relative;width:100%;height:168px;flex-shrink:0;box-sizing:border-box;overflow:hidden;border:1px solid var(--bg-base-2-overlay)}.doubao-map-card__map{width:100%;height:100%}.doubao-map-card__content{display:flex;flex-direction:row;align-items:center;gap:12px;width:100%;padding:12px;box-sizing:border-box;border-radius:8px}.doubao-map-card__text-content{display:flex;flex:1 1 0;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;overflow:hidden}.doubao-map-card__meta{display:flex;flex-direction:row;align-items:center;width:100%;height:22px;flex-shrink:0;min-width:0;overflow:hidden}.doubao-map-card__meta-entry{display:flex;flex:0 1 auto;flex-direction:row;align-items:center;min-width:0;overflow:hidden}.doubao-map-card__meta-separator{margin:0 4px;flex-shrink:0;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-weight:400;line-height:1.5}.doubao-map-card__meta-text{min-width:0;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:1.5;text-overflow:ellipsis;white-space:nowrap}.doubao-map-card__meta-text--highlight{color:var(--theme-default-link)}.doubao-map-card__inline-actions{display:flex;flex-shrink:0;flex-direction:row;align-items:center;gap:8px}.doubao-map-card__inline-action{width:auto;min-width:60px;max-width:100px}
@@ -2,6 +2,7 @@ import type { TouchEvent } from '@lynx-js/types';
2
2
  import type { ReactElement } from 'react';
3
3
  import { type TemplateCardFooterProps } from '../components/footer/index.js';
4
4
  import { type TemplateCardHeaderProps } from '../components/header/index.js';
5
+ import { type CheckboxProps } from '../primitives/checkbox/index.js';
5
6
  import type { TemplateKey, TemplateText } from '../types.js';
6
7
  import './styles.scss';
7
8
  export interface PriceActionCardProps {
@@ -25,6 +26,8 @@ export interface PriceActionCardItem {
25
26
  infoRows?: PriceActionCardInfoRow[];
26
27
  /** 右侧操作按钮文案;不传或传空字符串时不展示。 */
27
28
  actionText?: string;
29
+ /** 右侧勾选框配置;配置后替换操作按钮。 */
30
+ checkbox?: CheckboxProps;
28
31
  /** 点击列表项时触发。 */
29
32
  onClick?: (event: TouchEvent) => void;
30
33
  /** 点击列表项右侧操作按钮时触发。 */
@@ -2,6 +2,7 @@ import { Button, useThemeClassName } from "@byted-doubao-apps/components";
2
2
  import { clsx } from "clsx";
3
3
  import { TemplateCardFooter } from "../components/footer/index.js";
4
4
  import { TemplateCardHeader } from "../components/header/index.js";
5
+ import { Checkbox } from "../primitives/checkbox/index.js";
5
6
  import { Price } from "../primitives/price/index.js";
6
7
  import { useHostCardStyle } from "../utils/use-host-card-style.js";
7
8
  import "./styles.css";
@@ -20,7 +21,7 @@ function PriceActionCardItemView({ item, isLast }) {
20
21
  const hasBadge = !isPriceActionCardTextEmpty(item.badgeText);
21
22
  const hasAction = null != item.actionText && item.actionText.length > 0;
22
23
  const infoRows = (item.infoRows ?? []).filter((infoRow)=>!isPriceActionCardTextEmpty(infoRow.text)).slice(0, PRICE_ACTION_CARD_INFO_ROW_LIMIT);
23
- return <view className={clsx('doubao-price-action-card__item', isLast && 'doubao-price-action-card__item--last')} {...null != item.onClick ? {
24
+ return <view className={clsx('doubao-price-action-card__item', isLast && 'doubao-price-action-card__item--last', null != item.checkbox && 'doubao-price-action-card__item--checkbox')} {...null != item.onClick ? {
24
25
  catchtap: item.onClick
25
26
  } : {}}>
26
27
  <view className="doubao-price-action-card__item-content">
@@ -35,7 +36,7 @@ function PriceActionCardItemView({ item, isLast }) {
35
36
  {infoRow.text}
36
37
  </text>)}
37
38
  </view>
38
- {hasAction && <Button className="doubao-price-action-card__item-action" type="default" text={item.actionText} onClick={item.onActionClick}/>}
39
+ {null != item.checkbox ? <Checkbox {...item.checkbox}/> : hasAction ? <Button className="doubao-price-action-card__item-action" type="default" text={item.actionText} onClick={item.onActionClick}/> : null}
39
40
  </view>
40
41
  </view>;
41
42
  }
@@ -43,13 +44,13 @@ function PriceActionCard(props) {
43
44
  const { header, items = [], footer, onClick } = props;
44
45
  const cardStyle = useHostCardStyle();
45
46
  return <view className={useThemeClassName('doubao-price-action-card')} style={cardStyle} bindtap={onClick} clip-radius="true">
46
- <TemplateCardHeader actionText={header?.actionText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
47
+ <TemplateCardHeader actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
47
48
  <view className="doubao-price-action-card__body">
48
49
  <view className="doubao-price-action-card__default">
49
50
  {items.map((item, index)=><PriceActionCardItemView item={item} isLast={index === items.length - 1} key={item.key ?? index}/>)}
50
51
  </view>
51
52
  </view>
52
- <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton}/>
53
+ <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement}/>
53
54
  </view>;
54
55
  }
55
56
  export { PriceActionCard };
@@ -1 +1 @@
1
- .doubao-price-action-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-price-action-card__body{width:100%;box-sizing:border-box}.doubao-price-action-card__default{width:100%;box-sizing:border-box}.doubao-price-action-card__item{position:relative;display:flex;flex-direction:row;align-items:center;width:100%;height:82px;padding:20px 12px;box-sizing:border-box}.doubao-price-action-card__item::after{position:absolute;right:0;bottom:0;left:95px;height:.5px;content:"";background-color:var(--neutral-transparent-1)}.doubao-price-action-card__item--last::after{display:none}.doubao-price-action-card__item-content{display:flex;flex-direction:row;align-items:center;width:100%;gap:12px}.doubao-price-action-card__value{display:flex;flex-direction:column;align-items:flex-start;padding:0 4px;width:94px;min-width:0;flex-shrink:0}.doubao-price-action-card__value>.doubao-price{width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__amount,.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group,.doubao-price-action-card__value>.doubao-price .doubao-price__integer{flex-shrink:1}.doubao-price-action-card__value>.doubao-price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-price-action-card__badge{height:20px;max-width:100%;padding:2px 3px;box-sizing:border-box;overflow:hidden;color:var(--pink-500);font-family:"PingFang SC",sans-serif;font-size:11px;font-style:normal;font-weight:400;line-height:14px;text-overflow:ellipsis;white-space:nowrap;background-color:var(--pink-trans-6);border-radius:4px}.doubao-price-action-card__info{display:flex;flex:1 1 0;flex-direction:column;justify-content:center;min-width:0}.doubao-price-action-card__info-row{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-price-action-card__info-row+.doubao-price-action-card__info-row{margin-top:2px}.doubao-price-action-card__item-action{width:auto;min-width:60px;max-width:100px;height:38px;flex-shrink:0;--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 38px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 14px;--doubao-button-default-line-height: 20px;--doubao-button-default-bg: var(--bg-base-1-overlay);--doubao-button-default-text: var(--neutral-100)}
1
+ .doubao-price-action-card{display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-price-action-card__body{width:100%;box-sizing:border-box}.doubao-price-action-card__default{width:100%;box-sizing:border-box}.doubao-price-action-card__item{position:relative;display:flex;flex-direction:row;align-items:center;width:100%;height:82px;padding:20px 12px;box-sizing:border-box}.doubao-price-action-card__item::after{position:absolute;right:0;bottom:0;left:95px;height:1px;content:"";background-color:var(--neutral-transparent-1)}.doubao-price-action-card__item--last::after{display:none}.doubao-price-action-card__item--checkbox{height:74px;padding:16px 12px}.doubao-price-action-card__item--checkbox .doubao-price-action-card__value{width:75px;box-sizing:border-box}.doubao-price-action-card__item-content{display:flex;flex-direction:row;align-items:center;width:100%;gap:12px}.doubao-price-action-card__value{display:flex;flex-direction:column;align-items:flex-start;padding:0 4px;width:94px;min-width:0;flex-shrink:0}.doubao-price-action-card__value>.doubao-price{width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__amount,.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group{max-width:100%;min-width:0;overflow:hidden}.doubao-price-action-card__value>.doubao-price .doubao-price__main,.doubao-price-action-card__value>.doubao-price .doubao-price__integer-group,.doubao-price-action-card__value>.doubao-price .doubao-price__integer{flex-shrink:1}.doubao-price-action-card__value>.doubao-price .doubao-price__integer{min-width:0;overflow:hidden;text-overflow:ellipsis}.doubao-price-action-card__badge{height:20px;max-width:100%;padding:2px 3px;box-sizing:border-box;overflow:hidden;color:var(--theme-default-link);font-family:"PingFang SC",sans-serif;font-size:11px;font-style:normal;font-weight:400;line-height:14px;text-overflow:ellipsis;white-space:nowrap;background-color:var(--primary-transparent-1);border-radius:4px}.doubao-price-action-card__info{display:flex;flex:1 1 0;flex-direction:column;justify-content:center;min-width:0}.doubao-price-action-card__info-row{width:100%;overflow:hidden;color:var(--neutral-70);font-family:"PingFang SC",sans-serif;font-size:13px;font-style:normal;font-weight:400;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.doubao-price-action-card__info-row+.doubao-price-action-card__info-row{margin-top:2px}.doubao-price-action-card__item-action{width:auto;min-width:60px;max-width:100px;height:38px;flex-shrink:0;--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 38px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 14px;--doubao-button-default-line-height: 20px;--doubao-button-default-bg: var(--bg-base-1-overlay);--doubao-button-default-text: var(--neutral-100)}
@@ -0,0 +1,5 @@
1
+ import type { AgreementProps } from './types.js';
2
+ import './styles.scss';
3
+ export type { AgreementLink, AgreementProps } from './types.js';
4
+ export declare function Agreement({ text, links }: AgreementProps): any;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,18 @@
1
+ import { useThemeClassName } from "@byted-doubao-apps/components";
2
+ import "./styles.css";
3
+ function Agreement({ text: text1 = '点击下单代表同意', links }) {
4
+ const className = useThemeClassName('doubao-agreement');
5
+ const visibleLinks = links.filter((link)=>'' !== link.text);
6
+ if (0 === visibleLinks.length) return null;
7
+ return <view className={className} catchtap={()=>{}}>
8
+ <text className="doubao-agreement__text" text-maxline="2">
9
+ {text1}
10
+ {'' !== text1 && ' '}
11
+ {visibleLinks.map((link, index)=><text className="doubao-agreement__link" key={link.key ?? index} bindtap={link.onClick}>
12
+ {index > 0 ? '、' : ''}
13
+ {link.text}
14
+ </text>)}
15
+ </text>
16
+ </view>;
17
+ }
18
+ export { Agreement };
@@ -0,0 +1 @@
1
+ .doubao-agreement{display:flex;flex-direction:column;align-items:center;width:100%;padding:0 12px 14px;box-sizing:border-box;background-color:var(--bg-base-1)}.doubao-agreement__text,.doubao-agreement__link{font-family:"PingFang SC",sans-serif;font-size:13px;font-weight:400;font-style:normal;line-height:20px}.doubao-agreement__text{max-width:100%;overflow:hidden;color:var(--neutral-70);text-overflow:ellipsis}.doubao-agreement__link{color:var(--neutral-100)}
@@ -0,0 +1,17 @@
1
+ import type { TouchEvent } from '@lynx-js/types';
2
+ import type { TemplateKey, TemplateText } from '../../types.js';
3
+ export interface AgreementLink {
4
+ /** 唯一标识;不传时使用数组下标。 */
5
+ key?: TemplateKey;
6
+ /** 协议名称。 */
7
+ text: TemplateText;
8
+ /** 点击协议时触发;跳转由业务处理。 */
9
+ onClick?: (event: TouchEvent) => void;
10
+ }
11
+ export interface AgreementProps {
12
+ /** 协议前的说明文案。@defaultValue 点击下单代表同意 */
13
+ text?: TemplateText;
14
+ /** 协议列表,按顺序展示,以顿号分隔。 */
15
+ links: AgreementLink[];
16
+ }
17
+ //# sourceMappingURL=types.d.ts.map
File without changes
@@ -0,0 +1,5 @@
1
+ import type { CheckboxProps } from './types.js';
2
+ import './styles.scss';
3
+ export type { CheckboxProps } from './types.js';
4
+ export declare function Checkbox({ checked, disabled, onChange }: CheckboxProps): any;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ import { useThemeClassName } from "@byted-doubao-apps/components";
2
+ import { clsx } from "clsx";
3
+ import "./styles.css";
4
+ const CHECKMARK_CONTENT = '<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.94847 5.29293C10.1552 4.98835 10.5696 4.90868 10.8743 5.1152C11.1786 5.32194 11.2584 5.73643 11.052 6.04098L7.885 10.708C7.76885 10.879 7.57965 10.9866 7.37328 10.999C7.16695 11.0113 6.96606 10.9273 6.83031 10.7714L4.9973 8.66305C4.7557 8.38525 4.78496 7.96424 5.06273 7.72262C5.34052 7.48102 5.76153 7.51031 6.00316 7.78805L7.26683 9.24215L9.94847 5.29293Z" fill="white"/></svg>';
5
+ function Checkbox({ checked, disabled = false, onChange }) {
6
+ const themeClassName = useThemeClassName();
7
+ const handleTap = (event)=>{
8
+ if (!disabled) onChange?.(!checked, event);
9
+ };
10
+ return <view className={clsx('doubao-checkbox', themeClassName, {
11
+ 'doubao-checkbox--checked': checked,
12
+ 'doubao-checkbox--disabled': disabled
13
+ })} accessibility-element accessibility-label={checked ? '已选中' : '未选中'} catchtap={handleTap}>
14
+ {checked && <svg className="doubao-checkbox__checkmark" content={CHECKMARK_CONTENT}/>}
15
+ </view>;
16
+ }
17
+ export { Checkbox };
@@ -0,0 +1 @@
1
+ .doubao-checkbox{display:flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;box-sizing:border-box;border-radius:10px;border:1.33333px solid var(--neutral-transparent-3)}.doubao-checkbox--disabled{background:var(--neutral-10)}.doubao-checkbox--checked{border:none;background:var(--primary-50)}.doubao-checkbox--checked.doubao-checkbox--disabled{opacity:.4}.doubao-checkbox__checkmark{width:20px;height:20px;flex-shrink:0}
@@ -0,0 +1,10 @@
1
+ import type { TouchEvent } from '@lynx-js/types';
2
+ export interface CheckboxProps {
3
+ /** 是否选中;由业务根据 onChange 更新。 */
4
+ checked: boolean;
5
+ /** 是否禁用。@defaultValue false */
6
+ disabled?: boolean;
7
+ /** 点击后返回下一次选中状态;禁用时不触发。 */
8
+ onChange?: (checked: boolean, event: TouchEvent) => void;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
File without changes
@@ -1,7 +1,9 @@
1
+ export { Agreement, type AgreementLink, type AgreementProps } from './agreement/index.js';
2
+ export { Checkbox, type CheckboxProps } from './checkbox/index.js';
1
3
  export { Icon, type IconName, type IconProps } from './icon/index.js';
2
4
  export { OptionGroup, type OptionGroupItem, type OptionGroupLargeItem, type OptionGroupMediumItem, type OptionGroupProps, type OptionGroupSize, type OptionGroupText, type OptionGroupValue } from './option-group/index.js';
3
5
  export { Price, type PricePrefixTone, type PriceProps, type PriceTone, type PriceValue } from './price/index.js';
4
6
  export { Stepper, type StepperProps } from './stepper/index.js';
5
7
  export { Tag, type TagProps, type TagTone, type TagValue } from './tag/index.js';
6
- export { Title, type TitleMaxLines, type TitleProps, type TitleValue } from './title/index.js';
8
+ export { Title, type TitleMaxLines, type TitleProps, type TitleSegment, type TitleTone, type TitleValue } from './title/index.js';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +1,5 @@
1
+ export { Agreement } from "./agreement/index.js";
2
+ export { Checkbox } from "./checkbox/index.js";
1
3
  export { Icon } from "./icon/index.js";
2
4
  export { OptionGroup } from "./option-group/index.js";
3
5
  export { Price } from "./price/index.js";
@@ -1 +1 @@
1
- .doubao-price{display:flex;flex-direction:row;align-items:flex-end;gap:4px;height:22px;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal;white-space:nowrap}.doubao-price--tone-highlight .doubao-price__prefix,.doubao-price--tone-highlight .doubao-price__currency,.doubao-price--tone-highlight .doubao-price__integer,.doubao-price--tone-highlight .doubao-price__decimal,.doubao-price--tone-highlight .doubao-price__suffix{color:#ff375f}.doubao-price--loading{align-items:center;width:100%}.doubao-price__amount{display:flex;flex-direction:row;align-items:flex-end;gap:2px;height:22px;flex-shrink:0}.doubao-price__affix,.doubao-price__meta{display:flex;flex-direction:row;align-items:center;gap:4px;height:19px;flex-shrink:0}.doubao-price__main{display:flex;flex-direction:row;align-items:flex-end;height:22px;flex-shrink:0}.doubao-price__integer-group{display:flex;flex-direction:row;align-items:center;height:22px;flex-shrink:0}.doubao-price__decimal-group{display:flex;align-items:center;height:21px;flex-shrink:0}.doubao-price__prefix,.doubao-price__currency,.doubao-price__integer,.doubao-price__decimal,.doubao-price__suffix,.doubao-price__description,.doubao-price__original-price{display:block;flex-shrink:0;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal;letter-spacing:0;white-space:nowrap}.doubao-price__prefix{font-size:12px;font-weight:500;line-height:11px}.doubao-price__prefix.doubao-price__prefix--tone-default{color:var(--neutral-100)}.doubao-price__prefix.doubao-price__prefix--tone-highlight{color:#ff375f}.doubao-price__prefix.doubao-price__prefix--tone-muted{color:var(--neutral-70)}.doubao-price__currency{font-size:13px;font-weight:500;line-height:11px}.doubao-price__integer{font-family:"SF Pro",sans-serif;font-size:17px;font-weight:500;line-height:24px}.doubao-price__decimal{font-family:"SF Pro",sans-serif;font-size:14px;font-weight:500;line-height:11px}.doubao-price__suffix,.doubao-price__description,.doubao-price__original-price{font-size:13px;font-weight:400;line-height:11px}.doubao-price__description,.doubao-price__original-price{color:var(--neutral-70)}.doubao-price__original-price{text-decoration:line-through}.doubao-price__placeholder{width:100%;max-width:60%;height:16px;border-radius:4px;background-image:linear-gradient(90deg, #f7f7f7 0%, #e6e6e6 30%, #f7f7f7 100%);background-size:200% 100%;animation:doubao-price-placeholder-shimmer 1.4s ease-in-out infinite}@keyframes doubao-price-placeholder-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
1
+ .doubao-price{display:flex;flex-direction:row;align-items:flex-end;gap:4px;height:22px;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal;white-space:nowrap}.doubao-price--tone-highlight .doubao-price__prefix,.doubao-price--tone-highlight .doubao-price__currency,.doubao-price--tone-highlight .doubao-price__integer,.doubao-price--tone-highlight .doubao-price__decimal,.doubao-price--tone-highlight .doubao-price__suffix{color:var(--theme-default-link)}.doubao-price--loading{align-items:center;width:100%}.doubao-price__amount{display:flex;flex-direction:row;align-items:flex-end;gap:2px;height:22px;flex-shrink:0}.doubao-price__affix,.doubao-price__meta{display:flex;flex-direction:row;align-items:center;gap:4px;height:19px;flex-shrink:0}.doubao-price__main{display:flex;flex-direction:row;align-items:flex-end;height:22px;flex-shrink:0}.doubao-price__integer-group{display:flex;flex-direction:row;align-items:center;height:22px;flex-shrink:0}.doubao-price__decimal-group{display:flex;align-items:center;height:21px;flex-shrink:0}.doubao-price__prefix,.doubao-price__currency,.doubao-price__integer,.doubao-price__decimal,.doubao-price__suffix,.doubao-price__description,.doubao-price__original-price{display:block;flex-shrink:0;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal;letter-spacing:0;white-space:nowrap}.doubao-price__prefix{font-size:12px;font-weight:500;line-height:11px}.doubao-price__prefix.doubao-price__prefix--tone-default{color:var(--neutral-100)}.doubao-price__prefix.doubao-price__prefix--tone-highlight{color:var(--theme-default-link)}.doubao-price__prefix.doubao-price__prefix--tone-muted{color:var(--neutral-70)}.doubao-price__currency{font-size:13px;font-weight:500;line-height:11px}.doubao-price__integer{font-family:"SF Pro",sans-serif;font-size:17px;font-weight:500;line-height:24px}.doubao-price__decimal{font-family:"SF Pro",sans-serif;font-size:14px;font-weight:500;line-height:11px}.doubao-price__suffix,.doubao-price__description,.doubao-price__original-price{font-size:13px;font-weight:400;line-height:11px}.doubao-price__description,.doubao-price__original-price{color:var(--neutral-70)}.doubao-price__original-price{text-decoration:line-through}.doubao-price__placeholder{width:100%;max-width:60%;height:16px;border-radius:4px;background-image:linear-gradient(90deg, #f7f7f7 0%, #e6e6e6 30%, #f7f7f7 100%);background-size:200% 100%;animation:doubao-price-placeholder-shimmer 1.4s ease-in-out infinite}@keyframes doubao-price-placeholder-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
@@ -8,7 +8,7 @@ export interface PriceProps {
8
8
  currency?: string;
9
9
  /** 价格前缀,例如“均”“起”。 */
10
10
  prefix?: string;
11
- /** 价格前缀色调。不传时跟随价格色调。 */
11
+ /** 价格前缀色调。不传时跟随价格色调;muted 为次级灰色。 */
12
12
  prefixTone?: PricePrefixTone;
13
13
  /** 价格后缀,例如“券后价”“/10斤”。 */
14
14
  suffix?: string;
@@ -16,7 +16,7 @@ export interface PriceProps {
16
16
  description?: string;
17
17
  /** 原价。传入后会在辅助信息区域以删除线展示。 */
18
18
  originalPrice?: PriceValue;
19
- /** 价格色调。highlight 对应营销强调色。@defaultValue 'default' */
19
+ /** 价格色调。highlight 对应豆包蓝。@defaultValue 'default' */
20
20
  tone?: PriceTone;
21
21
  /** 是否展示价格占位骨架。@defaultValue false */
22
22
  loading?: boolean;
@@ -1,9 +1,10 @@
1
1
  import { useThemeClassName } from "@byted-doubao-apps/components";
2
2
  import { clsx } from "clsx";
3
3
  import "./styles.css";
4
- function Tag({ text: text1, tone = 'authority' }) {
4
+ function Tag({ text: text1, tone = 'neutral' }) {
5
5
  const themedClassName = useThemeClassName();
6
- return <view className={clsx('doubao-tag', `doubao-tag--tone-${tone}`, themedClassName)}>
6
+ const visualTone = 'authority' === tone ? 'neutral' : tone;
7
+ return <view className={clsx('doubao-tag', `doubao-tag--tone-${visualTone}`, themedClassName)}>
7
8
  <text className="doubao-tag__text">{text1}</text>
8
9
  </view>;
9
10
  }
@@ -1 +1 @@
1
- .doubao-tag{display:flex;align-items:center;height:20px;padding:2px 3px;box-sizing:border-box;flex-shrink:0;overflow:hidden;border-radius:4px}.doubao-tag__text{display:block;flex-shrink:0;font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:14px;white-space:nowrap}.doubao-tag--tone-marketing{background-color:#fff3ee}.doubao-tag--tone-marketing .doubao-tag__text{color:#ff375f}.doubao-tag--tone-authority{background-color:#fff8e7}.doubao-tag--tone-authority .doubao-tag__text{color:#814300}.doubao-tag--tone-neutral{background-color:#f7f7f7}.doubao-tag--tone-neutral .doubao-tag__text{color:#666}.doubao-tag.doubao-theme-dark.doubao-tag--tone-marketing{background-color:#3f2b27}.doubao-tag.doubao-theme-dark.doubao-tag--tone-marketing .doubao-tag__text{color:#ff5c7c}.doubao-tag.doubao-theme-dark.doubao-tag--tone-authority{background-color:#3a3324}.doubao-tag.doubao-theme-dark.doubao-tag--tone-authority .doubao-tag__text{color:#e2a45c}.doubao-tag.doubao-theme-dark.doubao-tag--tone-neutral{background-color:#252525}.doubao-tag.doubao-theme-dark.doubao-tag--tone-neutral .doubao-tag__text{color:#bababa}
1
+ .doubao-tag{display:flex;align-items:center;height:20px;padding:2px 3px;box-sizing:border-box;flex-shrink:0;overflow:hidden;border-radius:4px}.doubao-tag__text{display:block;flex-shrink:0;font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:14px;white-space:nowrap}.doubao-tag--tone-marketing{background-color:#fff3e6}.doubao-tag--tone-marketing .doubao-tag__text{color:#e66805}.doubao-tag--tone-neutral{background-color:#f7f7f7}.doubao-tag--tone-neutral .doubao-tag__text{color:#666}.doubao-tag.doubao-theme-dark.doubao-tag--tone-marketing{background-color:#523e23}.doubao-tag.doubao-theme-dark.doubao-tag--tone-marketing .doubao-tag__text{color:var(--warning-500)}.doubao-tag.doubao-theme-dark.doubao-tag--tone-neutral{background-color:#252525}.doubao-tag.doubao-theme-dark.doubao-tag--tone-neutral .doubao-tag__text{color:#bababa}
@@ -1,9 +1,12 @@
1
1
  export type TagValue = string | number;
2
- export type TagTone = 'marketing' | 'authority' | 'neutral';
2
+ /** @deprecated 使用 neutral;authority 仅保留兼容,视觉与 neutral 相同。 */
3
+ type DeprecatedAuthorityTone = 'authority';
4
+ export type TagTone = 'marketing' | 'neutral' | DeprecatedAuthorityTone;
3
5
  export interface TagProps {
4
6
  /** 标签内容。 */
5
7
  text: TagValue;
6
- /** 标签色调。@defaultValue 'authority' */
8
+ /** 标签色调。authority 已废弃,视觉与 neutral 相同。@defaultValue 'neutral' */
7
9
  tone?: TagTone;
8
10
  }
11
+ export {};
9
12
  //# sourceMappingURL=types.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import type { TitleProps } from './types.js';
2
2
  import './styles.scss';
3
- export type { TitleMaxLines, TitleProps, TitleValue } from './types.js';
3
+ export type { TitleMaxLines, TitleProps, TitleSegment, TitleTone, TitleValue } from './types.js';
4
4
  export declare function Title({ text, maxLines, showArrow, loading }: TitleProps): any;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -14,7 +14,9 @@ function Title({ text: text1, maxLines = 1, showArrow = true, loading = false })
14
14
  {showArrow ? <TemplateChevronRightIcon className="doubao-title__arrow"/> : null}
15
15
  </view>
16
16
  </inline-truncation>
17
- {text1}
17
+ {'string' == typeof text1 || 'number' == typeof text1 ? text1 : text1.map((segment, index)=><text className={clsx('doubao-title__segment', `doubao-title__segment--tone-${segment.tone ?? 'default'}`)} key={index}>
18
+ {segment.text}
19
+ </text>)}
18
20
  {showArrow ? <view className="doubao-title__inline-arrow">
19
21
  <TemplateChevronRightIcon className="doubao-title__arrow"/>
20
22
  </view> : null}
@@ -1 +1 @@
1
- .doubao-title{display:flex;flex-direction:row;align-items:flex-start;width:100%;max-width:100%;min-width:0;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal}.doubao-title--loading{align-items:center;width:100%;height:24px}.doubao-title__text{display:block;flex:0 1 auto;width:100%;min-width:0;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:clip}.doubao-title__text>inline-truncation{overflow:visible;vertical-align:top}.doubao-title__inline-arrow{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:14px;height:24px;box-sizing:border-box;vertical-align:top}.doubao-title__truncation{position:relative;width:0;height:24px;overflow:visible;vertical-align:top}.doubao-title__truncation.doubao-title__inline-arrow{width:14px}.doubao-title__fade{position:absolute;top:2px;left:-22px;width:22px;height:19px;background-image:linear-gradient(90deg, transparent, var(--bg-base-1))}.doubao-title__arrow{width:12px;height:12px;flex-shrink:0}.doubao-title__placeholder{width:100%;max-width:40%;height:16px;border-radius:4px;background-image:linear-gradient(90deg, #f7f7f7 0%, #e6e6e6 30%, #f7f7f7 100%);background-size:200% 100%;animation:doubao-title-placeholder-shimmer 1.4s ease-in-out infinite}@keyframes doubao-title-placeholder-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
1
+ .doubao-title{display:flex;flex-direction:row;align-items:flex-start;width:100%;max-width:100%;min-width:0;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-style:normal}.doubao-title--loading{align-items:center;width:100%;height:24px}.doubao-title__text{display:block;flex:0 1 auto;width:100%;min-width:0;overflow:hidden;color:var(--neutral-100);font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:500;line-height:24px;text-overflow:clip}.doubao-title__segment{font-size:16px;font-style:normal;font-weight:500}.doubao-title__segment--tone-default{color:var(--neutral-100)}.doubao-title__segment--tone-highlight{color:var(--theme-default-link)}.doubao-title__text>inline-truncation{overflow:visible;vertical-align:top}.doubao-title__inline-arrow{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;width:14px;height:24px;box-sizing:border-box;vertical-align:top}.doubao-title__truncation{position:relative;width:0;height:24px;overflow:visible;vertical-align:top}.doubao-title__truncation.doubao-title__inline-arrow{width:14px}.doubao-title__fade{position:absolute;top:2px;left:-22px;width:22px;height:19px;background-image:linear-gradient(90deg, transparent, var(--bg-base-1))}.doubao-title__arrow{width:12px;height:12px;flex-shrink:0}.doubao-title__placeholder{width:100%;max-width:40%;height:16px;border-radius:4px;background-image:linear-gradient(90deg, #f7f7f7 0%, #e6e6e6 30%, #f7f7f7 100%);background-size:200% 100%;animation:doubao-title-placeholder-shimmer 1.4s ease-in-out infinite}@keyframes doubao-title-placeholder-shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
@@ -1,7 +1,13 @@
1
- export type TitleValue = string | number;
1
+ export type TitleTone = 'default' | 'highlight';
2
+ export interface TitleSegment {
3
+ text: string | number;
4
+ /** 片段颜色。highlight 对应豆包蓝。@defaultValue 'default' */
5
+ tone?: TitleTone;
6
+ }
7
+ export type TitleValue = string | number | readonly TitleSegment[];
2
8
  export type TitleMaxLines = 1 | 2;
3
9
  export interface TitleProps {
4
- /** 标题内容。 */
10
+ /** 标题内容。传片段数组时可分别指定高亮文字。 */
5
11
  text: TitleValue;
6
12
  /** 标题最多展示行数。@defaultValue 1 */
7
13
  maxLines?: TitleMaxLines;
@@ -64,7 +64,7 @@ export interface TransitCardPrice {
64
64
  export interface TransitCardPriceAction {
65
65
  /** 操作文案。 */
66
66
  text: TemplateText;
67
- /** 文案色调。@defaultValue highlight */
67
+ /** 文案色调。highlight 为豆包蓝,muted 为灰色。@defaultValue highlight */
68
68
  tone?: TransitCardPriceActionTone;
69
69
  /** 是否展示文案右侧箭头。@defaultValue true */
70
70
  showIcon?: boolean;
@@ -73,7 +73,7 @@ export type TransitCardPriceActionTone = 'highlight' | 'muted';
73
73
  export interface TransitCardTag {
74
74
  /** 标签内容。 */
75
75
  text: TagValue;
76
- /** 标签色调;marketing 为红色,neutral 为灰色,默认 marketing。 */
76
+ /** 标签色调;marketing 为橙色,neutral 为灰色,默认 marketing。 */
77
77
  tone?: 'marketing' | 'neutral';
78
78
  }
79
79
  export declare function TransitCard(props: TransitCardProps): ReactElement;
@@ -7,9 +7,9 @@ function TransitCard(props) {
7
7
  const { header, items = [], footer, onClick } = props;
8
8
  const cardStyle = useHostCardStyle();
9
9
  return <view className={useThemeClassName('doubao-transit-card')} style={cardStyle} bindtap={onClick}>
10
- <TemplateCardHeader actionText={header?.actionText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
10
+ <TemplateCardHeader actionText={header?.actionText} statusText={header?.statusText} showAction={header?.showAction} onActionClick={header?.onActionClick}/>
11
11
  <TransitCardContent items={items}/>
12
- <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton}/>
12
+ <TemplateCardFooter primaryActionButton={footer?.primaryActionButton} secondaryActionButton={footer?.secondaryActionButton} agreement={footer?.agreement}/>
13
13
  </view>;
14
14
  }
15
15
  export { TransitCard };
@@ -1 +1 @@
1
- .doubao-transit-card{--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 44px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 16px;--doubao-button-default-line-height: 22px;display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:8px}.doubao-transit-card__body{width:100%;box-sizing:border-box}.doubao-transit-card__item{width:100%;box-sizing:border-box}.doubao-transit-card__item--spread{height:.5px;margin-left:12px;width:calc(100% - 12px);background:var(--neutral-transparent-1)}.doubao-transit-card__item--last{border-bottom:none}.doubao-transit-card__view-more{width:100%;padding:8px 12px;box-sizing:border-box}.doubao-transit-card__view-more-button{width:100%;border-radius:8px;height:44px}
1
+ .doubao-transit-card{--doubao-button-border-radius: 8px;--doubao-button-default-border-radius: 8px;--doubao-button-default-height: 44px;--doubao-button-default-padding-x: 12px;--doubao-button-default-padding-y: 0;--doubao-button-default-font-size: 16px;--doubao-button-default-line-height: 22px;display:flex;flex-direction:column;align-items:stretch;width:100%;box-sizing:border-box;overflow:hidden;background-color:var(--bg-base-1);border:1px solid var(--bg-base-2-overlay);border-radius:12px}.doubao-transit-card__body{width:100%;box-sizing:border-box}.doubao-transit-card__item{width:100%;box-sizing:border-box}.doubao-transit-card__item--spread{height:1px;margin-left:12px;width:calc(100% - 12px);background:var(--neutral-transparent-1)}.doubao-transit-card__item--last{border-bottom:none}.doubao-transit-card__view-more{width:100%;padding:8px 12px;box-sizing:border-box}.doubao-transit-card__view-more-button{width:100%;border-radius:8px;height:44px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doubao-dev/template",
3
- "version": "0.7.1",
3
+ "version": "0.8.0-canary-99e80cd87-20261106061422",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {