mac-human-design 0.1.11 → 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/changelog.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.13
6
+
7
+ ### Changed
8
+
9
+ - Refined shared control Motion defaults so buttons and icon buttons scale from
10
+ center without vertical hover or press translation.
11
+ - Added explicit center transform origins to macOS icon buttons and symbol
12
+ glyphs to keep animated icon-only controls visually anchored.
13
+ - Bumped the package to `0.1.13`.
14
+
15
+ ## 0.1.12
16
+
17
+ ### Fixed
18
+
19
+ - Rendered `SymbolIconButton` glyphs as direct children of the shared
20
+ `MacIconButton` render element, avoiding tooltip slot child placement
21
+ ambiguity.
22
+ - Tightened icon-button centering with explicit grid content centering,
23
+ zero line-height, vertical alignment, and grid-area placement for symbol
24
+ glyphs.
25
+
26
+ ### Changed
27
+
28
+ - Bumped the package to `0.1.12`.
29
+
5
30
  ## 0.1.11
6
31
 
7
32
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mac-human-design",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "Reusable macOS-oriented UI primitives and SF Symbols bridge for Tauri apps.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -111,14 +111,22 @@ function isDisabled(props: Record<string, unknown>) {
111
111
  return Boolean(props.disabled || props["data-disabled"] || props["aria-disabled"]);
112
112
  }
113
113
 
114
- function interactiveControlDefaults(props: Record<string, unknown>): MotionDefaults {
114
+ function interactiveControlDefaults(macClassName: string, props: Record<string, unknown>): MotionDefaults {
115
115
  if (isDisabled(props)) {
116
116
  return {};
117
117
  }
118
118
 
119
+ if (includesAny(macClassName, ["hd-mac-icon-button", "hd-mac-help-button"])) {
120
+ return {
121
+ whileHover: { scale: 1.04 },
122
+ whileTap: { scale: 0.94 },
123
+ transition: macFastTransition,
124
+ };
125
+ }
126
+
119
127
  return {
120
- whileHover: { y: -0.5, scale: 1.012 },
121
- whileTap: { y: 1, scale: 0.985 },
128
+ whileHover: { scale: 1.006 },
129
+ whileTap: { scale: 0.982 },
122
130
  transition: macFastTransition,
123
131
  };
124
132
  }
@@ -147,7 +155,7 @@ function getMotionDefaults(macClassName: string, props: Record<string, unknown>)
147
155
  "hd-mac-disclosure-trigger",
148
156
  ])
149
157
  ) {
150
- return interactiveControlDefaults(props);
158
+ return interactiveControlDefaults(macClassName, props);
151
159
  }
152
160
 
153
161
  if (macClassName.includes("hd-mac-input")) {
@@ -47,34 +47,34 @@ export function SymbolIconButton({
47
47
  minHeight: ICON_BUTTON_SIZE,
48
48
  borderRadius: ICON_BUTTON_RADIUS,
49
49
  }}
50
- />
50
+ >
51
+ <span
52
+ aria-hidden
53
+ className="hd-mac-symbol-icon"
54
+ style={{
55
+ width: glyphPx,
56
+ height: glyphPx,
57
+ color: "currentColor",
58
+ backgroundColor: symbolDataUrl ? "currentColor" : "transparent",
59
+ fontFamily: "-apple-system, BlinkMacSystemFont, sans-serif",
60
+ fontSize: symbolDataUrl ? "0" : glyphPx,
61
+ fontWeight: 500,
62
+ lineHeight: "1",
63
+ WebkitMaskImage: symbolDataUrl ? `url("${symbolDataUrl}")` : undefined,
64
+ WebkitMaskPosition: symbolDataUrl ? "center" : undefined,
65
+ WebkitMaskRepeat: symbolDataUrl ? "no-repeat" : undefined,
66
+ WebkitMaskSize: symbolDataUrl ? "contain" : undefined,
67
+ maskImage: symbolDataUrl ? `url("${symbolDataUrl}")` : undefined,
68
+ maskPosition: symbolDataUrl ? "center" : undefined,
69
+ maskRepeat: symbolDataUrl ? "no-repeat" : undefined,
70
+ maskSize: symbolDataUrl ? "contain" : undefined,
71
+ }}
72
+ >
73
+ {symbolDataUrl ? null : fallback}
74
+ </span>
75
+ </MacIconButton>
51
76
  }
52
- >
53
- <span
54
- aria-hidden
55
- className="hd-mac-symbol-icon"
56
- style={{
57
- width: glyphPx,
58
- height: glyphPx,
59
- color: "currentColor",
60
- backgroundColor: symbolDataUrl ? "currentColor" : "transparent",
61
- fontFamily: "-apple-system, BlinkMacSystemFont, sans-serif",
62
- fontSize: symbolDataUrl ? "0" : glyphPx,
63
- fontWeight: 500,
64
- lineHeight: "1",
65
- WebkitMaskImage: symbolDataUrl ? `url("${symbolDataUrl}")` : undefined,
66
- WebkitMaskPosition: symbolDataUrl ? "center" : undefined,
67
- WebkitMaskRepeat: symbolDataUrl ? "no-repeat" : undefined,
68
- WebkitMaskSize: symbolDataUrl ? "contain" : undefined,
69
- maskImage: symbolDataUrl ? `url("${symbolDataUrl}")` : undefined,
70
- maskPosition: symbolDataUrl ? "center" : undefined,
71
- maskRepeat: symbolDataUrl ? "no-repeat" : undefined,
72
- maskSize: symbolDataUrl ? "contain" : undefined,
73
- }}
74
- >
75
- {symbolDataUrl ? null : fallback}
76
- </span>
77
- </MacTooltip.Trigger>
77
+ />
78
78
  <MacTooltip.Portal>
79
79
  <MacTooltip.Positioner sideOffset={5}>
80
80
  <MacTooltip.Popup>{label}</MacTooltip.Popup>
@@ -232,7 +232,11 @@
232
232
  .hd-mac-symbol-icon-button {
233
233
  display: inline-grid;
234
234
  place-items: center;
235
+ place-content: center;
235
236
  padding: 0;
237
+ line-height: 0;
238
+ transform-origin: center;
239
+ vertical-align: middle;
236
240
  }
237
241
 
238
242
  .hd-mac-icon-button {
@@ -251,11 +255,14 @@
251
255
  }
252
256
 
253
257
  .hd-mac-symbol-icon {
258
+ grid-area: 1 / 1;
254
259
  display: inline-flex;
255
260
  align-items: center;
256
261
  justify-content: center;
257
262
  text-align: center;
258
263
  flex-shrink: 0;
264
+ margin: auto;
265
+ transform-origin: center;
259
266
  }
260
267
 
261
268
  .hd-mac-help-button {