v0.1.8 — corrige l'import côté Server Component (Next App Router)
- ToastProvider/useToast déplacés dans @napps/design-system/toast ("use client")
- index principal de nouveau importable depuis un Server Component
- test de non-régression test/run-next-smoke.sh (next build)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { Checkbox, ColorPicker, Dialog, Radio, SegmentedControl, TabBar, Toggle } from '@napps/design-system';
|
||||
import { useToast } from '@napps/design-system/toast';
|
||||
|
||||
export function ClientDemo() {
|
||||
const toast = useToast();
|
||||
const [on, setOn] = useState(false);
|
||||
const [tab, setTab] = useState('a');
|
||||
const [color, setColor] = useState('#0B6CFF');
|
||||
return (
|
||||
<div>
|
||||
<Toggle checked={on} onChange={setOn} aria-label="toggle" />
|
||||
<Checkbox checked={on} onChange={setOn} aria-label="checkbox" />
|
||||
<Radio checked={on} onChange={() => setOn(true)} aria-label="radio" />
|
||||
<SegmentedControl options={[{ label: 'A', value: 'a' }, { label: 'B', value: 'b' }]} value={tab} onChange={setTab} aria-label="seg" />
|
||||
<TabBar items={[{ value: 'a', label: 'A' }]} value={tab} onChange={setTab} aria-label="tabs" />
|
||||
<ColorPicker value={color} onChange={setColor} aria-label="color" />
|
||||
<Dialog open={false} title="t" actions={[{ label: 'OK', onClick: () => toast.show('ok') }]} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user