@hanzo/ui 8.0.40 → 8.0.41
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/backends/gui/card.cjs +3 -2
- package/dist/backends/gui/card.d.ts +2 -2
- package/dist/backends/gui/card.d.ts.map +1 -1
- package/dist/backends/gui/card.js +3 -2
- package/dist/backends/gui/card.js.map +1 -1
- package/dist/backends/gui/collapsible.cjs +6 -1
- package/dist/backends/gui/collapsible.d.ts +1 -1
- package/dist/backends/gui/collapsible.d.ts.map +1 -1
- package/dist/backends/gui/collapsible.js +6 -1
- package/dist/backends/gui/collapsible.js.map +1 -1
- package/dist/backends/gui/scroll-area.cjs +2 -1
- package/dist/backends/gui/scroll-area.d.ts.map +1 -1
- package/dist/backends/gui/scroll-area.js +2 -1
- package/dist/backends/gui/scroll-area.js.map +1 -1
- package/dist/backends/gui/slider.cjs +8 -1
- package/dist/backends/gui/slider.d.ts.map +1 -1
- package/dist/backends/gui/slider.js +8 -1
- package/dist/backends/gui/slider.js.map +1 -1
- package/dist/backends/gui/switch.cjs +3 -1
- package/dist/backends/gui/switch.d.ts.map +1 -1
- package/dist/backends/gui/switch.js +3 -1
- package/dist/backends/gui/switch.js.map +1 -1
- package/dist/backends/gui/tabs.cjs +1 -1
- package/dist/backends/gui/tabs.d.ts +1 -1
- package/dist/backends/gui/tabs.d.ts.map +1 -1
- package/dist/backends/gui/tabs.js +1 -1
- package/dist/backends/gui/tabs.js.map +1 -1
- package/dist/gallery.cjs +23 -0
- package/dist/gallery.d.ts +7 -0
- package/dist/gallery.d.ts.map +1 -0
- package/dist/gallery.js +20 -0
- package/dist/gallery.js.map +1 -0
- package/dist/index.cjs +6 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/root.cjs +67 -0
- package/dist/root.d.ts +10 -0
- package/dist/root.d.ts.map +1 -0
- package/dist/root.js +64 -0
- package/dist/root.js.map +1 -0
- package/dist/styles.css +1259 -0
- package/dist/theme.css +71 -40
- package/package.json +14 -4
package/dist/root.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import './styles.css';
|
|
3
|
+
export type HanzoProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** Dark-first Hanzo identity. `light` retunes it. */
|
|
6
|
+
theme?: 'dark' | 'light';
|
|
7
|
+
};
|
|
8
|
+
export declare const Hanzo: ({ children, theme }: HanzoProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default Hanzo;
|
|
10
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,OAAO,cAAc,CAAA;AAErB,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,qDAAqD;IACrD,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB,CAAA;AAqBD,eAAO,MAAM,KAAK,GAAI,qBAA8B,UAAU,4CAO7D,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/dist/root.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* `Hanzo` — the root. The only thing an app has to mount.
|
|
5
|
+
*
|
|
6
|
+
* import { Hanzo, Button } from '@hanzo/ui'
|
|
7
|
+
* <Hanzo><Button>Ship</Button></Hanzo>
|
|
8
|
+
*
|
|
9
|
+
* No config file, no CSS import, no generator script, no bundler aliases. Three
|
|
10
|
+
* things used to be the app's job and are now the package's:
|
|
11
|
+
*
|
|
12
|
+
* the config — @hanzo/gui resolves `$3` / `$background` / `$borderColor`
|
|
13
|
+
* against ONE process-global config, and @hanzo/ui owns it (gui-config.ts).
|
|
14
|
+
* It is passed here as a value, not imported for its side effect: Vite 8
|
|
15
|
+
* ignores package.json `sideEffects` ARRAYS outright, so a bare
|
|
16
|
+
* `import './gui-config.js'` is dropped and the first render dies on "Missing
|
|
17
|
+
* hanzogui config". A value a rendered component needs cannot be shaken out.
|
|
18
|
+
*
|
|
19
|
+
* the stylesheet — `styles.css` is generated at OUR publish time by rendering
|
|
20
|
+
* every component and harvesting the atomic CSS that render produces
|
|
21
|
+
* (scripts/gen-css.mjs). It used to be each app's job to run a generator and
|
|
22
|
+
* import its output; hanzo.app never did, and shipped 103 `_bg-` classes
|
|
23
|
+
* against zero `_bg-` rules with a green build the whole time.
|
|
24
|
+
*
|
|
25
|
+
* the theme — gui throws "Missing theme." for any component without a root
|
|
26
|
+
* theme context, so there is no version of this that works with no root at
|
|
27
|
+
* all. Dark-first, matching the Hanzo identity.
|
|
28
|
+
*
|
|
29
|
+
* `disableInjectCSS` because the sheet is a real file. Left on, the provider
|
|
30
|
+
* inlines `config.getCSS()` into the document on every streaming flush — that is
|
|
31
|
+
* how hanzo.ai once shipped thirteen byte-identical copies, 591,305 of its
|
|
32
|
+
* 638,443 bytes. A file is cached once and costs nothing after the first page.
|
|
33
|
+
* Styles gui generates at runtime for props we could not know at publish time
|
|
34
|
+
* still reach the document: that path is `insertStyleRules`, and it is not what
|
|
35
|
+
* this flag controls.
|
|
36
|
+
*/
|
|
37
|
+
import { GuiProvider } from '@hanzo/gui';
|
|
38
|
+
import { config } from './gui-config.js';
|
|
39
|
+
import './styles.css';
|
|
40
|
+
/** A stylesheet that did not reach the document is invisible until someone opens
|
|
41
|
+
* production. `styles.css` declares `--hanzo-ui-styles`, so the check is one
|
|
42
|
+
* lookup, it runs once, and it names the fix. Development only.
|
|
43
|
+
*
|
|
44
|
+
* A document with NO stylesheets at all is jsdom, where nothing loads CSS and
|
|
45
|
+
* there is nothing to be wrong about — throwing there would break every
|
|
46
|
+
* consumer's unit tests to report a condition that cannot exist. */
|
|
47
|
+
let checked = false;
|
|
48
|
+
const assertStylesheet = () => {
|
|
49
|
+
if (checked || typeof document === 'undefined' || document.styleSheets.length === 0)
|
|
50
|
+
return;
|
|
51
|
+
checked = true;
|
|
52
|
+
if (getComputedStyle(document.documentElement).getPropertyValue('--hanzo-ui-styles').trim())
|
|
53
|
+
return;
|
|
54
|
+
throw new Error('@hanzo/ui: styles.css did not reach the document. <Hanzo> imports it, so a bundler ' +
|
|
55
|
+
'that does not process CSS imported from node_modules has dropped it. Import it ' +
|
|
56
|
+
"directly instead: import '@hanzo/ui/styles.css'.");
|
|
57
|
+
};
|
|
58
|
+
export const Hanzo = ({ children, theme = 'dark' }) => {
|
|
59
|
+
if (process.env.NODE_ENV !== 'production')
|
|
60
|
+
assertStylesheet();
|
|
61
|
+
return (_jsx(GuiProvider, { config: config, defaultTheme: theme, disableInjectCSS: true, children: children }));
|
|
62
|
+
};
|
|
63
|
+
export default Hanzo;
|
|
64
|
+
//# sourceMappingURL=root.js.map
|
package/dist/root.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../src/root.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,cAAc,CAAA;AAQrB;;;;;;qEAMqE;AACrE,IAAI,OAAO,GAAG,KAAK,CAAA;AACnB,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC5B,IAAI,OAAO,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAM;IAC3F,OAAO,GAAG,IAAI,CAAA;IACd,IAAI,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC,IAAI,EAAE;QAAE,OAAM;IACnG,MAAM,IAAI,KAAK,CACb,qFAAqF;QACnF,iFAAiF;QACjF,kDAAkD,CACrD,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,KAAK,GAAG,MAAM,EAAc,EAAE,EAAE;IAChE,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY;QAAE,gBAAgB,EAAE,CAAA;IAC7D,OAAO,CACL,KAAC,WAAW,IAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,kBAC/D,QAAQ,GACG,CACf,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAA"}
|