@beydesign/storybook 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -40
- package/dist/App.js +161 -5
- package/dist/assets/animations/loading-animation.json +1 -0
- package/dist/index.d.ts +12 -2
- package/dist/index.js +12 -4
- package/dist/stories/Agent/AgentCard.d.ts +3 -0
- package/dist/stories/Agent/AgentCard.js +102 -0
- package/dist/stories/Agent/AgentCard.stories.d.ts +13 -0
- package/dist/stories/Agent/AgentCard.stories.js +303 -0
- package/dist/stories/Agent/AgentCardSkeleton.d.ts +2 -0
- package/dist/stories/Agent/AgentCardSkeleton.js +6 -0
- package/dist/stories/Agent/AgentCardSkeleton.stories.d.ts +13 -0
- package/dist/stories/Agent/AgentCardSkeleton.stories.js +101 -0
- package/dist/stories/Agent/CreateNewCard.d.ts +7 -0
- package/dist/stories/Agent/CreateNewCard.js +25 -0
- package/dist/stories/Agent/CreateNewCard.stories.d.ts +7 -0
- package/dist/stories/Agent/CreateNewCard.stories.js +23 -0
- package/dist/stories/Agent/index.d.ts +4 -0
- package/dist/stories/Agent/index.js +4 -0
- package/dist/stories/Agent/types.d.ts +96 -0
- package/dist/stories/Agent/types.js +7 -0
- package/dist/stories/Buttons/MainButton.d.ts +3 -0
- package/dist/stories/Buttons/MainButton.js +302 -0
- package/dist/stories/Buttons/MainButton.stories.d.ts +28 -0
- package/dist/stories/Buttons/MainButton.stories.js +299 -0
- package/dist/stories/Buttons/ToggleButtonGroup.d.ts +3 -0
- package/dist/stories/Buttons/ToggleButtonGroup.js +34 -0
- package/dist/stories/Buttons/ToggleButtonGroup.stories.d.ts +9 -0
- package/dist/stories/Buttons/ToggleButtonGroup.stories.js +78 -0
- package/dist/stories/Buttons/index.d.ts +3 -0
- package/dist/stories/Buttons/index.js +3 -0
- package/dist/stories/{types/button.d.ts → Buttons/types.d.ts} +37 -14
- package/dist/stories/{types/button.js → Buttons/types.js} +12 -2
- package/dist/stories/Credits/CreditsCard.d.ts +3 -0
- package/dist/stories/Credits/CreditsCard.js +53 -0
- package/dist/stories/Credits/CreditsCard.stories.d.ts +7 -0
- package/dist/stories/Credits/CreditsCard.stories.js +34 -0
- package/dist/stories/Credits/CreditsCardSkeleton.d.ts +3 -0
- package/dist/stories/Credits/CreditsCardSkeleton.js +30 -0
- package/dist/stories/Credits/CreditsCardSkeleton.stories.d.ts +7 -0
- package/dist/stories/Credits/CreditsCardSkeleton.stories.js +40 -0
- package/dist/stories/Credits/index.d.ts +3 -0
- package/dist/stories/Credits/index.js +3 -0
- package/dist/stories/Credits/types.d.ts +57 -0
- package/dist/stories/Credits/types.js +11 -0
- package/dist/stories/EntityCard/EntityCard.d.ts +3 -0
- package/dist/stories/EntityCard/EntityCard.js +22 -0
- package/dist/stories/EntityCard/EntityCard.stories.d.ts +10 -0
- package/dist/stories/EntityCard/EntityCard.stories.js +187 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.d.ts +3 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.js +9 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.stories.d.ts +10 -0
- package/dist/stories/EntityCard/EntityCardSkeleton.stories.js +73 -0
- package/dist/stories/EntityCard/index.d.ts +3 -0
- package/dist/stories/EntityCard/index.js +3 -0
- package/dist/stories/EntityCard/types.d.ts +54 -0
- package/dist/stories/EntityCard/types.js +1 -0
- package/dist/stories/Form/AutoComplete.d.ts +3 -0
- package/dist/stories/Form/AutoComplete.js +163 -0
- package/dist/stories/Form/AutoComplete.stories.d.ts +6 -0
- package/dist/stories/Form/AutoComplete.stories.js +88 -0
- package/dist/stories/Form/Checkbox.d.ts +3 -0
- package/dist/stories/Form/Checkbox.js +65 -0
- package/dist/stories/Form/Checkbox.stories.d.ts +13 -0
- package/dist/stories/Form/Checkbox.stories.js +121 -0
- package/dist/stories/Form/Dropdown.d.ts +3 -0
- package/dist/stories/Form/Dropdown.js +183 -0
- package/dist/stories/Form/Dropdown.stories.d.ts +6 -0
- package/dist/stories/Form/Dropdown.stories.js +122 -0
- package/dist/stories/Form/FileUpload/FileUpload.d.ts +3 -0
- package/dist/stories/Form/FileUpload/FileUpload.js +128 -0
- package/dist/stories/Form/FileUpload/FileUpload.stories.d.ts +7 -0
- package/dist/stories/Form/FileUpload/FileUpload.stories.js +51 -0
- package/dist/stories/Form/FileUpload/FileUploading.d.ts +3 -0
- package/dist/stories/Form/FileUpload/FileUploading.js +49 -0
- package/dist/stories/Form/FileUpload/FileUploading.stories.d.ts +10 -0
- package/dist/stories/Form/FileUpload/FileUploading.stories.js +108 -0
- package/dist/stories/Form/FileUpload/UploadedFile.d.ts +3 -0
- package/dist/stories/Form/FileUpload/UploadedFile.js +12 -0
- package/dist/stories/Form/FileUpload/UploadedFile.stories.d.ts +7 -0
- package/dist/stories/Form/FileUpload/UploadedFile.stories.js +73 -0
- package/dist/stories/Form/FileUpload/index.d.ts +3 -0
- package/dist/stories/Form/FileUpload/index.js +3 -0
- package/dist/stories/Form/TextArea.d.ts +3 -0
- package/dist/stories/Form/TextArea.js +23 -0
- package/dist/stories/Form/TextArea.stories.d.ts +161 -0
- package/dist/stories/Form/TextArea.stories.js +142 -0
- package/dist/stories/Form/TextInput.d.ts +3 -0
- package/dist/stories/Form/TextInput.js +57 -0
- package/dist/stories/Form/TextInput.stories.d.ts +155 -0
- package/dist/stories/Form/TextInput.stories.js +155 -0
- package/dist/stories/Form/Toggle.d.ts +3 -0
- package/dist/stories/Form/Toggle.js +57 -0
- package/dist/stories/Form/Toggle.stories.d.ts +6 -0
- package/dist/stories/Form/Toggle.stories.js +79 -0
- package/dist/stories/Form/index.d.ts +8 -0
- package/dist/stories/Form/index.js +8 -0
- package/dist/stories/Form/types.d.ts +274 -0
- package/dist/stories/Form/types.js +46 -0
- package/dist/stories/Foundations/Colors.d.ts +2 -0
- package/dist/stories/Foundations/Colors.js +266 -0
- package/dist/stories/Foundations/Colors.stories.d.ts +6 -0
- package/dist/stories/Foundations/Colors.stories.js +15 -0
- package/dist/stories/Foundations/index.d.ts +1 -0
- package/dist/stories/Foundations/index.js +1 -0
- package/dist/stories/Navigation/ComplexHeader.d.ts +3 -0
- package/dist/stories/Navigation/ComplexHeader.js +21 -0
- package/dist/stories/Navigation/ComplexHeader.stories.d.ts +6 -0
- package/dist/stories/Navigation/ComplexHeader.stories.js +82 -0
- package/dist/stories/Navigation/Header.d.ts +3 -0
- package/dist/stories/Navigation/Header.js +9 -0
- package/dist/stories/Navigation/Header.stories.d.ts +7 -0
- package/dist/stories/Navigation/Header.stories.js +87 -0
- package/dist/stories/Navigation/NavItem.d.ts +3 -0
- package/dist/stories/Navigation/NavItem.js +66 -0
- package/dist/stories/Navigation/NavItem.stories.d.ts +14 -0
- package/dist/stories/Navigation/NavItem.stories.js +100 -0
- package/dist/stories/Navigation/ProcessHeader.d.ts +3 -0
- package/dist/stories/Navigation/ProcessHeader.js +11 -0
- package/dist/stories/Navigation/ProcessHeader.stories.d.ts +6 -0
- package/dist/stories/Navigation/ProcessHeader.stories.js +76 -0
- package/dist/stories/Navigation/Sidebar.d.ts +3 -0
- package/dist/stories/Navigation/Sidebar.js +115 -0
- package/dist/stories/Navigation/Sidebar.stories.d.ts +11 -0
- package/dist/stories/Navigation/Sidebar.stories.js +174 -0
- package/dist/stories/Navigation/index.d.ts +6 -0
- package/dist/stories/Navigation/index.js +6 -0
- package/dist/stories/Navigation/types.d.ts +186 -0
- package/dist/stories/Navigation/types.js +21 -0
- package/dist/stories/PlanCard/PlanCard.d.ts +3 -0
- package/dist/stories/PlanCard/PlanCard.js +13 -0
- package/dist/stories/PlanCard/PlanCard.stories.d.ts +9 -0
- package/dist/stories/PlanCard/PlanCard.stories.js +125 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.d.ts +3 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.js +6 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.stories.d.ts +7 -0
- package/dist/stories/PlanCard/PlanCardSkeleton.stories.js +40 -0
- package/dist/stories/PlanCard/index.d.ts +3 -0
- package/dist/stories/PlanCard/index.js +3 -0
- package/dist/stories/PlanCard/types.d.ts +61 -0
- package/dist/stories/PlanCard/types.js +1 -0
- package/dist/stories/StripeProduct/StripeProduct.d.ts +3 -0
- package/dist/stories/StripeProduct/StripeProduct.js +24 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.d.ts +10 -0
- package/dist/stories/StripeProduct/StripeProduct.stories.js +110 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.d.ts +3 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.js +6 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.stories.d.ts +16 -0
- package/dist/stories/StripeProduct/StripeProductCardSkeleton.stories.js +137 -0
- package/dist/stories/StripeProduct/index.d.ts +3 -0
- package/dist/stories/StripeProduct/index.js +3 -0
- package/dist/stories/StripeProduct/types.d.ts +56 -0
- package/dist/stories/StripeProduct/types.js +1 -0
- package/dist/stories/Typography/Typography.d.ts +3 -0
- package/dist/stories/Typography/Typography.js +22 -0
- package/dist/stories/Typography/Typography.stories.d.ts +25 -0
- package/dist/stories/Typography/Typography.stories.js +225 -0
- package/dist/stories/Typography/index.d.ts +2 -0
- package/dist/stories/Typography/index.js +2 -0
- package/dist/stories/Typography/types.d.ts +46 -0
- package/dist/stories/Typography/types.js +27 -0
- package/dist/stories/UI/Avatar.d.ts +3 -0
- package/dist/stories/UI/Avatar.js +76 -0
- package/dist/stories/UI/Avatar.stories.d.ts +8 -0
- package/dist/stories/UI/Avatar.stories.js +76 -0
- package/dist/stories/UI/Badge.d.ts +3 -0
- package/dist/stories/UI/Badge.js +118 -0
- package/dist/stories/UI/Badge.stories.d.ts +11 -0
- package/dist/stories/UI/Badge.stories.js +107 -0
- package/dist/stories/UI/CheckIcon.d.ts +3 -0
- package/dist/stories/UI/CheckIcon.js +36 -0
- package/dist/stories/UI/CheckIcon.stories.d.ts +7 -0
- package/dist/stories/UI/CheckIcon.stories.js +48 -0
- package/dist/stories/UI/FeatureBanner.d.ts +3 -0
- package/dist/stories/UI/FeatureBanner.js +34 -0
- package/dist/stories/UI/FeatureBanner.stories.d.ts +9 -0
- package/dist/stories/UI/FeatureBanner.stories.js +131 -0
- package/dist/stories/UI/HintBubble.d.ts +3 -0
- package/dist/stories/UI/HintBubble.js +28 -0
- package/dist/stories/UI/HintBubble.stories.d.ts +9 -0
- package/dist/stories/UI/HintBubble.stories.js +68 -0
- package/dist/stories/UI/Logo.d.ts +3 -0
- package/dist/stories/UI/Logo.js +60 -0
- package/dist/stories/UI/Logo.stories.d.ts +11 -0
- package/dist/stories/UI/Logo.stories.js +65 -0
- package/dist/stories/UI/Menu.d.ts +3 -0
- package/dist/stories/UI/Menu.js +56 -0
- package/dist/stories/UI/Menu.stories.d.ts +7 -0
- package/dist/stories/UI/Menu.stories.js +80 -0
- package/dist/stories/UI/ProgressIndicator.d.ts +3 -0
- package/dist/stories/UI/ProgressIndicator.js +35 -0
- package/dist/stories/UI/ProgressIndicator.stories.d.ts +10 -0
- package/dist/stories/UI/ProgressIndicator.stories.js +98 -0
- package/dist/stories/UI/PromoBanner.d.ts +3 -0
- package/dist/stories/UI/PromoBanner.js +34 -0
- package/dist/stories/UI/PromoBanner.stories.d.ts +9 -0
- package/dist/stories/UI/PromoBanner.stories.js +159 -0
- package/dist/stories/UI/SkeletonLoader.d.ts +3 -0
- package/dist/stories/UI/SkeletonLoader.js +19 -0
- package/dist/stories/UI/SkeletonLoader.stories.d.ts +8 -0
- package/dist/stories/UI/SkeletonLoader.stories.js +74 -0
- package/dist/stories/UI/Stepper.d.ts +3 -0
- package/dist/stories/UI/Stepper.js +67 -0
- package/dist/stories/UI/Stepper.stories.d.ts +6 -0
- package/dist/stories/UI/Stepper.stories.js +65 -0
- package/dist/stories/UI/Topbar.d.ts +3 -0
- package/dist/stories/UI/Topbar.js +9 -0
- package/dist/stories/UI/Topbar.stories.d.ts +6 -0
- package/dist/stories/UI/Topbar.stories.js +71 -0
- package/dist/stories/UI/index.d.ts +13 -0
- package/dist/stories/UI/index.js +13 -0
- package/dist/stories/UI/types.d.ts +398 -0
- package/dist/stories/UI/types.js +110 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/common.js +20 -0
- package/dist/utils/icon.d.ts +6 -0
- package/dist/utils/icon.js +6 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/typography.d.ts +14 -0
- package/dist/utils/typography.js +46 -0
- package/package.json +48 -42
- package/dist/stories/Button.d.ts +0 -4
- package/dist/stories/Button.js +0 -258
- package/dist/stories/Colors.d.ts +0 -5
- package/dist/stories/Colors.js +0 -9
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.js +0 -4
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.js +0 -26
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.js +0 -8
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/stories/Page.stories.js +0 -24
package/README.md
CHANGED
|
@@ -1,50 +1,70 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BeyDesign Storybook
|
|
2
|
+
[](https://github.com/Beyond-Presence/bey-design-system/actions/workflows/lint.yml) [](https://github.com/Beyond-Presence/bey-design-system/actions/workflows/storybook.yml) [](https://github.com/Beyond-Presence/bey-design-system/actions/workflows/publish.yml)
|
|
2
3
|
|
|
3
|
-
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A React component library implementing the Beyond Presence Design System. This package provides a collection of reusable components that follow the design specifications from our [Figma Design System](https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=4295-3110&p=f&m=dev).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
7
|
+
## Installation
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
```bash
|
|
10
|
+
# First install the required design tokens package
|
|
11
|
+
npm install @beydesign/tokens
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
# Then install the component library
|
|
14
|
+
npm install @beydesign/storybook
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Prerequisites
|
|
18
|
+
|
|
19
|
+
This package depends on `@beydesign/tokens` which provides the design tokens (colors, typography, spacing, etc.) used across the components. Make sure to install and configure it first.
|
|
20
|
+
|
|
21
|
+
After installing the tokens package, you will need to install the figtree font. Link to the font is provided in the [Links](#links) section.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
1. Import the components you need:
|
|
13
26
|
|
|
14
|
-
|
|
27
|
+
```jsx
|
|
28
|
+
import {
|
|
29
|
+
MainButton,
|
|
30
|
+
ButtonHierarchy,
|
|
31
|
+
ButtonShape,
|
|
32
|
+
ButtonSize,
|
|
33
|
+
} from '@beydesign/storybook';
|
|
15
34
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
35
|
+
function App() {
|
|
36
|
+
return (
|
|
37
|
+
<MainButton
|
|
38
|
+
size={ButtonSize.lg}
|
|
39
|
+
shape={ButtonShape.Square}
|
|
40
|
+
onClick={rejoin}
|
|
41
|
+
disabled={buttonsDisabled}
|
|
42
|
+
hierarchy={ButtonHierarchy.Primary}
|
|
43
|
+
showLeadingIcon={false}
|
|
44
|
+
showTrailingIcon={false}
|
|
45
|
+
text="Rejoin"
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
26
49
|
```
|
|
27
50
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export default tseslint.config({
|
|
37
|
-
// Set the react version
|
|
38
|
-
settings: { react: { version: '18.3' } },
|
|
39
|
-
plugins: {
|
|
40
|
-
// Add the react plugin
|
|
41
|
-
react,
|
|
42
|
-
},
|
|
43
|
-
rules: {
|
|
44
|
-
// other rules...
|
|
45
|
-
// Enable its recommended rules
|
|
46
|
-
...react.configs.recommended.rules,
|
|
47
|
-
...react.configs['jsx-runtime'].rules,
|
|
48
|
-
},
|
|
49
|
-
})
|
|
51
|
+
## Development
|
|
52
|
+
|
|
53
|
+
To run the Storybook development environment locally:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npm install
|
|
57
|
+
npm run storybook
|
|
50
58
|
```
|
|
59
|
+
|
|
60
|
+
## Links
|
|
61
|
+
|
|
62
|
+
- [Design System (Figma)](https://www.figma.com/design/mIhjz2yJjcpLlIqw6oUivt/Beyond-Presence?node-id=4295-3110&p=f&m=dev)
|
|
63
|
+
- [NPM Package](https://www.npmjs.com/package/@beydesign/storybook)
|
|
64
|
+
- [Hosted Storybook](https://beyond-presence.github.io/bey-design-system/)
|
|
65
|
+
- [Design Tokens Package](https://github.com/Beyond-Presence/bey-design-token)
|
|
66
|
+
- [Figtree Font](https://fonts.google.com/specimen/Figtree)
|
|
67
|
+
|
|
68
|
+
## Support
|
|
69
|
+
|
|
70
|
+
For issues and feature requests, please use our GitHub issues page.
|
package/dist/App.js
CHANGED
|
@@ -1,10 +1,166 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import { EntityCard, EntityCardSkeleton } from './stories/EntityCard';
|
|
4
|
+
import { PlanCard, PlanCardSkeleton } from './stories/PlanCard';
|
|
5
|
+
import { BadgeColor } from './stories/UI';
|
|
5
6
|
import './App.css';
|
|
7
|
+
const plans = [
|
|
8
|
+
{
|
|
9
|
+
id: 'free',
|
|
10
|
+
title: 'Free',
|
|
11
|
+
description: 'Discover what Beyond Presence has to offer.',
|
|
12
|
+
price: '€0',
|
|
13
|
+
badgeText: 'Current Plan',
|
|
14
|
+
badgeColor: BadgeColor.Green,
|
|
15
|
+
buttonText: 'Current plan',
|
|
16
|
+
buttonDisabled: true,
|
|
17
|
+
features: [
|
|
18
|
+
'1 credit (1 min of Conversational Agent video)',
|
|
19
|
+
'5 stock Digital Twins',
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'personal',
|
|
24
|
+
title: 'Personal',
|
|
25
|
+
description: 'Tailored for personal projects and independent creators.',
|
|
26
|
+
price: '€50',
|
|
27
|
+
features: [
|
|
28
|
+
'50 credits (50 min of Conversational Agent video)',
|
|
29
|
+
'5 stock Digital Twins',
|
|
30
|
+
'1 active Conversational Agent',
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: 'pro',
|
|
35
|
+
title: 'Pro',
|
|
36
|
+
description: 'Designed for professionals looking to expand their reach.',
|
|
37
|
+
price: '€210',
|
|
38
|
+
badgeText: 'Most Popular',
|
|
39
|
+
badgeColor: BadgeColor.Lemon,
|
|
40
|
+
highlighted: true,
|
|
41
|
+
features: [
|
|
42
|
+
'300 credits (300 min of Conversational Agent video)',
|
|
43
|
+
'5 stock Digital Twins',
|
|
44
|
+
'3 active Conversational Agents',
|
|
45
|
+
'Priority support',
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
const avatars = [
|
|
50
|
+
{
|
|
51
|
+
id: 'nelly',
|
|
52
|
+
name: 'Nelly',
|
|
53
|
+
image: 'https://images.unsplash.com/photo-1494790108377-be9c29b29330?fm=jpg&q=60&w=600&ixlib=rb-4.0.3',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'ava',
|
|
57
|
+
name: 'Ava',
|
|
58
|
+
image: 'https://images.unsplash.com/photo-1438761681033-6461ffad8d80?fm=jpg&q=60&w=600&ixlib=rb-4.0.3',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'leo',
|
|
62
|
+
name: 'Leo',
|
|
63
|
+
image: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?fm=jpg&q=60&w=600&ixlib=rb-4.0.3',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'maya',
|
|
67
|
+
name: 'Maya Customer Support',
|
|
68
|
+
image: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?fm=jpg&q=60&w=600&ixlib=rb-4.0.3',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'no-image',
|
|
72
|
+
name: 'No Image',
|
|
73
|
+
image: undefined,
|
|
74
|
+
},
|
|
75
|
+
];
|
|
76
|
+
const agentMenuItems = [
|
|
77
|
+
{
|
|
78
|
+
label: 'Conversation Link',
|
|
79
|
+
icon: 'ShareNetwork',
|
|
80
|
+
onClick: () => { },
|
|
81
|
+
},
|
|
82
|
+
{ label: 'Copy Agent ID', icon: 'CopySimple', onClick: () => { } },
|
|
83
|
+
{ label: 'Embed', icon: 'Code', onClick: () => { } },
|
|
84
|
+
{
|
|
85
|
+
label: 'Agent Details',
|
|
86
|
+
icon: 'IdentificationCard',
|
|
87
|
+
onClick: () => { },
|
|
88
|
+
},
|
|
89
|
+
{ label: 'Duplicate', icon: 'Copy', onClick: () => { } },
|
|
90
|
+
{
|
|
91
|
+
label: 'Delete',
|
|
92
|
+
icon: 'Trash',
|
|
93
|
+
onClick: () => { },
|
|
94
|
+
destructive: true,
|
|
95
|
+
},
|
|
96
|
+
];
|
|
6
97
|
function App() {
|
|
7
|
-
const [
|
|
8
|
-
return (_jsxs(
|
|
98
|
+
const [loading, setLoading] = useState(false);
|
|
99
|
+
return (_jsxs("div", { style: { padding: '32px' }, children: [_jsx("button", { type: "button", onClick: () => setLoading((prev) => !prev), style: {
|
|
100
|
+
fontFamily: 'Figtree, sans-serif',
|
|
101
|
+
marginBottom: '24px',
|
|
102
|
+
padding: '8px 16px',
|
|
103
|
+
borderRadius: '6px',
|
|
104
|
+
border: '1px solid var(--color-border-border-component)',
|
|
105
|
+
background: 'var(--color-background-bg-white)',
|
|
106
|
+
color: 'var(--color-text-text-title)',
|
|
107
|
+
cursor: 'pointer',
|
|
108
|
+
}, children: loading ? 'Show loaded cards' : 'Show loading skeletons' }), _jsx("h2", { style: {
|
|
109
|
+
fontFamily: 'Figtree, sans-serif',
|
|
110
|
+
color: 'var(--color-text-text-title)',
|
|
111
|
+
marginBottom: '4px',
|
|
112
|
+
}, children: "Explore our Avatar Library" }), _jsx("p", { style: {
|
|
113
|
+
fontFamily: 'Figtree, sans-serif',
|
|
114
|
+
color: 'var(--color-text-text-subtle)',
|
|
115
|
+
marginBottom: '24px',
|
|
116
|
+
}, children: "Select the perfect studio-quality digital human to make your interactions feel personal." }), _jsx("div", { style: {
|
|
117
|
+
display: 'flex',
|
|
118
|
+
flexWrap: 'wrap',
|
|
119
|
+
gap: '16px',
|
|
120
|
+
}, children: avatars.map((avatar) => loading ? (_jsx(EntityCardSkeleton, { view: "avatar", showDescription: true }, avatar.id)) : (_jsx(EntityCard, { name: avatar.name, image: avatar.image, onPreview: () => console.log('Preview', avatar.name), showMenu: true, menuItems: [
|
|
121
|
+
{
|
|
122
|
+
label: 'Copy Avatar ID',
|
|
123
|
+
icon: 'Copy',
|
|
124
|
+
onClick: () => console.log('Copy', avatar.id),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Create Agent',
|
|
128
|
+
icon: 'UserCirclePlus',
|
|
129
|
+
onClick: () => console.log('Create Agent', avatar.name),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: 'Delete',
|
|
133
|
+
icon: 'Trash',
|
|
134
|
+
onClick: () => console.log('Delete', avatar.name),
|
|
135
|
+
destructive: true,
|
|
136
|
+
},
|
|
137
|
+
], description: "daijdaij pa oapopao ao opaop op", showDescription: true }, avatar.id))) }), _jsx("h2", { style: {
|
|
138
|
+
fontFamily: 'Figtree, sans-serif',
|
|
139
|
+
color: 'var(--color-text-text-title)',
|
|
140
|
+
margin: '40px 0 4px',
|
|
141
|
+
}, children: "Explore our Agent library" }), _jsx("p", { style: {
|
|
142
|
+
fontFamily: 'Figtree, sans-serif',
|
|
143
|
+
color: 'var(--color-text-text-subtle)',
|
|
144
|
+
marginBottom: '24px',
|
|
145
|
+
}, children: "Your active agents \u2014 hover a card to join a live conversation." }), _jsx("div", { style: {
|
|
146
|
+
display: 'flex',
|
|
147
|
+
flexWrap: 'wrap',
|
|
148
|
+
gap: '16px',
|
|
149
|
+
}, children: avatars
|
|
150
|
+
.slice(0, 4)
|
|
151
|
+
.map((avatar) => loading ? (_jsx(EntityCardSkeleton, { view: "agent" }, `agent-${avatar.id}`)) : (_jsx(EntityCard, { view: "agent", name: `${avatar.name} Customer Support`, image: avatar.image, showStatusBadge: true, statusBadgeText: "Active", onPreview: () => console.log('Join', avatar.name), previewButtonText: "Join", previewIcon: "VideoCamera", showMenu: true, menuItems: agentMenuItems }, `agent-${avatar.id}`))) }), _jsx("h2", { style: {
|
|
152
|
+
fontFamily: 'Figtree, sans-serif',
|
|
153
|
+
color: 'var(--color-text-text-title)',
|
|
154
|
+
margin: '40px 0 4px',
|
|
155
|
+
}, children: "Subscription plans" }), _jsx("p", { style: {
|
|
156
|
+
fontFamily: 'Figtree, sans-serif',
|
|
157
|
+
color: 'var(--color-text-text-subtle)',
|
|
158
|
+
marginBottom: '24px',
|
|
159
|
+
}, children: "Choose the plan that's right for you." }), _jsx("div", { style: {
|
|
160
|
+
display: 'flex',
|
|
161
|
+
flexWrap: 'wrap',
|
|
162
|
+
alignItems: 'flex-start',
|
|
163
|
+
gap: '16px',
|
|
164
|
+
}, children: plans.map((plan) => loading ? (_jsx(PlanCardSkeleton, { featuresCount: plan.features.length }, plan.id)) : (_jsx(PlanCard, { title: plan.title, description: plan.description, price: plan.price, badgeText: plan.badgeText, badgeColor: plan.badgeColor, highlighted: plan.highlighted, buttonText: plan.buttonText, buttonDisabled: plan.buttonDisabled, features: plan.features, onButtonClick: () => console.log('Plan action', plan.title) }, plan.id))) })] }));
|
|
9
165
|
}
|
|
10
166
|
export default App;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "nm": "Main Scene", "ddd": 0, "h": 8, "w": 302, "meta": { "g": "@lottiefiles/creator 1.45.0" }, "layers": [{ "ty": 4, "nm": "Masque", "sr": 1, "st": 0, "op": 2250.58391725058, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "td": 1, "ao": 0, "ks": { "a": { "a": 0, "k": [-15.75, 16.08405002307892], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [151.25, 4.08405002307892], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "TracÃÂé rectangulaire 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 20, "ix": 4 }, "s": { "a": 0, "k": [300, 4], "ix": 2 } }, { "ty": "st", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Stroke", "nm": "Contour 1", "lc": 1, "lj": 1, "ml": 4, "o": { "a": 0, "k": 100, "ix": 4 }, "w": { "a": 0, "k": 0, "ix": 5 }, "c": { "a": 0, "k": [1, 1, 1], "ix": 3 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fond 1", "c": { "a": 0, "k": [0.9216, 1, 1], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-15.75, 16.062], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 1 }, { "ty": 4, "nm": "Item barre", "sr": 1, "st": 0, "op": 2250.58391725058, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "tt": 1, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [0, 0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 1, "k": [{ "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [46, -12, 0], "t": 0 }, { "o": { "x": 0.167, "y": 0.167 }, "i": { "x": 0.833, "y": 0.833 }, "s": [498, -12, 0], "t": 50 }, { "o": { "x": 0.167, "y": 0.167 }, "i": { "x": 0.833, "y": 0.833 }, "s": [46, -12, 0], "t": 51 }, { "o": { "x": 0.333, "y": 0 }, "i": { "x": 0.667, "y": 1 }, "s": [46, -12, 0], "t": 53 }, { "s": [498, -12, 0], "t": 103 }], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 1, "k": [{ "o": { "x": 0.167, "y": 0.167 }, "i": { "x": 0.833, "y": 0.833 }, "s": [100], "t": 46 }, { "o": { "x": 0.167, "y": 0.167 }, "i": { "x": 0.833, "y": 0.833 }, "s": [0], "t": 49 }, { "o": { "x": 0.167, "y": 0.167 }, "i": { "x": 0.833, "y": 0.833 }, "s": [0], "t": 51 }, { "s": [100], "t": 52 }], "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "TracÃÂé rectangulaire 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 20, "ix": 4 }, "s": { "a": 0, "k": [100, 4], "ix": 2 } }, { "ty": "st", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Stroke", "nm": "Contour 1", "lc": 1, "lj": 1, "ml": 4, "o": { "a": 0, "k": 100, "ix": 4 }, "w": { "a": 0, "k": 0, "ix": 5 }, "c": { "a": 0, "k": [1, 1, 1], "ix": 3 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fond 1", "c": { "a": 0, "k": [0.2902, 0.1216, 0.7216], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-115.75, 16.062], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 2, "tp": 1 }, { "ty": 4, "nm": "Barre", "sr": 1, "st": 0, "op": 2250.58391725058, "ip": 0, "hd": false, "ddd": 0, "bm": 0, "hasMask": false, "ao": 0, "ks": { "a": { "a": 0, "k": [-15.75, 16.08405002307892], "ix": 1 }, "s": { "a": 0, "k": [100, 100, 100], "ix": 6 }, "sk": { "a": 0, "k": 0 }, "p": { "a": 0, "k": [151.25, 4.08405002307892], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 10 }, "sa": { "a": 0, "k": 0 }, "o": { "a": 0, "k": 100, "ix": 11 } }, "shapes": [{ "ty": "gr", "bm": 0, "hd": false, "mn": "ADBE Vector Group", "nm": "Rectangle 1", "ix": 1, "cix": 2, "np": 3, "it": [{ "ty": "rc", "bm": 0, "hd": false, "mn": "ADBE Vector Shape - Rect", "nm": "TracÃÂé rectangulaire 1", "d": 1, "p": { "a": 0, "k": [0, 0], "ix": 3 }, "r": { "a": 0, "k": 20, "ix": 4 }, "s": { "a": 0, "k": [300, 4], "ix": 2 } }, { "ty": "st", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Stroke", "nm": "Contour 1", "lc": 1, "lj": 1, "ml": 4, "o": { "a": 0, "k": 100, "ix": 4 }, "w": { "a": 0, "k": 0, "ix": 5 }, "c": { "a": 0, "k": [1, 1, 1], "ix": 3 } }, { "ty": "fl", "bm": 0, "hd": false, "mn": "ADBE Vector Graphic - Fill", "nm": "Fond 1", "c": { "a": 0, "k": [0.7412, 0.7059, 0.9961], "ix": 4 }, "r": 1, "o": { "a": 0, "k": 100, "ix": 5 } }, { "ty": "tr", "a": { "a": 0, "k": [0, 0], "ix": 1 }, "s": { "a": 0, "k": [100, 100], "ix": 3 }, "sk": { "a": 0, "k": 0, "ix": 4 }, "p": { "a": 0, "k": [-15.75, 16.062], "ix": 2 }, "r": { "a": 0, "k": 0, "ix": 6 }, "sa": { "a": 0, "k": 0, "ix": 5 }, "o": { "a": 0, "k": 100, "ix": 7 } }] }], "ind": 3 }], "v": "5.7.0", "fr": 50, "op": 105, "ip": 0, "assets": [] }
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from './stories/UI';
|
|
2
|
+
export * from './stories/Agent';
|
|
3
|
+
export * from './stories/EntityCard';
|
|
4
|
+
export * from './stories/PlanCard';
|
|
5
|
+
export * from './stories/Form';
|
|
6
|
+
export * from './stories/Buttons';
|
|
7
|
+
export * from './stories/Typography';
|
|
8
|
+
export * from './stories/Credits';
|
|
9
|
+
export * from './stories/Navigation';
|
|
10
|
+
export * from './stories/Typography';
|
|
11
|
+
export * from './stories/UI';
|
|
12
|
+
export * from './stories/StripeProduct';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export
|
|
1
|
+
export * from './stories/UI';
|
|
2
|
+
export * from './stories/Agent';
|
|
3
|
+
export * from './stories/EntityCard';
|
|
4
|
+
export * from './stories/PlanCard';
|
|
5
|
+
export * from './stories/Form';
|
|
6
|
+
export * from './stories/Buttons';
|
|
7
|
+
export * from './stories/Typography';
|
|
8
|
+
export * from './stories/Credits';
|
|
9
|
+
export * from './stories/Navigation';
|
|
10
|
+
export * from './stories/Typography';
|
|
11
|
+
export * from './stories/UI';
|
|
12
|
+
export * from './stories/StripeProduct';
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { AgentState } from './types';
|
|
4
|
+
import { Box } from '@mui/material';
|
|
5
|
+
import { Typography, TypographySize, TypographyWeight } from '../Typography';
|
|
6
|
+
import { Toggle, TogglePosition } from '../Form';
|
|
7
|
+
import { Badge, ProgressIndicator, ProgressIndicatorMode, BadgeColor, BadgeSize, Menu, } from '../UI';
|
|
8
|
+
import { MainButton, ButtonHierarchy, ButtonSize } from '../Buttons';
|
|
9
|
+
import { ArrowsClockwise, Warning } from '@phosphor-icons/react';
|
|
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 = '', onClickAgentId, }) => {
|
|
12
|
+
const [hovered, setHovered] = useState(false);
|
|
13
|
+
const [imageError, setImageError] = useState(false);
|
|
14
|
+
const [isLoading, setIsLoading] = useState(!!agentImage);
|
|
15
|
+
const isError = agentState === AgentState.error;
|
|
16
|
+
const isDraft = agentState === AgentState.pending;
|
|
17
|
+
const isProcessing = agentState === AgentState.processing;
|
|
18
|
+
const isReady = agentState === AgentState.ready;
|
|
19
|
+
const agentKey = title?.toLowerCase()?.replace(/\s+/g, '-');
|
|
20
|
+
// Handle image loading and errors
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
if (!agentImage) {
|
|
23
|
+
setIsLoading(false);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setIsLoading(true);
|
|
27
|
+
setImageError(false);
|
|
28
|
+
// Preload the image to check if it exists
|
|
29
|
+
const img = new Image();
|
|
30
|
+
img.onload = () => {
|
|
31
|
+
setImageError(false);
|
|
32
|
+
setIsLoading(false);
|
|
33
|
+
};
|
|
34
|
+
img.onerror = () => {
|
|
35
|
+
setImageError(true);
|
|
36
|
+
setIsLoading(false);
|
|
37
|
+
};
|
|
38
|
+
img.src = agentImage;
|
|
39
|
+
// Cleanup
|
|
40
|
+
return () => {
|
|
41
|
+
img.onload = null;
|
|
42
|
+
img.onerror = null;
|
|
43
|
+
};
|
|
44
|
+
}, [agentImage]);
|
|
45
|
+
// Render loading state or placeholder
|
|
46
|
+
const renderImageContent = () => {
|
|
47
|
+
if (isLoading) {
|
|
48
|
+
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--color-background-bg-element)', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsxs(Box, { display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--color-text-text-subtle)', className: "spin-animation" }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-subtle)', children: "Loading preview..." })] }) }));
|
|
49
|
+
}
|
|
50
|
+
if (imageError || !agentImage) {
|
|
51
|
+
return (_jsx(Box, { width: '100%', height: '100%', bgcolor: 'var(--color-background-bg-element)', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', border: '2px solid var(--color-border-border-component)', boxSizing: 'border-box', display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, children: "No Preview Available" }) }));
|
|
52
|
+
}
|
|
53
|
+
return (_jsx("img", { src: agentImage, alt: "Agent", width: '100%', height: '100%', style: { objectFit: 'cover', height: '100%', width: '100%' } }));
|
|
54
|
+
};
|
|
55
|
+
return (_jsxs(Box, { width: 'auto', display: 'flex', flexDirection: 'column', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', padding: 'var(--spacing-tokens-size-in-px-spacing-spacing-xl)', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-lg)', bgcolor: isError
|
|
56
|
+
? 'var(--color-background-bg-error-subtle)'
|
|
57
|
+
: isDraft
|
|
58
|
+
? 'var(--color-background-bg-element)'
|
|
59
|
+
: 'var(--color-background-bg-component)', boxShadow: `var(--global-shadows-shadow-xs-offset-x) var(--global-shadows-shadow-xs-offset-y) var(--global-shadows-shadow-xs-blur) var(--global-shadows-shadow-xs-spread) var(--global-shadows-shadow-xs-color)`, "data-testid": `${agentKey}-parent`, children: [_jsx("style", { children: `
|
|
60
|
+
@keyframes spin {
|
|
61
|
+
0% { transform: rotate(0deg); }
|
|
62
|
+
100% { transform: rotate(360deg); }
|
|
63
|
+
}
|
|
64
|
+
.spin-animation {
|
|
65
|
+
animation: spin 1.5s linear infinite;
|
|
66
|
+
}
|
|
67
|
+
` }), _jsxs(Box, { display: 'flex', justifyContent: 'center', alignItems: 'center', position: 'relative', sx: { aspectRatio: 1 }, height: '268px', borderRadius: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', overflow: 'hidden', onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), children: [renderImageContent(), showTimeBadge && time && (_jsx(Badge, { text: time, size: BadgeSize.md, fill: true, style: {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
right: '8px',
|
|
70
|
+
bottom: '8px',
|
|
71
|
+
zIndex: 2,
|
|
72
|
+
}, color: BadgeColor.Violet })), showStatusBadge && statusBadgeText && (_jsx(Badge, { text: statusBadgeText, size: BadgeSize.md, fill: true, style: {
|
|
73
|
+
position: 'absolute',
|
|
74
|
+
left: '8px',
|
|
75
|
+
top: '8px',
|
|
76
|
+
zIndex: 2,
|
|
77
|
+
}, color: BadgeColor.Blue })), showMenu && menuItems.length > 0 && (_jsx(Menu, { items: menuItems, style: {
|
|
78
|
+
zIndex: 2,
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
right: '8px',
|
|
81
|
+
top: '8px',
|
|
82
|
+
}, testKey: agentKey })), isReady && hovered && onPreview && active && (_jsx(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--color-background-bg-component-hover)', sx: { zIndex: 1 }, display: 'flex', justifyContent: 'center', alignItems: 'center', children: _jsx(MainButton, { text: previewButtonText, onClick: onPreview, showTrailingIcon: true, trailingIcon: "Play", hierarchy: ButtonHierarchy.SecondaryTransparent, size: ButtonSize.sm, style: { border: 'none' }, testId: `${agentKey}-preview-button` }) })), isProcessing && (_jsxs(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--color-background-bg-component-hover)', style: { zIndex: 1 }, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(ArrowsClockwise, { size: 24, color: 'var(--color-text-text-white)', className: "spin-animation" }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, color: 'var(--color-text-text-white)', children: processingText }), showProgressIndicator && (_jsx(ProgressIndicator, { mode: ProgressIndicatorMode.Percentage, currentValue: progressValue, maxValue: 100, textColor: 'var(--color-text-text-white)' }))] })), isError && (_jsxs(Box, { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', bgcolor: 'var(--color-background-bg-error-solid)', style: { zIndex: 1, opacity: 0.7 }, display: 'flex', flexDirection: 'column', justifyContent: 'center', alignItems: 'center', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-md)', children: [_jsx(Warning, { size: 74, color: 'var(--color-text-text-white)' }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.SemiBold, color: 'var(--color-text-text-white)', children: "Something went wrong" })] }))] }), _jsxs(Box, { display: 'flex', flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', children: [_jsx(Typography, { size: TypographySize.HeadingXS, weight: TypographyWeight.SemiBold, textStyle: {
|
|
83
|
+
maxWidth: '140px',
|
|
84
|
+
overflow: 'hidden',
|
|
85
|
+
whiteSpace: 'nowrap',
|
|
86
|
+
textOverflow: 'ellipsis',
|
|
87
|
+
}, children: title }), agentId && (_jsxs(Box, { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', gap: 'var(--spacing-tokens-size-in-px-spacing-spacing-sm)', children: [_jsxs(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Medium, color: 'var(--color-text-text-title)', textStyle: {
|
|
88
|
+
maxWidth: '100px',
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
whiteSpace: 'nowrap',
|
|
91
|
+
textOverflow: 'ellipsis',
|
|
92
|
+
}, title: agentId, children: ["ID ", agentId] }), onClickAgentId &&
|
|
93
|
+
getIconComponent('Copy', {
|
|
94
|
+
width: '20px',
|
|
95
|
+
height: '20px',
|
|
96
|
+
weight: 'bold',
|
|
97
|
+
color: 'var(--color-text-text-accent)',
|
|
98
|
+
style: { cursor: 'pointer' },
|
|
99
|
+
onClick: () => onClickAgentId(agentId),
|
|
100
|
+
'data-testid': `${agentKey}-copy-icon`,
|
|
101
|
+
})] }))] }), (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(--color-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(--color-text-text-paragraph)', children: description }))] }));
|
|
102
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AgentCard } from './AgentCard';
|
|
3
|
+
declare const meta: Meta<typeof AgentCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AgentCard>;
|
|
6
|
+
export declare const Placeholder: Story;
|
|
7
|
+
export declare const CustomPreviewText: Story;
|
|
8
|
+
export declare const LoadingPreview: Story;
|
|
9
|
+
export declare const NoImage: Story;
|
|
10
|
+
export declare const WithStatusBadge: Story;
|
|
11
|
+
export declare const NoStatusBadge: Story;
|
|
12
|
+
export declare const Processing: Story;
|
|
13
|
+
export declare const ProcessingWithoutProgress: Story;
|