worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
15
node_modules/@mui/system/esm/compose/compose.d.ts
generated
vendored
Normal file
15
node_modules/@mui/system/esm/compose/compose.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { StyleFunction } from "../style/index.js";
|
||||
|
||||
/**
|
||||
* given a list of StyleFunction return the intersection of the props each individual
|
||||
* StyleFunction requires.
|
||||
*
|
||||
* If `firstFn` requires { color: string } and `secondFn` requires { spacing: number }
|
||||
* their composed function requires { color: string, spacing: number }
|
||||
*/
|
||||
type ComposedArg<T> = T extends Array<(arg: infer P) => any> ? P : never;
|
||||
type ComposedOwnerState<T> = ComposedArg<T>;
|
||||
export type ComposedStyleFunction<T extends Array<StyleFunction<any>>> = StyleFunction<ComposedOwnerState<T>> & {
|
||||
filterProps: string[];
|
||||
};
|
||||
export default function compose<T extends Array<StyleFunction<any>>>(...args: T): ComposedStyleFunction<T>;
|
||||
24
node_modules/@mui/system/esm/compose/compose.js
generated
vendored
Normal file
24
node_modules/@mui/system/esm/compose/compose.js
generated
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import merge from "../merge/index.js";
|
||||
function compose(...styles) {
|
||||
const handlers = styles.reduce((acc, style) => {
|
||||
style.filterProps.forEach(prop => {
|
||||
acc[prop] = style;
|
||||
});
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
// false positive
|
||||
// eslint-disable-next-line react/function-component-definition
|
||||
const fn = props => {
|
||||
return Object.keys(props).reduce((acc, prop) => {
|
||||
if (handlers[prop]) {
|
||||
return merge(acc, handlers[prop](props));
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
};
|
||||
fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};
|
||||
fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);
|
||||
return fn;
|
||||
}
|
||||
export default compose;
|
||||
1
node_modules/@mui/system/esm/compose/index.d.ts
generated
vendored
Normal file
1
node_modules/@mui/system/esm/compose/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default, type ComposedStyleFunction } from "./compose.js";
|
||||
1
node_modules/@mui/system/esm/compose/index.js
generated
vendored
Normal file
1
node_modules/@mui/system/esm/compose/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default } from "./compose.js";
|
||||
Loading…
Add table
Add a link
Reference in a new issue