@msviderok/base-ui-solid 1.0.0-beta.2 → 1.0.0-beta.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/README.md +11 -32
- package/cjs/merge-props/mergeProps.js +40 -24
- package/esm/index.js +1 -1
- package/esm/merge-props/mergeProps.js +40 -24
- package/package.json +14 -6
package/README.md
CHANGED
|
@@ -1,48 +1,27 @@
|
|
|
1
1
|
<!-- markdownlint-disable MD041 -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# _(WIP)_ This project is a work in progress.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Library is compatible with **@base-ui-components/react@1.0.0-beta.1**
|
|
6
|
+
- Docs have everything copied over from the original React-based docs so **_a lot_** of discrepancies in text are present
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
### Please, consider supporting an awesome Base UI team directly on [OpenCollective](https://opencollective.com/mui-org). This port is a gesture of appreciation of an increadible work they've been doing.
|
|
9
|
+
|
|
10
|
+
### Link to the original library: [Base UI GitHub](https://github.com/mui/base-ui)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
<hr />
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
10
15
|
|
|
11
16
|
```bash
|
|
12
|
-
npm install @base-ui-
|
|
17
|
+
npm install @msviderok/base-ui-solid
|
|
13
18
|
```
|
|
14
19
|
|
|
15
20
|
## Documentation
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Visit [base-ui.com](https://base-ui.com) to view the full documentation.
|
|
20
|
-
|
|
21
|
-
## Questions
|
|
22
|
-
|
|
23
|
-
For how-to questions that don't involve making changes to the code base, please use [Stack Overflow](https://stackoverflow.com/questions/tagged/base-ui) instead of GitHub issues.
|
|
24
|
-
Use the "base-ui" tag on Stack Overflow to make it easier for the community to find your question.
|
|
25
|
-
|
|
26
|
-
## Contributing
|
|
27
|
-
|
|
28
|
-
Read the [contributing guide](/CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.
|
|
29
|
-
|
|
30
|
-
Contributing to Base UI is about more than just issues and pull requests!
|
|
31
|
-
There are many other ways to [support Base UI](https://mui.com/material-ui/getting-started/faq/#mui-is-awesome-how-can-i-support-the-project) beyond contributing to the code base.
|
|
32
|
-
|
|
33
|
-
## Changelog
|
|
34
|
-
|
|
35
|
-
The [changelog](https://github.com/mui/base-ui/releases) is regularly updated to reflect what's changed in each new release.
|
|
36
|
-
|
|
37
|
-
## Roadmap
|
|
38
|
-
|
|
39
|
-
Future plans and high-priority features and enhancements can be found in the [roadmap](https://github.com/orgs/mui/projects/1).
|
|
22
|
+
### [base-ui-docs-solid.vercel.app](https://base-ui-docs-solid.vercel.app/)
|
|
40
23
|
|
|
41
24
|
## License
|
|
42
25
|
|
|
43
26
|
This project is licensed under the terms of the
|
|
44
27
|
[MIT license](/LICENSE).
|
|
45
|
-
|
|
46
|
-
## Security
|
|
47
|
-
|
|
48
|
-
For details of supported versions and contact details for reporting security issues, please refer to the [security policy](https://github.com/mui/base-ui/security/policy).
|
|
@@ -133,23 +133,32 @@ function mergeProps(...args) {
|
|
|
133
133
|
for (let props of sources) {
|
|
134
134
|
let propsOverride = false;
|
|
135
135
|
if (typeof props === 'function') {
|
|
136
|
-
const mergedListeners = {
|
|
137
|
-
|
|
136
|
+
const mergedListeners = Object.assign({}, cachedListeners);
|
|
137
|
+
const mergedStyles = Object.assign([], cacheStyles);
|
|
138
|
+
const mergedRefs = Object.assign([], cacheRefs);
|
|
139
|
+
const mergedClasses = Object.assign([], cacheClasses);
|
|
140
|
+
const mergedClassList = Object.assign([], cacheClassList);
|
|
141
|
+
const localMerged = {
|
|
142
|
+
get style() {
|
|
143
|
+
return reduce(mergedStyles, 'style', combineStyle);
|
|
144
|
+
},
|
|
145
|
+
get ref() {
|
|
146
|
+
return reverseChain(mergedRefs);
|
|
147
|
+
},
|
|
148
|
+
get class() {
|
|
149
|
+
return reduce(mergedClasses, 'class', (a, b) => `${a} ${b}`);
|
|
150
|
+
},
|
|
151
|
+
get classList() {
|
|
152
|
+
return reduce(mergedClassList, 'classList', (a, b) => ({
|
|
153
|
+
...a,
|
|
154
|
+
...b
|
|
155
|
+
}));
|
|
156
|
+
}
|
|
138
157
|
};
|
|
139
|
-
const mergedStyles = reduce(cacheStyles, 'style', combineStyle);
|
|
140
|
-
const mergedRefs = reverseChain(cacheRefs);
|
|
141
|
-
const mergedClasses = reduce(cacheClasses, 'class', (a, b) => `${a} ${b}`);
|
|
142
|
-
const mergedClassList = reduce(cacheClassList, 'classList', (a, b) => ({
|
|
143
|
-
...a,
|
|
144
|
-
...b
|
|
145
|
-
}));
|
|
146
158
|
const mergedForGetter = new Proxy(merge, {
|
|
147
159
|
get(target, key, receiver) {
|
|
148
160
|
if (typeof key !== 'string') return Reflect.get(target, key, receiver);
|
|
149
|
-
if (key
|
|
150
|
-
if (key === 'ref') return mergedRefs;
|
|
151
|
-
if (key === 'class') return mergedClasses;
|
|
152
|
-
if (key === 'classList') return mergedClassList;
|
|
161
|
+
if (key in localMerged) return localMerged[key];
|
|
153
162
|
if (key[0] === 'o' && key[1] === 'n' && key[2]) {
|
|
154
163
|
const name = key.toLowerCase();
|
|
155
164
|
if (name in mergedListeners) return mergedListeners[name];
|
|
@@ -209,20 +218,27 @@ function mergeProps(...args) {
|
|
|
209
218
|
const mergedListeners = {
|
|
210
219
|
...cachedListeners
|
|
211
220
|
};
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
221
|
+
const localMerged = {
|
|
222
|
+
get style() {
|
|
223
|
+
return reduce(cacheStyles, 'style', combineStyle);
|
|
224
|
+
},
|
|
225
|
+
get ref() {
|
|
226
|
+
return reverseChain(cacheRefs);
|
|
227
|
+
},
|
|
228
|
+
get class() {
|
|
229
|
+
return reduce(cacheClasses, 'class', (a, b) => `${a} ${b}`);
|
|
230
|
+
},
|
|
231
|
+
get classList() {
|
|
232
|
+
return reduce(cacheClassList, 'classList', (a, b) => ({
|
|
233
|
+
...a,
|
|
234
|
+
...b
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
219
238
|
return new Proxy({
|
|
220
239
|
get(key) {
|
|
221
240
|
if (typeof key !== 'string') return Reflect.get(merge, key);
|
|
222
|
-
if (key
|
|
223
|
-
if (key === 'ref') return mergedRefs;
|
|
224
|
-
if (key === 'class') return mergedClasses;
|
|
225
|
-
if (key === 'classList') return mergedClassList;
|
|
241
|
+
if (key in localMerged) return localMerged[key];
|
|
226
242
|
if (key[0] === 'o' && key[1] === 'n' && key[2]) {
|
|
227
243
|
const name = key.toLowerCase();
|
|
228
244
|
if (name in mergedListeners) return mergedListeners[name];
|
package/esm/index.js
CHANGED
|
@@ -124,23 +124,32 @@ export function mergeProps(...args) {
|
|
|
124
124
|
for (let props of sources) {
|
|
125
125
|
let propsOverride = false;
|
|
126
126
|
if (typeof props === 'function') {
|
|
127
|
-
const mergedListeners = {
|
|
128
|
-
|
|
127
|
+
const mergedListeners = Object.assign({}, cachedListeners);
|
|
128
|
+
const mergedStyles = Object.assign([], cacheStyles);
|
|
129
|
+
const mergedRefs = Object.assign([], cacheRefs);
|
|
130
|
+
const mergedClasses = Object.assign([], cacheClasses);
|
|
131
|
+
const mergedClassList = Object.assign([], cacheClassList);
|
|
132
|
+
const localMerged = {
|
|
133
|
+
get style() {
|
|
134
|
+
return reduce(mergedStyles, 'style', combineStyle);
|
|
135
|
+
},
|
|
136
|
+
get ref() {
|
|
137
|
+
return reverseChain(mergedRefs);
|
|
138
|
+
},
|
|
139
|
+
get class() {
|
|
140
|
+
return reduce(mergedClasses, 'class', (a, b) => `${a} ${b}`);
|
|
141
|
+
},
|
|
142
|
+
get classList() {
|
|
143
|
+
return reduce(mergedClassList, 'classList', (a, b) => ({
|
|
144
|
+
...a,
|
|
145
|
+
...b
|
|
146
|
+
}));
|
|
147
|
+
}
|
|
129
148
|
};
|
|
130
|
-
const mergedStyles = reduce(cacheStyles, 'style', combineStyle);
|
|
131
|
-
const mergedRefs = reverseChain(cacheRefs);
|
|
132
|
-
const mergedClasses = reduce(cacheClasses, 'class', (a, b) => `${a} ${b}`);
|
|
133
|
-
const mergedClassList = reduce(cacheClassList, 'classList', (a, b) => ({
|
|
134
|
-
...a,
|
|
135
|
-
...b
|
|
136
|
-
}));
|
|
137
149
|
const mergedForGetter = new Proxy(merge, {
|
|
138
150
|
get(target, key, receiver) {
|
|
139
151
|
if (typeof key !== 'string') return Reflect.get(target, key, receiver);
|
|
140
|
-
if (key
|
|
141
|
-
if (key === 'ref') return mergedRefs;
|
|
142
|
-
if (key === 'class') return mergedClasses;
|
|
143
|
-
if (key === 'classList') return mergedClassList;
|
|
152
|
+
if (key in localMerged) return localMerged[key];
|
|
144
153
|
if (key[0] === 'o' && key[1] === 'n' && key[2]) {
|
|
145
154
|
const name = key.toLowerCase();
|
|
146
155
|
if (name in mergedListeners) return mergedListeners[name];
|
|
@@ -200,20 +209,27 @@ export function mergeProps(...args) {
|
|
|
200
209
|
const mergedListeners = {
|
|
201
210
|
...cachedListeners
|
|
202
211
|
};
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
212
|
+
const localMerged = {
|
|
213
|
+
get style() {
|
|
214
|
+
return reduce(cacheStyles, 'style', combineStyle);
|
|
215
|
+
},
|
|
216
|
+
get ref() {
|
|
217
|
+
return reverseChain(cacheRefs);
|
|
218
|
+
},
|
|
219
|
+
get class() {
|
|
220
|
+
return reduce(cacheClasses, 'class', (a, b) => `${a} ${b}`);
|
|
221
|
+
},
|
|
222
|
+
get classList() {
|
|
223
|
+
return reduce(cacheClassList, 'classList', (a, b) => ({
|
|
224
|
+
...a,
|
|
225
|
+
...b
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
};
|
|
210
229
|
return new Proxy({
|
|
211
230
|
get(key) {
|
|
212
231
|
if (typeof key !== 'string') return Reflect.get(merge, key);
|
|
213
|
-
if (key
|
|
214
|
-
if (key === 'ref') return mergedRefs;
|
|
215
|
-
if (key === 'class') return mergedClasses;
|
|
216
|
-
if (key === 'classList') return mergedClassList;
|
|
232
|
+
if (key in localMerged) return localMerged[key];
|
|
217
233
|
if (key[0] === 'o' && key[1] === 'n' && key[2]) {
|
|
218
234
|
const name = key.toLowerCase();
|
|
219
235
|
if (name in mergedListeners) return mergedListeners[name];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@msviderok/base-ui-solid",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "MUI Team",
|
|
6
6
|
"description": "Base UI is a library of headless ('unstyled') Solid components and low-level hooks. You gain complete control over your app's CSS and accessibility features.",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
],
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/
|
|
16
|
+
"url": "git+https://github.com/msviderok/base-ui.git",
|
|
17
17
|
"directory": "packages/solid"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"bugs": {
|
|
21
|
-
"url": "https://github.com/
|
|
21
|
+
"url": "https://github.com/msviderok/base-ui/issues"
|
|
22
22
|
},
|
|
23
23
|
"homepage": "https://base-ui.com",
|
|
24
24
|
"funding": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@babel/runtime": "^7.27.6",
|
|
31
31
|
"@floating-ui/dom": "^1.7.2",
|
|
32
32
|
"@floating-ui/utils": "^0.2.10",
|
|
33
|
+
"@solid-primitives/props": "^3.2.2",
|
|
33
34
|
"@solidjs/router": "^0.15.3",
|
|
34
35
|
"babel-preset-solid": "^1.9.10",
|
|
35
36
|
"tabbable": "^6.2.0"
|
|
@@ -42,9 +43,6 @@
|
|
|
42
43
|
"node": ">=14.0.0"
|
|
43
44
|
},
|
|
44
45
|
"main": "./cjs/index.js",
|
|
45
|
-
"directories": {
|
|
46
|
-
"test": "test"
|
|
47
|
-
},
|
|
48
46
|
"module": "./esm/index.js",
|
|
49
47
|
"types": "index",
|
|
50
48
|
"typesVersions": {
|
|
@@ -439,6 +437,16 @@
|
|
|
439
437
|
"default": "./esm/unstable-use-media-query/index.js"
|
|
440
438
|
}
|
|
441
439
|
},
|
|
440
|
+
"./use-render": {
|
|
441
|
+
"require": {
|
|
442
|
+
"types": "./cjs/use-render/index.d.ts",
|
|
443
|
+
"default": "./cjs/use-render/index.js"
|
|
444
|
+
},
|
|
445
|
+
"import": {
|
|
446
|
+
"types": "./esm/use-render/index.d.ts",
|
|
447
|
+
"default": "./esm/use-render/index.js"
|
|
448
|
+
}
|
|
449
|
+
},
|
|
442
450
|
"./utils": {
|
|
443
451
|
"require": {
|
|
444
452
|
"types": "./cjs/utils/index.d.ts",
|