@helloimjolopez-pathway/pathway-components 0.2.1 → 0.2.2
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.
|
@@ -398,8 +398,8 @@ export function Button({
|
|
|
398
398
|
};
|
|
399
399
|
|
|
400
400
|
// Icon slot wrapper, iconWrap = outer slot size, iconInner = rendered glyph size.
|
|
401
|
-
//
|
|
402
|
-
//
|
|
401
|
+
// opsz 24, as Figma draws its icons, so the glyph fills the slot in Figma's
|
|
402
|
+
// proportion (changed 2026-11-03; opsz 20 drew it about 6% small).
|
|
403
403
|
const iconWrapStyle = {
|
|
404
404
|
display: "inline-flex",
|
|
405
405
|
alignItems: "center",
|
|
@@ -410,7 +410,7 @@ export function Button({
|
|
|
410
410
|
fontSize: sz.iconInner,
|
|
411
411
|
color: iconColor,
|
|
412
412
|
transition: "color var(--motion-duration-2) var(--motion-easing-standard)",
|
|
413
|
-
fontVariationSettings: "'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz'
|
|
413
|
+
fontVariationSettings: "'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24",
|
|
414
414
|
};
|
|
415
415
|
|
|
416
416
|
// Outer button element, handles the touch-target zone
|
package/components/icon/icon.jsx
CHANGED
|
@@ -34,9 +34,12 @@
|
|
|
34
34
|
* SideNav is FILL 1 throughout; the Widget header is FILL 0.
|
|
35
35
|
* wght 400 everywhere in Pathway.
|
|
36
36
|
* GRAD 0 everywhere in Pathway.
|
|
37
|
-
* opsz
|
|
38
|
-
*
|
|
39
|
-
*
|
|
37
|
+
* opsz 24 everywhere in Pathway (changed 2026-11-03). Figma's icons are the
|
|
38
|
+
* font's opsz-24 artwork scaled to each frame, so the glyph fills its
|
|
39
|
+
* box in the same proportion at every size. Tracking opsz to the frame
|
|
40
|
+
* (which the font clamps to 20 below 20px) redrew each glyph about 6%
|
|
41
|
+
* smaller inside the same box: a 16 help icon drew 12.5 against
|
|
42
|
+
* Figma's 13.33.
|
|
40
43
|
*
|
|
41
44
|
* SIZE IS THE FRAME, NEVER THE VECTOR. Figma nests a wrapper (24), an icon
|
|
42
45
|
* frame (16) and the drawn vector (~12), because the Material grid has about
|
|
@@ -58,8 +61,8 @@ export const ICON_SOURCES = {
|
|
|
58
61
|
webSymbols: "https://github.com/google/material-design-icons/tree/master/symbols/web",
|
|
59
62
|
};
|
|
60
63
|
|
|
61
|
-
/** Pathway's fixed axis values. Only FILL
|
|
62
|
-
export const AXES = { wght: 400, GRAD: 0 };
|
|
64
|
+
/** Pathway's fixed axis values. Only FILL ever varies. */
|
|
65
|
+
export const AXES = { wght: 400, GRAD: 0, opsz: 24 };
|
|
63
66
|
|
|
64
67
|
/**
|
|
65
68
|
* The per-size table from docs/design-system-spec.md §7.2. `wrapper` is the
|
|
@@ -109,10 +112,9 @@ export function Icon({
|
|
|
109
112
|
display: "block",
|
|
110
113
|
flexShrink: 0,
|
|
111
114
|
color,
|
|
112
|
-
// opsz
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
fontVariationSettings: `'FILL' ${fill}, 'wght' ${AXES.wght}, 'GRAD' ${AXES.GRAD}, 'opsz' ${frame}`,
|
|
115
|
+
// opsz is fixed at 24, Figma's artwork, so the glyph fills the frame
|
|
116
|
+
// exactly as it does in Figma. See AXES.
|
|
117
|
+
fontVariationSettings: `'FILL' ${fill}, 'wght' ${AXES.wght}, 'GRAD' ${AXES.GRAD}, 'opsz' ${AXES.opsz}`,
|
|
116
118
|
...style,
|
|
117
119
|
}}
|
|
118
120
|
{...rest}
|
|
@@ -276,10 +276,9 @@ export function SideNavItem({
|
|
|
276
276
|
// parent is centred by its line box, not by its own art, so
|
|
277
277
|
// it rode high inside the 24px wrap.
|
|
278
278
|
display: "block",
|
|
279
|
-
// opsz
|
|
280
|
-
//
|
|
281
|
-
|
|
282
|
-
fontVariationSettings: `'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' ${L.iconInner}` }}>
|
|
279
|
+
// opsz 24, as Figma draws its icons, so the glyph fills the
|
|
280
|
+
// box in Figma's proportion (changed 2026-11-03).
|
|
281
|
+
fontVariationSettings: `'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24` }}>
|
|
283
282
|
{item.icon}
|
|
284
283
|
</span>
|
|
285
284
|
: React.cloneElement(item.icon, { style: { color: iconColor } })}
|