feat: add InlineEdit, ConfirmDialog, MultiSelect to Inventory demos
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import {
|
||||
BarChart,
|
||||
Breadcrumb,
|
||||
CommandPalette,
|
||||
ConfirmDialog,
|
||||
DataTable,
|
||||
DetailPanel,
|
||||
Dropdown,
|
||||
@@ -17,6 +18,7 @@ import {
|
||||
LineChart,
|
||||
MenuItem,
|
||||
Modal,
|
||||
MultiSelect,
|
||||
Popover,
|
||||
ProcessorTimeline,
|
||||
ShortcutsBar,
|
||||
@@ -208,6 +210,13 @@ export function CompositesSection() {
|
||||
]
|
||||
const [activeFilters, setActiveFilters] = useState([{ label: 'Live', value: 'live' }])
|
||||
|
||||
// ConfirmDialog
|
||||
const [confirmOpen, setConfirmOpen] = useState(false)
|
||||
const [confirmDone, setConfirmDone] = useState(false)
|
||||
|
||||
// MultiSelect
|
||||
const [multiValue, setMultiValue] = useState<string[]>(['admin'])
|
||||
|
||||
// 15. Modal
|
||||
const [modalOpen, setModalOpen] = useState(false)
|
||||
|
||||
@@ -294,6 +303,21 @@ export function CompositesSection() {
|
||||
/>
|
||||
</DemoCard>
|
||||
|
||||
{/* 2b. ConfirmDialog */}
|
||||
<DemoCard id="confirm-dialog" title="ConfirmDialog" description="Type-to-confirm destructive action dialog. Built on Modal.">
|
||||
<Button size="sm" variant="danger" onClick={() => { setConfirmOpen(true); setConfirmDone(false) }}>
|
||||
Delete project
|
||||
</Button>
|
||||
{confirmDone && <span style={{ color: 'var(--success)', fontSize: 12, marginLeft: 8 }}>Deleted!</span>}
|
||||
<ConfirmDialog
|
||||
open={confirmOpen}
|
||||
onClose={() => setConfirmOpen(false)}
|
||||
onConfirm={() => { setConfirmOpen(false); setConfirmDone(true) }}
|
||||
message={'Delete project "my-project"? This cannot be undone.'}
|
||||
confirmText="my-project"
|
||||
/>
|
||||
</DemoCard>
|
||||
|
||||
{/* 3. AreaChart */}
|
||||
<DemoCard
|
||||
id="areachart"
|
||||
@@ -511,6 +535,27 @@ export function CompositesSection() {
|
||||
</Modal>
|
||||
</DemoCard>
|
||||
|
||||
{/* 15b. MultiSelect */}
|
||||
<DemoCard id="multi-select" title="MultiSelect" description="Dropdown with searchable checkbox list and Apply action.">
|
||||
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, maxWidth: 260 }}>
|
||||
<MultiSelect
|
||||
options={[
|
||||
{ value: 'admin', label: 'ADMIN' },
|
||||
{ value: 'editor', label: 'EDITOR' },
|
||||
{ value: 'viewer', label: 'VIEWER' },
|
||||
{ value: 'operator', label: 'OPERATOR' },
|
||||
{ value: 'auditor', label: 'AUDITOR' },
|
||||
]}
|
||||
value={multiValue}
|
||||
onChange={setMultiValue}
|
||||
placeholder="Add roles..."
|
||||
/>
|
||||
<span style={{ fontSize: 11, color: 'var(--text-muted)' }}>
|
||||
Selected: {multiValue.join(', ') || 'none'}
|
||||
</span>
|
||||
</div>
|
||||
</DemoCard>
|
||||
|
||||
{/* 16. Popover */}
|
||||
<DemoCard
|
||||
id="popover"
|
||||
|
||||
Reference in New Issue
Block a user