@ngrr/ds 0.1.29 → 0.1.32

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 CHANGED
@@ -1 +1,50 @@
1
- # DSN
1
+ # DS-Nagarro
2
+
3
+ AI-first React component library.
4
+
5
+ ---
6
+
7
+ ## For AI agents
8
+
9
+ Read `node_modules/@ngrr/ds/AI.md` before writing any code.
10
+ That file contains all the rules for using this design system correctly — layout, tokens, patterns, and component usage guidelines.
11
+
12
+ Add this to your project's `.cursorrules` to load it automatically:
13
+
14
+ ```
15
+ Read node_modules/@ngrr/ds/AI.md before writing any code.
16
+ ```
17
+
18
+ ---
19
+
20
+ ## Setup
21
+
22
+ ```bash
23
+ npm install @ngrr/ds --legacy-peer-deps
24
+ ```
25
+
26
+ ```tsx
27
+ // main.tsx — before everything else
28
+ import '@ngrr/ds/style.css'
29
+ import '@ngrr/ds/tokens.css'
30
+ ```
31
+
32
+ ```css
33
+ /* index.css */
34
+ html, body { margin: 0; height: 100%; }
35
+ #root { height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
36
+ ```
37
+
38
+ ---
39
+
40
+ ## Resources
41
+
42
+ - **Storybook:** https://699f3dfd3540c3f346868d55-kmskdmltrn.chromatic.com/
43
+ - **Usage rules:** `node_modules/@ngrr/ds/AI.md`
44
+ - **Contributing:** `AGENTS.md` in the source repository
45
+
46
+ ---
47
+
48
+ ## Stack
49
+
50
+ React 18+ · TypeScript · Styled Components v6 · Vite
@@ -1,10 +1,10 @@
1
1
  import { default as React } from 'react';
2
2
  import { LucideIcon } from 'lucide-react';
3
- export type AvatarSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
3
+ export type AvatarSize = 'xxs' | 'xs' | 'sm' | 'lg' | 'xl' | 'xxl';
4
4
  export type AvatarVariant = 'profile' | 'organization';
5
5
  export type AvatarFill = 'picture' | 'initials' | 'icon';
6
6
  export interface AvatarProps {
7
- /** Visual size of the avatar. Default: `'md'` (40×40px). */
7
+ /** Visual size of the avatar. Default: `'sm'` (32×32px). */
8
8
  size?: AvatarSize;
9
9
  /** Shape: circle for a person, rounded square for an org. Default: `'profile'`. */
10
10
  variant?: AvatarVariant;
@@ -1,11 +1,11 @@
1
- export type BadgeSize = 'sm' | 'lg' | 'dot';
1
+ export type BadgeSize = 'sm' | 'dot';
2
2
  export type BadgeVariant = 'highlight-soft' | 'highlight-strong' | 'informative' | 'inverted' | 'critical';
3
3
  export interface BadgeProps {
4
4
  /**
5
5
  * Visual size of the badge.
6
- * - `sm` — 16 × 16 px minimum; shows count text.
7
- * - `lg` — 24 × 24 px minimum; shows count text.
8
- * - `dot` — 8 × 8 px circle; no text; use for presence/status signals only.
6
+ * - `sm` — 16px visual pill (--size-16) inside a transparent wrapper with
7
+ * 4px padding-block (--inset-tiny), giving a 24px total footprint.
8
+ * - `dot` — 8px circle (--size-8); no text; use for presence signals only.
9
9
  * @default 'sm'
10
10
  */
11
11
  size?: BadgeSize;
@@ -662,7 +662,7 @@ function qe({ size: e = "md", variant: t = "secondary", children: n, leadingIcon
662
662
  }
663
663
  //#endregion
664
664
  //#region src/components/atoms/Avatar/Avatar.tsx
665
- function Je({ size: e = "md", variant: t = "profile", fill: n = "initials", src: r, initials: i, icon: a, name: o, alt: s, className: c, style: l }) {
665
+ function Je({ size: e = "sm", variant: t = "profile", fill: n = "initials", src: r, initials: i, icon: a, name: o, alt: s, className: c, style: l }) {
666
666
  let u = ["dsn-avatar", c].filter(Boolean).join(" "), d = o ?? void 0, f = o ? void 0 : !0, p = i ? i.trim().slice(0, 2).toUpperCase() : void 0;
667
667
  return /* @__PURE__ */ g("div", {
668
668
  className: u,
@@ -717,15 +717,27 @@ function Ye({ size: e = "sm", avatars: t, maxVisible: n = 5, className: r, "aria
717
717
  //#endregion
718
718
  //#region src/components/atoms/Badge/Badge.tsx
719
719
  function Xe({ size: e = "sm", variant: t = "highlight-soft", count: n, className: r, "aria-label": i }) {
720
- let a = e === "dot", o = a || n === void 0 ? void 0 : n > 99 ? "99+" : String(n);
721
- return /* @__PURE__ */ h("span", {
722
- className: ["dsn-badge", r].filter(Boolean).join(" "),
720
+ let a = e === "dot", o = a || n === void 0 ? void 0 : n > 99 ? "99+" : String(n), s = ["dsn-badge", r].filter(Boolean).join(" ");
721
+ return a ? /* @__PURE__ */ h("span", {
722
+ className: s,
723
+ "data-size": e,
724
+ "data-variant": t,
725
+ "aria-label": i,
726
+ role: i ? "img" : void 0,
727
+ "aria-hidden": i ? void 0 : !0
728
+ }) : /* @__PURE__ */ h("span", {
729
+ className: s,
723
730
  "data-size": e,
724
731
  "data-variant": t,
725
732
  "aria-label": i,
726
733
  role: i ? "img" : void 0,
727
- "aria-hidden": a && !i ? !0 : void 0,
728
- children: o
734
+ children: /* @__PURE__ */ h("span", {
735
+ className: "dsn-badge__pill",
736
+ children: /* @__PURE__ */ h("span", {
737
+ className: "dsn-badge__label",
738
+ children: o
739
+ })
740
+ })
729
741
  });
730
742
  }
731
743
  //#endregion
@@ -6433,9 +6445,12 @@ function jr({ variant: e = "inline", severity: t = "default", title: n, descript
6433
6445
  onMouseLeave: w,
6434
6446
  children: [
6435
6447
  /* @__PURE__ */ h("span", {
6436
- className: "dsn-toast-icon",
6448
+ className: "dsn-toast-icon-wrapper",
6437
6449
  "aria-hidden": "true",
6438
- children: d ?? Ar(t)
6450
+ children: /* @__PURE__ */ h("span", {
6451
+ className: "dsn-toast-icon",
6452
+ children: d ?? Ar(t)
6453
+ })
6439
6454
  }),
6440
6455
  /* @__PURE__ */ g("div", {
6441
6456
  className: "dsn-toast-content",