@ngrr/ds 0.1.13 → 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/AGENTS.md CHANGED
@@ -1,7 +1,10 @@
1
- # DS-Nagarro Component Library — Agent Briefing
1
+ # DS-Nagarro Component Library — Building Guide
2
2
 
3
- > **READ THIS FIRST.** This file is the entry point for every coding session.
3
+ > **READ THIS FIRST.** This file is the entry point for every coding session on the component library.
4
4
  > Do not write any code until you have read and understood this document.
5
+ >
6
+ > **This file is for building components.** For component usage specs, layout rules, and
7
+ > navigation patterns when building apps *with* `@ngrr/ds`, read `AI.md` instead.
5
8
 
6
9
  ---
7
10
 
@@ -28,7 +31,9 @@ This is the React component library for **DS-Nagarro**, an enterprise design sys
28
31
 
29
32
  ```
30
33
  ds-nagarro/
31
- ├── AGENTS.md ← You are here
34
+ ├── AGENTS.md ← You are here (building guide)
35
+ ├── AI.md ← Usage guide (for consuming the package)
36
+ ├── CLAUDE.md ← Claude Code pointer (redirects here)
32
37
  ├── tokens.css ← All design tokens as CSS custom properties
33
38
  ├── src/
34
39
  │ ├── index.ts ← Public API — export all components
@@ -50,7 +55,7 @@ ds-nagarro/
50
55
  │ ├── main.ts
51
56
  │ └── preview.ts ← Imports tokens.css globally
52
57
  └── docs/ ← Design system documentation (read-only)
53
- └── [copied from /mnt/project/ — see Documentation section]
58
+ └── [component spec files — see table below]
54
59
  ```
55
60
 
56
61
  ---
@@ -59,7 +64,7 @@ ds-nagarro/
59
64
 
60
65
  All component specs live in the `docs/` directory. Each file is authoritative for its component(s). Read the relevant doc **before** generating any component.
61
66
 
62
- | File | Components Covered |
67
+ | File | Components covered |
63
68
  |---|---|
64
69
  | `button.md` | Button (Main, Destructive, Toggle, Vertical) |
65
70
  | `avatar.md` | Avatar, AvatarGroup |
@@ -452,153 +457,4 @@ Either populate with real, meaningful content or hide the slot entirely.
452
457
 
453
458
  ---
454
459
 
455
- ## Consuming the Package Layout & Navigation
456
-
457
- > This section is for AI agents building apps with `@ngrr/ds`, not for building the library itself.
458
-
459
- ### Setup — mandatory CSS imports
460
- ```tsx
461
- // main.tsx — must be first, before any other imports
462
- import '@ngrr/ds/style.css'
463
- import '@ngrr/ds/tokens.css'
464
- ```
465
-
466
- ### Required CSS on the host app
467
- ```css
468
- html, body { margin: 0; height: 100%; }
469
- #root { min-height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
470
- ```
471
-
472
- ---
473
-
474
- ### AppShell — mandatory root layout
475
-
476
- `AppShell` is the only permitted root layout wrapper. Every page must be inside it. Do not invent wrapper divs or custom layouts.
477
- ```tsx
478
- import { AppShell, Navbar, Sidebar, Button, SearchBar, Avatar } from '@ngrr/ds';
479
- // Icons come from lucide-react — install separately: npm install lucide-react
480
- import { LayoutDashboard, FolderKanban, CheckSquare, Users, FileText, Settings } from 'lucide-react';
481
-
482
- <AppShell
483
- header={
484
- <Navbar
485
- title="Dashboard"
486
- rightActions={<Button variant="primary" label="New project" />}
487
- />
488
- }
489
- sidebar={
490
- <Sidebar
491
- selectorProps={{
492
- label: 'WorkScope',
493
- avatarProps: {
494
- size: 'xs',
495
- variant: 'organization',
496
- fill: 'initials',
497
- initials: 'WS',
498
- name: 'WorkScope',
499
- },
500
- }}
501
- showSearch
502
- searchSlot={<SearchBar placeholder="Search" />}
503
- sections={[
504
- {
505
- id: 'main',
506
- items: [
507
- { id: 'dashboard', label: 'Dashboard', icon: <LayoutDashboard size={16} />, selected: true, onClick: () => {} },
508
- { id: 'projects', label: 'Projects', icon: <FolderKanban size={16} />, onClick: () => {} },
509
- { id: 'tasks', label: 'Tasks', icon: <CheckSquare size={16} />, onClick: () => {} },
510
- { id: 'people', label: 'People', icon: <Users size={16} />, onClick: () => {} },
511
- { id: 'notes', label: 'Notes', icon: <FileText size={16} />, onClick: () => {} },
512
- ],
513
- },
514
- ]}
515
- bottomContent={
516
- <>
517
- <SidebarMenuSelector
518
- variant="full"
519
- label="Settings"
520
- showIcon
521
- icon={<Settings size={16} />}
522
- onClick={() => {}}
523
- />
524
- <SidebarMenuSelector
525
- variant="full"
526
- label="User Name"
527
- showAvatar
528
- avatarProps={{ size: 'xs', fill: 'initials', initials: 'UN', name: 'User Name' }}
529
- onClick={() => {}}
530
- />
531
- </>
532
- }
533
- />
534
- }
535
- >
536
- {/* page content goes here */}
537
- </AppShell>
538
- ```
539
-
540
- **AppShell props:**
541
- - `header` — `<Navbar />` only
542
- - `sidebar` — `<Sidebar />` only. Never pass `collapsed` manually — AppShell injects it automatically
543
- - `children` — main page content
544
- - `rightPanel` — optional, omit if not needed
545
- - `footer` — optional, omit if not needed
546
-
547
- **Forbidden:**
548
- - Do not wrap AppShell in any other layout element
549
- - Do not add sidebar items beyond what is specified
550
- - Do not invent extra sections, items, or nav elements
551
-
552
- ---
553
-
554
- ### Navbar props
555
- - `variant` — `'title'` (default) for top-level pages | `'breadcrumbs'` for detail views only
556
- - `title` — page title, sentence case
557
- - `rightActions` — primary CTA button, rightmost position
558
- - `leftActions` — secondary actions on the left, omit if not needed
559
- - `onBackClick` — only used with `variant="breadcrumbs"`
560
- - `breadcrumbItems` — required only when `variant="breadcrumbs"`
561
-
562
- **Rules:**
563
- - Never show a back arrow on top-level pages (Dashboard, Projects, Tasks, People, Notes)
564
- - Back arrow only on detail views using `variant="breadcrumbs"`
565
- - Primary CTA always in `rightActions`
566
-
567
- ---
568
-
569
- ### Sidebar props
570
- - `sections` — required. Only include sections explicitly specified. Never invent extra items.
571
- - `selectorProps` — workspace selector at the top. Always set `label` and `avatarProps`.
572
- - `showSearch` — set to `true` to show the search bar
573
- - `searchSlot` — pass a `<SearchBar />` component when `showSearch` is true
574
- - `bottomContent` — use for Settings and User Name, pinned to bottom with a divider. Always include these two items.
575
- - Never pass `collapsed` — AppShell controls it automatically
576
-
577
- **SidebarMenuItem shape:**
578
- ```ts
579
- {
580
- id: string;
581
- label: string; // sentence case always
582
- icon?: React.ReactNode; // lucide-react icon at size={16}
583
- selected?: boolean; // true only for the active page
584
- onClick?: () => void;
585
- showBadge?: boolean;
586
- badgeCount?: number;
587
- badgeVariant?: BadgeVariant;
588
- showAvatar?: boolean;
589
- avatarProps?: AvatarProps;
590
- }
591
- ```
592
-
593
- ---
594
-
595
- ### Hard rules — always follow
596
- - `AppShell` is always the root — no exceptions
597
- - `DataTable` must never be wrapped in a `Card`
598
- - No back arrow on top-level pages: Dashboard, Projects, Tasks, People, Notes
599
- - CTA hierarchy: Primary (object creation, rightmost in Navbar) → Secondary → Ghost (Export, Share, Edit)
600
- - All labels and copy: sentence case always ("New project" not "New Project")
601
- - Icons: from `lucide-react` — install with `npm install lucide-react`
602
- - Tag variants: `success` = completed, `progress` = in progress, `warning` = at risk, `neutral` = not started
603
- - Settings and User Name always pinned to sidebar bottom via `bottomContent`
604
- - Sidebar always full viewport height — guaranteed by AppShell CSS rules above
460
+ *Source of truth for building DS-Nagarro components. Last updated: 2026-03-16.*