mac-human-design 0.1.13 → 0.1.15

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,32 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.15
6
+
7
+ ### Changed
8
+
9
+ - Added shared macOS motion timing tokens and applied them to controls and
10
+ floating surfaces for more consistent UI motion.
11
+ - Replaced button active-state vertical translation with non-positional pressed
12
+ feedback, keeping icon-only controls visually anchored while pressed.
13
+ - Bumped the package to `0.1.15`.
14
+
15
+ ## 0.1.14
16
+
17
+ ### Added
18
+
19
+ - Added `SymbolIconButton` coverage to the macOS Base UI gallery, including a
20
+ fallback-only state for non-Tauri render paths.
21
+
22
+ ### Changed
23
+
24
+ - Added a `symbolEnabled` prop to `SymbolIconButton` so consumers and examples
25
+ can intentionally render fallback glyphs without invoking the Tauri symbol
26
+ bridge.
27
+ - Split masked SF Symbol and fallback glyph rendering into separate centered
28
+ elements, with fallback-specific typography and optical vertical correction.
29
+ - Bumped the package to `0.1.14`.
30
+
5
31
  ## 0.1.13
6
32
 
7
33
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mac-human-design",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
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",
@@ -56,6 +56,7 @@ import {
56
56
  import { MacDataTable } from "./MacDataTable";
57
57
  import { MacSegmentedControl } from "./MacSegmentedControl";
58
58
  import { MacWindowToolbar } from "./MacWindowToolbar";
59
+ import { SymbolIconButton } from "./SymbolIconButton";
59
60
 
60
61
  const choices = [
61
62
  { label: "General", value: "general" },
@@ -93,6 +94,9 @@ export function MacBaseUIGallery() {
93
94
  <MacDestructiveButton>Delete</MacDestructiveButton>
94
95
  <MacPlainButton>Cancel</MacPlainButton>
95
96
  <MacIconButton aria-label="Add">+</MacIconButton>
97
+ <SymbolIconButton label="Refresh" symbolName="arrow.clockwise" fallback="↻" onClick={() => {}} />
98
+ <SymbolIconButton label="Upload" symbolName="square.and.arrow.up" fallback="↑" onClick={() => {}} />
99
+ <SymbolIconButton label="Fallback refresh" symbolName="arrow.clockwise" fallback="↻" onClick={() => {}} symbolEnabled={false} />
96
100
  <MacHelpButton aria-label="Help">?</MacHelpButton>
97
101
  </GallerySection>
98
102
 
@@ -9,6 +9,7 @@ type SymbolIconButtonProps = {
9
9
  disabled?: boolean;
10
10
  isLoading?: boolean;
11
11
  iconSizePx?: number;
12
+ symbolEnabled?: boolean;
12
13
  };
13
14
 
14
15
  const ICON_BUTTON_SIZE = "30px";
@@ -22,10 +23,12 @@ export function SymbolIconButton({
22
23
  disabled,
23
24
  isLoading,
24
25
  iconSizePx = 18,
26
+ symbolEnabled = true,
25
27
  }: SymbolIconButtonProps) {
26
28
  const { dataUrl: symbolDataUrl } = useSystemSymbol({
27
29
  symbolName,
28
30
  cssPixelSize: iconSizePx,
31
+ enabled: symbolEnabled,
29
32
  });
30
33
  const glyphPx = `${iconSizePx}px`;
31
34
 
@@ -48,30 +51,38 @@ export function SymbolIconButton({
48
51
  borderRadius: ICON_BUTTON_RADIUS,
49
52
  }}
50
53
  >
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>
54
+ {symbolDataUrl ? (
55
+ <span
56
+ aria-hidden
57
+ className="hd-mac-symbol-icon hd-mac-symbol-icon-mask"
58
+ style={{
59
+ width: glyphPx,
60
+ height: glyphPx,
61
+ color: "currentColor",
62
+ backgroundColor: "currentColor",
63
+ WebkitMaskImage: `url("${symbolDataUrl}")`,
64
+ WebkitMaskPosition: "center",
65
+ WebkitMaskRepeat: "no-repeat",
66
+ WebkitMaskSize: "contain",
67
+ maskImage: `url("${symbolDataUrl}")`,
68
+ maskPosition: "center",
69
+ maskRepeat: "no-repeat",
70
+ maskSize: "contain",
71
+ }}
72
+ />
73
+ ) : (
74
+ <span
75
+ aria-hidden
76
+ className="hd-mac-symbol-icon hd-mac-symbol-icon-fallback"
77
+ style={{
78
+ width: glyphPx,
79
+ height: glyphPx,
80
+ fontSize: glyphPx,
81
+ }}
82
+ >
83
+ {fallback}
84
+ </span>
85
+ )}
75
86
  </MacIconButton>
76
87
  }
77
88
  />
@@ -24,6 +24,9 @@
24
24
  0 1px 0 rgba(255, 255, 255, 0.86) inset,
25
25
  0 1px 1px rgba(15, 23, 42, 0.08);
26
26
  --hd-mac-focus-ring: 0 0 0 3px color-mix(in srgb, var(--hd-mac-blue) 28%, transparent);
27
+ --hd-mac-motion-fast: 90ms cubic-bezier(0.2, 0.8, 0.2, 1);
28
+ --hd-mac-motion-standard: 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
29
+ --hd-mac-motion-surface: 180ms cubic-bezier(0.16, 1, 0.3, 1);
27
30
  }
28
31
 
29
32
  @media (prefers-color-scheme: dark) {
@@ -157,11 +160,11 @@
157
160
  user-select: none;
158
161
  white-space: nowrap;
159
162
  transition:
160
- background-color 120ms ease,
161
- border-color 120ms ease,
162
- box-shadow 120ms ease,
163
- filter 120ms ease,
164
- transform 80ms ease;
163
+ background-color var(--hd-mac-motion-standard),
164
+ border-color var(--hd-mac-motion-standard),
165
+ box-shadow var(--hd-mac-motion-standard),
166
+ filter var(--hd-mac-motion-fast),
167
+ transform var(--hd-mac-motion-fast);
165
168
  }
166
169
 
167
170
  .hd-mac-button:hover,
@@ -177,8 +180,10 @@
177
180
  .hd-mac-toggle:active,
178
181
  .hd-mac-toolbar-button:active,
179
182
  .hd-mac-stepper-button:active {
180
- transform: translateY(1px);
181
183
  filter: brightness(0.98);
184
+ box-shadow:
185
+ 0 1px 0 rgba(0, 0, 0, 0.06) inset,
186
+ 0 1px 1px rgba(15, 23, 42, 0.04);
182
187
  }
183
188
 
184
189
  .hd-mac-button:focus-visible,
@@ -265,6 +270,18 @@
265
270
  transform-origin: center;
266
271
  }
267
272
 
273
+ .hd-mac-symbol-icon-mask {
274
+ line-height: 0;
275
+ }
276
+
277
+ .hd-mac-symbol-icon-fallback {
278
+ color: currentColor;
279
+ font-family: -apple-system, BlinkMacSystemFont, sans-serif;
280
+ font-weight: 500;
281
+ line-height: 1;
282
+ transform: translateY(-0.04em);
283
+ }
284
+
268
285
  .hd-mac-help-button {
269
286
  display: inline-grid;
270
287
  width: 18px;
@@ -503,6 +520,11 @@
503
520
  box-shadow: var(--hd-mac-shadow);
504
521
  backdrop-filter: saturate(180%) blur(28px);
505
522
  -webkit-backdrop-filter: saturate(180%) blur(28px);
523
+ transform-origin: center;
524
+ transition:
525
+ opacity var(--hd-mac-motion-surface),
526
+ transform var(--hd-mac-motion-surface),
527
+ box-shadow var(--hd-mac-motion-surface);
506
528
  }
507
529
 
508
530
  .hd-mac-popup,