@medixdeck/ui 0.1.16 → 0.1.18
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/LICENSE +21 -21
- package/README.md +188 -99
- package/dist/_redirects +1 -0
- package/dist/index.cjs +159 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +364 -146
- package/dist/index.js +17005 -6899
- package/dist/index.js.map +1 -1
- package/dist/logos/logo-blue.png +0 -0
- package/dist/manifest.json +1 -1
- package/dist/sw.js +3 -3
- package/package.json +54 -7
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 MedixDeck
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MedixDeck
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -11,19 +11,17 @@
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
+
# Core UI library
|
|
14
15
|
npm install @medixdeck/ui @chakra-ui/react react react-dom
|
|
16
|
+
|
|
17
|
+
# Optional: If using RichTextInput (TipTap Rich Text Editor)
|
|
18
|
+
npm install @tiptap/react @tiptap/pm @tiptap/starter-kit @tiptap/extension-link @tiptap/extension-underline @tiptap/extension-text-align @tiptap/extension-placeholder
|
|
15
19
|
```
|
|
16
20
|
|
|
17
21
|
## Quick start
|
|
18
22
|
|
|
19
23
|
```tsx
|
|
20
|
-
import {
|
|
21
|
-
Button,
|
|
22
|
-
Logo,
|
|
23
|
-
MedixProvider,
|
|
24
|
-
Navbar,
|
|
25
|
-
useThemeMode,
|
|
26
|
-
} from "@medixdeck/ui";
|
|
24
|
+
import { Button, Logo, MedixProvider, Navbar, useThemeMode } from '@medixdeck/ui';
|
|
27
25
|
|
|
28
26
|
// Next.js App Router: mark this component "use client" when using hooks.
|
|
29
27
|
function ThemeToggle() {
|
|
@@ -34,7 +32,7 @@ function ThemeToggle() {
|
|
|
34
32
|
|
|
35
33
|
return (
|
|
36
34
|
<Button variant="solid" colorScheme="blue" onClick={toggleThemeMode}>
|
|
37
|
-
Switch to {themeMode ===
|
|
35
|
+
Switch to {themeMode === 'dark' ? 'light' : 'dark'} mode
|
|
38
36
|
</Button>
|
|
39
37
|
);
|
|
40
38
|
}
|
|
@@ -43,7 +41,7 @@ export function App() {
|
|
|
43
41
|
return (
|
|
44
42
|
<MedixProvider defaultColorMode="light">
|
|
45
43
|
<Navbar
|
|
46
|
-
navItems={[{ label:
|
|
44
|
+
navItems={[{ label: 'Docs', href: '#docs' }]}
|
|
47
45
|
ctaLabel="Talk to a Doctor"
|
|
48
46
|
ctaHref="/consult"
|
|
49
47
|
/>
|
|
@@ -56,30 +54,31 @@ export function App() {
|
|
|
56
54
|
|
|
57
55
|
## Public API index
|
|
58
56
|
|
|
59
|
-
| Area
|
|
60
|
-
|
|
|
61
|
-
| Provider + theme
|
|
62
|
-
| Primitive
|
|
63
|
-
| Form
|
|
64
|
-
| Layout
|
|
65
|
-
| Navigation
|
|
66
|
-
| Feedback
|
|
67
|
-
| Data display
|
|
68
|
-
| Healthcare
|
|
69
|
-
| Chakra re-exports | `Box`, `Flex`, `Grid`, `Stack`, `Text`, `Heading`, `Link`, `Image`, `Icon`, `Center`, `Wrap`, `WrapItem`, others in `lib/index.ts`
|
|
57
|
+
| Area | Exports |
|
|
58
|
+
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
59
|
+
| Provider + theme | `MedixProvider`, `useThemeMode`, `useIsDarkMode`, `useColorScheme`, `system`, `medixConfig`, token exports |
|
|
60
|
+
| Primitive | `Button`, `IconButton`, `Badge`, `Avatar`, `AvatarGroup`, `Spinner`, `FullPageSpinner`, `Tag`, `Divider`, `Logo` |
|
|
61
|
+
| Form | `Input`, `SearchInput`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `FormControl`, `OTPInput`, `PinInput`, `PhoneInput`, `DatePicker`, `DateRangePicker`, `Calendar`, `Combobox`, `FileUpload`, `TagsInput`, `TagInput`, `RichTextInput`, `RichTextEditor` |
|
|
62
|
+
| Layout | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `StatCard`, `Container`, `SectionHeader`, `ThemeColorPalette`, `DashboardLayout`, `Footer` |
|
|
63
|
+
| Navigation | `Navbar`, `Breadcrumb`, `Tabs`, `Pagination`, `Stepper` |
|
|
64
|
+
| Feedback | `Alert`, `Skeleton`, `SkeletonText`, `SkeletonCard`, `Progress`, `Modal`, `Drawer`, `Tooltip`, `EmptyState`, `NotFoundPage`, `ServerErrorPage`, `Toaster`, `toast`, `dismissToast`, `CookieConsentBanner`, `PWAInstallPrompt` |
|
|
65
|
+
| Data display | `Accordion`, `TestimonialCard`, `BlogCard`, `DataTable` |
|
|
66
|
+
| Healthcare | `DoctorCard`, `VitalBadge`, `AppointmentCard` |
|
|
67
|
+
| Chakra re-exports | `Box`, `Flex`, `Grid`, `Stack`, `Text`, `Heading`, `Link`, `Image`, `Icon`, `Center`, `Wrap`, `WrapItem`, others in `lib/index.ts` |
|
|
70
68
|
|
|
71
69
|
## Design-system rules
|
|
72
70
|
|
|
73
71
|
- Use Chakra UI **v3** APIs only.
|
|
74
72
|
- All library source lives in `lib\`; `src\` is dev-preview only.
|
|
75
73
|
- Use semantic tokens such as `bg.surface`, `text.heading`, and `border` instead of raw hex for normal component styling.
|
|
74
|
+
- **No `boxShadow` / `shadow`**: Do NOT use `boxShadow`, `shadow`, `card-light`, or `card-dark` props. Rely on clean borders (`border="1px solid" borderColor="border"`) for visual separation.
|
|
76
75
|
- For color-critical interactive controls, prefer the repo's native-first pattern instead of Chakra recipes.
|
|
77
76
|
- Apply dark mode on `document.documentElement`, not an inner container.
|
|
78
77
|
|
|
79
78
|
## Theme hooks
|
|
80
79
|
|
|
81
80
|
```tsx
|
|
82
|
-
import { useIsDarkMode, useThemeMode } from
|
|
81
|
+
import { useIsDarkMode, useThemeMode } from '@medixdeck/ui';
|
|
83
82
|
|
|
84
83
|
function ThemeStatus() {
|
|
85
84
|
const { themeMode, themeSetting, setThemeMode, toggleThemeMode } = useThemeMode();
|
|
@@ -88,11 +87,11 @@ function ThemeStatus() {
|
|
|
88
87
|
return (
|
|
89
88
|
<>
|
|
90
89
|
<p>Resolved mode: {themeMode}</p>
|
|
91
|
-
<p>Following: {themeSetting ??
|
|
90
|
+
<p>Following: {themeSetting ?? 'system'}</p>
|
|
92
91
|
<p>Dark mode active: {String(isDarkMode)}</p>
|
|
93
|
-
<button onClick={() => setThemeMode(
|
|
94
|
-
<button onClick={() => setThemeMode(
|
|
95
|
-
<button onClick={() => setThemeMode(
|
|
92
|
+
<button onClick={() => setThemeMode('dark')}>Dark</button>
|
|
93
|
+
<button onClick={() => setThemeMode('light')}>Light</button>
|
|
94
|
+
<button onClick={() => setThemeMode('system')}>System</button>
|
|
96
95
|
<button onClick={toggleThemeMode}>Toggle</button>
|
|
97
96
|
</>
|
|
98
97
|
);
|
|
@@ -142,13 +141,101 @@ function Page() {
|
|
|
142
141
|
|
|
143
142
|
`useColorScheme(initialScheme?)` returns:
|
|
144
143
|
|
|
145
|
-
| Field
|
|
146
|
-
|
|
|
147
|
-
| `colorScheme`
|
|
148
|
-
| `setColorScheme`
|
|
149
|
-
| `toggleColorScheme` | `() => void`
|
|
150
|
-
| `isBlue`
|
|
151
|
-
| `isPurple`
|
|
144
|
+
| Field | Type | Description |
|
|
145
|
+
| ------------------- | -------------------- | -------------------------------- |
|
|
146
|
+
| `colorScheme` | `"blue" \| "purple"` | Currently active scheme |
|
|
147
|
+
| `setColorScheme` | `(scheme) => void` | Explicit setter |
|
|
148
|
+
| `toggleColorScheme` | `() => void` | Flips blue ↔ purple |
|
|
149
|
+
| `isBlue` | `boolean` | `true` when scheme is `"blue"` |
|
|
150
|
+
| `isPurple` | `boolean` | `true` when scheme is `"purple"` |
|
|
151
|
+
|
|
152
|
+
## Feedback & Overlays
|
|
153
|
+
|
|
154
|
+
### Toast Notifications
|
|
155
|
+
|
|
156
|
+
The MedixDeck UI includes a fully automated `Toast` system powered by Chakra UI v3's `createToaster` API, styled to match MedixDeck `Alert` components.
|
|
157
|
+
|
|
158
|
+
To use it, render the `<Toaster />` at the root of your application, and then use the `toast` helper to trigger notifications from anywhere.
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import { Toaster, toast } from '@medixdeck/ui';
|
|
162
|
+
|
|
163
|
+
function App() {
|
|
164
|
+
return (
|
|
165
|
+
<>
|
|
166
|
+
<Toaster />
|
|
167
|
+
<button onClick={() => toast.success('Changes saved successfully!')}>Save</button>
|
|
168
|
+
</>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The `toast` utility exposes `success`, `error`, `info`, and `warning` shorthand methods.
|
|
174
|
+
|
|
175
|
+
### Error Pages (404 & 500)
|
|
176
|
+
|
|
177
|
+
`NotFoundPage` and `ServerErrorPage` render beautifully styled full-screen error states. In the development environment (`process.env.NODE_ENV === "development"`), passing an `errorMessage` will render a technical code block. In production, this block is safely hidden to prevent data leakage.
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
<ServerErrorPage
|
|
181
|
+
errorMessage="TypeError: Cannot read properties of undefined (reading 'id')"
|
|
182
|
+
onAction={() => reset()}
|
|
183
|
+
/>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## Data Display & Form Enhancements
|
|
187
|
+
|
|
188
|
+
### Accordion with HTML/Markdown
|
|
189
|
+
|
|
190
|
+
The `Accordion` supports passing rich text answers via the `answerType` prop. Use `"HTML"` (safely sanitized via `isomorphic-dompurify`) or `"MD"` (parsed via `react-markdown`).
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
<Accordion
|
|
194
|
+
answerType="MD"
|
|
195
|
+
items={[{ id: 'q1', question: 'Markdown Support?', answer: 'Yes, **boldly** so!' }]}
|
|
196
|
+
/>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Multiple Select
|
|
200
|
+
|
|
201
|
+
The `Select` component supports native multiple selection, returning arrays on change.
|
|
202
|
+
|
|
203
|
+
```tsx
|
|
204
|
+
<Select
|
|
205
|
+
multiple
|
|
206
|
+
placeholder="Select specialties..."
|
|
207
|
+
options={[{ value: 'cardio', label: 'Cardiology' }]}
|
|
208
|
+
onChange={(values) => console.log(values)} // values is string | string[]
|
|
209
|
+
/>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Rich Text Input (`RichTextInput` / `RichTextEditor`)
|
|
213
|
+
|
|
214
|
+
A fully-featured rich text editor powered by TipTap (ProseMirror). Supports headings, formatting, lists, links, alignment, custom color schemes, character limit tracking, and height boundaries (`minHeight`, `maxHeight`).
|
|
215
|
+
|
|
216
|
+
Requires optional peer dependencies (`@tiptap/*`).
|
|
217
|
+
|
|
218
|
+
```tsx
|
|
219
|
+
import { RichTextInput } from '@medixdeck/ui';
|
|
220
|
+
|
|
221
|
+
function NotesForm() {
|
|
222
|
+
const [content, setContent] = React.useState('<p>Initial clinical note...</p>');
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<RichTextInput
|
|
226
|
+
label="Clinical Notes"
|
|
227
|
+
value={content}
|
|
228
|
+
onChange={setContent}
|
|
229
|
+
colorScheme="purple"
|
|
230
|
+
placeholder="Type clinical notes..."
|
|
231
|
+
minHeight="180px"
|
|
232
|
+
maxHeight="400px"
|
|
233
|
+
showCharCount
|
|
234
|
+
maxLength={1000}
|
|
235
|
+
/>
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
```
|
|
152
239
|
|
|
153
240
|
## DashboardLayout
|
|
154
241
|
|
|
@@ -157,23 +244,23 @@ The full-screen authenticated application shell. Renders a fixed sidebar, sticky
|
|
|
157
244
|
### Basic usage
|
|
158
245
|
|
|
159
246
|
```tsx
|
|
160
|
-
import { DashboardLayout } from
|
|
247
|
+
import { DashboardLayout } from '@medixdeck/ui';
|
|
161
248
|
|
|
162
249
|
<DashboardLayout
|
|
163
250
|
colorScheme="purple"
|
|
164
|
-
user={{ name:
|
|
251
|
+
user={{ name: 'Dr. Okedi Williams', email: 'williams@medixdeck.com' }}
|
|
165
252
|
navGroups={[
|
|
166
253
|
{
|
|
167
254
|
items: [
|
|
168
|
-
{ label:
|
|
169
|
-
{ label:
|
|
255
|
+
{ label: 'Home', href: '/', isActive: true },
|
|
256
|
+
{ label: 'Messages', href: '/messages', badge: 6 },
|
|
170
257
|
],
|
|
171
258
|
},
|
|
172
259
|
{
|
|
173
|
-
groupLabel:
|
|
260
|
+
groupLabel: 'Account',
|
|
174
261
|
items: [
|
|
175
|
-
{ label:
|
|
176
|
-
{ label:
|
|
262
|
+
{ label: 'Profile', href: '/profile' },
|
|
263
|
+
{ label: 'Notifications', href: '/notifications', hasDot: true },
|
|
177
264
|
],
|
|
178
265
|
},
|
|
179
266
|
]}
|
|
@@ -181,7 +268,7 @@ import { DashboardLayout } from "@medixdeck/ui";
|
|
|
181
268
|
renderLink={(item, children) => <Link href={item.href}>{children}</Link>}
|
|
182
269
|
>
|
|
183
270
|
{/* page content */}
|
|
184
|
-
</DashboardLayout
|
|
271
|
+
</DashboardLayout>;
|
|
185
272
|
```
|
|
186
273
|
|
|
187
274
|
### Mobile bottom navigation (`mobileNavItems`)
|
|
@@ -189,28 +276,28 @@ import { DashboardLayout } from "@medixdeck/ui";
|
|
|
189
276
|
A fixed bottom tab bar (mobile only, hidden on `md+`). Uses `react-icons/lu` or any icon component.
|
|
190
277
|
|
|
191
278
|
```tsx
|
|
192
|
-
import { LuHouse, LuMessageCircle, LuUser } from
|
|
279
|
+
import { LuHouse, LuMessageCircle, LuUser } from 'react-icons/lu';
|
|
193
280
|
|
|
194
281
|
<DashboardLayout
|
|
195
282
|
mobileNavItems={[
|
|
196
|
-
{ label:
|
|
197
|
-
{ label:
|
|
198
|
-
{ label:
|
|
283
|
+
{ label: 'Home', href: '/', icon: <LuHouse size={22} />, isActive: true },
|
|
284
|
+
{ label: 'Messages', href: '/messages', icon: <LuMessageCircle size={22} />, badge: 6 },
|
|
285
|
+
{ label: 'Profile', href: '/profile', icon: <LuUser size={22} /> },
|
|
199
286
|
]}
|
|
200
287
|
>
|
|
201
288
|
{/* ... */}
|
|
202
|
-
</DashboardLayout
|
|
289
|
+
</DashboardLayout>;
|
|
203
290
|
```
|
|
204
291
|
|
|
205
292
|
`DashboardMobileNavItem` props:
|
|
206
293
|
|
|
207
|
-
| Prop
|
|
208
|
-
|
|
|
209
|
-
| `label`
|
|
210
|
-
| `href`
|
|
211
|
-
| `icon`
|
|
212
|
-
| `isActive` | `boolean`
|
|
213
|
-
| `badge`
|
|
294
|
+
| Prop | Type | Required | Description |
|
|
295
|
+
| ---------- | ----------- | -------- | -------------------------------------- |
|
|
296
|
+
| `label` | `string` | ✓ | Text below the icon |
|
|
297
|
+
| `href` | `string` | ✓ | Unique key + navigation target |
|
|
298
|
+
| `icon` | `ReactNode` | ✓ | Icon (22 × 22 px recommended) |
|
|
299
|
+
| `isActive` | `boolean` | — | Highlights the active tab |
|
|
300
|
+
| `badge` | `number` | — | Count bubble on icon (capped at `99+`) |
|
|
214
301
|
|
|
215
302
|
### Doctor score card (`scoreCard`)
|
|
216
303
|
|
|
@@ -219,12 +306,12 @@ Shown above the sidebar nav on **desktop only**. Only pass this prop for doctor-
|
|
|
219
306
|
```tsx
|
|
220
307
|
<DashboardLayout
|
|
221
308
|
scoreCard={{
|
|
222
|
-
name:
|
|
223
|
-
role:
|
|
224
|
-
avatarSrc:
|
|
225
|
-
tier:
|
|
309
|
+
name: 'Dr. Okedi Williams',
|
|
310
|
+
role: 'Cardiologist',
|
|
311
|
+
avatarSrc: '/dr-okedi.jpg', // optional — initials fallback
|
|
312
|
+
tier: 'gold', // "bronze" | "silver" | "gold" | "platinum" | "diamond"
|
|
226
313
|
medixScore: 847,
|
|
227
|
-
link:
|
|
314
|
+
link: '/doctor/profile', // optional — makes the card clickable
|
|
228
315
|
}}
|
|
229
316
|
>
|
|
230
317
|
{/* ... */}
|
|
@@ -233,13 +320,13 @@ Shown above the sidebar nav on **desktop only**. Only pass this prop for doctor-
|
|
|
233
320
|
|
|
234
321
|
Tier colours:
|
|
235
322
|
|
|
236
|
-
| Tier
|
|
237
|
-
|
|
|
238
|
-
| `bronze`
|
|
239
|
-
| `silver`
|
|
240
|
-
| `gold`
|
|
241
|
-
| `platinum` | `#0284C7`
|
|
242
|
-
| `diamond`
|
|
323
|
+
| Tier | Label colour | Avatar ring |
|
|
324
|
+
| ---------- | ------------ | ----------- |
|
|
325
|
+
| `bronze` | `#92400E` | `#D97706` |
|
|
326
|
+
| `silver` | `#475569` | `#94A3B8` |
|
|
327
|
+
| `gold` | `#D97706` | `#F59E0B` |
|
|
328
|
+
| `platinum` | `#0284C7` | `#38BDF8` |
|
|
329
|
+
| `diamond` | `#7C3AED` | `#A78BFA` |
|
|
243
330
|
|
|
244
331
|
### Greeting subtitle (`greetingSubtext`)
|
|
245
332
|
|
|
@@ -247,8 +334,11 @@ An optional second line below the greeting. The top bar expands from 64 px → 8
|
|
|
247
334
|
|
|
248
335
|
```tsx
|
|
249
336
|
<DashboardLayout
|
|
250
|
-
greetingSubtext={`${new Date().toLocaleDateString(
|
|
251
|
-
weekday:
|
|
337
|
+
greetingSubtext={`${new Date().toLocaleDateString('en-GB', {
|
|
338
|
+
weekday: 'long',
|
|
339
|
+
day: 'numeric',
|
|
340
|
+
month: 'long',
|
|
341
|
+
year: 'numeric',
|
|
252
342
|
})} · 8 consultations scheduled today`}
|
|
253
343
|
>
|
|
254
344
|
{/* ... */}
|
|
@@ -257,56 +347,55 @@ An optional second line below the greeting. The top bar expands from 64 px → 8
|
|
|
257
347
|
|
|
258
348
|
### All `DashboardLayout` props
|
|
259
349
|
|
|
260
|
-
| Prop
|
|
261
|
-
|
|
|
262
|
-
| `user`
|
|
263
|
-
| `navGroups`
|
|
264
|
-
| `colorScheme`
|
|
265
|
-
| `logo`
|
|
266
|
-
| `greeting`
|
|
267
|
-
| `greetingSubtext` | `string`
|
|
268
|
-
| `mobileNavItems`
|
|
269
|
-
| `scoreCard`
|
|
270
|
-
| `topBarSlot`
|
|
271
|
-
| `dropdownItems`
|
|
272
|
-
| `sidebarWidth`
|
|
273
|
-
| `renderLink`
|
|
274
|
-
| `onLogout`
|
|
350
|
+
| Prop | Type | Default | Description |
|
|
351
|
+
| ----------------- | ------------------------------- | ---------- | --------------------------------------------- |
|
|
352
|
+
| `user` | `DashboardUser` | — | Name, email, optional avatar |
|
|
353
|
+
| `navGroups` | `DashboardNavGroup[]` | — | Sidebar navigation tree |
|
|
354
|
+
| `colorScheme` | `"blue" \| "purple"` | `"blue"` | Brand accent colour |
|
|
355
|
+
| `logo` | `ReactNode` | `<Logo />` | Override the sidebar logo |
|
|
356
|
+
| `greeting` | `string` | auto | Override "Good morning / afternoon / evening" |
|
|
357
|
+
| `greetingSubtext` | `string` | — | Subtitle line below the greeting |
|
|
358
|
+
| `mobileNavItems` | `DashboardMobileNavItem[]` | — | Mobile bottom tab bar items |
|
|
359
|
+
| `scoreCard` | `DashboardScoreCardData` | — | Doctor identity card (desktop only) |
|
|
360
|
+
| `topBarSlot` | `ReactNode` | — | Slot right of greeting (search, bell, etc.) |
|
|
361
|
+
| `dropdownItems` | `DashboardDropdownItem[]` | — | Extra user dropdown items |
|
|
362
|
+
| `sidebarWidth` | `number` | `220` | Sidebar width in px |
|
|
363
|
+
| `renderLink` | `(item, children) => ReactNode` | `<a>` | Router integration |
|
|
364
|
+
| `onLogout` | `() => void` | — | Logout callback |
|
|
275
365
|
|
|
276
366
|
## Footer
|
|
277
367
|
|
|
278
368
|
The `Footer` component provides the core navigation layout for the bottom of pages. It features an optional compliance `certifications` row and a brandable `colorScheme`.
|
|
279
369
|
|
|
280
370
|
```tsx
|
|
281
|
-
import { Footer } from
|
|
371
|
+
import { Footer } from '@medixdeck/ui';
|
|
282
372
|
|
|
283
373
|
<Footer
|
|
284
374
|
colorScheme="purple"
|
|
285
375
|
certifications={[
|
|
286
|
-
{ name:
|
|
287
|
-
{ name:
|
|
288
|
-
{ name:
|
|
376
|
+
{ name: 'NDPR Compliant', href: 'https://nitda.gov.ng' },
|
|
377
|
+
{ name: 'MDCN Certified Platform', href: 'https://mdcn.gov.ng' },
|
|
378
|
+
{ name: 'ISO 27001', href: '#' },
|
|
289
379
|
]}
|
|
290
|
-
|
|
380
|
+
/>;
|
|
291
381
|
```
|
|
292
382
|
|
|
293
|
-
| Prop
|
|
294
|
-
|
|
|
295
|
-
| `colorScheme`
|
|
296
|
-
| `certifications` | `FooterCertification[]`
|
|
297
|
-
| `logo`
|
|
298
|
-
| `description`
|
|
299
|
-
| `sections`
|
|
300
|
-
| `socialLinks`
|
|
301
|
-
| `newsletter`
|
|
302
|
-
| `bottomLinks`
|
|
303
|
-
| `renderLink`
|
|
383
|
+
| Prop | Type | Default | Description |
|
|
384
|
+
| ---------------- | ------------------------------- | ---------- | ----------------------------------------------- |
|
|
385
|
+
| `colorScheme` | `"blue" \| "purple"` | `"blue"` | Brand accent colour for links and social icons |
|
|
386
|
+
| `certifications` | `FooterCertification[]` | — | Compliance badges displayed above the copyright |
|
|
387
|
+
| `logo` | `ReactNode` | `<Logo />` | Override the default logo |
|
|
388
|
+
| `description` | `string` | — | Short company bio |
|
|
389
|
+
| `sections` | `FooterSection[]` | — | Link columns |
|
|
390
|
+
| `socialLinks` | `SocialLink[]` | — | Social media URLs |
|
|
391
|
+
| `newsletter` | `NewsletterProps` | — | Email subscription form config |
|
|
392
|
+
| `bottomLinks` | `BottomLink[]` | — | Terms/Privacy links next to copyright |
|
|
393
|
+
| `renderLink` | `(item, children) => ReactNode` | `<a>` | Router integration |
|
|
304
394
|
|
|
305
395
|
## Theme color reference
|
|
306
396
|
|
|
307
|
-
|
|
308
397
|
```tsx
|
|
309
|
-
import { ThemeColorPalette } from
|
|
398
|
+
import { ThemeColorPalette } from '@medixdeck/ui';
|
|
310
399
|
|
|
311
400
|
export function DesignTokensPage() {
|
|
312
401
|
return <ThemeColorPalette mt="8" />;
|
package/dist/_redirects
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* /index.html 200
|