From 8f0035aeeff100c460f278aadd899e63eeb479fb Mon Sep 17 00:00:00 2001 From: Dan Rukas Date: Tue, 8 Oct 2024 12:25:44 -0400 Subject: [PATCH] ui(component): Adds flexible DataRow component (#4399) --- .../src/_pages/patterns-measurements.tsx | 171 +++++ .../src/_pages/patterns-panelsplit.tsx | 43 ++ .../src/_pages/patterns-segmentations.tsx | 316 +++++++++ platform/ui-next/src/_pages/patterns.tsx | 309 ++++++++- platform/ui-next/src/_pages/playground.tsx | 16 +- .../src/_prototypes/DataRow/DataRow.tsx | 196 ++++++ .../_prototypes/DataRow/actionOptionsMap.ts | 11 + .../src/_prototypes/DataRow/dataList.json | 200 ++++++ .../ui-next/src/_prototypes/DataRow/index.ts | 0 .../ui-next/src/_prototypes/DataRow/types.ts | 15 + .../src/components/Accordion/Accordion.tsx | 2 +- .../components/DropdownMenu/DropdownMenu.tsx | 4 +- .../ui-next/src/components/Icons/Icons.tsx | 630 +++++++++++++++++- .../src/components/Tooltip/Tooltip.tsx | 2 +- platform/ui-next/src/tailwind.css | 2 +- 15 files changed, 1890 insertions(+), 27 deletions(-) create mode 100644 platform/ui-next/src/_pages/patterns-measurements.tsx create mode 100644 platform/ui-next/src/_pages/patterns-panelsplit.tsx create mode 100644 platform/ui-next/src/_pages/patterns-segmentations.tsx create mode 100644 platform/ui-next/src/_prototypes/DataRow/DataRow.tsx create mode 100644 platform/ui-next/src/_prototypes/DataRow/actionOptionsMap.ts create mode 100644 platform/ui-next/src/_prototypes/DataRow/dataList.json create mode 100644 platform/ui-next/src/_prototypes/DataRow/index.ts create mode 100644 platform/ui-next/src/_prototypes/DataRow/types.ts diff --git a/platform/ui-next/src/_pages/patterns-measurements.tsx b/platform/ui-next/src/_pages/patterns-measurements.tsx new file mode 100644 index 000000000..50353fd90 --- /dev/null +++ b/platform/ui-next/src/_pages/patterns-measurements.tsx @@ -0,0 +1,171 @@ +// src/_pages/patterns.tsx + +import React, { useState } from 'react'; +import { createRoot } from 'react-dom/client'; +import '../tailwind.css'; + +import { Button } from '../components/Button'; +import { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} from '../components/Select'; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuLabel, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, + DropdownMenuPortal, +} from '../components/DropdownMenu'; +import { Icons } from '../components/Icons/Icons'; +import DataRow from '../_prototypes/DataRow/DataRow'; +import dataList from '../_prototypes/DataRow/dataList.json'; +import actionOptionsMap from '../_prototypes/DataRow/actionOptionsMap'; +import { + Accordion, + AccordionItem, + AccordionTrigger, + AccordionContent, +} from '../components/Accordion/Accordion'; +import { Slider } from '../components/Slider'; +import { Switch } from '../components/Switch'; +import { Label } from '../components/Label'; +import { Input } from '../components/Input'; +import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; + +import { ChevronDownIcon } from '@radix-ui/react-icons'; + +interface DataItem { + id: number; + title: string; + description: string; + optionalField?: string; + colorHex?: string; + details?: string; + series?: string; +} + +interface ListGroup { + type: string; + items: DataItem[]; +} + +function Patterns() { + const [selectedRowId, setSelectedRowId] = useState(null); + const handleAction = (id: string, action: string) => { + console.log(`Action "${action}" triggered for item with id: ${id}`); + // Implement actual action logic here + }; + const handleRowSelect = (id: string) => { + setSelectedRowId(prevSelectedId => (prevSelectedId === id ? null : id)); + }; + + const organSegmentationGroup = dataList.find( + (listGroup: ListGroup) => listGroup.type === 'Organ Segmentation' + ); + const roiToolsGroup = dataList.find((listGroup: ListGroup) => listGroup.type === 'ROI Tools'); + + if (!organSegmentationGroup) { + return
Organ Segmentation data not found.
; + } + + if (!roiToolsGroup) { + return
ROI Tools data not found.
; + } + + return ( +
+ {/* Simulated Panel List for "Segmentation" */} +
+ + {/* Segmentation Tools */} + + + Measurements + + +
+
2024-Jan-01
+
+ Study title lorem ipsum +
+
+ +
+
+ + +
+
+
+ {roiToolsGroup.items.map((item, index) => { + const compositeId = `${roiToolsGroup.type}-${item.id}-panel`; // Ensure unique composite ID + return ( + handleAction(compositeId, action)} + isSelected={selectedRowId === compositeId} + onSelect={() => handleRowSelect(compositeId)} + /> + ); + })} +
+
+
+ + {/* Additional Findings */} + + + Additional Findings + + +
+
+
+
+
+
+ ); +} + +const container = document.getElementById('root'); +const root = createRoot(container!); +root.render(); diff --git a/platform/ui-next/src/_pages/patterns-panelsplit.tsx b/platform/ui-next/src/_pages/patterns-panelsplit.tsx new file mode 100644 index 000000000..06f322107 --- /dev/null +++ b/platform/ui-next/src/_pages/patterns-panelsplit.tsx @@ -0,0 +1,43 @@ +// src/_pages/patterns.tsx + +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import '../tailwind.css'; + +// component imports +import { Button } from '../components/Button'; +import { Input } from '../components/Input'; +import { Label } from '../components/Label'; +import { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} from '../components/Select'; +import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; +import Separator from '../components/Separator'; +import { Switch } from '../components/Switch'; +import { Checkbox } from '../components/Checkbox'; +import { Toggle, toggleVariants } from '../components/Toggle'; +import { Slider } from '../components/Slider'; +import { ScrollArea, ScrollBar } from '../components/ScrollArea'; +import { PanelSplit } from '../_prototypes/PanelSplit'; // Updated import path + +function Patterns() { + return ( +
+
Patterns 1
+ ; +
+ ); +} + +const container = document.getElementById('root'); +const root = createRoot(container); +root.render(React.createElement(Patterns)); diff --git a/platform/ui-next/src/_pages/patterns-segmentations.tsx b/platform/ui-next/src/_pages/patterns-segmentations.tsx new file mode 100644 index 000000000..2070cbd88 --- /dev/null +++ b/platform/ui-next/src/_pages/patterns-segmentations.tsx @@ -0,0 +1,316 @@ +import React, { useState } from 'react'; +import { createRoot } from 'react-dom/client'; +import '../tailwind.css'; + +import { Button } from '../components/Button'; +import { + Select, + SelectGroup, + SelectValue, + SelectTrigger, + SelectContent, + SelectLabel, + SelectItem, + SelectSeparator, + SelectScrollUpButton, + SelectScrollDownButton, +} from '../components/Select'; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuLabel, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, + DropdownMenuPortal, +} from '../components/DropdownMenu'; +import { Icons } from '../components/Icons/Icons'; +import DataRow from '../_prototypes/DataRow/DataRow'; +import dataList from '../_prototypes/DataRow/dataList.json'; +import actionOptionsMap from '../_prototypes/DataRow/actionOptionsMap'; +import { + Accordion, + AccordionItem, + AccordionTrigger, + AccordionContent, +} from '../components/Accordion/Accordion'; +import { Slider } from '../components/Slider'; +import { Switch } from '../components/Switch'; +import { Label } from '../components/Label'; +import { Input } from '../components/Input'; +import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; + +import { ChevronDownIcon } from '@radix-ui/react-icons'; + +interface DataItem { + id: number; + title: string; + description: string; + optionalField?: string; + colorHex?: string; + details?: string; + series?: string; +} + +interface ListGroup { + type: string; + items: DataItem[]; +} + +function Patterns() { + const [selectedRowId, setSelectedRowId] = useState(null); + const [selectedTab, setSelectedTab] = useState('Fill & Outline'); + const handleAction = (id: string, action: string) => { + console.log(`Action "${action}" triggered for item with id: ${id}`); + // Implement actual action logic here + }; + + // Handle row selection + const handleRowSelect = (id: string) => { + setSelectedRowId(prevSelectedId => (prevSelectedId === id ? null : id)); + }; + + const organSegmentationGroup = dataList.find( + (listGroup: ListGroup) => listGroup.type === 'Organ Segmentation' + ); + + if (!organSegmentationGroup) { + return
Organ Segmentation data not found.
; + } + + return ( +
+
+ + {/* Segmentation Tools */} + + + Segmentation Tools + + +
+
+
+ + {/* Segmentation List */} + + + Segmentation List + + +
+ {/* Header Controls */} +
+ + + + + + + + Create New Segmentation + + + Current Segmentation + + + Rename + + + + Delete + + + + + Export & Download + + + + Export DICOM SEG + Download DICOM SEG + Download DICOM RTSTRUCT + + + + + + + +
+ + {/* Appearance Settings */} + + +
+ + Appearance Settings +
+
+ +
+
+ {/* Display Label with Selected Tab */} +
Show: {selectedTab}
+ {/* Tabs Controls */} + + + + + + + + + + + + + +
+ {/* Opacity Slider */} +
+ + + +
+ {/* Border Slider */} +
+ + + +
+ {/* Sync Changes Switch */} +
+ + +
+
+ {/* Display Inactive Segmentations Switch */} +
+ + +
+ {/* Additional Opacity Slider */} +
+ + + +
+
+
+
+ {/* Action Buttons */} +
+ + +
+
+ + {/* Data Rows */} +
+ {organSegmentationGroup.items.map((item, index) => { + const compositeId = `${organSegmentationGroup.type}-${item.id}-panel`; + return ( + handleAction(compositeId, action)} + isSelected={selectedRowId === compositeId} + onSelect={() => handleRowSelect(compositeId)} + /> + ); + })} +
+
+
+
+
+
+ ); +} + +const container = document.getElementById('root'); +const root = createRoot(container!); +root.render(); diff --git a/platform/ui-next/src/_pages/patterns.tsx b/platform/ui-next/src/_pages/patterns.tsx index 06f322107..8a14075b4 100644 --- a/platform/ui-next/src/_pages/patterns.tsx +++ b/platform/ui-next/src/_pages/patterns.tsx @@ -1,13 +1,8 @@ -// src/_pages/patterns.tsx - -import React from 'react'; +import React, { useState } from 'react'; import { createRoot } from 'react-dom/client'; import '../tailwind.css'; -// component imports import { Button } from '../components/Button'; -import { Input } from '../components/Input'; -import { Label } from '../components/Label'; import { Select, SelectGroup, @@ -20,24 +15,302 @@ import { SelectScrollUpButton, SelectScrollDownButton, } from '../components/Select'; -import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; -import Separator from '../components/Separator'; -import { Switch } from '../components/Switch'; -import { Checkbox } from '../components/Checkbox'; -import { Toggle, toggleVariants } from '../components/Toggle'; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuSeparator, + DropdownMenuLabel, + DropdownMenuSub, + DropdownMenuSubTrigger, + DropdownMenuSubContent, + DropdownMenuPortal, +} from '../components/DropdownMenu'; +import { Icons } from '../components/Icons/Icons'; +import DataRow from '../_prototypes/DataRow/DataRow'; +import dataList from '../_prototypes/DataRow/dataList.json'; +import actionOptionsMap from '../_prototypes/DataRow/actionOptionsMap'; +import { + Accordion, + AccordionItem, + AccordionTrigger, + AccordionContent, +} from '../components/Accordion/Accordion'; import { Slider } from '../components/Slider'; -import { ScrollArea, ScrollBar } from '../components/ScrollArea'; -import { PanelSplit } from '../_prototypes/PanelSplit'; // Updated import path +import { Switch } from '../components/Switch'; +import { Label } from '../components/Label'; +import { Input } from '../components/Input'; +import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; + +import { ChevronDownIcon } from '@radix-ui/react-icons'; + +interface DataItem { + id: number; + title: string; + description: string; + optionalField?: string; + colorHex?: string; + details?: string; + series?: string; +} + +interface ListGroup { + type: string; + items: DataItem[]; +} function Patterns() { + const [selectedRowId, setSelectedRowId] = useState(null); + const [selectedTab, setSelectedTab] = useState('Fill & Outline'); + const handleAction = (id: string, action: string) => { + console.log(`Action "${action}" triggered for item with id: ${id}`); + // Implement actual action logic here + }; + + // Handle row selection + const handleRowSelect = (id: string) => { + setSelectedRowId(prevSelectedId => (prevSelectedId === id ? null : id)); + }; + + const organSegmentationGroup = dataList.find( + (listGroup: ListGroup) => listGroup.type === 'Organ Segmentation' + ); + + if (!organSegmentationGroup) { + return
Organ Segmentation data not found.
; + } + return ( -
-
Patterns 1
- ; +
+
+ + {/* Segmentation Tools */} + + + Segmentation Tools + + +
+
+
+ + {/* Segmentation List */} + + + Segmentation List + + +
+ {/* Header Controls */} +
+ + + + + + + + Create New Segmentation + + + Current Segmentation + + + Rename + + + + Delete + + + + + Export & Download + + + + Export DICOM SEG + Download DICOM SEG + Download DICOM RTSTRUCT + + + + + + + +
+ + {/* Appearance Settings */} + + +
+ + Appearance Settings +
+
+ +
+
+ {/* Display Label with Selected Tab */} +
Show: {selectedTab}
+ {/* Tabs Controls */} + + + + + + + + + + + + + +
+ {/* Opacity Slider */} +
+ + + +
+ {/* Border Slider */} +
+ + + +
+ {/* Sync Changes Switch */} +
+ + +
+
+ {/* Display Inactive Segmentations Switch */} +
+ + +
+ {/* Additional Opacity Slider */} +
+ + + +
+
+
+
+ {/* Action Buttons */} +
+ + +
+
+ + {/* Data Rows */} +
+ {organSegmentationGroup.items.map((item, index) => { + const compositeId = `${organSegmentationGroup.type}-${item.id}-panel`; // Ensure unique composite ID + return ( + handleAction(compositeId, action)} + isSelected={selectedRowId === compositeId} + onSelect={() => handleRowSelect(compositeId)} + /> + ); + })} +
+
+
+
+
); } const container = document.getElementById('root'); -const root = createRoot(container); -root.render(React.createElement(Patterns)); +const root = createRoot(container!); +root.render(); diff --git a/platform/ui-next/src/_pages/playground.tsx b/platform/ui-next/src/_pages/playground.tsx index 155468249..5cac2e10d 100644 --- a/platform/ui-next/src/_pages/playground.tsx +++ b/platform/ui-next/src/_pages/playground.tsx @@ -18,7 +18,7 @@ import { SelectScrollDownButton, } from '../components/Select'; import { Tabs, TabsList, TabsTrigger, TabsContent } from '../components/Tabs'; -import Separator from '../components/Separator'; +import { Separator } from '../components/Separator'; import { Switch } from '../components/Switch'; import { Checkbox } from '../components/Checkbox'; import { Toggle, toggleVariants } from '../components/Toggle'; @@ -374,6 +374,20 @@ export default function Playground() {
+

Accordion

+
+
+
+ +
+
+
+

Scroll Area

diff --git a/platform/ui-next/src/_prototypes/DataRow/DataRow.tsx b/platform/ui-next/src/_prototypes/DataRow/DataRow.tsx new file mode 100644 index 000000000..c2419f84e --- /dev/null +++ b/platform/ui-next/src/_prototypes/DataRow/DataRow.tsx @@ -0,0 +1,196 @@ +import React, { useState } from 'react'; +import { Button } from '../../components/Button/Button'; +import { + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, +} from '../../components/DropdownMenu'; +import { Icons } from '../../components/Icons/Icons'; +import { + Tooltip, + TooltipTrigger, + TooltipContent, + TooltipProvider, +} from '../../components/Tooltip/Tooltip'; + +interface DataRowProps { + number: number; + title: string; + description: string; + optionalField?: string; + colorHex?: string; + details?: string; + series?: string; + actionOptions: string[]; + onAction: (action: string) => void; + isSelected?: boolean; + onSelect?: () => void; +} + +const DataRow: React.FC = ({ + number, + title, + description, + optionalField, + colorHex, + details, + series, + actionOptions, + onAction, + isSelected = false, + onSelect, +}) => { + const [isDropdownOpen, setIsDropdownOpen] = useState(false); + const [isVisible, setIsVisible] = useState(true); + const isTitleLong = title.length > 25; + + return ( + + {' '} + {/* Ensure TooltipProvider wraps the component */} +
+ {/* Row 1 with 'group' class to enable group-hover */} +
+ {/* Hover Overlay */} +
+ + {/* Number Box */} +
+ {number} +
+ + {/* Color Circle (Optional) */} + {colorHex && ( +
+ +
+ )} + + {/* Label with Conditional Tooltip */} +
+ {isTitleLong ? ( + + + + {title} + + + + {title} + + + ) : ( + + {title} + + )} +
+ + {/* Actions and Visibility Toggle */} +
+ {/* Visibility Toggle Icon */} + {isVisible ? ( + + ) : ( + + )} + + {/* Actions Dropdown Menu */} + setIsDropdownOpen(open)}> + + + + + + + Rename + + + + Lock + + + + Delete + + + +
+
+ + {/* Row 2 (Details and Series) */} + {(details || series) && ( +
+ {/* Updated Flex Container: Changed 'items-center' to 'items-start' */} +
+ {details} + {series && {series}} +
+
+ )} +
+
+ ); +}; + +export default DataRow; diff --git a/platform/ui-next/src/_prototypes/DataRow/actionOptionsMap.ts b/platform/ui-next/src/_prototypes/DataRow/actionOptionsMap.ts new file mode 100644 index 000000000..1e24d7731 --- /dev/null +++ b/platform/ui-next/src/_prototypes/DataRow/actionOptionsMap.ts @@ -0,0 +1,11 @@ +// src/_prototypes/DataRow/actionOptionsMap.ts + +const actionOptionsMap: { [key: string]: string[] } = { + Measurement: ['Rename', 'Lock', 'Delete'], + Segmentation: ['Rename', 'Lock', 'Export', 'Delete'], + 'ROI Tools': ['Rename', 'Lock', 'Delete'], + 'Organ Segmentation': ['Rename', 'Lock', 'Export', 'Delete'], + // Add more types and their corresponding actions as needed +}; + +export default actionOptionsMap; diff --git a/platform/ui-next/src/_prototypes/DataRow/dataList.json b/platform/ui-next/src/_prototypes/DataRow/dataList.json new file mode 100644 index 000000000..2e4d230cb --- /dev/null +++ b/platform/ui-next/src/_prototypes/DataRow/dataList.json @@ -0,0 +1,200 @@ +[ + { + "type": "Measurement", + "items": [ + { + "id": 1, + "title": "Measurement Label", + "description": "Description for Measurement One.", + "optionalField": "Optional Info 1", + "details": "Data" + }, + { + "id": 2, + "title": "Measurement Label", + "description": "Description for Measurement Two.", + "details": "Data" + } + ] + }, + { + "type": "Segmentation", + "items": [ + { + "id": 3, + "title": "Segmentation One", + "colorHex": "#FF5733", + "description": "Description for Segmentation One." + }, + { + "id": 4, + "title": "Segmentation Two", + "colorHex": "#FF5733", + "description": "Description for Segmentation Two." + }, + { + "id": 5, + "title": "Segmentation Three", + "colorHex": "#FF5733", + "description": "Description for Segmentation Three." + } + ] + }, + { + "type": "ROI Tools", + "items": [ + { + "id": 6, + "title": "Linear", + "description": "Description for Linear.", + "details": "49.2 mm", + "series": "S:2 I:1" + }, + { + "id": 7, + "title": "Bidirectional", + "description": "Description for Bidirectional.", + "details": "L: 34.5 mm\nW: 23.0 mm", + "series": "S:2 I:2" + }, + { + "id": 8, + "title": "Ellipse", + "description": "Description for Ellipse.", + "details": "2641 mm²\nMax: 1087 HU", + "series": "S:2 I:4" + }, + { + "id": 9, + "title": "Rectangle", + "description": "Description for Rectangle.", + "details": "1426 mm²\nMax: 718 HU", + "series": "S:2 I:5" + }, + { + "id": 10, + "title": "Circle", + "description": "Description for Circle.", + "details": "7339 mm²\nMax: 871 HU", + "series": "S:2 I:6" + }, + { + "id": 11, + "title": "Freehand ROI", + "description": "Description for Freehand ROI.", + "details": "Mean: 215 HU\nMax: 947 HU\nArea: 839 mm²", + "series": "S:2 I:7" + }, + { + "id": 12, + "title": "Spline Tool", + "description": "Description for Spline Tool.", + "details": "Area: 203 mm²", + "series": "S:2 I:8" + }, + { + "id": 13, + "title": "Livewire Tool", + "description": "Description for Livewire Tool.", + "details": "", + "series": "S:2 I:3" + }, + { + "id": 14, + "title": "Annotation Lorem ipsum dolor sit amet long measurement name continues here", + "description": "Description for Annotation.", + "details": "", + "series": "S:2 I:3" + } + ] + }, + { + "type": "Organ Segmentation", + "items": [ + { + "id": 15, + "title": "Spleen", + "description": "Description for Spleen.", + "colorHex": "#6B8E23" + }, + { + "id": 16, + "title": "Kidney", + "description": "Description for Kidney.", + "colorHex": "#4682B4" + }, + { + "id": 17, + "title": "Kidney very long title name lorem ipsum dolor sit amet segmentation", + "description": "Description for Kidney.", + "colorHex": "#9ACD32" + }, + { + "id": 18, + "title": "Gallbladder", + "description": "Description for Gallbladder.", + "colorHex": "#20B2AA" + }, + { + "id": 19, + "title": "Esophagus", + "description": "Description for Esophagus.", + "colorHex": "#DAA520" + }, + { + "id": 20, + "title": "Liver", + "description": "Description for Liver.", + "colorHex": "#CD5C5C" + }, + { + "id": 21, + "title": "Stomach", + "description": "Description for Stomach.", + "colorHex": "#778899" + }, + { + "id": 22, + "title": "Abdominal aorta", + "description": "Description for Abdominal Aorta.", + "colorHex": "#B8860B" + }, + { + "id": 23, + "title": "Inferior vena cava", + "description": "Description for Inferior Vena Cava.", + "colorHex": "#556B2F" + }, + { + "id": 24, + "title": "Portal vein", + "description": "Description for Portal Vein.", + "colorHex": "#8B4513" + }, + { + "id": 25, + "title": "Pancreas", + "description": "Description for Pancreas.", + "colorHex": "#2F4F4F" + }, + { + "id": 26, + "title": "Adrenal gland", + "description": "Description for Adrenal Gland.", + "colorHex": "#708090" + }, + { + "id": 27, + "title": "Adrenal gland", + "description": "Description for Adrenal Gland.", + "colorHex": "#6A5ACD" + }, + { + "id": 28, + "title": "New Seg Test New Seg Test New Seg Test New Seg Test New Seg Test New Seg Test ", + "description": "Description for New Seg Test.", + "colorHex": "#4682B4" + } + ] + } +] diff --git a/platform/ui-next/src/_prototypes/DataRow/index.ts b/platform/ui-next/src/_prototypes/DataRow/index.ts new file mode 100644 index 000000000..e69de29bb diff --git a/platform/ui-next/src/_prototypes/DataRow/types.ts b/platform/ui-next/src/_prototypes/DataRow/types.ts new file mode 100644 index 000000000..127c5e52d --- /dev/null +++ b/platform/ui-next/src/_prototypes/DataRow/types.ts @@ -0,0 +1,15 @@ +// src/_prototypes/DataRow/types.ts + +export interface DataItem { + id: number; + title: string; + description: string; + optionalField?: string; + colorHex?: string; + details?: string; +} + +export interface ListGroup { + type: string; + items: DataItem[]; +} diff --git a/platform/ui-next/src/components/Accordion/Accordion.tsx b/platform/ui-next/src/components/Accordion/Accordion.tsx index 76a0b92b3..bc9d7c2dc 100644 --- a/platform/ui-next/src/components/Accordion/Accordion.tsx +++ b/platform/ui-next/src/components/Accordion/Accordion.tsx @@ -36,7 +36,7 @@ const AccordionTrigger = React.forwardRef< {...props} > {children} - + )); diff --git a/platform/ui-next/src/components/DropdownMenu/DropdownMenu.tsx b/platform/ui-next/src/components/DropdownMenu/DropdownMenu.tsx index a4f57aace..377c18d90 100644 --- a/platform/ui-next/src/components/DropdownMenu/DropdownMenu.tsx +++ b/platform/ui-next/src/components/DropdownMenu/DropdownMenu.tsx @@ -142,7 +142,7 @@ const DropdownMenuLabel = React.forwardRef< >(({ className, inset, ...props }, ref) => ( )); @@ -154,7 +154,7 @@ const DropdownMenuSeparator = React.forwardRef< >(({ className, ...props }, ref) => ( )); diff --git a/platform/ui-next/src/components/Icons/Icons.tsx b/platform/ui-next/src/components/Icons/Icons.tsx index ec3aa6d62..67d09af39 100644 --- a/platform/ui-next/src/components/Icons/Icons.tsx +++ b/platform/ui-next/src/components/Icons/Icons.tsx @@ -5,6 +5,52 @@ type IconProps = React.HTMLAttributes; export const Icons = { // Usage example: + Add: (props: IconProps) => ( + + + + + + + + + + ), ChevronClosed: (props: IconProps) => ( ), + Controls: (props: IconProps) => ( + + + + + + + + + + + + + + + + ), + Delete: (props: IconProps) => ( + + + + + + + + + ), Download: (props: IconProps) => ( ), + Export: (props: IconProps) => ( + + + + + + + + + ), + Hide: (props: IconProps) => ( + + + + + + + + ), + Info: (props: IconProps) => ( + + + + + + + + + + ), + Lock: (props: IconProps) => ( + + + + + + + ), ListView: (props: IconProps) => ( ), + DisplayFillAndOutline: (props: IconProps) => ( + + + + + + + + + + ), + DisplayOutlineOnly: (props: IconProps) => ( + + + + + + + + + ), + DisplayFillOnly: (props: IconProps) => ( + + + + + + + + + ), + Actions: (props: IconProps) => ( + + + + + + + + + + ), PinFill: (props: IconProps) => ( ), + Rename: (props: IconProps) => ( + + + + + + + + + + + ), ThumbnailView: (props: IconProps) => ( @@ -736,7 +1298,7 @@ export const Icons = { {...props} > ), + Show: (props: IconProps) => ( + + + + + + + + + + + ), SidePanelCloseLeft: (props: IconProps) => (