feat(tracker-web): complete Primitives adapter + export-presence test (UX-9)
Extend src/components/ui/Primitives.tsx to re-export the shared @bytelyst/ui controls later waves need (Select, Textarea, Checkbox, Switch, RadioGroup, Tooltip, Tabs, SegmentedControl, DropdownMenu, Drawer, ActionMenu, IconButton, AlertBanner, Card, Panel, Separator, DataList, Timeline), and add a pure export-presence test that lifts the adapter off 0% coverage without a DOM dep. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
3515fbddc5
commit
18a09b25b8
@ -175,14 +175,14 @@ pnpm build # final gate
|
|||||||
> sits at **0% test coverage** (flagged in `docs/TEST_VALIDATION_LOG.md`). Broaden it and
|
> sits at **0% test coverage** (flagged in `docs/TEST_VALIDATION_LOG.md`). Broaden it and
|
||||||
> lock it with a cheap export-presence test — no `@testing-library/react`/jsdom needed.
|
> lock it with a cheap export-presence test — no `@testing-library/react`/jsdom needed.
|
||||||
|
|
||||||
- [ ] **9.1** Extend `Primitives.tsx` to also re-export the shared controls the app will need
|
- [x] **9.1** Extend `Primitives.tsx` to also re-export the shared controls the app will need
|
||||||
in later waves: `Select` `Textarea` `Checkbox` `Switch` `RadioGroup` `Tooltip` `Tabs`
|
in later waves: `Select` `Textarea` `Checkbox` `Switch` `RadioGroup` `Tooltip` `Tabs`
|
||||||
`SegmentedControl` `DropdownMenu` `Drawer` `ActionMenu` `IconButton` `AlertBanner`
|
`SegmentedControl` `DropdownMenu` `Drawer` `ActionMenu` `IconButton` `AlertBanner`
|
||||||
`Card` `Panel` `Separator` `DataList` `Timeline`. Keep app code importing only from the
|
`Card` `Panel` `Separator` `DataList` `Timeline`. Keep app code importing only from the
|
||||||
adapter (preserves the UI-drift ratchet).
|
adapter (preserves the UI-drift ratchet).
|
||||||
- [ ] **9.2** Add `src/__tests__/primitives-adapter.exports.test.ts` asserting every adapter
|
- [x] **9.2** Add `src/__tests__/primitives-adapter.exports.test.ts` asserting every adapter
|
||||||
export is `defined` (a pure import test — raises `Primitives.tsx` off 0% without a DOM dep).
|
export is `defined` (a pure import test — raises `Primitives.tsx` off 0% without a DOM dep).
|
||||||
**Verify:** `pnpm typecheck && pnpm lint && pnpm test && pnpm build`.
|
**Verify:** `pnpm typecheck && pnpm lint && pnpm test && pnpm build`. (UX-9 verified: tc/lint/test 159 ✓/build/e2e 18 ✓)
|
||||||
|
|
||||||
## UX-10 — Page chrome via `@bytelyst/dashboard-components`
|
## UX-10 — Page chrome via `@bytelyst/dashboard-components`
|
||||||
|
|
||||||
@ -252,7 +252,7 @@ pnpm build # final gate
|
|||||||
|
|
||||||
```
|
```
|
||||||
Core : UX-1 ✅ UX-2 ⬜ UX-3 ⬜ UX-4 ⬜ UX-5 ⬜ UX-6 ⬜ UX-7 ⬜ UX-8 ⬜
|
Core : UX-1 ✅ UX-2 ⬜ UX-3 ⬜ UX-4 ⬜ UX-5 ⬜ UX-6 ⬜ UX-7 ⬜ UX-8 ⬜
|
||||||
Expand : UX-9 ⬜ UX-10 ⬜ UX-11 ⬜ UX-12 ⬜ UX-13 ⬜ (stretch: 12.3, 13.*)
|
Expand : UX-9 ✅ UX-10 ⬜ UX-11 ⬜ UX-12 ⬜ UX-13 ⬜ (stretch: 12.3, 13.*)
|
||||||
```
|
```
|
||||||
|
|
||||||
**UX-1 is done** (token bridge + Primitives adapter, commit `dc01dd02`) — the `--bl-*` bridge is
|
**UX-1 is done** (token bridge + Primitives adapter, commit `dc01dd02`) — the `--bl-*` bridge is
|
||||||
|
|||||||
@ -0,0 +1,98 @@
|
|||||||
|
/**
|
||||||
|
* Export-presence test for the Primitives adapter (UX-9.2).
|
||||||
|
*
|
||||||
|
* A pure import test: it asserts every runtime (value) export of
|
||||||
|
* `src/components/ui/Primitives.tsx` is defined. This lifts the adapter off
|
||||||
|
* 0% coverage without needing `@testing-library/react` or a DOM environment,
|
||||||
|
* and guards against an accidental broken/renamed re-export from `@bytelyst/ui`.
|
||||||
|
*
|
||||||
|
* @see docs/roadmaps/UX_INTEGRATION_BYTELYST.md (UX-9)
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
import * as Primitives from '@/components/ui/Primitives';
|
||||||
|
|
||||||
|
// Every value (non-type) export the adapter is expected to provide.
|
||||||
|
const EXPECTED_EXPORTS = [
|
||||||
|
// UX-1 baseline
|
||||||
|
'Button',
|
||||||
|
'Input',
|
||||||
|
'Field',
|
||||||
|
'FieldContent',
|
||||||
|
'FieldDescription',
|
||||||
|
'FieldError',
|
||||||
|
'FieldGroup',
|
||||||
|
'FieldLabel',
|
||||||
|
'FieldTitle',
|
||||||
|
'Modal',
|
||||||
|
'ConfirmDialog',
|
||||||
|
'Badge',
|
||||||
|
'StatusBadge',
|
||||||
|
'StatusDot',
|
||||||
|
'EmptyState',
|
||||||
|
'Skeleton',
|
||||||
|
'SkeletonGroup',
|
||||||
|
'TableSkeleton',
|
||||||
|
'MetricCard',
|
||||||
|
'Toast',
|
||||||
|
'ToastProvider',
|
||||||
|
'useToast',
|
||||||
|
'toast',
|
||||||
|
'dismissToast',
|
||||||
|
// UX-9.1 additions
|
||||||
|
'Select',
|
||||||
|
'Textarea',
|
||||||
|
'Checkbox',
|
||||||
|
'Switch',
|
||||||
|
'RadioGroup',
|
||||||
|
'RadioGroupItem',
|
||||||
|
'Tooltip',
|
||||||
|
'TooltipContent',
|
||||||
|
'TooltipProvider',
|
||||||
|
'TooltipTrigger',
|
||||||
|
'Tabs',
|
||||||
|
'TabsContent',
|
||||||
|
'TabsList',
|
||||||
|
'TabsTrigger',
|
||||||
|
'SegmentedControl',
|
||||||
|
'DropdownMenu',
|
||||||
|
'DropdownMenuContent',
|
||||||
|
'DropdownMenuGroup',
|
||||||
|
'DropdownMenuItem',
|
||||||
|
'DropdownMenuLabel',
|
||||||
|
'DropdownMenuRadioGroup',
|
||||||
|
'DropdownMenuSeparator',
|
||||||
|
'DropdownMenuSub',
|
||||||
|
'DropdownMenuSubTrigger',
|
||||||
|
'DropdownMenuTrigger',
|
||||||
|
'Drawer',
|
||||||
|
'ActionMenu',
|
||||||
|
'IconButton',
|
||||||
|
'AlertBanner',
|
||||||
|
'Card',
|
||||||
|
'CardHeader',
|
||||||
|
'CardTitle',
|
||||||
|
'CardDescription',
|
||||||
|
'Panel',
|
||||||
|
'PanelBody',
|
||||||
|
'PanelDescription',
|
||||||
|
'PanelHeader',
|
||||||
|
'PanelTitle',
|
||||||
|
'Separator',
|
||||||
|
'DataList',
|
||||||
|
'DataListItem',
|
||||||
|
'DataListMeta',
|
||||||
|
'Timeline',
|
||||||
|
] as const;
|
||||||
|
|
||||||
|
describe('Primitives adapter — export presence', () => {
|
||||||
|
it.each(EXPECTED_EXPORTS)('re-exports %s as a defined value', name => {
|
||||||
|
expect((Primitives as Record<string, unknown>)[name]).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('exposes the toast helpers as callable functions', () => {
|
||||||
|
expect(typeof Primitives.toast).toBe('function');
|
||||||
|
expect(typeof Primitives.dismissToast).toBe('function');
|
||||||
|
expect(typeof Primitives.useToast).toBe('function');
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -57,3 +57,92 @@ export {
|
|||||||
dismissToast,
|
dismissToast,
|
||||||
type ToastMessage,
|
type ToastMessage,
|
||||||
} from '@bytelyst/ui';
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
// ── UX-9.1: broaden the adapter with the shared controls later waves need ──
|
||||||
|
// App code imports only from this adapter (preserves the UI-drift ratchet, CC.6).
|
||||||
|
|
||||||
|
export { Select, type SelectProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Textarea, type TextareaProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Checkbox, type CheckboxProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Switch, type SwitchProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
Tooltip,
|
||||||
|
TooltipContent,
|
||||||
|
TooltipProvider,
|
||||||
|
TooltipTrigger,
|
||||||
|
type TooltipContentProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
Tabs,
|
||||||
|
TabsContent,
|
||||||
|
TabsList,
|
||||||
|
TabsTrigger,
|
||||||
|
type TabsContentProps,
|
||||||
|
type TabsListProps,
|
||||||
|
type TabsTriggerProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
SegmentedControl,
|
||||||
|
type SegmentedControlOption,
|
||||||
|
type SegmentedControlProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuGroup,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuLabel,
|
||||||
|
DropdownMenuRadioGroup,
|
||||||
|
DropdownMenuSeparator,
|
||||||
|
DropdownMenuSub,
|
||||||
|
DropdownMenuSubTrigger,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
type DropdownMenuContentProps,
|
||||||
|
type DropdownMenuItemProps,
|
||||||
|
type DropdownMenuLabelProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Drawer, type DrawerProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { ActionMenu, type ActionMenuItem, type ActionMenuProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { IconButton, type IconButtonProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { AlertBanner, type AlertBannerProps, type AlertBannerTone } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Card, CardHeader, CardTitle, CardDescription, type CardProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
Panel,
|
||||||
|
PanelBody,
|
||||||
|
PanelDescription,
|
||||||
|
PanelHeader,
|
||||||
|
PanelTitle,
|
||||||
|
type PanelBodyProps,
|
||||||
|
type PanelDescriptionProps,
|
||||||
|
type PanelHeaderProps,
|
||||||
|
type PanelProps,
|
||||||
|
type PanelTitleProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Separator, type SeparatorProps } from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export {
|
||||||
|
DataList,
|
||||||
|
DataListItem,
|
||||||
|
DataListMeta,
|
||||||
|
type DataListItemProps,
|
||||||
|
type DataListMetaProps,
|
||||||
|
type DataListProps,
|
||||||
|
} from '@bytelyst/ui';
|
||||||
|
|
||||||
|
export { Timeline, type TimelineItem, type TimelineProps } from '@bytelyst/ui';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user