@hanzo/ui 8.26.2 → 8.26.3
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 +1 -1
- package/dist/next.cjs +32 -0
- package/package.json +1 -1
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.26.
|
|
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.26.3</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
CHANGED
|
@@ -69,12 +69,40 @@ function guiPackages(dir) {
|
|
|
69
69
|
return []
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
/**
|
|
73
|
+
* An imported `.svg` is a COMPONENT.
|
|
74
|
+
*
|
|
75
|
+
* Without a loader saying so the import resolves to the asset descriptor Next
|
|
76
|
+
* hands `next/image`, and rendering it reads: "Element type is invalid: expected
|
|
77
|
+
* a string or a class/function but got: object" — which names no file and no
|
|
78
|
+
* import. Every site that draws an inline mark carried its own copy of this
|
|
79
|
+
* rule, for webpack only, so the same page compiled under `next dev` and threw
|
|
80
|
+
* under a Turbopack build.
|
|
81
|
+
*
|
|
82
|
+
* A site that imports no SVG matches nothing and pays nothing.
|
|
83
|
+
*/
|
|
84
|
+
const SVG_LOADER = '@svgr/webpack'
|
|
85
|
+
|
|
72
86
|
/** Webpack's half. */
|
|
73
87
|
function webpackGui(config) {
|
|
74
88
|
config.resolve = config.resolve || {}
|
|
75
89
|
config.resolve.alias = { ...config.resolve.alias, ...ALIAS }
|
|
76
90
|
const had = config.resolve.extensions || ['.tsx', '.ts', '.jsx', '.js']
|
|
77
91
|
config.resolve.extensions = [...EXTENSIONS, ...had.filter((e) => !EXTENSIONS.includes(e))]
|
|
92
|
+
|
|
93
|
+
config.module = config.module || {}
|
|
94
|
+
config.module.rules = config.module.rules || []
|
|
95
|
+
if (!config.module.rules.some((r) => String(r && r.use).includes(SVG_LOADER))) {
|
|
96
|
+
// Next's own rule still answers `foo.svg?url`, so a site that wants the
|
|
97
|
+
// file rather than the drawing keeps it by saying so at the import.
|
|
98
|
+
const asset = config.module.rules.find((r) => r && r.test && r.test.test && r.test.test('.svg'))
|
|
99
|
+
if (asset) asset.resourceQuery = { ...(asset.resourceQuery || {}), not: [/^$/] }
|
|
100
|
+
config.module.rules.push({
|
|
101
|
+
test: /\.svg$/i,
|
|
102
|
+
resourceQuery: { not: [/url/] },
|
|
103
|
+
use: [SVG_LOADER],
|
|
104
|
+
})
|
|
105
|
+
}
|
|
78
106
|
return config
|
|
79
107
|
}
|
|
80
108
|
|
|
@@ -115,6 +143,10 @@ function withGui(nextConfig = {}, dir = process.cwd()) {
|
|
|
115
143
|
...EXTENSIONS,
|
|
116
144
|
...(turbo.resolveExtensions || ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json']),
|
|
117
145
|
],
|
|
146
|
+
rules: {
|
|
147
|
+
'*.svg': { loaders: [SVG_LOADER], as: '*.js' },
|
|
148
|
+
...turbo.rules,
|
|
149
|
+
},
|
|
118
150
|
},
|
|
119
151
|
webpack(config, options) {
|
|
120
152
|
return webpackGui(theirs ? theirs(config, options) : config)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hanzo/ui",
|
|
3
|
-
"version": "8.26.
|
|
3
|
+
"version": "8.26.3",
|
|
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": {
|