@medixdeck/ui 0.1.22 → 0.1.23
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 +48 -53
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +189 -137
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -306,17 +306,17 @@ export function Header() {
|
|
|
306
306
|
|
|
307
307
|
### `NavItem` properties
|
|
308
308
|
|
|
309
|
-
| Prop
|
|
310
|
-
|
|
311
|
-
| `label`
|
|
312
|
-
| `href`
|
|
313
|
-
| `children`
|
|
314
|
-
| `description` | `string`
|
|
315
|
-
| `icon`
|
|
316
|
-
| `badge`
|
|
317
|
-
| `isActive`
|
|
318
|
-
| `isExternal`
|
|
319
|
-
| `onClick`
|
|
309
|
+
| Prop | Type | Description |
|
|
310
|
+
| ------------- | ------------------------------- | ------------------------------------------------------------- |
|
|
311
|
+
| `label` | `string` | Display text for the item |
|
|
312
|
+
| `href` | `string` | Target URL (optional for dropdown triggers) |
|
|
313
|
+
| `children` | `NavItem[]` | Nested items for desktop floating menus and mobile accordions |
|
|
314
|
+
| `description` | `string` | Subtitle text displayed below label in dropdown items |
|
|
315
|
+
| `icon` | `ReactNode` | Leading icon element |
|
|
316
|
+
| `badge` | `string \| number \| ReactNode` | Status tag or count (e.g. `"Popular"`, `"NDPR"`) |
|
|
317
|
+
| `isActive` | `boolean` | Highlights active route item |
|
|
318
|
+
| `isExternal` | `boolean` | Opens link in a new tab with an external arrow icon |
|
|
319
|
+
| `onClick` | `() => void` | Optional click callback |
|
|
320
320
|
|
|
321
321
|
---
|
|
322
322
|
|
|
@@ -470,15 +470,15 @@ It is completely safe across SSR and CSR runtimes (Next.js App/Pages Router, Vit
|
|
|
470
470
|
|
|
471
471
|
`DashboardEnvironmentBannerConfig` props:
|
|
472
472
|
|
|
473
|
-
| Prop
|
|
474
|
-
|
|
475
|
-
| `environment` | `"auto" \| "production" \| "live" \| "sandbox" \| "test" \| "development" \| "staging" \| "preview"` | `"auto"` | Environment classification
|
|
476
|
-
| `badgeLabel`
|
|
477
|
-
| `message`
|
|
478
|
-
| `status`
|
|
479
|
-
| `action`
|
|
480
|
-
| `dismissible` | `boolean`
|
|
481
|
-
| `onDismiss`
|
|
473
|
+
| Prop | Type | Default | Description |
|
|
474
|
+
| ------------- | ---------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------- |
|
|
475
|
+
| `environment` | `"auto" \| "production" \| "live" \| "sandbox" \| "test" \| "development" \| "staging" \| "preview"` | `"auto"` | Environment classification |
|
|
476
|
+
| `badgeLabel` | `string` | auto | Uppercase badge label (e.g., `"SANDBOX ENVIRONMENT"`) |
|
|
477
|
+
| `message` | `string` | auto | Descriptive warning / notice text |
|
|
478
|
+
| `status` | `"warning" \| "info" \| "error" \| "neutral"` | auto | Visual color scheme (amber warning, blue info, red error) |
|
|
479
|
+
| `action` | `ReactNode` | — | Action link or button on the right |
|
|
480
|
+
| `dismissible` | `boolean` | `false` | Shows a close (✕) button |
|
|
481
|
+
| `onDismiss` | `() => void` | — | Called when the close button is clicked |
|
|
482
482
|
|
|
483
483
|
### Collapsible Sidebar (`collapsible`, `isCollapsed`, `onCollapseChange`)
|
|
484
484
|
|
|
@@ -491,14 +491,9 @@ On desktop (`md+`), `DashboardLayout` supports shrinking the sidebar into a comp
|
|
|
491
491
|
|
|
492
492
|
```tsx
|
|
493
493
|
// 1. Uncontrolled with default expanded or collapsed
|
|
494
|
-
<DashboardLayout
|
|
495
|
-
collapsible={true}
|
|
496
|
-
defaultCollapsed={false}
|
|
497
|
-
user={user}
|
|
498
|
-
navGroups={navGroups}
|
|
499
|
-
>
|
|
494
|
+
<DashboardLayout collapsible={true} defaultCollapsed={false} user={user} navGroups={navGroups}>
|
|
500
495
|
{children}
|
|
501
|
-
</DashboardLayout
|
|
496
|
+
</DashboardLayout>;
|
|
502
497
|
|
|
503
498
|
// 2. Controlled collapse state
|
|
504
499
|
function App() {
|
|
@@ -521,32 +516,32 @@ function App() {
|
|
|
521
516
|
|
|
522
517
|
### All `DashboardLayout` props
|
|
523
518
|
|
|
524
|
-
| Prop
|
|
525
|
-
|
|
|
526
|
-
| `user`
|
|
527
|
-
| `navGroups`
|
|
528
|
-
| `collapsible`
|
|
529
|
-
| `defaultCollapsed`
|
|
530
|
-
| `isCollapsed`
|
|
531
|
-
| `onCollapseChange`
|
|
532
|
-
| `sidebarWidth`
|
|
533
|
-
| `collapsedSidebarWidth`
|
|
534
|
-
| `collapseTogglePlacement
|
|
535
|
-
| `collapsedLogo`
|
|
536
|
-
| `colorScheme`
|
|
537
|
-
| `environment`
|
|
538
|
-
| `showEnvironmentBanner` | `boolean`
|
|
539
|
-
| `environmentBanner`
|
|
540
|
-
| `environmentBannerSlot`
|
|
541
|
-
| `logo`
|
|
542
|
-
| `greeting`
|
|
543
|
-
| `greetingSubtext`
|
|
544
|
-
| `mobileNavItems`
|
|
545
|
-
| `scoreCard`
|
|
546
|
-
| `topBarSlot`
|
|
547
|
-
| `dropdownItems`
|
|
548
|
-
| `renderLink`
|
|
549
|
-
| `onLogout`
|
|
519
|
+
| Prop | Type | Default | Description |
|
|
520
|
+
| ------------------------- | -------------------------------------------------- | ---------------------- | ------------------------------------------------- |
|
|
521
|
+
| `user` | `DashboardUser` | — | Name, email, optional avatar |
|
|
522
|
+
| `navGroups` | `DashboardNavGroup[]` | — | Sidebar navigation tree |
|
|
523
|
+
| `collapsible` | `boolean` | `true` | Enables collapsible sidebar icon rail |
|
|
524
|
+
| `defaultCollapsed` | `boolean` | `false` | Initial collapsed state (uncontrolled) |
|
|
525
|
+
| `isCollapsed` | `boolean` | — | Controlled collapsed state |
|
|
526
|
+
| `onCollapseChange` | `(collapsed: boolean) => void` | — | Fired when sidebar collapse state toggles |
|
|
527
|
+
| `sidebarWidth` | `number` | `220` | Full sidebar width in px |
|
|
528
|
+
| `collapsedSidebarWidth` | `number` | `68` | Compact icon rail width in px |
|
|
529
|
+
| `collapseTogglePlacement` | `"sidebar-header" \| "topbar" \| "both" \| "none"` | `"sidebar-header"` | Placement of collapse/expand toggle buttons |
|
|
530
|
+
| `collapsedLogo` | `ReactNode` | `<Logo type="icon" />` | Custom logo displayed in collapsed mode |
|
|
531
|
+
| `colorScheme` | `"blue" \| "purple"` | `"blue"` | Brand accent colour |
|
|
532
|
+
| `environment` | `DashboardEnvironment` | `"auto"` | Auto-detects test/sandbox/staging environments |
|
|
533
|
+
| `showEnvironmentBanner` | `boolean` | auto | Force show (`true`) or suppress (`false`) banner |
|
|
534
|
+
| `environmentBanner` | `DashboardEnvironmentBannerConfig` | — | Detailed banner message, action, & dismiss config |
|
|
535
|
+
| `environmentBannerSlot` | `ReactNode` | — | Custom slot overriding the entire banner |
|
|
536
|
+
| `logo` | `ReactNode` | `<Logo />` | Override the sidebar logo |
|
|
537
|
+
| `greeting` | `string` | auto | Override "Good morning / afternoon / evening" |
|
|
538
|
+
| `greetingSubtext` | `string` | — | Subtitle line below the greeting |
|
|
539
|
+
| `mobileNavItems` | `DashboardMobileNavItem[]` | — | Mobile bottom tab bar items |
|
|
540
|
+
| `scoreCard` | `DashboardScoreCardData` | — | Doctor identity card (desktop only) |
|
|
541
|
+
| `topBarSlot` | `ReactNode` | — | Slot right of greeting (search, bell, etc.) |
|
|
542
|
+
| `dropdownItems` | `DashboardDropdownItem[]` | — | Extra user dropdown items |
|
|
543
|
+
| `renderLink` | `(item, children) => ReactNode` | `<a>` | Router integration |
|
|
544
|
+
| `onLogout` | `() => void` | — | Logout callback |
|
|
550
545
|
|
|
551
546
|
## Footer
|
|
552
547
|
|