Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
256 changes: 128 additions & 128 deletions libs/core/src/components.d.ts

Large diffs are not rendered by default.

56 changes: 51 additions & 5 deletions libs/core/src/components/pds-box/docs/pds-box.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,51 @@ Box is our primitive layout component. It is intended to be used as a building b

### Most Common Props
- `direction`: `"row"` (default, horizontal) or `"column"` (vertical stacking)
- `gap`: Spacing between items (`"none"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`)
- `gap`: Spacing between items - accepts t-shirt sizes (`"none"`, `"xxs"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`) or core spacing tokens (`"025"`, `"050"`, `"100"`, `"125"`, `"150"`, `"200"`, `"250"`, `"300"`, `"350"`, `"400"`, `"450"`, `"500"`, `"550"`, `"600"`, `"650"`, `"700"`, `"750"`, `"800"`)
- `padding`: Internal spacing (same size options as gap)
- `justify-content`: Horizontal alignment (`"start"`, `"center"`, `"end"`, `"space-between"`, etc.)
- `align-items`: Vertical alignment (`"start"`, `"center"`, `"end"`, `"baseline"`, `"stretch"`)

### Spacing Value Reference

**Core Spacing Tokens** map to specific pixel values from the Pine design system:

| Token | Pixel Value |
|-------|-------------|
| `"025"` | 2px |
| `"050"` | 4px |
| `"100"` | 8px |
| `"125"` | 10px |
| `"150"` | 12px |
| `"200"` | 16px |
| `"250"` | 20px |
| `"300"` | 24px |
| `"350"` | 28px |
| `"400"` | 32px |
| `"450"` | 36px |
| `"500"` | 40px |
| `"550"` | 44px |
| `"600"` | 48px |
| `"650"` | 52px |
| `"700"` | 56px |
| `"750"` | 60px |
| `"800"` | 64px |

**T-shirt Sizes** provide semantic spacing that adapts to the design system's scale:

| Size | Pixel Value |
|------|-------------|
| `"none"` | 0px |
| `"xxs"` | 2px |
| `"xs"` | 4px |
| `"sm"` | 8px |
| `"md"` | 16px |
| `"lg"` | 24px |
| `"xl"` | 32px |
| `"xxl"` | 40px |

Comment on lines +50 to +60
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

T‑shirt spacing table appears inconsistent with runtime scale. Please verify and align.

Row’s colGapMap uses xxs=.25rem (4px), xs=.5rem (8px), sm=1rem (16px), md=1.5rem (24px), lg=2.25rem (36px), xl=3rem (48px), xxl=4rem (64px), which conflicts with this table (xxs=2px…xxl=40px). Confirm the source of truth (tokens vs. rem scale) and update Box/Row docs accordingly.


I'll verify the spacing table inconsistency by examining the codebase for the actual runtime token definitions.


🏁 Script executed:

#!/bin/bash
# Find Row colGapMap definition
rg -n "colGapMap" --type=ts --type=js -C5

Length of output: 2465


🏁 Script executed:

#!/bin/bash
# Find spacing/gap token definitions in Box or core tokens
rg -n "xxs|xs.*px|gap.*map" --type=ts --type=js -g "*/tokens/*" -g "*/spacing*" -C2

Length of output: 148


🏁 Script executed:

#!/bin/bash
# Find the pds-box.mdx file and check context around lines 50-60
fd "pds-box.mdx" --type=f

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Search for spacing scale or token definitions in config/design files
fd "spacing|tokens|scale" --type=f | head -20

Length of output: 378


🏁 Script executed:

#!/bin/bash
# Look for any rem/px conversion or token definitions near pds-row or pds-box
rg -n "\.25rem|\.5rem|1rem|1\.5rem|2\.25rem|3rem|4rem" --type=ts --type=js -C3

Length of output: 7029


🏁 Script executed:

#!/bin/bash
# Search for Box padding/margin token definitions
rg -n "pds-box.*padding|pds-box.*margin|Box.*spacing" --type=ts --type=jsx --type=tsx -C3

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Look for design token or spacing constant definitions
fd ".*token.*" --type=f | grep -E "\.(ts|js|json)$" | head -15

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Find references to spacing scales (xxs, xs, sm, md, lg, xl, xxl)
rg -nP 'xxs|xs.*:\s*["\']?[\d.]+' --type=json --type=ts -C2 | head -40

Length of output: 68


🏁 Script executed:

#!/bin/bash
# Check the actual pds-box.mdx content around the table
cat libs/core/src/components/pds-box/docs/pds-box.mdx | sed -n '40,70p'

Length of output: 1074


🏁 Script executed:

#!/bin/bash
# Find pds-row component and colGapMap
fd "pds-row" -type d

Length of output: 170


🏁 Script executed:

#!/bin/bash
# Look for spacing definitions in a CSS or token file
rg -n "xxs.*2px|xs.*4px" --type=css --type=json --type=ts -C2

Length of output: 2996


🏁 Script executed:

#!/bin/bash
# Search for the actual spacing token source of truth
rg -n '"xxs"|"xs"|"sm"' --type=json -C5 | grep -A5 -B5 "px\|rem"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Find the pds-row index file or main definition
rg -n "colGapMap\|gapMap" -C10 --type=ts --type=jsx

Length of output: 27


🏁 Script executed:

#!/bin/bash
# Check for any spacing config or constants file
fd "config|constant|theme|design" --type=f -e ts -e js -e json | head -20

Length of output: 313


🏁 Script executed:

#!/bin/bash
# Search more broadly for gap or spacing related maps
rg -n "gap\s*[:=].*{" --type=ts --type=jsx -A10 | head -50

Length of output: 89


🏁 Script executed:

#!/bin/bash
# Look for the exact pixel values mentioned in the review
rg -n "2px|4px|8px|16px|24px|32px|40px" --type=ts --type=js --type=json | head -30

Length of output: 3130


🏁 Script executed:

#!/bin/bash
# Find Box component implementation
fd "pds-box" -type d

Length of output: 170


🏁 Script executed:

#!/bin/bash
# Check for spacing scale definition in a centralized location
rg -n "spacing.*scale|scale.*spacing" --type=ts --type=json -C5

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Look for the exact colGapMap with rem values
rg -n "colGapMap|gapMap" -B5 -A15 --type=ts --type=js

Length of output: 3562


🏁 Script executed:

#!/bin/bash
# Check if pds-box has spacing prop or similar
rg -n "padding|margin|gap|spacing" libs/core/src/components/pds-box/ -C2

Length of output: 206420


🏁 Script executed:

#!/bin/bash
# List contents of pds-box directory
find libs/core/src/components/pds-box -type f | head -20

Length of output: 409


🏁 Script executed:

#!/bin/bash
# List contents of pds-row directory if it exists
find libs/core/src/components/pds-row -type f 2>/dev/null | head -20

Length of output: 356


🏁 Script executed:

#!/bin/bash
# Check what's in the components directory
ls -la libs/core/src/components/ 2>/dev/null | head -20

Length of output: 1135


🏁 Script executed:

#!/bin/bash
# Search for token or scale definitions
rg -n "export.*spacing|export.*scale|export.*token" --type=ts --type=js | grep -i "xxs\|scale\|spacing"

Length of output: 0


🏁 Script executed:

#!/bin/bash
# Find any design tokens directory
find libs -name "*token*" -o -name "*scale*" 2>/dev/null | head -20

Length of output: 482


🏁 Script executed:

#!/bin/bash
# Look for the actual spacing map with all sizes
rg -n "xxs.*:" --type=ts --type=json -B2 -A2 | head -60

Length of output: 367


Update documentation: T-shirt size table has incorrect pixel values.

The pds-box.mdx spacing table shows xxs=2px, xs=4px...xl=32px, xxl=40px, but the actual SCSS tokens in pds-box.scss define xxs=4px, xs=8px...xl=40px (no xxl). Additionally, pds-row's colGapMap uses a different scale: xxs=4px...xl=48px, xxl=64px. Correct the documentation table to match the actual pds-box SCSS token values or clarify the separate scales used by Row vs. Box.

Use t-shirt sizes for consistent, design-system-aligned spacing, and core tokens when you need precise pixel control.

### Logical Properties
The Box component uses CSS logical properties for layout and spacing, which means properties are defined relative to the content's writing direction rather than physical directions. This makes the component more adaptable to different writing modes and languages.

Expand Down Expand Up @@ -247,7 +287,10 @@ Controls whether flex items wrap to new lines when they don't fit in the contain
### Gap
Controls spacing between items within the container.

**Options:** `"none"`, `"xxs"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`
**Options:**
- **T-shirt sizes:** `"none"`, `"xxs"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`
- **Core spacing tokens:** `"025"` through `"800"` (see [Spacing Value Reference](#spacing-value-reference) for exact pixel values)

**Responsive variants**: `gap-xs`, `gap-sm`, `gap-md`, `gap-lg`, `gap-xl`

<DocCanvas client:only
Expand Down Expand Up @@ -294,17 +337,20 @@ Controls spacing between items within the container.
### Padding
Controls internal spacing within the container.

**Options:** `"none"`, `"xxs"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`
**Options:**
- **T-shirt sizes:** `"none"`, `"xxs"`, `"xs"`, `"sm"`, `"md"`, `"lg"`, `"xl"`, `"xxl"`
- **Core spacing tokens:** `"025"` through `"800"` (see [Spacing Value Reference](#spacing-value-reference) for exact pixel values)

**Responsive variants**: `padding-xs`, `padding-sm`, `padding-md`, `padding-lg`, `padding-xl`

### Directional Padding
Control padding on specific sides using logical properties:
Control padding on specific sides using logical properties (accepts both t-shirt sizes and core spacing tokens):
- `padding-block-start` / `padding-block-end` (top/bottom)
- `padding-inline-start` / `padding-inline-end` (left/right in LTR)
- **All support responsive variants**

### Margin
Controls external spacing around the container using logical properties:
Controls external spacing around the container using logical properties (accepts both t-shirt sizes and core spacing tokens):
- `margin-block-start` / `margin-block-end` (top/bottom)
- `margin-inline-start` / `margin-inline-end` (left/right in LTR)
- **All support responsive variants**
Expand Down
60 changes: 57 additions & 3 deletions libs/core/src/components/pds-box/pds-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,25 @@ $gap-values: (
'md': var(--pine-dimension-md),
'lg': var(--pine-dimension-lg),
'xl': var(--pine-dimension-xl),
'xxl': var(--pine-dimension-2xl)
'xxl': var(--pine-dimension-2xl),
'025': var(--pine-dimension-025),
'050': var(--pine-dimension-050),
'100': var(--pine-dimension-100),
'125': var(--pine-dimension-125),
'150': var(--pine-dimension-150),
'200': var(--pine-dimension-200),
'250': var(--pine-dimension-250),
'300': var(--pine-dimension-300),
'350': var(--pine-dimension-350),
'400': var(--pine-dimension-400),
'450': var(--pine-dimension-450),
'500': var(--pine-dimension-500),
'550': var(--pine-dimension-550),
'600': var(--pine-dimension-600),
'650': var(--pine-dimension-650),
'700': var(--pine-dimension-700),
'750': var(--pine-dimension-750),
'800': var(--pine-dimension-800)
);

@each $breakpoint-name, $breakpoint-value in $breakpoints {
Expand All @@ -732,7 +750,25 @@ $margin-values: (
'md': var(--pine-dimension-md),
'lg': var(--pine-dimension-lg),
'xl': var(--pine-dimension-xl),
'xxl': var(--pine-dimension-2xl)
'xxl': var(--pine-dimension-2xl),
'025': var(--pine-dimension-025),
'050': var(--pine-dimension-050),
'100': var(--pine-dimension-100),
'125': var(--pine-dimension-125),
'150': var(--pine-dimension-150),
'200': var(--pine-dimension-200),
'250': var(--pine-dimension-250),
'300': var(--pine-dimension-300),
'350': var(--pine-dimension-350),
'400': var(--pine-dimension-400),
'450': var(--pine-dimension-450),
'500': var(--pine-dimension-500),
'550': var(--pine-dimension-550),
'600': var(--pine-dimension-600),
'650': var(--pine-dimension-650),
'700': var(--pine-dimension-700),
'750': var(--pine-dimension-750),
'800': var(--pine-dimension-800)
);

@each $breakpoint-name, $breakpoint-value in $breakpoints {
Expand Down Expand Up @@ -766,7 +802,25 @@ $padding-values: (
'md': var(--pine-dimension-md),
'lg': var(--pine-dimension-lg),
'xl': var(--pine-dimension-xl),
'xxl': var(--pine-dimension-2xl)
'xxl': var(--pine-dimension-2xl),
'025': var(--pine-dimension-025),
'050': var(--pine-dimension-050),
'100': var(--pine-dimension-100),
'125': var(--pine-dimension-125),
'150': var(--pine-dimension-150),
'200': var(--pine-dimension-200),
'250': var(--pine-dimension-250),
'300': var(--pine-dimension-300),
'350': var(--pine-dimension-350),
'400': var(--pine-dimension-400),
'450': var(--pine-dimension-450),
'500': var(--pine-dimension-500),
'550': var(--pine-dimension-550),
'600': var(--pine-dimension-600),
'650': var(--pine-dimension-650),
'700': var(--pine-dimension-700),
'750': var(--pine-dimension-750),
'800': var(--pine-dimension-800)
);

@each $breakpoint-name, $breakpoint-value in $breakpoints {
Expand Down
Loading
Loading