mac-human-design 0.1.30-preview.3 → 0.1.30-preview.4
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 +26 -14
- package/changelog.md +66 -0
- package/docs/macos-base-ui-coverage.md +30 -27
- package/examples/macos-base-ui-gallery-tauri/src-tauri/Cargo.lock +4602 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/Cargo.toml +12 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/build.rs +4 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/capabilities/default.json +7 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/icons/icon.png +0 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/src/main.rs +16 -0
- package/examples/macos-base-ui-gallery-tauri/src-tauri/tauri.conf.json +24 -0
- package/package.json +12 -6
- package/src/components/MacBaseUI.tsx +1 -0
- package/src/components/MacBaseUIControls.tsx +17 -6
- package/src/components/MacBaseUIGallery.tsx +18 -7
- package/src/components/MacBaseUIGalleryAdvanced.tsx +149 -258
- package/src/components/MacBaseUIGalleryButtons.tsx +116 -0
- package/src/components/MacBaseUIGalleryControls.tsx +146 -125
- package/src/components/MacBaseUIGalleryShared.tsx +9 -0
- package/src/components/MacBaseUIGalleryStateful.tsx +176 -0
- package/src/components/MacBaseUIInternals.tsx +11 -9
- package/src/components/MacBaseUINavigation.tsx +0 -5
- package/src/components/MacNativeDialog.tsx +106 -0
- package/src/components/MacSegmentedControl.tsx +63 -20
- package/src/components/{SymbolIconButton.tsx → MacSymbolButton.tsx} +37 -27
- package/src/components/index.ts +8 -2
- package/src/index.ts +16 -2
- package/src/styles/macosBaseUi.css +343 -80
- package/src/symbols/systemSymbolService.ts +2 -1
- package/src/tauri/startTauriWindowDrag.ts +8 -0
- package/src-tauri/Cargo.toml +5 -0
- package/src-tauri/src/lib.rs +3 -1
- package/src-tauri/src/native_dialog.rs +100 -0
- package/scripts/verify-base-ui-coverage.mjs +0 -264
- package/scripts/verify-macos-design-components.mjs +0 -224
- package/scripts/verify-macos-design-icons.mjs +0 -86
- package/scripts/verify-macos-design.mjs +0 -256
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
MacSegmentedControl,
|
|
64
64
|
MacSelect,
|
|
65
65
|
MacWindowToolbar,
|
|
66
|
-
|
|
66
|
+
MacSymbolButton,
|
|
67
67
|
} from "mac-human-design";
|
|
68
68
|
import { SystemSymbolImage } from "mac-human-design/symbols";
|
|
69
69
|
import "mac-human-design/styles/macos-base-ui.css";
|
|
@@ -86,7 +86,7 @@ export function Demo() {
|
|
|
86
86
|
/>
|
|
87
87
|
}
|
|
88
88
|
trailing={
|
|
89
|
-
<
|
|
89
|
+
<MacSymbolButton
|
|
90
90
|
label="Refresh"
|
|
91
91
|
symbolName="arrow.clockwise"
|
|
92
92
|
fallback="↻"
|
|
@@ -104,7 +104,7 @@ export function Demo() {
|
|
|
104
104
|
rows={[{ name: "Documents", kind: "Folder" }]}
|
|
105
105
|
getRowKey={(row) => row.name}
|
|
106
106
|
/>
|
|
107
|
-
<MacButton
|
|
107
|
+
<MacButton role="primary">Continue</MacButton>
|
|
108
108
|
<MacSelect.Root items={[{ label: "Files", value: "files" }]}>
|
|
109
109
|
<MacSelect.Trigger>
|
|
110
110
|
<MacSelect.Value placeholder="Choose" />
|
|
@@ -120,8 +120,23 @@ export function Demo() {
|
|
|
120
120
|
```bash
|
|
121
121
|
npm run check
|
|
122
122
|
npm run dev:gallery -- --port 5177
|
|
123
|
+
npm run dev:gallery:tauri
|
|
123
124
|
```
|
|
124
125
|
|
|
126
|
+
## Native gallery app (dev-only)
|
|
127
|
+
|
|
128
|
+
For native surface checks, run the gallery in a Tauri shell:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npm run dev:gallery:tauri
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The gallery is loaded from the existing `examples/macos-base-ui-gallery` frontend and opened in a Tauri shell using:
|
|
135
|
+
|
|
136
|
+
`examples/macos-base-ui-gallery-tauri/src-tauri/tauri.conf.json`
|
|
137
|
+
|
|
138
|
+
This is a dev-only workflow and does not affect the package public exports.
|
|
139
|
+
|
|
125
140
|
## Why it works cross-platform
|
|
126
141
|
|
|
127
142
|
The React components stay browser-safe. The optional Tauri plugin is the only
|
|
@@ -136,27 +151,24 @@ The following components are now in the shared library and can be imported by an
|
|
|
136
151
|
|
|
137
152
|
- `AppWindowShell`
|
|
138
153
|
- `MacAccordion`, `MacAlertDialog`, `MacAutocomplete`, `MacAvatar`,
|
|
139
|
-
`MacButton`, `
|
|
140
|
-
`MacDestructiveButton`, `MacPlainButton`, `MacIconButton`,
|
|
141
|
-
`MacHelpButton`, `MacCheckbox`, `MacCheckboxGroup`, `MacCollapsible`,
|
|
154
|
+
`MacButton`, `MacHelpButton`, `MacCheckbox`, `MacCheckboxGroup`, `MacCollapsible`,
|
|
142
155
|
`MacCombobox`, `MacContextMenu`, `MacDialog`, `MacDrawer`, `MacField`,
|
|
143
156
|
`MacFieldset`, `MacForm`, `MacInput`, `MacTextField`, `MacSearchField`,
|
|
144
157
|
`MacMenu`, `MacMenubar`, `MacMeter`, `MacMotionProvider`, `MacNavigationMenu`,
|
|
145
158
|
`MacNumberField`, `MacOTPField`, `MacPopover`,
|
|
146
159
|
`MacPreviewCard`, `MacProgress`, `MacRadio`, `MacRadioGroup`,
|
|
147
160
|
`MacScrollArea`, `MacSelect`, `MacSeparator`, `MacSlider`, `MacSwitch`,
|
|
148
|
-
`MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`,
|
|
149
|
-
`
|
|
150
|
-
`MacSeparatedSegmentedToggleGroup`, `MacToolbar`, `MacTooltip`
|
|
161
|
+
`MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`, `MacToggleGroup`,
|
|
162
|
+
`MacToolbar`, `MacTooltip`
|
|
151
163
|
- `MacDataTable`, a Finder-style grid/table primitive with loading, empty,
|
|
152
164
|
selected, keyboard, and interactive-row states
|
|
153
|
-
- `MacSegmentedControl`,
|
|
154
|
-
|
|
165
|
+
- `MacSegmentedControl`, the standard macOS segmented control wrapper with
|
|
166
|
+
single/multiple selection plus `regular`, `pill`, and `glass` variants
|
|
155
167
|
- `MacWindowToolbar`, a Motion-backed Tauri window toolbar with drag-region
|
|
156
168
|
and no-drag control group handling
|
|
157
169
|
- `StatusMessage`
|
|
158
|
-
- `
|
|
159
|
-
loading state, tooltips, and pass-through styling hooks
|
|
170
|
+
- `MacSymbolButton`, a centered SF Symbols icon button with fallback glyphs,
|
|
171
|
+
`role` and `variant` props, loading state, tooltips, and pass-through styling hooks
|
|
160
172
|
- `ViewDragRegion`
|
|
161
173
|
- `isDraggableAreaTarget` utility
|
|
162
174
|
|
|
@@ -169,7 +181,7 @@ import {
|
|
|
169
181
|
MacSegmentedControl,
|
|
170
182
|
MacWindowToolbar,
|
|
171
183
|
StatusMessage,
|
|
172
|
-
|
|
184
|
+
MacSymbolButton,
|
|
173
185
|
ViewDragRegion,
|
|
174
186
|
isDraggableAreaTarget,
|
|
175
187
|
} from "mac-human-design"
|
package/changelog.md
CHANGED
|
@@ -2,6 +2,72 @@
|
|
|
2
2
|
|
|
3
3
|
This file tracks changes between published npm versions of `mac-human-design`.
|
|
4
4
|
|
|
5
|
+
## 0.1.30-preview.4
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Added `MacNativeDialog`, a Tauri-backed native macOS dialog bridge with
|
|
10
|
+
`showMacNativeDialog()` and `MacNativeDialog.Trigger`, plus a browser-safe
|
|
11
|
+
fallback for the web gallery.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- Updated the gallery dialog section to use native Tauri/AppKit dialogs by
|
|
16
|
+
default and keep React-rendered dialog content only for the sidebar drawer
|
|
17
|
+
exception.
|
|
18
|
+
- Fixed Tauri plugin invocations to use the `plugin:human-design-system-symbols|`
|
|
19
|
+
command prefix for native dialogs and SF Symbols.
|
|
20
|
+
- Narrowed the npm package file list so preview publishes include example source
|
|
21
|
+
files without packing generated Tauri build output.
|
|
22
|
+
- Bumped the package to `0.1.30-preview.4` under the `preview` dist-tag.
|
|
23
|
+
|
|
24
|
+
## 0.1.30-preview.3
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Added `MacSymbolButton` as the exported, symbol-aware toolbar icon component,
|
|
29
|
+
replacing the previous `SymbolIconButton` name while preserving SF Symbol image
|
|
30
|
+
loading, fallback glyph, tooltip, and loading-state behavior.
|
|
31
|
+
- Added `MacSegmentedControl` selection and style variants for regular
|
|
32
|
+
single-choice controls, multiple-choice controls, pill controls, and
|
|
33
|
+
Tahoe-style glass controls.
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- Improved macOS control animation defaults so segmented-control segments no
|
|
38
|
+
longer enlarge on hover while keeping subtle press feedback.
|
|
39
|
+
- Improved gallery segmented-control examples so multiple selection, pill, and
|
|
40
|
+
Tahoe-style glass variants demonstrate their controlled selection behavior.
|
|
41
|
+
- Added a dedicated Tauri drag strip to the dev gallery so the native gallery
|
|
42
|
+
window can be moved without making component demos noninteractive.
|
|
43
|
+
- Wired the dev gallery drag strip to Tauri's `startDragging` API and enabled
|
|
44
|
+
the required dev-shell permission.
|
|
45
|
+
- Pinned the dev gallery drag strip to the top of the viewport so the native
|
|
46
|
+
window remains draggable after the gallery scrolls.
|
|
47
|
+
- Consolidated push-button styling into `MacButton` with `role` and `variant`
|
|
48
|
+
props, removed the separate role-specific button exports, and added matching
|
|
49
|
+
`role`/`variant` support to `MacSymbolButton`.
|
|
50
|
+
- Tuned `MacButton` role styling against native AppKit and SwiftUI references:
|
|
51
|
+
default and cancel buttons stay low-prominence, primary remains the filled
|
|
52
|
+
default action, destructive buttons use red low-prominence text by default,
|
|
53
|
+
regular text buttons use native 32 px sizing, regular symbol buttons use
|
|
54
|
+
native 28 px icon-button geometry, and every role now has gallery coverage for
|
|
55
|
+
regular and glass button variants.
|
|
56
|
+
- Refined the shared button finish with a flatter, more vibrant macOS-style
|
|
57
|
+
treatment and hid the symbol glyph while `MacSymbolButton` displays its
|
|
58
|
+
loading spinner.
|
|
59
|
+
- Updated public exports, gallery examples, README coverage, docs, and
|
|
60
|
+
verification scripts to use the new `MacSymbolButton` naming consistently.
|
|
61
|
+
- Updated symbol icon button alignment styling for tooltip-trigger integration so
|
|
62
|
+
the symbol layer and loading overlay remain correctly centered.
|
|
63
|
+
- Bumped the package to `0.1.30-preview.3` under the `preview` dist-tag.
|
|
64
|
+
- Removed `MacIconButton` from the public wrapper set and replaced icon-only
|
|
65
|
+
uses with `MacButton` plus the `hd-mac-icon-button` styling (preserving the
|
|
66
|
+
existing `MacSymbolButton` API and behavior).
|
|
67
|
+
- Removed the separate segmented toggle-group variants from the public wrapper
|
|
68
|
+
checklist and gallery so segmented controls are represented through
|
|
69
|
+
`MacSegmentedControl` instead of multiple overlapping component names.
|
|
70
|
+
|
|
5
71
|
## 0.1.30-preview.2
|
|
6
72
|
|
|
7
73
|
### Added
|
|
@@ -63,44 +63,46 @@ render UI.
|
|
|
63
63
|
|
|
64
64
|
## Native Variants
|
|
65
65
|
|
|
66
|
-
| Native role
|
|
67
|
-
|
|
|
68
|
-
| Default push button
|
|
69
|
-
|
|
|
70
|
-
| Secondary push button
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|
|
|
74
|
-
|
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
|
|
|
78
|
-
|
|
|
79
|
-
|
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
| Toolbar toggle
|
|
83
|
-
| Toolbar icon button
|
|
84
|
-
|
|
|
85
|
-
|
|
|
66
|
+
| Native role | Export |
|
|
67
|
+
| ------------------------ | ---------------------------------- |
|
|
68
|
+
| Default push button | `MacButton role="default"` |
|
|
69
|
+
| Primary push button | `MacButton role="primary"` |
|
|
70
|
+
| Secondary push button | `MacButton role="secondary"` |
|
|
71
|
+
| Cancel button | `MacButton role="cancel"` |
|
|
72
|
+
| Destructive button | `MacButton role="destructive"` |
|
|
73
|
+
| Liquid glass button | `MacButton variant="glass"` |
|
|
74
|
+
| Icon button | `MacButton` + `hd-mac-icon-button` |
|
|
75
|
+
| Help button | `MacHelpButton` |
|
|
76
|
+
| Motion defaults provider | `MacMotionProvider` |
|
|
77
|
+
| Text field | `MacTextField` / `MacInput` |
|
|
78
|
+
| Search field | `MacSearchField` |
|
|
79
|
+
| Pop-up button | `MacSelect.PopUpButtonTrigger` |
|
|
80
|
+
| Pull-down button | `MacSelect.PullDownButtonTrigger` |
|
|
81
|
+
| Segmented control | `MacSegmentedControl` |
|
|
82
|
+
| Toolbar toggle | `MacToolbarToggle` |
|
|
83
|
+
| Toolbar icon button | `MacToolbar.IconButton` |
|
|
84
|
+
| Native AppKit dialog | `MacNativeDialog` |
|
|
85
|
+
| Legacy React sheet | `MacDialog.SheetPopup` |
|
|
86
|
+
| Sidebar drawer | `MacDrawer.SidebarPopup` |
|
|
86
87
|
|
|
87
88
|
## App-Level Components
|
|
88
89
|
|
|
89
90
|
These shared components cover reusable macOS/Tauri app patterns that should not
|
|
90
91
|
be reimplemented in consuming apps:
|
|
91
92
|
|
|
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, arrow/Home/End row focus navigation, selected row state, and layered hover/selection styling.
|
|
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
|
-
|
|
|
97
|
-
|
|
|
93
|
+
| App pattern | Export | Contract |
|
|
94
|
+
| --------------------------------- | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| 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, arrow/Home/End row focus navigation, selected row state, and layered hover/selection styling. |
|
|
96
|
+
| 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. |
|
|
97
|
+
| Native Tauri dialog bridge | `MacNativeDialog` | Provides `showMacNativeDialog()` and `MacNativeDialog.Trigger` so Tauri apps can present native macOS `NSAlert` dialogs through the library's Tauri plugin while retaining a browser-safe fallback for the developer gallery. |
|
|
98
|
+
| Segmented control | `MacSegmentedControl` | Provides the standard macOS segmented control API with single/multiple selection, regular joined segments, pill segments, Tahoe-style glass segments, accessible labels, full-width layout support, and class/style pass-through. |
|
|
99
|
+
| Centered SF Symbols icon button | `MacSymbolButton` | Renders through `MacButton` and `hd-mac-icon-button`, supports `role` and `variant`, 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
100
|
|
|
99
101
|
## Icon Button Alignment Guarantees
|
|
100
102
|
|
|
101
103
|
Icon-only buttons use fixed-size grid containers with zero padding, zero
|
|
102
104
|
line-height, centered grid content, middle inline alignment, and center transform
|
|
103
|
-
origins. `
|
|
105
|
+
origins. `MacSymbolButton` keeps the SF Symbol and loading spinner in the same
|
|
104
106
|
grid cell, renders hover/focus/loading feedback as a centered state layer under
|
|
105
107
|
the glyph, centers generated symbol masks, trims transparent symbol padding in
|
|
106
108
|
the native symbol service, applies per-symbol optical offsets for asymmetric SF
|
|
@@ -140,4 +142,5 @@ Run the visual gallery with:
|
|
|
140
142
|
|
|
141
143
|
```bash
|
|
142
144
|
npm run dev:gallery -- --port 5177
|
|
145
|
+
npm run dev:gallery:tauri
|
|
143
146
|
```
|