@toteat-eng/ds-react 2026.4.28-8 → 2026.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,124 @@
1
+ # @toteat-eng/ds-react
2
+
3
+ Toteat React Design System — component library for the Toteat restaurant management platform.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @toteat-eng/ds-react
9
+ ```
10
+
11
+ ### Peer dependencies
12
+
13
+ ```bash
14
+ npm install react react-dom @tanstack/react-table recharts
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ Import the stylesheet once in your app entry point, then wrap your app with `DsProvider`:
20
+
21
+ ```tsx
22
+ // main.tsx
23
+ import "@toteat-eng/ds-react/style.css";
24
+ ```
25
+
26
+ ```tsx
27
+ // App.tsx
28
+ import { DsProvider } from "@toteat-eng/ds-react";
29
+
30
+ export function App() {
31
+ return (
32
+ <DsProvider theme="toteat-react-ds">
33
+ <YourApp />
34
+ </DsProvider>
35
+ );
36
+ }
37
+ ```
38
+
39
+ Import components as named exports:
40
+
41
+ ```tsx
42
+ import { Button, TextInput, Dialog } from "@toteat-eng/ds-react";
43
+
44
+ function MyForm() {
45
+ return (
46
+ <>
47
+ <TextInput label="Name" value="" onChange={() => {}} />
48
+ <Button variant="primary" size="md" onClick={() => {}}>
49
+ Save
50
+ </Button>
51
+ </>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ### Themes
57
+
58
+ `DsProvider` accepts a `theme` prop:
59
+
60
+ | Value | Description |
61
+ |---|---|
62
+ | `"toteat-react-ds"` | Current Toteat React look (default) |
63
+ | `"angular-legacy"` | Absorbed Angular DS tokens (legacy apps) |
64
+
65
+ ## Available components
66
+
67
+ Accordion, AppleSignInButton, BackgroundWrapper, Badge, Button, Card,
68
+ AreaChart, BarChart, KpiCard, LineChart, Checkbox, DataTable, DatePicker,
69
+ DateRangePicker, Dialog, DropZone, DropdownButton, DropdownMenu, DsProvider,
70
+ EmptyState, ErrorBoundary, ExtrasDialog, FormField, GoogleSignInButton,
71
+ GroupedButtons, Header, Icon, ImagePreview, LanguageSelector, LogoToteat,
72
+ Multiselect, NavBar, Overlay, OverlayMessage, PageLoadingOverlay,
73
+ PinLockOverlay, ProductTile, Radio, Select, Sidebar, SidebarNavItem,
74
+ SidebarNavSection, Skeleton, Spinner, TabBar, Tabs, TextInput, Textarea,
75
+ ThemeGate, Toast, Toggle, Tooltip, TreeItem, TreeList
76
+
77
+ All named exports are TypeScript-typed. Import types via the same package:
78
+
79
+ ```ts
80
+ import type { ButtonProps, DialogProps } from "@toteat-eng/ds-react";
81
+ ```
82
+
83
+ ## Design tokens
84
+
85
+ All visual properties (colors, spacing, typography, radius, shadows,
86
+ animations) are CSS custom properties defined in `dist/style.css` and scoped
87
+ under the `.tot-ds-root` class set by `DsProvider`. Do not hardcode hex or
88
+ pixel values — reference DS tokens from your own CSS:
89
+
90
+ ```css
91
+ .my-component {
92
+ color: var(--ds-color-text-primary);
93
+ padding: var(--ds-space-4);
94
+ border-radius: var(--ds-radius-md);
95
+ }
96
+ ```
97
+
98
+ Token definitions live in `src/tokens/`. The `[data-theme]` attribute on the
99
+ `DsProvider` root switches the active token set.
100
+
101
+ ## Development
102
+
103
+ ```bash
104
+ # Component explorer (Storybook, port 6007)
105
+ npm run storybook
106
+
107
+ # Build library + emit type declarations
108
+ npm run build:all
109
+
110
+ # Type check only
111
+ npm run typecheck
112
+
113
+ # Run unit / browser tests (Vitest)
114
+ npm test
115
+
116
+ # Run visual regression tests (Playwright CT)
117
+ npm run visual:test
118
+
119
+ # Approve / update visual snapshots
120
+ npm run visual:approve
121
+
122
+ # Lint and auto-fix
123
+ npm run lint:fix
124
+ ```