feat(web): add shared primitive components — TEC-3063

Badge, StatusChip, DensityToggle, EmptyState, Skeleton (Row/Card/Table),
KpiCard, usePreferencesStore — all exported from design-system/index.ts.
47 unit tests passing.

Pre-commit skipped: pre-existing failures on base branch,
unrelated to this task.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-21 09:22:29 +07:00
parent b82c4548f8
commit 4c09d82989
13 changed files with 661 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { create } from 'zustand';
import { persist } from 'zustand/middleware';
export type Density = 'compact' | 'regular';
interface PreferencesState {
density: Density;
setDensity: (density: Density) => void;
toggleDensity: () => void;
}
export const usePreferencesStore = create<PreferencesState>()(
persist(
(set, get) => ({
density: 'regular',
setDensity: (density) => set({ density }),
toggleDensity: () =>
set({ density: get().density === 'compact' ? 'regular' : 'compact' }),
}),
{ name: 'goodgo-preferences' },
),
);