mac-human-design 0.1.29 → 0.1.30-preview.1

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,39 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.30-preview.1
6
+
7
+ ### Added
8
+
9
+ - Added shared `MacWindowToolbar` layout guardrails for dense toolbar groups,
10
+ including stable group height, row gaps, fixed child flex sizing, and fixed
11
+ `SymbolIconButton` flex basis inside toolbar groups.
12
+ - Added verifier coverage for toolbar group layout stability.
13
+
14
+ ### Changed
15
+
16
+ - Improved wrapped toolbar behavior so segmented controls and icon buttons keep
17
+ stable alignment as toolbar content density changes.
18
+ - Bumped the package to `0.1.30-preview.1` under the `preview` dist-tag.
19
+
20
+ ## 0.1.30-preview.0
21
+
22
+ ### Added
23
+
24
+ - Added a centered `SymbolIconButton` state layer for hover, focus, active, and
25
+ loading feedback that sits under the glyph and spinner without changing
26
+ button geometry.
27
+ - Added an emphasis motion token for slightly richer shared control feedback.
28
+ - Added verifier coverage for the icon button state layer, glyph stacking, and
29
+ emphasis motion token.
30
+
31
+ ### Changed
32
+
33
+ - Improved icon-only button interaction feedback so highlighted toolbar buttons
34
+ feel more deliberate while keeping SF Symbols optically centered.
35
+ - Bumped the package to `0.1.30-preview.0` and publish it under the `preview`
36
+ dist-tag while this UI/UX iteration is still being verified.
37
+
5
38
  ## 0.1.29
6
39
 
7
40
  ### Added
@@ -92,7 +92,7 @@ be reimplemented in consuming apps:
92
92
  | App pattern | Export | Contract |
93
93
  | --- | --- | --- |
94
94
  | Finder-style grid/table primitive | `MacDataTable` | Uses `table` semantics for static rows, upgrades to `grid` semantics for interactive rows, exposes row/column metadata, busy state, keyboard activation, selected row state, and focus-visible row styling. |
95
- | Tauri window toolbar | `MacWindowToolbar` | Provides a labelled `toolbar` landmark, labelled leading/content/trailing control groups, a root drag region, and no-drag regions around interactive controls. |
95
+ | Tauri window toolbar | `MacWindowToolbar` | Provides a labelled `toolbar` landmark, labelled leading/content/trailing control groups, a root drag region, no-drag regions around interactive controls, and stable wrapped-control sizing for dense icon toolbars. |
96
96
  | Segmented control | `MacSegmentedControl` | Wraps the shared macOS segmented toggle styling with accessible labels, stable class names, full-width layout support, and class/style pass-through. |
97
97
  | Centered SF Symbols icon button | `SymbolIconButton` | Renders through `MacIconButton`, defaults to `type="button"`, preserves fixed geometry while allowing style/class pass-through, supports tooltip offsets and per-symbol optical offsets, and exposes loading state with `aria-busy`. |
98
98
 
@@ -101,9 +101,10 @@ be reimplemented in consuming apps:
101
101
  Icon-only buttons use fixed-size grid containers with zero padding, zero
102
102
  line-height, centered grid content, middle inline alignment, and center transform
103
103
  origins. `SymbolIconButton` keeps the SF Symbol and loading spinner in the same
104
- grid cell, centers generated symbol masks, trims transparent symbol padding in
105
- the native symbol service, applies per-symbol optical offsets for asymmetric
106
- SF Symbols, and avoids vertical Motion offsets for icon-only controls.
104
+ grid cell, renders hover/focus/loading feedback as a centered state layer under
105
+ the glyph, centers generated symbol masks, trims transparent symbol padding in
106
+ the native symbol service, applies per-symbol optical offsets for asymmetric SF
107
+ Symbols, and avoids vertical Motion offsets for icon-only controls.
107
108
 
108
109
  The gallery at `examples/macos-base-ui-gallery` renders these wrappers across
109
110
  normal, selected, disabled, mixed, popup, dialog, and narrow-width states.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mac-human-design",
3
- "version": "0.1.29",
3
+ "version": "0.1.30-preview.1",
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",
@@ -39,6 +39,7 @@
39
39
  "check": "npm run typecheck && npm run verify:base-ui && npm run verify:design && npm run verify:gallery",
40
40
  "dev:gallery": "vite --host 127.0.0.1 examples/macos-base-ui-gallery",
41
41
  "publish": "npm publish --access public --ignore-scripts",
42
+ "publish:preview": "npm publish --access public --ignore-scripts --tag preview",
42
43
  "typecheck": "tsc --noEmit",
43
44
  "verify:base-ui": "node scripts/verify-base-ui-coverage.mjs",
44
45
  "verify:design": "node scripts/verify-macos-design.mjs",
@@ -86,6 +86,7 @@ const requiredStyleFeatures = [
86
86
  ["reduced motion support", /@media\s*\(prefers-reduced-motion:\s*reduce\)/],
87
87
  ["keyboard focus-visible support", /:focus-visible/],
88
88
  ["macOS blue accent token", /--hd-mac-blue:\s*#0a84ff/i],
89
+ ["emphasis motion token", /--hd-mac-motion-emphasis:\s*220ms\s+cubic-bezier\(0\.16,\s*1,\s*0\.3,\s*1\)/],
89
90
  ];
90
91
 
91
92
  const missingFeatures = requiredStyleFeatures
@@ -146,6 +147,25 @@ requireCssDeclarations(".hd-mac-symbol-icon-button", [
146
147
  ["fixed 30px height", /height\s*:\s*30px\s*;/],
147
148
  ["fixed 30px min-width", /min-width\s*:\s*30px\s*;/],
148
149
  ["fixed 30px min-height", /min-height\s*:\s*30px\s*;/],
150
+ ["stable state layer positioning", /position\s*:\s*relative\s*;/],
151
+ ["state layer isolation", /isolation\s*:\s*isolate\s*;/],
152
+ ["state layer clipping", /overflow\s*:\s*hidden\s*;/],
153
+ ]);
154
+
155
+ requireCssDeclarations(".hd-mac-symbol-icon-button::before", [
156
+ ["state layer content", /content\s*:\s*""\s*;/],
157
+ ["state layer behind glyph", /z-index\s*:\s*0\s*;/],
158
+ ["state layer full width", /width\s*:\s*100%\s*;/],
159
+ ["state layer full height", /height\s*:\s*100%\s*;/],
160
+ ["state layer hidden by default", /opacity\s*:\s*0\s*;/],
161
+ ["state layer scale starts centered", /transform\s*:\s*scale\(0\.82\)\s*;/],
162
+ ["state layer opacity transition", /opacity\s+var\(--hd-mac-motion-standard\)/],
163
+ ["state layer emphasis transition", /transform\s+var\(--hd-mac-motion-emphasis\)/],
164
+ ]);
165
+
166
+ requireCssDeclarations(".hd-mac-symbol-icon-button:hover::before", [
167
+ ["hover state layer visible", /opacity\s*:\s*1\s*;/],
168
+ ["hover state layer full scale", /transform\s*:\s*scale\(1\)\s*;/],
149
169
  ]);
150
170
 
151
171
  requireCssDeclarations(".hd-mac-symbol-icon-button::after", [
@@ -154,6 +174,7 @@ requireCssDeclarations(".hd-mac-symbol-icon-button::after", [
154
174
 
155
175
  requireCssDeclarations(".hd-mac-symbol-icon", [
156
176
  ["single grid cell placement", /grid-area\s*:\s*1\s*\/\s*1\s*;/],
177
+ ["glyph above state layer", /z-index\s*:\s*1\s*;/],
157
178
  ["flex centering display", /display\s*:\s*inline-flex\s*;/],
158
179
  ["vertical glyph centering", /align-items\s*:\s*center\s*;/],
159
180
  ["horizontal glyph centering", /justify-content\s*:\s*center\s*;/],
@@ -163,6 +184,7 @@ requireCssDeclarations(".hd-mac-symbol-icon", [
163
184
  "symbol optical centering translate",
164
185
  /translate\s*:\s*var\(--hd-mac-symbol-offset-x,\s*0px\)\s*var\(--hd-mac-symbol-offset-y,\s*0px\)\s*;/,
165
186
  ],
187
+ ["symbol opacity transition", /opacity\s+var\(--hd-mac-motion-standard\)/],
166
188
  ]);
167
189
 
168
190
  const sharedIconButtonRule = stylesSource.match(
@@ -316,6 +338,20 @@ if (missingToolbarRequirements.length > 0) {
316
338
  );
317
339
  }
318
340
 
341
+ requireCssDeclarations(".hd-mac-window-toolbar-group", [
342
+ ["toolbar group stable min height", /min-height\s*:\s*30px\s*;/],
343
+ ["toolbar group row gap", /row-gap\s*:\s*6px\s*;/],
344
+ ["toolbar group center transform origin", /transform-origin\s*:\s*center\s*;/],
345
+ ]);
346
+
347
+ requireCssDeclarations(".hd-mac-window-toolbar-group > *", [
348
+ ["toolbar controls fixed auto flex", /flex\s*:\s*0\s+0\s+auto\s*;/],
349
+ ]);
350
+
351
+ requireCssDeclarations(".hd-mac-window-toolbar-group > .hd-mac-symbol-icon-button", [
352
+ ["toolbar icon button fixed flex basis", /flex-basis\s*:\s*30px\s*;/],
353
+ ]);
354
+
319
355
  const missingPublicDocs = [
320
356
  ["README documents MacDataTable", /`MacDataTable`[\s\S]*Finder-style grid\/table primitive/],
321
357
  ["README documents MacWindowToolbar", /`MacWindowToolbar`[\s\S]*Tauri window toolbar/],
@@ -28,6 +28,7 @@
28
28
  --hd-mac-motion-standard: 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
29
29
  --hd-mac-motion-surface: 180ms cubic-bezier(0.16, 1, 0.3, 1);
30
30
  --hd-mac-motion-row: 120ms cubic-bezier(0.2, 0.8, 0.2, 1);
31
+ --hd-mac-motion-emphasis: 220ms cubic-bezier(0.16, 1, 0.3, 1);
31
32
  }
32
33
 
33
34
  @media (prefers-color-scheme: dark) {
@@ -76,6 +77,7 @@
76
77
  .hd-mac-avatar,
77
78
  .hd-mac-scroll-thumb,
78
79
  .hd-mac-status-message,
80
+ .hd-mac-symbol-icon-button::before,
79
81
  .hd-mac-symbol-icon-button[data-loading]::after,
80
82
  .hd-mac-window-toolbar,
81
83
  .hd-mac-data-table,
@@ -282,13 +284,41 @@
282
284
  height: 30px;
283
285
  min-height: 30px;
284
286
  border-radius: 7px;
287
+ position: relative;
288
+ isolation: isolate;
289
+ overflow: hidden;
290
+ }
291
+
292
+ .hd-mac-symbol-icon-button::before,
293
+ .hd-mac-symbol-icon-button::after {
294
+ grid-area: 1 / 1;
295
+ pointer-events: none;
285
296
  }
286
297
 
287
298
  .hd-mac-symbol-icon-button::after {
288
299
  grid-area: 1 / 1;
289
300
  }
290
301
 
302
+ .hd-mac-symbol-icon-button::before {
303
+ content: "";
304
+ z-index: 0;
305
+ width: 100%;
306
+ height: 100%;
307
+ border-radius: inherit;
308
+ background:
309
+ radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.28), transparent 54%),
310
+ var(--hd-mac-fill-hover);
311
+ opacity: 0;
312
+ transform: scale(0.82);
313
+ transition:
314
+ opacity var(--hd-mac-motion-standard),
315
+ transform var(--hd-mac-motion-emphasis),
316
+ background-color var(--hd-mac-motion-standard);
317
+ }
318
+
291
319
  .hd-mac-symbol-icon {
320
+ position: relative;
321
+ z-index: 1;
292
322
  grid-area: 1 / 1;
293
323
  display: inline-flex;
294
324
  align-items: center;
@@ -298,6 +328,9 @@
298
328
  margin: auto;
299
329
  transform-origin: center;
300
330
  translate: var(--hd-mac-symbol-offset-x, 0px) var(--hd-mac-symbol-offset-y, 0px);
331
+ transition:
332
+ opacity var(--hd-mac-motion-standard),
333
+ color var(--hd-mac-motion-standard);
301
334
  }
302
335
 
303
336
  .hd-mac-symbol-icon-mask {
@@ -325,6 +358,29 @@
325
358
  font: 700 12px/18px var(--hd-mac-font);
326
359
  }
327
360
 
361
+ .hd-mac-symbol-icon-button:hover::before {
362
+ opacity: 1;
363
+ transform: scale(1);
364
+ }
365
+
366
+ .hd-mac-symbol-icon-button:focus-visible::before {
367
+ opacity: 1;
368
+ transform: scale(1);
369
+ }
370
+
371
+ .hd-mac-symbol-icon-button:active::before,
372
+ .hd-mac-symbol-icon-button[data-loading]::before {
373
+ opacity: 1;
374
+ transform: scale(0.92);
375
+ background:
376
+ radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.18), transparent 54%),
377
+ var(--hd-mac-fill-pressed);
378
+ }
379
+
380
+ .hd-mac-symbol-icon-button[disabled]::before {
381
+ opacity: 0;
382
+ }
383
+
328
384
  .hd-mac-button[disabled],
329
385
  .hd-mac-select-trigger[disabled],
330
386
  .hd-mac-toggle[disabled],
@@ -980,6 +1036,7 @@
980
1036
 
981
1037
  .hd-mac-symbol-icon-button[data-loading]::after {
982
1038
  content: "";
1039
+ z-index: 2;
983
1040
  width: 15px;
984
1041
  height: 15px;
985
1042
  border: 1.5px solid color-mix(in srgb, currentColor 28%, transparent);
@@ -1426,12 +1483,52 @@
1426
1483
  .hd-mac-window-toolbar-content {
1427
1484
  display: inline-flex;
1428
1485
  min-width: 0;
1486
+ min-height: 30px;
1429
1487
  align-items: center;
1430
1488
  gap: 8px;
1489
+ row-gap: 6px;
1431
1490
  flex-wrap: wrap;
1432
1491
  transform-origin: center;
1433
1492
  }
1434
1493
 
1494
+ .hd-mac-window-toolbar-group {
1495
+ min-height: 30px;
1496
+ row-gap: 6px;
1497
+ transform-origin: center;
1498
+ }
1499
+
1500
+ .hd-mac-window-toolbar-content {
1501
+ min-height: 30px;
1502
+ row-gap: 6px;
1503
+ transform-origin: center;
1504
+ }
1505
+
1506
+ .hd-mac-window-toolbar-group > *,
1507
+ .hd-mac-window-toolbar-content > * {
1508
+ flex: 0 0 auto;
1509
+ }
1510
+
1511
+ .hd-mac-window-toolbar-group > * {
1512
+ flex: 0 0 auto;
1513
+ }
1514
+
1515
+ .hd-mac-window-toolbar-content > * {
1516
+ flex: 0 0 auto;
1517
+ }
1518
+
1519
+ .hd-mac-window-toolbar-group > .hd-mac-symbol-icon-button,
1520
+ .hd-mac-window-toolbar-content > .hd-mac-symbol-icon-button {
1521
+ flex-basis: 30px;
1522
+ }
1523
+
1524
+ .hd-mac-window-toolbar-group > .hd-mac-symbol-icon-button {
1525
+ flex-basis: 30px;
1526
+ }
1527
+
1528
+ .hd-mac-window-toolbar-content > .hd-mac-symbol-icon-button {
1529
+ flex-basis: 30px;
1530
+ }
1531
+
1435
1532
  .hd-mac-window-toolbar-title {
1436
1533
  min-width: 0;
1437
1534
  flex: 1;