@medixdeck/ui 0.1.14 → 0.1.15
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 +153 -1
- package/dist/index.cjs +59 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +227 -14
- package/dist/index.js +3738 -2539
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ export function App() {
|
|
|
63
63
|
| Form | `Input`, `SearchInput`, `Textarea`, `Select`, `Checkbox`, `RadioGroup`, `Switch`, `FormControl`, `OTPInput`, `PinInput`, `PhoneInput`, `DatePicker`, `DateRangePicker`, `Calendar`, `Combobox`, `FileUpload` |
|
|
64
64
|
| Layout | `Card`, `CardHeader`, `CardBody`, `CardFooter`, `StatCard`, `Container`, `SectionHeader`, `ThemeColorPalette`, `DashboardLayout`, `Footer` |
|
|
65
65
|
| Navigation | `Navbar`, `Breadcrumb`, `Tabs`, `Pagination`, `Stepper` |
|
|
66
|
-
| Feedback | `Alert`, `Skeleton`, `SkeletonText`, `SkeletonCard`, `Progress`, `Modal`, `Drawer`, `Tooltip`, `EmptyState`, `Toaster`, `toast`, `dismissToast` |
|
|
66
|
+
| Feedback | `Alert`, `Skeleton`, `SkeletonText`, `SkeletonCard`, `Progress`, `Modal`, `Drawer`, `Tooltip`, `EmptyState`, `Toaster`, `toast`, `dismissToast`, `CookieConsentBanner`, `PWAInstallPrompt` |
|
|
67
67
|
| Data display | `Accordion`, `TestimonialCard`, `BlogCard`, `DataTable` |
|
|
68
68
|
| Healthcare | `DoctorCard`, `VitalBadge`, `AppointmentCard` |
|
|
69
69
|
| Chakra re-exports | `Box`, `Flex`, `Grid`, `Stack`, `Text`, `Heading`, `Link`, `Image`, `Icon`, `Center`, `Wrap`, `WrapItem`, others in `lib/index.ts` |
|
|
@@ -150,6 +150,158 @@ function Page() {
|
|
|
150
150
|
| `isBlue` | `boolean` | `true` when scheme is `"blue"` |
|
|
151
151
|
| `isPurple` | `boolean` | `true` when scheme is `"purple"` |
|
|
152
152
|
|
|
153
|
+
## DashboardLayout
|
|
154
|
+
|
|
155
|
+
The full-screen authenticated application shell. Renders a fixed sidebar, sticky top bar, and an optional mobile bottom nav.
|
|
156
|
+
|
|
157
|
+
### Basic usage
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { DashboardLayout } from "@medixdeck/ui";
|
|
161
|
+
|
|
162
|
+
<DashboardLayout
|
|
163
|
+
colorScheme="purple"
|
|
164
|
+
user={{ name: "Dr. Okedi Williams", email: "williams@medixdeck.com" }}
|
|
165
|
+
navGroups={[
|
|
166
|
+
{
|
|
167
|
+
items: [
|
|
168
|
+
{ label: "Home", href: "/", isActive: true },
|
|
169
|
+
{ label: "Messages", href: "/messages", badge: 6 },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
groupLabel: "Account",
|
|
174
|
+
items: [
|
|
175
|
+
{ label: "Profile", href: "/profile" },
|
|
176
|
+
{ label: "Notifications", href: "/notifications", hasDot: true },
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
]}
|
|
180
|
+
onLogout={() => auth.signOut()}
|
|
181
|
+
renderLink={(item, children) => <Link href={item.href}>{children}</Link>}
|
|
182
|
+
>
|
|
183
|
+
{/* page content */}
|
|
184
|
+
</DashboardLayout>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Mobile bottom navigation (`mobileNavItems`)
|
|
188
|
+
|
|
189
|
+
A fixed bottom tab bar (mobile only, hidden on `md+`). Uses `react-icons/lu` or any icon component.
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
import { LuHouse, LuMessageCircle, LuUser } from "react-icons/lu";
|
|
193
|
+
|
|
194
|
+
<DashboardLayout
|
|
195
|
+
mobileNavItems={[
|
|
196
|
+
{ label: "Home", href: "/", icon: <LuHouse size={22} />, isActive: true },
|
|
197
|
+
{ label: "Messages", href: "/messages", icon: <LuMessageCircle size={22} />, badge: 6 },
|
|
198
|
+
{ label: "Profile", href: "/profile", icon: <LuUser size={22} /> },
|
|
199
|
+
]}
|
|
200
|
+
>
|
|
201
|
+
{/* ... */}
|
|
202
|
+
</DashboardLayout>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
`DashboardMobileNavItem` props:
|
|
206
|
+
|
|
207
|
+
| Prop | Type | Required | Description |
|
|
208
|
+
| --- | --- | --- | --- |
|
|
209
|
+
| `label` | `string` | ✓ | Text below the icon |
|
|
210
|
+
| `href` | `string` | ✓ | Unique key + navigation target |
|
|
211
|
+
| `icon` | `ReactNode` | ✓ | Icon (22 × 22 px recommended) |
|
|
212
|
+
| `isActive` | `boolean` | — | Highlights the active tab |
|
|
213
|
+
| `badge` | `number` | — | Count bubble on icon (capped at `99+`) |
|
|
214
|
+
|
|
215
|
+
### Doctor score card (`scoreCard`)
|
|
216
|
+
|
|
217
|
+
Shown above the sidebar nav on **desktop only**. Only pass this prop for doctor-role users.
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
<DashboardLayout
|
|
221
|
+
scoreCard={{
|
|
222
|
+
name: "Dr. Okedi Williams",
|
|
223
|
+
role: "Cardiologist",
|
|
224
|
+
avatarSrc: "/dr-okedi.jpg", // optional — initials fallback
|
|
225
|
+
tier: "gold", // "bronze" | "silver" | "gold" | "platinum" | "diamond"
|
|
226
|
+
medixScore: 847,
|
|
227
|
+
link: "/doctor/profile", // optional — makes the card clickable
|
|
228
|
+
}}
|
|
229
|
+
>
|
|
230
|
+
{/* ... */}
|
|
231
|
+
</DashboardLayout>
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Tier colours:
|
|
235
|
+
|
|
236
|
+
| Tier | Label colour | Avatar ring |
|
|
237
|
+
| --- | --- | --- |
|
|
238
|
+
| `bronze` | `#92400E` | `#D97706` |
|
|
239
|
+
| `silver` | `#475569` | `#94A3B8` |
|
|
240
|
+
| `gold` | `#D97706` | `#F59E0B` |
|
|
241
|
+
| `platinum` | `#0284C7` | `#38BDF8` |
|
|
242
|
+
| `diamond` | `#7C3AED` | `#A78BFA` |
|
|
243
|
+
|
|
244
|
+
### Greeting subtitle (`greetingSubtext`)
|
|
245
|
+
|
|
246
|
+
An optional second line below the greeting. The top bar expands from 64 px → 80 px automatically.
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
<DashboardLayout
|
|
250
|
+
greetingSubtext={`${new Date().toLocaleDateString("en-GB", {
|
|
251
|
+
weekday: "long", day: "numeric", month: "long", year: "numeric",
|
|
252
|
+
})} · 8 consultations scheduled today`}
|
|
253
|
+
>
|
|
254
|
+
{/* ... */}
|
|
255
|
+
</DashboardLayout>
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### All `DashboardLayout` props
|
|
259
|
+
|
|
260
|
+
| Prop | Type | Default | Description |
|
|
261
|
+
| --- | --- | --- | --- |
|
|
262
|
+
| `user` | `DashboardUser` | — | Name, email, optional avatar |
|
|
263
|
+
| `navGroups` | `DashboardNavGroup[]` | — | Sidebar navigation tree |
|
|
264
|
+
| `colorScheme` | `"blue" \| "purple"` | `"blue"` | Brand accent colour |
|
|
265
|
+
| `logo` | `ReactNode` | `<Logo />` | Override the sidebar logo |
|
|
266
|
+
| `greeting` | `string` | auto | Override "Good morning / afternoon / evening" |
|
|
267
|
+
| `greetingSubtext` | `string` | — | Subtitle line below the greeting |
|
|
268
|
+
| `mobileNavItems` | `DashboardMobileNavItem[]` | — | Mobile bottom tab bar items |
|
|
269
|
+
| `scoreCard` | `DashboardScoreCardData` | — | Doctor identity card (desktop only) |
|
|
270
|
+
| `topBarSlot` | `ReactNode` | — | Slot right of greeting (search, bell, etc.) |
|
|
271
|
+
| `dropdownItems` | `DashboardDropdownItem[]` | — | Extra user dropdown items |
|
|
272
|
+
| `sidebarWidth` | `number` | `220` | Sidebar width in px |
|
|
273
|
+
| `renderLink` | `(item, children) => ReactNode` | `<a>` | Router integration |
|
|
274
|
+
| `onLogout` | `() => void` | — | Logout callback |
|
|
275
|
+
|
|
276
|
+
## Footer
|
|
277
|
+
|
|
278
|
+
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
|
+
|
|
280
|
+
```tsx
|
|
281
|
+
import { Footer } from "@medixdeck/ui";
|
|
282
|
+
|
|
283
|
+
<Footer
|
|
284
|
+
colorScheme="purple"
|
|
285
|
+
certifications={[
|
|
286
|
+
{ name: "NDPR Compliant", href: "https://nitda.gov.ng" },
|
|
287
|
+
{ name: "MDCN Certified Platform", href: "https://mdcn.gov.ng" },
|
|
288
|
+
{ name: "ISO 27001", href: "#" },
|
|
289
|
+
]}
|
|
290
|
+
/>
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
| Prop | Type | Default | Description |
|
|
294
|
+
| --- | --- | --- | --- |
|
|
295
|
+
| `colorScheme` | `"blue" \| "purple"` | `"blue"` | Brand accent colour for links and social icons |
|
|
296
|
+
| `certifications` | `FooterCertification[]` | — | Compliance badges displayed above the copyright |
|
|
297
|
+
| `logo` | `ReactNode` | `<Logo />` | Override the default logo |
|
|
298
|
+
| `description` | `string` | — | Short company bio |
|
|
299
|
+
| `sections` | `FooterSection[]` | — | Link columns |
|
|
300
|
+
| `socialLinks` | `SocialLink[]` | — | Social media URLs |
|
|
301
|
+
| `newsletter` | `NewsletterProps` | — | Email subscription form config |
|
|
302
|
+
| `bottomLinks` | `BottomLink[]` | — | Terms/Privacy links next to copyright |
|
|
303
|
+
| `renderLink` | `(item, children) => ReactNode` | `<a>` | Router integration |
|
|
304
|
+
|
|
153
305
|
## Theme color reference
|
|
154
306
|
|
|
155
307
|
|