diff --git a/CHANGELOG.md b/CHANGELOG.md
index 68b00bbdf..a909a89c5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,10 @@
+# [1.37.0](https://github.com/mParticle/aquarium/compare/v1.36.1...v1.37.0) (2025-01-17)
+
+### Features
+
+- add badge indicator ([#526](https://github.com/mParticle/aquarium/issues/526)) ([56a3a47](https://github.com/mParticle/aquarium/commit/56a3a4738a44457f1a8932b33dc3a80b0778d20b))
+- replace crosshair icon with precision ([#528](https://github.com/mParticle/aquarium/issues/528)) ([06884ae](https://github.com/mParticle/aquarium/commit/06884ae29d213efd091d6e50cea5c66f3dc95439))
+
## [1.36.1](https://github.com/mParticle/aquarium/compare/v1.36.0...v1.36.1) (2024-12-06)
### Bug Fixes
diff --git a/docs/UX Patterns/Table/Table.stories.tsx b/docs/UX Patterns/Table/Table.stories.tsx
index c774dd819..7e8a2febc 100644
--- a/docs/UX Patterns/Table/Table.stories.tsx
+++ b/docs/UX Patterns/Table/Table.stories.tsx
@@ -23,8 +23,6 @@ import { tableColumns, tableData, type TableDataType } from './TableStoryUtils'
import { SelectWithRangePicker } from 'docs/Candidate Components/Directory/Date Range Filter/SelectWithRangePicker'
import { useState } from 'react'
import { ColorTextDescription } from 'src/styles/style'
-import MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined'
-import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'
const meta: Meta = {
title: 'UX Patterns/Table/Table',
@@ -110,11 +108,7 @@ const CollapsibleSection = ({ ...item }: ICollapsibleFormSectionProps): React.JS
},
},
}}>
- (isActive ? : )}
- items={[{ ...item, key: 'item' }]}
- />
+
)
}
diff --git a/docs/components/Data Display/Avatar/Documentation.mdx b/docs/components/Data Display/Avatar/Documentation.mdx
index 74069ea35..77bed1111 100644
--- a/docs/components/Data Display/Avatar/Documentation.mdx
+++ b/docs/components/Data Display/Avatar/Documentation.mdx
@@ -6,9 +6,14 @@ import * as AvatarStories from '../../../../src/components/data-display/Avatar/A
# Avatar
-### Overview
+#### Overview
-The Avatar component provides a quick, versatile visual cue to represent users or entities in the UI by displaying images, icons, or initials.
+The **Avatar** component is used to display a profile image, initials, or an icon, commonly for identification purposes.
+
+#### When to use
+
+- To represent an account, organization, or workspace.
+- To represent a single user or as a placeholder when a user profile image isn’t available.
#### Current Usage
@@ -19,6 +24,7 @@ The Avatar component provides a quick, versatile visual cue to represent users o
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Avatar Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=397-12044&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Avatar Component](https://ant.design/components/avatar) |
diff --git a/docs/components/Data Display/Badge/Documentation.mdx b/docs/components/Data Display/Badge/Documentation.mdx
index aa0361802..168be3022 100644
--- a/docs/components/Data Display/Badge/Documentation.mdx
+++ b/docs/components/Data Display/Badge/Documentation.mdx
@@ -10,12 +10,12 @@ import * as BadgeStories from '../../../../src/components/data-display/Badge/Bad
#### Overview
-The **Badge** component provides visual indicators for an item’s status, available in two styles: a **dot** and a **status badge" with text.
+The **Badge** component provides visual indicators for an item’s status, available in two styles: a **dot** and a **status badge" with text.
### [Dot Badge](https://mparticle.github.io/aquarium/?path=/story/components-data-display-badge--dot-badge)
-#### When to use
+#### When to use
Use **Badge** when a status needs to be displayed next to an element in a compact form.
@@ -23,6 +23,8 @@ Use **Badge** when a status needs to be displayed next to an element in a compac
- **[Navigation](https://mparticle.github.io/aquarium/?path=/story/components-navigation-globalnavigation--primary)** – Badge is used within the navigation sidebar for notification use cases.
+
+
### [Status Badge](https://mparticle.github.io/aquarium/?path=/story/components-data-display-badge--example-status)
#### When to Use
@@ -38,4 +40,7 @@ For displaying status with accompanying text (e.g., "Active," "Failed," or "Draf
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Badge Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=399-0&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Badge Component](https://ant.design/components/badge) |
+
+
diff --git a/docs/components/Data Display/Card/Documentation.mdx b/docs/components/Data Display/Card/Documentation.mdx
index 8a9f216c9..5a5d70469 100644
--- a/docs/components/Data Display/Card/Documentation.mdx
+++ b/docs/components/Data Display/Card/Documentation.mdx
@@ -7,13 +7,23 @@ import * as CardStories from '../../../../src/components/data-display/Card/Card.
# Card
#### Overview
-A Card is a rectangular container for displaying content related to a single subject, combining elements like text, images, or buttons within a single area.
+
+The **Card** component is a flexible and convenient container for displaying content related to a single subject. It combines elements like text, lists, and interactive actions into a visually distinct and structured layout.
+
+## Key Features
+
+- **Customizable Headers and Footers** Supports headers (title) and footers (extra) to add context or actions. Both header and footer is optional.
+- **Content Areas** Organize information into a visually distinct and structured layout.
+- **Actions** Built-in support for buttons, dropdowns, or custom controls to enhance interactivity.
+- **Responsive Layouts** Grid support for displaying multiple cards in a responsive and organized format.
+- **Inner Card**The Inner Card is a specialized type of card designed for use within a parent card. It allows you to organize nested or related content, providing a clear hierarchy within the layout.
#### Related Links
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Card Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=403-0&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Card Component](https://ant.design/components/card) |
diff --git a/docs/components/Data Display/Collapse/Documentation.mdx b/docs/components/Data Display/Collapse/Documentation.mdx
index b821d3adc..17a53bfc6 100644
--- a/docs/components/Data Display/Collapse/Documentation.mdx
+++ b/docs/components/Data Display/Collapse/Documentation.mdx
@@ -11,7 +11,7 @@ A content area which can be collapsed and expanded.
#### When to use
-In a complex input form within a modal, certain fields or options can be hidden under expandable sections.
+In a complex input form within a modal, certain fields or options can be hidden under expandable sections.
#### Current Usages
@@ -23,6 +23,7 @@ We use expand/collapse in [Table Filters](https://mparticle.github.io/aquarium/?
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Collapse Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=406-109&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Collapse Component](https://ant.design/components/collapse) |
-
+
diff --git a/docs/components/Data Display/Descriptions/Documentation.mdx b/docs/components/Data Display/Descriptions/Documentation.mdx
index 6e07677f8..bc2e53b1c 100644
--- a/docs/components/Data Display/Descriptions/Documentation.mdx
+++ b/docs/components/Data Display/Descriptions/Documentation.mdx
@@ -10,7 +10,7 @@ import * as DescriptionsStories from '../../../../src/components/data-display/De
#### Overview
-Display multiple read-only fields grouped together, commonly used on details pages to organize information in a structured way.
+Display multiple read-only fields grouped together, commonly used on details pages to organize information in a structured way.
#### Related Links
@@ -18,6 +18,7 @@ Display multiple read-only fields grouped together, commonly used on details pag
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Descriptions Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=407-297&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Descriptions Component](https://ant.design/components/descriptions) |
diff --git a/docs/components/Data Display/Empty/Documentation.mdx b/docs/components/Data Display/Empty/Documentation.mdx
index 029634856..8f520ac3e 100644
--- a/docs/components/Data Display/Empty/Documentation.mdx
+++ b/docs/components/Data Display/Empty/Documentation.mdx
@@ -23,6 +23,7 @@ Use an Empty State when:
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Empty Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=407-367&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Empty Component](https://ant.design/components/empty) |
diff --git a/docs/components/Data Display/Image/Documentation.mdx b/docs/components/Data Display/Image/Documentation.mdx
index b937a3c5a..39da674e1 100644
--- a/docs/components/Data Display/Image/Documentation.mdx
+++ b/docs/components/Data Display/Image/Documentation.mdx
@@ -18,6 +18,7 @@ The Image component displays pictures in the UI. It supports various sizes and i
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Image Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=507-39111&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Image Component](https://ant.design/components/image) |
diff --git a/docs/components/Data Display/List/Documentation.mdx b/docs/components/Data Display/List/Documentation.mdx
index 073b302b3..866e1aee8 100644
--- a/docs/components/Data Display/List/Documentation.mdx
+++ b/docs/components/Data Display/List/Documentation.mdx
@@ -10,13 +10,27 @@ import * as ListStories from '../../../../src/components/data-display/List/List.
#### Overview
-The **List** component is a simple, versatile structure for displaying multiple items in a single view. List can hold various types of content, providing a clean and organized way to present information.
+The **List** component is a simple, versatile container for displaying multiple items in a single view. List can hold various types of content, providing a clean and organized way to present information.
+
+### When to Use
+- To display a collection of data in a structured format.
+- When presenting lists of settings
+
+## Key Features
+
+- **Customizable Headers and Footers:** Add headers and footers to provide context or summary for the list.
+- **Flexible List Item Structure:** Layouts can include text, images, and actions, offering versatility in content presentation.
+- **Pagination:** Built-in support for pagination to efficiently manage large data sets.
+- **Load More:** An optional "Load More" button for dynamically loading additional items.
+- **Grid Support:** Display list items in grid layouts for a more visual and organized presentation.
+- **Interactive Elements:** Integrate buttons, links, or select into each list item
#### Related Links
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [List Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=407-405&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [List Component](https://ant.design/components/list) |
diff --git a/docs/components/Data Display/Popover/Documentation.mdx b/docs/components/Data Display/Popover/Documentation.mdx
index 52c08d721..24c9d6194 100644
--- a/docs/components/Data Display/Popover/Documentation.mdx
+++ b/docs/components/Data Display/Popover/Documentation.mdx
@@ -31,6 +31,7 @@ Use [Tooltip](https://mparticle.github.io/aquarium/?path=/story/components-data-
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Popover Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=408-12073&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Popover Component](https://ant.design/components/popover) |
diff --git a/docs/components/Data Display/Tabs/Documentation.mdx b/docs/components/Data Display/Tabs/Documentation.mdx
index 9827fd4fc..fca12abf7 100644
--- a/docs/components/Data Display/Tabs/Documentation.mdx
+++ b/docs/components/Data Display/Tabs/Documentation.mdx
@@ -9,13 +9,14 @@ import * as TabsStories from '../../../../src/components/data-display/Tabs/Tabs.
# Tabs
### Overview
-The **Tabs** component organizes content into multiple sections within a single view, allowing users to switch between sections without navigating away from the page.
+The **Tabs** component organizes content into multiple sections within a single view, allowing users to switch between sections without navigating away from the page.
#### Related Links
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Tabs Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=411-17&node-type=canvas&t=B6HJWqqDsUOypZQj-0) |
+| AntD | [Tabs Component](https://ant.design/components/tabs) |
{/* Documentation goes here */}
diff --git a/docs/components/Data Display/Tag/Documentation.mdx b/docs/components/Data Display/Tag/Documentation.mdx
index 6bfa452db..84a3b3b7d 100644
--- a/docs/components/Data Display/Tag/Documentation.mdx
+++ b/docs/components/Data Display/Tag/Documentation.mdx
@@ -18,7 +18,7 @@ Used to indicate contextual information, such as environments or states. These t
#### Current Usage
-[**Tables Usage:**](https://mparticle.github.io/aquarium/?path=/story/components-data-display-tag--table-usage) Used to indicate environment (e.g., production or development), priority, or health status.
+[**Tables Usage:**](https://mparticle.github.io/aquarium/?path=/story/components-data-display-tag--table-usage) Used to indicate environment (e.g., production or development), priority, or health status.
### Clicable Tags
@@ -31,4 +31,11 @@ Used as interactive elements that can function as filters or selection tools.
{/* Documentation goes here */}
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Tag Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?m=auto&node-id=412-13377&t=BQax0YEp3gD4PyU6-1) |
+| AntD | [Tag Component](https://ant.design/components/tag) |
+
diff --git a/docs/components/Data Display/Tooltip/Documentation.mdx b/docs/components/Data Display/Tooltip/Documentation.mdx
index 77e634184..19f02a2db 100644
--- a/docs/components/Data Display/Tooltip/Documentation.mdx
+++ b/docs/components/Data Display/Tooltip/Documentation.mdx
@@ -20,7 +20,8 @@ The Tooltip is a lightweight, contextual UI element used to display additional i
| Type | Resource |
| ------ | -------- |
| Eames | [Tooltip Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=413-13162&t=5iHsAw2QyK8Lx8zt-4) |
+| AntD | [Tooltip Component](https://ant.design/components/tooltip) |
{/* Documentation goes here */}
-
\ No newline at end of file
+
diff --git a/docs/components/Data Display/Tour/Documentation.mdx b/docs/components/Data Display/Tour/Documentation.mdx
index 190b0f6b8..5fcf273e8 100644
--- a/docs/components/Data Display/Tour/Documentation.mdx
+++ b/docs/components/Data Display/Tour/Documentation.mdx
@@ -21,6 +21,7 @@ Use the Tour component when:
| Type | Resource |
| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Eames | [Tour Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=1721-40337&node-type=canvas&t=gOAJGJ8C9ev7N7lt-0) |
+| AntD | [Tour Component](https://ant.design/components/tour) |
{/* Documentation goes here */}
diff --git a/docs/components/Data Entry/Auto Complete/Documentation.mdx b/docs/components/Data Entry/Auto Complete/Documentation.mdx
index 1c2d46522..90076a886 100644
--- a/docs/components/Data Entry/Auto Complete/Documentation.mdx
+++ b/docs/components/Data Entry/Auto Complete/Documentation.mdx
@@ -8,8 +8,16 @@ import * as AutoCompleteStories from '../../../../src/components/data-entry/Auto
# AutoComplete
-This is the documentation for the AutoComplete component
+#### Overview
+
+An input field with text hints that aids users by providing keyword-based suggestions as they type.
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [AutoComplete Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?m=auto&node-id=388-11035&t=zURbLpG60aM6aJiH-1) |
+| AntD | [AutoComplete Component](https://ant.design/components/auto-complete) |
-{/* Documentation goes here */}
diff --git a/docs/components/Data Entry/Checkbox/Documentation.mdx b/docs/components/Data Entry/Checkbox/Documentation.mdx
index fbf16b732..922e5016b 100644
--- a/docs/components/Data Entry/Checkbox/Documentation.mdx
+++ b/docs/components/Data Entry/Checkbox/Documentation.mdx
@@ -8,8 +8,27 @@ import * as CheckboxStories from '../../../../src/components/data-entry/Checkbox
# Checkbox
-This is the documentation for the checkbox component
+#### Overview
+
+The **Checkbox** component allows users to select one or multiple options from a list of choices. It provides a straightforward way to toggle selections on or off and can be used individually or within a group of related options.
+
+### When to Use
+
+Use the **Checkbox** component when:
+- In lists or forms where users can select multiple items.
+- For binary options, especially when changes require saving.
+- For active agreements, such as accepting terms of service.
+
+When selecting a single option from a set of mutually exclusive choices, use **[Radio Buttons](https://mparticle.github.io/aquarium/?path=/story/components-data-entry-radio--primary)**.
+
+Use **[switch](https://mparticle.github.io/aquarium/?path=/story/components-data-entry-switch--primary)** for cases like activation, filter controls, or subscriptions where there is a clear "on/off" state.
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Checkbox Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=388-11036&p=f&t=zURbLpG60aM6aJiH-0) |
+| AntD | [Checkbox Component](https://ant.design/components/checkbox) |
-{/* Documentation goes here */}
-
\ No newline at end of file
+
diff --git a/docs/components/Data Entry/Date Picker/Documentation.mdx b/docs/components/Data Entry/Date Picker/Documentation.mdx
index 8fb35d6bc..e2c4663b7 100644
--- a/docs/components/Data Entry/Date Picker/Documentation.mdx
+++ b/docs/components/Data Entry/Date Picker/Documentation.mdx
@@ -8,8 +8,15 @@ import * as DatePickerStories from '../../../../src/components/data-entry/DatePi
# Date Picker
-This is the documentation for the date picker component
+#### Overview
+Used to select or input a single date through an interactive popup calendar.
+For date range selection with presets, use the [Date Range Filter](https://mparticle.github.io/aquarium/?path=/story/candidate-components-directory-date-range-filter--date-range-filter).
-{/* Documentation goes here */}
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [DatePicker Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=388-11437&p=f&t=zURbLpG60aM6aJiH-0) |
+| AntD | [DatePicker Component](https://ant.design/components/date-picker) |
-
\ No newline at end of file
+
diff --git a/docs/components/Data Entry/Input/Documentation.mdx b/docs/components/Data Entry/Input/Documentation.mdx
index fe437350d..be5d2347c 100644
--- a/docs/components/Data Entry/Input/Documentation.mdx
+++ b/docs/components/Data Entry/Input/Documentation.mdx
@@ -8,8 +8,19 @@ import * as InputStories from '../../../../src/components/data-entry/Input/Input
# Input
-This is the documentation for the Inputs component
+#### Overview
+The **Input** component allows users to enter content using a mouse or keyboard. It serves as the most basic form field wrapper and is commonly used where user input is required.
+
+#### **When To Use**
+- A user input in a form field is needed.
+- A search input is required.
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Input Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=388-11439&p=f&t=zURbLpG60aM6aJiH-0) |
+| AntD | [Input Component](https://ant.design/components/input) |
-{/* Documentation goes here */}
diff --git a/docs/components/Data Entry/InputNumber/Documentation.mdx b/docs/components/Data Entry/InputNumber/Documentation.mdx
index 075c8bde0..3cea09db1 100644
--- a/docs/components/Data Entry/InputNumber/Documentation.mdx
+++ b/docs/components/Data Entry/InputNumber/Documentation.mdx
@@ -8,8 +8,18 @@ import * as InputNumberStories from '../../../../src/components/data-entry/Input
# InputNumber
-This is the documentation for the InputNumbers component
+#### Overview
+The **InputNumber** component allows users to enter numeric values within a specified range using the mouse or keyboard. It ensures controlled and validated number input.
-{/* Documentation goes here */}
+#### **When To Use**
+- When a numeric value needs to be provided by the user.
+- To restrict input to numbers only, optionally within a defined range.
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [InputNumber Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=388-11439&p=f&t=zURbLpG60aM6aJiH-0) |
+| AntD | [InputNumber Component](https://ant.design/components/input-number) |
diff --git a/docs/components/Data Entry/QueryItem/Documentation.mdx b/docs/components/Data Entry/QueryItem/Documentation.mdx
index e455567a0..7bf6ff575 100644
--- a/docs/components/Data Entry/QueryItem/Documentation.mdx
+++ b/docs/components/Data Entry/QueryItem/Documentation.mdx
@@ -8,8 +8,14 @@ import * as QueryItemStories from '../../../../src/components/data-entry/QueryIt
# QueryItem
-This is the documentation for the QueryItems component
-
-{/* Documentation goes here */}
+QueryItems are the essential elements used for query builders such as **Analysis Builder**, **Audience Builder**, or **Prediction Builder**. They work together to form clauses that power query logic.
+#### **Types of QueryItems**
+There are four types of QueryItems, each serving a specific purpose:
+1. **ValueSelector**: Used to select a specific value from a list or range.
+2. **Qualifier**: Defines conditions, such as operators (e.g., equals, greater than).
+3. **Text**: Allows free-form text input for custom queries or descriptions.
+4. **Action**: Provides interactive options, such as adding or removing query items.
+#### **When To Use**
+- To build queries for analytical tools like Audience Builder or Analysis Builder.
diff --git a/docs/components/Data Entry/Radio/Documentation.mdx b/docs/components/Data Entry/Radio/Documentation.mdx
index 80ce38c8c..d89622c03 100644
--- a/docs/components/Data Entry/Radio/Documentation.mdx
+++ b/docs/components/Data Entry/Radio/Documentation.mdx
@@ -8,8 +8,19 @@ import * as RadioStories from '../../../../src/components/data-entry/Radio/Radio
# Radio
-This is the documentation for the Radios component
+#### Overview
+Used to select a single state from multiple options.
-{/* Documentation goes here */}
+#### **When To Use**
+- To select a single state from multiple options.
+- Unlike **[select](https://mparticle.github.io/aquarium/?path=/story/components-data-entry-select--primary)**, **Radio** is always visible, helping users easily compare choices.
+- Use **Radio** when there are few options to avoid overwhelming the user.
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Radio Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=395-10973&p=f&t=zURbLpG60aM6aJiH-0) |
+| AntD | [Radio Component](https://ant.design/components/radio) |
-
+
diff --git a/docs/components/Data Entry/Select/Documentation.mdx b/docs/components/Data Entry/Select/Documentation.mdx
index 1dc415445..da5c3f106 100644
--- a/docs/components/Data Entry/Select/Documentation.mdx
+++ b/docs/components/Data Entry/Select/Documentation.mdx
@@ -28,7 +28,8 @@ Select component allows users to select the necessary record from a list.
| Type | Resource |
| ------ | -------- |
| Eames | [Select Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=1217-31707&t=5iHsAw2QyK8Lx8zt-4) |
+| AntD | [Select Component](https://ant.design/components/select) |
{/* Documentation goes here */}
-
\ No newline at end of file
+
diff --git a/docs/components/Data Entry/Switch/Documentation.mdx b/docs/components/Data Entry/Switch/Documentation.mdx
index 73ec5158f..30abce59f 100644
--- a/docs/components/Data Entry/Switch/Documentation.mdx
+++ b/docs/components/Data Entry/Switch/Documentation.mdx
@@ -7,9 +7,18 @@ import * as SwitchStories from '../../../../src/components/data-entry/Switch/Swi
{/* Documentation goes here */}
# Switch
+#### Overview
+Used to toggle between two states.
-This is the documentation for the Switchs component
+#### **When To Use**
+- To represent the switching between two states, such as an on-off state.
+- Use **Switch** when the state change happens immediately upon toggling.
+- Use **[Checkbox](https://mparticle.github.io/aquarium/?path=/story/components-data-entry-checkbox--primary)** for state marking, which typically requires a submit operation to apply changes.
-{/* Documentation goes here */}
+#### Related Links
+| Type | Resource |
+| ------ | -------- |
+| Eames | [Switch Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=396-12305&p=f&t=hGHFK3BQiEoVHZ6E-0) |
+| AntD | [Switch Component](https://ant.design/components/switch) |
diff --git a/docs/components/Data Entry/TreeSelect/Documentation.mdx b/docs/components/Data Entry/TreeSelect/Documentation.mdx
index 20c36573b..6b5d3a192 100644
--- a/docs/components/Data Entry/TreeSelect/Documentation.mdx
+++ b/docs/components/Data Entry/TreeSelect/Documentation.mdx
@@ -7,9 +7,18 @@ import * as TreeSelectStories from '../../../../src/components/data-entry/TreeSe
{/* Documentation goes here */}
# TreeSelect
+#### Overview
+**TreeSelect** is similar to Select, but the values are provided in a tree-like structure.
-This is the documentation for the TreeSelects component
+#### **When To Use**
+- Use **TreeSelect** when data entries are defined in a hierarchical manner.
+- Ideal for scenarios like categorized data with parent-child relationships
-{/* Documentation goes here */}
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [TreeSelect Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=396-13800&p=f&t=tFDp4mtk1zJJUroL-0) |
+| AntD | [TreeSelect Component](https://ant.design/components/tree-select) |
diff --git a/docs/components/Data Entry/Upload/Documentation.mdx b/docs/components/Data Entry/Upload/Documentation.mdx
index e9c095bf5..521c866ed 100644
--- a/docs/components/Data Entry/Upload/Documentation.mdx
+++ b/docs/components/Data Entry/Upload/Documentation.mdx
@@ -7,9 +7,19 @@ import * as UploadStories from '../../../../src/components/data-entry/Upload/Upl
{/* Documentation goes here */}
# Upload
+#### Overview
+Used to select and upload files or drag and drop files.
-This is the documentation for the Uploads component
+#### **When To Use**
+- When you need to upload one or more files.
+- When you want to allow file uploads via drag-and-drop.
+- When you need to display the upload process (e.g., progress indicators).
-{/* Documentation goes here */}
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Upload Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=396-13801&p=f&t=qTxTI3nmyrN7o7DQ-0) |
+| AntD | [Upload Component](https://ant.design/components/upload) |
diff --git a/docs/components/Feedback/Alert/Documentation.mdx b/docs/components/Feedback/Alert/Documentation.mdx
new file mode 100644
index 000000000..18466a64b
--- /dev/null
+++ b/docs/components/Feedback/Alert/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as AlertStories from '../../../../src/components/feedback/Alert/Alert.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Alert
+
+This is the documentation for the Alert component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Alert Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=413-15306&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Alert Component](https://ant.design/components/alert) |
diff --git a/docs/components/Feedback/Notification/Documentation.mdx b/docs/components/Feedback/Notification/Documentation.mdx
new file mode 100644
index 000000000..59b778410
--- /dev/null
+++ b/docs/components/Feedback/Notification/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as NotificationStories from '../../../../src/components/feedback/Notification/Notification.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Notification
+
+This is the documentation for the Notification component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Notification Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=422-13542&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Notification Component](https://ant.design/components/notification) |
diff --git a/docs/components/Feedback/Popconfirm/Documentation.mdx b/docs/components/Feedback/Popconfirm/Documentation.mdx
new file mode 100644
index 000000000..ee9e75e0b
--- /dev/null
+++ b/docs/components/Feedback/Popconfirm/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as PopconfirmStories from '../../../../src/components/feedback/Popconfirm/Popconfirm.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Popconfirm
+
+This is the documentation for the Popconfirm component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Popconfirm Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=422-13717&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Popconfirm Component](https://ant.design/components/popconfirm) |
diff --git a/docs/components/Feedback/Progress/Documentation.mdx b/docs/components/Feedback/Progress/Documentation.mdx
new file mode 100644
index 000000000..7db397d60
--- /dev/null
+++ b/docs/components/Feedback/Progress/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as ProgressStories from '../../../../src/components/feedback/Progress/Progress.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Progress
+
+This is the documentation for the Progress component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Progress Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=422-13987&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Progress Component](https://ant.design/components/progress) |
diff --git a/docs/components/Feedback/Result/Documentation.mdx b/docs/components/Feedback/Result/Documentation.mdx
new file mode 100644
index 000000000..c848e5252
--- /dev/null
+++ b/docs/components/Feedback/Result/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as ResultStories from '../../../../src/components/feedback/Result/Result.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Result
+
+This is the documentation for the Result component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Result Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=423-32&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Result Component](https://ant.design/components/result) |
diff --git a/docs/components/Feedback/Skeleton/Documentation.mdx b/docs/components/Feedback/Skeleton/Documentation.mdx
new file mode 100644
index 000000000..c35e30d63
--- /dev/null
+++ b/docs/components/Feedback/Skeleton/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as SkeletonStories from '../../../../src/components/feedback/Skeleton/Skeleton.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Skeleton
+
+This is the documentation for the Skeleton component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Skeleton Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=423-365&p=f&t=6nzqzvHIbyHgLbNh-0) |
+| AntD | [Skeleton Component](https://ant.design/components/skeleton) |
diff --git a/docs/components/Feedback/Spin/Documentation.mdx b/docs/components/Feedback/Spin/Documentation.mdx
new file mode 100644
index 000000000..123a07a96
--- /dev/null
+++ b/docs/components/Feedback/Spin/Documentation.mdx
@@ -0,0 +1,22 @@
+import { Meta, Canvas } from '@storybook/blocks';
+
+import * as SpinStories from '../../../../src/components/feedback/Spin/Spin.stories';
+
+
+
+{/* Documentation goes here */}
+
+# Spin
+
+This is the documentation for the Spin component
+
+{/* Documentation goes here */}
+
+
+
+### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Spin Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=516-40776&p=f&t=CcQ8vx5kuy3kh5XE-0) |
+| AntD | [Spin Component](https://ant.design/components/spin) |
diff --git a/docs/components/General/Button/Documentation.mdx b/docs/components/General/Button/Documentation.mdx
new file mode 100644
index 000000000..593c50e28
--- /dev/null
+++ b/docs/components/General/Button/Documentation.mdx
@@ -0,0 +1,91 @@
+import { Meta, Canvas } from '@storybook/blocks'
+
+import * as ButtonStories from '../../../../src/components/general/Button/Button.stories'
+
+
+
+{/* Documentation goes here */}
+
+# Button
+
+#### Overview
+
+The **Button** component is used to trigger actions or navigate the interface. It supports various styles, sizes, and states to fit different use cases.
+
+#### Key Features
+
+- **Variants:** Includes primary, default, dashed, text, and link buttons for different use cases.
+- **Sizes:** Supports small, medium (default), and large sizes.
+- **States:** Disabled, loading, and hover states to indicate action availability.
+- **Icons:** Easily integrate icons for visual clarity and emphasis.
+
+
+### Button Variants and Use Cases
+
+#### Primary Button
+
+**Use Case**: For the main action on a page or section.
+- **Example:** Submitting a form, saving changes, or initiating a key process.
+
+**Examples**:
+
+- **With Icon**:
+
+
+- **Without Icon**:
+
+
+#### Default Button
+
+**Use Case**: For secondary actions that complement the primary task.
+- **Example:** Canceling an action, opening a dialog, or performing less important tasks.
+
+**Examples**:
+
+- **With Icon**:
+
+
+- **Without Icon**:
+
+
+#### Dashed Button
+
+**Use Case**: For tertiary actions in the visual hierarchy.
+
+**Examples**:
+
+- **With Icon**:
+
+
+- **Without Icon**:
+
+
+#### Link Button
+
+**Use Case**: Ideal for triggering an actions that don't require heavy visual emphasis.
+- **Example:** Viewing errors, navigating to documentation
+When navigating to a new URL or external page, always use [Typography.Link](https://mparticle.github.io/aquarium/?path=/story/components-general-typography-link--primary) instead of a Link Button.
+
+**Examples**:
+
+- **With Icon**:
+
+
+- **Without Icon**:
+
+
+#### Icon-Only Button
+
+**Use Case**: For compact controls where only an icon is needed.
+- **Example:** Toolbar controls, close buttons, or quick actions.
+
+**Examples**:
+
+
+
+#### Related Links
+
+| Type | Resource |
+| ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| Eames | [Button Component](https://www.figma.com/design/veXnmignQnJz8StIq10VJ5/Eames-2.0---Foundations-%26-Components?node-id=368-430&p=f&t=1Pi9thxrLJt7TsHN-0) |
+| AntD | [Button Component](https://ant.design/components/button) |
diff --git a/package-lock.json b/package-lock.json
index 05b33f1d7..6248dbe82 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@mparticle/aquarium",
- "version": "1.36.1",
+ "version": "1.37.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@mparticle/aquarium",
- "version": "1.36.1",
+ "version": "1.37.0",
"license": "Apache-2.0",
"dependencies": {
"lodash.clonedeep": "4.5.0"
diff --git a/package.json b/package.json
index 75bb14915..767cb47fd 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@mparticle/aquarium",
- "version": "1.36.1",
+ "version": "1.37.0",
"description": "mParticle Component Library",
"license": "Apache-2.0",
"keywords": [
diff --git a/src/assets/svg/crosshair.svg b/src/assets/svg/crosshair.svg
deleted file mode 100644
index dd26ccdb1..000000000
--- a/src/assets/svg/crosshair.svg
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/assets/svg/precision.svg b/src/assets/svg/precision.svg
new file mode 100644
index 000000000..b783191a4
--- /dev/null
+++ b/src/assets/svg/precision.svg
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/components/data-display/Avatar/Avatar.stories.tsx b/src/components/data-display/Avatar/Avatar.stories.tsx
index 33be7360f..634b37784 100644
--- a/src/components/data-display/Avatar/Avatar.stories.tsx
+++ b/src/components/data-display/Avatar/Avatar.stories.tsx
@@ -1,46 +1,9 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { useState } from 'react'
-import { Avatar, Badge, Button, Icon, Space } from 'src/components'
-import { ExampleStory } from 'src/utils/ExampleStory'
+import { Avatar, Icon } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Avatar',
component: Avatar,
-
- args: {
- alt: 'Avatar',
- gap: 4,
- icon: ,
- shape: 'circle',
- size: 'default',
- src: undefined,
- srcSet: undefined,
- draggable: true,
- crossOrigin: '',
- onError: () => true,
- },
- argTypes: {
- crossOrigin: {
- control: 'select',
- options: ['anonymous', 'use-credentials', ''],
- },
- shape: {
- control: 'select',
- options: ['circle', 'square'],
- },
- draggable: {
- control: 'select',
- options: [true, false, 'true', 'false'],
- },
- icon: {
- control: 'select',
- options: ['Users', 'Sparkles'],
- mapping: {
- Users: ,
- Sparkles: ,
- },
- },
- },
}
export default meta
@@ -51,140 +14,14 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const Square: Story = {
- args: {
- shape: 'square',
- },
-}
-
-export const Large: Story = {
+export const WithInitials: Story = {
args: {
- size: 'large',
+ children: 'mP',
},
}
-export const Small: Story = {
+export const WithIcon: Story = {
args: {
- size: 'small',
- },
-}
-
-export const CustomSizes: Story = {
- args: {
- size: { xs: 24, sm: 32, md: 40, lg: 64, xl: 80, xxl: 120 },
- },
-}
-
-export const CustomIcon: Story = {
- args: {
- icon: 'Sparkles',
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- return (
-
-
-
- } />
- } />
- } />
- } />
-
-
- } />
- } />
- } />
- } />
-
-
-
- )
- },
-}
-
-export const ExampleTypes: Story = {
- render: () => {
- const url = 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg'
- return (
-
-
- } />
- U
- USER
-
- } />
- U
- } />
-
-
- )
- },
-}
-
-export const ExampleWithBadge: Story = {
- render: () => {
- return (
-
-
-
- } />
-
-
- } />
-
-
-
- )
- },
-}
-
-export const ExampleResponsive: Story = {
- render: () => {
- return (
-
- } />
-
- )
- },
-}
-
-export const ExampleAutosetFontSize: Story = {
- render: () => {
- const UserList = ['Edward', 'U', 'Lucy', 'Tom']
- const ColorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae']
- const GapList = [4, 3, 2, 1]
-
- const [user, setUser] = useState(UserList[0])
- const [color, setColor] = useState(ColorList[0])
- const [gap, setGap] = useState(GapList[0])
-
- const changeUser = (): void => {
- const index = UserList.indexOf(user)
- setUser(index < UserList.length - 1 ? UserList[index + 1] : UserList[0])
- setColor(index < ColorList.length - 1 ? ColorList[index + 1] : ColorList[0])
- }
-
- const changeGap = (): void => {
- const index = GapList.indexOf(gap)
- setGap(index < GapList.length - 1 ? GapList[index + 1] : GapList[0])
- }
-
- return (
-
-
- {user}
-
-
- ChangeUser
-
-
- changeGap
-
-
- )
+ icon: ,
},
}
diff --git a/src/components/data-display/Avatar/AvatarNotProdReady.stories.tsx b/src/components/data-display/Avatar/AvatarNotProdReady.stories.tsx
new file mode 100644
index 000000000..e9c87c2f4
--- /dev/null
+++ b/src/components/data-display/Avatar/AvatarNotProdReady.stories.tsx
@@ -0,0 +1,190 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { useState } from 'react'
+import { Avatar, Badge, Button, Icon, Space } from 'src/components'
+import { ExampleStory } from 'src/utils/ExampleStory'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Avatar',
+ component: Avatar,
+
+ args: {
+ alt: 'Avatar',
+ gap: 4,
+ icon: ,
+ shape: 'circle',
+ size: 'default',
+ src: undefined,
+ srcSet: undefined,
+ draggable: true,
+ crossOrigin: '',
+ onError: () => true,
+ },
+ argTypes: {
+ crossOrigin: {
+ control: 'select',
+ options: ['anonymous', 'use-credentials', ''],
+ },
+ shape: {
+ control: 'select',
+ options: ['circle', 'square'],
+ },
+ draggable: {
+ control: 'select',
+ options: [true, false, 'true', 'false'],
+ },
+ icon: {
+ control: 'select',
+ options: ['Users', 'Sparkles'],
+ mapping: {
+ Users: ,
+ Sparkles: ,
+ },
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const Square: Story = {
+ args: {
+ shape: 'square',
+ },
+}
+
+export const Large: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const CustomSizes: Story = {
+ args: {
+ size: { xs: 24, sm: 32, md: 40, lg: 64, xl: 80, xxl: 120 },
+ },
+}
+
+export const CustomIcon: Story = {
+ args: {
+ icon: 'Sparkles',
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ return (
+
+
+
+ } />
+ } />
+ } />
+ } />
+
+
+ } />
+ } />
+ } />
+ } />
+
+
+
+ )
+ },
+}
+
+export const ExampleTypes: Story = {
+ render: () => {
+ const url = 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg'
+ return (
+
+
+ } />
+ U
+ USER
+
+ } />
+ U
+ } />
+
+
+ )
+ },
+}
+
+export const ExampleWithBadge: Story = {
+ render: () => {
+ return (
+
+
+
+ } />
+
+
+ } />
+
+
+
+ )
+ },
+}
+
+export const ExampleResponsive: Story = {
+ render: () => {
+ return (
+
+ } />
+
+ )
+ },
+}
+
+export const ExampleAutosetFontSize: Story = {
+ render: () => {
+ const UserList = ['Edward', 'U', 'Lucy', 'Tom']
+ const ColorList = ['#f56a00', '#7265e6', '#ffbf00', '#00a2ae']
+ const GapList = [4, 3, 2, 1]
+
+ const [user, setUser] = useState(UserList[0])
+ const [color, setColor] = useState(ColorList[0])
+ const [gap, setGap] = useState(GapList[0])
+
+ const changeUser = (): void => {
+ const index = UserList.indexOf(user)
+ setUser(index < UserList.length - 1 ? UserList[index + 1] : UserList[0])
+ setColor(index < ColorList.length - 1 ? ColorList[index + 1] : ColorList[0])
+ }
+
+ const changeGap = (): void => {
+ const index = GapList.indexOf(gap)
+ setGap(index < GapList.length - 1 ? GapList[index + 1] : GapList[0])
+ }
+
+ return (
+
+
+ {user}
+
+
+ ChangeUser
+
+
+ changeGap
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Badge/Badge.stories.tsx b/src/components/data-display/Badge/Badge.stories.tsx
index 1d48aa0d7..65d11ba68 100644
--- a/src/components/data-display/Badge/Badge.stories.tsx
+++ b/src/components/data-display/Badge/Badge.stories.tsx
@@ -1,42 +1,12 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { Badge } from 'src/components/data-display/Badge/Badge'
+import { ColorPrimary } from 'src/styles/style'
import { ExampleStory } from 'src/utils/ExampleStory'
-import { Avatar, Button } from 'src/components'
import { Space } from 'src/components'
-import { Switch } from 'src/components'
-import { Card } from 'src/components'
-import { Divider } from 'src/components'
-import { useState } from 'react'
-import { Icon } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Badge',
component: Badge,
-
- args: {
- color: '',
- count: 5,
- classNames: undefined,
- dot: false,
- offset: undefined,
- overflowCount: 99,
- showZero: false,
- size: 'default',
- status: undefined,
- styles: undefined,
- text: undefined,
- title: '',
- },
- argTypes: {
- size: {
- control: 'select',
- options: ['default', 'small'],
- },
- status: {
- control: 'select',
- options: ['success', 'processing', 'default', 'error', 'warning'],
- },
- },
}
export default meta
@@ -47,173 +17,20 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
export const DotBadge: Story = {
args: {
dot: true,
+ color: ColorPrimary,
},
}
-export const SmallSize: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const OverflowCount: Story = {
- args: {
- overflowCount: 2,
- },
-}
-
-export const CustomColor: Story = {
- args: {
- color: '#f60',
- },
-}
-
-export const CustomText: Story = {
- args: {
- text: 'Custom Text',
- },
-}
-
-export const HoverTitle: Story = {
- args: {
- title: 'Custom Hovering Text',
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
-
- }>
-
-
-
-
- )
- },
-}
-
-export const ExampleStandalone: Story = {
- render: () => {
- const [show, setShow] = useState(true)
- return (
-
-
- {
- setShow(!show)
- }}
- />
-
-
- : 0} />
-
-
-
- )
- },
-}
-
-export const ExampleOverflowCount: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleDynamic: Story = {
- render: () => {
- const [count, setCount] = useState(5)
- const [show, setShow] = useState(true)
-
- const increase = () => {
- setCount(count + 1)
- }
-
- const decline = () => {
- let newCount = count - 1
- if (newCount < 0) {
- newCount = 0
- }
- setCount(newCount)
- }
-
- const random = () => {
- const newCount = Math.floor(Math.random() * 100)
- setCount(newCount)
- }
-
- const onChange = (checked: boolean) => {
- setShow(checked)
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
+export const BadgeStatus: Story = {
+ argTypes: {
+ status: {
+ control: 'select',
+ options: ['success', 'processing', 'default', 'error', 'warning'],
+ },
},
-}
-
-export const ExampleOffset: Story = {
- render: () => {
- return (
-
-
-
-
-
- )
- },
-}
-
-export const ExampleStatus: Story = {
render: () => {
return (
@@ -237,69 +54,10 @@ export const ExampleStatus: Story = {
},
}
-export const ExampleRibbon: Story = {
- render: () => {
- return (
-
-
-
-
- Card Inner text
-
-
-
-
- )
- },
-}
-
-export const ExampleClickable: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleColors: Story = {
- render: () => {
- const colors = [
- 'pink',
- 'red',
- 'yellow',
- 'orange',
- 'cyan',
- 'green',
- 'blue',
- 'purple',
- 'geekblue',
- 'magenta',
- 'volcano',
- 'gold',
- 'lime',
- ]
- return (
-
- Presets
-
- {colors.map(color => (
-
- ))}
-
- Custom
-
-
-
-
-
-
-
- )
+export const WithText: Story = {
+ args: {
+ dot: true,
+ status: 'success',
+ text: 'Active',
},
}
diff --git a/src/components/data-display/Badge/BadgeNotProdReady.stories.tsx b/src/components/data-display/Badge/BadgeNotProdReady.stories.tsx
new file mode 100644
index 000000000..c4c2b5f1c
--- /dev/null
+++ b/src/components/data-display/Badge/BadgeNotProdReady.stories.tsx
@@ -0,0 +1,275 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Badge } from 'src/components/data-display/Badge/Badge'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Avatar, Button } from 'src/components'
+import { Space } from 'src/components'
+import { Switch } from 'src/components'
+import { Card } from 'src/components'
+import { Divider } from 'src/components'
+import { useState } from 'react'
+import { Icon } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Badge',
+ component: Badge,
+
+ args: {
+ color: '',
+ count: 5,
+ classNames: undefined,
+ dot: false,
+ offset: undefined,
+ overflowCount: 99,
+ showZero: false,
+ size: 'default',
+ status: undefined,
+ styles: undefined,
+ text: undefined,
+ title: '',
+ },
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['default', 'small'],
+ },
+ status: {
+ control: 'select',
+ options: ['success', 'processing', 'default', 'error', 'warning'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const SmallSize: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const OverflowCount: Story = {
+ args: {
+ overflowCount: 2,
+ },
+}
+
+export const CustomColor: Story = {
+ args: {
+ color: '#f60',
+ },
+}
+
+export const CustomText: Story = {
+ args: {
+ text: 'Custom Text',
+ },
+}
+
+export const HoverTitle: Story = {
+ args: {
+ title: 'Custom Hovering Text',
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+
+ }>
+
+
+
+
+ )
+ },
+}
+
+export const ExampleStandalone: Story = {
+ render: () => {
+ const [show, setShow] = useState(true)
+ return (
+
+
+ {
+ setShow(!show)
+ }}
+ />
+
+
+ : 0} />
+
+
+
+ )
+ },
+}
+
+export const ExampleOverflowCount: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleDynamic: Story = {
+ render: () => {
+ const [count, setCount] = useState(5)
+ const [show, setShow] = useState(true)
+
+ const increase = () => {
+ setCount(count + 1)
+ }
+
+ const decline = () => {
+ let newCount = count - 1
+ if (newCount < 0) {
+ newCount = 0
+ }
+ setCount(newCount)
+ }
+
+ const random = () => {
+ const newCount = Math.floor(Math.random() * 100)
+ setCount(newCount)
+ }
+
+ const onChange = (checked: boolean) => {
+ setShow(checked)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleOffset: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleRibbon: Story = {
+ render: () => {
+ return (
+
+
+
+
+ Card Inner text
+
+
+
+
+ )
+ },
+}
+
+export const ExampleClickable: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleColors: Story = {
+ render: () => {
+ const colors = [
+ 'pink',
+ 'red',
+ 'yellow',
+ 'orange',
+ 'cyan',
+ 'green',
+ 'blue',
+ 'purple',
+ 'geekblue',
+ 'magenta',
+ 'volcano',
+ 'gold',
+ 'lime',
+ ]
+ return (
+
+ Presets
+
+ {colors.map(color => (
+
+ ))}
+
+ Custom
+
+
+
+
+
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Card/Card.stories.tsx b/src/components/data-display/Card/Card.stories.tsx
index 32a50f0d7..3bb9b0768 100644
--- a/src/components/data-display/Card/Card.stories.tsx
+++ b/src/components/data-display/Card/Card.stories.tsx
@@ -1,40 +1,18 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { Card } from 'src/components/data-display/Card/Card'
-import { Button } from 'src/components'
+import { Button, Flex, Form, QueryItem, Typography } from 'src/components'
+import { MarginSm, MpBrandSecondary2, PaddingXs } from 'src/styles/style'
import { ExampleStory } from 'src/utils/ExampleStory'
-import { Col } from 'src/components'
-import { Row } from 'src/components'
-import { useState } from 'react'
-import { Switch } from 'src/components'
-import { Avatar } from 'src/components'
-import { Skeleton } from 'src/components'
-import { Icon } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Card',
component: props => {props.children} ,
args: {
- actions: undefined,
- activeTabKey: undefined,
- bodyStyle: undefined,
- bordered: true,
- cover: undefined,
- defaultActiveTabKey: undefined,
- extra: undefined,
- headStyle: undefined,
hoverable: false,
- loading: false,
size: 'default',
- tabBarExtraContent: undefined,
- tabList: undefined,
- tabProps: undefined,
- title: 'Card Title',
- type: undefined,
- children: 'Card Content',
- onTabChange: key => {
- alert(`Tab Changed: ${key}`)
- },
+ title: '',
+ children: Card Content ,
},
argTypes: {
size: {
@@ -52,275 +30,38 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const SmallSize: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const NoBorder: Story = {
+export const Primary: Story = {
args: {
- bordered: false,
+ title: Any React Component ,
},
}
export const Hoverable: Story = {
args: {
+ title: 'Hoverable card',
hoverable: true,
},
}
-export const Loading: Story = {
- args: {
- loading: true,
- },
-}
-
-export const WithActions: Story = {
- args: {
- children: 'Custom Actions',
- actions: [Edit ],
- },
-}
-
-export const WithTabs: Story = {
- args: {
- tabList: [
- { key: 'tab1', tab: 'Tab 1' },
- { key: 'tab2', tab: 'Tab 2' },
- { key: 'tab3', tab: 'Tab 3' },
- ],
- },
-}
-
-export const WithCover: Story = {
- args: {
- cover: ,
- },
-}
-
-export const CustomTitle: Story = {
- args: {
- title: Any React Component ,
- },
-}
-
-export const InnerStyle: Story = {
- args: {
- type: 'inner',
- },
-}
-
-export const ExampleMeta: Story = {
- render: () => {
- return (
-
- }>
-
-
-
- )
- },
-}
-
-export const ExampleColumn: Story = {
- render: () => {
- return (
-
-
-
-
- Card content
-
-
-
-
- Card content
-
-
-
-
- Card content
-
-
-
-
- )
- },
-}
-
-export const ExampleGrid: Story = {
- render: () => {
- const gridStyle: React.CSSProperties = {
- width: '25%',
- textAlign: 'center',
- }
-
- return (
-
-
- Content
-
- Content
-
- Content
- Content
- Content
- Content
- Content
-
-
- )
- },
-}
-
-export const ExampleLoading: Story = {
- render: () => {
- const [loading, setLoading] = useState(true)
- const onChange = (checked: boolean) => {
- setLoading(!checked)
- }
- return (
-
- <>
-
-
- }
- title="Card title"
- description="This is the description"
- />
-
- , , ]}>
-
- }
- title="Card title"
- description="This is the description"
- />
-
-
- >
-
- )
- },
-}
-
-export const ExampleInnerCard: Story = {
+export const WithInnerCard: Story = {
render: () => {
return (
-
- More}>
- Inner Card content
+
+
+
+
+
+
+
+
+
- More}>
- Inner Card content
-
-
-
- )
- },
-}
-
-export const ExampleWithTabs: Story = {
- render: () => {
- const tabList = [
- {
- key: 'tab1',
- tab: 'tab1',
- },
- {
- key: 'tab2',
- tab: 'tab2',
- },
- ]
-
- const contentList: Record = {
- tab1: content1
,
- tab2: content2
,
- }
-
- const tabListNoTitle = [
- {
- key: 'article',
- label: 'article',
- },
- {
- key: 'app',
- label: 'app',
- },
- {
- key: 'project',
- label: 'project',
- },
- ]
-
- const contentListNoTitle: Record = {
- article: article content
,
- app: app content
,
- project: project content
,
- }
-
- const [activeTabKey1, setActiveTabKey1] = useState('tab1')
- const [activeTabKey2, setActiveTabKey2] = useState('app')
-
- const onTab1Change = (key: string) => {
- setActiveTabKey1(key)
- }
- const onTab2Change = (key: string) => {
- setActiveTabKey2(key)
- }
-
- return (
-
- More}
- tabList={tabList}
- activeTabKey={activeTabKey1}
- onTabChange={onTab1Change}>
- {contentList[activeTabKey1]}
-
-
-
- More}
- onTabChange={onTab2Change}
- tabProps={{
- size: 'middle',
- }}>
- {contentListNoTitle[activeTabKey2]}
-
-
- )
- },
-}
-
-export const ExampleContentConfiguration: Story = {
- render: () => {
- return (
-
- }
- actions={[ , , ]}>
- }
- title="Card title"
- description="This is the description"
- />
)
diff --git a/src/components/data-display/Card/CardNotProdReady.stories.tsx b/src/components/data-display/Card/CardNotProdReady.stories.tsx
new file mode 100644
index 000000000..878bfb638
--- /dev/null
+++ b/src/components/data-display/Card/CardNotProdReady.stories.tsx
@@ -0,0 +1,314 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Card } from 'src/components/data-display/Card/Card'
+import { Button } from 'src/components'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Col } from 'src/components'
+import { Row } from 'src/components'
+import { useState } from 'react'
+import { Switch } from 'src/components'
+import { Avatar } from 'src/components'
+import { Skeleton } from 'src/components'
+import { Icon } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Card',
+ component: props => {props.children} ,
+
+ args: {
+ actions: undefined,
+ activeTabKey: undefined,
+ bodyStyle: undefined,
+ bordered: true,
+ cover: undefined,
+ defaultActiveTabKey: undefined,
+ extra: undefined,
+ headStyle: undefined,
+ hoverable: false,
+ loading: false,
+ size: 'default',
+ tabBarExtraContent: undefined,
+ tabList: undefined,
+ tabProps: undefined,
+ title: 'Card Title',
+ type: undefined,
+ children: 'Card Content',
+ onTabChange: key => {
+ alert(`Tab Changed: ${key}`)
+ },
+ },
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['default', 'small'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const SmallSize: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const NoBorder: Story = {
+ args: {
+ bordered: false,
+ },
+}
+
+export const Loading: Story = {
+ args: {
+ loading: true,
+ },
+}
+
+export const WithActions: Story = {
+ args: {
+ children: 'Custom Actions',
+ actions: [Edit ],
+ },
+}
+
+export const WithTabs: Story = {
+ args: {
+ tabList: [
+ { key: 'tab1', tab: 'Tab 1' },
+ { key: 'tab2', tab: 'Tab 2' },
+ { key: 'tab3', tab: 'Tab 3' },
+ ],
+ },
+}
+
+export const WithCover: Story = {
+ args: {
+ cover: ,
+ },
+}
+
+export const InnerStyle: Story = {
+ args: {
+ type: 'inner',
+ },
+}
+
+export const ExampleMeta: Story = {
+ render: () => {
+ return (
+
+ }>
+
+
+
+ )
+ },
+}
+
+export const ExampleColumn: Story = {
+ render: () => {
+ return (
+
+
+
+
+ Card content
+
+
+
+
+ Card content
+
+
+
+
+ Card content
+
+
+
+
+ )
+ },
+}
+
+export const ExampleGrid: Story = {
+ render: () => {
+ const gridStyle: React.CSSProperties = {
+ width: '25%',
+ textAlign: 'center',
+ }
+
+ return (
+
+
+ Content
+
+ Content
+
+ Content
+ Content
+ Content
+ Content
+ Content
+
+
+ )
+ },
+}
+
+export const ExampleLoading: Story = {
+ render: () => {
+ const [loading, setLoading] = useState(true)
+ const onChange = (checked: boolean) => {
+ setLoading(!checked)
+ }
+ return (
+
+ <>
+
+
+ }
+ title="Card title"
+ description="This is the description"
+ />
+
+ , , ]}>
+
+ }
+ title="Card title"
+ description="This is the description"
+ />
+
+
+ >
+
+ )
+ },
+}
+
+export const ExampleInnerCard: Story = {
+ render: () => {
+ return (
+
+
+ More}>
+ Inner Card content
+
+ More}>
+ Inner Card content
+
+
+
+ )
+ },
+}
+
+export const ExampleWithTabs: Story = {
+ render: () => {
+ const tabList = [
+ {
+ key: 'tab1',
+ tab: 'tab1',
+ },
+ {
+ key: 'tab2',
+ tab: 'tab2',
+ },
+ ]
+
+ const contentList: Record = {
+ tab1: content1
,
+ tab2: content2
,
+ }
+
+ const tabListNoTitle = [
+ {
+ key: 'article',
+ label: 'article',
+ },
+ {
+ key: 'app',
+ label: 'app',
+ },
+ {
+ key: 'project',
+ label: 'project',
+ },
+ ]
+
+ const contentListNoTitle: Record = {
+ article: article content
,
+ app: app content
,
+ project: project content
,
+ }
+
+ const [activeTabKey1, setActiveTabKey1] = useState('tab1')
+ const [activeTabKey2, setActiveTabKey2] = useState('app')
+
+ const onTab1Change = (key: string) => {
+ setActiveTabKey1(key)
+ }
+ const onTab2Change = (key: string) => {
+ setActiveTabKey2(key)
+ }
+
+ return (
+
+ More}
+ tabList={tabList}
+ activeTabKey={activeTabKey1}
+ onTabChange={onTab1Change}>
+ {contentList[activeTabKey1]}
+
+
+
+ More}
+ onTabChange={onTab2Change}
+ tabProps={{
+ size: 'middle',
+ }}>
+ {contentListNoTitle[activeTabKey2]}
+
+
+ )
+ },
+}
+
+export const ExampleContentConfiguration: Story = {
+ render: () => {
+ return (
+
+ }
+ actions={[ , , ]}>
+ }
+ title="Card title"
+ description="This is the description"
+ />
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Collapse/Collapse.stories.tsx b/src/components/data-display/Collapse/Collapse.stories.tsx
index d6319a258..9b0b08fb0 100644
--- a/src/components/data-display/Collapse/Collapse.stories.tsx
+++ b/src/components/data-display/Collapse/Collapse.stories.tsx
@@ -1,33 +1,40 @@
import { type Meta, type StoryObj } from '@storybook/react'
+import { ConfigProvider, Select } from 'src/components'
import { Collapse } from 'src/components/data-display/Collapse/Collapse'
-import { ExampleStory } from 'src/utils/ExampleStory'
import { type ICollapseProps } from 'src/components/data-display/Collapse/Collapse'
-import { Divider, Icon, Space } from 'src/components'
-import { theme } from 'antd'
-import { Select } from 'src/components'
-import { useState } from 'react'
-
-const text = `
- A dog is a type of domesticated animal.
- Known for its loyalty and faithfulness,
- it can be found as a welcome guest in many households across the world.
-`
const items: ICollapseProps['items'] = [
{
key: '1',
- label: 'This is panel header 1',
- children: {text}
,
+ label: 'Environment',
+ children: (
+ <>
+
+ >
+ ),
},
{
key: '2',
- label: 'This is panel header 2',
- children: {text}
,
- },
- {
- key: '3',
- label: 'This is panel header 3',
- children: {text}
,
+ label: 'Inputs',
+ children: (
+
+ ),
},
]
@@ -36,35 +43,13 @@ const meta: Meta = {
component: props => ,
args: {
- accordion: false,
- activeKey: undefined,
- bordered: true,
- collapsible: undefined,
defaultActiveKey: undefined,
- destroyInactivePanel: false,
- expandIcon: undefined,
- expandIconPosition: undefined,
ghost: false,
- size: 'middle',
items,
onChange: (key: string | string[]) => {
console.log(key)
},
},
- argTypes: {
- size: {
- control: 'select',
- options: ['small', 'medium', 'large'],
- },
- expandIconPosition: {
- control: 'select',
- options: ['start', 'end'],
- },
- collapsible: {
- control: 'select',
- options: ['header', 'icon', 'disabled'],
- },
- },
}
export default meta
@@ -75,358 +60,22 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const AccordionMode: Story = {
- args: {
- accordion: true,
- },
-}
-
-export const WithActivePanel: Story = {
- args: {
- activeKey: ['1'],
- },
-}
-
-export const BorderlessCollapse: Story = {
- args: {
- bordered: false,
- },
-}
-
-export const WithCollapsibleHeaders: Story = {
- args: {
- collapsible: 'header',
- },
-}
-
-export const WithCustomActivePanel: Story = {
- args: {
- defaultActiveKey: ['2'],
- },
-}
-
-export const DestroyInactivePanels: Story = {
- args: {
- destroyInactivePanel: true,
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- const onChange = (key: string | string[]) => {
- console.log(key)
- }
-
- return (
-
-
-
- )
- },
-}
-
-export const ExampleSize: Story = {
- render: () => {
- return (
-
- Supports a default collapse size as well as a large and small size.
-
- If a large or small collapse is desired, set the size property to either large or small respectively. Omit
- the size property for a collapse with the default size.
- >
- }>
- Default Size
- {text} }]} />
- Small Size
- {text} }]}
- />
- Large Size
- {text} }]}
- />
-
- )
- },
-}
-
-export const ExampleAccordion: Story = {
+export const GhostCollapse: Story = {
render: () => {
return (
-
-
-
- )
- },
-}
-
-export const ExampleNestedPanel: Story = {
- render: () => {
- const itemsNest: ICollapseProps['items'] = [
- {
- key: '1',
- label: 'This is panel nest panel',
- children: {text}
,
- },
- ]
-
- const items: ICollapseProps['items'] = [
- {
- key: '1',
- label: 'This is panel header 1',
- children: ,
- },
- {
- key: '2',
- label: 'This is panel header 2',
- children: {text}
,
- },
- {
- key: '3',
- label: 'This is panel header 3',
- children: {text}
,
- },
- ]
- const onChange = (key: string | string[]) => {
- console.log(key)
- }
-
- return (
-
-
-
- )
- },
-}
-
-export const ExampleBorderless: Story = {
- render: () => {
- const collapseText = (
-
- A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome
- guest in many households across the world.
-
- )
- const items: ICollapseProps['items'] = [
- {
- key: '1',
- label: 'This is panel header 1',
- children: collapseText,
- },
- {
- key: '2',
- label: 'This is panel header 2',
- children: collapseText,
- },
- {
- key: '3',
- label: 'This is panel header 3',
- children: collapseText,
- },
- ]
- return (
-
-
-
- )
- },
-}
-
-export const ExampleCustomPanel: Story = {
- render: () => {
- const getItems: (panelStyle: React.CSSProperties) => ICollapseProps['items'] = panelStyle => [
- {
- key: '1',
- label: 'This is panel header 1',
- children: {text}
,
- style: panelStyle,
- },
- {
- key: '2',
- label: 'This is panel header 2',
- children: {text}
,
- style: panelStyle,
- },
- {
- key: '3',
- label: 'This is panel header 3',
- children: {text}
,
- style: panelStyle,
- },
- ]
-
- const { token } = theme.useToken()
-
- const panelStyle: React.CSSProperties = {
- marginBottom: 24,
- background: token.colorFillAlter,
- borderRadius: token.borderRadiusLG,
- border: 'none',
- }
- return (
-
- }
- style={{ background: token.colorBgContainer }}
- items={getItems(panelStyle)}
- />
-
- )
- },
-}
-
-export const ExampleNoArrow: Story = {
- render: () => {
- const items: ICollapseProps['items'] = [
- {
- key: '1',
- label: 'This is panel header with arrow icon',
- children: {text}
,
- },
- {
- key: '2',
- label: 'This is panel header with no arrow icon',
- children: {text}
,
- showArrow: false,
- },
- ]
-
- const onChange = (key: string | string[]) => {
- console.log(key)
- }
-
- return (
-
-
-
- )
- },
-}
-
-export const ExampleExtraNode: Story = {
- render: () => {
- const { Option } = Select
-
- const text = `
- A dog is a type of domesticated animal.
- Known for its loyalty and faithfulness,
- it can be found as a welcome guest in many households across the world.
-`
-
- type ExpandIconPosition = 'start' | 'end'
-
- const [expandIconPosition, setExpandIconPosition] = useState('start')
-
- const onPositionChange = (newExpandIconPosition: ExpandIconPosition) => {
- setExpandIconPosition(newExpandIconPosition)
- }
-
- const onChange = (key: string | string[]) => {
- console.log(key)
- }
-
- const genExtra = () => (
- {
- // If you don't want click extra trigger collapse, you can prevent this:
- event.stopPropagation()
+
-
-
- )
-
- const items: ICollapseProps['items'] = [
- {
- key: '1',
- label: 'This is panel header 1',
- children: {text}
,
- extra: genExtra(),
- },
- {
- key: '2',
- label: 'This is panel header 2',
- children: {text}
,
- extra: genExtra(),
- },
- {
- key: '3',
- label: 'This is panel header 3',
- children: {text}
,
- extra: genExtra(),
- },
- ]
-
- return (
- >}>
-
-
- Expand Icon Position:
-
- start
- end
-
-
- )
- },
-}
-
-export const ExampleGhostCollaps: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleCollapsible: Story = {
- render: () => {
- return (
-
-
- {text},
- },
- ]}
- />
- {text},
- },
- ]}
- />
- {text},
- },
- ]}
- />
-
-
+
+
+
+
)
},
}
diff --git a/src/components/data-display/Collapse/Collapse.tsx b/src/components/data-display/Collapse/Collapse.tsx
index a59fd6793..9b79e85a7 100644
--- a/src/components/data-display/Collapse/Collapse.tsx
+++ b/src/components/data-display/Collapse/Collapse.tsx
@@ -1,13 +1,18 @@
import { Collapse as AntCollapse } from 'antd'
import type { CollapseProps as AntCollapseProps } from 'antd'
-import { ConfigProvider } from 'src/components'
+import { ConfigProvider, Icon } from 'src/components'
export interface ICollapseProps extends AntCollapseProps {}
export const Collapse = (props: ICollapseProps) => {
return (
-
+
+ isActive ? :
+ }
+ {...props}
+ />
)
}
diff --git a/src/components/data-display/Collapse/CollapseNotProdReady.stories.tsx b/src/components/data-display/Collapse/CollapseNotProdReady.stories.tsx
new file mode 100644
index 000000000..bd986b8b9
--- /dev/null
+++ b/src/components/data-display/Collapse/CollapseNotProdReady.stories.tsx
@@ -0,0 +1,432 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Collapse } from 'src/components/data-display/Collapse/Collapse'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { type ICollapseProps } from 'src/components/data-display/Collapse/Collapse'
+import { Divider, Icon, Space } from 'src/components'
+import { theme } from 'antd'
+import { Select } from 'src/components'
+import { useState } from 'react'
+
+const text = `
+ A dog is a type of domesticated animal.
+ Known for its loyalty and faithfulness,
+ it can be found as a welcome guest in many households across the world.
+`
+
+const items: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel header 1',
+ children: {text}
,
+ },
+ {
+ key: '2',
+ label: 'This is panel header 2',
+ children: {text}
,
+ },
+ {
+ key: '3',
+ label: 'This is panel header 3',
+ children: {text}
,
+ },
+]
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Collapse',
+ component: props => ,
+
+ args: {
+ accordion: false,
+ activeKey: undefined,
+ bordered: true,
+ collapsible: undefined,
+ defaultActiveKey: undefined,
+ destroyInactivePanel: false,
+ expandIcon: undefined,
+ expandIconPosition: undefined,
+ ghost: false,
+ size: 'middle',
+ items,
+ onChange: (key: string | string[]) => {
+ console.log(key)
+ },
+ },
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['small', 'medium', 'large'],
+ },
+ expandIconPosition: {
+ control: 'select',
+ options: ['start', 'end'],
+ },
+ collapsible: {
+ control: 'select',
+ options: ['header', 'icon', 'disabled'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const AccordionMode: Story = {
+ args: {
+ accordion: true,
+ },
+}
+
+export const WithActivePanel: Story = {
+ args: {
+ activeKey: ['1'],
+ },
+}
+
+export const BorderlessCollapse: Story = {
+ args: {
+ bordered: false,
+ },
+}
+
+export const WithCollapsibleHeaders: Story = {
+ args: {
+ collapsible: 'header',
+ },
+}
+
+export const WithCustomActivePanel: Story = {
+ args: {
+ defaultActiveKey: ['2'],
+ },
+}
+
+export const DestroyInactivePanels: Story = {
+ args: {
+ destroyInactivePanel: true,
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ const onChange = (key: string | string[]) => {
+ console.log(key)
+ }
+
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleSize: Story = {
+ render: () => {
+ return (
+
+ Supports a default collapse size as well as a large and small size.
+
+ If a large or small collapse is desired, set the size property to either large or small respectively. Omit
+ the size property for a collapse with the default size.
+ >
+ }>
+ Default Size
+ {text} }]} />
+ Small Size
+ {text} }]}
+ />
+ Large Size
+ {text} }]}
+ />
+
+ )
+ },
+}
+
+export const ExampleAccordion: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleNestedPanel: Story = {
+ render: () => {
+ const itemsNest: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel nest panel',
+ children: {text}
,
+ },
+ ]
+
+ const items: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel header 1',
+ children: ,
+ },
+ {
+ key: '2',
+ label: 'This is panel header 2',
+ children: {text}
,
+ },
+ {
+ key: '3',
+ label: 'This is panel header 3',
+ children: {text}
,
+ },
+ ]
+ const onChange = (key: string | string[]) => {
+ console.log(key)
+ }
+
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleBorderless: Story = {
+ render: () => {
+ const collapseText = (
+
+ A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome
+ guest in many households across the world.
+
+ )
+ const items: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel header 1',
+ children: collapseText,
+ },
+ {
+ key: '2',
+ label: 'This is panel header 2',
+ children: collapseText,
+ },
+ {
+ key: '3',
+ label: 'This is panel header 3',
+ children: collapseText,
+ },
+ ]
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleCustomPanel: Story = {
+ render: () => {
+ const getItems: (panelStyle: React.CSSProperties) => ICollapseProps['items'] = panelStyle => [
+ {
+ key: '1',
+ label: 'This is panel header 1',
+ children: {text}
,
+ style: panelStyle,
+ },
+ {
+ key: '2',
+ label: 'This is panel header 2',
+ children: {text}
,
+ style: panelStyle,
+ },
+ {
+ key: '3',
+ label: 'This is panel header 3',
+ children: {text}
,
+ style: panelStyle,
+ },
+ ]
+
+ const { token } = theme.useToken()
+
+ const panelStyle: React.CSSProperties = {
+ marginBottom: 24,
+ background: token.colorFillAlter,
+ borderRadius: token.borderRadiusLG,
+ border: 'none',
+ }
+ return (
+
+ }
+ style={{ background: token.colorBgContainer }}
+ items={getItems(panelStyle)}
+ />
+
+ )
+ },
+}
+
+export const ExampleNoArrow: Story = {
+ render: () => {
+ const items: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel header with arrow icon',
+ children: {text}
,
+ },
+ {
+ key: '2',
+ label: 'This is panel header with no arrow icon',
+ children: {text}
,
+ showArrow: false,
+ },
+ ]
+
+ const onChange = (key: string | string[]) => {
+ console.log(key)
+ }
+
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleExtraNode: Story = {
+ render: () => {
+ const { Option } = Select
+
+ const text = `
+ A dog is a type of domesticated animal.
+ Known for its loyalty and faithfulness,
+ it can be found as a welcome guest in many households across the world.
+`
+
+ type ExpandIconPosition = 'start' | 'end'
+
+ const [expandIconPosition, setExpandIconPosition] = useState('start')
+
+ const onPositionChange = (newExpandIconPosition: ExpandIconPosition) => {
+ setExpandIconPosition(newExpandIconPosition)
+ }
+
+ const onChange = (key: string | string[]) => {
+ console.log(key)
+ }
+
+ const genExtra = () => (
+ {
+ // If you don't want click extra trigger collapse, you can prevent this:
+ event.stopPropagation()
+ }}>
+
+
+ )
+
+ const items: ICollapseProps['items'] = [
+ {
+ key: '1',
+ label: 'This is panel header 1',
+ children: {text}
,
+ extra: genExtra(),
+ },
+ {
+ key: '2',
+ label: 'This is panel header 2',
+ children: {text}
,
+ extra: genExtra(),
+ },
+ {
+ key: '3',
+ label: 'This is panel header 3',
+ children: {text}
,
+ extra: genExtra(),
+ },
+ ]
+
+ return (
+ >}>
+
+
+ Expand Icon Position:
+
+ start
+ end
+
+
+ )
+ },
+}
+
+export const ExampleGhostCollaps: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleCollapsible: Story = {
+ render: () => {
+ return (
+
+
+ {text},
+ },
+ ]}
+ />
+ {text},
+ },
+ ]}
+ />
+ {text},
+ },
+ ]}
+ />
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Descriptions/Descriptions.stories.tsx b/src/components/data-display/Descriptions/Descriptions.stories.tsx
index a0dd4fa19..4be1cbe77 100644
--- a/src/components/data-display/Descriptions/Descriptions.stories.tsx
+++ b/src/components/data-display/Descriptions/Descriptions.stories.tsx
@@ -1,42 +1,12 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { Descriptions } from 'src/components/data-display/Descriptions/Descriptions'
-import { Button } from 'src/components'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { type IDescriptionsProps } from 'src/components/data-display/Descriptions/Descriptions'
-import { Badge } from 'src/components'
-import { useState } from 'react'
-import { type RadioChangeEvent } from 'antd'
-import { Radio } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Descriptions',
component: Descriptions,
args: {
- bordered: false,
- colon: true,
- column: 3,
- contentStyle: undefined,
- extra: undefined,
- items: [
- { label: 'Item 1', children: 'Value 1' },
- { label: 'Item 2', children: 'Value 2' },
- { label: 'Item 3', children: 'Value 3' },
- ],
- labelStyle: undefined,
- layout: 'horizontal',
- size: 'default',
- title: undefined,
- },
- argTypes: {
- size: {
- control: 'select',
- options: ['default', 'middle', 'small'],
- },
- layout: {
- control: 'select',
- options: ['horizontal', 'vertical'],
- },
+ items: [{ label: 'Item 1', children: 'Value 1' }],
},
}
export default meta
@@ -49,327 +19,3 @@ type Story = StoryObj
*/
export const Primary: Story = {}
-
-export const Bordered: Story = {
- args: {
- bordered: true,
- },
-}
-
-export const Vertical: Story = {
- args: {
- layout: 'vertical',
- },
-}
-
-export const Small: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const CustomTitle: Story = {
- args: {
- title: Custom React Component ,
- },
-}
-
-export const WithExtra: Story = {
- args: {
- extra: Extra React Components ,
- },
-}
-
-export const WithTitleAndExtra: Story = {
- args: {
- title: Custom React Component ,
- extra: Extra React Components ,
- },
-}
-
-export const WithContentStyle: Story = {
- args: {
- contentStyle: { color: 'red' },
- },
-}
-
-export const WithLabelStyle: Story = {
- args: {
- labelStyle: { fontWeight: 'bold' },
- },
-}
-
-export const ResponsiveColumn: Story = {
- args: {
- column: { xs: 8, sm: 16, md: 24 },
- },
-}
-
-export const ExampleTableLook: Story = {
- render: () => {
- const items: IDescriptionsProps['items'] = [
- {
- key: '1',
- label: 'Product',
- children: 'Cloud Database',
- },
- {
- key: '2',
- label: 'Billing Mode',
- children: 'Prepaid',
- },
- {
- key: '3',
- label: 'Automatic Renewal',
- children: 'YES',
- },
- {
- key: '4',
- label: 'Order time',
- children: '2018-04-24 18:00:00',
- },
- {
- key: '5',
- label: 'Usage Time',
- children: '2019-04-24 18:00:00',
- span: 2,
- },
- {
- key: '6',
- label: 'Status',
- children: ,
- span: 3,
- },
- {
- key: '7',
- label: 'Negotiated Amount',
- children: '$80.00',
- },
- {
- key: '8',
- label: 'Discount',
- children: '$20.00',
- },
- {
- key: '9',
- label: 'Official Receipts',
- children: '$60.00',
- },
- {
- key: '10',
- label: 'Config Info',
- children: (
- <>
- Data disk type: MongoDB
-
- Database version: 3.4
-
- Package: dds.mongo.mid
-
- Storage space: 10 GB
-
- Replication factor: 3
-
- Region: East China 1
-
- >
- ),
- },
- ]
- return (
-
-
-
- )
- },
-}
-
-export const ExampleSize: Story = {
- render: () => {
- const borderedItems: IDescriptionsProps['items'] = [
- {
- key: '1',
- label: 'Product',
- children: 'Cloud Database',
- },
- {
- key: '2',
- label: 'Billing',
- children: 'Prepaid',
- },
- {
- key: '3',
- label: 'Time',
- children: '18:00:00',
- },
- {
- key: '4',
- label: 'Amount',
- children: '$80.00',
- },
- {
- key: '5',
- label: 'Discount',
- children: '$20.00',
- },
- {
- key: '6',
- label: 'Official',
- children: '$60.00',
- },
- {
- key: '7',
- label: 'Config Info',
- children: (
- <>
- Data disk type: MongoDB
-
- Database version: 3.4
-
- Package: dds.mongo.mid
-
- Storage space: 10 GB
-
- Replication factor: 3
-
- Region: East China 1
-
- >
- ),
- },
- ]
-
- const items: IDescriptionsProps['items'] = [
- {
- key: '1',
- label: 'Product',
- children: 'Cloud Database',
- },
- {
- key: '2',
- label: 'Billing',
- children: 'Prepaid',
- },
- {
- key: '3',
- label: 'Time',
- children: '18:00:00',
- },
- {
- key: '4',
- label: 'Amount',
- children: '$80.00',
- },
- {
- key: '5',
- label: 'Discount',
- children: '$20.00',
- },
- {
- key: '6',
- label: 'Official',
- children: '$60.00',
- },
- ]
- const [size, setSize] = useState('default')
-
- const onChange = (e: RadioChangeEvent): void => {
- console.log('size checked', e.target.value)
- setSize(e.target.value as IDescriptionsProps['size'])
- }
- return (
-
-
-
- default
- middle
- small
-
-
-
- Edit}
- items={borderedItems}
- />
-
-
- Edit} items={items} />
-
-
- )
- },
-}
-
-export const ExampleResponsiveDescriptions: Story = {
- render: () => {
- const items: IDescriptionsProps['items'] = [
- {
- label: 'Product',
- children: 'Cloud Database',
- },
- {
- label: 'Billing',
- children: 'Prepaid',
- },
- {
- label: 'Time',
- children: '18:00:00',
- },
- {
- label: 'Amount',
- children: '$80.00',
- },
- {
- label: 'Discount',
- span: { xl: 2, xxl: 2 },
- children: '$20.00',
- },
- {
- label: 'Official',
- span: { xl: 2, xxl: 2 },
- children: '$60.00',
- },
- {
- label: 'Config Info',
- span: { xs: 1, sm: 2, md: 3, lg: 3, xl: 2, xxl: 2 },
- children: (
- <>
- Data disk type: MongoDB
-
- Database version: 3.4
-
- Package: dds.mongo.mid
- >
- ),
- },
- {
- label: 'Hardware Info',
- span: { xs: 1, sm: 2, md: 3, lg: 3, xl: 2, xxl: 2 },
- children: (
- <>
- CPU: 6 Core 3.5 GHz
-
- Storage space: 10 GB
-
- Replication factor: 3
-
- Region: East China 1
- >
- ),
- },
- ]
- return (
-
-
-
- )
- },
-}
diff --git a/src/components/data-display/Descriptions/DescriptionsNotProdReady.stories.tsx b/src/components/data-display/Descriptions/DescriptionsNotProdReady.stories.tsx
new file mode 100644
index 000000000..04fa10eaf
--- /dev/null
+++ b/src/components/data-display/Descriptions/DescriptionsNotProdReady.stories.tsx
@@ -0,0 +1,373 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Descriptions } from 'src/components/data-display/Descriptions/Descriptions'
+import { Button } from 'src/components'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { type IDescriptionsProps } from 'src/components/data-display/Descriptions/Descriptions'
+import { Badge } from 'src/components'
+import { useState } from 'react'
+import { type RadioChangeEvent } from 'antd'
+import { Radio } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Descriptions',
+ component: Descriptions,
+
+ args: {
+ bordered: false,
+ colon: true,
+ column: 3,
+ contentStyle: undefined,
+ extra: undefined,
+ items: [
+ { label: 'Item 1', children: 'Value 1' },
+ { label: 'Item 2', children: 'Value 2' },
+ { label: 'Item 3', children: 'Value 3' },
+ ],
+ labelStyle: undefined,
+ layout: 'horizontal',
+ size: 'default',
+ title: undefined,
+ },
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['default', 'middle', 'small'],
+ },
+ layout: {
+ control: 'select',
+ options: ['horizontal', 'vertical'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Bordered: Story = {
+ args: {
+ bordered: true,
+ },
+}
+
+export const Vertical: Story = {
+ args: {
+ layout: 'vertical',
+ },
+}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const CustomTitle: Story = {
+ args: {
+ title: Custom React Component ,
+ },
+}
+
+export const WithExtra: Story = {
+ args: {
+ extra: Extra React Components ,
+ },
+}
+
+export const WithTitleAndExtra: Story = {
+ args: {
+ title: Custom React Component ,
+ extra: Extra React Components ,
+ },
+}
+
+export const WithContentStyle: Story = {
+ args: {
+ contentStyle: { color: 'red' },
+ },
+}
+
+export const WithLabelStyle: Story = {
+ args: {
+ labelStyle: { fontWeight: 'bold' },
+ },
+}
+
+export const ResponsiveColumn: Story = {
+ args: {
+ column: { xs: 8, sm: 16, md: 24 },
+ },
+}
+
+export const ExampleTableLook: Story = {
+ render: () => {
+ const items: IDescriptionsProps['items'] = [
+ {
+ key: '1',
+ label: 'Product',
+ children: 'Cloud Database',
+ },
+ {
+ key: '2',
+ label: 'Billing Mode',
+ children: 'Prepaid',
+ },
+ {
+ key: '3',
+ label: 'Automatic Renewal',
+ children: 'YES',
+ },
+ {
+ key: '4',
+ label: 'Order time',
+ children: '2018-04-24 18:00:00',
+ },
+ {
+ key: '5',
+ label: 'Usage Time',
+ children: '2019-04-24 18:00:00',
+ span: 2,
+ },
+ {
+ key: '6',
+ label: 'Status',
+ children: ,
+ span: 3,
+ },
+ {
+ key: '7',
+ label: 'Negotiated Amount',
+ children: '$80.00',
+ },
+ {
+ key: '8',
+ label: 'Discount',
+ children: '$20.00',
+ },
+ {
+ key: '9',
+ label: 'Official Receipts',
+ children: '$60.00',
+ },
+ {
+ key: '10',
+ label: 'Config Info',
+ children: (
+ <>
+ Data disk type: MongoDB
+
+ Database version: 3.4
+
+ Package: dds.mongo.mid
+
+ Storage space: 10 GB
+
+ Replication factor: 3
+
+ Region: East China 1
+
+ >
+ ),
+ },
+ ]
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleSize: Story = {
+ render: () => {
+ const borderedItems: IDescriptionsProps['items'] = [
+ {
+ key: '1',
+ label: 'Product',
+ children: 'Cloud Database',
+ },
+ {
+ key: '2',
+ label: 'Billing',
+ children: 'Prepaid',
+ },
+ {
+ key: '3',
+ label: 'Time',
+ children: '18:00:00',
+ },
+ {
+ key: '4',
+ label: 'Amount',
+ children: '$80.00',
+ },
+ {
+ key: '5',
+ label: 'Discount',
+ children: '$20.00',
+ },
+ {
+ key: '6',
+ label: 'Official',
+ children: '$60.00',
+ },
+ {
+ key: '7',
+ label: 'Config Info',
+ children: (
+ <>
+ Data disk type: MongoDB
+
+ Database version: 3.4
+
+ Package: dds.mongo.mid
+
+ Storage space: 10 GB
+
+ Replication factor: 3
+
+ Region: East China 1
+
+ >
+ ),
+ },
+ ]
+
+ const items: IDescriptionsProps['items'] = [
+ {
+ key: '1',
+ label: 'Product',
+ children: 'Cloud Database',
+ },
+ {
+ key: '2',
+ label: 'Billing',
+ children: 'Prepaid',
+ },
+ {
+ key: '3',
+ label: 'Time',
+ children: '18:00:00',
+ },
+ {
+ key: '4',
+ label: 'Amount',
+ children: '$80.00',
+ },
+ {
+ key: '5',
+ label: 'Discount',
+ children: '$20.00',
+ },
+ {
+ key: '6',
+ label: 'Official',
+ children: '$60.00',
+ },
+ ]
+ const [size, setSize] = useState('default')
+
+ const onChange = (e: RadioChangeEvent): void => {
+ console.log('size checked', e.target.value)
+ setSize(e.target.value as IDescriptionsProps['size'])
+ }
+ return (
+
+
+
+ default
+ middle
+ small
+
+
+
+ Edit}
+ items={borderedItems}
+ />
+
+
+ Edit} items={items} />
+
+
+ )
+ },
+}
+
+export const ExampleResponsiveDescriptions: Story = {
+ render: () => {
+ const items: IDescriptionsProps['items'] = [
+ {
+ label: 'Product',
+ children: 'Cloud Database',
+ },
+ {
+ label: 'Billing',
+ children: 'Prepaid',
+ },
+ {
+ label: 'Time',
+ children: '18:00:00',
+ },
+ {
+ label: 'Amount',
+ children: '$80.00',
+ },
+ {
+ label: 'Discount',
+ span: { xl: 2, xxl: 2 },
+ children: '$20.00',
+ },
+ {
+ label: 'Official',
+ span: { xl: 2, xxl: 2 },
+ children: '$60.00',
+ },
+ {
+ label: 'Config Info',
+ span: { xs: 1, sm: 2, md: 3, lg: 3, xl: 2, xxl: 2 },
+ children: (
+ <>
+ Data disk type: MongoDB
+
+ Database version: 3.4
+
+ Package: dds.mongo.mid
+ >
+ ),
+ },
+ {
+ label: 'Hardware Info',
+ span: { xs: 1, sm: 2, md: 3, lg: 3, xl: 2, xxl: 2 },
+ children: (
+ <>
+ CPU: 6 Core 3.5 GHz
+
+ Storage space: 10 GB
+
+ Replication factor: 3
+
+ Region: East China 1
+ >
+ ),
+ },
+ ]
+ return (
+
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Empty/Empty.stories.tsx b/src/components/data-display/Empty/Empty.stories.tsx
index 158608230..c8db17c08 100644
--- a/src/components/data-display/Empty/Empty.stories.tsx
+++ b/src/components/data-display/Empty/Empty.stories.tsx
@@ -1,24 +1,12 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { Switch } from 'src/components'
import { Empty } from 'src/components/data-display/Empty/Empty'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Divider } from 'src/components'
-import { ConfigProvider } from 'src/components'
-import { Space } from 'src/components'
-import { Select } from 'src/components'
-import { TreeSelect } from 'src/components'
-import { Cascader } from 'src/components'
-import { Transfer } from 'src/components'
-import { Table } from 'src/components'
-import { List } from 'src/components'
-import { useState } from 'react'
const meta: Meta = {
title: 'Components/Data Display/Empty',
component: Empty,
args: {
- description: 'Default Message',
+ description: 'No Data',
image: Empty.PRESENTED_IMAGE_DEFAULT,
imageStyle: undefined,
},
@@ -33,110 +21,3 @@ type Story = StoryObj
*/
export const Primary: Story = {}
-
-export const CustomDescription: Story = {
- args: {
- description: 'Custom description for empty state',
- },
-}
-
-export const CustomImageStyle: Story = {
- args: {
- imageStyle: { width: '60px', height: '60px' },
- },
-}
-
-export const NoImage: Story = {
- args: {
- image: null,
- },
-}
-
-export const AltImage: Story = {
- args: {
- image: Empty.PRESENTED_IMAGE_SIMPLE,
- imageStyle: { width: '100px', height: '62px' },
- },
-}
-
-export const CustomDescriptionAndImage: Story = {
- args: {
- description: (
- <>
- This is a custom description for the empty state.
-
- Feel free to add formatted content here.
-
- >
- ),
- imageStyle: { width: '200px', height: '200px' },
- },
-}
-
-export const NoDescription: Story = {
- args: {
- description: '',
- },
-}
-
-export const CustomImageAndStyle: Story = {
- args: {
- description: 'No data available',
- imageStyle: {
- borderRadius: '50%',
- boxShadow: '0 0 10px rgba(0, 0, 0, 0.2)',
- },
- },
-}
-
-export const NoImageAndNoDescription: Story = {
- args: {
- description: null,
- image: null,
- },
-}
-
-export const ExampleGlobalEmpty: Story = {
- render: () => {
- const customizeRenderEmpty = () => (
-
- {'{Icon}'}
-
Data Not Found
-
- )
-
- const style: React.CSSProperties = { width: 200 }
- const [customize, setCustomize] = useState(true)
-
- return (
-
- <>
-
-
-
-
- Select
-
- TreeSelect
-
- Cascader
-
- Transfer
-
- Table
-
- List
-
-
-
- >
-
- )
- },
-}
diff --git a/src/components/data-display/Empty/EmptyNotProdReady.stories.tsx b/src/components/data-display/Empty/EmptyNotProdReady.stories.tsx
new file mode 100644
index 000000000..3166de9fa
--- /dev/null
+++ b/src/components/data-display/Empty/EmptyNotProdReady.stories.tsx
@@ -0,0 +1,140 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Switch } from 'src/components'
+import { Empty } from 'src/components/data-display/Empty/Empty'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Divider } from 'src/components'
+import { ConfigProvider } from 'src/components'
+import { Space } from 'src/components'
+import { Select } from 'src/components'
+import { TreeSelect } from 'src/components'
+import { Cascader } from 'src/components'
+import { Transfer } from 'src/components'
+import { Table } from 'src/components'
+import { List } from 'src/components'
+import { useState } from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Empty',
+ component: Empty,
+
+ args: {
+ description: 'Default Message',
+ image: Empty.PRESENTED_IMAGE_DEFAULT,
+ imageStyle: undefined,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const CustomDescription: Story = {
+ args: {
+ description: 'Custom description for empty state',
+ },
+}
+
+export const CustomImageStyle: Story = {
+ args: {
+ imageStyle: { width: '60px', height: '60px' },
+ },
+}
+
+export const NoImage: Story = {
+ args: {
+ image: null,
+ },
+}
+
+export const AltImage: Story = {
+ args: {
+ image: Empty.PRESENTED_IMAGE_SIMPLE,
+ imageStyle: { width: '100px', height: '62px' },
+ },
+}
+
+export const CustomDescriptionAndImage: Story = {
+ args: {
+ description: (
+ <>
+ This is a custom description for the empty state.
+
+ Feel free to add formatted content here.
+
+ >
+ ),
+ imageStyle: { width: '200px', height: '200px' },
+ },
+}
+
+export const NoDescription: Story = {
+ args: {
+ description: '',
+ },
+}
+
+export const CustomImageAndStyle: Story = {
+ args: {
+ description: 'No data available',
+ imageStyle: {
+ borderRadius: '50%',
+ boxShadow: '0 0 10px rgba(0, 0, 0, 0.2)',
+ },
+ },
+}
+
+export const NoImageAndNoDescription: Story = {
+ args: {
+ description: null,
+ image: null,
+ },
+}
+
+export const ExampleGlobalEmpty: Story = {
+ render: () => {
+ const customizeRenderEmpty = () => (
+
+ {'{Icon}'}
+
Data Not Found
+
+ )
+
+ const style: React.CSSProperties = { width: 200 }
+ const [customize, setCustomize] = useState(true)
+
+ return (
+
+ <>
+
+
+
+
+ Select
+
+ TreeSelect
+
+ Cascader
+
+ Transfer
+
+ Table
+
+ List
+
+
+
+ >
+
+ )
+ },
+}
diff --git a/src/components/data-display/Image/Image.stories.tsx b/src/components/data-display/Image/Image.stories.tsx
index 06c30bd79..38803bcc6 100644
--- a/src/components/data-display/Image/Image.stories.tsx
+++ b/src/components/data-display/Image/Image.stories.tsx
@@ -11,4 +11,13 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
+export const Primary: Story = {
+ args: {
+ src: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
+ preview: false,
+ width: 100,
+ height: 100,
+ },
+}
+
+//
diff --git a/src/components/data-display/List/List.stories.tsx b/src/components/data-display/List/List.stories.tsx
index f87a69bf3..71e507f19 100644
--- a/src/components/data-display/List/List.stories.tsx
+++ b/src/components/data-display/List/List.stories.tsx
@@ -1,28 +1,27 @@
import { type Meta, type StoryObj } from '@storybook/react'
+import { Flex, Typography } from 'src/components'
import { List } from 'src/components/data-display/List/List'
+import { ExampleStory } from 'src/utils/ExampleStory'
const meta: Meta = {
title: 'Components/Data Display/List',
component: props =>
,
args: {
- dataSource: ['item1', 'item2', 'item3'],
- renderItem: item => {item as string} ,
bordered: false,
- footer: undefined,
- grid: undefined,
- header: undefined,
- itemLayout: 'horizontal',
- loading: false,
- locale: { emptyText: 'No Data' },
- pagination: false,
+ split: false,
size: 'default',
- split: true,
+ dataSource: ['item1', 'item2', 'item3'],
+ renderItem: item => {item as string} ,
},
argTypes: {
- itemLayout: {
- control: 'select',
- options: ['horizontal', 'vertical'],
+ bordered: {
+ control: 'boolean',
+ description: 'Toggle whether the list is bordered',
+ },
+ split: {
+ control: 'boolean',
+ description: 'Toggle whether list items are split by a divider',
},
size: {
control: 'select',
@@ -39,52 +38,69 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const BorderedList: Story = {
+export const Primary: Story = {
args: {
+ header: List Header ,
bordered: true,
+ split: true,
+ size: 'default',
},
-}
-
-export const VerticalLayout: Story = {
- args: {
- itemLayout: 'vertical',
- },
-}
-
-export const LoadingIndicator: Story = {
- args: {
- loading: true,
- },
-}
-
-export const CustomPagination: Story = {
- args: {
- pagination: { current: 1, total: 50, pageSize: 10 },
- },
-}
-
-export const CustomGrid: Story = {
- args: {
- grid: { gutter: 16, column: 4 },
- },
-}
+ render: args => {
+ const dataSource = [
+ 'Racing car sprays burning fuel into crowd.',
+ 'Japanese princess to wed commoner.',
+ 'Australian walks 100km after outback crash.',
+ 'Man charged over missing wedding girl.',
+ 'Los Angeles battles huge wildfires.',
+ ]
-export const LargeSizeList: Story = {
- args: {
- size: 'large',
+ return (
+ List Header}
+ footer={List Footer
}
+ dataSource={dataSource}
+ renderItem={item => {item} }
+ />
+ )
},
}
-export const CustomFooter: Story = {
- args: {
- footer: <>Custom Footer>,
- },
-}
+export const WithMetaItems: Story = {
+ render: () => {
+ const dataSource = [
+ {
+ title: 'item1',
+ description: 'description1',
+ },
+ {
+ title: 'item2',
+ description: 'description2',
+ },
+ {
+ title: 'item3',
+ description: 'description3',
+ },
+ ]
-export const NoSplitUnderListItem: Story = {
- args: {
- split: false,
+ return (
+
+ (
+
+
+ {item.title}}
+ description={item.description}
+ className="u-margin-bottom-none"
+ />
+
+
+ )}
+ />
+
+ )
},
}
diff --git a/src/components/data-display/List/ListNotProdReady.stories.tsx b/src/components/data-display/List/ListNotProdReady.stories.tsx
new file mode 100644
index 000000000..01cb61d7b
--- /dev/null
+++ b/src/components/data-display/List/ListNotProdReady.stories.tsx
@@ -0,0 +1,90 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { List } from 'src/components/data-display/List/List'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/List',
+ component: props =>
,
+
+ args: {
+ dataSource: ['item1', 'item2', 'item3'],
+ renderItem: item => {item as string} ,
+ bordered: false,
+ footer: undefined,
+ grid: undefined,
+ header: undefined,
+ itemLayout: 'horizontal',
+ loading: false,
+ locale: { emptyText: 'No Data' },
+ pagination: false,
+ size: 'default',
+ split: true,
+ },
+ argTypes: {
+ itemLayout: {
+ control: 'select',
+ options: ['horizontal', 'vertical'],
+ },
+ size: {
+ control: 'select',
+ options: ['default', 'large', 'small'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const BorderedList: Story = {
+ args: {
+ bordered: true,
+ },
+}
+
+export const VerticalLayout: Story = {
+ args: {
+ itemLayout: 'vertical',
+ },
+}
+
+export const LoadingIndicator: Story = {
+ args: {
+ loading: true,
+ },
+}
+
+export const CustomPagination: Story = {
+ args: {
+ pagination: { current: 1, total: 50, pageSize: 10 },
+ },
+}
+
+export const CustomGrid: Story = {
+ args: {
+ grid: { gutter: 16, column: 4 },
+ },
+}
+
+export const LargeSizeList: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const CustomFooter: Story = {
+ args: {
+ footer: <>Custom Footer>,
+ },
+}
+
+export const NoSplitUnderListItem: Story = {
+ args: {
+ split: false,
+ },
+}
diff --git a/src/components/data-display/Popover/Popover.stories.tsx b/src/components/data-display/Popover/Popover.stories.tsx
index 59971de5c..e32b58064 100644
--- a/src/components/data-display/Popover/Popover.stories.tsx
+++ b/src/components/data-display/Popover/Popover.stories.tsx
@@ -29,16 +29,12 @@ const PrimaryTemplate = (args: IPopoverProps) => {
}
export const Primary: Story = {
- args: { trigger: 'click', children: 'Click Me' },
- render: PrimaryTemplate,
-}
-
-export const Hover: Story = {
- args: { trigger: 'hover', children: 'Hover Me' },
- render: PrimaryTemplate,
-}
-
-export const Focus: Story = {
- args: { trigger: 'focus', children: 'Focus Me' },
+ args: { trigger: 'click', children: 'Button with popover' },
+ argTypes: {
+ trigger: {
+ control: 'select',
+ options: ['click', 'hover', 'focus'],
+ },
+ },
render: PrimaryTemplate,
}
diff --git a/src/components/data-display/Popover/PopoverNotProdReady.stories.tsx b/src/components/data-display/Popover/PopoverNotProdReady.stories.tsx
new file mode 100644
index 000000000..b459672b5
--- /dev/null
+++ b/src/components/data-display/Popover/PopoverNotProdReady.stories.tsx
@@ -0,0 +1,39 @@
+import { Popover, type IPopoverProps } from 'src/components/data-display/Popover/Popover'
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Button } from 'src/components/general/Button/Button'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Popover',
+ component: Popover,
+
+ args: {},
+}
+export default meta
+
+type Story = StoryObj
+
+const PrimaryTemplate = (args: IPopoverProps) => {
+ const content = (
+
+ )
+
+ return (
+ <>
+
+ {args.children}
+
+ >
+ )
+}
+
+export const Hover: Story = {
+ args: { trigger: 'hover', children: 'Hover Me' },
+ render: PrimaryTemplate,
+}
+
+export const Focus: Story = {
+ args: { trigger: 'focus', children: 'Focus Me' },
+ render: PrimaryTemplate,
+}
diff --git a/src/components/data-display/Segmented/Segmented.stories.tsx b/src/components/data-display/Segmented/Segmented.stories.tsx
index 7b4b69df3..ec86d385f 100644
--- a/src/components/data-display/Segmented/Segmented.stories.tsx
+++ b/src/components/data-display/Segmented/Segmented.stories.tsx
@@ -2,7 +2,7 @@ import { type Meta, type StoryObj } from '@storybook/react'
import { Segmented } from 'src/components/data-display/Segmented/Segmented'
const meta: Meta = {
- title: 'Components/Data Display/Segmented',
+ title: 'Components/Not Prod Ready/Data Display/Segmented',
component: Segmented,
args: {},
diff --git a/src/components/data-display/Tabs/Tabs.stories.tsx b/src/components/data-display/Tabs/Tabs.stories.tsx
index 86ceb6878..3693cc88c 100644
--- a/src/components/data-display/Tabs/Tabs.stories.tsx
+++ b/src/components/data-display/Tabs/Tabs.stories.tsx
@@ -1,5 +1,24 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { Tabs } from 'src/components/data-display/Tabs/Tabs'
+import { type ITabsProps, Tabs } from 'src/components/data-display/Tabs/Tabs'
+
+const items: ITabsProps['items'] = [
+ {
+ key: '1',
+ label: 'Tab 1',
+ children: 'Content of Tab Pane 1',
+ },
+ {
+ key: '2',
+ label: 'Tab 2',
+ children: 'Content of Tab Pane 2',
+ disabled: true,
+ },
+ {
+ key: '3',
+ label: 'Tab 3',
+ children: 'Content of Tab Pane 3',
+ },
+]
const meta: Meta = {
title: 'Components/Data Display/Tabs',
@@ -11,4 +30,9 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
+export const Primary: Story = {
+ args: {
+ items,
+ defaultActiveKey: '1',
+ },
+}
diff --git a/src/components/data-display/Tag/Tag.stories.tsx b/src/components/data-display/Tag/Tag.stories.tsx
index 659dd18ee..46f145ae4 100644
--- a/src/components/data-display/Tag/Tag.stories.tsx
+++ b/src/components/data-display/Tag/Tag.stories.tsx
@@ -1,26 +1,11 @@
import { type Meta } from '@storybook/react'
import { type StoryObj } from '@storybook/react'
+import { Space } from 'src/components'
import { Tag } from 'src/components/data-display/Tag/Tag'
-import { Divider, Flex, Space } from 'src/components'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { useState } from 'react'
-import { userEvent } from '@storybook/test'
-import { expect } from '@storybook/test'
-import { Icon } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Tag',
component: props => Tag ,
-
- args: {
- closeIcon: false,
- color: '',
- icon: null,
- bordered: true,
- onClose: e => {
- alert('Tag Closed')
- },
- },
}
export default meta
@@ -31,138 +16,24 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const WithCloseIcon: Story = {
- args: {
- closeIcon: true,
- },
-}
-
-export const WithColor: Story = {
+export const Primary: Story = {
args: {
- color: '#3498db',
- },
-}
-
-export const WithIcon: Story = {
- args: {
- icon: ,
- },
-}
-
-export const WithoutBorder: Story = {
- args: {
- bordered: false,
+ color: 'default',
+ bordered: true,
},
-}
-
-export const WithOnCloseCallback: Story = {
- args: {
- closeIcon: true,
- onClose: e => {
- alert('Tag Closed')
+ argTypes: {
+ color: {
+ control: 'select',
+ options: ['success', 'processing', 'default', 'error', 'warning'],
},
},
-}
-
-export const ExampleCheckableTagPrimary: Story = {
- render: () => {
- const [checked, setChecked] = useState(true)
-
- return (
- <>
-
-
- {
- alert(`Tag ${checked ? 'Checked' : 'Unchecked'}`)
- setChecked(curr => !curr)
- }}>
- Tag
-
-
-
- >
- )
- },
- play: async context => {
- const tag = context.canvasElement.querySelector('.ant-tag.ant-tag-checkable')
- if (tag) {
- void expect(tag).not.toBeNull()
- void expect(tag.classList.contains('ant-tag-checkable-checked')).toBeTruthy()
- await userEvent.click(tag)
- void expect(tag.classList.contains('ant-tag-checkable-checked')).toBeFalsy()
- } else {
- throw new Error('Tag not found')
- }
- },
-}
-
-export const ExampleColors: Story = {
- render: () => {
- return (
- <>
-
- Presets
-
- magenta
- red
- volcano
- orange
- gold
- lime
- green
- cyan
- blue
- geekblue
- purple
-
- Custom
-
- #f50
- #2db7f5
- #87d068
- #108ee9
-
-
- >
- )
- },
-}
-
-export const ExampleStatusTags: Story = {
render: () => {
return (
- <>
-
- Without icon
-
- success
- processing
- error
- warning
- default
-
- With icon
-
- } color="success">
- success
-
- } color="processing">
- processing
-
- } color="error">
- error
-
- } color="warning">
- warning
-
-
-
- >
+
+ Prod
+ Dev
+ Default
+
)
},
}
diff --git a/src/components/data-display/Tag/TagNotProdReady.stories.tsx b/src/components/data-display/Tag/TagNotProdReady.stories.tsx
new file mode 100644
index 000000000..bc4870703
--- /dev/null
+++ b/src/components/data-display/Tag/TagNotProdReady.stories.tsx
@@ -0,0 +1,168 @@
+import { type Meta } from '@storybook/react'
+import { type StoryObj } from '@storybook/react'
+import { Tag } from 'src/components/data-display/Tag/Tag'
+import { Divider, Flex, Space } from 'src/components'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { useState } from 'react'
+import { userEvent } from '@storybook/test'
+import { expect } from '@storybook/test'
+import { Icon } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Tag',
+ component: props => Tag ,
+
+ args: {
+ closeIcon: false,
+ color: '',
+ icon: null,
+ bordered: true,
+ onClose: e => {
+ alert('Tag Closed')
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const WithCloseIcon: Story = {
+ args: {
+ closeIcon: true,
+ },
+}
+
+export const WithColor: Story = {
+ args: {
+ color: '#3498db',
+ },
+}
+
+export const WithIcon: Story = {
+ args: {
+ icon: ,
+ },
+}
+
+export const WithoutBorder: Story = {
+ args: {
+ bordered: false,
+ },
+}
+
+export const WithOnCloseCallback: Story = {
+ args: {
+ closeIcon: true,
+ onClose: e => {
+ alert('Tag Closed')
+ },
+ },
+}
+
+export const ExampleCheckableTagPrimary: Story = {
+ render: () => {
+ const [checked, setChecked] = useState(true)
+
+ return (
+ <>
+
+
+ {
+ alert(`Tag ${checked ? 'Checked' : 'Unchecked'}`)
+ setChecked(curr => !curr)
+ }}>
+ Tag
+
+
+
+ >
+ )
+ },
+ play: async context => {
+ const tag = context.canvasElement.querySelector('.ant-tag.ant-tag-checkable')
+ if (tag) {
+ void expect(tag).not.toBeNull()
+ void expect(tag.classList.contains('ant-tag-checkable-checked')).toBeTruthy()
+ await userEvent.click(tag)
+ void expect(tag.classList.contains('ant-tag-checkable-checked')).toBeFalsy()
+ } else {
+ throw new Error('Tag not found')
+ }
+ },
+}
+
+export const ExampleColors: Story = {
+ render: () => {
+ return (
+ <>
+
+ Presets
+
+ magenta
+ red
+ volcano
+ orange
+ gold
+ lime
+ green
+ cyan
+ blue
+ geekblue
+ purple
+
+ Custom
+
+ #f50
+ #2db7f5
+ #87d068
+ #108ee9
+
+
+ >
+ )
+ },
+}
+
+export const ExampleStatusTags: Story = {
+ render: () => {
+ return (
+ <>
+
+ Without icon
+
+ success
+ processing
+ error
+ warning
+ default
+
+ With icon
+
+ } color="success">
+ success
+
+ } color="processing">
+ processing
+
+ } color="error">
+ error
+
+ } color="warning">
+ warning
+
+
+
+ >
+ )
+ },
+}
diff --git a/src/components/data-display/Tooltip/Tooltip.stories.tsx b/src/components/data-display/Tooltip/Tooltip.stories.tsx
index 80ff14770..a6549c6b5 100644
--- a/src/components/data-display/Tooltip/Tooltip.stories.tsx
+++ b/src/components/data-display/Tooltip/Tooltip.stories.tsx
@@ -1,42 +1,28 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { ConfigProvider, Flex, Segmented, Tooltip } from 'src/components'
+import { Flex, Tooltip, Typography } from 'src/components'
import { Button } from 'src/components'
-import { useState, useMemo } from 'react'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Space } from 'src/components'
-import { useEffect } from 'react'
const meta: Meta = {
title: 'Components/Data Display/Tooltip',
component: props => (
-
- Tooltip element
-
+
+
+ Tooltip element
+
+
),
+}
+export default meta
+type Story = StoryObj
+
+export const Primary: Story = {
args: {
title: 'Tooltip content',
- arrow: true,
- autoAdjustOverflow: true,
- color: '',
- defaultOpen: false,
- destroyTooltipOnHide: false,
- fresh: false,
- getPopupContainer: (_node: HTMLElement) => document.body,
- mouseEnterDelay: 0.1,
- mouseLeaveDelay: 0.1,
- overlayClassName: '',
- overlayStyle: {},
- overlayInnerStyle: {},
placement: 'top',
trigger: 'hover',
- zIndex: 0,
- onOpenChange: (_open: boolean) => {},
},
argTypes: {
- color: {
- control: 'color',
- },
placement: {
control: 'select',
options: [
@@ -60,199 +46,30 @@ const meta: Meta = {
},
},
}
-export default meta
-
-type Story = StoryObj
-
-export const Primary: Story = {}
-
-/*
- Initial story templates generated by AI.
- Customize the stories based on specific requirements.
-*/
-
-export const Title: Story = {
- args: {
- title: 'Different Tooltip Content',
- },
-}
-
-export const Color: Story = {
- args: {
- color: '#fc0',
- },
-}
-
-export const NoArrow: Story = {
- args: {
- arrow: false,
- },
-}
-
-export const BottomPlacement: Story = {
- args: {
- placement: 'bottom',
- },
-}
-
-export const ClickTrigger: Story = {
- args: {
- trigger: 'click',
- },
-}
-
-export const AlwaysOpen: Story = {
- args: {
- open: true,
- },
-}
-
-export const RightClick: Story = {
- args: {
- trigger: 'contextMenu',
- },
-}
-
-export const ClickWithOnChange: Story = {
- args: {
- trigger: 'click',
- onOpenChange: (open: boolean) => {
- alert(`onOpenChange: ${open}`)
- },
- },
-}
-
-export const ExampleArrowPlacements: Story = {
- render: () => {
- const [arrow, setArrow] = useState('Show')
-
- const mergedArrow = useMemo(() => {
- if (arrow === 'Hide') {
- return false
- }
-
- if (arrow === 'Show') {
- return true
- }
-
- return {
- pointAtCenter: true,
- }
- }, [arrow])
-
- const text = prompt text
- const buttonWidth = 80
- const buttonHeight = 70
-
- return (
-
-
-
- {
- setArrow(String(val))
- }}
- style={{ marginBottom: 24 }}
- />
-
-
-
-
- TL
-
-
- Top
-
-
- TR
-
-
-
-
- LT
-
-
- Left
-
-
- LB
-
-
-
-
- RT
-
-
- Right
-
-
- RB
-
-
-
-
- BL
-
-
- Bottom
-
-
- BR
-
-
-
-
-
- )
- },
-}
-export const ExampleDisabled: Story = {
+export const WithLink: Story = {
render: () => {
- const [disabled, setDisabled] = useState(true)
return (
-
-
- {
- setDisabled(!disabled)
- }}>
- {disabled ? 'Enable' : 'Disable'}
-
-
- Tooltip will show on mouse enter.
-
-
-
+
+
+
+ Help lorem ipsum{' '}
+
+ Learn More
+
+
+ >
+ }>
+ Tooltip with a link
+
+
)
},
}
-export const ExampleAutoShift: Story = {
- render: () => {
- useEffect(() => {
- document.documentElement.scrollTop = document.documentElement.clientHeight
- document.documentElement.scrollLeft = document.documentElement.clientWidth
- }, [])
-
- return (
-
-
-
-
- Scroll The Window, watch the tooltip move
-
-
-
-
- )
- },
-}
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
diff --git a/src/components/data-display/Tooltip/TooltipNotProdReady.stories.tsx b/src/components/data-display/Tooltip/TooltipNotProdReady.stories.tsx
new file mode 100644
index 000000000..175612d20
--- /dev/null
+++ b/src/components/data-display/Tooltip/TooltipNotProdReady.stories.tsx
@@ -0,0 +1,258 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { ConfigProvider, Flex, Segmented, Tooltip } from 'src/components'
+import { Button } from 'src/components'
+import { useState, useMemo } from 'react'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Space } from 'src/components'
+import { useEffect } from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Tooltip',
+ component: props => (
+
+ Tooltip element
+
+ ),
+
+ args: {
+ title: 'Tooltip content',
+ arrow: true,
+ autoAdjustOverflow: true,
+ color: '',
+ defaultOpen: false,
+ destroyTooltipOnHide: false,
+ fresh: false,
+ getPopupContainer: (_node: HTMLElement) => document.body,
+ mouseEnterDelay: 0.1,
+ mouseLeaveDelay: 0.1,
+ overlayClassName: '',
+ overlayStyle: {},
+ overlayInnerStyle: {},
+ placement: 'top',
+ trigger: 'hover',
+ zIndex: 0,
+ onOpenChange: (_open: boolean) => {},
+ },
+ argTypes: {
+ color: {
+ control: 'color',
+ },
+ placement: {
+ control: 'select',
+ options: [
+ 'top',
+ 'left',
+ 'right',
+ 'bottom',
+ 'topLeft',
+ 'topRight',
+ 'bottomLeft',
+ 'bottomRight',
+ 'leftTop',
+ 'leftBottom',
+ 'rightTop',
+ 'rightBottom',
+ ],
+ },
+ trigger: {
+ control: 'select',
+ options: ['hover', 'focus', 'click', 'contextMenu'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+export const Primary: Story = {}
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Title: Story = {
+ args: {
+ title: 'Different Tooltip Content',
+ },
+}
+
+export const Color: Story = {
+ args: {
+ color: '#fc0',
+ },
+}
+
+export const NoArrow: Story = {
+ args: {
+ arrow: false,
+ },
+}
+
+export const BottomPlacement: Story = {
+ args: {
+ placement: 'bottom',
+ },
+}
+
+export const ClickTrigger: Story = {
+ args: {
+ trigger: 'click',
+ },
+}
+
+export const AlwaysOpen: Story = {
+ args: {
+ open: true,
+ },
+}
+
+export const RightClick: Story = {
+ args: {
+ trigger: 'contextMenu',
+ },
+}
+
+export const ClickWithOnChange: Story = {
+ args: {
+ trigger: 'click',
+ onOpenChange: (open: boolean) => {
+ alert(`onOpenChange: ${open}`)
+ },
+ },
+}
+
+export const ExampleArrowPlacements: Story = {
+ render: () => {
+ const [arrow, setArrow] = useState('Show')
+
+ const mergedArrow = useMemo(() => {
+ if (arrow === 'Hide') {
+ return false
+ }
+
+ if (arrow === 'Show') {
+ return true
+ }
+
+ return {
+ pointAtCenter: true,
+ }
+ }, [arrow])
+
+ const text = prompt text
+ const buttonWidth = 80
+ const buttonHeight = 70
+
+ return (
+
+
+
+ {
+ setArrow(String(val))
+ }}
+ style={{ marginBottom: 24 }}
+ />
+
+
+
+
+ TL
+
+
+ Top
+
+
+ TR
+
+
+
+
+ LT
+
+
+ Left
+
+
+ LB
+
+
+
+
+ RT
+
+
+ Right
+
+
+ RB
+
+
+
+
+ BL
+
+
+ Bottom
+
+
+ BR
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleDisabled: Story = {
+ render: () => {
+ const [disabled, setDisabled] = useState(true)
+ return (
+
+
+ {
+ setDisabled(!disabled)
+ }}>
+ {disabled ? 'Enable' : 'Disable'}
+
+
+ Tooltip will show on mouse enter.
+
+
+
+ )
+ },
+}
+
+export const ExampleAutoShift: Story = {
+ render: () => {
+ useEffect(() => {
+ document.documentElement.scrollTop = document.documentElement.clientHeight
+ document.documentElement.scrollLeft = document.documentElement.clientWidth
+ }, [])
+
+ return (
+
+
+
+
+ Scroll The Window, watch the tooltip move
+
+
+
+
+ )
+ },
+}
diff --git a/src/components/data-display/Tour/Tour.stories.tsx b/src/components/data-display/Tour/Tour.stories.tsx
index 6573132ab..893bba9eb 100644
--- a/src/components/data-display/Tour/Tour.stories.tsx
+++ b/src/components/data-display/Tour/Tour.stories.tsx
@@ -1,7 +1,7 @@
import { type Meta, type StoryObj } from '@storybook/react'
import React, { useRef, useState } from 'react'
import { type ITourProps, Tour } from 'src/components/data-display/Tour/Tour'
-import { Button, Icon, SuiteLogo } from 'src/components'
+import { Icon, SuiteLogo } from 'src/components'
const meta: Meta = {
title: 'Components/Data Display/Tour',
@@ -13,61 +13,10 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
-
-export const ExamplePlacement: Story = {
- render: () => {
- const ref = useRef(null)
- const [open, setOpen] = useState(false)
-
- const steps: ITourProps['steps'] = [
- {
- title: 'Center',
- description: 'Displayed in the center of screen.',
- target: null,
- },
- {
- title: 'Right',
- description: 'On the right of target.',
- placement: 'right',
- target: () => ref.current,
- },
- {
- title: 'Top',
- description: 'On the top of target.',
- placement: 'top',
- target: () => ref.current,
- },
- ]
-
- return (
- <>
-
- {
- setOpen(true)
- }}>
- Begin Tour
-
-
-
- {
- setOpen(false)
- }}
- steps={steps}
- />
- >
- )
- },
-}
-
export const ExampleNavLogo: Story = {
render: () => {
const ref = useRef(null)
- const [open, setOpen] = useState(false)
+ const [open, setOpen] = useState(true)
const steps: ITourProps['steps'] = [
{
diff --git a/src/components/data-display/Tour/TourNotProdReady.stories.tsx b/src/components/data-display/Tour/TourNotProdReady.stories.tsx
new file mode 100644
index 000000000..0932f1da1
--- /dev/null
+++ b/src/components/data-display/Tour/TourNotProdReady.stories.tsx
@@ -0,0 +1,65 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import React, { useRef, useState } from 'react'
+import { type ITourProps, Tour } from 'src/components/data-display/Tour/Tour'
+import { Button } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Display/Tour',
+ component: Tour,
+
+ args: {},
+}
+export default meta
+
+type Story = StoryObj
+
+export const Primary: Story = {}
+
+export const ExamplePlacement: Story = {
+ render: () => {
+ const ref = useRef(null)
+ const [open, setOpen] = useState(false)
+
+ const steps: ITourProps['steps'] = [
+ {
+ title: 'Center',
+ description: 'Displayed in the center of screen.',
+ target: null,
+ },
+ {
+ title: 'Right',
+ description: 'On the right of target.',
+ placement: 'right',
+ target: () => ref.current,
+ },
+ {
+ title: 'Top',
+ description: 'On the top of target.',
+ placement: 'top',
+ target: () => ref.current,
+ },
+ ]
+
+ return (
+ <>
+
+ {
+ setOpen(true)
+ }}>
+ Begin Tour
+
+
+
+ {
+ setOpen(false)
+ }}
+ steps={steps}
+ />
+ >
+ )
+ },
+}
diff --git a/src/components/data-entry/AutoComplete/AutoComplete.stories.tsx b/src/components/data-entry/AutoComplete/AutoComplete.stories.tsx
index abefc4988..51216faf7 100644
--- a/src/components/data-entry/AutoComplete/AutoComplete.stories.tsx
+++ b/src/components/data-entry/AutoComplete/AutoComplete.stories.tsx
@@ -1,9 +1,7 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { useState } from 'react'
-import { AutoComplete, Flex, Icon, Input, Space } from 'src/components'
+import { AutoComplete } from 'src/components'
import { type IAutoCompleteProps } from 'src/components/data-entry/AutoComplete/AutoComplete'
-import { type ISelectProps } from 'src/components/data-entry/Select/Select'
-import { ExampleStory } from 'src/utils/ExampleStory'
const baseOptions = [
{ label: 'The quick brown fox jumps over the lazy dog', value: 1 },
@@ -46,31 +44,18 @@ const meta: Meta = {
},
args: {
+ placeholder: 'Search AutoComplete',
allowClear: false,
autoFocus: false,
backfill: false,
- bordered: true,
defaultActiveFirstOption: true,
- options: baseOptions,
- defaultOpen: undefined,
- defaultValue: undefined,
disabled: false,
- popupClassName: undefined,
- // filterOption: true,
- open: undefined,
- placeholder: 'Search AutoComplete',
+ options: baseOptions,
status: undefined,
- style: { width: 200 },
value: undefined,
- onBlur: () => {
- console.log('Blur Event')
- },
onChange: value => {
alert(`Selected Value: ${value}`)
},
- onDropdownVisibleChange: open => {
- console.log(`Dropdown Open: ${open}`)
- },
onFocus: () => {
console.log('Focus Event')
},
@@ -100,378 +85,9 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const ClearButton: Story = {
+export const Primary: Story = {
args: {
- allowClear: true,
- },
-}
-
-export const Placeholder: Story = {
- args: {
- placeholder: 'Custom Placeholder Text',
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- },
-}
-
-export const NotFound: Story = {
- args: {
- notFoundContent: <>Custom Not Found Component goes here>,
- },
-}
-
-export const Borderless: Story = {
- args: {
- bordered: false,
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- const [value, setValue] = useState('')
- const [options, setOptions] = useState([])
- const [anotherOptions, setAnotherOptions] = useState([])
-
- const mockVal = (str: string, repeat = 1) => ({
- value: str.repeat(repeat),
- })
- const getPanelValue = (searchText: string) =>
- !searchText
- ? []
- : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
- const onSelect = (data: string) => {
- alert('onSelect:' + data)
- }
- const onChange = (data: string) => {
- setValue(data)
- }
-
- return (
- <>
-
- {
- setOptions(getPanelValue(text))
- }}
- placeholder="input here"
- />
-
-
- {
- setAnotherOptions(getPanelValue(text))
- }}
- onChange={onChange}
- placeholder="control mode"
- />
-
- >
- )
- },
-}
-
-export const ExampleCustomized: Story = {
- render: () => {
- const [options, setOptions] = useState>([])
-
- const handleSearch = (value: string) => {
- let res: Array<{ value: string; label: string }>
- if (!value || value.includes('@')) {
- res = []
- } else {
- res = ['gmail.com', '163.com', 'qq.com'].map(domain => ({
- value,
- label: `${value}@${domain}`,
- }))
- }
- setOptions(res)
- }
-
- return (
- <>
-
-
-
- >
- )
- },
-}
-
-export const ExampleCustomizeInput: Story = {
- render: () => {
- const [options, setOptions] = useState([])
-
- const handleSearch = (value: string) => {
- setOptions(
- !value
- ? []
- : ([{ value }, { value: value + value }, { value: value + value + value }] as IAutoCompleteProps['options']),
- )
- }
-
- const handleKeyPress = (ev: React.KeyboardEvent) => {
- console.log('handleKeyPress', ev)
- }
-
- const onSelect = (value: string) => {
- alert('selected: ' + value)
- }
-
- return (
-
-
-
-
-
- )
- },
-}
-
-export const ExampleNonCaseSensitive: Story = {
- render: () => {
- return (
- <>
-
- ({
- ...o,
- label: o.label.toUpperCase(),
- }))}
- placeholder="try to type `b`"
- filterOption={(inputValue, option) =>
- option?.label?.toString().toUpperCase().includes(inputValue.toUpperCase()) ?? false
- }
- />
-
- >
- )
- },
-}
-
-export const ExampleLookupPatternsCertainCategory: Story = {
- render: () => {
- const renderTitle = (title: string) => (
-
- {title}
-
- more
-
-
- )
-
- const renderItem = (title: string, count: number) => ({
- value: title,
- label: (
-
- {title}
-
-
- {count}
-
-
- ),
- })
-
- const options = [
- {
- label: renderTitle('Libraries'),
- options: [renderItem('AntDesign', 10000), renderItem('AntDesign UI', 10600)],
- },
- {
- label: renderTitle('Solutions'),
- options: [renderItem('AntDesign UI FAQ', 60100), renderItem('AntDesign FAQ', 30010)],
- },
- {
- label: renderTitle('Articles'),
- options: [renderItem('AntDesign design language', 100000)],
- },
- ]
-
- return (
- <>
-
- Demonstration of{' '}
-
- Lookup Patterns: Certain Category
-
- Basic Usage, set options of autocomplete with options property.
- >
- }>
-
-
-
-
- >
- )
- },
-}
-
-export const ExampleLookupPatternsUnCertainCategory: Story = {
- render: () => {
- const getRandomInt = (max: number, min = 0) => Math.floor(Math.random() * (max - min + 1)) + min
-
- const searchResult = (query: string) =>
- new Array(getRandomInt(5))
- .join('.')
- .split('.')
- .map((_, idx) => {
- const category = `${query}${idx}`
- return {
- value: category,
- label: (
-
-
- Found {query} on{' '}
-
- {category}
-
-
- {getRandomInt(200, 100)} results
-
- ),
- }
- })
-
- const [options, setOptions] = useState['options']>([])
- const handleSearch = (value: string) => {
- setOptions(value !== '' ? searchResult(value) : [])
- }
- const onSelect = (value: string) => {
- alert('selected: ' + value)
- }
-
- return (
- <>
-
- Demonstration of{' '}
-
- Lookup Patterns: Certain Category
-
- Basic Usage, set options of autocomplete with options property.
- >
- }>
-
-
-
-
- >
- )
- },
-}
-
-export const ExampleStatus: Story = {
- render: () => {
- const mockVal = (str: string, repeat = 1) => ({
- value: str.repeat(repeat),
- })
- const [options, setOptions] = useState([])
- const [anotherOptions, setAnotherOptions] = useState([])
- const getPanelValue = (searchText: string) =>
- !searchText
- ? []
- : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
-
- return (
-
-
- {
- setOptions(getPanelValue(text))
- }}
- status="error"
- style={{ width: 200 }}
- />
- {
- setAnotherOptions(getPanelValue(text))
- }}
- status="warning"
- style={{ width: 200 }}
- />
-
-
- )
- },
-}
-
-export const ExampleClearButton: Story = {
- render: () => {
- const mockVal = (str: string, repeat = 1) => ({
- value: str.repeat(repeat),
- })
- const [options, setOptions] = useState([])
- const getPanelValue = (searchText: string) =>
- !searchText
- ? []
- : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
-
- return (
- <>
-
- {
- setOptions(getPanelValue(text))
- }}
- placeholder="No clear icon"
- allowClear={false}
- />
-
-
- {
- setOptions(getPanelValue(text))
- }}
- placeholder="Customized clear icon"
- allowClear={{ clearIcon: }}
- />
-
- >
- )
+ placeholder: '-Select-',
+ style: { width: 200 },
},
}
diff --git a/src/components/data-entry/AutoComplete/AutoCompleteNotProdReady.stories.tsx b/src/components/data-entry/AutoComplete/AutoCompleteNotProdReady.stories.tsx
new file mode 100644
index 000000000..ad7467e2a
--- /dev/null
+++ b/src/components/data-entry/AutoComplete/AutoCompleteNotProdReady.stories.tsx
@@ -0,0 +1,475 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { useState } from 'react'
+import { AutoComplete, Flex, Icon, Input, Space } from 'src/components'
+import { type IAutoCompleteProps } from 'src/components/data-entry/AutoComplete/AutoComplete'
+import { type ISelectProps } from 'src/components/data-entry/Select/Select'
+import { ExampleStory } from 'src/utils/ExampleStory'
+
+const baseOptions = [
+ { label: 'The quick brown fox jumps over the lazy dog', value: 1 },
+ { label: 'Waxy and quivering, jocks fumble the pizza', value: 2 },
+ { label: 'When zombies arrive, quickly fax judge Pat', value: 3 },
+ { label: 'Pack my red box with five dozen quality jugs', value: 4 },
+ { label: 'The quick onyx goblin jumps over the lazy dwarf', value: 5 },
+]
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Auto Complete',
+ component: props => {
+ const [value, setValue] = useState('')
+ const [options, setOptions] = useState([])
+
+ const getPanelValue = (searchText: string): IAutoCompleteProps['options'] => {
+ if (!searchText) return []
+ return baseOptions.filter(o => o.label.toLowerCase().includes(searchText.toLowerCase()))
+ }
+
+ const onSearch = (text: string) => {
+ setOptions(getPanelValue(text))
+ }
+ const onSelect = (value: string) => {
+ console.log('you selected value: ' + value)
+ }
+
+ return (
+ <>
+
+ >
+ )
+ },
+
+ args: {
+ allowClear: false,
+ autoFocus: false,
+ backfill: false,
+ bordered: true,
+ defaultActiveFirstOption: true,
+ options: baseOptions,
+ defaultOpen: undefined,
+ defaultValue: undefined,
+ disabled: false,
+ popupClassName: undefined,
+ // filterOption: true,
+ open: undefined,
+ placeholder: 'Search AutoComplete',
+ status: undefined,
+ style: { width: 200 },
+ value: undefined,
+ onBlur: () => {
+ console.log('Blur Event')
+ },
+ onChange: value => {
+ alert(`Selected Value: ${value}`)
+ },
+ onDropdownVisibleChange: open => {
+ console.log(`Dropdown Open: ${open}`)
+ },
+ onFocus: () => {
+ console.log('Focus Event')
+ },
+ onSearch: value => {
+ alert(`Search Value: ${value}`)
+ },
+ onSelect: (value, option) => {
+ alert(`Selected Value: ${value}, Option: ${String(option.label)}`)
+ },
+ onClear: () => {
+ alert('Clear Event')
+ },
+ },
+ argTypes: {
+ status: {
+ control: 'select',
+ options: ['error', 'warning'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const ClearButton: Story = {
+ args: {
+ allowClear: true,
+ },
+}
+
+export const Placeholder: Story = {
+ args: {
+ placeholder: 'Custom Placeholder Text',
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const NotFound: Story = {
+ args: {
+ notFoundContent: <>Custom Not Found Component goes here>,
+ },
+}
+
+export const Borderless: Story = {
+ args: {
+ bordered: false,
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ const [value, setValue] = useState('')
+ const [options, setOptions] = useState([])
+ const [anotherOptions, setAnotherOptions] = useState([])
+
+ const mockVal = (str: string, repeat = 1) => ({
+ value: str.repeat(repeat),
+ })
+ const getPanelValue = (searchText: string) =>
+ !searchText
+ ? []
+ : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
+ const onSelect = (data: string) => {
+ alert('onSelect:' + data)
+ }
+ const onChange = (data: string) => {
+ setValue(data)
+ }
+
+ return (
+ <>
+
+ {
+ setOptions(getPanelValue(text))
+ }}
+ placeholder="input here"
+ />
+
+
+ {
+ setAnotherOptions(getPanelValue(text))
+ }}
+ onChange={onChange}
+ placeholder="control mode"
+ />
+
+ >
+ )
+ },
+}
+
+export const ExampleCustomized: Story = {
+ render: () => {
+ const [options, setOptions] = useState>([])
+
+ const handleSearch = (value: string) => {
+ let res: Array<{ value: string; label: string }>
+ if (!value || value.includes('@')) {
+ res = []
+ } else {
+ res = ['gmail.com', '163.com', 'qq.com'].map(domain => ({
+ value,
+ label: `${value}@${domain}`,
+ }))
+ }
+ setOptions(res)
+ }
+
+ return (
+ <>
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleCustomizeInput: Story = {
+ render: () => {
+ const [options, setOptions] = useState([])
+
+ const handleSearch = (value: string) => {
+ setOptions(
+ !value
+ ? []
+ : ([{ value }, { value: value + value }, { value: value + value + value }] as IAutoCompleteProps['options']),
+ )
+ }
+
+ const handleKeyPress = (ev: React.KeyboardEvent) => {
+ console.log('handleKeyPress', ev)
+ }
+
+ const onSelect = (value: string) => {
+ alert('selected: ' + value)
+ }
+
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleNonCaseSensitive: Story = {
+ render: () => {
+ return (
+ <>
+
+ ({
+ ...o,
+ label: o.label.toUpperCase(),
+ }))}
+ placeholder="try to type `b`"
+ filterOption={(inputValue, option) =>
+ option?.label?.toString().toUpperCase().includes(inputValue.toUpperCase()) ?? false
+ }
+ />
+
+ >
+ )
+ },
+}
+
+export const ExampleLookupPatternsCertainCategory: Story = {
+ render: () => {
+ const renderTitle = (title: string) => (
+
+ {title}
+
+ more
+
+
+ )
+
+ const renderItem = (title: string, count: number) => ({
+ value: title,
+ label: (
+
+ {title}
+
+
+ {count}
+
+
+ ),
+ })
+
+ const options = [
+ {
+ label: renderTitle('Libraries'),
+ options: [renderItem('AntDesign', 10000), renderItem('AntDesign UI', 10600)],
+ },
+ {
+ label: renderTitle('Solutions'),
+ options: [renderItem('AntDesign UI FAQ', 60100), renderItem('AntDesign FAQ', 30010)],
+ },
+ {
+ label: renderTitle('Articles'),
+ options: [renderItem('AntDesign design language', 100000)],
+ },
+ ]
+
+ return (
+ <>
+
+ Demonstration of{' '}
+
+ Lookup Patterns: Certain Category
+
+ Basic Usage, set options of autocomplete with options property.
+ >
+ }>
+
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleLookupPatternsUnCertainCategory: Story = {
+ render: () => {
+ const getRandomInt = (max: number, min = 0) => Math.floor(Math.random() * (max - min + 1)) + min
+
+ const searchResult = (query: string) =>
+ new Array(getRandomInt(5))
+ .join('.')
+ .split('.')
+ .map((_, idx) => {
+ const category = `${query}${idx}`
+ return {
+ value: category,
+ label: (
+
+
+ Found {query} on{' '}
+
+ {category}
+
+
+ {getRandomInt(200, 100)} results
+
+ ),
+ }
+ })
+
+ const [options, setOptions] = useState['options']>([])
+ const handleSearch = (value: string) => {
+ setOptions(value !== '' ? searchResult(value) : [])
+ }
+ const onSelect = (value: string) => {
+ alert('selected: ' + value)
+ }
+
+ return (
+ <>
+
+ Demonstration of{' '}
+
+ Lookup Patterns: Certain Category
+
+ Basic Usage, set options of autocomplete with options property.
+ >
+ }>
+
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleStatus: Story = {
+ render: () => {
+ const mockVal = (str: string, repeat = 1) => ({
+ value: str.repeat(repeat),
+ })
+ const [options, setOptions] = useState([])
+ const [anotherOptions, setAnotherOptions] = useState([])
+ const getPanelValue = (searchText: string) =>
+ !searchText
+ ? []
+ : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
+
+ return (
+
+
+ {
+ setOptions(getPanelValue(text))
+ }}
+ status="error"
+ style={{ width: 200 }}
+ />
+ {
+ setAnotherOptions(getPanelValue(text))
+ }}
+ status="warning"
+ style={{ width: 200 }}
+ />
+
+
+ )
+ },
+}
+
+export const ExampleClearButton: Story = {
+ render: () => {
+ const mockVal = (str: string, repeat = 1) => ({
+ value: str.repeat(repeat),
+ })
+ const [options, setOptions] = useState([])
+ const getPanelValue = (searchText: string) =>
+ !searchText
+ ? []
+ : ([mockVal(searchText), mockVal(searchText, 2), mockVal(searchText, 3)] as IAutoCompleteProps['options'])
+
+ return (
+ <>
+
+ {
+ setOptions(getPanelValue(text))
+ }}
+ placeholder="No clear icon"
+ allowClear={false}
+ />
+
+
+ {
+ setOptions(getPanelValue(text))
+ }}
+ placeholder="Customized clear icon"
+ allowClear={{ clearIcon: }}
+ />
+
+ >
+ )
+ },
+}
diff --git a/src/components/data-entry/Cascader/Cascader.stories.tsx b/src/components/data-entry/Cascader/Cascader.stories.tsx
index 8c83028fa..d6b22a59a 100644
--- a/src/components/data-entry/Cascader/Cascader.stories.tsx
+++ b/src/components/data-entry/Cascader/Cascader.stories.tsx
@@ -42,7 +42,7 @@ const options: ICascaderProps['options'] = [
]
const meta: Meta = {
- title: 'Components/Data Entry/Cascader',
+ title: 'Components/Not Prod Ready/Data Entry/Cascader',
component: Cascader,
args: {
diff --git a/src/components/data-entry/Checkbox/Checkbox.stories.tsx b/src/components/data-entry/Checkbox/Checkbox.stories.tsx
index db5434e59..9ac395cea 100644
--- a/src/components/data-entry/Checkbox/Checkbox.stories.tsx
+++ b/src/components/data-entry/Checkbox/Checkbox.stories.tsx
@@ -1,11 +1,7 @@
import { type Meta } from '@storybook/react'
import { type StoryObj } from '@storybook/react'
-import { Checkbox, Divider } from 'src/components'
+import { Checkbox } from 'src/components'
import { useState } from 'react'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { type ICheckboxProps } from 'src/components/data-entry/Checkbox/Checkbox'
-import { userEvent } from '@storybook/test'
-import { expect } from '@storybook/test'
export type CheckboxValueType = string | number | boolean
@@ -25,13 +21,15 @@ const meta: Meta = {
},
args: {
- autoFocus: false,
- checked: false,
- defaultChecked: false,
+ defaultChecked: true,
disabled: false,
- indeterminate: false,
- onChange: e => {
- alert(`checked = ${e.target.checked}`)
+ },
+ argTypes: {
+ defaultChecked: {
+ control: 'boolean',
+ },
+ disabled: {
+ control: 'boolean',
},
},
}
@@ -44,67 +42,9 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const WithAutoFocus: Story = {
- args: {
- autoFocus: true,
- },
-}
-
-export const DefaultChecked: Story = {
+export const Primary: Story = {
args: {
- defaultChecked: true,
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- },
-}
-
-export const Indeterminate: Story = {
- args: {
- indeterminate: true,
- },
-}
-
-export const ExampleCheckAll: Story = {
- render: () => {
- const plainOptions = ['A', 'B', 'C']
- const defaultCheckedList = ['A', 'C']
-
- const [checkedList, setCheckedList] = useState(defaultCheckedList)
-
- const checkAll = plainOptions.length === checkedList.length
- const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length
-
- const onCheckAllChange: ICheckboxProps['onChange'] = e => {
- setCheckedList(e.target.checked ? plainOptions : [])
- }
-
- return (
- <>
-
-
- Check all
-
-
-
-
- >
- )
- },
-
- play: async context => {
- void expect(context.canvasElement.querySelectorAll('.ant-checkbox-checked').length).toBe(2)
- const checkboxIndeterminate = context.canvasElement.querySelector('.ant-checkbox-indeterminate')
- if (checkboxIndeterminate) {
- await userEvent.click(checkboxIndeterminate)
- } else {
- throw new Error('Checkbox Indeterminate not found')
- }
- void expect(context.canvasElement.querySelectorAll('.ant-checkbox-checked').length).toBe(4)
+ disabled: false,
+ children: 'Don’t show this message again',
},
}
diff --git a/src/components/data-entry/Checkbox/CheckboxNotProdReady.stories.tsx b/src/components/data-entry/Checkbox/CheckboxNotProdReady.stories.tsx
new file mode 100644
index 000000000..5b99e07b9
--- /dev/null
+++ b/src/components/data-entry/Checkbox/CheckboxNotProdReady.stories.tsx
@@ -0,0 +1,108 @@
+import { type Meta } from '@storybook/react'
+import { type StoryObj } from '@storybook/react'
+import { Checkbox, Divider } from 'src/components'
+import { useState } from 'react'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { type ICheckboxProps } from 'src/components/data-entry/Checkbox/Checkbox'
+import { userEvent } from '@storybook/test'
+import { expect } from '@storybook/test'
+
+export type CheckboxValueType = string | number | boolean
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Checkbox',
+ component: props => {
+ const [checked, setChecked] = useState(props.checked ?? props.defaultChecked ?? false)
+ return (
+ {
+ setChecked(!checked)
+ }}
+ />
+ )
+ },
+
+ args: {
+ autoFocus: false,
+ checked: false,
+ defaultChecked: false,
+ disabled: false,
+ indeterminate: false,
+ onChange: e => {
+ alert(`checked = ${e.target.checked}`)
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const WithAutoFocus: Story = {
+ args: {
+ autoFocus: true,
+ },
+}
+
+export const DefaultChecked: Story = {
+ args: {
+ defaultChecked: true,
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const Indeterminate: Story = {
+ args: {
+ indeterminate: true,
+ },
+}
+
+export const ExampleCheckAll: Story = {
+ render: () => {
+ const plainOptions = ['A', 'B', 'C']
+ const defaultCheckedList = ['A', 'C']
+
+ const [checkedList, setCheckedList] = useState(defaultCheckedList)
+
+ const checkAll = plainOptions.length === checkedList.length
+ const indeterminate = checkedList.length > 0 && checkedList.length < plainOptions.length
+
+ const onCheckAllChange: ICheckboxProps['onChange'] = e => {
+ setCheckedList(e.target.checked ? plainOptions : [])
+ }
+
+ return (
+ <>
+
+
+ Check all
+
+
+
+
+ >
+ )
+ },
+
+ play: async context => {
+ void expect(context.canvasElement.querySelectorAll('.ant-checkbox-checked').length).toBe(2)
+ const checkboxIndeterminate = context.canvasElement.querySelector('.ant-checkbox-indeterminate')
+ if (checkboxIndeterminate) {
+ await userEvent.click(checkboxIndeterminate)
+ } else {
+ throw new Error('Checkbox Indeterminate not found')
+ }
+ void expect(context.canvasElement.querySelectorAll('.ant-checkbox-checked').length).toBe(4)
+ },
+}
diff --git a/src/components/data-entry/Input/Input.stories.tsx b/src/components/data-entry/Input/Input.stories.tsx
index 478bf34d5..ef16e088f 100644
--- a/src/components/data-entry/Input/Input.stories.tsx
+++ b/src/components/data-entry/Input/Input.stories.tsx
@@ -1,10 +1,7 @@
-import { Input, type InputRef } from 'src/components'
-import { Button } from 'src/components/general/Button/Button'
+import { useState } from 'react'
+import { Icon, Input } from 'src/components'
import { type Meta, type StoryObj } from '@storybook/react'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { useRef } from 'react'
import { Space } from 'src/components'
-import { expect, userEvent } from '@storybook/test'
const meta: Meta = {
title: 'Components/Data Entry/Input',
@@ -12,23 +9,13 @@ const meta: Meta = {
args: {
placeholder: 'Input Placeholder',
- addonAfter: undefined,
- addonBefore: undefined,
- allowClear: false,
- bordered: true,
- classNames: {},
- count: undefined,
- defaultValue: '',
disabled: false,
- id: undefined,
maxLength: undefined,
- prefix: undefined,
- showCount: false,
status: undefined,
- styles: {},
size: 'middle',
- suffix: undefined,
type: 'text',
+ addonBefore: undefined,
+ allowClear: false,
value: '',
onChange: e => {
console.log('Input changed: ' + e.target.value)
@@ -39,9 +26,12 @@ const meta: Meta = {
},
argTypes: {
+ maxLength: {
+ control: 'number',
+ },
status: {
control: 'select',
- options: ['warning', 'error'],
+ options: ['warning', 'error', 'default'],
},
size: {
control: 'select',
@@ -58,134 +48,47 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Error: Story = {
- args: {
- status: 'error',
- },
-}
-
-export const TextArea: Story = {
- args: {
- type: 'textarea',
- },
-}
-
-export const Large: Story = {
- args: {
- size: 'large',
- },
-}
-
-export const Middle: Story = {
- args: {
- size: 'middle',
- },
-}
-
-export const Small: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const Primary: Story = {}
-
-export const WithHttpsBefore: Story = {
+export const Primary: Story = {
args: {
- addonBefore: 'https://',
- placeholder: 'Enter URL',
- },
-}
-
-export const WithDotComAfter: Story = {
- args: {
- addonAfter: '.com',
- placeholder: 'Domain',
- },
-}
-
-export const AllowClear: Story = {
- args: {
- allowClear: true,
- placeholder: 'Clearable Input',
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
+ value: '',
},
-}
+ render: args => {
+ const [value, setValue] = useState(args.value ?? '')
-export const WithMaxLength: Story = {
- args: {
- maxLength: 10,
- placeholder: 'Max 10 characters',
+ return (
+ {
+ setValue(e.target.value)
+ args.onChange?.(e)
+ }}
+ />
+ )
},
}
-export const WithPrefixAndSuffix: Story = {
- args: {
- prefix: '@',
- suffix: '.com',
- placeholder: 'Email',
+export const TextArea: Story = {
+ render: () => {
+ return (
+
+ Test
+
+ )
},
}
-export const WithFocusManagement: Story = {
- args: {
- value: 'Test value',
- },
- render: (props, meta) => {
- const inputRef = useRef(null)
-
- const focus = (cursor: 'start' | 'end' | 'all' = 'start') => {
- inputRef.current?.focus({
- cursor,
- })
- }
-
+export const WithSearchAddon: Story = {
+ render: () => {
return (
-
-
-
- {
- focus('start')
- }}>
- Focus at start
-
- {
- focus('end')
- }}>
- Focus at last
-
- {
- focus('all')
- }}>
- Focus to select all
-
-
-
-
-
-
+
+ }
+ />
+
)
},
- play: async story => {
- const input = story.canvasElement.querySelector('input')
- await expect(input).toBeInTheDocument()
-
- const buttons = story.canvasElement.querySelectorAll('button')
- await expect(buttons.length).toBe(3)
-
- for (const button of buttons) {
- input?.blur()
- await userEvent.click(button)
- await expect(input).toHaveFocus()
- input?.blur()
- }
- },
}
diff --git a/src/components/data-entry/Input/InputNotProdReady.stories.tsx b/src/components/data-entry/Input/InputNotProdReady.stories.tsx
new file mode 100644
index 000000000..5cd7c41ca
--- /dev/null
+++ b/src/components/data-entry/Input/InputNotProdReady.stories.tsx
@@ -0,0 +1,191 @@
+import { Input, type InputRef } from 'src/components'
+import { Button } from 'src/components/general/Button/Button'
+import { type Meta, type StoryObj } from '@storybook/react'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { useRef } from 'react'
+import { Space } from 'src/components'
+import { expect, userEvent } from '@storybook/test'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Input',
+ component: Input,
+
+ args: {
+ placeholder: 'Input Placeholder',
+ addonAfter: undefined,
+ addonBefore: undefined,
+ allowClear: false,
+ bordered: true,
+ classNames: {},
+ count: undefined,
+ defaultValue: '',
+ disabled: false,
+ id: undefined,
+ maxLength: undefined,
+ prefix: undefined,
+ showCount: false,
+ status: undefined,
+ styles: {},
+ size: 'middle',
+ suffix: undefined,
+ type: 'text',
+ value: '',
+ onChange: e => {
+ console.log('Input changed: ' + e.target.value)
+ },
+ onPressEnter: e => {
+ console.log('Enter key pressed: ' + String(e))
+ },
+ },
+
+ argTypes: {
+ status: {
+ control: 'select',
+ options: ['warning', 'error'],
+ },
+ size: {
+ control: 'select',
+ options: ['small', 'medium', 'large'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Error: Story = {
+ args: {
+ status: 'error',
+ },
+}
+
+export const TextArea: Story = {
+ args: {
+ type: 'textarea',
+ },
+}
+
+export const Large: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const Middle: Story = {
+ args: {
+ size: 'middle',
+ },
+}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const Primary: Story = {}
+
+export const WithHttpsBefore: Story = {
+ args: {
+ addonBefore: 'https://',
+ placeholder: 'Enter URL',
+ },
+}
+
+export const WithDotComAfter: Story = {
+ args: {
+ addonAfter: '.com',
+ placeholder: 'Domain',
+ },
+}
+
+export const AllowClear: Story = {
+ args: {
+ allowClear: true,
+ placeholder: 'Clearable Input',
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const WithMaxLength: Story = {
+ args: {
+ maxLength: 10,
+ placeholder: 'Max 10 characters',
+ },
+}
+
+export const WithPrefixAndSuffix: Story = {
+ args: {
+ prefix: '@',
+ suffix: '.com',
+ placeholder: 'Email',
+ },
+}
+
+export const WithFocusManagement: Story = {
+ args: {
+ value: 'Test value',
+ },
+ render: (props, meta) => {
+ const inputRef = useRef(null)
+
+ const focus = (cursor: 'start' | 'end' | 'all' = 'start') => {
+ inputRef.current?.focus({
+ cursor,
+ })
+ }
+
+ return (
+
+
+
+ {
+ focus('start')
+ }}>
+ Focus at start
+
+ {
+ focus('end')
+ }}>
+ Focus at last
+
+ {
+ focus('all')
+ }}>
+ Focus to select all
+
+
+
+
+
+
+ )
+ },
+ play: async story => {
+ const input = story.canvasElement.querySelector('input')
+ await expect(input).toBeInTheDocument()
+
+ const buttons = story.canvasElement.querySelectorAll('button')
+ await expect(buttons.length).toBe(3)
+
+ for (const button of buttons) {
+ input?.blur()
+ await userEvent.click(button)
+ await expect(input).toHaveFocus()
+ input?.blur()
+ }
+ },
+}
diff --git a/src/components/data-entry/InputNumber/InputNumber.stories.tsx b/src/components/data-entry/InputNumber/InputNumber.stories.tsx
index 6b85f699c..27c5d5f15 100644
--- a/src/components/data-entry/InputNumber/InputNumber.stories.tsx
+++ b/src/components/data-entry/InputNumber/InputNumber.stories.tsx
@@ -6,31 +6,19 @@ const meta: Meta = {
component: InputNumber,
args: {
- addonAfter: undefined,
- addonBefore: undefined,
+ max: Number.MAX_SAFE_INTEGER,
+ min: Number.MIN_SAFE_INTEGER,
+ placeholder: '',
autoFocus: false,
- bordered: true,
- changeOnBlur: true,
controls: true,
- decimalSeparator: '.',
- placeholder: 'Enter a number',
- defaultValue: undefined,
disabled: false,
- formatter: undefined,
- keyboard: true,
- max: Number.MAX_SAFE_INTEGER,
- min: Number.MIN_SAFE_INTEGER,
- parser: undefined,
- precision: undefined,
- readOnly: false,
status: undefined,
- prefix: undefined,
size: 'middle',
+ decimalSeparator: '.',
step: 1,
- stringMode: false,
value: undefined,
onChange: value => {
- alert('InputNumber changed: ' + value)
+ console.log('InputNumber changed: ' + value)
},
onPressEnter: e => {
console.log('Enter key pressed:', e)
@@ -41,6 +29,9 @@ const meta: Meta = {
},
argTypes: {
+ autoFocus: {
+ control: 'boolean',
+ },
size: {
control: 'select',
options: ['large', 'middle', 'small'],
@@ -60,86 +51,12 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const Small: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const Large: Story = {
- args: {
- size: 'large',
- },
-}
-
-export const Warning: Story = {
- args: {
- status: 'warning',
- },
-}
-
-export const Error: Story = {
- args: {
- status: 'error',
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- value: 42,
- },
-}
-
-export const ReadOnly: Story = {
- args: {
- readOnly: true,
- value: 123,
- },
-}
-
-export const $Prefix: Story = {
- args: {
- prefix: '$',
- },
-}
-export const StringMode: Story = {
- args: {
- stringMode: true,
- value: '42.50',
- },
-}
-
-export const WithControlsAndPrecision: Story = {
- args: {
- controls: true,
- precision: 2,
- },
-}
-
-export const DecimalSeparatorComma: Story = {
- args: {
- decimalSeparator: ',',
- },
-}
-
-export const WithFormatter: Story = {
- args: {
- formatter: (value, info) => `$${value}`,
- },
-}
-
-export const MinMaxConstraints: Story = {
- args: {
- min: 10,
- max: 100,
- },
-}
-
-export const Step05: Story = {
+export const Primary: Story = {
args: {
- step: 0.5,
+ max: 90,
+ min: 1,
+ placeholder: 'number',
+ suffix: 'days',
+ style: { width: 120, textAlign: 'right' },
},
}
diff --git a/src/components/data-entry/InputNumber/InputNumberNotProdReady.stories.tsx b/src/components/data-entry/InputNumber/InputNumberNotProdReady.stories.tsx
new file mode 100644
index 000000000..a5ab47306
--- /dev/null
+++ b/src/components/data-entry/InputNumber/InputNumberNotProdReady.stories.tsx
@@ -0,0 +1,145 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { InputNumber } from 'src/components/data-entry/InputNumber/InputNumber'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/InputNumber',
+ component: InputNumber,
+
+ args: {
+ addonAfter: undefined,
+ addonBefore: undefined,
+ autoFocus: false,
+ bordered: true,
+ changeOnBlur: true,
+ controls: true,
+ decimalSeparator: '.',
+ placeholder: 'Enter a number',
+ defaultValue: undefined,
+ disabled: false,
+ formatter: undefined,
+ keyboard: true,
+ max: Number.MAX_SAFE_INTEGER,
+ min: Number.MIN_SAFE_INTEGER,
+ parser: undefined,
+ precision: undefined,
+ readOnly: false,
+ status: undefined,
+ prefix: undefined,
+ size: 'middle',
+ step: 1,
+ stringMode: false,
+ value: undefined,
+ onChange: value => {
+ alert('InputNumber changed: ' + value)
+ },
+ onPressEnter: e => {
+ console.log('Enter key pressed:', e)
+ },
+ onStep: (value, info) => {
+ console.log('Step:', value, info)
+ },
+ },
+
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['large', 'middle', 'small'],
+ },
+ status: {
+ control: 'select',
+ options: ['error', 'warning'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const Large: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const Warning: Story = {
+ args: {
+ status: 'warning',
+ },
+}
+
+export const Error: Story = {
+ args: {
+ status: 'error',
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ value: 42,
+ },
+}
+
+export const ReadOnly: Story = {
+ args: {
+ readOnly: true,
+ value: 123,
+ },
+}
+
+export const $Prefix: Story = {
+ args: {
+ prefix: '$',
+ },
+}
+export const StringMode: Story = {
+ args: {
+ stringMode: true,
+ value: '42.50',
+ },
+}
+
+export const WithControlsAndPrecision: Story = {
+ args: {
+ controls: true,
+ precision: 2,
+ },
+}
+
+export const DecimalSeparatorComma: Story = {
+ args: {
+ decimalSeparator: ',',
+ },
+}
+
+export const WithFormatter: Story = {
+ args: {
+ formatter: (value, info) => `$${value}`,
+ },
+}
+
+export const MinMaxConstraints: Story = {
+ args: {
+ min: 10,
+ max: 100,
+ },
+}
+
+export const Step05: Story = {
+ args: {
+ step: 0.5,
+ },
+}
diff --git a/src/components/data-entry/QueryItem/QueryItem.stories.tsx b/src/components/data-entry/QueryItem/QueryItem.stories.tsx
index c033471d7..c2c685114 100644
--- a/src/components/data-entry/QueryItem/QueryItem.stories.tsx
+++ b/src/components/data-entry/QueryItem/QueryItem.stories.tsx
@@ -19,4 +19,4 @@ export default meta
type Story = StoryObj
-export const DontUseThisOrYouWillBeFired: Story = {}
+export const Primary: Story = {}
diff --git a/src/components/data-entry/QueryItem/QueryItem.tsx b/src/components/data-entry/QueryItem/QueryItem.tsx
index 5a504dc09..c112fc506 100644
--- a/src/components/data-entry/QueryItem/QueryItem.tsx
+++ b/src/components/data-entry/QueryItem/QueryItem.tsx
@@ -1,13 +1,22 @@
import React from 'react'
+import { Center, Typography } from 'src/components'
import ValueSelector from 'src/components/data-entry/QueryItem/ValueSelector'
import Action from 'src/components/data-entry/QueryItem/Action'
import Text from 'src/components/data-entry/QueryItem/Text'
import Qualifier from 'src/components/data-entry/QueryItem/Qualifier'
export const QueryItem = () => {
- return <>DO NOT USE THIS OR YOU WILL BE FIRED!>
+ return (
+
+
+ Component Candidate: Under Review
+
+ This component is pending review and should not be used at this time.
+
+
+ )
}
QueryItem.Action = Action
QueryItem.Qualifier = Qualifier
QueryItem.ValueSelector = ValueSelector
-QueryItem.Text = Text
\ No newline at end of file
+QueryItem.Text = Text
diff --git a/src/components/data-entry/Radio/Radio.stories.tsx b/src/components/data-entry/Radio/Radio.stories.tsx
index 72bd4cfb5..801d5dbd3 100644
--- a/src/components/data-entry/Radio/Radio.stories.tsx
+++ b/src/components/data-entry/Radio/Radio.stories.tsx
@@ -6,7 +6,6 @@ const meta: Meta = {
component: Radio,
args: {
- autoFocus: false,
checked: false,
defaultChecked: false,
disabled: false,
@@ -23,36 +22,9 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const WithAutoFocus: Story = {
- args: {
- autoFocus: true,
- },
-}
-
-export const Checked: Story = {
+export const Primary: Story = {
args: {
checked: true,
- },
-}
-
-export const DefaultChecked: Story = {
- args: {
- defaultChecked: true,
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- },
-}
-
-export const WithOnChange: Story = {
- args: {
- onChange: () => {
- alert('Radio Changed')
- },
+ children: 'All users',
},
}
diff --git a/src/components/data-entry/Radio/RadioButton.stories.tsx b/src/components/data-entry/Radio/RadioButton.stories.tsx
index 8833b9e51..7d887ce44 100644
--- a/src/components/data-entry/Radio/RadioButton.stories.tsx
+++ b/src/components/data-entry/Radio/RadioButton.stories.tsx
@@ -2,7 +2,7 @@ import { type Meta, type StoryObj } from '@storybook/react'
import { Radio } from 'src/components/data-entry/Radio/Radio'
const meta: Meta = {
- title: 'Components/Data Entry/Radio/RadioButton',
+ title: 'Components/Not Prod Ready/Data Entry/Radio/RadioButton',
component: Radio.Button,
args: {
diff --git a/src/components/data-entry/Radio/RadioGroup.stories.tsx b/src/components/data-entry/Radio/RadioGroup.stories.tsx
index 840f7b8f1..4d9fc978d 100644
--- a/src/components/data-entry/Radio/RadioGroup.stories.tsx
+++ b/src/components/data-entry/Radio/RadioGroup.stories.tsx
@@ -6,13 +6,8 @@ const meta: Meta = {
component: Radio.Group,
args: {
- buttonStyle: undefined,
- defaultValue: undefined,
disabled: false,
- name: undefined,
options: undefined,
- optionType: undefined,
- size: 'middle',
value: undefined,
onChange: undefined,
children: undefined,
@@ -22,33 +17,25 @@ export default meta
type Story = StoryObj
-export const WithOptionsAndOptionType: Story = {
+export const WithEnvOptions: Story = {
args: {
options: [
- { label: 'Apple', value: 'Apple' },
- { label: 'Pear', value: 'Pear' },
- { label: 'Orange', value: 'Orange', title: 'Orange' },
+ { label: 'Production', value: 'production' },
+ { label: 'Development', value: 'development' },
+ { label: 'Production & Development', value: 'unknown' },
],
+ defaultValue: 'development',
optionType: 'default',
},
}
-export const WithRadioButtons: Story = {
+export const WithButtonOptionsType: Story = {
args: {
- defaultValue: 'a',
- children: [
-
- Hangzhou
- ,
-
- Shanghai
- ,
-
- Beijing
- ,
-
- Chengdu
- ,
+ options: [
+ { label: 'Overview', value: 'overview' },
+ { label: 'Connections', value: 'connections' },
],
+ defaultValue: 'overview',
+ optionType: 'button',
},
}
diff --git a/src/components/data-entry/Radio/RadioGroupNotProdReady.stories.tsx b/src/components/data-entry/Radio/RadioGroupNotProdReady.stories.tsx
new file mode 100644
index 000000000..56b2f78f8
--- /dev/null
+++ b/src/components/data-entry/Radio/RadioGroupNotProdReady.stories.tsx
@@ -0,0 +1,54 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Radio } from 'src/components/data-entry/Radio/Radio'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Radio/RadioGroup',
+ component: Radio.Group,
+
+ args: {
+ buttonStyle: undefined,
+ defaultValue: undefined,
+ disabled: false,
+ name: undefined,
+ options: undefined,
+ optionType: undefined,
+ size: 'middle',
+ value: undefined,
+ onChange: undefined,
+ children: undefined,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+export const WithOptionsAndOptionType: Story = {
+ args: {
+ options: [
+ { label: 'Apple', value: 'Apple' },
+ { label: 'Pear', value: 'Pear' },
+ { label: 'Orange', value: 'Orange', title: 'Orange' },
+ ],
+ optionType: 'default',
+ },
+}
+
+export const WithRadioButtons: Story = {
+ args: {
+ defaultValue: 'a',
+ children: [
+
+ Hangzhou
+ ,
+
+ Shanghai
+ ,
+
+ Beijing
+ ,
+
+ Chengdu
+ ,
+ ],
+ },
+}
diff --git a/src/components/data-entry/Radio/RadioNotProdReady.stories.tsx b/src/components/data-entry/Radio/RadioNotProdReady.stories.tsx
new file mode 100644
index 000000000..6395342b1
--- /dev/null
+++ b/src/components/data-entry/Radio/RadioNotProdReady.stories.tsx
@@ -0,0 +1,56 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Radio } from 'src/components/data-entry/Radio/Radio'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Radio',
+ component: Radio,
+
+ args: {
+ autoFocus: false,
+ checked: false,
+ defaultChecked: false,
+ disabled: false,
+ value: undefined,
+ onChange: undefined,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const WithAutoFocus: Story = {
+ args: {
+ autoFocus: true,
+ },
+}
+
+export const Checked: Story = {
+ args: {
+ checked: true,
+ },
+}
+
+export const DefaultChecked: Story = {
+ args: {
+ defaultChecked: true,
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const WithOnChange: Story = {
+ args: {
+ onChange: () => {
+ alert('Radio Changed')
+ },
+ },
+}
diff --git a/src/components/data-entry/Select/Select.stories.tsx b/src/components/data-entry/Select/Select.stories.tsx
index f2a9d8e19..9bfdde478 100644
--- a/src/components/data-entry/Select/Select.stories.tsx
+++ b/src/components/data-entry/Select/Select.stories.tsx
@@ -11,4 +11,14 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
+export const Primary: Story = {
+ args: {
+ placeholder: 'Select Environment',
+ options: [
+ { label: 'All', value: 'all' },
+ { label: 'Prod', value: 'prod' },
+ { label: 'Dev', value: 'dev' },
+ ],
+ style: { width: '180px' },
+ },
+}
diff --git a/src/components/data-entry/Switch/Switch.stories.tsx b/src/components/data-entry/Switch/Switch.stories.tsx
index 5c268ae4a..42a240cdf 100644
--- a/src/components/data-entry/Switch/Switch.stories.tsx
+++ b/src/components/data-entry/Switch/Switch.stories.tsx
@@ -1,29 +1,17 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { Switch } from 'src/components/data-entry/Switch/Switch'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Icon, Space } from 'src/components'
import { useState } from 'react'
-import { Button } from 'src/components'
+import { Switch } from 'src/components/data-entry/Switch/Switch'
const meta: Meta = {
title: 'Components/Data Entry/Switch',
component: Switch,
args: {
- autoFocus: false,
- checked: false,
- checkedChildren: 'On',
- className: '',
- defaultChecked: false,
- defaultValue: false, // Alias for defaultChecked
disabled: false,
loading: false,
- size: 'default',
- unCheckedChildren: 'Off',
- value: false, // Alias for checked
onClick: (checked, event) => {},
onChange: (checked, event) => {
- alert(`Switch changed: ${checked}`)
+ console.log(`Switch changed: ${checked}`)
},
},
}
@@ -36,97 +24,21 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const Checked: Story = {
- args: {
- checked: true,
- },
-}
-
-export const CustomCopy: Story = {
- args: {
- checked: true,
- checkedChildren: 'On (Custom Copy)',
- unCheckedChildren: 'Off (Custom Copy)',
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- },
-}
-
-export const Loading: Story = {
+export const Primary: Story = {
args: {
- loading: true,
- },
-}
-
-export const Small: Story = {
- args: {
- size: 'small',
+ checked: false,
+ disabled: false,
},
-}
+ render: args => {
+ const [checked, setChecked] = useState(args.checked ?? false)
-export const ExampleDisabled: Story = {
- render: () => {
- const [disabled, setDisabled] = useState(true)
- const toggle = () => {
- setDisabled(!disabled)
+ const handleChange = (checkedValue: boolean, event: React.MouseEvent) => {
+ setChecked(checkedValue)
+ if (args.onChange) {
+ args.onChange(checkedValue, event)
+ }
}
- return (
-
-
-
-
- Toggle disabled
-
-
-
- )
- },
-}
-
-export const ExampleSizes: Story = {
- render: () => {
- return (
- size=small represents a small sized switch.>}>
-
-
-
-
- )
- },
-}
-
-export const ExampleLoading: Story = {
- render: () => {
- return (
-
-
-
-
-
- )
- },
-}
-export const ExampleTextAndIcon: Story = {
- render: () => {
- return (
-
-
-
-
- }
- unCheckedChildren={ }
- defaultChecked
- />
-
-
- )
+ return
},
}
diff --git a/src/components/data-entry/Switch/SwitchNotProdReady.stories.tsx b/src/components/data-entry/Switch/SwitchNotProdReady.stories.tsx
new file mode 100644
index 000000000..e6976dcc0
--- /dev/null
+++ b/src/components/data-entry/Switch/SwitchNotProdReady.stories.tsx
@@ -0,0 +1,130 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Switch } from 'src/components/data-entry/Switch/Switch'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Icon, Space } from 'src/components'
+import { useState } from 'react'
+import { Button } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Switch',
+ component: Switch,
+
+ args: {
+ autoFocus: false,
+ checked: false,
+ checkedChildren: 'On',
+ className: '',
+ defaultChecked: false,
+ defaultValue: false, // Alias for defaultChecked
+ disabled: false,
+ loading: false,
+ size: 'default',
+ unCheckedChildren: 'Off',
+ value: false, // Alias for checked
+ onClick: (checked, event) => {},
+ onChange: (checked, event) => {
+ alert(`Switch changed: ${checked}`)
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Checked: Story = {
+ args: {
+ checked: true,
+ },
+}
+
+export const CustomCopy: Story = {
+ args: {
+ checked: true,
+ checkedChildren: 'On (Custom Copy)',
+ unCheckedChildren: 'Off (Custom Copy)',
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const Loading: Story = {
+ args: {
+ loading: true,
+ },
+}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const ExampleDisabled: Story = {
+ render: () => {
+ const [disabled, setDisabled] = useState(true)
+ const toggle = () => {
+ setDisabled(!disabled)
+ }
+ return (
+
+
+
+
+ Toggle disabled
+
+
+
+ )
+ },
+}
+
+export const ExampleSizes: Story = {
+ render: () => {
+ return (
+ size=small represents a small sized switch.>}>
+
+
+
+
+ )
+ },
+}
+
+export const ExampleLoading: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleTextAndIcon: Story = {
+ render: () => {
+ return (
+
+
+
+
+ }
+ unCheckedChildren={ }
+ defaultChecked
+ />
+
+
+ )
+ },
+}
diff --git a/src/components/data-entry/TimePicker/TimePicker.stories.tsx b/src/components/data-entry/TimePicker/TimePicker.stories.tsx
index 8e8d4517b..9a7ba2fd0 100644
--- a/src/components/data-entry/TimePicker/TimePicker.stories.tsx
+++ b/src/components/data-entry/TimePicker/TimePicker.stories.tsx
@@ -2,7 +2,7 @@ import { type Meta, type StoryObj } from '@storybook/react'
import { TimePicker } from 'src/components/data-entry/TimePicker/TimePicker'
const meta: Meta = {
- title: 'Components/Data Entry/TimePicker',
+ title: 'Components/Not Prod Ready/Data Entry/TimePicker',
component: TimePicker,
args: {},
diff --git a/src/components/data-entry/TreeSelect/TreeSelect.stories.tsx b/src/components/data-entry/TreeSelect/TreeSelect.stories.tsx
index 839b7da3a..68c8b989a 100644
--- a/src/components/data-entry/TreeSelect/TreeSelect.stories.tsx
+++ b/src/components/data-entry/TreeSelect/TreeSelect.stories.tsx
@@ -11,4 +11,77 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
+export const Primary: Story = {
+ render: () => {
+ return (
+
+ )
+ },
+}
diff --git a/src/components/data-entry/Upload/Upload.stories.tsx b/src/components/data-entry/Upload/Upload.stories.tsx
index a7fd03ea2..c5d617975 100644
--- a/src/components/data-entry/Upload/Upload.stories.tsx
+++ b/src/components/data-entry/Upload/Upload.stories.tsx
@@ -71,36 +71,20 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const CustomListType: Story = {
- args: {
- listType: 'picture-card',
- },
-}
-
-export const DragAndDropUpload: Story = {
- args: {
- onDrop: event => {
- alert('File Drop:')
- },
- },
-}
-
-export const CustomProgress: Story = {
- args: {
- progress: { strokeWidth: 5, showInfo: true },
- },
-}
-
-export const CustomAcceptFileType: Story = {
- args: {
- accept: '.pdf,.docx',
- },
-}
-
-export const DisabledUpload: Story = {
- args: {
- disabled: true,
+export const Primary: Story = {
+ render: () => {
+ return (
+
+ }>Upload
+
+ )
},
}
diff --git a/src/components/data-entry/Upload/UploadNotProdReady.stories.tsx b/src/components/data-entry/Upload/UploadNotProdReady.stories.tsx
new file mode 100644
index 000000000..bfbe37d10
--- /dev/null
+++ b/src/components/data-entry/Upload/UploadNotProdReady.stories.tsx
@@ -0,0 +1,106 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Icon } from 'src/components'
+import { Upload } from 'src/components/data-entry/Upload/Upload'
+import { Button } from 'src/components/general/Button/Button'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Data Entry/Upload',
+ component: props => (
+
+ }>Click to Upload
+
+ ),
+
+ args: {
+ accept: '.jpg,.png,.gif',
+ action: '/upload',
+ beforeUpload: (file, fileList) => {
+ alert('Before Upload:')
+ // Customize before upload logic
+ return true
+ },
+ customRequest: undefined,
+ data: file => {
+ alert('Custom Data:')
+ // Customize data logic
+ return { name: file.name, type: file.type }
+ },
+ defaultFileList: [],
+ directory: false,
+ disabled: false,
+ fileList: [],
+ headers: { Authorization: 'Bearer token' },
+ iconRender: undefined,
+ isImageUrl: undefined,
+ itemRender: undefined,
+ listType: 'text',
+ maxCount: undefined,
+ method: 'post',
+ multiple: false,
+ name: 'file',
+ openFileDialogOnClick: true,
+ previewFile: undefined,
+ progress: { strokeWidth: 2, showInfo: false },
+ showUploadList: true,
+ withCredentials: false,
+ onChange: info => {
+ alert('Upload Change:')
+ },
+ onDrop: event => {
+ alert('File Drop:')
+ },
+ onDownload: file => {
+ alert('Download:')
+ },
+ onPreview: file => {
+ alert('Preview:')
+ },
+ onRemove: file => {
+ alert('Remove:')
+ // Customize remove logic
+ return true
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const CustomListType: Story = {
+ args: {
+ listType: 'picture-card',
+ },
+}
+
+export const DragAndDropUpload: Story = {
+ args: {
+ onDrop: event => {
+ alert('File Drop:')
+ },
+ },
+}
+
+export const CustomProgress: Story = {
+ args: {
+ progress: { strokeWidth: 5, showInfo: true },
+ },
+}
+
+export const CustomAcceptFileType: Story = {
+ args: {
+ accept: '.pdf,.docx',
+ },
+}
+
+export const DisabledUpload: Story = {
+ args: {
+ disabled: true,
+ },
+}
diff --git a/src/components/feedback/Alert/Alert.stories.tsx b/src/components/feedback/Alert/Alert.stories.tsx
index 28df29f9b..c3cb73f41 100644
--- a/src/components/feedback/Alert/Alert.stories.tsx
+++ b/src/components/feedback/Alert/Alert.stories.tsx
@@ -1,22 +1,13 @@
import { type Meta } from '@storybook/react'
import { type StoryObj } from '@storybook/react'
import { Alert } from 'src/components/feedback/Alert/Alert'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Icon, Space } from 'src/components'
-import { useState } from 'react'
-import { Button } from 'src/components'
const meta: Meta = {
title: 'Components/Feedback/Alert',
component: Alert,
args: {
- action: undefined,
banner: false,
- closeIcon: undefined,
- description: undefined,
- icon: undefined,
- message: 'This is a simple alert message',
showIcon: false,
type: 'info',
onClose: e => {
@@ -42,198 +33,37 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const Success: Story = {
+export const Info: Story = {
args: {
- type: 'success',
+ type: 'info',
+ message: 'Note',
+ description: 'Audience size estimates are approximate.',
},
}
-export const ErrorType: Story = {
+export const Success: Story = {
args: {
- type: 'error',
+ type: 'success',
+ closable: true,
+ message: 'The predictive attribute has been successfully created and now is being calculated.',
},
}
-export const WarningBanner: Story = {
+export const Warning: Story = {
args: {
- banner: true,
+ message: 'The default environment is Production.',
+ description:
+ "Ensure your audience's environment aligns with that of any parent audiences to avoid unexpected results.",
type: 'warning',
+ showIcon: true,
+ closable: true,
},
}
-export const Description: Story = {
+export const Error: Story = {
args: {
- description: 'Additional content of the alert.',
- },
-}
-
-export const CustomAction: Story = {
- args: {
- action: Click Me Link ,
- },
-}
-
-export const CustomCloseIcon: Story = {
- args: {
- closeIcon: ,
- },
-}
-
-export const ExampleAllTypes: Story = {
- render: () => {
- return (
- <>
- There are 4 types of Alert: success, info, warning, error.>}>
-
-
-
-
-
-
-
- >
- )
- },
-}
-
-export const ExampleClosable: Story = {
- render: () => {
- return (
- <>
-
-
- {
- alert('closed')
- }}
- />
- {
- alert('closed')
- }}
- />
-
-
- >
- )
- },
-}
-
-export const ExampleBanner: Story = {
- render: () => {
- return (
- <>
-
-
-
-
-
-
-
-
- >
- )
- },
-}
-
-export const ExampleCatchError: Story = {
- render: () => {
- const [error, setError] = useState()
-
- const ThrowError: React.FC = () => {
- const onClick = () => {
- setError(new Error('An Uncaught Error'))
- }
- if (error) {
- throw error
- }
- return (
-
- Click me to throw a error
-
- )
- }
-
- return (
- <>
-
-
-
-
-
- >
- )
- },
-}
-
-export const ExampleCustomActions: Story = {
- render: () => {
- return (
- <>
-
-
-
- UNDO
-
- }
- />
-
- Detail
-
- }
- />
-
-
- Done
-
-
- }
- />
-
-
- Accept
-
-
- Decline
-
-
- }
- />
-
-
- >
- )
+ description: 'An error occurred creating the tracing configuration',
+ type: 'error',
+ showIcon: false,
},
}
diff --git a/src/components/feedback/Alert/AlertNotProdReady.stories.tsx b/src/components/feedback/Alert/AlertNotProdReady.stories.tsx
new file mode 100644
index 000000000..fe1abf475
--- /dev/null
+++ b/src/components/feedback/Alert/AlertNotProdReady.stories.tsx
@@ -0,0 +1,239 @@
+import { type Meta } from '@storybook/react'
+import { type StoryObj } from '@storybook/react'
+import { Alert } from 'src/components/feedback/Alert/Alert'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Icon, Space } from 'src/components'
+import { useState } from 'react'
+import { Button } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Alert',
+ component: Alert,
+
+ args: {
+ action: undefined,
+ banner: false,
+ closeIcon: undefined,
+ description: undefined,
+ icon: undefined,
+ message: 'This is a simple alert message',
+ showIcon: false,
+ type: 'info',
+ onClose: e => {
+ alert('Alert On Close')
+ },
+ afterClose: () => {
+ console.log('Alert After Closed')
+ },
+ },
+ argTypes: {
+ type: {
+ control: 'select',
+ options: ['success', 'info', 'warning', 'error'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const Success: Story = {
+ args: {
+ type: 'success',
+ },
+}
+
+export const ErrorType: Story = {
+ args: {
+ type: 'error',
+ },
+}
+
+export const WarningBanner: Story = {
+ args: {
+ banner: true,
+ type: 'warning',
+ },
+}
+
+export const Description: Story = {
+ args: {
+ description: 'Additional content of the alert.',
+ },
+}
+
+export const CustomAction: Story = {
+ args: {
+ action: Click Me Link ,
+ },
+}
+
+export const CustomCloseIcon: Story = {
+ args: {
+ closeIcon: ,
+ },
+}
+
+export const ExampleAllTypes: Story = {
+ render: () => {
+ return (
+ <>
+ There are 4 types of Alert: success, info, warning, error.>}>
+
+
+
+
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleClosable: Story = {
+ render: () => {
+ return (
+ <>
+
+
+ {
+ alert('closed')
+ }}
+ />
+ {
+ alert('closed')
+ }}
+ />
+
+
+ >
+ )
+ },
+}
+
+export const ExampleBanner: Story = {
+ render: () => {
+ return (
+ <>
+
+
+
+
+
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleCatchError: Story = {
+ render: () => {
+ const [error, setError] = useState()
+
+ const ThrowError: React.FC = () => {
+ const onClick = () => {
+ setError(new Error('An Uncaught Error'))
+ }
+ if (error) {
+ throw error
+ }
+ return (
+
+ Click me to throw a error
+
+ )
+ }
+
+ return (
+ <>
+
+
+
+
+
+ >
+ )
+ },
+}
+
+export const ExampleCustomActions: Story = {
+ render: () => {
+ return (
+ <>
+
+
+
+ UNDO
+
+ }
+ />
+
+ Detail
+
+ }
+ />
+
+
+ Done
+
+
+ }
+ />
+
+
+ Accept
+
+
+ Decline
+
+
+ }
+ />
+
+
+ >
+ )
+ },
+}
diff --git a/src/components/feedback/LoadingModal/LoadingModal.stories.tsx b/src/components/feedback/LoadingModal/LoadingModal.stories.tsx
index ed4c8240f..7b40ba3ec 100644
--- a/src/components/feedback/LoadingModal/LoadingModal.stories.tsx
+++ b/src/components/feedback/LoadingModal/LoadingModal.stories.tsx
@@ -4,7 +4,7 @@ import { Button } from 'src/components/general/Button/Button'
import { LoadingModal, type ILoadingModalProps } from 'src/components/feedback/LoadingModal/LoadingModal'
const meta: Meta = {
- title: 'Components/Feedback/Loading Modal',
+ title: 'Components/Not Prod Ready/Feedback/Loading Modal',
component: LoadingModal,
args: {},
diff --git a/src/components/feedback/Notification/Notification.stories.tsx b/src/components/feedback/Notification/Notification.stories.tsx
index 4ba841ff7..b99b57234 100644
--- a/src/components/feedback/Notification/Notification.stories.tsx
+++ b/src/components/feedback/Notification/Notification.stories.tsx
@@ -1,24 +1,21 @@
import { type Meta, type StoryObj } from '@storybook/react'
+import { Space } from 'src/components'
import { Notification } from 'src/components/feedback/Notification/Notification'
import { Button } from 'src/components/general/Button/Button'
+import { FontWeightStrong } from 'src/styles/style'
const meta: Meta = {
title: 'Components/Feedback/Notification',
component: Notification,
args: {
- type: 'info',
children: Show Notification ,
message: 'Message',
description: 'Description goes here',
duration: 0,
btn: undefined,
- className: undefined,
- closeIcon: true,
- icon: undefined,
key: undefined,
placement: 'topRight',
- style: undefined,
role: 'alert',
onClick: function () {
alert('Notification Clicked')
@@ -47,34 +44,21 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const Short: Story = {
- args: {
- duration: 1,
- },
-}
-
-export const Info: Story = {
- args: {
- type: 'info',
- },
-}
-
-export const Warning: Story = {
- args: {
- type: 'warning',
- },
-}
-
-export const Success: Story = {
- args: {
- type: 'success',
- },
-}
-
-export const Error: Story = {
+export const Primary: Story = {
args: {
- type: 'error',
+ placement: 'bottomLeft',
+ message: Join the new mParticle Experience! ,
+ description:
+ 'Managing your data is easier than ever with the new mParticle experience. Try out the latest features with ease, and switch back to the classic experience anytime from the side navigation.',
+ btn: (
+
+
+ Remind me later
+
+
+ Take me there
+
+
+ ),
},
}
diff --git a/src/components/feedback/Notification/NotificationNotProdReady.stories.tsx b/src/components/feedback/Notification/NotificationNotProdReady.stories.tsx
new file mode 100644
index 000000000..d1e050c2a
--- /dev/null
+++ b/src/components/feedback/Notification/NotificationNotProdReady.stories.tsx
@@ -0,0 +1,80 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Notification } from 'src/components/feedback/Notification/Notification'
+import { Button } from 'src/components/general/Button/Button'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Notification',
+ component: Notification,
+
+ args: {
+ type: 'info',
+ children: Show Notification ,
+ message: 'Message',
+ description: 'Description goes here',
+ duration: 0,
+ btn: undefined,
+ className: undefined,
+ closeIcon: true,
+ icon: undefined,
+ key: undefined,
+ placement: 'topRight',
+ style: undefined,
+ role: 'alert',
+ onClick: function () {
+ alert('Notification Clicked')
+ },
+ onClose: function () {
+ alert('Notification Closed')
+ },
+ },
+ argTypes: {
+ role: {
+ control: 'select',
+ options: ['alert', 'status'],
+ },
+ type: {
+ control: 'select',
+ options: ['info', 'warning', 'success', 'error'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const Short: Story = {
+ args: {
+ duration: 1,
+ },
+}
+
+export const Info: Story = {
+ args: {
+ type: 'info',
+ },
+}
+
+export const Warning: Story = {
+ args: {
+ type: 'warning',
+ },
+}
+
+export const Success: Story = {
+ args: {
+ type: 'success',
+ },
+}
+
+export const Error: Story = {
+ args: {
+ type: 'error',
+ },
+}
diff --git a/src/components/feedback/Popconfirm/Popconfirm.stories.tsx b/src/components/feedback/Popconfirm/Popconfirm.stories.tsx
index 91b94f3d9..cfd4fe131 100644
--- a/src/components/feedback/Popconfirm/Popconfirm.stories.tsx
+++ b/src/components/feedback/Popconfirm/Popconfirm.stories.tsx
@@ -1,5 +1,7 @@
import { type Meta, type StoryObj } from '@storybook/react'
+import { Button, Flex } from 'src/components'
import { Popconfirm } from 'src/components/feedback/Popconfirm/Popconfirm'
+import { Typography } from 'src/components/general/Typography/Typography'
const meta: Meta = {
title: 'Components/Feedback/Popconfirm',
@@ -11,4 +13,22 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {}
+export const Primary: Story = {
+ args: {
+ title: (
+ <>
+
+ Audience Fault
+ Dec 09 2024, 13:04:51
+
+ >
+ ),
+ description: 'We were unable to forward this audience because the connection has been marked as faulted.',
+ trigger: 'hover',
+ placement: 'bottom',
+ showCancel: false,
+ okText: 'Resume',
+ overlayInnerStyle: { maxWidth: '320px' },
+ children: Show popconfirm ,
+ },
+}
diff --git a/src/components/feedback/Progress/Progress.stories.tsx b/src/components/feedback/Progress/Progress.stories.tsx
index 872878f3f..9b653dfaf 100644
--- a/src/components/feedback/Progress/Progress.stories.tsx
+++ b/src/components/feedback/Progress/Progress.stories.tsx
@@ -1,10 +1,5 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { Icon, Space } from 'src/components'
import { Progress } from 'src/components/feedback/Progress/Progress'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Button } from 'src/components'
-import { useState } from 'react'
-import { Tooltip } from 'src/components'
const meta: Meta = {
title: 'Components/Feedback/Progress',
@@ -12,15 +7,6 @@ const meta: Meta = {
args: {
percent: 0,
- showInfo: true,
- status: undefined,
- strokeColor: undefined,
- strokeLinecap: 'round',
- success: undefined,
- trailColor: undefined,
- style: { width: '100px' },
- type: 'line',
- size: 'default',
format: percent => `${percent}%`,
},
}
@@ -33,248 +19,11 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const HalfWay: Story = {
- args: {
- percent: 50,
- },
-}
-
-export const Success: Story = {
- args: {
- percent: 50,
- status: 'success',
- },
-}
-
-export const Exception: Story = {
- args: {
- percent: 30,
- status: 'exception',
- },
-}
-
-export const Active: Story = {
- args: {
- percent: 50,
- status: 'active',
- },
-}
-
-export const WithCustomColors: Story = {
- args: {
- percent: 70,
- strokeColor: '#1890ff',
- trailColor: '#f0f0f0',
- },
-}
-
-export const CircleType: Story = {
+export const Primary: Story = {
args: {
percent: 50,
+ size: 14,
type: 'circle',
- },
-}
-
-export const DashboardType: Story = {
- args: {
- percent: 50,
- type: 'dashboard',
- },
-}
-
-export const SmallSize: Story = {
- args: {
- percent: 50,
- size: 'small',
- },
-}
-
-export const CustomFormat: Story = {
- args: {
- percent: 50,
- format: (percent, successPercent) => `Progress: ${percent}% (Success: ${successPercent}%)`,
- },
-}
-
-export const ExampleProgress: Story = {
- render: () => {
- return (
-
- <>
-
-
-
-
-
- >
-
- )
- },
-}
-
-export const ExampleCircle: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleSmall: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleResponsive: Story = {
- render: () => {
- return (
-
- `Tooltip with percent info - ${number}%`}
- />
-
- )
- },
-}
-
-export const ExampleDynamic: Story = {
- render: () => {
- const [percent, setPercent] = useState(0)
-
- const increase = () => {
- setPercent(prevPercent => {
- const newPercent = prevPercent + 10
- if (newPercent > 100) {
- return 100
- }
- return newPercent
- })
- }
-
- const decline = () => {
- setPercent(prevPercent => {
- const newPercent = prevPercent - 10
- if (newPercent < 0) {
- return 0
- }
- return newPercent
- })
- }
- return (
-
-
-
- } />
- } />
-
-
- )
- },
-}
-
-export const ExampleSegments: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleGradient: Story = {
- render: () => {
- const twoColors = { '0%': '#108ee9', '100%': '#87d068' }
- const conicColors = { '0%': '#87d068', '50%': '#ffe58f', '100%': '#ffccc7' }
- return (
- >}>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleProgressSize: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
+ format: () => `Calculating: 50% complete`,
},
}
diff --git a/src/components/feedback/Progress/ProgressNotProdReady.stories.tsx b/src/components/feedback/Progress/ProgressNotProdReady.stories.tsx
new file mode 100644
index 000000000..67ae0b8af
--- /dev/null
+++ b/src/components/feedback/Progress/ProgressNotProdReady.stories.tsx
@@ -0,0 +1,280 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Icon, Space } from 'src/components'
+import { Progress } from 'src/components/feedback/Progress/Progress'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Button } from 'src/components'
+import { useState } from 'react'
+import { Tooltip } from 'src/components'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Progress',
+ component: Progress,
+
+ args: {
+ percent: 0,
+ showInfo: true,
+ status: undefined,
+ strokeColor: undefined,
+ strokeLinecap: 'round',
+ success: undefined,
+ trailColor: undefined,
+ style: { width: '100px' },
+ type: 'line',
+ size: 'default',
+ format: percent => `${percent}%`,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const HalfWay: Story = {
+ args: {
+ percent: 50,
+ },
+}
+
+export const Success: Story = {
+ args: {
+ percent: 50,
+ status: 'success',
+ },
+}
+
+export const Exception: Story = {
+ args: {
+ percent: 30,
+ status: 'exception',
+ },
+}
+
+export const Active: Story = {
+ args: {
+ percent: 50,
+ status: 'active',
+ },
+}
+
+export const WithCustomColors: Story = {
+ args: {
+ percent: 70,
+ strokeColor: '#1890ff',
+ trailColor: '#f0f0f0',
+ },
+}
+
+export const CircleType: Story = {
+ args: {
+ percent: 50,
+ type: 'circle',
+ },
+}
+
+export const DashboardType: Story = {
+ args: {
+ percent: 50,
+ type: 'dashboard',
+ },
+}
+
+export const SmallSize: Story = {
+ args: {
+ percent: 50,
+ size: 'small',
+ },
+}
+
+export const CustomFormat: Story = {
+ args: {
+ percent: 50,
+ format: (percent, successPercent) => `Progress: ${percent}% (Success: ${successPercent}%)`,
+ },
+}
+
+export const ExampleProgress: Story = {
+ render: () => {
+ return (
+
+ <>
+
+
+
+
+
+ >
+
+ )
+ },
+}
+
+export const ExampleCircle: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleSmall: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleResponsive: Story = {
+ render: () => {
+ return (
+
+ `Tooltip with percent info - ${number}%`}
+ />
+
+ )
+ },
+}
+
+export const ExampleDynamic: Story = {
+ render: () => {
+ const [percent, setPercent] = useState(0)
+
+ const increase = () => {
+ setPercent(prevPercent => {
+ const newPercent = prevPercent + 10
+ if (newPercent > 100) {
+ return 100
+ }
+ return newPercent
+ })
+ }
+
+ const decline = () => {
+ setPercent(prevPercent => {
+ const newPercent = prevPercent - 10
+ if (newPercent < 0) {
+ return 0
+ }
+ return newPercent
+ })
+ }
+ return (
+
+
+
+ } />
+ } />
+
+
+ )
+ },
+}
+
+export const ExampleSegments: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleGradient: Story = {
+ render: () => {
+ const twoColors = { '0%': '#108ee9', '100%': '#87d068' }
+ const conicColors = { '0%': '#87d068', '50%': '#ffe58f', '100%': '#ffccc7' }
+ return (
+ >}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleProgressSize: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
diff --git a/src/components/feedback/Result/Result.stories.tsx b/src/components/feedback/Result/Result.stories.tsx
index 12baf070a..c690062e6 100644
--- a/src/components/feedback/Result/Result.stories.tsx
+++ b/src/components/feedback/Result/Result.stories.tsx
@@ -1,4 +1,5 @@
import { type Meta, type StoryObj } from '@storybook/react'
+import { Button, Icon, Typography } from 'src/components'
import { Result } from 'src/components/feedback/Result/Result'
const meta: Meta = {
@@ -11,26 +12,39 @@ export default meta
type Story = StoryObj
-export const Primary: Story = {
+export const Info: Story = {
args: {
- status: 'success',
+ icon: ,
+ title: (
+ <>
+
+ Premium Feature.
+
+
+ Achieve next-level personalization with Predictive Attributes
+ >
+ ),
+ extra: (
+ <>
+ Start Free Trial
+ Learn More
+ >
+ ),
},
}
export const Error: Story = {
args: {
status: 'error',
- },
-}
-
-export const Warning: Story = {
- args: {
- status: 'warning',
- },
-}
-
-export const Info: Story = {
- args: {
- status: 'info',
+ title: 'We were unable to load the prediction details.',
+ subTitle: (
+ <>
+ Please{' '}
+
+ refresh the page
+ {' '}
+ to try again. If the problem persists, contact support .
+ >
+ ),
},
}
diff --git a/src/components/feedback/Result/ResultNotProdReady.stories.tsx b/src/components/feedback/Result/ResultNotProdReady.stories.tsx
new file mode 100644
index 000000000..182887f16
--- /dev/null
+++ b/src/components/feedback/Result/ResultNotProdReady.stories.tsx
@@ -0,0 +1,36 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Result } from 'src/components/feedback/Result/Result'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Result',
+ component: Result,
+
+ args: {},
+}
+export default meta
+
+type Story = StoryObj
+
+export const Primary: Story = {
+ args: {
+ status: 'success',
+ },
+}
+
+export const Error: Story = {
+ args: {
+ status: 'error',
+ },
+}
+
+export const Warning: Story = {
+ args: {
+ status: 'warning',
+ },
+}
+
+export const Info: Story = {
+ args: {
+ status: 'info',
+ },
+}
diff --git a/src/components/feedback/Skeleton/Skeleton.stories.tsx b/src/components/feedback/Skeleton/Skeleton.stories.tsx
index e0f2cbfa8..a5183e2c0 100644
--- a/src/components/feedback/Skeleton/Skeleton.stories.tsx
+++ b/src/components/feedback/Skeleton/Skeleton.stories.tsx
@@ -1,23 +1,13 @@
import { Skeleton } from 'src/components/feedback/Skeleton/Skeleton'
import { type Meta, type StoryObj } from '@storybook/react'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Avatar, Button, Icon, Radio, Switch } from 'src/components'
-import { useState } from 'react'
-import { List, type RadioChangeEvent } from 'antd'
-import { Space } from 'src/components'
-import { Form } from 'src/components'
-import { Divider } from 'src/components'
-import { createElement } from 'react'
const meta: Meta = {
title: 'Components/Feedback/Skeleton',
component: props => ,
args: {
- avatar: false,
loading: true,
paragraph: false,
- round: false,
title: false,
},
}
@@ -35,245 +25,3 @@ export const Primary: Story = {
paragraph: true,
},
}
-
-export const AvatarPlaceholder: Story = {
- args: {
- avatar: {
- shape: 'circle',
- size: 'large',
- },
- },
-}
-
-export const Paragraph: Story = {
- args: {
- paragraph: { rows: 7 },
- },
-}
-
-export const RoundEdges: Story = {
- args: {
- round: true,
- paragraph: true,
- },
-}
-
-export const Title: Story = {
- args: {
- title: {
- width: 70,
- },
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleCombiniation: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleConfigs: Story = {
- render: () => {
- type SizeType = 'default' | 'small' | 'large'
- type ButtonShapeType = 'circle' | 'square' | 'round' | 'default'
- type AvatarShapeType = 'circle' | 'square'
-
- const [active, setActive] = useState(false)
- const [block, setBlock] = useState(false)
- const [size, setSize] = useState('default')
- const [buttonShape, setButtonShape] = useState('default')
- const [avatarShape, setAvatarShape] = useState('circle')
-
- const handleActiveChange = (checked: boolean): void => {
- setActive(checked)
- }
-
- const handleBlockChange = (checked: boolean): void => {
- setBlock(checked)
- }
-
- const handleSizeChange = (e: RadioChangeEvent): void => {
- setSize(e.target.value as SizeType)
- }
-
- const handleShapeButton = (e: RadioChangeEvent): void => {
- setButtonShape(e.target.value as ButtonShapeType)
- }
-
- const handleAvatarShape = (e: RadioChangeEvent): void => {
- setAvatarShape(e.target.value as AvatarShapeType)
- }
-
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleSubComponent: Story = {
- render: () => {
- const [loading, setLoading] = useState(false)
-
- const showSkeleton = () => {
- setLoading(true)
- setTimeout(() => {
- setLoading(false)
- }, 3000)
- }
-
- return (
-
-
-
- Ant Design, a design language
-
- We supply a series of design principles, practical patterns and high quality design resources (Sketch and
- Axure), to help people create their product prototypes beautifully and efficiently.
-
-
-
- Show Skeleton
-
-
-
- )
- },
-}
-
-export const ExampleList: Story = {
- render: () => {
- interface IconTextProps {
- icon: any
- text: React.ReactNode
- }
-
- const listData = Array.from({ length: 3 }).map((_, i) => ({
- href: 'https://ant.design',
- title: `ant design part ${i + 1}`,
- avatar: `https://api.dicebear.com/7.x/miniavs/svg?seed=${i}`,
- description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.',
- content:
- 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
- }))
-
- const IconText: React.FC = ({ icon, text }: { icon: any; text: any }) => (
- <>
- {createElement(icon, { style: { marginRight: 8 } })}
- {text}
- >
- )
-
- const [loading, setLoading] = useState(true)
-
- const onChange = (checked: boolean) => {
- setLoading(!checked)
- }
- return (
-
-
- (
- } text="156" key="list-vertical-star-o" />,
- } text="156" key="list-vertical-like-o" />,
- } text="2" key="list-vertical-message" />,
- ]
- : undefined
- }
- extra={
- !loading && (
-
- )
- }>
-
- }
- title={{item.title} }
- description={item.description}
- />
- {item.content}
-
-
- )}
- />
-
- )
- },
-}
diff --git a/src/components/feedback/Skeleton/SkeletonNotProdReady.stories.tsx b/src/components/feedback/Skeleton/SkeletonNotProdReady.stories.tsx
new file mode 100644
index 000000000..a28abfe00
--- /dev/null
+++ b/src/components/feedback/Skeleton/SkeletonNotProdReady.stories.tsx
@@ -0,0 +1,279 @@
+import { Skeleton } from 'src/components/feedback/Skeleton/Skeleton'
+import { type Meta, type StoryObj } from '@storybook/react'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Avatar, Button, Icon, Radio, Switch } from 'src/components'
+import { useState } from 'react'
+import { List, type RadioChangeEvent } from 'antd'
+import { Space } from 'src/components'
+import { Form } from 'src/components'
+import { Divider } from 'src/components'
+import { createElement } from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Skeleton',
+ component: props => ,
+
+ args: {
+ avatar: false,
+ loading: true,
+ paragraph: false,
+ round: false,
+ title: false,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {
+ args: {
+ paragraph: true,
+ },
+}
+
+export const AvatarPlaceholder: Story = {
+ args: {
+ avatar: {
+ shape: 'circle',
+ size: 'large',
+ },
+ },
+}
+
+export const Paragraph: Story = {
+ args: {
+ paragraph: { rows: 7 },
+ },
+}
+
+export const RoundEdges: Story = {
+ args: {
+ round: true,
+ paragraph: true,
+ },
+}
+
+export const Title: Story = {
+ args: {
+ title: {
+ width: 70,
+ },
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleCombiniation: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleConfigs: Story = {
+ render: () => {
+ type SizeType = 'default' | 'small' | 'large'
+ type ButtonShapeType = 'circle' | 'square' | 'round' | 'default'
+ type AvatarShapeType = 'circle' | 'square'
+
+ const [active, setActive] = useState(false)
+ const [block, setBlock] = useState(false)
+ const [size, setSize] = useState('default')
+ const [buttonShape, setButtonShape] = useState('default')
+ const [avatarShape, setAvatarShape] = useState('circle')
+
+ const handleActiveChange = (checked: boolean): void => {
+ setActive(checked)
+ }
+
+ const handleBlockChange = (checked: boolean): void => {
+ setBlock(checked)
+ }
+
+ const handleSizeChange = (e: RadioChangeEvent): void => {
+ setSize(e.target.value as SizeType)
+ }
+
+ const handleShapeButton = (e: RadioChangeEvent): void => {
+ setButtonShape(e.target.value as ButtonShapeType)
+ }
+
+ const handleAvatarShape = (e: RadioChangeEvent): void => {
+ setAvatarShape(e.target.value as AvatarShapeType)
+ }
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleSubComponent: Story = {
+ render: () => {
+ const [loading, setLoading] = useState(false)
+
+ const showSkeleton = () => {
+ setLoading(true)
+ setTimeout(() => {
+ setLoading(false)
+ }, 3000)
+ }
+
+ return (
+
+
+
+ Ant Design, a design language
+
+ We supply a series of design principles, practical patterns and high quality design resources (Sketch and
+ Axure), to help people create their product prototypes beautifully and efficiently.
+
+
+
+ Show Skeleton
+
+
+
+ )
+ },
+}
+
+export const ExampleList: Story = {
+ render: () => {
+ interface IconTextProps {
+ icon: any
+ text: React.ReactNode
+ }
+
+ const listData = Array.from({ length: 3 }).map((_, i) => ({
+ href: 'https://ant.design',
+ title: `ant design part ${i + 1}`,
+ avatar: `https://api.dicebear.com/7.x/miniavs/svg?seed=${i}`,
+ description: 'Ant Design, a design language for background applications, is refined by Ant UED Team.',
+ content:
+ 'We supply a series of design principles, practical patterns and high quality design resources (Sketch and Axure), to help people create their product prototypes beautifully and efficiently.',
+ }))
+
+ const IconText: React.FC = ({ icon, text }: { icon: any; text: any }) => (
+ <>
+ {createElement(icon, { style: { marginRight: 8 } })}
+ {text}
+ >
+ )
+
+ const [loading, setLoading] = useState(true)
+
+ const onChange = (checked: boolean) => {
+ setLoading(!checked)
+ }
+ return (
+
+
+ (
+ } text="156" key="list-vertical-star-o" />,
+ } text="156" key="list-vertical-like-o" />,
+ } text="2" key="list-vertical-message" />,
+ ]
+ : undefined
+ }
+ extra={
+ !loading && (
+
+ )
+ }>
+
+ }
+ title={{item.title} }
+ description={item.description}
+ />
+ {item.content}
+
+
+ )}
+ />
+
+ )
+ },
+}
diff --git a/src/components/feedback/Spin/Spin.stories.tsx b/src/components/feedback/Spin/Spin.stories.tsx
index 2fd0b3661..5c3f491de 100644
--- a/src/components/feedback/Spin/Spin.stories.tsx
+++ b/src/components/feedback/Spin/Spin.stories.tsx
@@ -1,25 +1,18 @@
import { type Meta, type StoryObj } from '@storybook/react'
import { Spin } from 'src/components/feedback/Spin/Spin'
-import { ExampleStory } from 'src/utils/ExampleStory'
-import { Flex, Icon } from 'src/components'
-import { Switch } from 'src/components'
-import { Alert } from 'src/components'
-import { Button } from 'src/components'
-import { Margin } from 'src/styles/style'
-import { useState } from 'react'
const meta: Meta = {
title: 'Components/Feedback/Spin',
component: Spin,
args: {
- delay: undefined,
- indicator: undefined,
size: 'default',
- spinning: true,
- tip: undefined,
- wrapperClassName: undefined,
- fullscreen: false,
+ },
+ argTypes: {
+ size: {
+ control: 'select',
+ options: ['default', 'small'],
+ },
},
}
export default meta
@@ -32,156 +25,3 @@ type Story = StoryObj
*/
export const Primary: Story = {}
-
-export const SmallSize: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const LargeSize: Story = {
- args: {
- size: 'large',
- },
-}
-
-export const WithCustomDelay: Story = {
- args: {
- delay: 500,
- },
-}
-
-export const WithCustomIndicator: Story = {
- args: {
- indicator: ,
- },
-}
-
-export const SpinningDisabled: Story = {
- args: {
- spinning: false,
- },
-}
-
-export const WithCustomTip: Story = {
- args: {
- tip: 'Loading...',
- children: <>>,
- },
-}
-
-export const WithWrapperClassName: Story = {
- args: {
- wrapperClassName: 'custom-wrapper',
- },
-}
-
-export const FullscreenMode: Story = {
- args: {
- fullscreen: true,
- },
-}
-
-export const ExampleSize: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleEmbedded: Story = {
- render: () => {
- const [loading, setLoading] = useState(false)
- return (
-
-
-
-
-
- Loading state:
-
-
-
- )
- },
-}
-
-export const ExampleCustomizedDescription: Story = {
- render: () => {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleDelay: Story = {
- render: () => {
- const [loading, setLoading] = useState(false)
- return (
-
-
-
-
-
- Loading state:
-
-
-
- )
- },
-}
-
-export const ExampleFullscreen: Story = {
- render: () => {
- const [spinning, setSpinning] = useState(false)
-
- const showLoader = () => {
- setSpinning(true)
- setTimeout(() => {
- setSpinning(false)
- }, 3000)
- }
- return (
-
- Show fullscreen for 3s
-
-
- )
- },
-}
diff --git a/src/components/feedback/Spin/SpinNotProdReady.stories.tsx b/src/components/feedback/Spin/SpinNotProdReady.stories.tsx
new file mode 100644
index 000000000..79b13dc92
--- /dev/null
+++ b/src/components/feedback/Spin/SpinNotProdReady.stories.tsx
@@ -0,0 +1,187 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Spin } from 'src/components/feedback/Spin/Spin'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { Flex, Icon } from 'src/components'
+import { Switch } from 'src/components'
+import { Alert } from 'src/components'
+import { Button } from 'src/components'
+import { Margin } from 'src/styles/style'
+import { useState } from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Feedback/Spin',
+ component: Spin,
+
+ args: {
+ delay: undefined,
+ indicator: undefined,
+ size: 'default',
+ spinning: true,
+ tip: undefined,
+ wrapperClassName: undefined,
+ fullscreen: false,
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const SmallSize: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const LargeSize: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const WithCustomDelay: Story = {
+ args: {
+ delay: 500,
+ },
+}
+
+export const WithCustomIndicator: Story = {
+ args: {
+ indicator: ,
+ },
+}
+
+export const SpinningDisabled: Story = {
+ args: {
+ spinning: false,
+ },
+}
+
+export const WithCustomTip: Story = {
+ args: {
+ tip: 'Loading...',
+ children: <>>,
+ },
+}
+
+export const WithWrapperClassName: Story = {
+ args: {
+ wrapperClassName: 'custom-wrapper',
+ },
+}
+
+export const FullscreenMode: Story = {
+ args: {
+ fullscreen: true,
+ },
+}
+
+export const ExampleSize: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleEmbedded: Story = {
+ render: () => {
+ const [loading, setLoading] = useState(false)
+ return (
+
+
+
+
+
+ Loading state:
+
+
+
+ )
+ },
+}
+
+export const ExampleCustomizedDescription: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleDelay: Story = {
+ render: () => {
+ const [loading, setLoading] = useState(false)
+ return (
+
+
+
+
+
+ Loading state:
+
+
+
+ )
+ },
+}
+
+export const ExampleFullscreen: Story = {
+ render: () => {
+ const [spinning, setSpinning] = useState(false)
+
+ const showLoader = () => {
+ setSpinning(true)
+ setTimeout(() => {
+ setSpinning(false)
+ }, 3000)
+ }
+ return (
+
+ Show fullscreen for 3s
+
+
+ )
+ },
+}
diff --git a/src/components/general/Button/Button.stories.tsx b/src/components/general/Button/Button.stories.tsx
index 18cdfaaa3..de223e481 100644
--- a/src/components/general/Button/Button.stories.tsx
+++ b/src/components/general/Button/Button.stories.tsx
@@ -1,7 +1,7 @@
import { Button } from 'src/components/general/Button/Button'
import { type Meta, type StoryObj } from '@storybook/react'
import { userEvent } from '@storybook/test'
-import { Icon } from 'src/components'
+import { Divider, Flex, Icon, Typography } from 'src/components'
import React from 'react'
const meta: Meta = {
@@ -9,19 +9,13 @@ const meta: Meta = {
component: props => {props.children ?? 'Button Label'} ,
args: {
- block: false,
danger: false,
disabled: false,
ghost: false,
- href: undefined,
- htmlType: 'button',
- icon: undefined,
loading: false,
shape: 'default',
size: 'middle',
- target: undefined,
type: 'primary',
- onClick: undefined,
},
argTypes: {
@@ -49,6 +43,10 @@ type Story = StoryObj
*/
export const Primary: Story = {
+ args: {
+ type: 'primary',
+ children: 'Create',
+ },
play: async context => {
const button = context.canvasElement.querySelector('button')
if (button) {
@@ -59,119 +57,70 @@ export const Primary: Story = {
},
}
-export const Default: Story = {
- args: {
- type: 'default',
- },
-}
-
-export const Dashed: Story = {
- args: {
- type: 'dashed',
- },
-}
-
-export const Text: Story = {
- args: {
- type: 'text',
- },
-}
-
-export const Link: Story = {
- args: {
- type: 'link',
- },
-}
-
-export const WithDanger: Story = {
- args: {
- danger: true,
- },
-}
-
-export const Disabled: Story = {
- args: {
- disabled: true,
- },
-}
-
-export const Ghost: Story = {
- args: {
- ghost: true,
- },
-}
-
-export const Block: Story = {
- args: {
- block: true,
- },
-}
-
-export const WithIcon: Story = {
- args: {
- icon: ,
- },
-}
-
-export const WithIconSM: Story = {
+export const PrimaryWithIcon: Story = {
args: {
- type: 'default',
- icon: ,
- variant: 'with-new-icon',
+ type: 'primary',
+ icon: ,
+ children: 'Add',
},
}
-export const WithIconDefaultColorSM: Story = {
+export const Default: Story = {
args: {
type: 'default',
- icon: ,
- variant: 'with-new-icon',
+ children: 'Cancel',
},
}
-export const RoundIconButton: Story = {
+export const DefaultWithIcon: Story = {
args: {
- icon: ,
- children: ' ',
type: 'default',
- shape: 'round',
- variant: 'with-new-icon',
- },
-}
-export const Loading: Story = {
- args: {
- loading: true,
- },
-}
-
-export const Circle: Story = {
- args: {
- shape: 'circle',
+ icon: ,
+ children: 'View Columns',
},
}
-export const Round: Story = {
+export const Dashed: Story = {
args: {
- shape: 'round',
+ type: 'dashed',
},
}
-export const Large: Story = {
+export const DashedWithIcon: Story = {
args: {
- size: 'large',
+ type: 'dashed',
+ icon: ,
+ children: 'Connect Output',
},
}
-export const Small: Story = {
+export const Link: Story = {
args: {
- size: 'small',
+ type: 'link',
+ children: 'Retry',
},
}
-export const PrimaryButtonWithClick: Story = {
+export const LinkWithIcon: Story = {
args: {
- onClick: e => {
- alert('Button Clicked')
- },
+ type: 'link',
+ icon: ,
+ children: 'Add Audience Criteria',
+ },
+}
+
+export const IconOnly: Story = {
+ render: () => {
+ return (
+ <>
+
+ } />
+ 100%
+ } />
+
+ } />
+
+ >
+ )
},
}
diff --git a/src/components/general/Button/ButtonNotProdReady.stories.tsx b/src/components/general/Button/ButtonNotProdReady.stories.tsx
new file mode 100644
index 000000000..2eea17876
--- /dev/null
+++ b/src/components/general/Button/ButtonNotProdReady.stories.tsx
@@ -0,0 +1,157 @@
+import { Button } from 'src/components/general/Button/Button'
+import { type Meta, type StoryObj } from '@storybook/react'
+import { userEvent } from '@storybook/test'
+import { Icon } from 'src/components'
+import React from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/General/Button',
+ component: props => {props.children ?? 'Button Label'} ,
+
+ args: {
+ block: false,
+ danger: false,
+ disabled: false,
+ ghost: false,
+ href: undefined,
+ htmlType: 'button',
+ icon: undefined,
+ loading: false,
+ shape: 'default',
+ size: 'middle',
+ target: undefined,
+ type: 'primary',
+ onClick: undefined,
+ },
+
+ argTypes: {
+ shape: {
+ control: 'select',
+ options: ['default', 'circle', 'round'],
+ },
+ size: {
+ control: 'select',
+ options: ['small', 'medium', 'large'],
+ },
+ type: {
+ control: 'select',
+ options: ['primary', 'dashed', 'link', 'text', 'default'],
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {
+ play: async context => {
+ const button = context.canvasElement.querySelector('button')
+ if (button) {
+ await userEvent.click(button) // Click the button
+ } else {
+ throw new Error('Button not found')
+ }
+ },
+}
+
+export const Dashed: Story = {
+ args: {
+ type: 'dashed',
+ },
+}
+
+export const Text: Story = {
+ args: {
+ type: 'text',
+ },
+}
+
+export const Link: Story = {
+ args: {
+ type: 'link',
+ },
+}
+
+export const WithDanger: Story = {
+ args: {
+ danger: true,
+ },
+}
+
+export const Disabled: Story = {
+ args: {
+ disabled: true,
+ },
+}
+
+export const Ghost: Story = {
+ args: {
+ ghost: true,
+ },
+}
+
+export const Block: Story = {
+ args: {
+ block: true,
+ },
+}
+
+export const WithIconDefaultColorSM: Story = {
+ args: {
+ type: 'default',
+ icon: ,
+ variant: 'with-new-icon',
+ },
+}
+
+export const RoundIconButton: Story = {
+ args: {
+ icon: ,
+ children: ' ',
+ type: 'default',
+ shape: 'round',
+ variant: 'with-new-icon',
+ },
+}
+export const Loading: Story = {
+ args: {
+ loading: true,
+ },
+}
+
+export const Circle: Story = {
+ args: {
+ shape: 'circle',
+ },
+}
+
+export const Round: Story = {
+ args: {
+ shape: 'round',
+ },
+}
+
+export const Large: Story = {
+ args: {
+ size: 'large',
+ },
+}
+
+export const Small: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const PrimaryButtonWithClick: Story = {
+ args: {
+ onClick: e => {
+ alert('Button Clicked')
+ },
+ },
+}
diff --git a/src/components/general/FloatButton/FloatButton.stories.tsx b/src/components/general/FloatButton/FloatButton.stories.tsx
index 62e40a5ee..01ee6f6be 100644
--- a/src/components/general/FloatButton/FloatButton.stories.tsx
+++ b/src/components/general/FloatButton/FloatButton.stories.tsx
@@ -2,7 +2,7 @@ import { type Meta, type StoryObj } from '@storybook/react'
import { FloatButton } from 'src/components/general/FloatButton/FloatButton'
const meta: Meta = {
- title: 'Components/General/FloatButton',
+ title: 'Components/Not Prod Ready/General/FloatButton',
component: FloatButton,
args: {
diff --git a/src/components/general/Typography/Paragraph.stories.tsx b/src/components/general/Typography/Paragraph.stories.tsx
index 1719a6473..cdad3e855 100644
--- a/src/components/general/Typography/Paragraph.stories.tsx
+++ b/src/components/general/Typography/Paragraph.stories.tsx
@@ -84,7 +84,12 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
+export const Primary: Story = {
+ args: {
+ code: false,
+ delete: false,
+ },
+}
export const ExampleEditable: Story = {
render: () => {
diff --git a/src/components/icons/index.ts b/src/components/icons/index.ts
index df1f868d4..5665bf1b4 100644
--- a/src/components/icons/index.ts
+++ b/src/components/icons/index.ts
@@ -8,7 +8,6 @@ import ChartLineIcon from 'src/assets/svg/chart-line.svg?react'
import CheckIcon from 'src/assets/svg/check.svg?react'
import CircleNodesIcon from 'src/assets/svg/circle-nodes.svg?react'
import CloudIcon from 'src/assets/svg/cloud.svg?react'
-import CrosshairIcon from 'src/assets/svg/crosshair.svg?react'
import ConnectionsIcon from 'src/assets/svg/connections.svg?react'
import DataPlatformIconDt from 'src/assets/svg/mp_pm_dt_data-platform.svg?react'
import DatabaseIcon from 'src/assets/svg/database.svg?react'
@@ -34,6 +33,7 @@ import MessageQuestionIcon from 'src/assets/svg/message-question.svg?react'
import MpLogoIcon from 'src/assets/svg/mpLogo.svg?react'
import ObservabilityIcon from 'src/assets/svg/mp_pm_lt_observability.svg?react'
import OversightIconDt from 'src/assets/svg/mp_pm_dt_oversight.svg?react'
+import PrecisionIcon from 'src/assets/svg/precision.svg?react'
import PredictionsIcon from 'src/assets/svg/mp_pm_lt_predictions.svg?react'
import PredictionsIconDt from 'src/assets/svg/mp_pm_dt_predictions.svg?react'
import RemoveIcon from 'src/assets/svg/remove.svg?react'
@@ -106,7 +106,6 @@ export {
CheckIcon,
CircleNodesIcon,
CloudIcon,
- CrosshairIcon,
Cohort,
ConnectionsIcon,
ConversionIcon,
@@ -158,6 +157,7 @@ export {
OverviewIconDt,
PaywallIcon,
Placeholder,
+ PrecisionIcon,
PredictionsIcon,
PredictionsIconDt,
PremiumIcon,
diff --git a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx
index 332f84c67..e733dc52d 100644
--- a/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx
+++ b/src/components/navigation/GlobalNavigation/GlobalNavigation.stories.tsx
@@ -119,6 +119,7 @@ const defaultOrgs: INavigationOrg[] = [
const defaultNotificationCenter: INotificationCenterProps = {
open: false,
+ unreadMessages: 0,
content: () =>
,
onClose: () => {},
onPreferencesClick: () => {},
@@ -1566,3 +1567,105 @@ export const MPWithNotificationCenterMessageModal: Story = {
)
},
}
+
+export const MPWithNotificationCenterUnreadNotifications: Story = {
+ args: {
+ notificationCenter: {
+ ...defaultNotificationCenter,
+ unreadMessages: 1,
+ },
+ },
+
+ render: props => {
+ const [isNotificationCenterOpen, setIsNotificationCenterOpen] = useState(false)
+ const [isModalOpen, setIsModalOpen] = useState(false)
+ const [zIndex, setZIndex] = useState(NotificationCenterZIndex)
+ const [unreadMessages, setUnreadMessages] = useState(1)
+ return (
+
+
{
+ setIsModalOpen(false)
+ }}
+ onOk={() => {
+ setIsModalOpen(false)
+ }}
+ afterClose={() => {
+ setZIndex(NotificationCenterZIndex)
+ }}
+ centered={true}>
+
+
Message Title
+
Unread Messages: {unreadMessages}
+
+
+
{
+ if (isModalOpen) {
+ return
+ }
+ setIsNotificationCenterOpen(newOpen)
+ },
+ content: () => (
+
+
{
+ setZIndex(0)
+ setIsModalOpen(true)
+ setUnreadMessages(prev => (prev > 0 ? prev - 1 : 0))
+ }}>
+ Open Modal
+
+
Content
+
Content
+
Content
+
Content
+
+ ),
+ onClose: () => {
+ setIsNotificationCenterOpen(false)
+ },
+ onPreferencesClick: () => {
+ setIsNotificationCenterOpen(false)
+ },
+ }}
+ logo={defaultLogo}
+ tools={defaultTools}
+ management={defaultManagement}
+ orgs={defaultOrgs}
+ showSuiteLogo={true}
+ onSearchClick={() => {
+ alert('Searching!')
+ }}
+ suiteSelectorOptions={{
+ overviewHref: '/',
+ onLinkClick: link => {
+ alert(link.href)
+ },
+ onUnauthorizedClick: link => {
+ alert(`unauthorized ${link?.href} `)
+ },
+ unauthorizedLinks: ['dataPlatform'],
+ activeLink: 'oversight',
+ links: [
+ { linkId: 'oversight', href: '/oversight' },
+ { linkId: 'dataPlatform', href: '/data-platform' },
+ { linkId: 'customer360', href: '/customer-360' },
+ { linkId: 'predictions', href: '/predictions' },
+ { linkId: 'analytics', href: '/analytics' },
+ { linkId: 'segmentation', href: '/segmentation' },
+ ],
+ }}
+ />
+
+ )
+ },
+}
diff --git a/src/components/navigation/GlobalNavigation/NotificationCenter.tsx b/src/components/navigation/GlobalNavigation/NotificationCenter.tsx
index 9d9a3bacb..c76bb6090 100644
--- a/src/components/navigation/GlobalNavigation/NotificationCenter.tsx
+++ b/src/components/navigation/GlobalNavigation/NotificationCenter.tsx
@@ -1,16 +1,23 @@
import { Flex, Typography, Space, Button } from 'antd'
-import { type IButtonProps, Icon, type IPopoverProps, Popover } from 'src/components'
+import { Badge, type IButtonProps, Icon, type IPopoverProps, Popover } from 'src/components'
import { NavigationItem } from 'src/components/navigation/GlobalNavigation/NavigationItem'
export interface INotificationCenterProps
extends Omit {
+ unreadMessages?: number
onClose?: IButtonProps['onClick']
onPreferencesClick?: IButtonProps['onClick']
}
export const NotificationCenterZIndex = 9999
-export function NotificationCenter({ zIndex, onClose, onPreferencesClick, ...props }: INotificationCenterProps) {
+export function NotificationCenter({
+ zIndex,
+ onClose,
+ onPreferencesClick,
+ unreadMessages,
+ ...props
+}: INotificationCenterProps) {
return (
}
+ icon={
+
+
+
+ }
/>
diff --git a/src/components/navigation/Pagination/Pagination.stories.tsx b/src/components/navigation/Pagination/Pagination.stories.tsx
index fe15d28b4..2fed8e7bc 100644
--- a/src/components/navigation/Pagination/Pagination.stories.tsx
+++ b/src/components/navigation/Pagination/Pagination.stories.tsx
@@ -1,9 +1,6 @@
import { type Meta, type StoryObj } from '@storybook/react'
-import { Icon } from 'src/components'
import { Pagination } from 'src/components/navigation/Pagination/Pagination'
import { ExampleStory } from 'src/utils/ExampleStory'
-import { type IPaginationProps } from 'src/components/navigation/Pagination/Pagination'
-import { useState } from 'react'
const meta: Meta = {
title: 'Components/Navigation/Pagination',
@@ -13,20 +10,8 @@ const meta: Meta = {
current: 1,
defaultCurrent: 1,
defaultPageSize: 10,
- disabled: false,
- hideOnSinglePage: false,
- itemRender: (page, type, originalElement) => (type === 'page' ? {page} : originalElement),
pageSize: 10,
pageSizeOptions: [10, 20, 50, 100],
- responsive: false,
- showLessItems: false,
- showQuickJumper: false,
- showSizeChanger: false,
- showTitle: true,
- showTotal: (total, range) => `Total ${total} items`,
- simple: false,
- size: 'default',
- total: 27,
onChange: (page, pageSize) => {
alert(`Page changed to ${page}, Page Size: ${pageSize}`)
},
@@ -44,183 +29,11 @@ type Story = StoryObj
Customize the stories based on specific requirements.
*/
-export const Primary: Story = {}
-
-export const SmallSize: Story = {
- args: {
- size: 'small',
- },
-}
-
-export const ResponsivePagination: Story = {
- args: {
- responsive: true,
- },
-}
-
-export const ShowQuickJumperWithButton: Story = {
- args: {
- showQuickJumper: { goButton: },
- },
-}
-
-export const ShowSizeChangerDynamic: Story = {
- args: {
- showSizeChanger: true,
- total: 60,
- },
-}
-
-export const SimplePagination: Story = {
- args: {
- simple: true,
- },
-}
-
-export const ShowLessItemsPagination: Story = {
- args: {
- showLessItems: true,
- },
-}
-
-export const CustomTotalText: Story = {
- args: {
- showTotal: (total, range) => `Showing ${range[0]}-${range[1]} of ${total} items`,
- },
-}
-
-export const ExampleBasic: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleMorePages: Story = {
- render: () => {
- return (
-
-
-
- )
- },
-}
-
-export const ExampleChangePageSize: Story = {
- render: () => {
- const onShowSizeChange: IPaginationProps['onShowSizeChange'] = (current, pageSize) => {
- console.log(current, pageSize)
- }
- return (
-
-
-
-
-
- )
- },
-}
-
-export const ExampleJump: Story = {
- render: () => {
- const onChange: IPaginationProps['onChange'] = pageNumber => {
- console.log('Page: ', pageNumber)
- }
- return (
-
-
-
-
-
- )
- },
-}
-
-export const ExampleMini: Story = {
- render: () => {
- const showTotal: IPaginationProps['showTotal'] = total => `Total ${total} items`
- return (
-
-
-
-
-
-
- )
- },
-}
-
-export const ExampleSimple: Story = {
- render: () => {
- return (
-
-
-
-
-
- )
- },
-}
-
-export const ExampleControlled: Story = {
- render: () => {
- const [current, setCurrent] = useState(3)
- const onChange: IPaginationProps['onChange'] = page => {
- console.log(page)
- setCurrent(page)
- }
- return (
-
-
-
- )
- },
-}
-
-export const ExampleTotalNumber: Story = {
- render: () => {
- return (
-
- `Total ${total} items`} defaultPageSize={20} defaultCurrent={1} />
-
- `${range[0]}-${range[1]} of ${total} items`}
- defaultPageSize={20}
- defaultCurrent={1}
- />
-
- )
- },
-}
-
-export const ExampleShowAll: Story = {
- render: () => {
- return (
-
- `Total ${total} items`} />
-
- )
- },
-}
-
-export const ExamplePrevNext: Story = {
+export const Default: Story = {
render: () => {
- const itemRender: IPaginationProps['itemRender'] = (_, type, originalElement) => {
- if (type === 'prev') {
- return Previous
- }
- if (type === 'next') {
- return Next
- }
- return originalElement
- }
return (
-
-
+
+
)
},
diff --git a/src/components/navigation/Pagination/PaginationNotProdReady.stories.tsx b/src/components/navigation/Pagination/PaginationNotProdReady.stories.tsx
new file mode 100644
index 000000000..da06b8572
--- /dev/null
+++ b/src/components/navigation/Pagination/PaginationNotProdReady.stories.tsx
@@ -0,0 +1,227 @@
+import { type Meta, type StoryObj } from '@storybook/react'
+import { Icon } from 'src/components'
+import { Pagination } from 'src/components/navigation/Pagination/Pagination'
+import { ExampleStory } from 'src/utils/ExampleStory'
+import { type IPaginationProps } from 'src/components/navigation/Pagination/Pagination'
+import { useState } from 'react'
+
+const meta: Meta = {
+ title: 'Components/Not Prod Ready/Navigation/Pagination',
+ component: Pagination,
+
+ args: {
+ current: 1,
+ defaultCurrent: 1,
+ defaultPageSize: 10,
+ disabled: false,
+ hideOnSinglePage: false,
+ itemRender: (page, type, originalElement) => (type === 'page' ? {page} : originalElement),
+ pageSize: 10,
+ pageSizeOptions: [10, 20, 50, 100],
+ responsive: false,
+ showLessItems: false,
+ showQuickJumper: false,
+ showSizeChanger: false,
+ showTitle: true,
+ showTotal: (total, range) => `Total ${total} items`,
+ simple: false,
+ size: 'default',
+ total: 27,
+ onChange: (page, pageSize) => {
+ alert(`Page changed to ${page}, Page Size: ${pageSize}`)
+ },
+ onShowSizeChange: (current, size) => {
+ alert(`Page Size changed to ${size}, Current Page: ${current}`)
+ },
+ },
+}
+export default meta
+
+type Story = StoryObj
+
+/*
+ Initial story templates generated by AI.
+ Customize the stories based on specific requirements.
+*/
+
+export const Primary: Story = {}
+
+export const SmallSize: Story = {
+ args: {
+ size: 'small',
+ },
+}
+
+export const ResponsivePagination: Story = {
+ args: {
+ responsive: true,
+ },
+}
+
+export const ShowQuickJumperWithButton: Story = {
+ args: {
+ showQuickJumper: { goButton: },
+ },
+}
+
+export const ShowSizeChangerDynamic: Story = {
+ args: {
+ showSizeChanger: true,
+ total: 60,
+ },
+}
+
+export const SimplePagination: Story = {
+ args: {
+ simple: true,
+ },
+}
+
+export const ShowLessItemsPagination: Story = {
+ args: {
+ showLessItems: true,
+ },
+}
+
+export const CustomTotalText: Story = {
+ args: {
+ showTotal: (total, range) => `Showing ${range[0]}-${range[1]} of ${total} items`,
+ },
+}
+
+export const ExampleBasic: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleMorePages: Story = {
+ render: () => {
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleChangePageSize: Story = {
+ render: () => {
+ const onShowSizeChange: IPaginationProps['onShowSizeChange'] = (current, pageSize) => {
+ console.log(current, pageSize)
+ }
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleJump: Story = {
+ render: () => {
+ const onChange: IPaginationProps['onChange'] = pageNumber => {
+ console.log('Page: ', pageNumber)
+ }
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleMini: Story = {
+ render: () => {
+ const showTotal: IPaginationProps['showTotal'] = total => `Total ${total} items`
+ return (
+
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleSimple: Story = {
+ render: () => {
+ return (
+
+
+
+
+
+ )
+ },
+}
+
+export const ExampleControlled: Story = {
+ render: () => {
+ const [current, setCurrent] = useState(3)
+ const onChange: IPaginationProps['onChange'] = page => {
+ console.log(page)
+ setCurrent(page)
+ }
+ return (
+
+
+
+ )
+ },
+}
+
+export const ExampleTotalNumber: Story = {
+ render: () => {
+ return (
+
+ `Total ${total} items`} defaultPageSize={20} defaultCurrent={1} />
+
+ `${range[0]}-${range[1]} of ${total} items`}
+ defaultPageSize={20}
+ defaultCurrent={1}
+ />
+
+ )
+ },
+}
+
+export const ExampleShowAll: Story = {
+ render: () => {
+ return (
+
+ `Total ${total} items`} />
+
+ )
+ },
+}
+
+export const ExamplePrevNext: Story = {
+ render: () => {
+ const itemRender: IPaginationProps['itemRender'] = (_, type, originalElement) => {
+ if (type === 'prev') {
+ return Previous
+ }
+ if (type === 'next') {
+ return Next
+ }
+ return originalElement
+ }
+ return (
+
+
+
+ )
+ },
+}
diff --git a/src/constants/Icons.ts b/src/constants/Icons.ts
index a57fe4612..a7c469a77 100644
--- a/src/constants/Icons.ts
+++ b/src/constants/Icons.ts
@@ -11,7 +11,6 @@ import {
CheckIcon,
CircleNodesIcon,
CloudIcon,
- CrosshairIcon,
ConnectionsIcon,
DataPlatformIconDt,
DatabaseIcon,
@@ -38,6 +37,7 @@ import {
MpLogoIcon,
ObservabilityIcon,
OversightIconDt,
+ PrecisionIcon,
PredictionsIconDt,
PredictionsIcon,
RemoveIcon,
@@ -186,10 +186,6 @@ export const Icons: Record = {
light: Copy,
default: 'light',
},
- crosshair: {
- light: CrosshairIcon,
- default: 'light',
- },
dashboard: {
light: Dashboard,
default: 'light',
@@ -408,6 +404,10 @@ export const Icons: Record = {
light: Placeholder,
default: 'light',
},
+ precision: {
+ light: PrecisionIcon,
+ default: 'light',
+ },
predictions: {
light: PredictionsIcon,
'duo-tone': PredictionsIconDt,
diff --git a/src/types/icons.ts b/src/types/icons.ts
index a8639dcd0..c5961aa1f 100644
--- a/src/types/icons.ts
+++ b/src/types/icons.ts
@@ -36,7 +36,6 @@ export type IconNames =
| 'connections'
| 'conversion'
| 'copy'
- | 'crosshair'
| 'dashboard'
| 'database'
| 'dataPlatform'
@@ -90,6 +89,7 @@ export type IconNames =
| 'paywall'
| 'pipelines'
| 'placeholder'
+ | 'precision'
| 'predictions'
| 'premium'
| 'premiumDt'