Skip to content

Commit

Permalink
docs: moved some components to unused folder (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibuurcio authored Oct 18, 2024
1 parent 1978e65 commit 7a51472
Show file tree
Hide file tree
Showing 26 changed files with 284 additions and 52 deletions.
15 changes: 13 additions & 2 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
3 changes: 3 additions & 0 deletions docs/UX Patterns/Directory.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Directory

TBD
1 change: 1 addition & 0 deletions docs/UX Patterns/Table/Cell Badge.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions docs/UX Patterns/Table/Cell Link.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![](../../assets/test.png)
18 changes: 18 additions & 0 deletions docs/UX Patterns/Table/Cell More Actions.mdx
Original file line number Diff line number Diff line change
@@ -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.

<iframe width="1143" height="8208" src="https://www.figma.com/embed?embed_host=your-site.com&url=https://www.figma.com/design/yCPszaTtkCFxRHaSkkJFR9/Eames-Templates-%5BInternal%5D?node-id=2146-40220" allowfullscreen></iframe>




#### 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)

1 change: 1 addition & 0 deletions docs/UX Patterns/Table/Cell Tag.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

53 changes: 53 additions & 0 deletions docs/UX Patterns/Table/Documentation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { Meta, Story } from '@storybook/blocks';

{/* // import * as TableStories from './Table.stories'; */}

{/* <Meta of={TableStories.default} /> */}

{/* <Story of={TableStories.default} /> */}

# 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)

<img src="images/basic-table.png" />
20 changes: 20 additions & 0 deletions docs/UX Patterns/Table/Filters.mdx
Original file line number Diff line number Diff line change
@@ -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)
94 changes: 94 additions & 0 deletions docs/UX Patterns/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
@@ -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<DataType>['columns'] = [
{
title: 'Name',
dataIndex: 'name',
key: 'name',
render: text => <a>{text}</a>,
},
{
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 color={color} key={tag}>
{tag.toUpperCase()}
</Tag>
)
})}
</>
),
},
{
title: 'Action',
key: 'action',
render: (_, record) => (
<Space size="middle">
<a>Invite {record.name}</a>
<a>Delete</a>
</Space>
),
},
]

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<typeof Table> = {
title: 'UX Patterns/Table',
component: () => <Table<DataType> columns={columns} dataSource={data} />,

args: {},
}

export default meta
17 changes: 17 additions & 0 deletions docs/UX Patterns/Table/Tags.mdx
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions docs/components/Unused/Documentation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Unused components

The following components are not used in mParticle but can still be browsed if needed.
14 changes: 0 additions & 14 deletions src/components/data-display/QRCode/QRCode.stories.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/components/data-entry/ColorPicker/ColorPicker.stories.tsx

This file was deleted.

12 changes: 6 additions & 6 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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'
Expand All @@ -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'
Expand Down
Original file line number Diff line number Diff line change
@@ -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<typeof Calendar> = {
title: 'Components/Data Display/Calendar',
title: 'Components/Unused/Calendar',
component: Calendar,

args: {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -16,7 +16,7 @@ const contentStyle: React.CSSProperties = {
}

const meta: Meta<typeof Carousel> = {
title: 'Components/Data Display/Carousel',
title: 'Components/Unused/Carousel',
component: props => (
<Carousel {...props} style={{ maxWidth: '800px' }}>
<div>
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions src/components/unused/ColorPicker/ColorPicker.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/react'
import { ColorPicker } from 'src/components/unused/ColorPicker/ColorPicker'

const meta: Meta<typeof ColorPicker> = {
title: 'Components/Unused/ColorPicker',
component: ColorPicker,

args: {},
}
export default meta

type Story = StoryObj<typeof ColorPicker>

export const Primary: Story = {}
Original file line number Diff line number Diff line change
@@ -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 {}
Expand Down
14 changes: 14 additions & 0 deletions src/components/unused/QRCode/QRCode.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { Meta, StoryObj } from '@storybook/react'
import { QRCode } from 'src/components/unused/QRCode/QRCode'

const meta: Meta<typeof QRCode> = {
title: 'Components/Unused/QRCode',
component: QRCode,

args: {},
}
export default meta

type Story = StoryObj<typeof QRCode>

export const Primary: Story = {}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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<typeof Rate> = {
title: 'Components/Data Entry/Rate',
title: 'Components/Unused/Rate',
component: Rate,

args: {},
Expand Down
Loading

0 comments on commit 7a51472

Please sign in to comment.