@beydesign/storybook 0.0.81 → 0.0.82
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.
|
@@ -8,7 +8,7 @@ import { Badge, ProgressIndicator, ProgressIndicatorMode, BadgeColor, BadgeSize,
|
|
|
8
8
|
import { MainButton, ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
9
9
|
import { ArrowsClockwise, Warning } from '@phosphor-icons/react';
|
|
10
10
|
import { getIconComponent } from '../../utils';
|
|
11
|
-
export const AgentCard = ({ title, description = '', date = '', showDate = false, badges = [], showBadges = false, showTimeBadge = false, showDescription = false, showMenu = false, menuItems = [], active = false, showActiveToggle = false, onActiveToggleChange, activeToggleDisabled = false, agentImage, time, onPreview, agentState, previewButtonText = 'Preview', showStatusBadge = false, statusBadgeText = '', showProgressIndicator = false, progressValue = 50, processingText = 'Creation in progress', agentId = '', }) => {
|
|
11
|
+
export const AgentCard = ({ title, description = '', date = '', showDate = false, badges = [], showBadges = false, showTimeBadge = false, showDescription = false, showMenu = false, menuItems = [], active = false, showActiveToggle = false, onActiveToggleChange, activeToggleDisabled = false, agentImage, time, onPreview, agentState, previewButtonText = 'Preview', showStatusBadge = false, statusBadgeText = '', showProgressIndicator = false, progressValue = 50, processingText = 'Creation in progress', agentId = '', onClickAgentId, }) => {
|
|
12
12
|
const [hovered, setHovered] = useState(false);
|
|
13
13
|
const [imageError, setImageError] = useState(false);
|
|
14
14
|
const [isLoading, setIsLoading] = useState(!!agentImage);
|
|
@@ -41,9 +41,6 @@ export const AgentCard = ({ title, description = '', date = '', showDate = false
|
|
|
41
41
|
img.onerror = null;
|
|
42
42
|
};
|
|
43
43
|
}, [agentImage]);
|
|
44
|
-
const copyToClipboard = (text) => {
|
|
45
|
-
navigator.clipboard.writeText(text);
|
|
46
|
-
};
|
|
47
44
|
// Render loading state or placeholder
|
|
48
45
|
const renderImageContent = () => {
|
|
49
46
|
if (isLoading) {
|
|
@@ -91,12 +88,13 @@ export const AgentCard = ({ title, description = '', date = '', showDate = false
|
|
|
91
88
|
overflow: 'hidden',
|
|
92
89
|
whiteSpace: 'nowrap',
|
|
93
90
|
textOverflow: 'ellipsis',
|
|
94
|
-
}, title: agentId, children: ["ID ", agentId] }),
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
}, title: agentId, children: ["ID ", agentId] }), onClickAgentId &&
|
|
92
|
+
getIconComponent('Copy', {
|
|
93
|
+
width: '20px',
|
|
94
|
+
height: '20px',
|
|
95
|
+
weight: 'bold',
|
|
96
|
+
color: 'var(--colors-light-text-text-accent)',
|
|
97
|
+
style: { cursor: 'pointer' },
|
|
98
|
+
onClick: () => onClickAgentId(agentId),
|
|
99
|
+
})] }))] }), (showDate || showActiveToggle) && (_jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [showDate && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-subtle)', children: date })), showActiveToggle && (_jsx(Toggle, { checked: active, onChange: (checked) => onActiveToggleChange?.(checked), disabled: activeToggleDisabled, text: "Active", togglePosition: TogglePosition.Right, style: { flex: 1 } }))] })), showBadges && (_jsx(Box, { display: 'flex', flexDirection: 'row', flexWrap: 'wrap', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', children: badges.map((badge, index) => (_jsx(Badge, { text: badge, size: BadgeSize.lg, fill: true }, `badge-${index}-${badge}`))) })), showDescription && (_jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--colors-light-text-text-paragraph)', children: description }))] }));
|
|
102
100
|
};
|
|
@@ -10,7 +10,9 @@ export declare enum AgentState {
|
|
|
10
10
|
*/
|
|
11
11
|
export type AgentCardProps = {
|
|
12
12
|
/** Agent id */
|
|
13
|
-
agentId
|
|
13
|
+
agentId?: string;
|
|
14
|
+
/** On click agent id */
|
|
15
|
+
onClickAgentId?: (agentId: string) => void;
|
|
14
16
|
/** Agent image */
|
|
15
17
|
agentImage?: string;
|
|
16
18
|
/** Show date */
|