@hanzo/ui 8.0.43 → 8.0.45

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 (120) hide show
  1. package/dist/backends/gui/aspect-ratio.cjs +14 -1
  2. package/dist/backends/gui/aspect-ratio.d.ts +13 -0
  3. package/dist/backends/gui/aspect-ratio.d.ts.map +1 -1
  4. package/dist/backends/gui/aspect-ratio.js +14 -1
  5. package/dist/backends/gui/aspect-ratio.js.map +1 -1
  6. package/dist/backends/gui/badge.cjs +1 -1
  7. package/dist/backends/gui/badge.d.ts.map +1 -1
  8. package/dist/backends/gui/badge.js +1 -1
  9. package/dist/backends/gui/badge.js.map +1 -1
  10. package/dist/backends/gui/button.cjs +35 -8
  11. package/dist/backends/gui/button.d.ts.map +1 -1
  12. package/dist/backends/gui/button.js +35 -8
  13. package/dist/backends/gui/button.js.map +1 -1
  14. package/dist/backends/gui/card.cjs +45 -5
  15. package/dist/backends/gui/card.d.ts +50 -5
  16. package/dist/backends/gui/card.d.ts.map +1 -1
  17. package/dist/backends/gui/card.js +44 -5
  18. package/dist/backends/gui/card.js.map +1 -1
  19. package/dist/backends/gui/collapsible.cjs +6 -1
  20. package/dist/backends/gui/collapsible.d.ts +1 -1
  21. package/dist/backends/gui/collapsible.d.ts.map +1 -1
  22. package/dist/backends/gui/collapsible.js +6 -1
  23. package/dist/backends/gui/collapsible.js.map +1 -1
  24. package/dist/backends/gui/grid.cjs +61 -0
  25. package/dist/backends/gui/grid.d.ts +16 -0
  26. package/dist/backends/gui/grid.d.ts.map +1 -0
  27. package/dist/backends/gui/grid.js +59 -0
  28. package/dist/backends/gui/grid.js.map +1 -0
  29. package/dist/backends/gui/index.cjs +7 -2
  30. package/dist/backends/gui/index.d.ts +3 -1
  31. package/dist/backends/gui/index.d.ts.map +1 -1
  32. package/dist/backends/gui/index.js +3 -1
  33. package/dist/backends/gui/index.js.map +1 -1
  34. package/dist/backends/gui/scroll-area.cjs +2 -1
  35. package/dist/backends/gui/scroll-area.d.ts.map +1 -1
  36. package/dist/backends/gui/scroll-area.js +2 -1
  37. package/dist/backends/gui/scroll-area.js.map +1 -1
  38. package/dist/backends/gui/section.cjs +39 -0
  39. package/dist/backends/gui/section.d.ts +29 -0
  40. package/dist/backends/gui/section.d.ts.map +1 -0
  41. package/dist/backends/gui/section.js +37 -0
  42. package/dist/backends/gui/section.js.map +1 -0
  43. package/dist/backends/gui/slider.cjs +8 -1
  44. package/dist/backends/gui/slider.d.ts.map +1 -1
  45. package/dist/backends/gui/slider.js +8 -1
  46. package/dist/backends/gui/slider.js.map +1 -1
  47. package/dist/backends/gui/switch.cjs +3 -1
  48. package/dist/backends/gui/switch.d.ts.map +1 -1
  49. package/dist/backends/gui/switch.js +3 -1
  50. package/dist/backends/gui/switch.js.map +1 -1
  51. package/dist/backends/gui/tabs.cjs +1 -1
  52. package/dist/backends/gui/tabs.d.ts +1 -1
  53. package/dist/backends/gui/tabs.d.ts.map +1 -1
  54. package/dist/backends/gui/tabs.js +1 -1
  55. package/dist/backends/gui/tabs.js.map +1 -1
  56. package/dist/core/cn.cjs +1 -1
  57. package/dist/core/cn.d.ts +1 -1
  58. package/dist/core/cn.js +1 -1
  59. package/dist/gallery.cjs +32 -0
  60. package/dist/gallery.d.ts +7 -0
  61. package/dist/gallery.d.ts.map +1 -0
  62. package/dist/gallery.js +29 -0
  63. package/dist/gallery.js.map +1 -0
  64. package/dist/gui-config.cjs +12 -1
  65. package/dist/gui-config.d.ts +182 -0
  66. package/dist/gui-config.d.ts.map +1 -1
  67. package/dist/gui-config.js +12 -1
  68. package/dist/gui-config.js.map +1 -1
  69. package/dist/index.cjs +6 -1
  70. package/dist/index.d.ts +1 -0
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +4 -0
  73. package/dist/index.js.map +1 -1
  74. package/dist/primitives/CardMedia.cjs +8 -0
  75. package/dist/primitives/CardMedia.d.ts +2 -0
  76. package/dist/primitives/CardMedia.d.ts.map +1 -0
  77. package/dist/primitives/CardMedia.js +5 -0
  78. package/dist/primitives/CardMedia.js.map +1 -0
  79. package/dist/primitives/Grid.cjs +8 -0
  80. package/dist/primitives/Grid.d.ts +2 -0
  81. package/dist/primitives/Grid.d.ts.map +1 -0
  82. package/dist/primitives/Grid.js +5 -0
  83. package/dist/primitives/Grid.js.map +1 -0
  84. package/dist/primitives/Section.cjs +8 -0
  85. package/dist/primitives/Section.d.ts +2 -0
  86. package/dist/primitives/Section.d.ts.map +1 -0
  87. package/dist/primitives/Section.js +5 -0
  88. package/dist/primitives/Section.js.map +1 -0
  89. package/dist/product/DataTable.cjs +4 -4
  90. package/dist/product/DataTable.js +4 -4
  91. package/dist/product/DataTable.js.map +1 -1
  92. package/dist/product/FadeIn.cjs +1 -1
  93. package/dist/product/FadeIn.d.ts +1 -1
  94. package/dist/product/FadeIn.js +1 -1
  95. package/dist/product/FadeIn.js.map +1 -1
  96. package/dist/product/Metric.cjs +2 -2
  97. package/dist/product/Metric.js +2 -2
  98. package/dist/product/Metric.js.map +1 -1
  99. package/dist/product/Reorder.cjs +1 -1
  100. package/dist/product/Reorder.js +1 -1
  101. package/dist/product/Reorder.js.map +1 -1
  102. package/dist/product/SlideOver.cjs +3 -3
  103. package/dist/product/SlideOver.d.ts +1 -1
  104. package/dist/product/SlideOver.js +3 -3
  105. package/dist/product/SlideOver.js.map +1 -1
  106. package/dist/product/social/SocialResource.cjs +1 -1
  107. package/dist/product/social/SocialResource.js +1 -1
  108. package/dist/product/social/SocialResource.js.map +1 -1
  109. package/dist/product/social/SocialSummaryBar.cjs +1 -1
  110. package/dist/product/social/SocialSummaryBar.js +1 -1
  111. package/dist/product/social/SocialSummaryBar.js.map +1 -1
  112. package/dist/root.cjs +67 -0
  113. package/dist/root.d.ts +10 -0
  114. package/dist/root.d.ts.map +1 -0
  115. package/dist/root.js +64 -0
  116. package/dist/root.js.map +1 -0
  117. package/dist/styles/{hanzo-motion.css → motion.css} +61 -34
  118. package/dist/styles.css +1331 -0
  119. package/dist/theme.css +4 -4
  120. package/package.json +15 -5
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
@@ -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"}
@@ -8,7 +8,7 @@
8
8
 
9
9
  /* Fade-up entrance — <FadeIn> applies the class + a per-item stagger delay.
10
10
  ~0.4s ease-out, small upward travel (matches the hanzo.ai marketing feel). */
11
- @keyframes hz-fade-up {
11
+ @keyframes fade-up {
12
12
  from {
13
13
  opacity: 0;
14
14
  transform: translateY(10px);
@@ -19,41 +19,41 @@
19
19
  }
20
20
  }
21
21
 
22
- .hz-fade-up {
23
- animation: hz-fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
22
+ .fade-up {
23
+ animation: fade-up 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
24
24
  will-change: transform, opacity;
25
25
  }
26
26
 
27
27
  @media (prefers-reduced-motion: reduce) {
28
- .hz-fade-up {
28
+ .fade-up {
29
29
  animation: none;
30
30
  }
31
31
  }
32
32
 
33
33
  /* Shell chrome motion — sidebar collapse (width) and the Linear-style two-level
34
34
  nav slide (transform); backdrop cross-fade behind a SlideOver / dialog. */
35
- .hz-collapse {
35
+ .collapse {
36
36
  transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1);
37
37
  will-change: width;
38
38
  }
39
39
 
40
- .hz-slide {
40
+ .slide {
41
41
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
42
42
  will-change: transform;
43
43
  }
44
44
 
45
- .hz-fade {
45
+ .fade {
46
46
  transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1);
47
47
  will-change: opacity;
48
48
  }
49
49
 
50
50
  /* Drag-to-reorder — a pinned row while it is being dragged (pointer DnD). The
51
- lifted row gets a subtle lift; siblings ease into place via `.hz-slide`. */
52
- .hz-drag-item {
51
+ lifted row gets a subtle lift; siblings ease into place via `.slide`. */
52
+ .drag {
53
53
  touch-action: none;
54
54
  transition: transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
55
55
  }
56
- .hz-drag-item[data-dragging='true'] {
56
+ .drag[data-dragging='true'] {
57
57
  transition: none;
58
58
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
59
59
  opacity: 0.96;
@@ -61,10 +61,10 @@
61
61
  }
62
62
 
63
63
  @media (prefers-reduced-motion: reduce) {
64
- .hz-collapse,
65
- .hz-slide,
66
- .hz-fade,
67
- .hz-drag-item {
64
+ .collapse,
65
+ .slide,
66
+ .fade,
67
+ .drag {
68
68
  transition: none;
69
69
  }
70
70
  }
@@ -75,7 +75,7 @@
75
75
  a brief highlight when a freshly-arrived row lands. */
76
76
 
77
77
  /* Skeleton shimmer — an honest "loading", never fabricated content. */
78
- @keyframes hz-shimmer {
78
+ @keyframes shimmer {
79
79
  0% {
80
80
  background-position: -160px 0;
81
81
  }
@@ -84,7 +84,7 @@
84
84
  }
85
85
  }
86
86
 
87
- .hz-skeleton {
87
+ .skeleton {
88
88
  background-color: var(--color3, rgba(148, 163, 184, 0.14));
89
89
  background-image: linear-gradient(
90
90
  90deg,
@@ -94,11 +94,11 @@
94
94
  );
95
95
  background-size: 160px 100%;
96
96
  background-repeat: no-repeat;
97
- animation: hz-shimmer 1.2s ease-in-out infinite;
97
+ animation: shimmer 1.2s ease-in-out infinite;
98
98
  }
99
99
 
100
100
  /* Live-feed pulse — the "Live" dot on a streaming panel. */
101
- @keyframes hz-pulse {
101
+ @keyframes pulse {
102
102
  0%,
103
103
  100% {
104
104
  opacity: 1;
@@ -111,7 +111,7 @@
111
111
  }
112
112
 
113
113
  /* Entrance for a freshly-arrived activity row (staggerless — one row at a time). */
114
- @keyframes hz-row-in {
114
+ @keyframes row-in {
115
115
  from {
116
116
  opacity: 0;
117
117
  transform: translateY(-6px);
@@ -122,48 +122,48 @@
122
122
  }
123
123
  }
124
124
 
125
- .hz-row-in {
126
- animation: hz-row-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
125
+ .row-in {
126
+ animation: row-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
127
127
  }
128
128
 
129
129
  @media (prefers-reduced-motion: reduce) {
130
- .hz-skeleton {
130
+ .skeleton {
131
131
  animation: none;
132
132
  }
133
- .hz-row-in {
133
+ .row-in {
134
134
  animation: none;
135
135
  }
136
136
  }
137
137
 
138
138
  /* ── Typography + surface classes the product layer's components reference ──────
139
- DataTable/Metric typeset numeric cells with `hz-mono`/`hz-tnum`; ComboBox and
140
- SelectMenu paint their popovers with `hz-paper hz-menu-in`; DataTable rows use
141
- `hz-row`. They travel WITH the components (this is the package's one stylesheet)
139
+ DataTable/Metric typeset numeric cells with `mono`/`tnum`; ComboBox and
140
+ SelectMenu paint their popovers with `paper menu-in`; DataTable rows use
141
+ `row`. They travel WITH the components (this is the package's one stylesheet)
142
142
  so any host that imports `@hanzo/ui/styles/motion.css` renders them correctly.
143
143
  The elevation/ring variables fall back to sane values, so a host that defines its
144
144
  own `--hz-*` theme tokens (the console does) still wins. */
145
145
 
146
- .hz-tnum {
146
+ .tnum {
147
147
  font-variant-numeric: tabular-nums;
148
148
  font-feature-settings: 'tnum' 1;
149
149
  }
150
150
 
151
151
  /* Data/numeric face — Geist Mono + tabular figures for metric values, prices, IDs
152
152
  and counts, so numbers read as precise, column-aligned data. */
153
- .hz-mono {
153
+ .mono {
154
154
  font-family: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
155
155
  font-variant-numeric: tabular-nums;
156
156
  font-feature-settings: 'tnum' 1;
157
157
  letter-spacing: -0.01em;
158
158
  }
159
159
 
160
- .hz-paper {
160
+ .paper {
161
161
  box-shadow: var(--hz-ring, inset 0 0 0 1px rgba(255, 255, 255, 0.08)),
162
162
  var(--hz-paper-highlight, inset 0 1px 0 0 rgba(255, 255, 255, 0.05)),
163
163
  var(--hz-elevation-3, 0 8px 24px rgba(0, 0, 0, 0.36));
164
164
  }
165
165
 
166
- @keyframes hz-menu-in {
166
+ @keyframes menu-in {
167
167
  from {
168
168
  opacity: 0;
169
169
  }
@@ -172,17 +172,44 @@
172
172
  }
173
173
  }
174
174
 
175
- .hz-menu-in {
176
- animation: hz-menu-in 140ms ease-out both;
175
+ .menu-in {
176
+ animation: menu-in 140ms ease-out both;
177
177
  will-change: opacity;
178
178
  }
179
179
 
180
- .hz-row {
180
+ .row {
181
181
  transition: background-color 140ms ease-out;
182
182
  }
183
183
 
184
184
  @media (prefers-reduced-motion: reduce) {
185
- .hz-menu-in {
185
+ .menu-in {
186
186
  animation: none;
187
187
  }
188
188
  }
189
+
190
+ /* ── Layout guarantees ─────────────────────────────────────────────────────────
191
+ Two rules, both structural. They are attached to `data-slot` rather than to a
192
+ class because they are not styling a caller can opt out of — they are the
193
+ thing the primitive PROMISES, and a class can be overwritten by forgetting to
194
+ pass it on. */
195
+
196
+ /* A grid item's initial `min-width` is `auto`, which floors the track at the
197
+ item's min-content width. One long unbroken string — a hash, a URL, a wide
198
+ <pre> — then pushes its own column wider and squeezes every sibling, which is
199
+ the ragged row Grid exists to prevent. The track sizing in grid.tsx is only
200
+ honoured once this floor is gone. */
201
+ [data-slot='grid'] > * {
202
+ min-width: 0;
203
+ }
204
+
205
+ /* Media fills the ratio box instead of setting its own size. Without this an
206
+ <img> renders at its intrinsic pixel size and either overflows the frame or
207
+ sits letterboxed inside it, and the ratio the caller asked for is decoration.
208
+ `display:block` kills the inline-baseline gap under the image. */
209
+ [data-ratio] > img,
210
+ [data-ratio] > video {
211
+ width: 100%;
212
+ height: 100%;
213
+ object-fit: cover;
214
+ display: block;
215
+ }