@ngrr/ds 0.1.31 → 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/AI.md CHANGED
@@ -80,6 +80,7 @@ These are the most violated rules. Read them first. They apply to every page, ev
80
80
  - Never use `--inset-*` for gaps between elements — use `--space-*`.
81
81
  - Never use `--space-*` for padding inside components — use `--inset-*`.
82
82
  - Never use generic semantic tokens or hardcoded hex for dataviz — always `--color-dataviz-*`.
83
+ - Always look on tokens.css for available tokens. Tokens are descriptive enough to understand the purpose. Use them accordingly. For example: You need a space between fields on a form, use --space-form-vertical. You need a border radius for a card, use --surface-card-radius. You need a gutter between cards, use --grid-cards-gutter.
83
84
 
84
85
  ### Tags
85
86
  - Always match Tag `variant` to the semantic meaning. Never use the same variant for all tags in a list.
@@ -255,6 +256,100 @@ Primitives (raw) → Semantic (intent) → Component (usage)
255
256
  ✅ `padding: var(--inset-large)` inside a card's content wrapper
256
257
  ❌ `gap: var(--inset-standard)` — wrong token family for gaps
257
258
 
259
+ **Spacing tokens — Source: Figma size collection**
260
+
261
+ space/* = gaps between sibling elements
262
+ inset/* = padding inside components
263
+ Rule: same name = same value across both scales.
264
+
265
+ | Token | Value |
266
+ |---|---|
267
+ | --space-none | 0px |
268
+ | --space-micro | 2px |
269
+ | --space-tiny | 4px |
270
+ | --space-small | 8px |
271
+ | --space-compact | 12px |
272
+ | --space-medium | 16px |
273
+ | --space-large | 24px |
274
+ | --space-spacious | 32px |
275
+ | --space-ample | 48px |
276
+ | --space-grand | 64px |
277
+ | --space-toolbar-standard | 16px (→ space-medium) |
278
+ | --space-form-vertical | 32px (→ space-spacious) |
279
+
280
+ | Token | Value |
281
+ |---|---|
282
+ | --inset-none | 0px |
283
+ | --inset-micro | 2px |
284
+ | --inset-tiny | 4px |
285
+ | --inset-small | 8px |
286
+ | --inset-compact | 12px |
287
+ | --inset-medium | 16px |
288
+ | --inset-large | 24px |
289
+ | --inset-spacious | 32px |
290
+
291
+ **Radius tokens — Source: Figma size collection → radius/***
292
+
293
+ | Token | Value | Use |
294
+ |---|---|---|
295
+ | --radius-none | 0px | Sharp corners |
296
+ | --radius-xsmall | 4px | Tooltips |
297
+ | --radius-small | 12px | Inputs, chips |
298
+ | --radius-standard | 16px | Buttons, tags, controls |
299
+ | --radius-large | 24px | Cards |
300
+ | --radius-xlarge | 32px | Modals |
301
+ | --radius-full | 9999px | Pills, avatars |
302
+
303
+ Component-specific aliases:
304
+ - --surface-tooltip-radius → --radius-xsmall (4px)
305
+ - --surface-popover-radius → --radius-standard (16px)
306
+ - --surface-card-radius → --radius-large (24px)
307
+ - --surface-modal-radius → --radius-xlarge (32px)
308
+
309
+ **Z-index tokens — Source: Figma size collection → z-index/***
310
+
311
+ | Token | Value |
312
+ |---|---|
313
+ | --z-index-sticky | 1020 |
314
+ | --z-index-fixed | 1030 |
315
+ | --z-index-modal-backdrop | 1040 |
316
+ | --z-index-modal | 1050 |
317
+ | --z-index-popover | 1060 |
318
+ | --z-index-tooltip | 1070 |
319
+
320
+ **Breakpoint tokens — Source: Figma size collection → breakpoints/***
321
+ NOTE: These must always be raw px values. Never use var() for breakpoints —
322
+ CSS custom properties do not resolve inside @media queries.
323
+
324
+ | Token | Value |
325
+ |---|---|
326
+ | --breakpoint-mobile | 480px |
327
+ | --breakpoint-tablet | 768px |
328
+ | --breakpoint-desktop | 1280px |
329
+ | --breakpoint-desktop-large | 1440px |
330
+
331
+ **Transition tokens — Source: Figma motion collection → transition/***
332
+
333
+ | Token | Value | Use |
334
+ |---|---|---|
335
+ | --transition-instant | 0ms ease | No animation |
336
+ | --transition-fast | 150ms ease | General UI |
337
+ | --transition-normal | 250ms ease | General UI |
338
+ | --transition-slow | 400ms ease | General UI |
339
+ | --transition-popover | 150ms ease | Popovers |
340
+ | --transition-switcher | 150ms ease | Toggle switches |
341
+ | --transition-drawer | 250ms ease | Drawers |
342
+ | --transition-modal | 0ms ease | Modals |
343
+
344
+ **Grid tokens — Source: Figma size collection → grid/***
345
+
346
+ | Token | Value |
347
+ |---|---|
348
+ | --grid-columns | 12 |
349
+ | --grid-gutter | 16px |
350
+ | --grid-margin-x | 16px |
351
+ | --grid-cards-gutter | 16px |
352
+
258
353
  ### Typography — never override
259
354
  ```tsx
260
355
  // CORRECT
@@ -270,6 +365,34 @@ Primitives (raw) → Semantic (intent) → Component (usage)
270
365
  <div style={{ fontFamily: 'Inter, sans-serif' }}> // never set font-family
271
366
  ```
272
367
 
368
+ ## Token invention rule
369
+
370
+ NEVER create CSS custom properties that do not correspond to a variable
371
+ in the Figma size, color, motion, or typography collections.
372
+
373
+ If a token does not exist in Figma, do not create it — not even as a
374
+ convenience alias or layout helper. If a token is needed, ask the user
375
+ to create it in Figma first, then mirror it in tokens.css.
376
+
377
+ ### Known fabricated token patterns to reject:
378
+
379
+ The following were invented by AI agents and removed. Never recreate them:
380
+
381
+ - layout/page-margin-x · layout/section-spacing-* · layout/card-padding
382
+ → These don't exist in Figma. Use --inset-medium and --space-* instead.
383
+ - space/comfortable · space/generous · space/ample (old names)
384
+ → Old invented names. Use --space-large, --space-spacious, --space-ample.
385
+ - inset/xlarge
386
+ → Renamed to --inset-spacious in Figma and CSS.
387
+ - radius/medium (6px) · radius/large (8px)
388
+ → Were wrong values. Correct scale is radius/small=12, radius/standard=16.
389
+ - font-size/display-s at 1.125rem
390
+ → Wrong value. Correct is 1.5rem (24px per Figma).
391
+ - --space-comfortable (20px)
392
+ → Never existed in Figma. Use --space-large (24px).
393
+ - var() inside @media queries using breakpoint tokens
394
+ → CSS custom properties don't resolve in @media. Always use raw px.
395
+
273
396
  ---
274
397
 
275
398
  ## Tag semantic mapping — critical
@@ -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;
@@ -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,