mac-human-design 0.1.13 → 0.1.14

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,22 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.14
6
+
7
+ ### Added
8
+
9
+ - Added `SymbolIconButton` coverage to the macOS Base UI gallery, including a
10
+ fallback-only state for non-Tauri render paths.
11
+
12
+ ### Changed
13
+
14
+ - Added a `symbolEnabled` prop to `SymbolIconButton` so consumers and examples
15
+ can intentionally render fallback glyphs without invoking the Tauri symbol
16
+ bridge.
17
+ - Split masked SF Symbol and fallback glyph rendering into separate centered
18
+ elements, with fallback-specific typography and optical vertical correction.
19
+ - Bumped the package to `0.1.14`.
20
+
5
21
  ## 0.1.13
6
22
 
7
23
  ### 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.14",
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
  />
@@ -265,6 +265,18 @@
265
265
  transform-origin: center;
266
266
  }
267
267
 
268
+ .hd-mac-symbol-icon-mask {
269
+ line-height: 0;
270
+ }
271
+
272
+ .hd-mac-symbol-icon-fallback {
273
+ color: currentColor;
274
+ font-family: -apple-system, BlinkMacSystemFont, sans-serif;
275
+ font-weight: 500;
276
+ line-height: 1;
277
+ transform: translateY(-0.04em);
278
+ }
279
+
268
280
  .hd-mac-help-button {
269
281
  display: inline-grid;
270
282
  width: 18px;