@hanzo/ui 8.11.2 → 8.12.0

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/dist/gallery.html CHANGED
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.11.2</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
1
+ <!doctype html><html lang="en" class="t_dark"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>@hanzo/ui 8.12.0</title><style>/* @hanzo/ui — generated by scripts/gen-css.mjs. Do not edit. */
2
2
  :root { --hanzo-ui-styles: 1; }
3
3
  /* Hanzo Design System — the entry point. Import THIS one file.
4
4
  *
package/dist/next.cjs ADDED
@@ -0,0 +1,81 @@
1
+ 'use client';// @hanzo/ui on the web, for BOTH of Next's bundlers.
2
+ //
3
+ // const { withGui } = require('@hanzo/ui/next')
4
+ // module.exports = withGui(nextConfig)
5
+ //
6
+ // Every component here renders through @hanzo/gui, which is cross-platform: its
7
+ // dependency graph names `react-native`, and one of those — react-native-svg,
8
+ // under the icon set — reaches real React Native source. That source is Flow,
9
+ // not TypeScript, so a web build does not fail to RESOLVE it, it fails to PARSE
10
+ // it:
11
+ //
12
+ // Parsing ecmascript source code failed
13
+ // import type {HostComponent} from '../../src/private/types/HostComponent';
14
+ //
15
+ // which reads as a broken dependency rather than a missing alias. `react-native`
16
+ // on the web IS `react-native-web`; saying so is the whole fix.
17
+ //
18
+ // Declared for both bundlers together, in one file, because that is the failure
19
+ // this replaces: a webpack-only alias is silently absent under Turbopack, so
20
+ // `next dev` and `next build` disagree about whether the app compiles.
21
+ //
22
+ // Node-only (a build-time module) and dependency-free: it takes and returns a
23
+ // plain object, so it does not force `next` into anyone's type graph.
24
+
25
+ /**
26
+ * react-native's web spelling, and the asset registry that ships beside it.
27
+ *
28
+ * The registry is named separately because it is the one module react-native-web
29
+ * does not re-export under the same path — an `Image` reaches for
30
+ * `@react-native/assets-registry/registry` and finds nothing.
31
+ */
32
+ const ALIAS = {
33
+ 'react-native': 'react-native-web',
34
+ '@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry',
35
+ }
36
+
37
+ /**
38
+ * `.web.tsx` before `.tsx`, so a package shipping both halves resolves to the
39
+ * web one. Without it the native file wins by being listed first, and the
40
+ * failure is again a parse error inside a dependency.
41
+ */
42
+ const EXTENSIONS = ['.web.tsx', '.web.ts', '.web.jsx', '.web.js']
43
+
44
+ /** Webpack's half. */
45
+ function webpackGui(config) {
46
+ config.resolve = config.resolve || {}
47
+ config.resolve.alias = { ...config.resolve.alias, ...ALIAS }
48
+ const had = config.resolve.extensions || ['.tsx', '.ts', '.jsx', '.js']
49
+ config.resolve.extensions = [...EXTENSIONS, ...had.filter((e) => !EXTENSIONS.includes(e))]
50
+ return config
51
+ }
52
+
53
+ /**
54
+ * Wrap a Next config so @hanzo/ui builds on the web.
55
+ *
56
+ * Composes with an existing `webpack()` hook rather than replacing it: a caller
57
+ * who already has one keeps it, and this runs after.
58
+ */
59
+ function withGui(nextConfig = {}) {
60
+ const theirs = nextConfig.webpack
61
+ return {
62
+ ...nextConfig,
63
+ turbopack: {
64
+ ...nextConfig.turbopack,
65
+ resolveAlias: { ...(nextConfig.turbopack && nextConfig.turbopack.resolveAlias), ...ALIAS },
66
+ resolveExtensions: [
67
+ ...EXTENSIONS,
68
+ ...((nextConfig.turbopack && nextConfig.turbopack.resolveExtensions) || [
69
+ '.tsx', '.ts', '.jsx', '.js', '.mjs', '.json',
70
+ ]),
71
+ ],
72
+ },
73
+ webpack(config, options) {
74
+ return webpackGui(theirs ? theirs(config, options) : config)
75
+ },
76
+ }
77
+ }
78
+
79
+ module.exports = withGui
80
+ module.exports.withGui = withGui
81
+ module.exports.GUI_ALIAS = ALIAS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "8.11.2",
3
+ "version": "8.12.0",
4
4
  "type": "module",
5
5
  "description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
6
6
  "exports": {
@@ -206,7 +206,8 @@
206
206
  "import": "./dist/types.js",
207
207
  "require": "./dist/types.cjs",
208
208
  "default": "./dist/types.js"
209
- }
209
+ },
210
+ "./next": "./dist/next.cjs"
210
211
  },
211
212
  "main": "./dist/index.cjs",
212
213
  "module": "./dist/index.js",
@@ -310,7 +311,7 @@
310
311
  "license": "MIT",
311
312
  "author": "Hanzo AI <dev@hanzo.ai>",
312
313
  "scripts": {
313
- "build": "rm -rf dist dist-cjs && tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json --noCheck && mkdir -p dist/styles && node scripts/compose-theme.mjs && cp src/styles/motion.css dist/styles/motion.css && node scripts/postbuild.mjs && node scripts/gen-css.mjs",
314
+ "build": "rm -rf dist dist-cjs && tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json --noCheck && mkdir -p dist/styles && node scripts/compose-theme.mjs && cp src/styles/motion.css dist/styles/motion.css && cp src/next.cjs dist/next.cjs && node scripts/postbuild.mjs && node scripts/gen-css.mjs",
314
315
  "clean": "rm -rf dist dist-cjs types",
315
316
  "gen:primitives": "node scripts/gen-primitives.mjs",
316
317
  "tc": "tsc --noEmit",