mac-human-design 0.1.3 → 0.1.6

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
@@ -1,8 +1,10 @@
1
- # human-design
1
+ # mac-human-design
2
2
 
3
3
  A reusable shared library for Tauri macOS apps. It includes:
4
4
 
5
- - `MacSegmentedControl` and macOS-focused BaseUI theme tokens.
5
+ - macOS-styled wrappers for every public `@base-ui/react` component family.
6
+ - Default-on Motion-powered animations that respect reduced-motion settings.
7
+ - `MacSegmentedControl` and macOS design tokens/classes.
6
8
  - A reusable SF Symbols fetch layer with React hooks/components.
7
9
  - A Rust/Tauri plugin crate that exposes a native command:
8
10
  `system_symbol_png_data_url`.
@@ -10,6 +12,7 @@ A reusable shared library for Tauri macOS apps. It includes:
10
12
  ## Structure
11
13
 
12
14
  - `src/` - TypeScript/React library exports
15
+ - `docs/macos-base-ui-coverage.md` - Base UI component coverage and variants
13
16
  - `src-tauri/` - Rust plugin crate (`human-design-tauri-system-symbols`)
14
17
 
15
18
  ## Install
@@ -17,7 +20,18 @@ A reusable shared library for Tauri macOS apps. It includes:
17
20
  From the consumer app:
18
21
 
19
22
  ```bash
20
- npm i human-design
23
+ npm i mac-human-design @base-ui/react motion react react-dom
24
+ ```
25
+
26
+ `@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
+
30
+ Consumer apps should also include the macOS Base UI stylesheet once near their
31
+ app root:
32
+
33
+ ```ts
34
+ import "mac-human-design/styles/macos-base-ui.css";
21
35
  ```
22
36
 
23
37
  In the Tauri Rust side, add the local path dependency while developing:
@@ -42,14 +56,15 @@ fn main() {
42
56
 
43
57
  ```ts
44
58
  import { useState } from "react";
45
- import { MacSegmentedControl } from "human-design";
46
- import { SystemSymbolImage } from "human-design/symbols";
59
+ import { MacButton, MacMotionProvider, MacSegmentedControl, MacSelect } from "mac-human-design";
60
+ import { SystemSymbolImage } from "mac-human-design/symbols";
61
+ import "mac-human-design/styles/macos-base-ui.css";
47
62
 
48
63
  export function Demo() {
49
64
  const [tab, setTab] = useState<"files" | "settings">("files");
50
65
 
51
66
  return (
52
- <div>
67
+ <MacMotionProvider>
53
68
  <SystemSymbolImage symbolName="folder" sizePx={18} fallback="▢" />
54
69
  <MacSegmentedControl
55
70
  options={[
@@ -59,18 +74,50 @@ export function Demo() {
59
74
  value={tab}
60
75
  onChange={setTab}
61
76
  />
62
- </div>
77
+ <MacButton data-variant="primary">Continue</MacButton>
78
+ <MacSelect.Root items={[{ label: "Files", value: "files" }]}>
79
+ <MacSelect.Trigger>
80
+ <MacSelect.Value placeholder="Choose" />
81
+ </MacSelect.Trigger>
82
+ </MacSelect.Root>
83
+ </MacMotionProvider>
63
84
  );
64
85
  }
65
86
  ```
66
87
 
88
+ ## Verify
89
+
90
+ ```bash
91
+ npm run check
92
+ npm run dev:gallery -- --port 5177
93
+ ```
94
+
67
95
  ## Why it works cross-platform
68
96
 
97
+ The React components stay browser-safe. The optional Tauri plugin is the only
98
+ native layer:
99
+
100
+ - On macOS, Rust command renders the symbol to PNG via `NSImage`.
101
+ - On non-macOS, command returns `None` so invocations stay safe and predictable.
102
+
69
103
  ## Shared UI components moved in
70
104
 
71
105
  The following components are now in the shared library and can be imported by any app:
72
106
 
73
107
  - `AppWindowShell`
108
+ - `MacAccordion`, `MacAlertDialog`, `MacAutocomplete`, `MacAvatar`,
109
+ `MacButton`, `MacPrimaryButton`, `MacSecondaryButton`,
110
+ `MacDestructiveButton`, `MacPlainButton`, `MacIconButton`,
111
+ `MacHelpButton`, `MacCheckbox`, `MacCheckboxGroup`, `MacCollapsible`,
112
+ `MacCombobox`, `MacContextMenu`, `MacDialog`, `MacDrawer`, `MacField`,
113
+ `MacFieldset`, `MacForm`, `MacInput`, `MacTextField`, `MacSearchField`,
114
+ `MacMenu`, `MacMenubar`, `MacMeter`, `MacMotionProvider`, `MacNavigationMenu`,
115
+ `MacNumberField`, `MacOTPField`, `MacPopover`,
116
+ `MacPreviewCard`, `MacProgress`, `MacRadio`, `MacRadioGroup`,
117
+ `MacScrollArea`, `MacSelect`, `MacSeparator`, `MacSlider`, `MacSwitch`,
118
+ `MacTabs`, `MacToast`, `MacToggle`, `MacToolbarToggle`,
119
+ `MacToggleGroup`, `MacSegmentedToggleGroup`,
120
+ `MacSeparatedSegmentedToggleGroup`, `MacToolbar`, `MacTooltip`
74
121
  - `StatusMessage`
75
122
  - `SymbolIconButton`
76
123
  - `ViewDragRegion`
@@ -85,8 +132,5 @@ import {
85
132
  SymbolIconButton,
86
133
  ViewDragRegion,
87
134
  isDraggableAreaTarget,
88
- } from "human-design";
135
+ } from "mac-human-design";
89
136
  ```
90
-
91
- - On macOS, Rust command renders the symbol to PNG via `NSImage`.
92
- - On non-macOS, command returns `None` so invocations stay safe and predictable.
package/changelog.md ADDED
@@ -0,0 +1,77 @@
1
+ # Changelog
2
+
3
+ This file tracks changes between published npm versions of `mac-human-design`.
4
+
5
+ ## 0.1.6
6
+
7
+ ### Added
8
+
9
+ - Added Motion for React as the default animation layer for the macOS Base UI
10
+ wrappers.
11
+ - Added `MacMotionProvider`, which applies the shared Motion transition config
12
+ and respects the user's reduced-motion preference by default.
13
+ - Added default macOS motion presets for controls, fields, selection controls,
14
+ panels, popups, dialogs, drawers, indicators, feedback meters, and utility
15
+ surfaces.
16
+ - Added verifier coverage for Motion peer/dev dependencies, provider export,
17
+ reduced-motion config, default transitions, and safe module-scope
18
+ `motion.create()` usage.
19
+
20
+ ### Changed
21
+
22
+ - Bumped the package to `0.1.6`.
23
+ - Added `motion` as a required peer dependency and development dependency.
24
+ - Updated the gallery to render inside `MacMotionProvider` so animation defaults
25
+ are exercised by the shipped example app.
26
+
27
+ ## 0.1.5
28
+
29
+ ### Changed
30
+
31
+ - Replaced the previous Base Web `baseui` foundation with `@base-ui/react`.
32
+ - Updated the package peer dependencies so consumers install `@base-ui/react`,
33
+ `react`, and `react-dom` alongside `mac-human-design`.
34
+ - Updated README and coverage documentation to use the published package name
35
+ `mac-human-design` in install and import examples.
36
+
37
+ ### Added
38
+
39
+ - Added macOS-styled wrappers for every public renderable `@base-ui/react`
40
+ component family in version 1.5.0:
41
+ `Accordion`, `AlertDialog`, `Autocomplete`, `Avatar`, `Button`,
42
+ `Checkbox`, `CheckboxGroup`, `Collapsible`, `Combobox`, `ContextMenu`,
43
+ `CSPProvider`, `Dialog`, `DirectionProvider`, `Drawer`, `Field`,
44
+ `Fieldset`, `Form`, `Input`, `Menu`, `Menubar`, `Meter`,
45
+ `NavigationMenu`, `NumberField`, `OTPField`, `Popover`, `PreviewCard`,
46
+ `Progress`, `Radio`, `RadioGroup`, `ScrollArea`, `Select`, `Separator`,
47
+ `Slider`, `Switch`, `Tabs`, `Toast`, `Toggle`, `ToggleGroup`, `Toolbar`,
48
+ and `Tooltip`.
49
+ - Added macOS-native variants for common platform control styles, including
50
+ primary, secondary, destructive, plain, icon, and help buttons; text and
51
+ search fields; pop-up and pull-down select triggers; segmented controls;
52
+ toolbar buttons; sheet dialogs; and sidebar drawers.
53
+ - Added `src/styles/macosBaseUi.css`, which defines the macOS control styling,
54
+ system font stack, light/dark tokens, focus rings, reduced-motion behavior,
55
+ popup/menu/dialog surfaces, and state styling used by the wrappers.
56
+ - Added `MacBaseUIGallery` and a Vite example app at
57
+ `examples/macos-base-ui-gallery` to visually exercise the wrapped component
58
+ families and variants.
59
+ - Added `docs/macos-base-ui-coverage.md` to document Base UI family coverage,
60
+ intentional utility exclusions, native variants, and verification commands.
61
+ - Added verification scripts for Base UI coverage, macOS design constraints,
62
+ gallery buildability, CSS selector coverage, stale Base Web references, and
63
+ npm package contents.
64
+
65
+ ### Removed
66
+
67
+ - Removed the old `baseui` dependency path from package metadata, source,
68
+ docs, examples, and the lockfile.
69
+ - Removed any dependency on Base Web or Styletron as the shared UI foundation.
70
+
71
+ ### Verification
72
+
73
+ - `npm run check` typechecks the package, verifies all public Base UI component
74
+ wrappers and namespace parts, validates macOS design constraints, and builds
75
+ the gallery.
76
+ - `npm pack --dry-run --json` confirms the npm package includes source, styles,
77
+ docs, examples, scripts, README, license, and this changelog.
@@ -0,0 +1,119 @@
1
+ # macOS Base UI Coverage
2
+
3
+ `mac-human-design` wraps every public component family exported by `@base-ui/react`
4
+ 1.5.0 with macOS-oriented class names. Import the CSS once:
5
+
6
+ ```ts
7
+ import "mac-human-design/styles/macos-base-ui.css";
8
+ ```
9
+
10
+ Consumer apps install `@base-ui/react`, `motion`, `react`, and `react-dom` as
11
+ peer dependencies alongside this package. Motion animations are enabled by
12
+ default through the macOS wrappers and respect the user's reduced-motion
13
+ preference through `MacMotionProvider`.
14
+
15
+ ## Component Families
16
+
17
+ | Base UI family | macOS export |
18
+ | --- | --- |
19
+ | `accordion` | `MacAccordion` |
20
+ | `alert-dialog` | `MacAlertDialog` |
21
+ | `autocomplete` | `MacAutocomplete` |
22
+ | `avatar` | `MacAvatar` |
23
+ | `button` | `MacButton` |
24
+ | `checkbox` | `MacCheckbox` |
25
+ | `checkbox-group` | `MacCheckboxGroup` |
26
+ | `collapsible` | `MacCollapsible` |
27
+ | `combobox` | `MacCombobox` |
28
+ | `context-menu` | `MacContextMenu` |
29
+ | `csp-provider` | `MacCSPProvider` |
30
+ | `dialog` | `MacDialog` |
31
+ | `direction-provider` | `MacDirectionProvider` |
32
+ | `drawer` | `MacDrawer` |
33
+ | `field` | `MacField` |
34
+ | `fieldset` | `MacFieldset` |
35
+ | `form` | `MacForm` |
36
+ | `input` | `MacInput` |
37
+ | `menu` | `MacMenu` |
38
+ | `menubar` | `MacMenubar` |
39
+ | `meter` | `MacMeter` |
40
+ | `navigation-menu` | `MacNavigationMenu` |
41
+ | `number-field` | `MacNumberField` |
42
+ | `otp-field` | `MacOTPField` |
43
+ | `popover` | `MacPopover` |
44
+ | `preview-card` | `MacPreviewCard` |
45
+ | `progress` | `MacProgress` |
46
+ | `radio` | `MacRadio` |
47
+ | `radio-group` | `MacRadioGroup` |
48
+ | `scroll-area` | `MacScrollArea` |
49
+ | `select` | `MacSelect` |
50
+ | `separator` | `MacSeparator` |
51
+ | `slider` | `MacSlider` |
52
+ | `switch` | `MacSwitch` |
53
+ | `tabs` | `MacTabs` |
54
+ | `toast` | `MacToast` |
55
+ | `toggle` | `MacToggle` |
56
+ | `toggle-group` | `MacToggleGroup` |
57
+ | `toolbar` | `MacToolbar` |
58
+ | `tooltip` | `MacTooltip` |
59
+
60
+ Support exports such as `merge-props`, `use-render`, and
61
+ `unstable-use-media-query` are intentionally not wrapped because they do not
62
+ render UI.
63
+
64
+ ## Native Variants
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` |
86
+
87
+ The gallery at `examples/macos-base-ui-gallery` renders these wrappers across
88
+ normal, selected, disabled, mixed, popup, dialog, and narrow-width states.
89
+
90
+ ## Verification
91
+
92
+ Run the full local gate before publishing wrapper changes:
93
+
94
+ ```bash
95
+ npm run check
96
+ ```
97
+
98
+ The gate typechecks the library and verifies:
99
+
100
+ - every public `@base-ui/react` component family has a `Mac...` wrapper export,
101
+ - every renderable namespace part in each wrapped family has a matching macOS part,
102
+ - every component family is listed in this coverage document,
103
+ - required native variants are exported,
104
+ - nested native variant parts such as pop-up buttons, sheets, and sidebar drawers are exported,
105
+ - every class assigned by the wrapper module has a matching CSS selector,
106
+ - every public wrapper export is represented in the visual gallery source,
107
+ - macOS design features are present: system font stack, dark mode, reduced motion,
108
+ keyboard focus rings, accent tokens, styled `hd-mac` classes, and typography
109
+ constraints,
110
+ - Motion integration is present: dependency declarations, `MacMotionProvider`,
111
+ reduced-motion config, default transitions, and module-scope `motion.create()`,
112
+ - the visual gallery can be bundled for production from the shipped source,
113
+ - old UI-foundation references have not returned.
114
+
115
+ Run the visual gallery with:
116
+
117
+ ```bash
118
+ npm run dev:gallery -- --port 5177
119
+ ```
@@ -0,0 +1,12 @@
1
+ <!doctype html>
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>
12
+ </html>
@@ -0,0 +1,13 @@
1
+ import { StrictMode } from "react";
2
+ import { createRoot } from "react-dom/client";
3
+ import { AppWindowShell, MacBaseUIGallery } from "../../../src";
4
+ import "../../../src/styles/macosBaseUi.css";
5
+ import "../../../src/styles/macosTauri.css";
6
+
7
+ createRoot(document.getElementById("root") as HTMLElement).render(
8
+ <StrictMode>
9
+ <AppWindowShell>
10
+ <MacBaseUIGallery />
11
+ </AppWindowShell>
12
+ </StrictMode>,
13
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mac-human-design",
3
- "version": "0.1.3",
3
+ "version": "0.1.6",
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",
@@ -11,10 +11,17 @@
11
11
  "./theme": "./src/theme/index.ts",
12
12
  "./symbols": "./src/symbols/index.ts",
13
13
  "./tauri": "./src/tauri/index.ts",
14
+ "./tauri/macos-window-config": "./src/tauri/macosWindowConfig.ts",
15
+ "./styles/macos-base-ui.css": "./src/styles/macosBaseUi.css",
14
16
  "./utils": "./src/utils/index.ts",
17
+ "./styles/macos-tauri.css": "./src/styles/macosTauri.css",
15
18
  "./rust": "./src-tauri"
16
19
  },
17
20
  "files": [
21
+ "changelog.md",
22
+ "docs/**/*",
23
+ "examples/**/*",
24
+ "scripts/**/*",
18
25
  "src/**/*",
19
26
  "src-tauri/**/*",
20
27
  "README.md",
@@ -29,31 +36,38 @@
29
36
  "components"
30
37
  ],
31
38
  "scripts": {
32
- "publish": "npm publish --access public --ignore-scripts"
39
+ "check": "npm run typecheck && npm run verify:base-ui && npm run verify:design && npm run verify:gallery",
40
+ "dev:gallery": "vite --host 127.0.0.1 examples/macos-base-ui-gallery",
41
+ "publish": "npm publish --access public --ignore-scripts",
42
+ "typecheck": "tsc --noEmit",
43
+ "verify:base-ui": "node scripts/verify-base-ui-coverage.mjs",
44
+ "verify:design": "node scripts/verify-macos-design.mjs",
45
+ "verify:gallery": "rm -rf .verify/macos-base-ui-gallery && vite build examples/macos-base-ui-gallery --outDir ../../.verify/macos-base-ui-gallery --emptyOutDir && rm -rf .verify/macos-base-ui-gallery"
33
46
  },
34
47
  "author": "human-design",
35
48
  "license": "MIT",
36
49
  "peerDependencies": {
50
+ "@base-ui/react": "^1.5.0",
37
51
  "@tauri-apps/api": "^2",
38
- "baseui": ">=18",
52
+ "motion": "^12.40.0",
39
53
  "react": ">=18",
40
- "react-dom": ">=18",
41
- "styletron-react": "^6.1.1",
42
- "styletron-standard": "^3.1.0"
54
+ "react-dom": ">=18"
43
55
  },
44
56
  "peerDependenciesMeta": {
45
57
  "@tauri-apps/api": {
46
58
  "optional": true
47
- },
48
- "baseui": {
49
- "optional": true
50
- },
51
- "styletron-react": {
52
- "optional": true
53
- },
54
- "styletron-standard": {
55
- "optional": true
56
59
  }
57
60
  },
58
- "dependencies": {}
61
+ "devDependencies": {
62
+ "@base-ui/react": "^1.5.0",
63
+ "@tauri-apps/api": "^2.11.0",
64
+ "@types/react": "^19.2.17",
65
+ "@types/react-dom": "^19.2.3",
66
+ "@vitejs/plugin-react": "^6.0.2",
67
+ "motion": "^12.40.0",
68
+ "react": "^19.2.7",
69
+ "react-dom": "^19.2.7",
70
+ "typescript": "^6.0.3",
71
+ "vite": "^8.0.16"
72
+ }
59
73
  }