dishui 0.0.97 → 0.0.101

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 (74) hide show
  1. package/dist/.release-verified.json +2 -2
  2. package/dist/ai.js +17 -15
  3. package/dist/components/Card/Ticket.d.ts +52 -0
  4. package/dist/components/Card/Ticket2.js +218 -0
  5. package/dist/components/Card/Ticket2.js.map +1 -0
  6. package/dist/components/Card/index.d.ts +12 -0
  7. package/dist/components/Card/index.js +142 -139
  8. package/dist/components/Card/index.js.map +1 -1
  9. package/dist/components/ai/AgentRunCard/index.d.ts +38 -0
  10. package/dist/components/ai/AgentRunCard/index.js +100 -0
  11. package/dist/components/ai/AgentRunCard/index.js.map +1 -0
  12. package/dist/components/ai/IssueCard/index.d.ts +39 -0
  13. package/dist/components/ai/IssueCard/index.js +78 -0
  14. package/dist/components/ai/IssueCard/index.js.map +1 -0
  15. package/dist/components/ai/index.d.ts +4 -0
  16. package/dist/components/pro/Flow/constants.js +3 -3
  17. package/dist/components/pro/Flow/constants.js.map +1 -1
  18. package/dist/components/pro/Flow/nodes/shapes.js +3 -3
  19. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  20. package/dist/components/pro/Flow/utils/themeColor.d.ts +2 -2
  21. package/dist/components/pro/Flow/utils/themeColor.js +2 -2
  22. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
  23. package/dist/components/pro/Kanban/Kanban.d.ts +3 -0
  24. package/dist/components/pro/Kanban/Kanban.js +339 -0
  25. package/dist/components/pro/Kanban/Kanban.js.map +1 -0
  26. package/dist/components/pro/Kanban/Swimlanes.d.ts +3 -0
  27. package/dist/components/pro/Kanban/Swimlanes.js +60 -0
  28. package/dist/components/pro/Kanban/Swimlanes.js.map +1 -0
  29. package/dist/components/pro/Kanban/index.d.ts +5 -0
  30. package/dist/components/pro/Kanban/types.d.ts +103 -0
  31. package/dist/components/pro/Kanban/useKanbanDrag.d.ts +17 -0
  32. package/dist/components/pro/Kanban/useKanbanDrag.js +69 -0
  33. package/dist/components/pro/Kanban/useKanbanDrag.js.map +1 -0
  34. package/dist/components/pro/Kanban/utils.d.ts +13 -0
  35. package/dist/components/pro/Kanban/utils.js +48 -0
  36. package/dist/components/pro/Kanban/utils.js.map +1 -0
  37. package/dist/components/pro/RichTextEditor/AIRewrite.js +158 -127
  38. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  39. package/dist/components/pro/RichTextEditor/BlockHandle.d.ts +2 -0
  40. package/dist/components/pro/RichTextEditor/BlockHandle.js +156 -115
  41. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  42. package/dist/components/pro/RichTextEditor/RichTextEditor.js +136 -159
  43. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  44. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -41
  45. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  46. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +59 -53
  47. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  48. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +48 -44
  49. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  50. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +67 -63
  51. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  52. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.d.ts +1 -0
  53. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +182 -129
  54. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  55. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.d.ts +1 -0
  56. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +3 -3
  57. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  58. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.d.ts +3 -0
  59. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js +31 -0
  60. package/dist/components/pro/RichTextEditor/Toolbar/useAnchoredDropdown.js.map +1 -0
  61. package/dist/components/pro/RichTextEditor/index.d.ts +1 -1
  62. package/dist/components/pro/RichTextEditor/types.d.ts +78 -11
  63. package/dist/components/pro/RichTextEditor/types.js +11 -0
  64. package/dist/components/pro/RichTextEditor/types.js.map +1 -1
  65. package/dist/dishui.css +1 -1
  66. package/dist/index-nostyled.d.ts +1 -1
  67. package/dist/index.d.ts +4 -2
  68. package/dist/index.js +128 -122
  69. package/dist/kanban.js +5 -0
  70. package/dist/utils/i18n.js +20 -0
  71. package/dist/utils/i18n.js.map +1 -1
  72. package/dist/utils/menu.js +1 -1
  73. package/dist/utils/menu.js.map +1 -1
  74. package/package.json +5 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Card/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\nimport { CardMetric, type CardMetricProps } from './Metric';\nimport ApprovalCard, { type ApprovalCardProps } from '../ai/ApprovalCard';\nimport RecommendationCard, { type RecommendationCardProps } from '../ai/RecommendationCard';\nimport ContextCards, { type ContextCardsProps } from '../ai/ContextCards';\nimport InsightCards, { type InsightCardsProps } from '../ai/InsightCards';\nimport FineTuneCard, { type FineTuneCardProps } from '../ai/FineTuneCard';\nexport type { CardMetricProps, CardMetricItem } from './Metric';\nexport type { ApprovalCardProps, ApprovalOption } from '../ai/ApprovalCard';\nexport type { RecommendationCardProps, Recommendation, RecommendationAlternative, RecommendationCardLabels, ConfidenceLevel } from '../ai/RecommendationCard';\nexport type { ContextCardsProps, ContextChunk, ContextSource, ContextSourceKind, ContextCardsLabels } from '../ai/ContextCards';\nexport type { InsightCardsProps, InsightCardItem } from '../ai/InsightCards';\nexport type { FineTuneCardProps, FineTuneMetric } from '../ai/FineTuneCard';\n\nexport type CardProps = {\n children: React.ReactNode;\n variant?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';\n bordered?: boolean;\n dash?: boolean;\n side?: boolean;\n imageFull?: boolean;\n compact?: boolean;\n hover?: boolean;\n glass?: boolean; // 毛玻璃效果\n /** Background opacity only (0..1, default 0.15). Non-finite values use the default. */\n glassOpacity?: number;\n style?: React.CSSProperties;\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n};\n\nconst Card = ({\n children,\n variant,\n bordered = false,\n dash = false,\n side = false,\n imageFull = false,\n compact = false,\n hover = true, // 默认启用 hover 效果\n glass = true, // 默认启用毛玻璃效果\n glassOpacity,\n style,\n size = 'sm',\n className = '',\n}: CardProps) => {\n const baseClass = 'card';\n\n const defaultStyles = glass && !variant ? 'dishui-card-glass' : '';\n\n // 如果指定了 variant,使用该 variant 的背景色,并添加阴影\n const variantClass = variant ? `bg-${variant} text-${variant}-content shadow-md` : '';\n\n const borderedClass = bordered ? 'card-bordered' : '';\n const dashClass = dash ? 'card-dash' : '';\n const sideClass = side ? 'card-side' : '';\n const imageFullClass = imageFull ? 'image-full' : '';\n const compactClass = compact ? 'card-compact' : '';\n const hoverClass = hover ? 'hover:shadow-md transition-shadow duration-200 motion-reduce:transition-none' : '';\n const sizeClass = size ? `card-${size}` : '';\n\n // 宽度策略:\n // 1. 如果用户指定了 w-/max-w-/min-w-,则完全使用用户的设置\n // 2. 否则不设置固定宽度,让 Card 自然适应父容器(Grid 中自动填充,Flex 中根据内容)\n const hasWidthClass = className.includes('w-') || className.match(/max-w-|min-w-/);\n const widthClass = ''; // 不设置默认宽度,让布局决定\n\n const cardClasses = cn(\n baseClass,\n widthClass,\n defaultStyles,\n variantClass,\n borderedClass,\n dashClass,\n sideClass,\n imageFullClass,\n compactClass,\n hoverClass,\n sizeClass,\n className\n );\n\n return (\n <div className={cardClasses} style={buildCardStyle({ variant, glass, glassOpacity, style })}>\n {children}\n </div>\n );\n};\n\n// Card.Title 组件\nexport type CardTitleProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nconst CardTitle = ({\n children,\n className = '',\n}: CardTitleProps) => {\n const titleClasses = cn('card-title', className);\n\n return (\n <h2 className={titleClasses}>\n {children}\n </h2>\n );\n};\n\n// Card.Body 组件\nexport type CardBodyProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nconst CardBody = ({\n children,\n className = '',\n}: CardBodyProps) => {\n const bodyClasses = cn('card-body', className);\n\n return (\n <div className={bodyClasses}>\n {children}\n </div>\n );\n};\n\n// Card.Actions 组件\nexport type CardActionsProps = {\n children: React.ReactNode;\n className?: string;\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n};\n\nconst CardActions = ({\n children,\n className = '',\n justify = 'end',\n}: CardActionsProps) => {\n const actionsClasses = cn(\n 'card-actions',\n justify && `justify-${justify}`,\n className\n );\n\n return (\n <div className={actionsClasses}>\n {children}\n </div>\n );\n};\n\n// Card.Figure 组件\nexport type CardFigureProps = {\n children: React.ReactNode;\n className?: string;\n /**\n * 图片填充方式(作用于内部 <img>):\n * - `cover` 等比裁切填满(默认,“撑满”)\n * - `contain` 等比完整展示,可能留白\n * - `fill` 拉伸填满(不保持比例)\n */\n fit?: 'cover' | 'contain' | 'fill';\n /** 图片撑满整个 figure(w/h 100%)。card-side 时建议开启。 */\n fill?: boolean;\n /** 指定 figure 高度(数字按 px,支持 \"16rem\"/\"50%\" 等);内部图片自动填满该高度 */\n height?: number | string;\n};\n\nconst FIT_CLASS: Record<NonNullable<CardFigureProps['fit']>, string> = {\n cover: '[&>img]:object-cover',\n contain: '[&>img]:object-contain',\n fill: '[&>img]:object-fill',\n};\n\nconst toCssSize = (value: number | string | undefined): string | undefined =>\n typeof value === 'number' ? `${value}px` : value;\n\nconst CardFigure = ({\n children,\n className = '',\n fit = 'cover',\n fill = false,\n height,\n}: CardFigureProps) => {\n const figureClasses = cn(\n 'figure',\n FIT_CLASS[fit],\n // 撑满:figure 与内部 img 都占满可用空间\n fill && 'w-full h-full [&>img]:h-full [&>img]:w-full',\n // 指定高度:figure 定高,内部图片自动填满\n height !== undefined && 'w-full [&>img]:h-full [&>img]:w-full',\n className\n );\n\n return (\n <figure className={figureClasses} style={height !== undefined ? { height: toCssSize(height) } : undefined}>\n {children}\n </figure>\n );\n};\n\n// ─── 内部工具:复用基础 Card 的类名拼装逻辑 ──────────────────\n\ninterface CardClassOptions {\n variant?: CardProps['variant'];\n bordered?: boolean;\n glass?: boolean;\n className?: string;\n}\n\nconst buildCardClasses = ({ variant, bordered = false, glass = true, className = '' }: CardClassOptions) => {\n const defaultStyles = glass && !variant ? 'dishui-card-glass' : '';\n const variantClass = variant ? `bg-${variant} text-${variant}-content shadow-md` : '';\n return cn('card', defaultStyles, variantClass, bordered && 'card-bordered', className);\n};\n\nconst buildCardStyle = ({\n variant,\n glass = true,\n glassOpacity = 0.15,\n style,\n}: Pick<CardProps, 'variant' | 'glass' | 'glassOpacity' | 'style'>): React.CSSProperties | undefined => {\n if (!glass || variant) return style;\n const opacity = Number.isFinite(glassOpacity) ? Math.min(1, Math.max(0, glassOpacity)) : 0.15;\n return { '--dishui-card-glass-opacity': `${opacity * 100}%`, ...style } as React.CSSProperties;\n};\n\nconst ClockGlyph: React.FC<{ className?: string }> = ({ className }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className={cn('h-4 w-4', className)} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path strokeLinecap=\"round\" d=\"M12 7v5l3 2\" />\n </svg>\n);\n\n// ─── Card.Feature:特性卡(图标 + 标题 + 描述) ───────────────\n\nexport type CardFeatureProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Icon node (usually a lucide / inline svg), rendered inside a tinted container. */\n icon?: React.ReactNode;\n /** Feature title. */\n title: React.ReactNode;\n /** Feature description rendered under the title. */\n description?: React.ReactNode;\n /** `vertical` centers everything with the icon on top; `horizontal` puts the icon at the left. */\n layout?: 'vertical' | 'horizontal';\n /** Icon container shape. Defaults to `circle` (vertical) / `square` (horizontal). */\n iconShape?: 'circle' | 'square';\n /** Extra content rendered under the description. */\n children?: React.ReactNode;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardFeature: React.FC<CardFeatureProps> = ({\n icon,\n title,\n description,\n layout = 'vertical',\n iconShape,\n children,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => {\n const shape = iconShape ?? (layout === 'vertical' ? 'circle' : 'square');\n const iconBox = icon && (\n <span\n className={cn(\n 'flex shrink-0 items-center justify-center bg-primary/10 text-primary',\n layout === 'vertical' ? 'size-16' : 'size-12',\n shape === 'circle' ? 'rounded-full' : 'rounded-xl',\n )}\n >\n {icon}\n </span>\n );\n\n return (\n <div\n className={buildCardClasses({ variant, bordered, glass, className })}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n {layout === 'horizontal' ? (\n <div className=\"card-body flex-row items-center gap-4\">\n {iconBox}\n <div className=\"min-w-0 flex-1\">\n <h3 className=\"font-semibold text-base-content\">{title}</h3>\n {description && (\n <p className=\"mt-0.5 text-sm text-base-content/70\">{description}</p>\n )}\n {children}\n </div>\n </div>\n ) : (\n <div className=\"card-body items-center gap-3 text-center\">\n {iconBox}\n <h3 className=\"text-lg font-bold text-base-content\">{title}</h3>\n {description && (\n <p className=\"text-sm leading-relaxed text-base-content/70\">{description}</p>\n )}\n {children}\n </div>\n )}\n </div>\n );\n};\n\n// ─── Card.Quote:引用卡(引用文本 + 作者 / 日期 + 装饰引号) ──\n\nexport type CardQuoteProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** The quoted text. */\n children: React.ReactNode;\n /** Author name (rendered in primary color). */\n author?: React.ReactNode;\n /** Avatar node (e.g. an `<img>` or initial circle) shown before the author. */\n avatar?: React.ReactNode;\n /** Date string/node rendered at the right side of the footer. */\n date?: React.ReactNode;\n /** Hide the decorative quote glyph in the top-right corner. */\n quoteMark?: boolean;\n /** Hide the divider between quote and footer. */\n divider?: boolean;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardQuote: React.FC<CardQuoteProps> = ({\n children,\n author,\n avatar,\n date,\n quoteMark = true,\n divider = true,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => (\n <div\n className={cn(\n buildCardClasses({ variant, bordered, glass, className }),\n 'relative overflow-hidden',\n )}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n {quoteMark && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-5 top-2 select-none font-serif text-6xl leading-none text-primary/25\"\n >\n ”\n </span>\n )}\n <div className=\"card-body gap-0 p-6\">\n <div className={cn('relative z-10 min-w-0 wrap-anywhere text-lg text-base-content', quoteMark && 'pe-10')}>{children}</div>\n <div\n className={cn(\n 'mt-4 flex flex-wrap items-center justify-between gap-3',\n divider && 'border-t border-base-300 pt-3.5',\n )}\n >\n <div className=\"flex min-w-0 items-center gap-2.5\">\n {avatar && <span className=\"size-8 shrink-0 overflow-hidden rounded-full\">{avatar}</span>}\n {author && (\n <span className=\"truncate text-sm font-medium text-primary\">{author}</span>\n )}\n </div>\n {date && (\n <span className=\"flex shrink-0 items-center gap-1.5 text-sm text-base-content/55\">\n <ClockGlyph />\n {date}\n </span>\n )}\n </div>\n </div>\n </div>\n);\n\n// ─── Card.Meta:元信息卡(标题 + 徽章 + 描述 + 左右页脚) ────\n\nexport type CardMetaProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Card title (top-left). */\n title: React.ReactNode;\n /** Badge / tag node (top-right, e.g. a visibility badge). */\n badge?: React.ReactNode;\n /** Body content under the title row. */\n children?: React.ReactNode;\n /** Footer left slot (e.g. `@author`). */\n footerLeft?: React.ReactNode;\n /** Footer right slot (e.g. a date). */\n footerRight?: React.ReactNode;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardMeta: React.FC<CardMetaProps> = ({\n title,\n badge,\n children,\n footerLeft,\n footerRight,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => (\n <div\n className={buildCardClasses({ variant, bordered, glass, className })}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n <div className=\"card-body gap-2.5 p-6\">\n <div className=\"flex items-center justify-between gap-3\">\n <h3 className=\"min-w-0 flex-1 truncate text-lg font-bold text-base-content\">{title}</h3>\n {badge && <span className=\"shrink-0\">{badge}</span>}\n </div>\n {children && <div className=\"text-sm text-base-content/75\">{children}</div>}\n {(footerLeft || footerRight) && (\n <div className=\"mt-1.5 flex items-center justify-between gap-3 text-sm text-base-content/55\">\n <span className=\"min-w-0 truncate\">{footerLeft}</span>\n <span className=\"shrink-0\">{footerRight}</span>\n </div>\n )}\n </div>\n </div>\n);\n\n// ─── Card.Info:指标卡(标签 + 数值 + 可选图标 / hint / 加载态) ──\n\nexport type CardInfoTone = 'primary' | 'success' | 'warning' | 'info' | 'error' | 'neutral';\n\nimport './Info.css';\n\nexport type CardInfoProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Metric name. */\n label: React.ReactNode;\n /** Metric value (number or short text). */\n value: React.ReactNode;\n /** Icon slot. Use Icon to control its size, color and background independently. */\n icon?: React.ReactNode;\n /** `top` keeps the icon beside the label; `left` / `right` flank the content. */\n iconPosition?: 'top' | 'left' | 'right';\n /** Stacked content (default), compact horizontal row, or two-column summary. */\n layout?: 'stacked' | 'horizontal' | 'split';\n /** Content alignment (default left). */\n align?: 'left' | 'center' | 'right';\n /** Additional multi-line content below the summary. */\n children?: React.ReactNode;\n /** Footer slot separated by a subtle divider. */\n footer?: React.ReactNode;\n /** @deprecated Use Icon styles instead. Shape of the optional neutral compatibility box. */\n iconShape?: 'square' | 'circle';\n /** @deprecated Use Icon styles instead. Optional neutral icon box (default false). */\n iconBoxed?: boolean;\n /** Card surface and border tone (default neutral). Does not style the icon. */\n tone?: CardInfoTone;\n /** Small hint text below the value (e.g. deltas, update time). */\n hint?: React.ReactNode;\n /** Loading state: value renders as a skeleton. */\n loading?: boolean;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border (default true). */\n bordered?: boolean;\n /** Enable the glass background (default true, matching Card). */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\n\nconst CardInfo: React.FC<CardInfoProps> = ({\n label,\n value,\n icon,\n iconPosition = 'top',\n iconShape = 'square',\n iconBoxed = false,\n tone = 'neutral',\n layout = 'stacked',\n align = 'left',\n children,\n footer,\n hint,\n loading = false,\n variant,\n bordered = true,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => {\n const cardClasses = buildCardClasses({\n variant, bordered, glass,\n className: cn('dishui-card-info', 'p-4', className),\n });\n const iconNode = icon != null && (\n <span className={cn(\n 'dishui-card-info__icon',\n iconBoxed && (iconShape === 'circle' ? 'rounded-full' : 'rounded-lg'),\n iconBoxed && 'bg-base-content/5',\n )}>\n {icon}\n </span>\n );\n\n return (\n <div\n className={cardClasses}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n data-layout={layout}\n data-align={align}\n data-tone={variant ? undefined : tone}\n data-bordered={bordered}\n data-glass={glass}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n aria-busy={loading || undefined}\n onClick={onClick}\n onKeyDown={onClick ? (event) => {\n // Let controls inside content/footer handle their own keyboard events.\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n if (!event.repeat) event.currentTarget.click();\n }\n } : undefined}\n >\n <div className=\"dishui-card-info__body\">\n {iconPosition === 'left' && iconNode}\n <div className=\"dishui-card-info__content\">\n <div className=\"dishui-card-info__summary\">\n <div className=\"dishui-card-info__header\">\n <div className=\"dishui-card-info__label\">{label}</div>\n {iconPosition === 'top' && iconNode}\n </div>\n <div className=\"dishui-card-info__reading\">\n <div className=\"dishui-card-info__value\">\n {loading ? <span className=\"dishui-card-info__skeleton\" aria-hidden=\"true\" /> : value}\n </div>\n {hint != null && <div className=\"dishui-card-info__hint\">{hint}</div>}\n </div>\n </div>\n {children != null && <div className=\"dishui-card-info__details\">{children}</div>}\n </div>\n {iconPosition === 'right' && iconNode}\n </div>\n {footer != null && <div className=\"dishui-card-info__footer\">{footer}</div>}\n </div>\n );\n};\n\n// ─── Card.Stat:统计面板(Grafana 风格:超大数值 + 迷你图 / 角标 / 填充色) ───\n\nexport type CardStatProps = {\n /** 面板标签 */\n label: React.ReactNode;\n /** 面板数值(数字或短文本) */\n value: React.ReactNode;\n /** 色调(决定数值文字色 / 角标三角 / filled 底色) */\n tone?: CardInfoTone;\n /** 加载态:值显示为骨架 */\n loading?: boolean;\n className?: string;\n /** 数值单位后缀(如 `K`、`%`),以小号字体渲染在数值右侧。 */\n unit?: React.ReactNode;\n /** 面板数值字号,默认 `xl`。 */\n valueSize?: 'md' | 'lg' | 'xl' | '2xl';\n /** 面板内容对齐,默认 `left`。 */\n align?: 'left' | 'center';\n /** 直接传入迷你图节点(优先于 sparklineData)。 */\n sparkline?: React.ReactNode;\n /** 迷你图数据:传入数值数组后自动渲染 sparkline。 */\n sparklineData?: number[];\n /** 迷你图类型:折线 / 面积 / 柱状。 */\n sparklineType?: 'line' | 'area' | 'bar';\n /** 迷你图高度(px)。 */\n sparklineHeight?: number;\n /** 右上角状态三角(Grafana 阈值指示)。 */\n indicator?: boolean;\n /** 整卡填充 tone 底色、文字用对应 content 色(图 RabbitMQ 风格)。 */\n filled?: boolean;\n /** 点击回调(面板常用于跳转详情)。 */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst STAT_TONE_TEXT_CLASS: Record<NonNullable<CardStatProps['tone']>, string> = {\n primary: 'text-primary',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n error: 'text-error',\n neutral: 'text-base-content/70',\n};\n\n/** filled 模式:整卡 tone 底色 + 对应 content 文字色 */\nconst STAT_FILLED_CLASS: Record<NonNullable<CardStatProps['tone']>, string> = {\n primary: 'bg-primary text-primary-content',\n success: 'bg-success text-success-content',\n warning: 'bg-warning text-warning-content',\n info: 'bg-info text-info-content',\n error: 'bg-error text-error-content',\n neutral: 'bg-neutral text-neutral-content',\n};\n\nconst STAT_VALUE_SIZE_CLASS: Record<NonNullable<CardStatProps['valueSize']> & string, string> = {\n md: 'text-2xl',\n lg: 'text-4xl',\n xl: 'text-5xl',\n '2xl': 'text-6xl',\n};\n\nconst statCssVarColor = (tone: NonNullable<CardStatProps['tone']>) =>\n tone === 'neutral' ? 'var(--color-base-content)' : `var(--color-${tone})`;\n\n/** 由数值数组生成迷你图(viewBox 拉伸铺满,描边不随宽度变形) */\nconst MiniSparkline: React.FC<{\n data: number[];\n type: 'line' | 'area' | 'bar';\n height: number;\n}> = ({ data, type, height }) => {\n if (!data || data.length < 2) return null;\n const w = 100;\n const pad = 3;\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n const px = (i: number) => (i / (data.length - 1)) * w;\n const py = (v: number) => height - pad - ((v - min) / range) * (height - pad * 2);\n const points = data.map((v, i) => `${px(i).toFixed(2)},${py(v).toFixed(2)}`);\n\n if (type === 'bar') {\n const bw = w / data.length;\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n {data.map((v, i) => (\n <rect\n key={i}\n x={px(i) - bw / 2}\n y={py(v)}\n width={bw * 0.8}\n height={Math.max(1, height - pad - py(v))}\n fill=\"currentColor\"\n />\n ))}\n </svg>\n );\n }\n\n if (type === 'area') {\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n <path\n d={`M0,${height} L${points.join(' L')} L${w},${height} Z`}\n fill=\"currentColor\"\n opacity={0.18}\n />\n <polyline\n points={points.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n );\n }\n\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n <polyline\n points={points.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n );\n};\n\n/**\n * 统计面板:Grafana stat panel 风格的「标签 + 超大数值 + 迷你图」小卡,\n * 支持单位后缀、折线 / 面积 / 柱状迷你图、角标状态三角与整卡填充色。\n *\n * 简单的「标签 + 数值 + 图标」指标卡请使用 `Card.Info`。\n */\nconst CardStat: React.FC<CardStatProps> = ({\n label,\n value,\n tone = 'primary',\n loading = false,\n className = '',\n unit,\n valueSize = 'xl',\n align = 'left',\n sparkline,\n sparklineData,\n sparklineType = 'line',\n sparklineHeight = 36,\n indicator = false,\n filled = false,\n onClick,\n}) => {\n const sparklineNode =\n sparkline ??\n (sparklineData && sparklineData.length >= 2 ? (\n <MiniSparkline data={sparklineData} type={sparklineType} height={sparklineHeight} />\n ) : null);\n\n const textColor = filled ? '' : STAT_TONE_TEXT_CLASS[tone];\n const mutedText = filled ? 'opacity-80' : 'text-base-content/60';\n\n return (\n <div\n onClick={onClick}\n className={`relative flex flex-col overflow-hidden rounded-lg p-3 ${\n filled ? STAT_FILLED_CLASS[tone] : 'border border-base-300/60 bg-base-200'\n } ${onClick ? 'cursor-pointer transition-colors hover:border-primary/40' : ''} ${className}`.trim()}\n >\n {indicator && !filled && (\n <span\n aria-hidden=\"true\"\n className=\"absolute right-0 top-0 h-0 w-0\"\n style={{\n borderTop: '14px solid ' + statCssVarColor(tone),\n borderLeft: '14px solid transparent',\n }}\n />\n )}\n <div\n className={`truncate text-xs font-medium ${mutedText} ${align === 'center' ? 'text-center' : ''}`.trim()}\n >\n {label}\n </div>\n <div\n className={`flex min-h-[3rem] flex-1 items-center py-1 ${align === 'center' ? 'justify-center' : 'justify-start'}`}\n >\n {loading ? (\n <span\n className={`inline-block h-8 w-16 animate-pulse rounded ${\n filled ? 'bg-white/25' : 'bg-base-content/10'\n }`}\n />\n ) : (\n <span className={`leading-none tracking-tight ${STAT_VALUE_SIZE_CLASS[valueSize]} font-semibold ${filled ? '' : textColor}`.trim()}>\n {value}\n {unit !== undefined && unit !== null && unit !== '' && (\n <span className=\"ml-0.5 text-[0.45em] font-semibold\">{unit}</span>\n )}\n </span>\n )}\n </div>\n {sparklineNode && (\n <div className={`-mx-3 -mb-3 mt-1 ${filled ? 'text-white' : STAT_TONE_TEXT_CLASS[tone]}`}>\n {sparklineNode}\n </div>\n )}\n </div>\n );\n};\n\n// 扩展Card组件,添加子组件\ninterface CardCompound extends React.FC<CardProps> {\n Metric: React.FC<CardMetricProps>;\n Title: React.FC<CardTitleProps>;\n Body: React.FC<CardBodyProps>;\n Actions: React.FC<CardActionsProps>;\n Figure: React.FC<CardFigureProps>;\n /** 特性卡:图标 + 标题 + 描述(垂直居中 / 横向两种布局) */\n Feature: React.FC<CardFeatureProps>;\n /** 引用卡:引用文本 + 作者头像 / 日期 + 装饰引号 */\n Quote: React.FC<CardQuoteProps>;\n /** 元信息卡:标题 + 徽章 + 描述 + 左右页脚 */\n Meta: React.FC<CardMetaProps>;\n /** 指标卡:标签 + 数值 + 可选图标 / hint / 加载态(仪表盘统计卡片) */\n Info: React.FC<CardInfoProps>;\n /** 统计面板:Grafana 风格超大数值 + 迷你折线 / 面积 / 柱状图 / 角标 / 填充色 */\n Stat: React.FC<CardStatProps>;\n /** AI 审批卡片:明确展示待批准操作及可选方案。 */\n Approval: React.FC<ApprovalCardProps>;\n /** AI 推荐卡片:首选建议、置信度与替代方案。 */\n Recommendation: React.FC<RecommendationCardProps>;\n /** AI 上下文卡片集合:检索片段与来源。 */\n Context: React.FC<ContextCardsProps>;\n /** AI 洞察指标卡片集合。 */\n Insights: React.FC<InsightCardsProps>;\n /** AI 微调任务状态卡片。 */\n FineTune: React.FC<FineTuneCardProps>;\n}\n\nconst CardWithCompounds = Card as CardCompound;\nCardWithCompounds.Title = CardTitle;\nCardWithCompounds.Body = CardBody;\nCardWithCompounds.Actions = CardActions;\nCardWithCompounds.Figure = CardFigure;\nCardWithCompounds.Feature = CardFeature;\nCardWithCompounds.Quote = CardQuote;\nCardWithCompounds.Meta = CardMeta;\nCardWithCompounds.Info = CardInfo;\nCardWithCompounds.Stat = CardStat;\nCardWithCompounds.Metric = CardMetric;\nCardWithCompounds.Approval = ApprovalCard;\nCardWithCompounds.Recommendation = RecommendationCard;\nCardWithCompounds.Context = ContextCards;\nCardWithCompounds.Insights = InsightCards;\nCardWithCompounds.FineTune = FineTuneCard;\n\nexport default CardWithCompounds; "],"mappings":";;;;;;;;;;;AAgCA,IAAM,KAAQ,EACZ,aACA,YACA,cAAW,IACX,UAAO,IACP,UAAO,IACP,eAAY,IACZ,aAAU,IACV,WAAQ,IACR,WAAQ,IACR,iBACA,UACA,UAAO,MACP,eAAY,SACG;CACf,IAEM,IAAgB,KAAS,CAAC,IAAU,sBAAsB,IAG1D,I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K,GACA,KAA+B,QAAQ,MAAS,MAC7C,kBAAC,QAAD;MAAM,WAAU;MAAsC,UAAA;KAAW,CAAA,CAEnE;;GAET,CAAA;GACJ,KACG,kBAAC,OAAD;IAAK,WAAW,oBAAoB,IAAS,eAAe,EAAqB;IAC5E,UAAA;GACA,CAAA;EAER;;AAEb,GA+BM,IAAoB;AAC1B,EAAkB,QAAQ,GAC1B,EAAkB,OAAO,GACzB,EAAkB,UAAU,GAC5B,EAAkB,SAAS,GAC3B,EAAkB,UAAU,GAC5B,EAAkB,QAAQ,GAC1B,EAAkB,OAAO,GACzB,EAAkB,OAAO,GACzB,EAAkB,OAAO,GACzB,EAAkB,SAAS,GAC3B,EAAkB,WAAW,GAC7B,EAAkB,iBAAiB,GACnC,EAAkB,UAAU,GAC5B,EAAkB,WAAW,GAC7B,EAAkB,WAAW"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Card/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../utils/cn';\nimport { CardMetric, type CardMetricProps } from './Metric';\nimport { CardTicket, type CardTicketProps } from './Ticket';\nimport ApprovalCard, { type ApprovalCardProps } from '../ai/ApprovalCard';\nimport RecommendationCard, { type RecommendationCardProps } from '../ai/RecommendationCard';\nimport ContextCards, { type ContextCardsProps } from '../ai/ContextCards';\nimport InsightCards, { type InsightCardsProps } from '../ai/InsightCards';\nimport FineTuneCard, { type FineTuneCardProps } from '../ai/FineTuneCard';\nimport IssueCard, { type IssueCardProps } from '../ai/IssueCard';\nimport AgentRunCard, { type AgentRunCardProps } from '../ai/AgentRunCard';\nexport type { CardMetricProps, CardMetricItem } from './Metric';\nexport type {\n CardTicketProps,\n CardTicketTone,\n CardTicketPriorityLevel,\n CardTicketStatus,\n CardTicketIssueType,\n CardTicketAssignee,\n CardTicketPriority,\n CardTicketLabel,\n CardTicketSubtaskProgress,\n} from './Ticket';\nexport type { ApprovalCardProps, ApprovalOption } from '../ai/ApprovalCard';\nexport type { RecommendationCardProps, Recommendation, RecommendationAlternative, RecommendationCardLabels, ConfidenceLevel } from '../ai/RecommendationCard';\nexport type { ContextCardsProps, ContextChunk, ContextSource, ContextSourceKind, ContextCardsLabels } from '../ai/ContextCards';\nexport type { InsightCardsProps, InsightCardItem } from '../ai/InsightCards';\nexport type { FineTuneCardProps, FineTuneMetric } from '../ai/FineTuneCard';\nexport type { IssueCardProps, IssueLabel, IssuePriority, IssueAccent } from '../ai/IssueCard';\nexport type { AgentRunCardProps, AgentRunStatus, AgentRunMeta } from '../ai/AgentRunCard';\n\nexport type CardProps = {\n children: React.ReactNode;\n variant?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';\n bordered?: boolean;\n dash?: boolean;\n side?: boolean;\n imageFull?: boolean;\n compact?: boolean;\n hover?: boolean;\n glass?: boolean; // 毛玻璃效果\n /** Background opacity only (0..1, default 0.15). Non-finite values use the default. */\n glassOpacity?: number;\n style?: React.CSSProperties;\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n};\n\nconst Card = ({\n children,\n variant,\n bordered = false,\n dash = false,\n side = false,\n imageFull = false,\n compact = false,\n hover = true, // 默认启用 hover 效果\n glass = true, // 默认启用毛玻璃效果\n glassOpacity,\n style,\n size = 'sm',\n className = '',\n}: CardProps) => {\n const baseClass = 'card';\n\n const defaultStyles = glass && !variant ? 'dishui-card-glass' : '';\n\n // 如果指定了 variant,使用该 variant 的背景色,并添加阴影\n const variantClass = variant ? `bg-${variant} text-${variant}-content shadow-md` : '';\n\n const borderedClass = bordered ? 'card-bordered' : '';\n const dashClass = dash ? 'card-dash' : '';\n const sideClass = side ? 'card-side' : '';\n const imageFullClass = imageFull ? 'image-full' : '';\n const compactClass = compact ? 'card-compact' : '';\n const hoverClass = hover ? 'hover:shadow-md transition-shadow duration-200 motion-reduce:transition-none' : '';\n const sizeClass = size ? `card-${size}` : '';\n\n // 宽度策略:\n // 1. 如果用户指定了 w-/max-w-/min-w-,则完全使用用户的设置\n // 2. 否则不设置固定宽度,让 Card 自然适应父容器(Grid 中自动填充,Flex 中根据内容)\n const hasWidthClass = className.includes('w-') || className.match(/max-w-|min-w-/);\n const widthClass = ''; // 不设置默认宽度,让布局决定\n\n const cardClasses = cn(\n baseClass,\n widthClass,\n defaultStyles,\n variantClass,\n borderedClass,\n dashClass,\n sideClass,\n imageFullClass,\n compactClass,\n hoverClass,\n sizeClass,\n className\n );\n\n return (\n <div className={cardClasses} style={buildCardStyle({ variant, glass, glassOpacity, style })}>\n {children}\n </div>\n );\n};\n\n// Card.Title 组件\nexport type CardTitleProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nconst CardTitle = ({\n children,\n className = '',\n}: CardTitleProps) => {\n const titleClasses = cn('card-title', className);\n\n return (\n <h2 className={titleClasses}>\n {children}\n </h2>\n );\n};\n\n// Card.Body 组件\nexport type CardBodyProps = {\n children: React.ReactNode;\n className?: string;\n};\n\nconst CardBody = ({\n children,\n className = '',\n}: CardBodyProps) => {\n const bodyClasses = cn('card-body', className);\n\n return (\n <div className={bodyClasses}>\n {children}\n </div>\n );\n};\n\n// Card.Actions 组件\nexport type CardActionsProps = {\n children: React.ReactNode;\n className?: string;\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n};\n\nconst CardActions = ({\n children,\n className = '',\n justify = 'end',\n}: CardActionsProps) => {\n const actionsClasses = cn(\n 'card-actions',\n justify && `justify-${justify}`,\n className\n );\n\n return (\n <div className={actionsClasses}>\n {children}\n </div>\n );\n};\n\n// Card.Figure 组件\nexport type CardFigureProps = {\n children: React.ReactNode;\n className?: string;\n /**\n * 图片填充方式(作用于内部 <img>):\n * - `cover` 等比裁切填满(默认,“撑满”)\n * - `contain` 等比完整展示,可能留白\n * - `fill` 拉伸填满(不保持比例)\n */\n fit?: 'cover' | 'contain' | 'fill';\n /** 图片撑满整个 figure(w/h 100%)。card-side 时建议开启。 */\n fill?: boolean;\n /** 指定 figure 高度(数字按 px,支持 \"16rem\"/\"50%\" 等);内部图片自动填满该高度 */\n height?: number | string;\n};\n\nconst FIT_CLASS: Record<NonNullable<CardFigureProps['fit']>, string> = {\n cover: '[&>img]:object-cover',\n contain: '[&>img]:object-contain',\n fill: '[&>img]:object-fill',\n};\n\nconst toCssSize = (value: number | string | undefined): string | undefined =>\n typeof value === 'number' ? `${value}px` : value;\n\nconst CardFigure = ({\n children,\n className = '',\n fit = 'cover',\n fill = false,\n height,\n}: CardFigureProps) => {\n const figureClasses = cn(\n 'figure',\n FIT_CLASS[fit],\n // 撑满:figure 与内部 img 都占满可用空间\n fill && 'w-full h-full [&>img]:h-full [&>img]:w-full',\n // 指定高度:figure 定高,内部图片自动填满\n height !== undefined && 'w-full [&>img]:h-full [&>img]:w-full',\n className\n );\n\n return (\n <figure className={figureClasses} style={height !== undefined ? { height: toCssSize(height) } : undefined}>\n {children}\n </figure>\n );\n};\n\n// ─── 内部工具:复用基础 Card 的类名拼装逻辑 ──────────────────\n\ninterface CardClassOptions {\n variant?: CardProps['variant'];\n bordered?: boolean;\n glass?: boolean;\n className?: string;\n}\n\nconst buildCardClasses = ({ variant, bordered = false, glass = true, className = '' }: CardClassOptions) => {\n const defaultStyles = glass && !variant ? 'dishui-card-glass' : '';\n const variantClass = variant ? `bg-${variant} text-${variant}-content shadow-md` : '';\n return cn('card', defaultStyles, variantClass, bordered && 'card-bordered', className);\n};\n\nconst buildCardStyle = ({\n variant,\n glass = true,\n glassOpacity = 0.15,\n style,\n}: Pick<CardProps, 'variant' | 'glass' | 'glassOpacity' | 'style'>): React.CSSProperties | undefined => {\n if (!glass || variant) return style;\n const opacity = Number.isFinite(glassOpacity) ? Math.min(1, Math.max(0, glassOpacity)) : 0.15;\n return { '--dishui-card-glass-opacity': `${opacity * 100}%`, ...style } as React.CSSProperties;\n};\n\nconst ClockGlyph: React.FC<{ className?: string }> = ({ className }) => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className={cn('h-4 w-4', className)} fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" strokeWidth={2}>\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path strokeLinecap=\"round\" d=\"M12 7v5l3 2\" />\n </svg>\n);\n\n// ─── Card.Feature:特性卡(图标 + 标题 + 描述) ───────────────\n\nexport type CardFeatureProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Icon node (usually a lucide / inline svg), rendered inside a tinted container. */\n icon?: React.ReactNode;\n /** Feature title. */\n title: React.ReactNode;\n /** Feature description rendered under the title. */\n description?: React.ReactNode;\n /** `vertical` centers everything with the icon on top; `horizontal` puts the icon at the left. */\n layout?: 'vertical' | 'horizontal';\n /** Icon container shape. Defaults to `circle` (vertical) / `square` (horizontal). */\n iconShape?: 'circle' | 'square';\n /** Extra content rendered under the description. */\n children?: React.ReactNode;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardFeature: React.FC<CardFeatureProps> = ({\n icon,\n title,\n description,\n layout = 'vertical',\n iconShape,\n children,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => {\n const shape = iconShape ?? (layout === 'vertical' ? 'circle' : 'square');\n const iconBox = icon && (\n <span\n className={cn(\n 'flex shrink-0 items-center justify-center bg-primary/10 text-primary',\n layout === 'vertical' ? 'size-16' : 'size-12',\n shape === 'circle' ? 'rounded-full' : 'rounded-xl',\n )}\n >\n {icon}\n </span>\n );\n\n return (\n <div\n className={buildCardClasses({ variant, bordered, glass, className })}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n {layout === 'horizontal' ? (\n <div className=\"card-body flex-row items-center gap-4\">\n {iconBox}\n <div className=\"min-w-0 flex-1\">\n <h3 className=\"font-semibold text-base-content\">{title}</h3>\n {description && (\n <p className=\"mt-0.5 text-sm text-base-content/70\">{description}</p>\n )}\n {children}\n </div>\n </div>\n ) : (\n <div className=\"card-body items-center gap-3 text-center\">\n {iconBox}\n <h3 className=\"text-lg font-bold text-base-content\">{title}</h3>\n {description && (\n <p className=\"text-sm leading-relaxed text-base-content/70\">{description}</p>\n )}\n {children}\n </div>\n )}\n </div>\n );\n};\n\n// ─── Card.Quote:引用卡(引用文本 + 作者 / 日期 + 装饰引号) ──\n\nexport type CardQuoteProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** The quoted text. */\n children: React.ReactNode;\n /** Author name (rendered in primary color). */\n author?: React.ReactNode;\n /** Avatar node (e.g. an `<img>` or initial circle) shown before the author. */\n avatar?: React.ReactNode;\n /** Date string/node rendered at the right side of the footer. */\n date?: React.ReactNode;\n /** Hide the decorative quote glyph in the top-right corner. */\n quoteMark?: boolean;\n /** Hide the divider between quote and footer. */\n divider?: boolean;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardQuote: React.FC<CardQuoteProps> = ({\n children,\n author,\n avatar,\n date,\n quoteMark = true,\n divider = true,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => (\n <div\n className={cn(\n buildCardClasses({ variant, bordered, glass, className }),\n 'relative overflow-hidden',\n )}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n {quoteMark && (\n <span\n aria-hidden=\"true\"\n className=\"pointer-events-none absolute right-5 top-2 select-none font-serif text-6xl leading-none text-primary/25\"\n >\n ”\n </span>\n )}\n <div className=\"card-body gap-0 p-6\">\n <div className={cn('relative z-10 min-w-0 wrap-anywhere text-lg text-base-content', quoteMark && 'pe-10')}>{children}</div>\n <div\n className={cn(\n 'mt-4 flex flex-wrap items-center justify-between gap-3',\n divider && 'border-t border-base-300 pt-3.5',\n )}\n >\n <div className=\"flex min-w-0 items-center gap-2.5\">\n {avatar && <span className=\"size-8 shrink-0 overflow-hidden rounded-full\">{avatar}</span>}\n {author && (\n <span className=\"truncate text-sm font-medium text-primary\">{author}</span>\n )}\n </div>\n {date && (\n <span className=\"flex shrink-0 items-center gap-1.5 text-sm text-base-content/55\">\n <ClockGlyph />\n {date}\n </span>\n )}\n </div>\n </div>\n </div>\n);\n\n// ─── Card.Meta:元信息卡(标题 + 徽章 + 描述 + 左右页脚) ────\n\nexport type CardMetaProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Card title (top-left). */\n title: React.ReactNode;\n /** Badge / tag node (top-right, e.g. a visibility badge). */\n badge?: React.ReactNode;\n /** Body content under the title row. */\n children?: React.ReactNode;\n /** Footer left slot (e.g. `@author`). */\n footerLeft?: React.ReactNode;\n /** Footer right slot (e.g. a date). */\n footerRight?: React.ReactNode;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border. */\n bordered?: boolean;\n /** Disable the default glass background. */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst CardMeta: React.FC<CardMetaProps> = ({\n title,\n badge,\n children,\n footerLeft,\n footerRight,\n variant,\n bordered,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => (\n <div\n className={buildCardClasses({ variant, bordered, glass, className })}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n onClick={onClick}\n >\n <div className=\"card-body gap-2.5 p-6\">\n <div className=\"flex items-center justify-between gap-3\">\n <h3 className=\"min-w-0 flex-1 truncate text-lg font-bold text-base-content\">{title}</h3>\n {badge && <span className=\"shrink-0\">{badge}</span>}\n </div>\n {children && <div className=\"text-sm text-base-content/75\">{children}</div>}\n {(footerLeft || footerRight) && (\n <div className=\"mt-1.5 flex items-center justify-between gap-3 text-sm text-base-content/55\">\n <span className=\"min-w-0 truncate\">{footerLeft}</span>\n <span className=\"shrink-0\">{footerRight}</span>\n </div>\n )}\n </div>\n </div>\n);\n\n// ─── Card.Info:指标卡(标签 + 数值 + 可选图标 / hint / 加载态) ──\n\nexport type CardInfoTone = 'primary' | 'success' | 'warning' | 'info' | 'error' | 'neutral';\n\nimport './Info.css';\n\nexport type CardInfoProps = Pick<CardProps, 'glassOpacity' | 'style'> & {\n /** Metric name. */\n label: React.ReactNode;\n /** Metric value (number or short text). */\n value: React.ReactNode;\n /** Icon slot. Use Icon to control its size, color and background independently. */\n icon?: React.ReactNode;\n /** `top` keeps the icon beside the label; `left` / `right` flank the content. */\n iconPosition?: 'top' | 'left' | 'right';\n /** Stacked content (default), compact horizontal row, or two-column summary. */\n layout?: 'stacked' | 'horizontal' | 'split';\n /** Content alignment (default left). */\n align?: 'left' | 'center' | 'right';\n /** Additional multi-line content below the summary. */\n children?: React.ReactNode;\n /** Footer slot separated by a subtle divider. */\n footer?: React.ReactNode;\n /** @deprecated Use Icon styles instead. Shape of the optional neutral compatibility box. */\n iconShape?: 'square' | 'circle';\n /** @deprecated Use Icon styles instead. Optional neutral icon box (default false). */\n iconBoxed?: boolean;\n /** Card surface and border tone (default neutral). Does not style the icon. */\n tone?: CardInfoTone;\n /** Small hint text below the value (e.g. deltas, update time). */\n hint?: React.ReactNode;\n /** Loading state: value renders as a skeleton. */\n loading?: boolean;\n /** Color variant (daisyUI). */\n variant?: CardProps['variant'];\n /** Show a border (default true). */\n bordered?: boolean;\n /** Enable the glass background (default true, matching Card). */\n glass?: boolean;\n /** Extra class names on the card. */\n className?: string;\n /** Click handler. */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\n\nconst CardInfo: React.FC<CardInfoProps> = ({\n label,\n value,\n icon,\n iconPosition = 'top',\n iconShape = 'square',\n iconBoxed = false,\n tone = 'neutral',\n layout = 'stacked',\n align = 'left',\n children,\n footer,\n hint,\n loading = false,\n variant,\n bordered = true,\n glass = true,\n glassOpacity,\n style,\n className = '',\n onClick,\n}) => {\n const cardClasses = buildCardClasses({\n variant, bordered, glass,\n className: cn('dishui-card-info', 'p-4', className),\n });\n const iconNode = icon != null && (\n <span className={cn(\n 'dishui-card-info__icon',\n iconBoxed && (iconShape === 'circle' ? 'rounded-full' : 'rounded-lg'),\n iconBoxed && 'bg-base-content/5',\n )}>\n {icon}\n </span>\n );\n\n return (\n <div\n className={cardClasses}\n style={buildCardStyle({ variant, glass, glassOpacity, style })}\n data-layout={layout}\n data-align={align}\n data-tone={variant ? undefined : tone}\n data-bordered={bordered}\n data-glass={glass}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n aria-busy={loading || undefined}\n onClick={onClick}\n onKeyDown={onClick ? (event) => {\n // Let controls inside content/footer handle their own keyboard events.\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n if (!event.repeat) event.currentTarget.click();\n }\n } : undefined}\n >\n <div className=\"dishui-card-info__body\">\n {iconPosition === 'left' && iconNode}\n <div className=\"dishui-card-info__content\">\n <div className=\"dishui-card-info__summary\">\n <div className=\"dishui-card-info__header\">\n <div className=\"dishui-card-info__label\">{label}</div>\n {iconPosition === 'top' && iconNode}\n </div>\n <div className=\"dishui-card-info__reading\">\n <div className=\"dishui-card-info__value\">\n {loading ? <span className=\"dishui-card-info__skeleton\" aria-hidden=\"true\" /> : value}\n </div>\n {hint != null && <div className=\"dishui-card-info__hint\">{hint}</div>}\n </div>\n </div>\n {children != null && <div className=\"dishui-card-info__details\">{children}</div>}\n </div>\n {iconPosition === 'right' && iconNode}\n </div>\n {footer != null && <div className=\"dishui-card-info__footer\">{footer}</div>}\n </div>\n );\n};\n\n// ─── Card.Stat:统计面板(Grafana 风格:超大数值 + 迷你图 / 角标 / 填充色) ───\n\nexport type CardStatProps = {\n /** 面板标签 */\n label: React.ReactNode;\n /** 面板数值(数字或短文本) */\n value: React.ReactNode;\n /** 色调(决定数值文字色 / 角标三角 / filled 底色) */\n tone?: CardInfoTone;\n /** 加载态:值显示为骨架 */\n loading?: boolean;\n className?: string;\n /** 数值单位后缀(如 `K`、`%`),以小号字体渲染在数值右侧。 */\n unit?: React.ReactNode;\n /** 面板数值字号,默认 `xl`。 */\n valueSize?: 'md' | 'lg' | 'xl' | '2xl';\n /** 面板内容对齐,默认 `left`。 */\n align?: 'left' | 'center';\n /** 直接传入迷你图节点(优先于 sparklineData)。 */\n sparkline?: React.ReactNode;\n /** 迷你图数据:传入数值数组后自动渲染 sparkline。 */\n sparklineData?: number[];\n /** 迷你图类型:折线 / 面积 / 柱状。 */\n sparklineType?: 'line' | 'area' | 'bar';\n /** 迷你图高度(px)。 */\n sparklineHeight?: number;\n /** 右上角状态三角(Grafana 阈值指示)。 */\n indicator?: boolean;\n /** 整卡填充 tone 底色、文字用对应 content 色(图 RabbitMQ 风格)。 */\n filled?: boolean;\n /** 点击回调(面板常用于跳转详情)。 */\n onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;\n};\n\nconst STAT_TONE_TEXT_CLASS: Record<NonNullable<CardStatProps['tone']>, string> = {\n primary: 'text-primary',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n error: 'text-error',\n neutral: 'text-base-content/70',\n};\n\n/** filled 模式:整卡 tone 底色 + 对应 content 文字色 */\nconst STAT_FILLED_CLASS: Record<NonNullable<CardStatProps['tone']>, string> = {\n primary: 'bg-primary text-primary-content',\n success: 'bg-success text-success-content',\n warning: 'bg-warning text-warning-content',\n info: 'bg-info text-info-content',\n error: 'bg-error text-error-content',\n neutral: 'bg-neutral text-neutral-content',\n};\n\nconst STAT_VALUE_SIZE_CLASS: Record<NonNullable<CardStatProps['valueSize']> & string, string> = {\n md: 'text-2xl',\n lg: 'text-4xl',\n xl: 'text-5xl',\n '2xl': 'text-6xl',\n};\n\nconst statCssVarColor = (tone: NonNullable<CardStatProps['tone']>) =>\n tone === 'neutral' ? 'var(--color-base-content)' : `var(--color-${tone})`;\n\n/** 由数值数组生成迷你图(viewBox 拉伸铺满,描边不随宽度变形) */\nconst MiniSparkline: React.FC<{\n data: number[];\n type: 'line' | 'area' | 'bar';\n height: number;\n}> = ({ data, type, height }) => {\n if (!data || data.length < 2) return null;\n const w = 100;\n const pad = 3;\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n const px = (i: number) => (i / (data.length - 1)) * w;\n const py = (v: number) => height - pad - ((v - min) / range) * (height - pad * 2);\n const points = data.map((v, i) => `${px(i).toFixed(2)},${py(v).toFixed(2)}`);\n\n if (type === 'bar') {\n const bw = w / data.length;\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n {data.map((v, i) => (\n <rect\n key={i}\n x={px(i) - bw / 2}\n y={py(v)}\n width={bw * 0.8}\n height={Math.max(1, height - pad - py(v))}\n fill=\"currentColor\"\n />\n ))}\n </svg>\n );\n }\n\n if (type === 'area') {\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n <path\n d={`M0,${height} L${points.join(' L')} L${w},${height} Z`}\n fill=\"currentColor\"\n opacity={0.18}\n />\n <polyline\n points={points.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n );\n }\n\n return (\n <svg\n viewBox={`0 0 ${w} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"block w-full\"\n style={{ height }}\n aria-hidden=\"true\"\n >\n <polyline\n points={points.join(' ')}\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.5}\n vectorEffect=\"non-scaling-stroke\"\n />\n </svg>\n );\n};\n\n/**\n * 统计面板:Grafana stat panel 风格的「标签 + 超大数值 + 迷你图」小卡,\n * 支持单位后缀、折线 / 面积 / 柱状迷你图、角标状态三角与整卡填充色。\n *\n * 简单的「标签 + 数值 + 图标」指标卡请使用 `Card.Info`。\n */\nconst CardStat: React.FC<CardStatProps> = ({\n label,\n value,\n tone = 'primary',\n loading = false,\n className = '',\n unit,\n valueSize = 'xl',\n align = 'left',\n sparkline,\n sparklineData,\n sparklineType = 'line',\n sparklineHeight = 36,\n indicator = false,\n filled = false,\n onClick,\n}) => {\n const sparklineNode =\n sparkline ??\n (sparklineData && sparklineData.length >= 2 ? (\n <MiniSparkline data={sparklineData} type={sparklineType} height={sparklineHeight} />\n ) : null);\n\n const textColor = filled ? '' : STAT_TONE_TEXT_CLASS[tone];\n const mutedText = filled ? 'opacity-80' : 'text-base-content/60';\n\n return (\n <div\n onClick={onClick}\n className={`relative flex flex-col overflow-hidden rounded-lg p-3 ${\n filled ? STAT_FILLED_CLASS[tone] : 'border border-base-300/60 bg-base-200'\n } ${onClick ? 'cursor-pointer transition-colors hover:border-primary/40' : ''} ${className}`.trim()}\n >\n {indicator && !filled && (\n <span\n aria-hidden=\"true\"\n className=\"absolute right-0 top-0 h-0 w-0\"\n style={{\n borderTop: '14px solid ' + statCssVarColor(tone),\n borderLeft: '14px solid transparent',\n }}\n />\n )}\n <div\n className={`truncate text-xs font-medium ${mutedText} ${align === 'center' ? 'text-center' : ''}`.trim()}\n >\n {label}\n </div>\n <div\n className={`flex min-h-[3rem] flex-1 items-center py-1 ${align === 'center' ? 'justify-center' : 'justify-start'}`}\n >\n {loading ? (\n <span\n className={`inline-block h-8 w-16 animate-pulse rounded ${\n filled ? 'bg-white/25' : 'bg-base-content/10'\n }`}\n />\n ) : (\n <span className={`leading-none tracking-tight ${STAT_VALUE_SIZE_CLASS[valueSize]} font-semibold ${filled ? '' : textColor}`.trim()}>\n {value}\n {unit !== undefined && unit !== null && unit !== '' && (\n <span className=\"ml-0.5 text-[0.45em] font-semibold\">{unit}</span>\n )}\n </span>\n )}\n </div>\n {sparklineNode && (\n <div className={`-mx-3 -mb-3 mt-1 ${filled ? 'text-white' : STAT_TONE_TEXT_CLASS[tone]}`}>\n {sparklineNode}\n </div>\n )}\n </div>\n );\n};\n\n// 扩展Card组件,添加子组件\ninterface CardCompound extends React.FC<CardProps> {\n Metric: React.FC<CardMetricProps>;\n /** Jira 风格工单卡:状态、类型、负责人、优先级、日期、估算与子任务进度。 */\n Ticket: React.FC<CardTicketProps>;\n Title: React.FC<CardTitleProps>;\n Body: React.FC<CardBodyProps>;\n Actions: React.FC<CardActionsProps>;\n Figure: React.FC<CardFigureProps>;\n /** 特性卡:图标 + 标题 + 描述(垂直居中 / 横向两种布局) */\n Feature: React.FC<CardFeatureProps>;\n /** 引用卡:引用文本 + 作者头像 / 日期 + 装饰引号 */\n Quote: React.FC<CardQuoteProps>;\n /** 元信息卡:标题 + 徽章 + 描述 + 左右页脚 */\n Meta: React.FC<CardMetaProps>;\n /** 指标卡:标签 + 数值 + 可选图标 / hint / 加载态(仪表盘统计卡片) */\n Info: React.FC<CardInfoProps>;\n /** 统计面板:Grafana 风格超大数值 + 迷你折线 / 面积 / 柱状图 / 角标 / 填充色 */\n Stat: React.FC<CardStatProps>;\n /** AI 审批卡片:明确展示待批准操作及可选方案。 */\n Approval: React.FC<ApprovalCardProps>;\n /** AI 推荐卡片:首选建议、置信度与替代方案。 */\n Recommendation: React.FC<RecommendationCardProps>;\n /** AI 上下文卡片集合:检索片段与来源。 */\n Context: React.FC<ContextCardsProps>;\n /** AI 洞察指标卡片集合。 */\n Insights: React.FC<InsightCardsProps>;\n /** AI 微调任务状态卡片。 */\n FineTune: React.FC<FineTuneCardProps>;\n /** Linear 风格的工单卡片:标题、标签、类型图标、编号、优先级点、估点与负责人。 */\n Issue: React.FC<IssueCardProps>;\n /** Agent 运行卡片:头像 + 名称 + 模型、状态徽章、任务、当前动作、进度条、元信息与分支页脚。 */\n Run: React.FC<AgentRunCardProps>;\n}\n\nconst CardWithCompounds = Card as CardCompound;\nCardWithCompounds.Title = CardTitle;\nCardWithCompounds.Body = CardBody;\nCardWithCompounds.Actions = CardActions;\nCardWithCompounds.Figure = CardFigure;\nCardWithCompounds.Feature = CardFeature;\nCardWithCompounds.Quote = CardQuote;\nCardWithCompounds.Meta = CardMeta;\nCardWithCompounds.Info = CardInfo;\nCardWithCompounds.Stat = CardStat;\nCardWithCompounds.Metric = CardMetric;\nCardWithCompounds.Ticket = CardTicket;\nCardWithCompounds.Approval = ApprovalCard;\nCardWithCompounds.Recommendation = RecommendationCard;\nCardWithCompounds.Context = ContextCards;\nCardWithCompounds.Insights = InsightCards;\nCardWithCompounds.FineTune = FineTuneCard;\nCardWithCompounds.Issue = IssueCard;\nCardWithCompounds.Run = AgentRunCard;\n\nexport default CardWithCompounds; "],"mappings":";;;;;;;;;;;;;;AAgDA,IAAM,KAAQ,EACZ,aACA,YACA,cAAW,IACX,UAAO,IACP,UAAO,IACP,eAAY,IACZ,aAAU,IACV,WAAQ,IACR,WAAQ,IACR,iBACA,UACA,UAAO,MACP,eAAY,SACG;CACf,IAEM,IAAgB,KAAS,CAAC,IAAU,sBAAsB,IAG1D,IAAe,IAAU,MAAM,EAAQ,QAAQ,EAAQ,sBAAsB,IAE7E,IAAgB,IAAW,kBAAkB,IAC7C,IAAY,IAAO,cAAc,IACjC,IAAY,IAAO,cAAc,IACjC,IAAiB,IAAY,eAAe,IAC5C,IAAe,IAAU,iBAAiB,IAC1C,IAAa,IAAQ,iFAAiF,IACtG,IAAY,IAAO,QAAQ,MAAS;CAKpB,EAAU,SAAS,IAAI,KAAK,EAAU,MAAM,eAAe;CAGjF,IAAM,IAAc,EAClB,QACA,IACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,GACA,CACF;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW;EAAa,OAAO,EAAe;GAAE;GAAS;GAAO;GAAc;EAAM,CAAC;EACvF;CACE,CAAA;AAET,GAQM,KAAa,EACjB,aACA,eAAY,SACQ;CACpB,IAAM,IAAe,EAAG,cAAc,CAAS;CAE/C,OACE,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,GAC1B,EAAkB,MAAM"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ export type AgentRunStatus = 'queued' | 'running' | 'waiting' | 'done' | 'failed';
3
+ export type AgentRunMeta = {
4
+ label?: React.ReactNode;
5
+ value: React.ReactNode;
6
+ };
7
+ export type AgentRunCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onSelect'> & {
8
+ /** Agent name (e.g. `Sol`). */
9
+ name: React.ReactNode;
10
+ /** Model or engine label shown beside the name (e.g. `Opus 5`). */
11
+ model?: React.ReactNode;
12
+ /** Avatar slot, typically an `Avatar` with the agent's initials. */
13
+ avatar?: React.ReactNode;
14
+ /** Run status; drives the trailing badge tone and progress colour. */
15
+ status?: AgentRunStatus;
16
+ /** Explicit status label; defaults to a capitalised form of `status`. */
17
+ statusLabel?: React.ReactNode;
18
+ /** The task the agent is working on (single truncating line). */
19
+ task?: React.ReactNode;
20
+ /** Current activity line, prefixed by a status dot. */
21
+ activity?: React.ReactNode;
22
+ /** Progress from 0 to 1. When omitted, the progress row is hidden. */
23
+ progress?: number;
24
+ /** Compact meta values shown in a row (e.g. steps, elapsed, tokens). */
25
+ meta?: AgentRunMeta[];
26
+ /** Monospace footer, typically a branch or path. */
27
+ footer?: React.ReactNode;
28
+ /** Selected state (raised border). */
29
+ selected?: boolean;
30
+ /** Click handler turns the card into a button for keyboard users. */
31
+ onSelect?: () => void;
32
+ };
33
+ /**
34
+ * Agent run card: avatar + name + model, a status badge, the task, a current
35
+ * activity line, an optional progress bar with percentage, a compact meta row
36
+ * (steps / elapsed / tokens) and a monospace footer (branch or path).
37
+ */
38
+ export default function AgentRunCard({ name, model, avatar, status, statusLabel, task, activity, progress, meta, footer, selected, onSelect, className, ...rest }: AgentRunCardProps): React.JSX.Element;
@@ -0,0 +1,100 @@
1
+ import { cn as e } from "../../../utils/cn.js";
2
+ import { clamp as t } from "../shared.js";
3
+ /* empty css */
4
+ import "react";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
+ //#region src/components/ai/AgentRunCard/index.tsx
7
+ var i = {
8
+ queued: "Queued",
9
+ running: "Running",
10
+ waiting: "Waiting",
11
+ done: "Done",
12
+ failed: "Failed"
13
+ }, a = [];
14
+ function o({ name: o, model: s, avatar: c, status: l = "queued", statusLabel: u, task: d, activity: f, progress: p, meta: m = a, footer: h, selected: g = !1, onSelect: _, className: v, ...y }) {
15
+ let b = !!_, x = typeof p == "number" && Number.isFinite(p), S = x ? Math.round(t(p, 0, 1) * 100) : 0, C = l === "running", w = u ?? i[l];
16
+ return /* @__PURE__ */ r("div", {
17
+ ...y,
18
+ className: e("dishui-ai-run-card", `dishui-ai-run-card--${l}`, g && "dishui-ai-run-card--selected", b && "dishui-ai-run-card--interactive", v),
19
+ role: b ? "button" : void 0,
20
+ tabIndex: b ? 0 : void 0,
21
+ "aria-pressed": b ? g : void 0,
22
+ onClick: b ? _ : y.onClick,
23
+ onKeyDown: b ? (e) => {
24
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.repeat || _?.());
25
+ } : void 0,
26
+ children: [
27
+ /* @__PURE__ */ r("header", {
28
+ className: "dishui-ai-run-card__header",
29
+ children: [
30
+ c != null && /* @__PURE__ */ n("span", {
31
+ className: "dishui-ai-run-card__avatar",
32
+ children: c
33
+ }),
34
+ /* @__PURE__ */ r("span", {
35
+ className: "dishui-ai-run-card__identity",
36
+ children: [/* @__PURE__ */ n("span", {
37
+ className: "dishui-ai-run-card__name",
38
+ children: o
39
+ }), s != null && /* @__PURE__ */ n("span", {
40
+ className: "dishui-ai-run-card__model",
41
+ children: s
42
+ })]
43
+ }),
44
+ /* @__PURE__ */ r("span", {
45
+ className: e("dishui-ai-run-card__status", `dishui-ai-run-card__status--${l}`),
46
+ role: "status",
47
+ "aria-live": "polite",
48
+ children: [/* @__PURE__ */ n("span", {
49
+ className: e("dishui-ai-run-card__dot", C && "dishui-ai-run-card__dot--live"),
50
+ "aria-hidden": "true"
51
+ }), w]
52
+ })
53
+ ]
54
+ }),
55
+ d != null && /* @__PURE__ */ n("div", {
56
+ className: "dishui-ai-run-card__task",
57
+ children: d
58
+ }),
59
+ f != null && /* @__PURE__ */ r("div", {
60
+ className: "dishui-ai-run-card__activity",
61
+ children: [/* @__PURE__ */ n("span", {
62
+ className: "dishui-ai-run-card__activity-dot",
63
+ "aria-hidden": "true"
64
+ }), /* @__PURE__ */ n("span", {
65
+ className: "dishui-ai-run-card__activity-text",
66
+ children: f
67
+ })]
68
+ }),
69
+ x && /* @__PURE__ */ r("div", {
70
+ className: "dishui-ai-run-card__progress",
71
+ children: [/* @__PURE__ */ n("span", {
72
+ className: "dishui-ai-run-card__track",
73
+ role: "progressbar",
74
+ "aria-valuemin": 0,
75
+ "aria-valuemax": 100,
76
+ "aria-valuenow": S,
77
+ children: /* @__PURE__ */ n("span", {
78
+ className: "dishui-ai-run-card__fill",
79
+ style: { width: `${S}%` }
80
+ })
81
+ }), /* @__PURE__ */ r("span", {
82
+ className: "dishui-ai-run-card__pct",
83
+ children: [S, "%"]
84
+ })]
85
+ }),
86
+ m.length > 0 && /* @__PURE__ */ n("dl", {
87
+ className: "dishui-ai-run-card__meta",
88
+ children: m.map((e, t) => /* @__PURE__ */ r("div", { children: [e.label !== null && e.label !== void 0 && /* @__PURE__ */ n("dt", { children: e.label }), /* @__PURE__ */ n("dd", { children: e.value })] }, e.label !== null && e.label !== void 0 ? `${String(e.label)}-${t}` : `meta-${t}`))
89
+ }),
90
+ h != null && /* @__PURE__ */ n("div", {
91
+ className: "dishui-ai-run-card__footer",
92
+ children: h
93
+ })
94
+ ]
95
+ });
96
+ }
97
+ //#endregion
98
+ export { o as default };
99
+
100
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ai/AgentRunCard/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../../utils/cn';\nimport { clamp } from '../shared';\nimport './AgentRunCard.css';\n\nexport type AgentRunStatus = 'queued' | 'running' | 'waiting' | 'done' | 'failed';\n\nexport type AgentRunMeta = {\n label?: React.ReactNode;\n value: React.ReactNode;\n};\n\nexport type AgentRunCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onSelect'> & {\n /** Agent name (e.g. `Sol`). */\n name: React.ReactNode;\n /** Model or engine label shown beside the name (e.g. `Opus 5`). */\n model?: React.ReactNode;\n /** Avatar slot, typically an `Avatar` with the agent's initials. */\n avatar?: React.ReactNode;\n /** Run status; drives the trailing badge tone and progress colour. */\n status?: AgentRunStatus;\n /** Explicit status label; defaults to a capitalised form of `status`. */\n statusLabel?: React.ReactNode;\n /** The task the agent is working on (single truncating line). */\n task?: React.ReactNode;\n /** Current activity line, prefixed by a status dot. */\n activity?: React.ReactNode;\n /** Progress from 0 to 1. When omitted, the progress row is hidden. */\n progress?: number;\n /** Compact meta values shown in a row (e.g. steps, elapsed, tokens). */\n meta?: AgentRunMeta[];\n /** Monospace footer, typically a branch or path. */\n footer?: React.ReactNode;\n /** Selected state (raised border). */\n selected?: boolean;\n /** Click handler turns the card into a button for keyboard users. */\n onSelect?: () => void;\n};\n\nconst STATUS_LABEL: Record<AgentRunStatus, string> = {\n queued: 'Queued',\n running: 'Running',\n waiting: 'Waiting',\n done: 'Done',\n failed: 'Failed',\n};\n\nconst EMPTY_META: AgentRunMeta[] = [];\n\n/**\n * Agent run card: avatar + name + model, a status badge, the task, a current\n * activity line, an optional progress bar with percentage, a compact meta row\n * (steps / elapsed / tokens) and a monospace footer (branch or path).\n */\nexport default function AgentRunCard({\n name,\n model,\n avatar,\n status = 'queued',\n statusLabel,\n task,\n activity,\n progress,\n meta = EMPTY_META,\n footer,\n selected = false,\n onSelect,\n className,\n ...rest\n}: AgentRunCardProps) {\n const interactive = !!onSelect;\n const hasProgress = typeof progress === 'number' && Number.isFinite(progress);\n const pct = hasProgress ? Math.round(clamp(progress as number, 0, 1) * 100) : 0;\n const live = status === 'running';\n const label = statusLabel ?? STATUS_LABEL[status];\n\n return (\n <div\n {...rest}\n className={cn(\n 'dishui-ai-run-card',\n `dishui-ai-run-card--${status}`,\n selected && 'dishui-ai-run-card--selected',\n interactive && 'dishui-ai-run-card--interactive',\n className,\n )}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-pressed={interactive ? selected : undefined}\n onClick={interactive ? onSelect : rest.onClick}\n onKeyDown={interactive ? (event) => {\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n if (!event.repeat) onSelect?.();\n }\n } : undefined}\n >\n <header className=\"dishui-ai-run-card__header\">\n {avatar !== null && avatar !== undefined && <span className=\"dishui-ai-run-card__avatar\">{avatar}</span>}\n <span className=\"dishui-ai-run-card__identity\">\n <span className=\"dishui-ai-run-card__name\">{name}</span>\n {model !== null && model !== undefined && <span className=\"dishui-ai-run-card__model\">{model}</span>}\n </span>\n <span\n className={cn('dishui-ai-run-card__status', `dishui-ai-run-card__status--${status}`)}\n role=\"status\"\n aria-live=\"polite\"\n >\n <span className={cn('dishui-ai-run-card__dot', live && 'dishui-ai-run-card__dot--live')} aria-hidden=\"true\" />\n {label}\n </span>\n </header>\n\n {task !== null && task !== undefined && <div className=\"dishui-ai-run-card__task\">{task}</div>}\n\n {activity !== null && activity !== undefined && (\n <div className=\"dishui-ai-run-card__activity\">\n <span className=\"dishui-ai-run-card__activity-dot\" aria-hidden=\"true\" />\n <span className=\"dishui-ai-run-card__activity-text\">{activity}</span>\n </div>\n )}\n\n {hasProgress && (\n <div className=\"dishui-ai-run-card__progress\">\n <span\n className=\"dishui-ai-run-card__track\"\n role=\"progressbar\"\n aria-valuemin={0}\n aria-valuemax={100}\n aria-valuenow={pct}\n >\n <span className=\"dishui-ai-run-card__fill\" style={{ width: `${pct}%` }} />\n </span>\n <span className=\"dishui-ai-run-card__pct\">{pct}%</span>\n </div>\n )}\n\n {meta.length > 0 && (\n <dl className=\"dishui-ai-run-card__meta\">\n {meta.map((item, index) => (\n <div key={item.label !== null && item.label !== undefined ? `${String(item.label)}-${index}` : `meta-${index}`}>\n {item.label !== null && item.label !== undefined && <dt>{item.label}</dt>}\n <dd>{item.value}</dd>\n </div>\n ))}\n </dl>\n )}\n\n {footer !== null && footer !== undefined && <div className=\"dishui-ai-run-card__footer\">{footer}</div>}\n </div>\n );\n}\n"],"mappings":";;;;;;AAuCA,IAAM,IAA+C;CACnD,QAAQ;CACR,SAAS;CACT,SAAS;CACT,MAAM;CACN,QAAQ;AACV,GAEM,IAA6B,CAAC;AAOpC,SAAwB,EAAa,EACnC,SACA,UACA,WACA,YAAS,UACT,gBACA,SACA,aACA,aACA,UAAO,GACP,WACA,cAAW,IACX,aACA,cACA,GAAG,KACiB;CACpB,IAAM,IAAc,CAAC,CAAC,GAChB,IAAc,OAAO,KAAa,YAAY,OAAO,SAAS,CAAQ,GACtE,IAAM,IAAc,KAAK,MAAM,EAAM,GAAoB,GAAG,CAAC,IAAI,GAAG,IAAI,GACxE,IAAO,MAAW,WAClB,IAAQ,KAAe,EAAa;CAE1C,OACE,kBAAC,OAAD;EACE,GAAI;EACJ,WAAW,EACT,sBACA,uBAAuB,KACvB,KAAY,gCACZ,KAAe,mCACf,CACF;EACA,MAAM,IAAc,WAAW,KAAA;EAC/B,UAAU,IAAc,IAAI,KAAA;EAC5B,gBAAc,IAAc,IAAW,KAAA;EACvC,SAAS,IAAc,IAAW,EAAK;EACvC,WAAW,KAAe,MAAU;GAC9B,EAAM,WAAW,EAAM,kBACvB,EAAM,QAAQ,WAAW,EAAM,QAAQ,SACzC,EAAM,eAAe,GAChB,EAAM,UAAQ,IAAW;EAElC,IAAI,KAAA;EAnBN,UAAA;GAqBE,kBAAC,UAAD;IAAQ,WAAU;IAAlB,UAAA;KACG,KAAW,QAAgC,kBAAC,QAAD;MAAM,WAAU;MAA8B,UAAA;KAAa,CAAA;KACvG,kBAAC,QAAD;MAAM,WAAU;MAAhB,UAAA,CACE,kBAAC,QAAD;OA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GlG,CACN;GACC,CAAA;GAGL,KAAW,QAAgC,kBAAC,OAAD;IAAK,WAAU;IAA8B,UAAA;GAAY,CAAA;EAClG;;AAET"}
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ /** Priority tone drives the small trailing dot beside the identifier. */
3
+ export type IssuePriority = 'none' | 'low' | 'medium' | 'high' | 'urgent';
4
+ /** Accent stripe on the leading edge of the card. */
5
+ export type IssueAccent = 'none' | 'neutral' | 'info' | 'success' | 'warning' | 'danger';
6
+ export type IssueLabel = {
7
+ id?: string;
8
+ text: React.ReactNode;
9
+ };
10
+ export type IssueCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onSelect'> & {
11
+ /** Primary issue title. */
12
+ title: React.ReactNode;
13
+ /** Short labels/tags shown below the title (e.g. `ui`, `infra`). */
14
+ labels?: Array<IssueLabel | string>;
15
+ /** Leading icon slot (e.g. issue type glyph). Style the box via `iconTone`. */
16
+ icon?: React.ReactNode;
17
+ /** Colour of the leading icon box. */
18
+ iconTone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
19
+ /** Human-facing identifier, rendered in a monospace, tabular style (e.g. `FCE-38`). */
20
+ identifier?: React.ReactNode;
21
+ /** Priority drives the coloured dot next to the identifier. */
22
+ priority?: IssuePriority;
23
+ /** Numeric badge on the trailing edge (e.g. estimate/points). */
24
+ count?: React.ReactNode;
25
+ /** Assignee slot, typically an `Avatar`. */
26
+ assignee?: React.ReactNode;
27
+ /** Coloured stripe on the leading edge. Defaults to `none`. */
28
+ accent?: IssueAccent;
29
+ /** Selected state (raises border + subtle surface shift). */
30
+ selected?: boolean;
31
+ /** Click handler turns the card into a button for keyboard users. */
32
+ onSelect?: () => void;
33
+ };
34
+ /**
35
+ * Linear-style issue card: an optional accent stripe, a title, small labels,
36
+ * and a footer that pairs a type icon, identifier, a priority dot, an estimate
37
+ * and an assignee. Status is always carried by text/icon, never colour alone.
38
+ */
39
+ export default function IssueCard({ title, labels, icon, iconTone, identifier, priority, count, assignee, accent, selected, onSelect, className, ...rest }: IssueCardProps): React.JSX.Element;
@@ -0,0 +1,78 @@
1
+ import { cn as e } from "../../../utils/cn.js";
2
+ /* empty css */
3
+ import "react";
4
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
+ //#region src/components/ai/IssueCard/index.tsx
6
+ var r = {
7
+ none: "No priority",
8
+ low: "Low priority",
9
+ medium: "Medium priority",
10
+ high: "High priority",
11
+ urgent: "Urgent priority"
12
+ }, i = [], a = (e, t) => typeof e == "string" ? {
13
+ text: e,
14
+ key: `${e}-${t}`
15
+ } : {
16
+ ...e,
17
+ key: e.id ?? `${String(e.text)}-${t}`
18
+ };
19
+ function o({ title: o, labels: s = i, icon: c, iconTone: l = "neutral", identifier: u, priority: d = "none", count: f, assignee: p, accent: m = "none", selected: h = !1, onSelect: g, className: _, ...v }) {
20
+ let y = !!g, b = s.map(a);
21
+ return /* @__PURE__ */ n("div", {
22
+ ...v,
23
+ className: e("dishui-ai-issue-card", m !== "none" && `dishui-ai-issue-card--accent-${m}`, h && "dishui-ai-issue-card--selected", y && "dishui-ai-issue-card--interactive", _),
24
+ role: y ? "button" : void 0,
25
+ tabIndex: y ? 0 : void 0,
26
+ "aria-pressed": y ? h : void 0,
27
+ onClick: y ? g : v.onClick,
28
+ onKeyDown: y ? (e) => {
29
+ e.target === e.currentTarget && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.repeat || g?.());
30
+ } : void 0,
31
+ children: [
32
+ /* @__PURE__ */ t("h3", {
33
+ className: "dishui-ai-issue-card__title",
34
+ children: o
35
+ }),
36
+ b.length > 0 && /* @__PURE__ */ t("div", {
37
+ className: "dishui-ai-issue-card__labels",
38
+ children: b.map((e) => /* @__PURE__ */ t("span", {
39
+ className: "dishui-ai-issue-card__label",
40
+ children: e.text
41
+ }, e.key))
42
+ }),
43
+ /* @__PURE__ */ n("div", {
44
+ className: "dishui-ai-issue-card__footer",
45
+ children: [
46
+ c != null && /* @__PURE__ */ t("span", {
47
+ className: e("dishui-ai-issue-card__icon", `dishui-ai-issue-card__icon--${l}`),
48
+ "aria-hidden": "true",
49
+ children: c
50
+ }),
51
+ u != null && /* @__PURE__ */ t("span", {
52
+ className: "dishui-ai-issue-card__id",
53
+ children: u
54
+ }),
55
+ d !== "none" && /* @__PURE__ */ t("span", {
56
+ className: e("dishui-ai-issue-card__priority", `dishui-ai-issue-card__priority--${d}`),
57
+ role: "img",
58
+ "aria-label": r[d],
59
+ title: r[d]
60
+ }),
61
+ /* @__PURE__ */ t("span", { className: "dishui-ai-issue-card__spacer" }),
62
+ f != null && /* @__PURE__ */ t("span", {
63
+ className: "dishui-ai-issue-card__count",
64
+ children: f
65
+ }),
66
+ p != null && /* @__PURE__ */ t("span", {
67
+ className: "dishui-ai-issue-card__assignee",
68
+ children: p
69
+ })
70
+ ]
71
+ })
72
+ ]
73
+ });
74
+ }
75
+ //#endregion
76
+ export { o as default };
77
+
78
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../src/components/ai/IssueCard/index.tsx"],"sourcesContent":["import React from 'react';\nimport { cn } from '../../../utils/cn';\nimport './IssueCard.css';\n\n/** Priority tone drives the small trailing dot beside the identifier. */\nexport type IssuePriority = 'none' | 'low' | 'medium' | 'high' | 'urgent';\n\n/** Accent stripe on the leading edge of the card. */\nexport type IssueAccent = 'none' | 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n\nexport type IssueLabel = {\n id?: string;\n text: React.ReactNode;\n};\n\nexport type IssueCardProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'title' | 'onSelect'> & {\n /** Primary issue title. */\n title: React.ReactNode;\n /** Short labels/tags shown below the title (e.g. `ui`, `infra`). */\n labels?: Array<IssueLabel | string>;\n /** Leading icon slot (e.g. issue type glyph). Style the box via `iconTone`. */\n icon?: React.ReactNode;\n /** Colour of the leading icon box. */\n iconTone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n /** Human-facing identifier, rendered in a monospace, tabular style (e.g. `FCE-38`). */\n identifier?: React.ReactNode;\n /** Priority drives the coloured dot next to the identifier. */\n priority?: IssuePriority;\n /** Numeric badge on the trailing edge (e.g. estimate/points). */\n count?: React.ReactNode;\n /** Assignee slot, typically an `Avatar`. */\n assignee?: React.ReactNode;\n /** Coloured stripe on the leading edge. Defaults to `none`. */\n accent?: IssueAccent;\n /** Selected state (raises border + subtle surface shift). */\n selected?: boolean;\n /** Click handler turns the card into a button for keyboard users. */\n onSelect?: () => void;\n};\n\nconst PRIORITY_LABEL: Record<IssuePriority, string> = {\n none: 'No priority',\n low: 'Low priority',\n medium: 'Medium priority',\n high: 'High priority',\n urgent: 'Urgent priority',\n};\n\nconst EMPTY_LABELS: Array<IssueLabel | string> = [];\n\nconst toLabel = (label: IssueLabel | string, index: number): IssueLabel & { key: string } => {\n if (typeof label === 'string') return { text: label, key: `${label}-${index}` };\n return { ...label, key: label.id ?? `${String(label.text)}-${index}` };\n};\n\n/**\n * Linear-style issue card: an optional accent stripe, a title, small labels,\n * and a footer that pairs a type icon, identifier, a priority dot, an estimate\n * and an assignee. Status is always carried by text/icon, never colour alone.\n */\nexport default function IssueCard({\n title,\n labels = EMPTY_LABELS,\n icon,\n iconTone = 'neutral',\n identifier,\n priority = 'none',\n count,\n assignee,\n accent = 'none',\n selected = false,\n onSelect,\n className,\n ...rest\n}: IssueCardProps) {\n const interactive = !!onSelect;\n const items = labels.map(toLabel);\n\n return (\n <div\n {...rest}\n className={cn(\n 'dishui-ai-issue-card',\n accent !== 'none' && `dishui-ai-issue-card--accent-${accent}`,\n selected && 'dishui-ai-issue-card--selected',\n interactive && 'dishui-ai-issue-card--interactive',\n className,\n )}\n role={interactive ? 'button' : undefined}\n tabIndex={interactive ? 0 : undefined}\n aria-pressed={interactive ? selected : undefined}\n onClick={interactive ? onSelect : rest.onClick}\n onKeyDown={interactive ? (event) => {\n if (event.target !== event.currentTarget) return;\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n if (!event.repeat) onSelect?.();\n }\n } : undefined}\n >\n <h3 className=\"dishui-ai-issue-card__title\">{title}</h3>\n\n {items.length > 0 && (\n <div className=\"dishui-ai-issue-card__labels\">\n {items.map(label => (\n <span key={label.key} className=\"dishui-ai-issue-card__label\">{label.text}</span>\n ))}\n </div>\n )}\n\n <div className=\"dishui-ai-issue-card__footer\">\n {icon !== null && icon !== undefined && (\n <span className={cn('dishui-ai-issue-card__icon', `dishui-ai-issue-card__icon--${iconTone}`)} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {identifier !== null && identifier !== undefined && (\n <span className=\"dishui-ai-issue-card__id\">{identifier}</span>\n )}\n {priority !== 'none' && (\n <span\n className={cn('dishui-ai-issue-card__priority', `dishui-ai-issue-card__priority--${priority}`)}\n role=\"img\"\n aria-label={PRIORITY_LABEL[priority]}\n title={PRIORITY_LABEL[priority]}\n />\n )}\n <span className=\"dishui-ai-issue-card__spacer\" />\n {count !== null && count !== undefined && (\n <span className=\"dishui-ai-issue-card__count\">{count}</span>\n )}\n {assignee !== null && assignee !== undefined && (\n <span className=\"dishui-ai-issue-card__assignee\">{assignee}</span>\n )}\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;AAwCA,IAAM,IAAgD;CACpD,MAAM;CACN,KAAK;CACL,QAAQ;CACR,MAAM;CACN,QAAQ;AACV,GAEM,IAA2C,CAAC,GAE5C,KAAW,GAA4B,MACvC,OAAO,KAAU,WAAiB;CAAE,MAAM;CAAO,KAAK,GAAG,EAAM,GAAG;AAAQ,IACvE;CAAE,GAAG;CAAO,KAAK,EAAM,MAAM,GAAG,OAAO,EAAM,IAAI,EAAE,GAAG;AAAQ;AAQvE,SAAwB,EAAU,EAChC,UACA,YAAS,GACT,SACA,cAAW,WACX,eACA,cAAW,QACX,UACA,aACA,YAAS,QACT,cAAW,IACX,aACA,cACA,GAAG,KACc;CACjB,IAAM,IAAc,CAAC,CAAC,GAChB,IAAQ,EAAO,IAAI,CAAO;CAEhC,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ionActionsProps, SelectionAction } from './SelectionActions';
49
49
  export { default as AgentScreen } from './AgentScreen';
50
50
  export type { AgentScreenProps, AgentScreenStatus, AgentScreenLabels } from './AgentScreen';
51
+ export { default as IssueCard } from './IssueCard';
52
+ export type { IssueCardProps, IssueLabel, IssuePriority, IssueAccent } from './IssueCard';
53
+ export { default as AgentRunCard } from './AgentRunCard';
54
+ export type { AgentRunCardProps, AgentRunStatus, AgentRunMeta } from './AgentRunCard';
@@ -2,8 +2,8 @@
2
2
  var e = "root", t = {
3
3
  label: "Text",
4
4
  fill: "theme:base-100",
5
- stroke: "theme:base-content",
6
- strokeWidth: 2,
5
+ stroke: "theme:base-300",
6
+ strokeWidth: 1,
7
7
  color: "theme:base-content",
8
8
  fontSize: 14,
9
9
  attributes: []
@@ -16,7 +16,7 @@ var e = "root", t = {
16
16
  fontSize: 14,
17
17
  attributes: []
18
18
  }, r = {
19
- strokeColor: "theme:base-content",
19
+ strokeColor: "theme:base-300",
20
20
  strokeWidth: 2,
21
21
  lineStyle: "solid",
22
22
  markerEnd: "arrowclosed"
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":[],"sources":["../../../../src/components/pro/Flow/constants.ts"],"sourcesContent":["import type {\n FlowNodeData,\n FlowShapeType,\n FlowEdgeTypeName,\n FlowEdgeMarkerKind,\n FlowEdgeLineStyle,\n FlowEdgeDashDensity,\n FlowBorderStyle,\n GradientDirection,\n FlowDocument,\n FlowEdgeData,\n} from './types';\n\nexport const ROOT_CANVAS_ID = 'root';\n\nexport const DEFAULT_NODE_DATA: FlowNodeData = {\n label: 'Text',\n fill: 'theme:base-100',\n stroke: 'theme:base-content',\n strokeWidth: 2,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const TEXT_NODE_DATA: FlowNodeData = {\n label: 'Label',\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const DEFAULT_EDGE_DATA: FlowEdgeData = {\n strokeColor: 'theme:base-content',\n strokeWidth: 2,\n lineStyle: 'solid',\n markerEnd: 'arrowclosed',\n};\n\nexport const PALETTE_ITEMS: Array<{\n type: FlowShapeType;\n width: number;\n height: number;\n data: FlowNodeData;\n}> = [\n { type: 'shapeRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rectangle' } },\n { type: 'shapeRoundRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rounded' } },\n { type: 'shapeEllipse', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Ellipse' } },\n { type: 'shapeDiamond', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Diamond' } },\n { type: 'shapeDocument', width: 120, height: 80, data: { ...DEFAULT_NODE_DATA, label: 'Document' } },\n { type: 'shapeParallelogram', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Parallelogram' } },\n { type: 'shapeTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Triangle' } },\n { type: 'shapeTrapezoid', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Trapezoid' } },\n { type: 'shapePentagon', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Pentagon' } },\n { type: 'shapeHexagon', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagon' } },\n { type: 'shapeStar', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Star' } },\n { type: 'shapeHexagram', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagram' } },\n { type: 'shapeRightTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Right Triangle' } },\n { type: 'shapeCorner', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Corner' } },\n { type: 'textLabel', width: 120, height: 40, data: { ...TEXT_NODE_DATA, label: 'Label' } },\n { type: 'animAnchor', width: 320, height: 240, data: { ...DEFAULT_NODE_DATA, label: 'Anchor', fill: 'transparent', stroke: '#8b5cf6', strokeWidth: 1.5, borderStyle: 'dashed' } },\n { type: 'flowGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Group', fill: '#f0f9ff', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dotted', isGroup: true } },\n { type: 'geometryGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Geo Group', fill: '#fefce8', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dashed', isGroup: true } },\n];\n\nexport const EDGE_TYPE_OPTIONS: FlowEdgeTypeName[] = [\n 'smoothstep',\n 'step',\n 'straight',\n 'simplebezier',\n];\n\nexport const EDGE_MARKER_OPTIONS: FlowEdgeMarkerKind[] = [\n 'none',\n 'arrow',\n 'arrowclosed',\n];\n\nexport const EDGE_LINE_STYLE_OPTIONS: FlowEdgeLineStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const BORDER_STYLE_OPTIONS: FlowBorderStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const DASH_DENSITY_OPTIONS: FlowEdgeDashDensity[] = [\n 'sparse',\n 'medium',\n 'dense',\n];\n\nexport const GRADIENT_DIRECTION_OPTIONS: Array<{\n value: GradientDirection;\n label: string;\n}> = [\n { value: 'to-r', label: 'Left → Right' },\n { value: 'to-l', label: 'Right → Left' },\n { value: 'to-b', label: 'Top → Bottom' },\n { value: 'to-t', label: 'Bottom → Top' },\n { value: 'to-br', label: 'Top-Left → Bottom-Right' },\n { value: 'to-tl', label: 'Bottom-Right → Top-Left' },\n { value: 'to-tr', label: 'Bottom-Left → Top-Right' },\n { value: 'to-bl', label: 'Top-Right → Bottom-Left' },\n];\n\nexport const MIN_ZOOM = 0.1;\nexport const MAX_ZOOM = 4;\nexport const DEFAULT_GRID_SIZE = 20;\nexport const ZOOM_SENSITIVITY = 0.001;\nexport const SNAP_THRESHOLD = 5;\nexport const HANDLE_SIZ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C;CACzD;CACA;CACA;AACF,GAEa,IAGR;CACH;EAAE,OAAO;EAAQ,OAAO;CAAe;CACvC;EAAE,OAAO;EAAQ,OAAO;CAAe;CACvC;EAAE,OAAO;EAAQ,OAAO;CAAe;CACvC;EAAE,OAAO;EAAQ,OAAO;CAAe;CACvC;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;AACrD,GAEa,IAAW;AAOxB,SAAgB,IAAoC;CAClD,OAAO;EACL,UAAU,GAAG,IAAiB;GAAE,OAAO,CAAC;GAAG,OAAO,CAAC;GAAG,OAAO,CAAC;EAAE,EAAE;EAClE,OAAO,CAAC,CAAc;CACxB;AACF"}
1
+ {"version":3,"file":"constants.js","names":[],"sources":["../../../../src/components/pro/Flow/constants.ts"],"sourcesContent":["import type {\n FlowNodeData,\n FlowShapeType,\n FlowEdgeTypeName,\n FlowEdgeMarkerKind,\n FlowEdgeLineStyle,\n FlowEdgeDashDensity,\n FlowBorderStyle,\n GradientDirection,\n FlowDocument,\n FlowEdgeData,\n} from './types';\n\nexport const ROOT_CANVAS_ID = 'root';\n\nexport const DEFAULT_NODE_DATA: FlowNodeData = {\n label: 'Text',\n fill: 'theme:base-100',\n stroke: 'theme:base-300',\n strokeWidth: 1,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const TEXT_NODE_DATA: FlowNodeData = {\n label: 'Label',\n fill: 'transparent',\n stroke: 'transparent',\n strokeWidth: 0,\n color: 'theme:base-content',\n fontSize: 14,\n attributes: [],\n};\n\nexport const DEFAULT_EDGE_DATA: FlowEdgeData = {\n strokeColor: 'theme:base-300',\n strokeWidth: 2,\n lineStyle: 'solid',\n markerEnd: 'arrowclosed',\n};\n\nexport const PALETTE_ITEMS: Array<{\n type: FlowShapeType;\n width: number;\n height: number;\n data: FlowNodeData;\n}> = [\n { type: 'shapeRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rectangle' } },\n { type: 'shapeRoundRect', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Rounded' } },\n { type: 'shapeEllipse', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Ellipse' } },\n { type: 'shapeDiamond', width: 120, height: 120, data: { ...DEFAULT_NODE_DATA, label: 'Diamond' } },\n { type: 'shapeDocument', width: 120, height: 80, data: { ...DEFAULT_NODE_DATA, label: 'Document' } },\n { type: 'shapeParallelogram', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Parallelogram' } },\n { type: 'shapeTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Triangle' } },\n { type: 'shapeTrapezoid', width: 140, height: 72, data: { ...DEFAULT_NODE_DATA, label: 'Trapezoid' } },\n { type: 'shapePentagon', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Pentagon' } },\n { type: 'shapeHexagon', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagon' } },\n { type: 'shapeStar', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Star' } },\n { type: 'shapeHexagram', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Hexagram' } },\n { type: 'shapeRightTriangle', width: 120, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Right Triangle' } },\n { type: 'shapeCorner', width: 100, height: 100, data: { ...DEFAULT_NODE_DATA, label: 'Corner' } },\n { type: 'textLabel', width: 120, height: 40, data: { ...TEXT_NODE_DATA, label: 'Label' } },\n { type: 'animAnchor', width: 320, height: 240, data: { ...DEFAULT_NODE_DATA, label: 'Anchor', fill: 'transparent', stroke: '#8b5cf6', strokeWidth: 1.5, borderStyle: 'dashed' } },\n { type: 'flowGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Group', fill: '#f0f9ff', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dotted', isGroup: true } },\n { type: 'geometryGroup', width: 200, height: 160, data: { ...DEFAULT_NODE_DATA, label: 'Geo Group', fill: '#fefce8', stroke: '#9ca3af', strokeWidth: 1.5, borderStyle: 'dashed', isGroup: true } },\n];\n\nexport const EDGE_TYPE_OPTIONS: FlowEdgeTypeName[] = [\n 'smoothstep',\n 'step',\n 'straight',\n 'simplebezier',\n];\n\nexport const EDGE_MARKER_OPTIONS: FlowEdgeMarkerKind[] = [\n 'none',\n 'arrow',\n 'arrowclosed',\n];\n\nexport const EDGE_LINE_STYLE_OPTIONS: FlowEdgeLineStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const BORDER_STYLE_OPTIONS: FlowBorderStyle[] = [\n 'solid',\n 'dashed',\n 'dotted',\n 'dynamic',\n];\n\nexport const DASH_DENSITY_OPTIONS: FlowEdgeDashDensity[] = [\n 'sparse',\n 'medium',\n 'dense',\n];\n\nexport const GRADIENT_DIRECTION_OPTIONS: Array<{\n value: GradientDirection;\n label: string;\n}> = [\n { value: 'to-r', label: 'Left → Right' },\n { value: 'to-l', label: 'Right → Left' },\n { value: 'to-b', label: 'Top → Bottom' },\n { value: 'to-t', label: 'Bottom → Top' },\n { value: 'to-br', label: 'Top-Left → Bottom-Right' },\n { value: 'to-tl', label: 'Bottom-Right → Top-Left' },\n { value: 'to-tr', label: 'Bottom-Left → Top-Right' },\n { value: 'to-bl', label: 'Top-Right → Bottom-Left' },\n];\n\nexport const MIN_ZOOM = 0.1;\nexport const MAX_ZOOM = 4;\nexport const DEFAULT_GRID_SIZE = 20;\nexport const ZOOM_SENSITIVITY = 0.001;\nexport const SNAP_THRESHOLD = 5;\nexport const HANDLE_SIZE = 8;\n\nexport function createEmptyDocument(): FlowDocument {\n return {\n canvases: { [ROOT_CANVAS_ID]: { nodes: [], edges: [], lines: [] } },\n stack: [ROOT_CANVAS_ID],\n };\n}\n"],"mappings":";AAaA,IAAa,IAAiB,QAEjB,IAAkC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AQ,OAAO;CAAe;CACvC;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;CACnD;EAAE,OAAO;EAAS,OAAO;CAA0B;AACrD,GAEa,IAAW;AAOxB,SAAgB,IAAoC;CAClD,OAAO;EACL,UAAU,GAAG,IAAiB;GAAE,OAAO,CAAC;GAAG,OAAO,CAAC;GAAG,OAAO,CAAC;EAAE,EAAE;EAClE,OAAO,CAAC,CAAc;CACxB;AACF"}
@@ -106,7 +106,7 @@ function c(e, t, r) {
106
106
  }
107
107
  function l(e, t, r) {
108
108
  if (t.borderStyle === "none" || !t.stroke || t.stroke === "transparent" || t.strokeWidth <= 0) return;
109
- let a = r ?? Math.min(12, t.width * .1, t.height * .1), s = n(t.borderStyle, t.strokeWidth);
109
+ let a = r ?? Math.min(14, t.width * .1, t.height * .1), s = n(t.borderStyle, t.strokeWidth);
110
110
  if (s) {
111
111
  let n = t.borderStyle === "dynamic" ? t.dashOffset ?? 0 : 0;
112
112
  o(e, i(t.width, t.height, a), s, n, t.stroke, t.strokeWidth);
@@ -122,7 +122,7 @@ function d(e, t) {
122
122
  e.rect(0, 0, t.width, t.height), s(e, t), c(e, t, r(t.width, t.height));
123
123
  }
124
124
  function f(e, t) {
125
- let n = Math.min(12, t.width * .1, t.height * .1);
125
+ let n = Math.min(14, t.width * .1, t.height * .1);
126
126
  e.roundRect(0, 0, t.width, t.height, n), s(e, t), c(e, t, i(t.width, t.height, n));
127
127
  }
128
128
  function p(e, t) {
@@ -373,7 +373,7 @@ function A(e, t) {
373
373
  }
374
374
  function j(e, t, n) {
375
375
  switch (e) {
376
- case "shapeRoundRect": return Math.min(12, t * .1, n * .1);
376
+ case "shapeRoundRect": return Math.min(14, t * .1, n * .1);
377
377
  case "mediaNode": return 6;
378
378
  case "flowGroup":
379
379
  case "geometryGroup": return Math.min(6, t * .04, n * .04);