@meonode/ui 0.3.6 → 0.3.8
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/CHANGELOG.md +34 -14
- package/dist/components/registry.client.d.ts +1 -1
- package/dist/components/registry.client.d.ts.map +1 -1
- package/dist/components/registry.client.js +1 -1
- package/dist/components/styled-renderer.client.d.ts +5 -833
- package/dist/components/styled-renderer.client.d.ts.map +1 -1
- package/dist/components/styled-renderer.client.js +3 -2
- package/dist/components/theme-provider.client.d.ts +1 -7
- package/dist/components/theme-provider.client.d.ts.map +1 -1
- package/dist/components/theme-provider.client.js +2 -4
- package/dist/components/theme-provider.d.ts +8 -0
- package/dist/components/theme-provider.d.ts.map +1 -0
- package/dist/components/theme-provider.js +3 -0
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +7 -7
- package/dist/helper/node.helper.d.ts +2 -828
- package/dist/helper/node.helper.d.ts.map +1 -1
- package/dist/helper/node.helper.js +11 -11
- package/dist/helper/theme.helper.d.ts +7 -2
- package/dist/helper/theme.helper.d.ts.map +1 -1
- package/dist/helper/theme.helper.js +9 -21
- package/dist/hook/useTheme.d.ts +1 -1
- package/dist/hook/useTheme.d.ts.map +1 -1
- package/dist/main.d.ts +6 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +6 -1
- package/dist/nextjs-registry/index.d.ts +3 -4
- package/dist/nextjs-registry/index.d.ts.map +1 -1
- package/dist/nextjs-registry/index.js +1 -1
- package/dist/node.type.d.ts +27 -4
- package/dist/node.type.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.3.8] - 2025-09-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **styling**: Enabled theme-aware functions in the `css` prop, allowing for more dynamic styling (e.g., `color: theme => theme.system.colors.primary`).
|
|
13
|
+
|
|
14
|
+
### Refactor
|
|
15
|
+
|
|
16
|
+
- **core**: Refactored the style resolution logic (`resolveObjWithTheme` and `StyledRenderer`) to selectively process the `css` prop. This enables the new theme-function feature while ensuring that other props (like `children`) are not processed, maintaining compatibility with Next.js Server Components.
|
|
17
|
+
|
|
18
|
+
## [0.3.7] - 2025-09-27
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **rsc:** make client components RSC compatible
|
|
23
|
+
|
|
24
|
+
### Refactor
|
|
25
|
+
|
|
26
|
+
- **node:** isolate css prop for StyledRenderer
|
|
27
|
+
|
|
8
28
|
## [0.3.6] - 2025-09-27
|
|
9
29
|
|
|
10
30
|
### Changed
|
|
@@ -62,7 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
62
82
|
- **feat(theme):** use React Context for theme propagation
|
|
63
83
|
|
|
64
84
|
**Before**:
|
|
65
|
-
|
|
85
|
+
'''typescript
|
|
66
86
|
import { Div } from '@meonode/ui';
|
|
67
87
|
|
|
68
88
|
const App = () => {
|
|
@@ -73,10 +93,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
73
93
|
children: 'Hello world!',
|
|
74
94
|
});
|
|
75
95
|
};
|
|
76
|
-
|
|
96
|
+
'''
|
|
77
97
|
|
|
78
98
|
**After**:
|
|
79
|
-
|
|
99
|
+
'''typescript
|
|
80
100
|
import { Div, ThemeProvider } from '@meonode/ui';
|
|
81
101
|
|
|
82
102
|
const App = () => {
|
|
@@ -99,7 +119,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
99
119
|
],
|
|
100
120
|
});
|
|
101
121
|
};
|
|
102
|
-
|
|
122
|
+
'''
|
|
103
123
|
|
|
104
124
|
## [0.2.21] - 2025-09-23
|
|
105
125
|
|
|
@@ -159,7 +179,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
159
179
|
|
|
160
180
|
- **feat(portal)**: use `usePortal` hook to make the portal reactive to state changes
|
|
161
181
|
|
|
162
|
-
|
|
182
|
+
'''typescript
|
|
163
183
|
import { Button, Div, Node, Portal, type PortalProps } from '@meonode/ui';
|
|
164
184
|
import { usePortal } from '@meonode/ui';
|
|
165
185
|
import { useState } from 'react';
|
|
@@ -198,7 +218,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
198
218
|
],
|
|
199
219
|
}).render();
|
|
200
220
|
};
|
|
201
|
-
|
|
221
|
+
'''
|
|
202
222
|
|
|
203
223
|
## [0.2.17] - 2025-09-14
|
|
204
224
|
|
|
@@ -310,22 +330,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
310
330
|
- **core**: add top-level `render` function for a cleaner and simpler API when mounting a Meonode instance to the DOM.
|
|
311
331
|
This abstracts away the need to manually use `react-dom/client`.
|
|
312
332
|
- **Before**:
|
|
313
|
-
|
|
333
|
+
'''typescript
|
|
314
334
|
import { createRoot } from 'react-dom/client';
|
|
315
335
|
import { Div } from '@meonode/ui';
|
|
316
336
|
|
|
317
337
|
const container = document.getElementById('root');
|
|
318
338
|
const root = createRoot(container);
|
|
319
339
|
root.render(Div({ children: 'Hello' }).render());
|
|
320
|
-
|
|
340
|
+
'''
|
|
321
341
|
- **After**:
|
|
322
|
-
|
|
342
|
+
'''typescript
|
|
323
343
|
import { Div } from '@meonode/ui';
|
|
324
344
|
import { render } from '@meonode/ui/client';
|
|
325
345
|
|
|
326
346
|
const container = document.getElementById('root');
|
|
327
347
|
render(Div({ children: 'Hello' }), container);
|
|
328
|
-
|
|
348
|
+
'''
|
|
329
349
|
- **constants**: add `NO_STYLE_TAGS` array and `noStyleTagsSet` for quick lookup of tags that should not receive styles
|
|
330
350
|
|
|
331
351
|
### Enhanced
|
|
@@ -357,7 +377,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
357
377
|
- Simplifies and unifies the typing system for node factories (`createNode`, `createChildrenFirstNode`).
|
|
358
378
|
- Improves developer experience when working with prebuilt components:
|
|
359
379
|
- Example:
|
|
360
|
-
|
|
380
|
+
'''typescript
|
|
361
381
|
import { Div, Input } from '@meonode/ui'
|
|
362
382
|
|
|
363
383
|
// Add new props
|
|
@@ -367,7 +387,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
367
387
|
Input<{ onChange: (e: { target: { value: string } }) => void }>({
|
|
368
388
|
onChange: ({ target }) => console.log(target.value),
|
|
369
389
|
})
|
|
370
|
-
|
|
390
|
+
'''
|
|
371
391
|
Extending prebuilt components is now safer and more predictable, with generic props always taking precedence when keys
|
|
372
392
|
overlap.
|
|
373
393
|
|
|
@@ -399,7 +419,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
399
419
|
### Added
|
|
400
420
|
|
|
401
421
|
- **core**: Exposed the original element via the created Node for easier access and debugging.
|
|
402
|
-
|
|
422
|
+
'''typescript
|
|
403
423
|
import { createNode } from "@meonode/ui";
|
|
404
424
|
|
|
405
425
|
// Create a Node wrapping a 'div' element
|
|
@@ -407,7 +427,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
407
427
|
|
|
408
428
|
// Access the underlying element type
|
|
409
429
|
console.log(MyComp.element); // 'div'
|
|
410
|
-
|
|
430
|
+
'''
|
|
411
431
|
|
|
412
432
|
## [0.2.3] - 2025-09-01
|
|
413
433
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
2
|
export default function StyleRegistry({ children }: {
|
|
3
3
|
children: ReactElement;
|
|
4
|
-
}):
|
|
4
|
+
}): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
5
5
|
//# sourceMappingURL=registry.client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.client.d.ts","sourceRoot":"","sources":["../../src/components/registry.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAY,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.client.d.ts","sourceRoot":"","sources":["../../src/components/registry.client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAY,MAAM,OAAO,CAAA;AAUlE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,YAAY,CAAA;CAAE,8EAuB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}import{createElement,useState}from"react";import{useServerInsertedHTML}from"next/navigation";import{CacheProvider}from"@emotion/react";import createCache from"@emotion/cache";function createEmotionCache(){return createCache({key:"meonode-css"})}export default function StyleRegistry(a){var b=a.children,c=useState(function(){var a=createEmotionCache();return a.compat=!0,a}),d=_slicedToArray(c,1),e=d[0];return useServerInsertedHTML(function(){var a=Object.keys(e.inserted).sort(),b=a.map(function(a){return e.inserted[a]}).join(""),c=a.join(" ");return b?createElement("style",{"data-emotion":"".concat(e.key," ").concat(c),dangerouslySetInnerHTML:{__html:b}}):null}),
|
|
1
|
+
"use client";function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}import{createElement,useState}from"react";import{useServerInsertedHTML}from"next/navigation";import{CacheProvider}from"@emotion/react";import createCache from"@emotion/cache";import{Node}from"../core.node.js";function createEmotionCache(){return createCache({key:"meonode-css"})}export default function StyleRegistry(a){var b=a.children,c=useState(function(){var a=createEmotionCache();return a.compat=!0,a}),d=_slicedToArray(c,1),e=d[0];return useServerInsertedHTML(function(){var a=Object.keys(e.inserted).sort(),b=a.map(function(a){return e.inserted[a]}).join(""),c=a.join(" ");return b?createElement("style",{"data-emotion":"".concat(e.key," ").concat(c),dangerouslySetInnerHTML:{__html:b}}):null}),Node(CacheProvider,{value:e,children:b}).render()}
|