mac-human-design 0.1.30-preview.3 → 0.1.30-preview.5

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.
Files changed (68) hide show
  1. package/README.md +70 -27
  2. package/changelog.md +89 -0
  3. package/docs/macos-base-ui-coverage.md +34 -27
  4. package/examples/macos-base-ui-gallery/index.html +9 -9
  5. package/examples/macos-base-ui-gallery/src/main.tsx +5 -5
  6. package/examples/macos-base-ui-gallery-tauri/src-tauri/Cargo.lock +4619 -0
  7. package/examples/macos-base-ui-gallery-tauri/src-tauri/Cargo.toml +12 -0
  8. package/examples/macos-base-ui-gallery-tauri/src-tauri/build.rs +4 -0
  9. package/examples/macos-base-ui-gallery-tauri/src-tauri/capabilities/default.json +7 -0
  10. package/examples/macos-base-ui-gallery-tauri/src-tauri/icons/icon.png +0 -0
  11. package/examples/macos-base-ui-gallery-tauri/src-tauri/src/main.rs +16 -0
  12. package/examples/macos-base-ui-gallery-tauri/src-tauri/tauri.conf.json +24 -0
  13. package/package.json +88 -80
  14. package/src/components/AppWindowShell.tsx +5 -5
  15. package/src/components/MacBaseUI.tsx +1 -0
  16. package/src/components/MacBaseUIControls.tsx +145 -134
  17. package/src/components/MacBaseUIGallery.tsx +30 -19
  18. package/src/components/MacBaseUIGalleryAdvanced.tsx +207 -282
  19. package/src/components/MacBaseUIGalleryButtons.tsx +116 -0
  20. package/src/components/MacBaseUIGalleryControls.tsx +203 -182
  21. package/src/components/MacBaseUIGalleryShared.tsx +20 -11
  22. package/src/components/MacBaseUIGalleryStateful.tsx +183 -0
  23. package/src/components/MacBaseUIInternals.tsx +207 -205
  24. package/src/components/MacBaseUINavigation.tsx +144 -149
  25. package/src/components/MacDataTable.tsx +223 -219
  26. package/src/components/MacNativeContextMenu.tsx +279 -0
  27. package/src/components/MacNativeDialog.tsx +106 -0
  28. package/src/components/MacNativeMenuIcons.ts +57 -0
  29. package/src/components/MacSegmentedControl.tsx +97 -54
  30. package/src/components/MacSymbolButton.tsx +148 -0
  31. package/src/components/MacWindowToolbar.tsx +83 -83
  32. package/src/components/StatusMessage.tsx +14 -14
  33. package/src/components/ViewDragRegion.tsx +11 -11
  34. package/src/components/index.ts +10 -2
  35. package/src/index.ts +47 -7
  36. package/src/styles/macosBaseUi.css +1231 -962
  37. package/src/styles/macosTauri.css +28 -26
  38. package/src/symbols/FolderIconImage.tsx +67 -0
  39. package/src/symbols/SystemSymbolImage.tsx +57 -57
  40. package/src/symbols/folderIconService.ts +60 -0
  41. package/src/symbols/index.ts +14 -5
  42. package/src/symbols/systemSymbolService.ts +95 -94
  43. package/src/symbols/useFolderIcon.ts +55 -0
  44. package/src/symbols/useSystemSymbol.ts +54 -54
  45. package/src/tauri/index.ts +17 -0
  46. package/src/tauri/macosWindowConfig.ts +12 -12
  47. package/src/tauri/startTauriWindowDrag.ts +8 -0
  48. package/src/theme/macosTheme.ts +40 -40
  49. package/src/utils/isDraggableAreaTarget.ts +13 -13
  50. package/src-tauri/Cargo.toml +10 -0
  51. package/src-tauri/build.rs +9 -0
  52. package/src-tauri/permissions/autogenerated/commands/folder_icon_png_data_url.toml +13 -0
  53. package/src-tauri/permissions/autogenerated/commands/native_dialog_show.toml +13 -0
  54. package/src-tauri/permissions/autogenerated/commands/system_symbol_png_data_url.toml +13 -0
  55. package/src-tauri/permissions/autogenerated/reference.md +98 -0
  56. package/src-tauri/permissions/default.toml +12 -0
  57. package/src-tauri/permissions/schemas/schema.json +342 -0
  58. package/src-tauri/src/folder_icons.rs +50 -0
  59. package/src-tauri/src/lib.rs +10 -1
  60. package/src-tauri/src/native_dialog.rs +100 -0
  61. package/src-tauri/src/native_image.rs +27 -0
  62. package/src-tauri/src/system_symbols.rs +5 -25
  63. package/src-tauri/templates/macos-transparent-overlay-window.json +14 -14
  64. package/scripts/verify-base-ui-coverage.mjs +0 -264
  65. package/scripts/verify-macos-design-components.mjs +0 -224
  66. package/scripts/verify-macos-design-icons.mjs +0 -86
  67. package/scripts/verify-macos-design.mjs +0 -256
  68. package/src/components/SymbolIconButton.tsx +0 -138
package/README.md CHANGED
@@ -5,9 +5,11 @@ A reusable shared library for Tauri macOS apps. It includes:
5
5
  - macOS-styled wrappers for every public `@base-ui/react` component family.
6
6
  - Default-on Motion-powered animations that respect reduced-motion settings.
7
7
  - `MacSegmentedControl` and macOS design tokens/classes.
8
- - A reusable SF Symbols fetch layer with React hooks/components.
9
- - A Rust/Tauri plugin crate that exposes a native command:
10
- `system_symbol_png_data_url`.
8
+ - Native Tauri helpers for macOS context menus and AppKit dialogs.
9
+ - Reusable SF Symbols and AppKit folder-icon fetch layers with React
10
+ hooks/components.
11
+ - A Rust/Tauri plugin crate that exposes native commands for SF Symbols, folder
12
+ icons, and native dialogs.
11
13
 
12
14
  ## Structure
13
15
 
@@ -24,8 +26,8 @@ npm i mac-human-design @base-ui/react motion react react-dom
24
26
  ```
25
27
 
26
28
  `@base-ui/react`, `motion`, `react`, and `react-dom` are peer dependencies.
27
- Install `@tauri-apps/api` too when using the SF Symbols helpers or Tauri
28
- integration.
29
+ Install `@tauri-apps/api` too when using the SF Symbols helpers, AppKit folder
30
+ icons, native context menus, native dialogs, or other Tauri integration.
29
31
 
30
32
  Consumer apps should also include the macOS Base UI stylesheet once near their
31
33
  app root:
@@ -52,6 +54,15 @@ fn main() {
52
54
  }
53
55
  ```
54
56
 
57
+ Native context menus use Tauri's built-in menu popup API. Consumer app
58
+ capabilities need `core:menu:allow-popup`, `core:menu:default`, or
59
+ `core:default`.
60
+
61
+ The shared native plugin default permission enables SF Symbol PNGs, AppKit
62
+ folder-icon PNGs, and native dialogs. If your app opts into individual plugin
63
+ permissions instead of `human-design-system-symbols:default`, include
64
+ `human-design-system-symbols:allow-folder-icon-png-data-url`.
65
+
55
66
  ## Usage (React)
56
67
 
57
68
  ```ts
@@ -60,12 +71,13 @@ import {
60
71
  MacButton,
61
72
  MacDataTable,
62
73
  MacMotionProvider,
74
+ MacNativeContextMenu,
63
75
  MacSegmentedControl,
64
76
  MacSelect,
65
77
  MacWindowToolbar,
66
- SymbolIconButton,
78
+ MacSymbolButton,
67
79
  } from "mac-human-design";
68
- import { SystemSymbolImage } from "mac-human-design/symbols";
80
+ import { FolderIconImage, SystemSymbolImage } from "mac-human-design/symbols";
69
81
  import "mac-human-design/styles/macos-base-ui.css";
70
82
 
71
83
  export function Demo() {
@@ -86,7 +98,7 @@ export function Demo() {
86
98
  />
87
99
  }
88
100
  trailing={
89
- <SymbolIconButton
101
+ <MacSymbolButton
90
102
  label="Refresh"
91
103
  symbolName="arrow.clockwise"
92
104
  fallback="↻"
@@ -94,6 +106,7 @@ export function Demo() {
94
106
  />
95
107
  }
96
108
  />
109
+ <FolderIconImage sizePx={24} ariaLabel="Folder" />
97
110
  <SystemSymbolImage symbolName="folder" sizePx={18} fallback="▢" />
98
111
  <MacDataTable
99
112
  ariaLabel="Demo files"
@@ -104,7 +117,18 @@ export function Demo() {
104
117
  rows={[{ name: "Documents", kind: "Folder" }]}
105
118
  getRowKey={(row) => row.name}
106
119
  />
107
- <MacButton data-variant="primary">Continue</MacButton>
120
+ <MacButton role="primary">Continue</MacButton>
121
+ <MacNativeContextMenu.Trigger
122
+ menu={[
123
+ { id: "rename", text: "Rename", action: () => {} },
124
+ { id: "duplicate", text: "Duplicate", nativeIcon: "Folder", action: () => {} },
125
+ { type: "separator" },
126
+ { type: "checkbox", id: "details", text: "Show Details", checked: true },
127
+ ]}
128
+ tabIndex={0}
129
+ >
130
+ Right-click for native actions
131
+ </MacNativeContextMenu.Trigger>
108
132
  <MacSelect.Root items={[{ label: "Files", value: "files" }]}>
109
133
  <MacSelect.Trigger>
110
134
  <MacSelect.Value placeholder="Choose" />
@@ -120,8 +144,23 @@ export function Demo() {
120
144
  ```bash
121
145
  npm run check
122
146
  npm run dev:gallery -- --port 5177
147
+ npm run dev:gallery:tauri
148
+ ```
149
+
150
+ ## Native gallery app (dev-only)
151
+
152
+ For native surface checks, run the gallery in a Tauri shell:
153
+
154
+ ```bash
155
+ npm run dev:gallery:tauri
123
156
  ```
124
157
 
158
+ The gallery is loaded from the existing `examples/macos-base-ui-gallery` frontend and opened in a Tauri shell using:
159
+
160
+ `examples/macos-base-ui-gallery-tauri/src-tauri/tauri.conf.json`
161
+
162
+ This is a dev-only workflow and does not affect the package public exports.
163
+
125
164
  ## Why it works cross-platform
126
165
 
127
166
  The React components stay browser-safe. The optional Tauri plugin is the only
@@ -136,27 +175,29 @@ The following components are now in the shared library and can be imported by an
136
175
 
137
176
  - `AppWindowShell`
138
177
  - `MacAccordion`, `MacAlertDialog`, `MacAutocomplete`, `MacAvatar`,
139
- `MacButton`, `MacPrimaryButton`, `MacSecondaryButton`,
140
- `MacDestructiveButton`, `MacPlainButton`, `MacIconButton`,
141
- `MacHelpButton`, `MacCheckbox`, `MacCheckboxGroup`, `MacCollapsible`,
178
+ `MacButton`, `MacHelpButton`, `MacCheckbox`, `MacCheckboxGroup`, `MacCollapsible`,
142
179
  `MacCombobox`, `MacContextMenu`, `MacDialog`, `MacDrawer`, `MacField`,
143
180
  `MacFieldset`, `MacForm`, `MacInput`, `MacTextField`, `MacSearchField`,
144
181
  `MacMenu`, `MacMenubar`, `MacMeter`, `MacMotionProvider`, `MacNavigationMenu`,
145
182
  `MacNumberField`, `MacOTPField`, `MacPopover`,
146
183
  `MacPreviewCard`, `MacProgress`, `MacRadio`, `MacRadioGroup`,
147
184
  `MacScrollArea`, `MacSelect`, `MacSeparator`, `MacSlider`, `MacSwitch`,
148
- `MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`,
149
- `MacToggleGroup`, `MacSegmentedToggleGroup`,
150
- `MacSeparatedSegmentedToggleGroup`, `MacToolbar`, `MacTooltip`
185
+ `MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`, `MacToggleGroup`,
186
+ `MacToolbar`, `MacTooltip`
151
187
  - `MacDataTable`, a Finder-style grid/table primitive with loading, empty,
152
188
  selected, keyboard, and interactive-row states
153
- - `MacSegmentedControl`, a compact macOS segmented control wrapper with
154
- accessible labels and full-width support
189
+ - `MacSegmentedControl`, the standard macOS segmented control wrapper with
190
+ single/multiple selection plus `regular`, `pill`, and `glass` variants
155
191
  - `MacWindowToolbar`, a Motion-backed Tauri window toolbar with drag-region
156
192
  and no-drag control group handling
193
+ - `MacNativeContextMenu`, a native Tauri context-menu bridge with
194
+ `showMacNativeContextMenu()`, native menu icons such as `nativeIcon:
195
+ "Folder"`, and a right-click/keyboard trigger component
196
+ - `FolderIconImage`, `useFolderIcon()`, and `getFolderIconDataUrl()` for
197
+ rendering AppKit/Finder-style folder icons in React UI
157
198
  - `StatusMessage`
158
- - `SymbolIconButton`, a centered SF Symbols icon button with fallback glyphs,
159
- loading state, tooltips, and pass-through styling hooks
199
+ - `MacSymbolButton`, a centered SF Symbols icon button with fallback glyphs,
200
+ `role` and `variant` props, loading state, tooltips, and pass-through styling hooks
160
201
  - `ViewDragRegion`
161
202
  - `isDraggableAreaTarget` utility
162
203
 
@@ -164,13 +205,15 @@ Example import:
164
205
 
165
206
  ```ts
166
207
  import {
167
- AppWindowShell,
168
- MacDataTable,
169
- MacSegmentedControl,
170
- MacWindowToolbar,
171
- StatusMessage,
172
- SymbolIconButton,
173
- ViewDragRegion,
174
- isDraggableAreaTarget,
208
+ AppWindowShell,
209
+ MacDataTable,
210
+ MacNativeContextMenu,
211
+ MacSegmentedControl,
212
+ MacWindowToolbar,
213
+ FolderIconImage,
214
+ StatusMessage,
215
+ MacSymbolButton,
216
+ ViewDragRegion,
217
+ isDraggableAreaTarget,
175
218
  } from "mac-human-design"
176
219
  ```
package/changelog.md CHANGED
@@ -2,6 +2,95 @@
2
2
 
3
3
  This file tracks changes between published npm versions of `mac-human-design`.
4
4
 
5
+ ## 0.1.30-preview.5
6
+
7
+ ### Added
8
+
9
+ - Added `FolderIconImage`, `useFolderIcon()`, and `getFolderIconDataUrl()` so
10
+ Tauri macOS apps can render AppKit/Finder-style generic folder icons or
11
+ folder-path-specific icons through the shared native plugin.
12
+ - Added `nativeIcon` support to `MacNativeContextMenu` action, checkbox, and
13
+ submenu items, including Tauri's native `Folder`, `FolderBurnable`, and
14
+ `FolderSmart` menu icons.
15
+
16
+ ### Changed
17
+
18
+ - Extended the shared Tauri plugin default permission set with
19
+ `allow-folder-icon-png-data-url`.
20
+ - Bumped the package to `0.1.30-preview.5`.
21
+
22
+ ## 0.1.30-preview.4
23
+
24
+ ### Added
25
+
26
+ - Added `MacNativeContextMenu`, a Tauri-backed native context-menu bridge with
27
+ `showMacNativeContextMenu()` and `MacNativeContextMenu.Trigger`, supporting
28
+ action items, checkbox items, separators, predefined native items, and
29
+ submenus while remaining browser-safe outside a Tauri runtime.
30
+ - Added `MacNativeDialog`, a Tauri-backed native macOS dialog bridge with
31
+ `showMacNativeDialog()` and `MacNativeDialog.Trigger`, plus a browser-safe
32
+ fallback for the web gallery.
33
+
34
+ ### Changed
35
+
36
+ - Updated the gallery dialog section to use native Tauri/AppKit dialogs by
37
+ default and keep React-rendered dialog content only for the sidebar drawer
38
+ exception.
39
+ - Added native context-menu gallery and README coverage, including the required
40
+ Tauri menu popup permission note for consumer apps.
41
+ - Fixed Tauri plugin invocations to use the `plugin:human-design-system-symbols|`
42
+ command prefix for native dialogs and SF Symbols.
43
+ - Narrowed the npm package file list so preview publishes include example source
44
+ files without packing generated Tauri build output.
45
+ - Bumped the package to `0.1.30-preview.4` under the `preview` dist-tag.
46
+
47
+ ## 0.1.30-preview.3
48
+
49
+ ### Added
50
+
51
+ - Added `MacSymbolButton` as the exported, symbol-aware toolbar icon component,
52
+ replacing the previous `SymbolIconButton` name while preserving SF Symbol image
53
+ loading, fallback glyph, tooltip, and loading-state behavior.
54
+ - Added `MacSegmentedControl` selection and style variants for regular
55
+ single-choice controls, multiple-choice controls, pill controls, and
56
+ Tahoe-style glass controls.
57
+
58
+ ### Changed
59
+
60
+ - Improved macOS control animation defaults so segmented-control segments no
61
+ longer enlarge on hover while keeping subtle press feedback.
62
+ - Improved gallery segmented-control examples so multiple selection, pill, and
63
+ Tahoe-style glass variants demonstrate their controlled selection behavior.
64
+ - Added a dedicated Tauri drag strip to the dev gallery so the native gallery
65
+ window can be moved without making component demos noninteractive.
66
+ - Wired the dev gallery drag strip to Tauri's `startDragging` API and enabled
67
+ the required dev-shell permission.
68
+ - Pinned the dev gallery drag strip to the top of the viewport so the native
69
+ window remains draggable after the gallery scrolls.
70
+ - Consolidated push-button styling into `MacButton` with `role` and `variant`
71
+ props, removed the separate role-specific button exports, and added matching
72
+ `role`/`variant` support to `MacSymbolButton`.
73
+ - Tuned `MacButton` role styling against native AppKit and SwiftUI references:
74
+ default and cancel buttons stay low-prominence, primary remains the filled
75
+ default action, destructive buttons use red low-prominence text by default,
76
+ regular text buttons use native 32 px sizing, regular symbol buttons use
77
+ native 28 px icon-button geometry, and every role now has gallery coverage for
78
+ regular and glass button variants.
79
+ - Refined the shared button finish with a flatter, more vibrant macOS-style
80
+ treatment and hid the symbol glyph while `MacSymbolButton` displays its
81
+ loading spinner.
82
+ - Updated public exports, gallery examples, README coverage, docs, and
83
+ verification scripts to use the new `MacSymbolButton` naming consistently.
84
+ - Updated symbol icon button alignment styling for tooltip-trigger integration so
85
+ the symbol layer and loading overlay remain correctly centered.
86
+ - Bumped the package to `0.1.30-preview.3` under the `preview` dist-tag.
87
+ - Removed `MacIconButton` from the public wrapper set and replaced icon-only
88
+ uses with `MacButton` plus the `hd-mac-icon-button` styling (preserving the
89
+ existing `MacSymbolButton` API and behavior).
90
+ - Removed the separate segmented toggle-group variants from the public wrapper
91
+ checklist and gallery so segmented controls are represented through
92
+ `MacSegmentedControl` instead of multiple overlapping component names.
93
+
5
94
  ## 0.1.30-preview.2
6
95
 
7
96
  ### Added
@@ -63,44 +63,50 @@ render UI.
63
63
 
64
64
  ## Native Variants
65
65
 
66
- | Native role | Export |
67
- | --------------------------- | ---------------------------------- |
68
- | Default push button | `MacButton` |
69
- | Blue default button | `MacPrimaryButton` |
70
- | Secondary push button | `MacSecondaryButton` |
71
- | Destructive button | `MacDestructiveButton` |
72
- | Borderless button | `MacPlainButton` |
73
- | Icon button | `MacIconButton` |
74
- | Help button | `MacHelpButton` |
75
- | Motion defaults provider | `MacMotionProvider` |
76
- | Text field | `MacTextField` / `MacInput` |
77
- | Search field | `MacSearchField` |
78
- | Pop-up button | `MacSelect.PopUpButtonTrigger` |
79
- | Pull-down button | `MacSelect.PullDownButtonTrigger` |
80
- | Segmented control | `MacSegmentedToggleGroup` |
81
- | Separated segmented control | `MacSeparatedSegmentedToggleGroup` |
82
- | Toolbar toggle | `MacToolbarToggle` |
83
- | Toolbar icon button | `MacToolbar.IconButton` |
84
- | Window sheet | `MacDialog.SheetPopup` |
85
- | Sidebar drawer | `MacDrawer.SidebarPopup` |
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
+ | Native context menu | `MacNativeContextMenu` |
86
+ | Native folder icon | `FolderIconImage` |
87
+ | Legacy React sheet | `MacDialog.SheetPopup` |
88
+ | Sidebar drawer | `MacDrawer.SidebarPopup` |
86
89
 
87
90
  ## App-Level Components
88
91
 
89
92
  These shared components cover reusable macOS/Tauri app patterns that should not
90
93
  be reimplemented in consuming apps:
91
94
 
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
- | 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 per-symbol optical offsets, and exposes loading state with `aria-busy`. |
95
+ | App pattern | Export | Contract |
96
+ | --------------------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
97
+ | 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. |
98
+ | 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. |
99
+ | Native Tauri context menu | `MacNativeContextMenu` | Provides `showMacNativeContextMenu()` and `MacNativeContextMenu.Trigger` so macOS Tauri apps can present native OS context menus through Tauri's built-in menu popup API, including native menu icons such as `Folder`, while keeping the package browser-safe for gallery and documentation builds. |
100
+ | 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. |
101
+ | AppKit folder icon bridge | `FolderIconImage` | Provides `getFolderIconDataUrl()`, `useFolderIcon()`, and `FolderIconImage` so macOS Tauri apps can render generic Finder-style folder icons or path-specific folder icons through `NSWorkspace`, with browser-safe fallback rendering outside Tauri. |
102
+ | 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. |
103
+ | 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
104
 
99
105
  ## Icon Button Alignment Guarantees
100
106
 
101
107
  Icon-only buttons use fixed-size grid containers with zero padding, zero
102
108
  line-height, centered grid content, middle inline alignment, and center transform
103
- origins. `SymbolIconButton` keeps the SF Symbol and loading spinner in the same
109
+ origins. `MacSymbolButton` keeps the SF Symbol and loading spinner in the same
104
110
  grid cell, renders hover/focus/loading feedback as a centered state layer under
105
111
  the glyph, centers generated symbol masks, trims transparent symbol padding in
106
112
  the native symbol service, applies per-symbol optical offsets for asymmetric SF
@@ -140,4 +146,5 @@ Run the visual gallery with:
140
146
 
141
147
  ```bash
142
148
  npm run dev:gallery -- --port 5177
149
+ npm run dev:gallery:tauri
143
150
  ```
@@ -1,12 +1,12 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>human-design macOS Base UI gallery</title>
7
- </head>
8
- <body>
9
- <div id="root"></div>
10
- <script type="module" src="/src/main.tsx"></script>
11
- </body>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>human-design macOS Base UI gallery</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.tsx"></script>
11
+ </body>
12
12
  </html>
@@ -5,9 +5,9 @@ import "../../../src/styles/macosBaseUi.css"
5
5
  import "../../../src/styles/macosTauri.css"
6
6
 
7
7
  createRoot(document.getElementById("root") as HTMLElement).render(
8
- <StrictMode>
9
- <AppWindowShell>
10
- <MacBaseUIGallery />
11
- </AppWindowShell>
12
- </StrictMode>,
8
+ <StrictMode>
9
+ <AppWindowShell>
10
+ <MacBaseUIGallery />
11
+ </AppWindowShell>
12
+ </StrictMode>,
13
13
  )