mac-human-design 0.1.26 → 0.1.28

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/README.md CHANGED
@@ -56,7 +56,15 @@ fn main() {
56
56
 
57
57
  ```ts
58
58
  import { useState } from "react";
59
- import { MacButton, MacMotionProvider, MacSegmentedControl, MacSelect } from "mac-human-design";
59
+ import {
60
+ MacButton,
61
+ MacDataTable,
62
+ MacMotionProvider,
63
+ MacSegmentedControl,
64
+ MacSelect,
65
+ MacWindowToolbar,
66
+ SymbolIconButton,
67
+ } from "mac-human-design";
60
68
  import { SystemSymbolImage } from "mac-human-design/symbols";
61
69
  import "mac-human-design/styles/macos-base-ui.css";
62
70
 
@@ -65,14 +73,36 @@ export function Demo() {
65
73
 
66
74
  return (
67
75
  <MacMotionProvider>
76
+ <MacWindowToolbar
77
+ ariaLabel="Demo toolbar"
78
+ leading={
79
+ <MacSegmentedControl
80
+ options={[
81
+ { value: "files", label: "Files" },
82
+ { value: "settings", label: "Settings" },
83
+ ]}
84
+ value={tab}
85
+ onChange={setTab}
86
+ />
87
+ }
88
+ trailing={
89
+ <SymbolIconButton
90
+ label="Refresh"
91
+ symbolName="arrow.clockwise"
92
+ fallback="↻"
93
+ onClick={() => {}}
94
+ />
95
+ }
96
+ />
68
97
  <SystemSymbolImage symbolName="folder" sizePx={18} fallback="▢" />
69
- <MacSegmentedControl
70
- options={[
71
- { value: "files", label: "Files" },
72
- { value: "settings", label: "Settings" },
98
+ <MacDataTable
99
+ ariaLabel="Demo files"
100
+ columns={[
101
+ { id: "name", header: "Name", width: "minmax(120px, 1fr)", render: (row) => row.name },
102
+ { id: "kind", header: "Kind", width: "90px", render: (row) => row.kind },
73
103
  ]}
74
- value={tab}
75
- onChange={setTab}
104
+ rows={[{ name: "Documents", kind: "Folder" }]}
105
+ getRowKey={(row) => row.name}
76
106
  />
77
107
  <MacButton data-variant="primary">Continue</MacButton>
78
108
  <MacSelect.Root items={[{ label: "Files", value: "files" }]}>
@@ -118,8 +148,15 @@ The following components are now in the shared library and can be imported by an
118
148
  `MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`,
119
149
  `MacToggleGroup`, `MacSegmentedToggleGroup`,
120
150
  `MacSeparatedSegmentedToggleGroup`, `MacToolbar`, `MacTooltip`
151
+ - `MacDataTable`, a Finder-style grid/table primitive with loading, empty,
152
+ selected, keyboard, and interactive-row states
153
+ - `MacSegmentedControl`, a compact macOS segmented control wrapper with
154
+ accessible labels and full-width support
155
+ - `MacWindowToolbar`, a Motion-backed Tauri window toolbar with drag-region
156
+ and no-drag control group handling
121
157
  - `StatusMessage`
122
- - `SymbolIconButton`
158
+ - `SymbolIconButton`, a centered SF Symbols icon button with fallback glyphs,
159
+ loading state, tooltips, and pass-through styling hooks
123
160
  - `ViewDragRegion`
124
161
  - `isDraggableAreaTarget` utility
125
162
 
@@ -128,6 +165,9 @@ Example import:
128
165
  ```ts
129
166
  import {
130
167
  AppWindowShell,
168
+ MacDataTable,
169
+ MacSegmentedControl,
170
+ MacWindowToolbar,
131
171
  StatusMessage,
132
172
  SymbolIconButton,
133
173
  ViewDragRegion,
package/changelog.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.28
6
+
7
+ ### Added
8
+
9
+ - Added formal coverage documentation for `MacDataTable`, `MacWindowToolbar`,
10
+ `MacSegmentedControl`, and `SymbolIconButton` in
11
+ `docs/macos-base-ui-coverage.md`.
12
+ - Documented the shared icon-button alignment guarantees that keep icon-only
13
+ buttons centered across normal, loading, hover, and pressed states.
14
+ - Extended the macOS design verifier to require the app-level component docs
15
+ and icon alignment guarantees before release.
16
+
17
+ ### Changed
18
+
19
+ - Bumped the package to `0.1.28`.
20
+
21
+ ## 0.1.27
22
+
23
+ ### Added
24
+
25
+ - Added README usage and export documentation for `MacDataTable`,
26
+ `MacWindowToolbar`, `MacSegmentedControl`, and `SymbolIconButton`.
27
+ - Extended the macOS design verifier to require README coverage for shared
28
+ app-level macOS components and their labelled toolbar/table examples.
29
+
30
+ ### Changed
31
+
32
+ - The main README example now demonstrates a toolbar with a segmented control,
33
+ centered `SymbolIconButton`, and `MacDataTable` usage.
34
+ - Bumped the package to `0.1.27`.
35
+
5
36
  ## 0.1.26
6
37
 
7
38
  ### Added
@@ -84,6 +84,27 @@ render UI.
84
84
  | Window sheet | `MacDialog.SheetPopup` |
85
85
  | Sidebar drawer | `MacDrawer.SidebarPopup` |
86
86
 
87
+ ## App-Level Components
88
+
89
+ These shared components cover reusable macOS/Tauri app patterns that should not
90
+ be reimplemented in consuming apps:
91
+
92
+ | App pattern | Export | Contract |
93
+ | --- | --- | --- |
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. |
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
+ | 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 exposes loading state with `aria-busy`. |
98
+
99
+ ## Icon Button Alignment Guarantees
100
+
101
+ Icon-only buttons use fixed-size grid containers with zero padding, zero
102
+ line-height, centered grid content, middle inline alignment, and center transform
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, and avoids vertical Motion offsets for icon-only
106
+ controls.
107
+
87
108
  The gallery at `examples/macos-base-ui-gallery` renders these wrappers across
88
109
  normal, selected, disabled, mixed, popup, dialog, and narrow-width states.
89
110
 
@@ -102,6 +123,8 @@ The gate typechecks the library and verifies:
102
123
  - every component family is listed in this coverage document,
103
124
  - required native variants are exported,
104
125
  - nested native variant parts such as pop-up buttons, sheets, and sidebar drawers are exported,
126
+ - shared app-level components and icon-button alignment guarantees are
127
+ documented in this coverage file,
105
128
  - every class assigned by the wrapper module has a matching CSS selector,
106
129
  - every public wrapper export is represented in the visual gallery source,
107
130
  - macOS design features are present: system font stack, dark mode, reduced motion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mac-human-design",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
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",
@@ -5,6 +5,8 @@ import { fileURLToPath } from "node:url";
5
5
  const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
6
6
  const stylesPath = path.join(repoRoot, "src", "styles", "macosBaseUi.css");
7
7
  const packageJsonPath = path.join(repoRoot, "package.json");
8
+ const readmePath = path.join(repoRoot, "README.md");
9
+ const coverageDocsPath = path.join(repoRoot, "docs", "macos-base-ui-coverage.md");
8
10
  const wrapperPath = path.join(repoRoot, "src", "components", "MacBaseUI.tsx");
9
11
  const symbolIconButtonPath = path.join(repoRoot, "src", "components", "SymbolIconButton.tsx");
10
12
  const galleryPath = path.join(repoRoot, "src", "components", "MacBaseUIGallery.tsx");
@@ -48,6 +50,8 @@ const sources = new Map(
48
50
  );
49
51
  const stylesSource = readText(stylesPath);
50
52
  const packageJson = JSON.parse(readText(packageJsonPath));
53
+ const readmeSource = readText(readmePath);
54
+ const coverageDocsSource = readText(coverageDocsPath);
51
55
  const wrapperSource = readText(wrapperPath);
52
56
  const symbolIconButtonSource = readText(symbolIconButtonPath);
53
57
  const gallerySource = readText(galleryPath);
@@ -305,6 +309,45 @@ if (missingToolbarRequirements.length > 0) {
305
309
  );
306
310
  }
307
311
 
312
+ const missingPublicDocs = [
313
+ ["README documents MacDataTable", /`MacDataTable`[\s\S]*Finder-style grid\/table primitive/],
314
+ ["README documents MacWindowToolbar", /`MacWindowToolbar`[\s\S]*Tauri window toolbar/],
315
+ ["README documents SymbolIconButton", /`SymbolIconButton`[\s\S]*centered SF Symbols icon button/],
316
+ ["README usage imports MacDataTable", /import\s+\{[\s\S]*MacDataTable[\s\S]*\}\s+from\s+["']mac-human-design["']/],
317
+ ["README usage imports MacWindowToolbar", /import\s+\{[\s\S]*MacWindowToolbar[\s\S]*\}\s+from\s+["']mac-human-design["']/],
318
+ ["README usage imports SymbolIconButton", /import\s+\{[\s\S]*SymbolIconButton[\s\S]*\}\s+from\s+["']mac-human-design["']/],
319
+ ["README shows labelled toolbar", /<MacWindowToolbar[\s\S]*ariaLabel=["']Demo toolbar["']/],
320
+ ["README shows labelled data table", /<MacDataTable[\s\S]*ariaLabel=["']Demo files["']/],
321
+ ].filter(([, pattern]) => !pattern.test(readmeSource));
322
+
323
+ if (missingPublicDocs.length > 0) {
324
+ fail(
325
+ "Missing README coverage for shared macOS component exports.",
326
+ missingPublicDocs.map(([label]) => label),
327
+ );
328
+ }
329
+
330
+ const missingCoverageDocs = [
331
+ ["coverage docs include app-level section", /## App-Level Components/],
332
+ ["coverage docs document MacDataTable", /Finder-style grid\/table primitive[\s\S]*`MacDataTable`/],
333
+ ["coverage docs document MacWindowToolbar", /Tauri window toolbar[\s\S]*`MacWindowToolbar`/],
334
+ ["coverage docs document MacSegmentedControl", /Segmented control[\s\S]*`MacSegmentedControl`/],
335
+ ["coverage docs document SymbolIconButton", /Centered SF Symbols icon button[\s\S]*`SymbolIconButton`/],
336
+ ["coverage docs include icon alignment section", /## Icon Button Alignment Guarantees/],
337
+ ["coverage docs mention fixed-size grid containers", /fixed-size grid containers/],
338
+ ["coverage docs mention zero line-height", /zero[\s-]line-height/],
339
+ ["coverage docs mention loading spinner grid cell", /loading spinner[\s\S]*same\s+grid\s+cell/],
340
+ ["coverage docs mention transparent symbol padding trim", /trims transparent symbol padding/],
341
+ ["coverage docs mention no vertical Motion offsets", /avoids vertical Motion offsets/],
342
+ ].filter(([, pattern]) => !pattern.test(coverageDocsSource));
343
+
344
+ if (missingCoverageDocs.length > 0) {
345
+ fail(
346
+ "Missing coverage documentation for shared macOS app components and icon-button alignment.",
347
+ missingCoverageDocs.map(([label]) => label),
348
+ );
349
+ }
350
+
308
351
  const missingSegmentedControlRequirements = [
309
352
  ["stable segmented control class", /"hd-mac-segmented-control"/],
310
353
  ["default accessible label", /ariaLabel = "Segmented control"/],