diff --git a/.storybook/preview.tsx b/.storybook/preview.tsx index 8e81f9bba..d0ca2db2a 100644 --- a/.storybook/preview.tsx +++ b/.storybook/preview.tsx @@ -18,10 +18,21 @@ const preview: Preview = { 'Design Templates', ], 'Foundations', - 'Components', ['Colors', 'Typography', 'Icons', 'Errors', 'Loading'], + 'Components', + [ + 'Data Display', + 'Data Entry', + 'General', + 'Feedback', + 'Layout', + 'Navigation', + 'Other', + 'Unused', + ['Documentation', 'Calendar', 'Carousel', 'ColorPicker', 'QRCode', 'Rate', 'Watermark'], + ], 'Candidate Components', - 'Design Templates', + 'UX Patterns', ['Table', ['Documentation', 'Filters'], 'Observability', 'Directory'], 'Contributing', ['Introduction', 'Commits', 'Testing in the platforms', 'Release Process', 'Maintainers'], diff --git a/docs/UX Patterns/Directory.mdx b/docs/UX Patterns/Directory.mdx new file mode 100644 index 000000000..db9c21e0f --- /dev/null +++ b/docs/UX Patterns/Directory.mdx @@ -0,0 +1,3 @@ +# Directory + +TBD \ No newline at end of file diff --git a/docs/UX Patterns/Table/Cell Badge.mdx b/docs/UX Patterns/Table/Cell Badge.mdx new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/docs/UX Patterns/Table/Cell Badge.mdx @@ -0,0 +1 @@ + diff --git a/docs/UX Patterns/Table/Cell Link.mdx b/docs/UX Patterns/Table/Cell Link.mdx new file mode 100644 index 000000000..ad9acf92a --- /dev/null +++ b/docs/UX Patterns/Table/Cell Link.mdx @@ -0,0 +1 @@ +![](../../assets/test.png) diff --git a/docs/UX Patterns/Table/Cell More Actions.mdx b/docs/UX Patterns/Table/Cell More Actions.mdx new file mode 100644 index 000000000..15b9950cb --- /dev/null +++ b/docs/UX Patterns/Table/Cell More Actions.mdx @@ -0,0 +1,18 @@ +### More Actions Menu + +#### Overview +The Actions Menu provides a consolidated interface for row-specific operations, such as delete, duplicate, download, and archive, all grouped within a single menu. + + + + + + +#### Usage Guidelines +- Highlight destructive actions in red to ensure emphasis and user caution. +- Omit icons from menu items to maintain a clean, easy-to-read menu. +- Display the "More Actions" menu even when only one option is available. + +Examples: +- Disabled menu item (Coming Soon) + diff --git a/docs/UX Patterns/Table/Cell Tag.mdx b/docs/UX Patterns/Table/Cell Tag.mdx new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/docs/UX Patterns/Table/Cell Tag.mdx @@ -0,0 +1 @@ + diff --git a/docs/UX Patterns/Table/Documentation.mdx b/docs/UX Patterns/Table/Documentation.mdx new file mode 100644 index 000000000..bf8c4ec9a --- /dev/null +++ b/docs/UX Patterns/Table/Documentation.mdx @@ -0,0 +1,53 @@ +import { Meta, Story } from '@storybook/blocks'; + +{/* // import * as TableStories from './Table.stories'; */} + +{/* */} + +{/* */} + +# Table + +#### Overview +Tables present and organize data in a structured, readable format, ranging from basic displays to complex interfaces that support queries and data manipulation. + +#### Basic Table + +##### Header +A typical table header contains column titles that describe the data in each column. It includes functionality for sorting columns and may feature help icons with tooltips to provide additional information on each column’s purpose. + +##### Pagination +Use pagination in tables to improve performance and reduce load times by fetching only the data needed for the current page. + +##### Cell Types +Table cells support various formats and are designed to display data in clear, readable ways. +- Numbers (Coming Soon) +- Date / Time (Coming Soon) +- CTA Buttons (Coming Soon) +- Status Badges (Coming Soon) +- Links (Coming Soon) +- Tags (Coming Soon) +- More Actions (Coming Soon) + +[View Example](#link) + +#### Tables with Filters +Filters help users refine large datasets within tables. The mParticle table supports a range of filter types, including: + +- [Search](#link-to-search) +- [Date Range filters](#link-to-daterange) +- [Basic Filters](#link-to-basic-filters) +- [Filters with an Apply button](#link-to-apply-button-filters) + + + +#### Related Links +| Type | Resource | +| ------ | -------- | +| Eames | [Figma Templates](https://www.figma.com/design/yCPszaTtkCFxRHaSkkJFR9/Eames-Templates-%5BInternal%5D?node-id=2114-9632&node-type=frame&t=Aa9XxcKyme3ud4cb-0) | + + + +#### Example basic table image (To be changed) + + diff --git a/docs/UX Patterns/Table/Filters.mdx b/docs/UX Patterns/Table/Filters.mdx new file mode 100644 index 000000000..7a1bb0632 --- /dev/null +++ b/docs/UX Patterns/Table/Filters.mdx @@ -0,0 +1,20 @@ +# Filters + +*Note: This section covers filters specifically for tables. For query-related filters, please refer to the [Analytics Filters - Coming Soon](#coming).* + +#### **Simple Filters** +Simple filters are ideal when there are only a few filter options. These are straightforward and quick to use, often appearing as dropdowns above the table. For implementation, refer to the [Select Component](https://mparticle.github.io/aquarium/?path=/docs/components-data-entry-select--documentation). + +Examples: +- Coming Soon +- Coming Soon + +#### **Filters with Apply Button** +Complex filters provide more advanced filtering options, allowing users to apply multiple criteria at once. These filters often include dropdowns, checkboxes, and text fields. Complex filters are particularly useful when multiple filters need to be applied simultaneously or when load times might be a concern. + +#### **Date Range Filters** +Date range filters allow users to specify a range of dates to narrow down the data displayed in the table. Typically, these filters include a start date and an end date, with options for common ranges like “Last 7 days” or “Last 30 days.” User presets are also available for frequently used date ranges. + +Examples: +- [Basic Date Picker](https://mparticle.github.io/aquarium/?path=/docs/components-data-entry-date-picker--documentation) +- [Date Range Filter with Presets](https://mparticle.github.io/aquarium/?path=/docs/candidate-components-directory-date-range-filter--documentation) diff --git a/docs/UX Patterns/Table/Table.stories.tsx b/docs/UX Patterns/Table/Table.stories.tsx new file mode 100644 index 000000000..7f0726d44 --- /dev/null +++ b/docs/UX Patterns/Table/Table.stories.tsx @@ -0,0 +1,94 @@ +import type { Meta } from '@storybook/react' +import { Table } from 'src/components/data-display/Table/Table' +import { Space, Tag } from 'antd' +import type { TableProps } from 'antd' + +interface DataType { + key: string + name: string + age: number + address: string + tags: string[] +} + +const columns: TableProps['columns'] = [ + { + title: 'Name', + dataIndex: 'name', + key: 'name', + render: text => {text}, + }, + { + title: 'Age', + dataIndex: 'age', + key: 'age', + }, + { + title: 'Address', + dataIndex: 'address', + key: 'address', + }, + { + title: 'Tags', + key: 'tags', + dataIndex: 'tags', + render: (_, { tags }) => ( + <> + {tags.map(tag => { + let color = tag.length > 5 ? 'geekblue' : 'green' + if (tag === 'loser') { + color = 'volcano' + } + return ( + + {tag.toUpperCase()} + + ) + })} + + ), + }, + { + title: 'Action', + key: 'action', + render: (_, record) => ( + + Invite {record.name} + Delete + + ), + }, +] + +const data: DataType[] = [ + { + key: '1', + name: 'John Brown', + age: 32, + address: 'New York No. 1 Lake Park', + tags: ['nice', 'developer'], + }, + { + key: '2', + name: 'Jim Green', + age: 42, + address: 'London No. 1 Lake Park', + tags: ['loser'], + }, + { + key: '3', + name: 'Joe Black', + age: 32, + address: 'Sydney No. 1 Lake Park', + tags: ['cool', 'teacher'], + }, +] + +const meta: Meta = { + title: 'UX Patterns/Table', + component: () => columns={columns} dataSource={data} />, + + args: {}, +} + +export default meta diff --git a/docs/UX Patterns/Table/Tags.mdx b/docs/UX Patterns/Table/Tags.mdx new file mode 100644 index 000000000..88d4acf86 --- /dev/null +++ b/docs/UX Patterns/Table/Tags.mdx @@ -0,0 +1,17 @@ +### Tags in Tables + +#### Overview +Tags are used within tables to visually categorize or label data, providing users with quick context about specific rows or items. Tags can indicate statuses, categories, priorities, or any other metadata that helps users understand and interpret the data at a glance. + +#### Managing Tags +- **Creating Tags - COMING SOON** +- **Editing Tags - COMING SOON** +- **Deleting Tags - COMING SOON** + +#### Displaying Tags within Tables + +COMING SOON + +#### Filtering by Tags + +COMING SOON diff --git a/docs/components/Unused/Documentation.mdx b/docs/components/Unused/Documentation.mdx new file mode 100644 index 000000000..b28a07cb1 --- /dev/null +++ b/docs/components/Unused/Documentation.mdx @@ -0,0 +1,3 @@ +# Unused components + +The following components are not used in mParticle but can still be browsed if needed. \ No newline at end of file diff --git a/src/components/data-display/QRCode/QRCode.stories.tsx b/src/components/data-display/QRCode/QRCode.stories.tsx deleted file mode 100644 index e29c23242..000000000 --- a/src/components/data-display/QRCode/QRCode.stories.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { type Meta, type StoryObj } from '@storybook/react' -import { QRCode } from 'src/components/data-display/QRCode/QRCode' - -const meta: Meta = { - title: 'Components/Data Display/QRCode', - component: QRCode, - - args: {}, -} -export default meta - -type Story = StoryObj - -export const Primary: Story = {} diff --git a/src/components/data-entry/ColorPicker/ColorPicker.stories.tsx b/src/components/data-entry/ColorPicker/ColorPicker.stories.tsx deleted file mode 100644 index 08a7a9965..000000000 --- a/src/components/data-entry/ColorPicker/ColorPicker.stories.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import { type Meta, type StoryObj } from '@storybook/react' -import { ColorPicker } from 'src/components/data-entry/ColorPicker/ColorPicker' - -const meta: Meta = { - title: 'Components/Data Entry/ColorPicker', - component: ColorPicker, - - args: {}, -} -export default meta - -type Story = StoryObj - -export const Primary: Story = {} diff --git a/src/components/index.ts b/src/components/index.ts index 7dce8bebb..9de918d0c 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -1,13 +1,13 @@ export { Button, type IButtonProps } from './general/Button/Button' export { FloatButton, type IFloatButtonProps } from './general/FloatButton/FloatButton' export { Icon, type IIconProps } from './general/Icon/Icon' -export { Rate, type IRateProps } from './data-entry/Rate/Rate' +export { Rate, type IRateProps } from './unused/Rate/Rate' export { Form, type IFormProps, type FormInstance } from './data-entry/Form/Form' export { TreeSelect, type ITreeSelectProps } from './data-entry/TreeSelect/TreeSelect' export { Select, type ISelectProps, type DefaultOptionType } from './data-entry/Select/Select' export { Mentions, type IMentionsProps } from './data-entry/Mentions/Mentions' export { Radio, type IRadioProps } from './data-entry/Radio/Radio' -export { ColorPicker, type IColorPickerProps } from './data-entry/ColorPicker/ColorPicker' +export { ColorPicker, type IColorPickerProps } from './unused/ColorPicker/ColorPicker' export { Slider, type ISliderProps } from './data-entry/Slider/Slider' export { Cascader, type ICascaderProps } from './data-entry/Cascader/Cascader' export { DatePicker, type IDatePickerProps } from './data-entry/DatePicker/DatePicker' @@ -26,17 +26,17 @@ export type { INumberInputProps } from './data-entry/QueryItem/NumberInput' export type { ITextInputProps } from './data-entry/QueryItem/TextInput' export { Collapse, type ICollapseProps } from './data-display/Collapse/Collapse' export { Timeline, type ITimelineProps } from './data-display/Timeline/Timeline' -export { Calendar, type ICalendarProps } from './data-display/Calendar/Calendar' +export { Calendar, type ICalendarProps } from './unused/Calendar/Calendar' export { Segmented, type ISegmentedProps } from './data-display/Segmented/Segmented' export { Tabs, type ITabsProps } from './data-display/Tabs/Tabs' export { Tag, type ITagProps } from './data-display/Tag/Tag' export { Tour, type ITourProps } from './data-display/Tour/Tour' -export { Carousel, type ICarouselProps } from './data-display/Carousel/Carousel' +export { Carousel, type ICarouselProps } from './unused/Carousel/Carousel' export { Tooltip, type ITooltipProps } from './data-display/Tooltip/Tooltip' export { Statistic, type IStatisticProps } from './data-display/Statistic/Statistic' export { Tree, type ITreeProps, type ITreeData } from './data-display/Tree/Tree' export { Image, type IImageProps } from './data-display/Image/Image' -export { QRCode, type IQRCodeProps } from './data-display/QRCode/QRCode' +export { QRCode, type IQRCodeProps } from './unused/QRCode/QRCode' export { Badge, type IBadgeProps } from './data-display/Badge/Badge' export { Card, type ICardProps } from './data-display/Card/Card' export { Avatar, type IAvatarProps } from './data-display/Avatar/Avatar' @@ -56,7 +56,7 @@ export { Progress, type IProgressProps } from './feedback/Progress/Progress' export { Result, type IResultProps } from './feedback/Result/Result' export { Spin, type ISpinProps } from './feedback/Spin/Spin' export { Skeleton, type ISkeletonProps } from './feedback/Skeleton/Skeleton' -export { Watermark, type IWatermarkProps } from './feedback/Watermark/Watermark' +export { Watermark, type IWatermarkProps } from './unused/Watermark/Watermark' export { Popconfirm, type IPopconfirmProps } from './feedback/Popconfirm/Popconfirm' export { Drawer, type IDrawerProps } from './feedback/Drawer/Drawer' export { Modal, type IModalProps } from './feedback/Modal/Modal' diff --git a/src/components/data-display/Calendar/Calendar.stories.tsx b/src/components/unused/Calendar/Calendar.stories.tsx similarity index 71% rename from src/components/data-display/Calendar/Calendar.stories.tsx rename to src/components/unused/Calendar/Calendar.stories.tsx index eb5d9b42e..14cd0424d 100644 --- a/src/components/data-display/Calendar/Calendar.stories.tsx +++ b/src/components/unused/Calendar/Calendar.stories.tsx @@ -1,9 +1,9 @@ import { type Meta, type StoryObj } from '@storybook/react' -import { Calendar } from 'src/components/data-display/Calendar/Calendar' +import { Calendar } from 'src/components/unused/Calendar/Calendar' import dayjs from 'dayjs' const meta: Meta = { - title: 'Components/Data Display/Calendar', + title: 'Components/Unused/Calendar', component: Calendar, args: { diff --git a/src/components/data-display/Calendar/Calendar.tsx b/src/components/unused/Calendar/Calendar.tsx similarity index 100% rename from src/components/data-display/Calendar/Calendar.tsx rename to src/components/unused/Calendar/Calendar.tsx diff --git a/src/components/data-display/Carousel/Carousel.stories.tsx b/src/components/unused/Carousel/Carousel.stories.tsx similarity index 97% rename from src/components/data-display/Carousel/Carousel.stories.tsx rename to src/components/unused/Carousel/Carousel.stories.tsx index f5a60633f..8beb9e703 100644 --- a/src/components/data-display/Carousel/Carousel.stories.tsx +++ b/src/components/unused/Carousel/Carousel.stories.tsx @@ -1,5 +1,5 @@ import { type Meta, type StoryObj } from '@storybook/react' -import { Carousel } from 'src/components/data-display/Carousel/Carousel' +import { Carousel } from 'src/components/unused/Carousel/Carousel' import { ExampleStory } from 'src/utils/ExampleStory' import { type RadioChangeEvent } from 'antd' import { type CarouselProps } from 'antd' @@ -16,7 +16,7 @@ const contentStyle: React.CSSProperties = { } const meta: Meta = { - title: 'Components/Data Display/Carousel', + title: 'Components/Unused/Carousel', component: props => (
diff --git a/src/components/data-display/Carousel/Carousel.tsx b/src/components/unused/Carousel/Carousel.tsx similarity index 100% rename from src/components/data-display/Carousel/Carousel.tsx rename to src/components/unused/Carousel/Carousel.tsx diff --git a/src/components/unused/ColorPicker/ColorPicker.stories.tsx b/src/components/unused/ColorPicker/ColorPicker.stories.tsx new file mode 100644 index 000000000..53ce1128d --- /dev/null +++ b/src/components/unused/ColorPicker/ColorPicker.stories.tsx @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react' +import { ColorPicker } from 'src/components/unused/ColorPicker/ColorPicker' + +const meta: Meta = { + title: 'Components/Unused/ColorPicker', + component: ColorPicker, + + args: {}, +} +export default meta + +type Story = StoryObj + +export const Primary: Story = {} diff --git a/src/components/data-entry/ColorPicker/ColorPicker.tsx b/src/components/unused/ColorPicker/ColorPicker.tsx similarity index 83% rename from src/components/data-entry/ColorPicker/ColorPicker.tsx rename to src/components/unused/ColorPicker/ColorPicker.tsx index bab2aa657..464c41340 100644 --- a/src/components/data-entry/ColorPicker/ColorPicker.tsx +++ b/src/components/unused/ColorPicker/ColorPicker.tsx @@ -1,5 +1,5 @@ import { ColorPicker as AntColorPicker } from 'antd' -import { type ColorPickerProps as AntColorPickerProps } from 'antd' +import type { ColorPickerProps as AntColorPickerProps } from 'antd' import { ConfigProvider } from 'src/components' export interface IColorPickerProps extends AntColorPickerProps {} diff --git a/src/components/unused/QRCode/QRCode.stories.tsx b/src/components/unused/QRCode/QRCode.stories.tsx new file mode 100644 index 000000000..2de41c37e --- /dev/null +++ b/src/components/unused/QRCode/QRCode.stories.tsx @@ -0,0 +1,14 @@ +import type { Meta, StoryObj } from '@storybook/react' +import { QRCode } from 'src/components/unused/QRCode/QRCode' + +const meta: Meta = { + title: 'Components/Unused/QRCode', + component: QRCode, + + args: {}, +} +export default meta + +type Story = StoryObj + +export const Primary: Story = {} diff --git a/src/components/data-display/QRCode/QRCode.tsx b/src/components/unused/QRCode/QRCode.tsx similarity index 100% rename from src/components/data-display/QRCode/QRCode.tsx rename to src/components/unused/QRCode/QRCode.tsx diff --git a/src/components/data-entry/Rate/Rate.stories.tsx b/src/components/unused/Rate/Rate.stories.tsx similarity index 50% rename from src/components/data-entry/Rate/Rate.stories.tsx rename to src/components/unused/Rate/Rate.stories.tsx index c30d5c763..844786ed5 100644 --- a/src/components/data-entry/Rate/Rate.stories.tsx +++ b/src/components/unused/Rate/Rate.stories.tsx @@ -1,8 +1,8 @@ -import { type Meta, type StoryObj } from '@storybook/react' -import { Rate } from 'src/components/data-entry/Rate/Rate' +import type { Meta, StoryObj } from '@storybook/react' +import { Rate } from 'src/components/unused/Rate/Rate' const meta: Meta = { - title: 'Components/Data Entry/Rate', + title: 'Components/Unused/Rate', component: Rate, args: {}, diff --git a/src/components/data-entry/Rate/Rate.tsx b/src/components/unused/Rate/Rate.tsx similarity index 83% rename from src/components/data-entry/Rate/Rate.tsx rename to src/components/unused/Rate/Rate.tsx index 37f43b982..5821b11f4 100644 --- a/src/components/data-entry/Rate/Rate.tsx +++ b/src/components/unused/Rate/Rate.tsx @@ -1,5 +1,5 @@ import { Rate as AntRate } from 'antd' -import { type RateProps as AntRateProps } from 'antd' +import type { RateProps as AntRateProps } from 'antd' import { ConfigProvider } from 'src/components' export interface IRateProps extends AntRateProps {} diff --git a/src/components/feedback/Watermark/Watermark.stories.tsx b/src/components/unused/Watermark/Watermark.stories.tsx similarity index 94% rename from src/components/feedback/Watermark/Watermark.stories.tsx rename to src/components/unused/Watermark/Watermark.stories.tsx index 1f0f083dd..f1c9aad9f 100644 --- a/src/components/feedback/Watermark/Watermark.stories.tsx +++ b/src/components/unused/Watermark/Watermark.stories.tsx @@ -1,11 +1,11 @@ -import { type Meta, type StoryObj } from '@storybook/react' -import { Watermark } from 'src/components/feedback/Watermark/Watermark' +import type { Meta, StoryObj } from '@storybook/react' +import { Watermark } from 'src/components/unused/Watermark/Watermark' import { ExampleStory } from 'src/utils/ExampleStory' import { Flex, Form } from 'src/components' import { type GetProp } from 'antd' import { useState } from 'react' import { type IColorPickerProps } from 'src/components' -import { type IWatermarkProps } from 'src/components/feedback/Watermark/Watermark' +import { type IWatermarkProps } from 'src/components/unused/Watermark/Watermark' import { InputNumber } from 'src/components' import { Typography } from 'src/components/general/Typography/Typography' import { Input } from 'src/components' @@ -16,7 +16,7 @@ import { Modal } from 'src/components' import { Drawer } from 'src/components' const meta: Meta = { - title: 'Components/Feedback/Watermark', + title: 'Components/Unused/Watermark', component: props => (
@@ -181,13 +181,23 @@ export const ExampleConfig: Story = { more natural. img