mac-human-design 0.1.26 → 0.1.27
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 +48 -8
- package/changelog.md +15 -0
- package/package.json +1 -1
- package/scripts/verify-macos-design.mjs +20 -0
package/README.md
CHANGED
|
@@ -56,7 +56,15 @@ fn main() {
|
|
|
56
56
|
|
|
57
57
|
```ts
|
|
58
58
|
import { useState } from "react";
|
|
59
|
-
import {
|
|
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
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
{
|
|
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
|
-
|
|
75
|
-
|
|
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,21 @@
|
|
|
2
2
|
|
|
3
3
|
This file tracks changes between published npm versions of `mac-human-design`.
|
|
4
4
|
|
|
5
|
+
## 0.1.27
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added README usage and export documentation for `MacDataTable`,
|
|
10
|
+
`MacWindowToolbar`, `MacSegmentedControl`, and `SymbolIconButton`.
|
|
11
|
+
- Extended the macOS design verifier to require README coverage for shared
|
|
12
|
+
app-level macOS components and their labelled toolbar/table examples.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- The main README example now demonstrates a toolbar with a segmented control,
|
|
17
|
+
centered `SymbolIconButton`, and `MacDataTable` usage.
|
|
18
|
+
- Bumped the package to `0.1.27`.
|
|
19
|
+
|
|
5
20
|
## 0.1.26
|
|
6
21
|
|
|
7
22
|
### Added
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ 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");
|
|
8
9
|
const wrapperPath = path.join(repoRoot, "src", "components", "MacBaseUI.tsx");
|
|
9
10
|
const symbolIconButtonPath = path.join(repoRoot, "src", "components", "SymbolIconButton.tsx");
|
|
10
11
|
const galleryPath = path.join(repoRoot, "src", "components", "MacBaseUIGallery.tsx");
|
|
@@ -48,6 +49,7 @@ const sources = new Map(
|
|
|
48
49
|
);
|
|
49
50
|
const stylesSource = readText(stylesPath);
|
|
50
51
|
const packageJson = JSON.parse(readText(packageJsonPath));
|
|
52
|
+
const readmeSource = readText(readmePath);
|
|
51
53
|
const wrapperSource = readText(wrapperPath);
|
|
52
54
|
const symbolIconButtonSource = readText(symbolIconButtonPath);
|
|
53
55
|
const gallerySource = readText(galleryPath);
|
|
@@ -305,6 +307,24 @@ if (missingToolbarRequirements.length > 0) {
|
|
|
305
307
|
);
|
|
306
308
|
}
|
|
307
309
|
|
|
310
|
+
const missingPublicDocs = [
|
|
311
|
+
["README documents MacDataTable", /`MacDataTable`[\s\S]*Finder-style grid\/table primitive/],
|
|
312
|
+
["README documents MacWindowToolbar", /`MacWindowToolbar`[\s\S]*Tauri window toolbar/],
|
|
313
|
+
["README documents SymbolIconButton", /`SymbolIconButton`[\s\S]*centered SF Symbols icon button/],
|
|
314
|
+
["README usage imports MacDataTable", /import\s+\{[\s\S]*MacDataTable[\s\S]*\}\s+from\s+["']mac-human-design["']/],
|
|
315
|
+
["README usage imports MacWindowToolbar", /import\s+\{[\s\S]*MacWindowToolbar[\s\S]*\}\s+from\s+["']mac-human-design["']/],
|
|
316
|
+
["README usage imports SymbolIconButton", /import\s+\{[\s\S]*SymbolIconButton[\s\S]*\}\s+from\s+["']mac-human-design["']/],
|
|
317
|
+
["README shows labelled toolbar", /<MacWindowToolbar[\s\S]*ariaLabel=["']Demo toolbar["']/],
|
|
318
|
+
["README shows labelled data table", /<MacDataTable[\s\S]*ariaLabel=["']Demo files["']/],
|
|
319
|
+
].filter(([, pattern]) => !pattern.test(readmeSource));
|
|
320
|
+
|
|
321
|
+
if (missingPublicDocs.length > 0) {
|
|
322
|
+
fail(
|
|
323
|
+
"Missing README coverage for shared macOS component exports.",
|
|
324
|
+
missingPublicDocs.map(([label]) => label),
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
308
328
|
const missingSegmentedControlRequirements = [
|
|
309
329
|
["stable segmented control class", /"hd-mac-segmented-control"/],
|
|
310
330
|
["default accessible label", /ariaLabel = "Segmented control"/],
|