diff --git a/web/.cursor/rules/components_features_rules.mdc b/web/.cursor/rules/components_features_rules.mdc index d204ad31c..d592ea642 100644 --- a/web/.cursor/rules/components_features_rules.mdc +++ b/web/.cursor/rules/components_features_rules.mdc @@ -32,7 +32,7 @@ features/ - Handle their own state management when necessary - Be fully typed using TypeScript - Include proper documentation and props interface - - Have a corresponding Storybook story showcasing different states and variations + - Have a corresponding Storybook story showcasing different states and variations (The storybook should be titled Features/{feature_name}) 2. Components should be: - Reusable across different parts of the application @@ -45,9 +45,11 @@ features/ // features/PaginatedTable/PaginatedTable.tsx import { Table, Pagination } from '../ui'; -export const PaginatedTable: React.FC = (props) => { +export const PaginatedTable: React.FC = React.memo((props) => { // Implementation -}; +}); + +PaginatedTable.displayName = 'PaginatedTable'; ``` ## Best Practices diff --git a/web/src/components/ui/avatar/Avatar.stories.tsx b/web/src/components/ui/avatar/Avatar.stories.tsx index 44c6f63fb..13b18b14b 100644 --- a/web/src/components/ui/avatar/Avatar.stories.tsx +++ b/web/src/components/ui/avatar/Avatar.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Avatar } from './Avatar'; const meta = { - title: 'Base/Avatar', + title: 'UI/Avatar', component: Avatar, parameters: { layout: 'centered' diff --git a/web/src/components/ui/breadcrumb/Breadcrumb.stories.tsx b/web/src/components/ui/breadcrumb/Breadcrumb.stories.tsx index 220a35603..5e15e473e 100644 --- a/web/src/components/ui/breadcrumb/Breadcrumb.stories.tsx +++ b/web/src/components/ui/breadcrumb/Breadcrumb.stories.tsx @@ -3,7 +3,7 @@ import { Breadcrumb } from './Breadcrumb'; import { BusterAppRoutes } from '@/routes/busterRoutes/busterAppRoutes'; const meta: Meta = { - title: 'Base/Breadcrumb', + title: 'UI/Breadcrumb', component: Breadcrumb, tags: ['autodocs'], parameters: { diff --git a/web/src/components/ui/buttons/BackButton.stories.tsx b/web/src/components/ui/buttons/BackButton.stories.tsx index 40499860b..11746235e 100644 --- a/web/src/components/ui/buttons/BackButton.stories.tsx +++ b/web/src/components/ui/buttons/BackButton.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { BackButton } from './BackButton'; const meta: Meta = { - title: 'Base/Buttons/BackButton', + title: 'UI/Buttons/BackButton', component: BackButton, tags: ['autodocs'], argTypes: { diff --git a/web/src/components/ui/buttons/Button.stories.tsx b/web/src/components/ui/buttons/Button.stories.tsx index 50d917ae6..c050648f9 100644 --- a/web/src/components/ui/buttons/Button.stories.tsx +++ b/web/src/components/ui/buttons/Button.stories.tsx @@ -7,7 +7,7 @@ const IconSelect = Object.keys(OutlinedIcons).map((icon) => { }); const meta: Meta = { - title: 'Base/Buttons/Button', + title: 'UI/Buttons/Button', component: Button, tags: ['autodocs'], args: { diff --git a/web/src/components/ui/buttons/ButtonDropdown.stories.tsx b/web/src/components/ui/buttons/ButtonDropdown.stories.tsx index d5b5ece19..25dfeeb36 100644 --- a/web/src/components/ui/buttons/ButtonDropdown.stories.tsx +++ b/web/src/components/ui/buttons/ButtonDropdown.stories.tsx @@ -3,7 +3,7 @@ import { ButtonDropdown } from './ButtonDropdown'; import { PaintRoller } from '../icons/NucleoIconOutlined'; const meta: Meta = { - title: 'Base/Buttons/Button Dropdown', + title: 'UI/Buttons/Button Dropdown', component: ButtonDropdown, parameters: { layout: 'centered' diff --git a/web/src/components/ui/card/CardBase.stories.tsx b/web/src/components/ui/card/CardBase.stories.tsx index 9ef51bf1b..ac3d31754 100644 --- a/web/src/components/ui/card/CardBase.stories.tsx +++ b/web/src/components/ui/card/CardBase.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent } from './CardBase'; const meta = { - title: 'Base/Cards/Card', + title: 'UI/Cards/Card', component: Card, parameters: { layout: 'centered' diff --git a/web/src/components/ui/card/CodeCard.stories.tsx b/web/src/components/ui/card/CodeCard.stories.tsx index 751ec7120..c850c17af 100644 --- a/web/src/components/ui/card/CodeCard.stories.tsx +++ b/web/src/components/ui/card/CodeCard.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { CodeCard } from './CodeCard'; const meta: Meta = { - title: 'Base/Cards/CodeCard', + title: 'UI/Cards/CodeCard', component: CodeCard, parameters: { layout: 'centered' diff --git a/web/src/components/ui/card/InfoCard.stories.tsx b/web/src/components/ui/card/InfoCard.stories.tsx index 7f183946e..a41dcce19 100644 --- a/web/src/components/ui/card/InfoCard.stories.tsx +++ b/web/src/components/ui/card/InfoCard.stories.tsx @@ -4,7 +4,7 @@ import { BellOutlined } from '@ant-design/icons'; import { faker } from '@faker-js/faker'; const meta: Meta = { - title: 'Base/Cards/InfoCard', + title: 'UI/Cards/InfoCard', component: InfoCard, tags: ['autodocs'], args: { diff --git a/web/src/components/ui/charts/BusterChartLegend/stories/BusterChartLegend.stories.tsx b/web/src/components/ui/charts/BusterChartLegend/stories/BusterChartLegend.stories.tsx index eee322857..39e923516 100644 --- a/web/src/components/ui/charts/BusterChartLegend/stories/BusterChartLegend.stories.tsx +++ b/web/src/components/ui/charts/BusterChartLegend/stories/BusterChartLegend.stories.tsx @@ -3,7 +3,7 @@ import { BusterChartLegend } from '../BusterChartLegend'; import { ChartType } from '../../interfaces'; const meta: Meta = { - title: 'Base/Charts/BusterChartLegend', + title: 'UI/Charts/BusterChartLegend', component: BusterChartLegend, parameters: { layout: 'centered' diff --git a/web/src/components/ui/charts/BusterChartLegend/stories/LegendDot.stories.tsx b/web/src/components/ui/charts/BusterChartLegend/stories/LegendDot.stories.tsx index c653b8ad5..5f1975e9a 100644 --- a/web/src/components/ui/charts/BusterChartLegend/stories/LegendDot.stories.tsx +++ b/web/src/components/ui/charts/BusterChartLegend/stories/LegendDot.stories.tsx @@ -3,7 +3,7 @@ import { LegendItemDot } from '../LegendDot'; import { ChartType } from '../../interfaces'; const meta = { - title: 'Base/Charts/LegendDot', + title: 'UI/Charts/LegendDot', component: LegendItemDot, parameters: { layout: 'centered' diff --git a/web/src/components/ui/charts/BusterChartLegend/stories/LegendItem.stories.tsx b/web/src/components/ui/charts/BusterChartLegend/stories/LegendItem.stories.tsx index b26f53965..8ce2a8e62 100644 --- a/web/src/components/ui/charts/BusterChartLegend/stories/LegendItem.stories.tsx +++ b/web/src/components/ui/charts/BusterChartLegend/stories/LegendItem.stories.tsx @@ -3,7 +3,7 @@ import { LegendItem } from '../LegendItem'; import { ChartType } from '../../interfaces'; const meta = { - title: 'Base/Charts/LegendItem', + title: 'UI/Charts/LegendItem', component: LegendItem, parameters: { layout: 'centered' diff --git a/web/src/components/ui/charts/BusterChartLegend/stories/OverflowButton.stories.tsx b/web/src/components/ui/charts/BusterChartLegend/stories/OverflowButton.stories.tsx index 03a8807b9..3251e9d8d 100644 --- a/web/src/components/ui/charts/BusterChartLegend/stories/OverflowButton.stories.tsx +++ b/web/src/components/ui/charts/BusterChartLegend/stories/OverflowButton.stories.tsx @@ -3,7 +3,7 @@ import { OverflowButton } from '../OverflowContainer'; import { ChartType } from '../../interfaces'; const meta = { - title: 'Base/Charts/OverflowButton', + title: 'UI/Charts/OverflowButton', component: OverflowButton, parameters: { layout: 'centered' diff --git a/web/src/components/ui/charts/BusterChartTooltip/BusterChartTooltip.stories.tsx b/web/src/components/ui/charts/BusterChartTooltip/BusterChartTooltip.stories.tsx index 2262b96bd..15fed5e59 100644 --- a/web/src/components/ui/charts/BusterChartTooltip/BusterChartTooltip.stories.tsx +++ b/web/src/components/ui/charts/BusterChartTooltip/BusterChartTooltip.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { BusterChartTooltip } from './BusterChartTooltip'; const meta: Meta = { - title: 'Base/Charts/BusterChartTooltip', + title: 'UI/Charts/BusterChartTooltip', component: BusterChartTooltip, parameters: { layout: 'centered' diff --git a/web/src/components/ui/checkbox/Checkbox.stories.tsx b/web/src/components/ui/checkbox/Checkbox.stories.tsx index 3f01f7c6d..b6b90613d 100644 --- a/web/src/components/ui/checkbox/Checkbox.stories.tsx +++ b/web/src/components/ui/checkbox/Checkbox.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Checkbox } from './Checkbox'; const meta: Meta = { - title: 'Base/Inputs/Checkbox', + title: 'UI/Inputs/Checkbox', component: Checkbox, tags: ['autodocs'], argTypes: { diff --git a/web/src/components/ui/dropdown/Dropdown.stories.tsx b/web/src/components/ui/dropdown/Dropdown.stories.tsx index 85b54a53c..82abf85e1 100644 --- a/web/src/components/ui/dropdown/Dropdown.stories.tsx +++ b/web/src/components/ui/dropdown/Dropdown.stories.tsx @@ -6,7 +6,7 @@ import { faker } from '@faker-js/faker'; import React from 'react'; const meta: Meta = { - title: 'Base/Dropdowns/Dropdown', + title: 'UI/Dropdowns/Dropdown', component: Dropdown, parameters: { layout: 'centered' diff --git a/web/src/components/ui/dropdown/SearchDropdown.stories.tsx b/web/src/components/ui/dropdown/SearchDropdown.stories.tsx index 4dc8c5951..2cf789435 100644 --- a/web/src/components/ui/dropdown/SearchDropdown.stories.tsx +++ b/web/src/components/ui/dropdown/SearchDropdown.stories.tsx @@ -3,7 +3,7 @@ import { SearchDropdown } from './SearchDropdown'; import { User, MapSettings, Mailbox } from '../icons'; const meta: Meta = { - title: 'Base/Dropdowns/SearchDropdown', + title: 'UI/Dropdowns/SearchDropdown', component: SearchDropdown, parameters: { layout: 'centered' diff --git a/web/src/components/ui/error/GlobalErrorComponent.stories.tsx b/web/src/components/ui/error/GlobalErrorComponent.stories.tsx index 455abc463..0015b7f2a 100644 --- a/web/src/components/ui/error/GlobalErrorComponent.stories.tsx +++ b/web/src/components/ui/error/GlobalErrorComponent.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { GlobalErrorComponent } from './GlobalErrorComponent'; const meta: Meta = { - title: 'Base/Error/GlobalErrorComponent', + title: 'UI/Error/GlobalErrorComponent', component: GlobalErrorComponent, parameters: { layout: 'fullscreen' diff --git a/web/src/components/ui/grid/BusterResizeableGrid.stories.tsx b/web/src/components/ui/grid/BusterResizeableGrid.stories.tsx index 54fbbc5ed..cbf375ffc 100644 --- a/web/src/components/ui/grid/BusterResizeableGrid.stories.tsx +++ b/web/src/components/ui/grid/BusterResizeableGrid.stories.tsx @@ -9,7 +9,7 @@ import { Hand } from '../icons'; import { cn } from '@/lib/classMerge'; const meta: Meta = { - title: 'Base/Grid/BusterResizeableGrid', + title: 'UI/Grid/BusterResizeableGrid', component: BusterResizeableGrid, parameters: { layout: 'padded' diff --git a/web/src/components/ui/icons/AppDataSourceIcons.stories.tsx b/web/src/components/ui/icons/AppDataSourceIcons.stories.tsx index 83cdf615a..70b968bf5 100644 --- a/web/src/components/ui/icons/AppDataSourceIcons.stories.tsx +++ b/web/src/components/ui/icons/AppDataSourceIcons.stories.tsx @@ -3,7 +3,7 @@ import { AppDataSourceIcon } from './AppDataSourceIcons'; import { DataSourceTypes } from '@/api/asset_interfaces'; const meta: Meta = { - title: 'Base/Icons/DataSourceIcon', + title: 'UI/Icons/DataSourceIcon', component: AppDataSourceIcon, parameters: { layout: 'centered' diff --git a/web/src/components/ui/indicators/StatusIndicator.stories.tsx b/web/src/components/ui/indicators/StatusIndicator.stories.tsx index 26fa26ecf..76477def4 100644 --- a/web/src/components/ui/indicators/StatusIndicator.stories.tsx +++ b/web/src/components/ui/indicators/StatusIndicator.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { StatusIndicator } from './StatusIndicator'; const meta = { - title: 'Base/StatusIndicator', + title: 'UI/StatusIndicator', component: StatusIndicator, parameters: { layout: 'centered' diff --git a/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.stories.tsx b/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.stories.tsx index 55b7495e7..d538e8fd4 100644 --- a/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.stories.tsx +++ b/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { AppCodeEditor } from './AppCodeEditor'; const meta: Meta = { - title: 'Base/Inputs/AppCodeEditor', + title: 'UI/Inputs/AppCodeEditor', component: AppCodeEditor, parameters: { layout: 'centered' diff --git a/web/src/components/ui/inputs/Input.stories.tsx b/web/src/components/ui/inputs/Input.stories.tsx index f2a7cb446..4a132286e 100644 --- a/web/src/components/ui/inputs/Input.stories.tsx +++ b/web/src/components/ui/inputs/Input.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { Input } from './Input'; const meta: Meta = { - title: 'Base/Inputs/Input', + title: 'UI/Inputs/Input', component: Input, tags: ['autodocs'], argTypes: { diff --git a/web/src/components/ui/inputs/InputTextArea.stories.tsx b/web/src/components/ui/inputs/InputTextArea.stories.tsx index 983c18fe3..9aa47fb29 100644 --- a/web/src/components/ui/inputs/InputTextArea.stories.tsx +++ b/web/src/components/ui/inputs/InputTextArea.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { InputTextArea } from './InputTextArea'; const meta: Meta = { - title: 'Base/Inputs/InputTextArea', + title: 'UI/Inputs/InputTextArea', component: InputTextArea, tags: ['autodocs'], args: { diff --git a/web/src/components/ui/inputs/InputTextAreaButton.stories.tsx b/web/src/components/ui/inputs/InputTextAreaButton.stories.tsx index e6de92b0b..3d8c9b161 100644 --- a/web/src/components/ui/inputs/InputTextAreaButton.stories.tsx +++ b/web/src/components/ui/inputs/InputTextAreaButton.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { InputTextAreaButton } from './InputTextAreaButton'; const meta: Meta = { - title: 'Base/Inputs/InputTextAreaButton', + title: 'UI/Inputs/InputTextAreaButton', component: InputTextAreaButton, tags: ['autodocs'], args: {}, diff --git a/web/src/components/ui/layout/AppSplitter/AppSplitter.stories.tsx b/web/src/components/ui/layout/AppSplitter/AppSplitter.stories.tsx index 162ac4427..360c7d691 100644 --- a/web/src/components/ui/layout/AppSplitter/AppSplitter.stories.tsx +++ b/web/src/components/ui/layout/AppSplitter/AppSplitter.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { AppSplitter } from './AppSplitter'; const meta = { - title: 'Base/Layouts/AppSplitter', + title: 'UI/Layouts/AppSplitter', component: AppSplitter, parameters: { layout: 'fullscreen' diff --git a/web/src/components/ui/layout/AppVerticalSplitterWithGap/AppVerticalSplitterWithGap.stories.tsx b/web/src/components/ui/layout/AppVerticalSplitterWithGap/AppVerticalSplitterWithGap.stories.tsx index 270d6fa83..1d9a03170 100644 --- a/web/src/components/ui/layout/AppVerticalSplitterWithGap/AppVerticalSplitterWithGap.stories.tsx +++ b/web/src/components/ui/layout/AppVerticalSplitterWithGap/AppVerticalSplitterWithGap.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { AppVerticalSplitterWithGap } from './AppVerticalSplitterWithGap'; const meta: Meta = { - title: 'Base/Layouts/AppVerticalSplitterWithGap', + title: 'UI/Layouts/AppVerticalSplitterWithGap', component: AppVerticalSplitterWithGap, parameters: { layout: 'fullscreen' diff --git a/web/src/components/ui/pills/KeyboardShortcutPills.stories.tsx b/web/src/components/ui/pills/KeyboardShortcutPills.stories.tsx index 59309c227..d28d7e6a8 100644 --- a/web/src/components/ui/pills/KeyboardShortcutPills.stories.tsx +++ b/web/src/components/ui/pills/KeyboardShortcutPills.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { KeyboardShortcutPill } from './KeyboardShortcutPills'; const meta: Meta = { - title: 'Base/Pills/KeyboardShortcutPill', + title: 'UI/Pills/KeyboardShortcutPill', component: KeyboardShortcutPill, tags: ['autodocs'] }; diff --git a/web/src/components/ui/segmented/Segmented.stories.tsx b/web/src/components/ui/segmented/Segmented.stories.tsx index 04f49b704..2121156a4 100644 --- a/web/src/components/ui/segmented/Segmented.stories.tsx +++ b/web/src/components/ui/segmented/Segmented.stories.tsx @@ -3,7 +3,7 @@ import { Segmented } from './Segmented'; import { BottleChampagne, Grid, HouseModern, PaintRoller } from '../icons'; const meta: Meta = { - title: 'Base/Segmented', + title: 'UI/Segmented', component: Segmented, parameters: { layout: 'centered' diff --git a/web/src/components/ui/select/Select.stories.tsx b/web/src/components/ui/select/Select.stories.tsx index 5b3fa8e3f..49e5a87db 100644 --- a/web/src/components/ui/select/Select.stories.tsx +++ b/web/src/components/ui/select/Select.stories.tsx @@ -3,7 +3,7 @@ import { Select } from './Select'; import { User, MapSettings, Mailbox } from '../icons'; const meta: Meta = { - title: 'Base/Select/Select', + title: 'UI/Select/Select', component: Select, parameters: { layout: 'centered' diff --git a/web/src/components/ui/select/SelectTagInput.stories.tsx b/web/src/components/ui/select/SelectTagInput.stories.tsx index de9e36eda..f5b13774f 100644 --- a/web/src/components/ui/select/SelectTagInput.stories.tsx +++ b/web/src/components/ui/select/SelectTagInput.stories.tsx @@ -4,7 +4,7 @@ import { useState } from 'react'; import { type SelectItem } from './Select'; const meta = { - title: 'Base/Select/SelectTagInput', + title: 'UI/Select/SelectTagInput', component: SelectTagInput, parameters: { layout: 'centered' diff --git a/web/src/components/ui/switch/AppSwitch.stories.tsx b/web/src/components/ui/switch/AppSwitch.stories.tsx index 9356ac39f..6b49f16b0 100644 --- a/web/src/components/ui/switch/AppSwitch.stories.tsx +++ b/web/src/components/ui/switch/AppSwitch.stories.tsx @@ -2,7 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'; import { AppSwitch } from './AppSwitch'; const meta: Meta = { - title: 'Base/Inputs/Switch', + title: 'UI/Inputs/Switch', component: AppSwitch, tags: ['autodocs'], argTypes: { diff --git a/web/src/components/ui/toaster/Toaster.stories.tsx b/web/src/components/ui/toaster/Toaster.stories.tsx index b82228ae3..ac623481f 100644 --- a/web/src/components/ui/toaster/Toaster.stories.tsx +++ b/web/src/components/ui/toaster/Toaster.stories.tsx @@ -70,7 +70,7 @@ const TestComponent = ({ }; const meta: Meta = { - title: 'Base/Toast', + title: 'UI/Toast', component: TestComponent, tags: ['autodocs'], argTypes: { diff --git a/web/src/components/ui/tooltip/Popover.stories.tsx b/web/src/components/ui/tooltip/Popover.stories.tsx index f7f0ce61c..ae9e2f3e5 100644 --- a/web/src/components/ui/tooltip/Popover.stories.tsx +++ b/web/src/components/ui/tooltip/Popover.stories.tsx @@ -3,7 +3,7 @@ import { Popover } from './Popover'; import { Button } from '../buttons/Button'; const meta = { - title: 'Base/Tooltip/Popover', + title: 'UI/Tooltip/Popover', component: Popover, tags: ['autodocs'], parameters: { diff --git a/web/src/components/ui/tooltip/Tooltip.stories.tsx b/web/src/components/ui/tooltip/Tooltip.stories.tsx index 9b7435dc2..e40bf4464 100644 --- a/web/src/components/ui/tooltip/Tooltip.stories.tsx +++ b/web/src/components/ui/tooltip/Tooltip.stories.tsx @@ -3,7 +3,7 @@ import { Button } from '../buttons/Button'; import { Tooltip } from './Tooltip'; const meta = { - title: 'Base/Tooltip', + title: 'UI/Tooltip', component: Tooltip, parameters: { layout: 'centered'