aidos-ui 4.0.5 → 5.0.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 +7 -7
- package/dist/index.d.ts +201 -132
- package/dist/index.js +2998 -1933
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +3 -1
- package/dist/jsx-dev-runtime.js +2 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/package.json +21 -10
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ElementType, Key } from 'react';
|
|
3
|
+
import { JSXSource } from 'react/jsx-dev-runtime';
|
|
2
4
|
export { Fragment, JSX } from 'react/jsx-dev-runtime';
|
|
3
5
|
|
|
4
|
-
declare function jsxDEV(type:
|
|
6
|
+
declare function jsxDEV(type: ElementType, props: unknown, key: Key | undefined, isStaticChildren: boolean, source?: JSXSource, self?: unknown): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
5
7
|
|
|
6
8
|
export { jsxDEV };
|
package/dist/jsx-dev-runtime.js
CHANGED
|
@@ -68,7 +68,8 @@ function getWrapped(type) {
|
|
|
68
68
|
var SKIP_NAMES = /* @__PURE__ */ new Set(["JSSComment", "JSSBoundary"]);
|
|
69
69
|
function isUserComponent(type, source) {
|
|
70
70
|
if (typeof type !== "function") return false;
|
|
71
|
-
const
|
|
71
|
+
const component = type;
|
|
72
|
+
const name = component.displayName || component.name;
|
|
72
73
|
if (!name || !/^[A-Z]/.test(name)) return false;
|
|
73
74
|
if (SKIP_NAMES.has(name)) return false;
|
|
74
75
|
if (source?.fileName?.includes("node_modules")) return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/JSSComment.tsx","../src/jsx-dev-runtime.ts"],"names":["_jsxDEV","Fragment"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"sources":["../src/JSSComment.tsx","../src/jsx-dev-runtime.ts"],"names":["_jsxDEV","Frag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KAAA;AAEjC,EAAA,IAAI,MAAA,EAAQ,QAAA,EAAU,QAAA,CAAS,cAAc,GAAG,OAAO,KAAA;AACvD,EAAA,OAAO,IAAA;AACT;AAEO,SAAS,OACd,IAAA,EACA,KAAA,EACA,GAAA,EACA,gBAAA,EACA,QACA,IAAA,EACA;AACA,EAAA,IAAI,eAAA,CAAgB,IAAA,EAAM,MAAM,CAAA,EAAG;AACjC,IAAA,OAAOA,QAAA;AAAA,MACL,WAAW,IAAI,CAAA;AAAA,MACf,KAAA;AAAA,MACA,GAAA;AAAA,MACA,gBAAA;AAAA,MACA,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAEA,EAAA,OAAOA,SAAQ,IAAA,EAAM,KAAA,EAAO,GAAA,EAAK,gBAAA,EAAkB,QAAQ,IAAI,CAAA;AACjE","file":"jsx-dev-runtime.js","sourcesContent":["import React, { useEffect, useRef } from \"react\";\n\ntype ReactFiber = {\n sibling?: ReactFiber | null;\n child?: ReactFiber | null;\n stateNode?: unknown;\n};\n\ntype ReactInternals = {\n ReactCurrentOwner?: { current?: ReactFiber | null };\n};\n\ntype ReactWithInternals = typeof React & {\n __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?: ReactInternals;\n};\n\n/**\n * Injects a real HTML comment node (<!-- ComponentName -->) into the DOM.\n *\n * Renders nothing (null). Uses the React fiber tree to locate the sibling\n * component's first DOM node, then inserts a comment before it.\n * Client-only — no SSR output, no hydration mismatch.\n */\nexport function JSSComment({ name }: { name: string }) {\n const fiberRef = useRef<ReactFiber | null>(null);\n\n // Capture our fiber during render\n try {\n const internals = (React as ReactWithInternals)\n .__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n fiberRef.current = internals?.ReactCurrentOwner?.current;\n } catch {}\n\n useEffect(() => {\n const fiber = fiberRef.current;\n if (!fiber) return;\n\n // Our sibling in the Fragment is the actual component\n const sibling = fiber.sibling;\n if (!sibling) return;\n\n // Walk down the sibling's fiber tree to find its first DOM node\n const hostNode = findFirstDOMNode(sibling);\n if (!hostNode?.parentNode) return;\n\n const comment = document.createComment(` ${name} `);\n hostNode.parentNode.insertBefore(comment, hostNode);\n\n return () => {\n comment.remove();\n };\n }, [name]);\n\n return null;\n}\n\nfunction findFirstDOMNode(fiber: ReactFiber): Node | null {\n let current = fiber;\n while (current) {\n if (current.stateNode instanceof Node) {\n return current.stateNode;\n }\n if (current.child) {\n current = current.child;\n continue;\n }\n break;\n }\n return null;\n}\n","// Custom JSX dev runtime that injects <!-- ComponentName --> comments\n// into the DOM at component boundaries.\n//\n// Usage: in tsconfig.json, set \"jsxImportSource\": \"aidos-ui/src\"\n// (or wherever this file is importable from)\n\nexport { Fragment } from \"react/jsx-dev-runtime\";\nexport type { JSX } from \"react/jsx-dev-runtime\";\nimport {\n jsxDEV as _jsxDEV,\n Fragment,\n type JSXSource,\n} from \"react/jsx-dev-runtime\";\nimport type { ComponentType, ElementType, Key } from \"react\";\nimport { JSSComment } from \"./JSSComment\";\n\ntype DebugComponent = ComponentType & {\n displayName?: string;\n readonly name: string;\n};\n\nconst wrapCache = new WeakMap<DebugComponent, DebugComponent>();\n\nfunction getWrapped(type: DebugComponent): DebugComponent {\n let wrapped = wrapCache.get(type);\n if (wrapped) return wrapped;\n\n const name = type.displayName || type.name;\n\n wrapped = function JSSBoundary(props: unknown) {\n return _jsxDEV(\n Fragment,\n {\n children: [\n _jsxDEV(JSSComment, { name }, undefined, false, undefined, undefined),\n _jsxDEV(type as ElementType, props, undefined, false, undefined, undefined),\n ],\n },\n undefined,\n true,\n undefined,\n undefined\n );\n };\n\n wrapped.displayName = name;\n wrapCache.set(type, wrapped);\n\n return wrapped;\n}\n\n// Skip our own wrapper components by name\nconst SKIP_NAMES = new Set([\"JSSComment\", \"JSSBoundary\"]);\n\nfunction isUserComponent(\n type: unknown,\n source: JSXSource | undefined,\n): type is DebugComponent {\n if (typeof type !== \"function\") return false;\n const component = type as DebugComponent;\n const name = component.displayName || component.name;\n if (!name || !/^[A-Z]/.test(name)) return false;\n if (SKIP_NAMES.has(name)) return false;\n // Use the source fileName from the JSX transform to skip node_modules\n if (source?.fileName?.includes(\"node_modules\")) return false;\n return true;\n}\n\nexport function jsxDEV(\n type: ElementType,\n props: unknown,\n key: Key | undefined,\n isStaticChildren: boolean,\n source?: JSXSource,\n self?: unknown,\n) {\n if (isUserComponent(type, source)) {\n return _jsxDEV(\n getWrapped(type),\n props,\n key,\n isStaticChildren,\n source,\n self\n );\n }\n\n return _jsxDEV(type, props, key, isStaticChildren, source, self);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "aidos-ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "An opinionated React component library with built-in theming and CSS-in-JS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -43,17 +43,18 @@
|
|
|
43
43
|
"./package.json": "./package.json"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"
|
|
46
|
+
"icons:types": "node ./scripts/generate-icon-types.mjs",
|
|
47
47
|
"dev": "next dev docs",
|
|
48
48
|
"publish:patch": "node ./scripts/publish.js --patch",
|
|
49
|
-
"build": "next build docs",
|
|
49
|
+
"build": "next build docs --webpack",
|
|
50
50
|
"build:lib": "tsup",
|
|
51
51
|
"prepack": "npm run build:lib",
|
|
52
52
|
"tsc": "tsc --noEmit && tsc --project docs/tsconfig.json --noEmit",
|
|
53
53
|
"tsc:watch": "tsc --noEmit --watch",
|
|
54
54
|
"start": "next start docs",
|
|
55
|
-
"lint": "eslint src docs",
|
|
56
|
-
"check:package": "publint && attw --pack . --profile esm-only"
|
|
55
|
+
"lint": "eslint src docs --max-warnings=0",
|
|
56
|
+
"check:package": "publint && attw --pack . --profile esm-only",
|
|
57
|
+
"test:popover": "node --test tests/Popover.e2e.test.mjs"
|
|
57
58
|
},
|
|
58
59
|
"type": "module",
|
|
59
60
|
"author": "Gerard Moreno-Torres Bertran",
|
|
@@ -65,10 +66,20 @@
|
|
|
65
66
|
"publishConfig": {
|
|
66
67
|
"access": "public"
|
|
67
68
|
},
|
|
69
|
+
"overrides": {
|
|
70
|
+
"esbuild": "0.28.1",
|
|
71
|
+
"postcss": "8.5.18",
|
|
72
|
+
"sharp": "0.35.3"
|
|
73
|
+
},
|
|
74
|
+
"allowScripts": {
|
|
75
|
+
"esbuild@0.28.1": true,
|
|
76
|
+
"fsevents@2.3.3": true,
|
|
77
|
+
"sharp@0.35.3": true,
|
|
78
|
+
"unrs-resolver@1.12.2": true
|
|
79
|
+
},
|
|
68
80
|
"devDependencies": {
|
|
69
81
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
70
|
-
"@iconify-json/
|
|
71
|
-
"@iconify-json/fa-solid": "^1.2.2",
|
|
82
|
+
"@iconify-json/lucide": "^1.2.121",
|
|
72
83
|
"@mdx-js/loader": "^3.1.1",
|
|
73
84
|
"@mdx-js/react": "^3.1.1",
|
|
74
85
|
"@next/mdx": "^16.2.12",
|
|
@@ -76,13 +87,13 @@
|
|
|
76
87
|
"@types/prismjs": "^1.26.5",
|
|
77
88
|
"@types/react": "^19.2.9",
|
|
78
89
|
"@types/react-dom": "^19.2.3",
|
|
79
|
-
"@xenova/transformers": "^2.17.2",
|
|
80
90
|
"csstype": "^3.2.3",
|
|
81
|
-
"dotenv": "^17.2.3",
|
|
82
91
|
"eslint": "^9.39.5",
|
|
83
92
|
"eslint-config-next": "^16.2.12",
|
|
93
|
+
"geist": "^1.7.2",
|
|
84
94
|
"next": "^16.2.12",
|
|
85
|
-
"
|
|
95
|
+
"playwright-core": "^1.62.1",
|
|
96
|
+
"prettier": "^3.9.6",
|
|
86
97
|
"prismjs": "^1.30.0",
|
|
87
98
|
"publint": "^0.3.22",
|
|
88
99
|
"react": "^19.2.0",
|