haze-ui 1.34.0 → 1.35.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/README.md +26 -0
- package/dist/THIRD-PARTY-NOTICES.md +2 -1
- package/dist/components/Anchor/Anchor.js +84 -65
- package/dist/components/BackToTop/BackToTop.js +18 -12
- package/dist/components/Combobox/Combobox.js +109 -99
- package/dist/components/CopyButton/CopyButton.js +13 -12
- package/dist/components/DataTable/DataTable.js +16 -16
- package/dist/components/FloatButton/FloatButton.js +11 -19
- package/dist/components/FollowUpSuggestions/FollowUpSuggestions.js +45 -0
- package/dist/components/FollowUpSuggestions/index.js +3 -0
- package/dist/components/LocaleProvider/ar-sa.js +9 -0
- package/dist/components/LocaleProvider/de-de.js +9 -0
- package/dist/components/LocaleProvider/es-es.js +9 -0
- package/dist/components/LocaleProvider/fr-fr.js +9 -0
- package/dist/components/LocaleProvider/it-it.js +9 -0
- package/dist/components/LocaleProvider/ja-jp.js +9 -0
- package/dist/components/LocaleProvider/ko-kr.js +9 -0
- package/dist/components/LocaleProvider/locale.js +9 -0
- package/dist/components/LocaleProvider/pt-br.js +9 -0
- package/dist/components/LocaleProvider/ru-ru.js +9 -0
- package/dist/components/LocaleProvider/zh-cn.js +9 -0
- package/dist/components/NavigationBar/NavLink.js +15 -16
- package/dist/components/NotificationCenter/NotificationCenter.js +294 -0
- package/dist/components/NotificationCenter/index.js +3 -0
- package/dist/components/Tabs/Tab.js +58 -50
- package/dist/components/TaskList/TaskList.js +96 -0
- package/dist/components/TaskList/index.js +3 -0
- package/dist/components/Toggle/Toggle.js +8 -8
- package/dist/components/Toggle/ToggleCore.js +4 -5
- package/dist/components/Toolbar/ToolbarButton.js +7 -7
- package/dist/components/Toolbar/ToolbarToggle.js +9 -9
- package/dist/components/Tree/Tree.js +159 -137
- package/dist/components/Tree/index.js +2 -1
- package/dist/components/Tree/useTree.js +32 -0
- package/dist/components/Tree/utils.js +21 -11
- package/dist/css/anchor.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/copy-button.css +1 -1
- package/dist/css/data-table.css +1 -1
- package/dist/css/follow-up-suggestions.css +4 -0
- package/dist/css/notification-center.css +5 -0
- package/dist/css/task-list.css +4 -0
- package/dist/css/tokens.css +1 -0
- package/dist/css-manifest.json +21 -0
- package/dist/haze-ui.css +18 -4
- package/dist/headless/index.js +2 -1
- package/dist/hooks/index.js +25 -0
- package/dist/hooks/useAnchorSpy.js +49 -0
- package/dist/hooks/useElementSize.js +31 -0
- package/dist/hooks/useIdle.js +45 -0
- package/dist/hooks/useMutationObserver.js +31 -0
- package/dist/hooks/useNetwork.js +28 -0
- package/dist/hooks/useOrientation.js +27 -0
- package/dist/hooks/useResizeObserver.js +16 -0
- package/dist/icons/index.js +9 -0
- package/dist/index.js +323 -318
- package/dist/mcp-docs.json +535 -13
- package/dist/registry.json +387 -7
- package/dist/sitemap.xml +6 -0
- package/dist/tokens/index.js +2 -1
- package/dist/tokens/zoom.js +6 -0
- package/dist/types/components/Anchor/Anchor.d.ts +5 -1
- package/dist/types/components/BackToTop/BackToTop.d.ts +23 -5
- package/dist/types/components/Combobox/Combobox.d.ts +17 -1
- package/dist/types/components/ConfigProvider/ConfigContext.d.ts +6 -0
- package/dist/types/components/CopyButton/CopyButton.d.ts +16 -4
- package/dist/types/components/DataTable/DataTable.bench.d.ts +1 -0
- package/dist/types/components/FloatButton/FloatButton.d.ts +25 -5
- package/dist/types/components/FollowUpSuggestions/FollowUpSuggestions.d.ts +27 -0
- package/dist/types/components/FollowUpSuggestions/index.d.ts +2 -0
- package/dist/types/components/LocaleProvider/locale.d.ts +9 -0
- package/dist/types/components/NavigationBar/NavLink.d.ts +24 -32
- package/dist/types/components/NotificationCenter/NotificationCenter.d.ts +111 -0
- package/dist/types/components/NotificationCenter/index.d.ts +2 -0
- package/dist/types/components/Select/Select.bench.d.ts +1 -0
- package/dist/types/components/Tabs/Tab.d.ts +26 -4
- package/dist/types/components/TaskList/TaskList.d.ts +50 -0
- package/dist/types/components/TaskList/index.d.ts +2 -0
- package/dist/types/components/Toggle/Toggle.d.ts +15 -8
- package/dist/types/components/Toggle/ToggleCore.d.ts +16 -7
- package/dist/types/components/Toolbar/ToolbarButton.d.ts +17 -5
- package/dist/types/components/Toolbar/ToolbarToggle.d.ts +22 -5
- package/dist/types/components/Tree/Tree.d.ts +1 -1
- package/dist/types/components/Tree/index.d.ts +4 -1
- package/dist/types/components/Tree/types.d.ts +20 -0
- package/dist/types/components/Tree/useTree.d.ts +96 -0
- package/dist/types/components/Tree/utils.d.ts +7 -0
- package/dist/types/components/VirtualList/VirtualList.bench.d.ts +1 -0
- package/dist/types/headless/index.d.ts +16 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/hooks/useAnchorSpy.d.ts +62 -0
- package/dist/types/icons/index.d.ts +138 -0
- package/dist/types/index.d.ts +10 -2
- package/dist/types/tokens/index.d.ts +1 -0
- package/dist/types/tokens/zoom.d.ts +33 -0
- package/dist/types/utils/deprecate.d.ts +13 -0
- package/dist/types/utils/portal.d.ts +29 -0
- package/dist/utils/portal.js +13 -0
- package/package.json +40 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dedup identity of one deprecation notice: the first call for a key
|
|
3
|
+
* warns, every later call is silent. Pick a stable, greppable name that
|
|
4
|
+
* names the deprecated surface — `'ButtonLink.alias'`, `'Tag.variant'` —
|
|
5
|
+
* it never reaches the console, it only buckets the warning.
|
|
6
|
+
*/
|
|
7
|
+
export type DeprecationKey = string;
|
|
8
|
+
/**
|
|
9
|
+
* Warn, at most once per `key`, that a public API surface is deprecated.
|
|
10
|
+
* No-op in production; in browsers without a `process` global the warning
|
|
11
|
+
* fires like in any dev build.
|
|
12
|
+
*/
|
|
13
|
+
export declare function warnDeprecated(key: DeprecationKey, message: string): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The DOM-portal primitive shared by overlay families (Dialog, Drawer,
|
|
4
|
+
* Tour… render through their own wiring; this is the escape hatch for
|
|
5
|
+
* composing your own). Radix/Mantine semantics: nothing renders until
|
|
6
|
+
* the client mounts — a server render and the first client render both
|
|
7
|
+
* produce no output, so hydration never mismatches and a missing
|
|
8
|
+
* `document` (SSR) cannot throw. Not exported from the library barrel —
|
|
9
|
+
* the public surface is curated behind the `haze-ui/headless` subpath.
|
|
10
|
+
*/
|
|
11
|
+
type PortalProps = {
|
|
12
|
+
/** Content to render into the container. */
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Portal target: an element or a lazy getter (evaluated after mount,
|
|
16
|
+
* so `document.body` and query-based lookups are safe on every
|
|
17
|
+
* render). Defaults to `document.body` — the overlay default that
|
|
18
|
+
* escapes ancestor `overflow`/`transform`/`z-index` stacking contexts.
|
|
19
|
+
*/
|
|
20
|
+
container?: HTMLElement | (() => HTMLElement);
|
|
21
|
+
/**
|
|
22
|
+
* Render `children` in place instead of through a portal — the
|
|
23
|
+
* composition escape for "portal only when a consumer opts out of my
|
|
24
|
+
* stacking context" (the same shape Radix uses for nested portals).
|
|
25
|
+
*/
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare function Portal({ children, container, disabled }: PortalProps): import("react").JSX.Element | null;
|
|
29
|
+
export type { PortalProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect as e, useState as t } from "react";
|
|
3
|
+
import { Fragment as n, jsx as r } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as i } from "react-dom";
|
|
5
|
+
//#region src/lib/utils/portal.tsx
|
|
6
|
+
function a({ children: a, container: o, disabled: s = !1 }) {
|
|
7
|
+
let [c, l] = t(null);
|
|
8
|
+
return e(() => {
|
|
9
|
+
s || l(typeof o == "function" ? o() : o ?? document.body);
|
|
10
|
+
}, [o, s]), s ? /* @__PURE__ */ r(n, { children: a }) : c === null ? null : i(a, c);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { a as Portal };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "haze-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React UI component library powered by react-use-control and Linaria",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
"import": "./dist/headless/index.js",
|
|
28
28
|
"default": "./dist/headless/index.js"
|
|
29
29
|
},
|
|
30
|
+
"./hooks": {
|
|
31
|
+
"types": "./dist/types/hooks/index.d.ts",
|
|
32
|
+
"import": "./dist/hooks/index.js",
|
|
33
|
+
"default": "./dist/hooks/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./icons": {
|
|
36
|
+
"types": "./dist/types/icons/index.d.ts",
|
|
37
|
+
"import": "./dist/icons/index.js",
|
|
38
|
+
"default": "./dist/icons/index.js"
|
|
39
|
+
},
|
|
30
40
|
"./locales": {
|
|
31
41
|
"types": "./dist/types/locales/index.d.ts",
|
|
32
42
|
"import": "./dist/locales/index.js",
|
|
@@ -70,19 +80,22 @@
|
|
|
70
80
|
"scripts": {
|
|
71
81
|
"start": "vite",
|
|
72
82
|
"build": "BUILD_LIB=true vite build && node scripts/split-css.mjs && node scripts/generate-registry.mjs && node scripts/generate-design-tokens.mjs && node scripts/generate-mcp-docs.mjs && tsc -p tsconfig.lib.json && tsc-alias -p tsconfig.lib.json && node scripts/fix-dts-extensions.mjs && node scripts/generate-licenses.mjs",
|
|
73
|
-
"build:demo": "node scripts/write-version.mjs && node scripts/generate-llms.mjs && BABEL_ENV=development BUILD_DEMO=true vite build && cp dist/index.html dist/404.html && cp llms.txt dist/ && cp llms-full.txt dist/ && cp src/generated/version.json dist/version.json",
|
|
83
|
+
"build:demo": "node scripts/generate-versions.mjs && node scripts/write-version.mjs && node scripts/generate-llms.mjs && BABEL_ENV=development BUILD_DEMO=true vite build && cp dist/index.html dist/404.html && cp llms.txt dist/ && cp llms-full.txt dist/ && cp src/generated/version.json dist/version.json",
|
|
74
84
|
"commit": "lint-staged && git-cz -n",
|
|
75
85
|
"coverage": "vitest run --coverage",
|
|
76
86
|
"lint": "eslint --fix src *.mjs",
|
|
77
87
|
"deploy": "npm run build:demo && gh-pages -d dist",
|
|
78
88
|
"test": "vitest run",
|
|
89
|
+
"bench": "vitest bench --run",
|
|
79
90
|
"test:compiler": "HAZE_REACT_COMPILER=1 vitest run --maxWorkers=4",
|
|
80
91
|
"test:e2e": "PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=1 playwright test --config e2e/playwright.config.ts",
|
|
81
92
|
"test:watch": "vitest",
|
|
82
93
|
"typecheck": "tsc --noEmit",
|
|
83
94
|
"prepublishOnly": "npm run build",
|
|
84
95
|
"serve": "vite preview",
|
|
85
|
-
"size": "size-limit"
|
|
96
|
+
"size": "size-limit",
|
|
97
|
+
"codemod": "node scripts/codemods/run.mjs",
|
|
98
|
+
"test:codemods": "node --test scripts/codemods/__tests__/"
|
|
86
99
|
},
|
|
87
100
|
"repository": {
|
|
88
101
|
"type": "git",
|
|
@@ -130,6 +143,7 @@
|
|
|
130
143
|
"@tiptap/react": "^3.32.0",
|
|
131
144
|
"@tiptap/starter-kit": "^3.32.0",
|
|
132
145
|
"libphonenumber-js": "^1.13.15",
|
|
146
|
+
"lucide-react": "^1.44.0",
|
|
133
147
|
"qrcode": "^1.5.4",
|
|
134
148
|
"react-f0rm": "^1.4.0",
|
|
135
149
|
"react-use-control": "^1.6.0",
|
|
@@ -176,9 +190,9 @@
|
|
|
176
190
|
"gh-pages": "^6.3.0",
|
|
177
191
|
"husky": "^9.1.7",
|
|
178
192
|
"jest-axe": "^11.0.0",
|
|
193
|
+
"jscodeshift": "^17.4.0",
|
|
179
194
|
"jsdom": "^30.0.1",
|
|
180
195
|
"lint-staged": "^17.5.1",
|
|
181
|
-
"lucide-react": "^1.44.0",
|
|
182
196
|
"prettier": "^3.9.6",
|
|
183
197
|
"react": "^19.3.0",
|
|
184
198
|
"react-dom": "^19.3.0",
|
|
@@ -198,7 +212,7 @@
|
|
|
198
212
|
"name": "Button only (bundled from barrel)",
|
|
199
213
|
"path": "dist/index.js",
|
|
200
214
|
"import": "{Button}",
|
|
201
|
-
"limit": "6.
|
|
215
|
+
"limit": "6.6 KB"
|
|
202
216
|
},
|
|
203
217
|
{
|
|
204
218
|
"name": "TagGroup+TagGroupItem only — dnd-free (bundled from barrel)",
|
|
@@ -222,16 +236,16 @@
|
|
|
222
236
|
"name": "Dashboard profile: Button + Input + Select + Dialog + Toast + Pagination",
|
|
223
237
|
"path": "dist/index.js",
|
|
224
238
|
"import": "{Button, Input, Select, Dialog, Toast, Pagination}",
|
|
225
|
-
"limit": "21.
|
|
239
|
+
"limit": "21.6 KB"
|
|
226
240
|
},
|
|
227
241
|
{
|
|
228
242
|
"name": "CSS aggregate (dist/haze-ui.css, brotli)",
|
|
229
243
|
"path": "dist/haze-ui.css",
|
|
230
|
-
"limit": "
|
|
244
|
+
"limit": "32.5 KB"
|
|
231
245
|
},
|
|
232
246
|
{
|
|
233
247
|
"path": "dist/haze-ui.css",
|
|
234
|
-
"limit": "44 KB",
|
|
248
|
+
"limit": "44.9 KB",
|
|
235
249
|
"gzip": true
|
|
236
250
|
},
|
|
237
251
|
{
|
|
@@ -414,6 +428,18 @@
|
|
|
414
428
|
"limit": "850 B",
|
|
415
429
|
"gzip": true
|
|
416
430
|
},
|
|
431
|
+
{
|
|
432
|
+
"name": "CSS family ratchet: follow-up-suggestions",
|
|
433
|
+
"path": "dist/css/follow-up-suggestions.css",
|
|
434
|
+
"limit": "200 B",
|
|
435
|
+
"gzip": true
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"name": "CSS family ratchet: task-list",
|
|
439
|
+
"path": "dist/css/task-list.css",
|
|
440
|
+
"limit": "500 B",
|
|
441
|
+
"gzip": true
|
|
442
|
+
},
|
|
417
443
|
{
|
|
418
444
|
"name": "CSS family ratchet: inline-citation",
|
|
419
445
|
"path": "dist/css/inline-citation.css",
|
|
@@ -503,6 +529,12 @@
|
|
|
503
529
|
"path": "dist/css/time-grid.css",
|
|
504
530
|
"limit": "2 KB",
|
|
505
531
|
"gzip": true
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"name": "CSS family ratchet: notification-center",
|
|
535
|
+
"path": "dist/css/notification-center.css",
|
|
536
|
+
"limit": "1.7 KB",
|
|
537
|
+
"gzip": true
|
|
506
538
|
}
|
|
507
539
|
]
|
|
508
540
|
}
|