@ngrr/ds 0.1.12 → 0.1.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/AGENTS.md +154 -1
- package/AI.md +156 -1
- package/package.json +2 -1
package/AGENTS.md
CHANGED
|
@@ -448,4 +448,157 @@ Either populate with real, meaningful content or hide the slot entirely.
|
|
|
448
448
|
2. Identify all Figma variants → TypeScript props
|
|
449
449
|
3. Identify all tokens needed (colour, typography, spacing, sizing)
|
|
450
450
|
4. Implement component → stories → tests in that order
|
|
451
|
-
5. Export from component `index.ts` and from `src/index.ts`
|
|
451
|
+
5. Export from component `index.ts` and from `src/index.ts`
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
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
|
package/AI.md
CHANGED
|
@@ -1973,4 +1973,159 @@ export const DisabledVariant: Story = {
|
|
|
1973
1973
|
---
|
|
1974
1974
|
|
|
1975
1975
|
*Generated from DS-Nagarro design system docs. Last updated: 2026-03-10.*
|
|
1976
|
-
*Source files: `docs/foundations.md`, `docs/ds-guidelines.md`, and all component docs in `docs/`.*
|
|
1976
|
+
*Source files: `docs/foundations.md`, `docs/ds-guidelines.md`, and all component docs in `docs/`.*
|
|
1977
|
+
|
|
1978
|
+
---
|
|
1979
|
+
|
|
1980
|
+
---
|
|
1981
|
+
|
|
1982
|
+
## Consuming the Package — Layout & Navigation
|
|
1983
|
+
|
|
1984
|
+
> This section is for AI agents building apps with `@ngrr/ds`, not for building the library itself.
|
|
1985
|
+
|
|
1986
|
+
### Setup — mandatory CSS imports
|
|
1987
|
+
```tsx
|
|
1988
|
+
// main.tsx — must be first, before any other imports
|
|
1989
|
+
import '@ngrr/ds/style.css'
|
|
1990
|
+
import '@ngrr/ds/tokens.css'
|
|
1991
|
+
```
|
|
1992
|
+
|
|
1993
|
+
### Required CSS on the host app
|
|
1994
|
+
```css
|
|
1995
|
+
html, body { margin: 0; height: 100%; }
|
|
1996
|
+
#root { min-height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
|
|
1997
|
+
```
|
|
1998
|
+
|
|
1999
|
+
---
|
|
2000
|
+
|
|
2001
|
+
### AppShell — mandatory root layout
|
|
2002
|
+
|
|
2003
|
+
`AppShell` is the only permitted root layout wrapper. Every page must be inside it. Do not invent wrapper divs or custom layouts.
|
|
2004
|
+
```tsx
|
|
2005
|
+
import { AppShell, Navbar, Sidebar, Button, SearchBar, Avatar } from '@ngrr/ds';
|
|
2006
|
+
// Icons come from lucide-react — install separately: npm install lucide-react
|
|
2007
|
+
import { LayoutDashboard, FolderKanban, CheckSquare, Users, FileText, Settings } from 'lucide-react';
|
|
2008
|
+
|
|
2009
|
+
<AppShell
|
|
2010
|
+
header={
|
|
2011
|
+
<Navbar
|
|
2012
|
+
title="Dashboard"
|
|
2013
|
+
rightActions={<Button variant="primary" label="New project" />}
|
|
2014
|
+
/>
|
|
2015
|
+
}
|
|
2016
|
+
sidebar={
|
|
2017
|
+
<Sidebar
|
|
2018
|
+
selectorProps={{
|
|
2019
|
+
label: 'WorkScope',
|
|
2020
|
+
avatarProps: {
|
|
2021
|
+
size: 'xs',
|
|
2022
|
+
variant: 'organization',
|
|
2023
|
+
fill: 'initials',
|
|
2024
|
+
initials: 'WS',
|
|
2025
|
+
name: 'WorkScope',
|
|
2026
|
+
},
|
|
2027
|
+
}}
|
|
2028
|
+
showSearch
|
|
2029
|
+
searchSlot={<SearchBar placeholder="Search" />}
|
|
2030
|
+
sections={[
|
|
2031
|
+
{
|
|
2032
|
+
id: 'main',
|
|
2033
|
+
items: [
|
|
2034
|
+
{ id: 'dashboard', label: 'Dashboard', icon: <LayoutDashboard size={16} />, selected: true, onClick: () => {} },
|
|
2035
|
+
{ id: 'projects', label: 'Projects', icon: <FolderKanban size={16} />, onClick: () => {} },
|
|
2036
|
+
{ id: 'tasks', label: 'Tasks', icon: <CheckSquare size={16} />, onClick: () => {} },
|
|
2037
|
+
{ id: 'people', label: 'People', icon: <Users size={16} />, onClick: () => {} },
|
|
2038
|
+
{ id: 'notes', label: 'Notes', icon: <FileText size={16} />, onClick: () => {} },
|
|
2039
|
+
],
|
|
2040
|
+
},
|
|
2041
|
+
]}
|
|
2042
|
+
bottomContent={
|
|
2043
|
+
<>
|
|
2044
|
+
<SidebarMenuSelector
|
|
2045
|
+
variant="full"
|
|
2046
|
+
label="Settings"
|
|
2047
|
+
showIcon
|
|
2048
|
+
icon={<Settings size={16} />}
|
|
2049
|
+
onClick={() => {}}
|
|
2050
|
+
/>
|
|
2051
|
+
<SidebarMenuSelector
|
|
2052
|
+
variant="full"
|
|
2053
|
+
label="User Name"
|
|
2054
|
+
showAvatar
|
|
2055
|
+
avatarProps={{ size: 'xs', fill: 'initials', initials: 'UN', name: 'User Name' }}
|
|
2056
|
+
onClick={() => {}}
|
|
2057
|
+
/>
|
|
2058
|
+
</>
|
|
2059
|
+
}
|
|
2060
|
+
/>
|
|
2061
|
+
}
|
|
2062
|
+
>
|
|
2063
|
+
{/* page content goes here */}
|
|
2064
|
+
</AppShell>
|
|
2065
|
+
```
|
|
2066
|
+
|
|
2067
|
+
**AppShell props:**
|
|
2068
|
+
- `header` — `<Navbar />` only
|
|
2069
|
+
- `sidebar` — `<Sidebar />` only. Never pass `collapsed` manually — AppShell injects it automatically
|
|
2070
|
+
- `children` — main page content
|
|
2071
|
+
- `rightPanel` — optional, omit if not needed
|
|
2072
|
+
- `footer` — optional, omit if not needed
|
|
2073
|
+
|
|
2074
|
+
**Forbidden:**
|
|
2075
|
+
- Do not wrap AppShell in any other layout element
|
|
2076
|
+
- Do not add sidebar items beyond what is specified
|
|
2077
|
+
- Do not invent extra sections, items, or nav elements
|
|
2078
|
+
|
|
2079
|
+
---
|
|
2080
|
+
|
|
2081
|
+
### Navbar props
|
|
2082
|
+
- `variant` — `'title'` (default) for top-level pages | `'breadcrumbs'` for detail views only
|
|
2083
|
+
- `title` — page title, sentence case
|
|
2084
|
+
- `rightActions` — primary CTA button, rightmost position
|
|
2085
|
+
- `leftActions` — secondary actions on the left, omit if not needed
|
|
2086
|
+
- `onBackClick` — only used with `variant="breadcrumbs"`
|
|
2087
|
+
- `breadcrumbItems` — required only when `variant="breadcrumbs"`
|
|
2088
|
+
|
|
2089
|
+
**Rules:**
|
|
2090
|
+
- Never show a back arrow on top-level pages (Dashboard, Projects, Tasks, People, Notes)
|
|
2091
|
+
- Back arrow only on detail views using `variant="breadcrumbs"`
|
|
2092
|
+
- Primary CTA always in `rightActions`
|
|
2093
|
+
|
|
2094
|
+
---
|
|
2095
|
+
|
|
2096
|
+
### Sidebar props
|
|
2097
|
+
- `sections` — required. Only include sections explicitly specified. Never invent extra items.
|
|
2098
|
+
- `selectorProps` — workspace selector at the top. Always set `label` and `avatarProps`.
|
|
2099
|
+
- `showSearch` — set to `true` to show the search bar
|
|
2100
|
+
- `searchSlot` — pass a `<SearchBar />` component when `showSearch` is true
|
|
2101
|
+
- `bottomContent` — use for Settings and User Name, pinned to bottom with a divider. Always include these two items.
|
|
2102
|
+
- Never pass `collapsed` — AppShell controls it automatically
|
|
2103
|
+
|
|
2104
|
+
**SidebarMenuItem shape:**
|
|
2105
|
+
```ts
|
|
2106
|
+
{
|
|
2107
|
+
id: string;
|
|
2108
|
+
label: string; // sentence case always
|
|
2109
|
+
icon?: React.ReactNode; // lucide-react icon at size={16}
|
|
2110
|
+
selected?: boolean; // true only for the active page
|
|
2111
|
+
onClick?: () => void;
|
|
2112
|
+
showBadge?: boolean;
|
|
2113
|
+
badgeCount?: number;
|
|
2114
|
+
badgeVariant?: BadgeVariant;
|
|
2115
|
+
showAvatar?: boolean;
|
|
2116
|
+
avatarProps?: AvatarProps;
|
|
2117
|
+
}
|
|
2118
|
+
```
|
|
2119
|
+
|
|
2120
|
+
---
|
|
2121
|
+
|
|
2122
|
+
### Hard rules — always follow
|
|
2123
|
+
- `AppShell` is always the root — no exceptions
|
|
2124
|
+
- `DataTable` must never be wrapped in a `Card`
|
|
2125
|
+
- No back arrow on top-level pages: Dashboard, Projects, Tasks, People, Notes
|
|
2126
|
+
- CTA hierarchy: Primary (object creation, rightmost in Navbar) → Secondary → Ghost (Export, Share, Edit)
|
|
2127
|
+
- All labels and copy: sentence case always ("New project" not "New Project")
|
|
2128
|
+
- Icons: from `lucide-react` — install with `npm install lucide-react`
|
|
2129
|
+
- Tag variants: `success` = completed, `progress` = in progress, `warning` = at risk, `neutral` = not started
|
|
2130
|
+
- Settings and User Name always pinned to sidebar bottom via `bottomContent`
|
|
2131
|
+
- Sidebar always full viewport height — guaranteed by AppShell CSS rules above
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngrr/ds",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"main": "./dist/ds-nagarro.umd.js",
|
|
5
5
|
"module": "./dist/ds-nagarro.es.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"@lexical/react": "^0.41.0",
|
|
44
44
|
"@lexical/rich-text": "^0.41.0",
|
|
45
45
|
"@lexical/selection": "^0.41.0",
|
|
46
|
+
"@ngrr/ds": "^0.1.12",
|
|
46
47
|
"@react-spring/web": "^9.7.5",
|
|
47
48
|
"@visx/axis": "^3.12.0",
|
|
48
49
|
"@visx/brush": "^3.12.0",
|