"use client";
import type { ReactNode } from "react";
import { Truck, Van } from "@phosphor-icons/react";
import type { Priority1ShipmentType } from "@/workers/rpa/priority1/shipment-types";
interface FeatheryCardProps {
label: string;
description?: string;
selected: boolean;
disabled?: boolean;
onClick: () => void;
}
/** 仿 Priority1 Feathery 卡片:选中黑底白字 */
export function FeatheryCard({
label,
description,
selected,
disabled,
onClick,
}: FeatheryCardProps) {
return (
);
}
export function FeatheryCardGrid({
children,
cols = 3,
}: {
children: ReactNode;
cols?: 2 | 3;
}) {
return (
{children}
);
}
function ShipmentIcon({
type,
selected,
}: {
type: Priority1ShipmentType;
selected: boolean;
}) {
const color = selected ? "text-white" : "text-neutral-900";
const size = 48;
if (type === "expedited") {
return ;
}
return ;
}
/** Step1 运输类型三卡 — 对齐官网布局 */
export function ShipmentTypeCard({
title,
description,
type,
selected,
disabled,
onSelect,
}: {
title: string;
description: string;
type: Priority1ShipmentType;
selected: boolean;
disabled?: boolean;
onSelect: () => void;
}) {
return (
);
}
export function P1FieldLabel({
children,
required,
htmlFor,
}: {
children: ReactNode;
required?: boolean;
htmlFor?: string;
}) {
return (
);
}
export function P1SectionTitle({
step,
title,
}: {
step: 1 | 2;
title: string;
}) {
return (
);
}
/** Step 2 进度条 — 对齐官网「Step 2 of 2」黑条 */
export function P1Step2Progress({ label }: { label: string }) {
return (
);
}
/** 总重量输入 — 右侧「磅」后缀 */
export function P1WeightField({
id,
label,
required,
value,
disabled,
error,
unitLabel = "磅",
onChange,
}: {
id: string;
label: string;
required?: boolean;
value: string;
disabled?: boolean;
error?: string;
unitLabel?: string;
onChange: (v: string) => void;
}) {
return (
{label}
onChange(e.target.value)}
className={`h-11 min-w-0 flex-1 rounded-l-sm border border-r-0 bg-neutral-100 px-3 text-sm focus:border-neutral-600 focus:outline-none disabled:opacity-60 ${
error ? "border-red-500" : "border-neutral-400"
}`}
/>
{unitLabel}
{error ?
{error}
: null}
);
}
/** 官网黄色 GET INSTANT QUOTES 主按钮 */
export function P1InstantQuotesButton({
loading,
disabled,
children,
onClick,
type = "button",
className = "",
}: {
loading?: boolean;
disabled?: boolean;
children: ReactNode;
onClick?: () => void;
type?: "button" | "submit";
className?: string;
}) {
return (
);
}
/** @deprecated 使用 P1InstantQuotesButton */
export function P1SubmitButton({
loading,
disabled,
children,
onClick,
}: {
loading?: boolean;
disabled?: boolean;
children: ReactNode;
onClick?: () => void;
}) {
return (
{children}
);
}
/** Step1/2 底部固定 CTA 栏 */
export function P1StickyActionBar({
children,
hint,
}: {
children: ReactNode;
hint?: string;
}) {
return (
{children}
{hint ?? "填写完成后点击按钮进入下一步或提交询价"}
);
}