@mui/utils 5.7.0 → 5.8.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/CHANGELOG.md +72 -0
- package/ClassNameGenerator/ClassNameGenerator.d.ts +6 -0
- package/ClassNameGenerator/ClassNameGenerator.js +30 -0
- package/ClassNameGenerator/index.d.ts +1 -0
- package/ClassNameGenerator/index.js +15 -0
- package/ClassNameGenerator/package.json +6 -0
- package/HTMLElementType.d.ts +3 -3
- package/chainPropTypes.d.ts +2 -2
- package/composeClasses/composeClasses.d.ts +1 -0
- package/composeClasses/composeClasses.js +26 -0
- package/composeClasses/index.d.ts +1 -0
- package/composeClasses/index.js +15 -0
- package/composeClasses/package.json +6 -0
- package/createChainedFunction.d.ts +7 -7
- package/deepmerge.d.ts +5 -5
- package/elementAcceptingRef.d.ts +3 -3
- package/elementTypeAcceptingRef.d.ts +3 -3
- package/esm/ClassNameGenerator/ClassNameGenerator.js +22 -0
- package/esm/ClassNameGenerator/index.js +1 -0
- package/esm/composeClasses/composeClasses.js +19 -0
- package/esm/composeClasses/index.js +1 -0
- package/esm/generateUtilityClass/generateUtilityClass.js +17 -0
- package/esm/generateUtilityClass/index.js +2 -0
- package/esm/generateUtilityClasses/generateUtilityClasses.js +8 -0
- package/esm/generateUtilityClasses/index.js +1 -0
- package/esm/index.js +6 -1
- package/exactProp.d.ts +2 -2
- package/formatMuiErrorMessage.d.ts +6 -6
- package/generateUtilityClass/generateUtilityClass.d.ts +2 -0
- package/generateUtilityClass/generateUtilityClass.js +28 -0
- package/generateUtilityClass/index.d.ts +2 -0
- package/generateUtilityClass/index.js +30 -0
- package/generateUtilityClass/package.json +6 -0
- package/generateUtilityClasses/generateUtilityClasses.d.ts +1 -0
- package/generateUtilityClasses/generateUtilityClasses.js +18 -0
- package/generateUtilityClasses/index.d.ts +1 -0
- package/generateUtilityClasses/index.js +15 -0
- package/generateUtilityClasses/package.json +6 -0
- package/getDisplayName.d.ts +8 -8
- package/getScrollbarSize.d.ts +1 -1
- package/index.d.ts +38 -33
- package/index.js +85 -1
- package/integerPropType.d.ts +7 -7
- package/isMuiElement.d.ts +1 -1
- package/legacy/ClassNameGenerator/ClassNameGenerator.js +21 -0
- package/legacy/ClassNameGenerator/index.js +1 -0
- package/legacy/composeClasses/composeClasses.js +19 -0
- package/legacy/composeClasses/index.js +1 -0
- package/legacy/generateUtilityClass/generateUtilityClass.js +17 -0
- package/legacy/generateUtilityClass/index.js +2 -0
- package/legacy/generateUtilityClasses/generateUtilityClasses.js +8 -0
- package/legacy/generateUtilityClasses/index.js +1 -0
- package/legacy/index.js +7 -2
- package/modern/ClassNameGenerator/ClassNameGenerator.js +22 -0
- package/modern/ClassNameGenerator/index.js +1 -0
- package/modern/composeClasses/composeClasses.js +19 -0
- package/modern/composeClasses/index.js +1 -0
- package/modern/generateUtilityClass/generateUtilityClass.js +17 -0
- package/modern/generateUtilityClass/index.js +2 -0
- package/modern/generateUtilityClasses/generateUtilityClasses.js +8 -0
- package/modern/generateUtilityClasses/index.js +1 -0
- package/modern/index.js +7 -2
- package/ownerDocument.d.ts +1 -1
- package/ownerWindow.d.ts +1 -1
- package/package.json +1 -1
- package/ponyfillGlobal.d.ts +2 -2
- package/refType.d.ts +3 -3
- package/resolveProps.d.ts +9 -9
- package/setRef.d.ts +15 -15
- package/useEventCallback.d.ts +4 -4
- package/useEventCallback.spec.d.ts +1 -1
- package/useForkRef.d.ts +2 -2
- package/useId.d.ts +7 -7
- package/useIsFocusVisible.d.ts +9 -9
- package/usePreviousProps.d.ts +2 -2
- package/visuallyHidden.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# [Versions](https://mui.com/versions/)
|
|
2
2
|
|
|
3
|
+
## 5.8.0
|
|
4
|
+
|
|
5
|
+
<!-- generated comparing v5.7.0..master -->
|
|
6
|
+
|
|
7
|
+
_May 17, 2022_
|
|
8
|
+
|
|
9
|
+
A big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
10
|
+
|
|
11
|
+
- 🚀 [Blog post](https://mui.com/blog/premium-plan-release/) for announcing the release of the Premium plan of MUI X is out thanks to @joserodolfofreitas.
|
|
12
|
+
- Codemod for `jss` to `tss-react` migration is out thanks to @ryancogswell
|
|
13
|
+
- And more 🐛 bug fixes and 📚 documentation improvements.
|
|
14
|
+
|
|
15
|
+
### `@mui/material@5.8.0`
|
|
16
|
+
|
|
17
|
+
- ​<!-- 37 -->[Autocomplete] Fix `getInputProps` TypeScript return type (#32730) @ZeeshanTamboli
|
|
18
|
+
- ​<!-- 36 -->[Autocomplete] Forward props to renderTags() (#32637) @emlai
|
|
19
|
+
- ​<!-- 35 -->[Badge] Fix TypeScript error when adding style overrides for Badge (#32745) @ZeeshanTamboli
|
|
20
|
+
- ​<!-- 09 -->[Menu] Fix context menu open position (#32661) @oliviertassinari
|
|
21
|
+
|
|
22
|
+
### `@mui/system@5.8.0`
|
|
23
|
+
|
|
24
|
+
- ​<!-- 05 -->[system] Add `Container` component and `createContainer` factory (#32263) @mnajdova
|
|
25
|
+
|
|
26
|
+
### `@mui/base@5.0.0-alpha.81`
|
|
27
|
+
|
|
28
|
+
- ​<!-- 15 -->[InputUnstyled] Support callbacks in componentsProps (#32271) @michaldudak
|
|
29
|
+
- ​<!-- 14 -->[InputUnstyled] Define ownerState and slot props' types (#32491) @michaldudak
|
|
30
|
+
- ​<!-- 08 -->[MenuUnstyled] Demos improvements (#32714) @michaldudak
|
|
31
|
+
- ​<!-- 07 -->[OptionUnstyled] Define ownerState and slot props' types (#32717) @michaldudak
|
|
32
|
+
|
|
33
|
+
### `@mui/joy@5.0.0-alpha.28`
|
|
34
|
+
|
|
35
|
+
- ​<!-- 13 -->[Joy] Add Badge doc (#32790) @siriwatknp
|
|
36
|
+
- ​<!-- 12 -->[Joy] Add global variant feature page (#32695) @siriwatknp
|
|
37
|
+
- ​<!-- 11 -->[Joy] Add avatar page (#32711) @siriwatknp
|
|
38
|
+
|
|
39
|
+
### `@mui/codemod@5.8.0`
|
|
40
|
+
|
|
41
|
+
- ​<!-- 33 -->[codemod] Add jss to tss-react codemod (#31802) @ryancogswell
|
|
42
|
+
|
|
43
|
+
### Docs
|
|
44
|
+
|
|
45
|
+
- ​<!-- 34 -->[blog] Add release post for MUI X Premium (#32720) @joserodolfofreitas
|
|
46
|
+
- ​<!-- 29 -->[docs] Fix wrong code snippet for overriding styles in theme with a callback value (#32781) @ZeeshanTamboli
|
|
47
|
+
- ​<!-- 28 -->[docs] Update Crowdin logo (#32782) @andrii-bodnar
|
|
48
|
+
- ​<!-- 27 -->[docs] Improve callouts design (#32709) @danilo-leal
|
|
49
|
+
- ​<!-- 26 -->[docs] Revise the "Understanding MUI packages" article (#32382) @danilo-leal
|
|
50
|
+
- ​<!-- 25 -->[docs] Fix link to the material icons (#32771) @oliviertassinari
|
|
51
|
+
- ​<!-- 24 -->[docs] Add notification for Premium release blog post (#32728) @joserodolfofreitas
|
|
52
|
+
- ​<!-- 23 -->[docs] Base Portal style revisions and final review (#32157) @samuelsycamore
|
|
53
|
+
- ​<!-- 22 -->[docs] Add joy to docs package.json (#32744) @siriwatknp
|
|
54
|
+
- ​<!-- 21 -->[docs] Fix TOC-related styles not being applied when disableAd=true (#32733) @cherniavskii
|
|
55
|
+
- ​<!-- 20 -->[docs] Add TypeScript guide on the polymorphic components (#32168) @mnajdova
|
|
56
|
+
- ​<!-- 19 -->[docs] Fix warning mode pass to React.Fragment (#32729) @siriwatknp
|
|
57
|
+
- ​<!-- 18 -->[docs] Revise Showcase copy for clarity + audit appList (#31946) @samuelsycamore
|
|
58
|
+
- ​<!-- 17 -->[examples] Update remix example's tsconfig with required values (#32723) @michaldudak
|
|
59
|
+
- ​<!-- 16 -->[examples] Update to use React 18's createRoot (#32506) @mnajdova
|
|
60
|
+
- ​<!-- 10 -->[l10n] Fix typos and translations on arSD and arEG locales (#31848) @shadigaafar
|
|
61
|
+
- ​<!-- 04 -->[website] Improve communication about MUI X components that are still wip (#32708) @danilo-leal
|
|
62
|
+
- ​<!-- 03 -->[website] Remove scrollbar on x-axis (#32291) @MrHBS
|
|
63
|
+
- ​<!-- 02 -->[website] Update the pricing page for the MUI X premium plan release (#32458) @joserodolfofreitas
|
|
64
|
+
- ​<!-- 01 -->[website] Update sponsors (#32725) @oliviertassinari
|
|
65
|
+
|
|
66
|
+
### Core
|
|
67
|
+
|
|
68
|
+
- ​<!-- 32 -->[core] Enabled Renovate's lockfile maintenance (#32635) @michaldudak
|
|
69
|
+
- ​<!-- 31 -->[core] Extract `MuiPage` interface to separate file (#32715) @cherniavskii
|
|
70
|
+
- ​<!-- 30 -->[core] Remove unnecessary `spacing` parameter from `createMixins` method (#32690) @ZeeshanTamboli
|
|
71
|
+
- ​<!-- 06 -->[private-classnames] Remove package and move everything to utils (#32758) @mnajdova
|
|
72
|
+
|
|
73
|
+
All contributors of this release in alphabetical order: @andrii-bodnar, @cherniavskii, @danilo-leal, @emlai, @joserodolfofreitas, @michaldudak, @mnajdova, @MrHBS, @oliviertassinari, @ryancogswell, @samuelsycamore, @shadigaafar, @siriwatknp, @ZeeshanTamboli
|
|
74
|
+
|
|
3
75
|
## 5.7.0
|
|
4
76
|
|
|
5
77
|
<!-- generated comparing v5.6.4..master -->
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
const defaultGenerator = componentName => componentName;
|
|
9
|
+
|
|
10
|
+
const createClassNameGenerator = () => {
|
|
11
|
+
let generate = defaultGenerator;
|
|
12
|
+
return {
|
|
13
|
+
configure(generator) {
|
|
14
|
+
generate = generator;
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
generate(componentName) {
|
|
18
|
+
return generate(componentName);
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
reset() {
|
|
22
|
+
generate = defaultGenerator;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const ClassNameGenerator = createClassNameGenerator();
|
|
29
|
+
var _default = ClassNameGenerator;
|
|
30
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ClassNameGenerator';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _ClassNameGenerator.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator"));
|
package/HTMLElementType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default function HTMLElementType(props: {
|
|
2
|
-
[key: string]: unknown;
|
|
3
|
-
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
|
1
|
+
export default function HTMLElementType(props: {
|
|
2
|
+
[key: string]: unknown;
|
|
3
|
+
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
package/chainPropTypes.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes: Record<string, string> | undefined): Record<ClassKey, string>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = composeClasses;
|
|
7
|
+
|
|
8
|
+
function composeClasses(slots, getUtilityClass, classes) {
|
|
9
|
+
const output = {};
|
|
10
|
+
Object.keys(slots).forEach( // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
11
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
12
|
+
slot => {
|
|
13
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
14
|
+
if (key) {
|
|
15
|
+
if (classes && classes[key]) {
|
|
16
|
+
acc.push(classes[key]);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
acc.push(getUtilityClass(key));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return acc;
|
|
23
|
+
}, []).join(' ');
|
|
24
|
+
});
|
|
25
|
+
return output;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './composeClasses';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _composeClasses.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _composeClasses = _interopRequireDefault(require("./composeClasses"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe chained function.
|
|
3
|
-
*
|
|
4
|
-
* Will only create a new function if needed,
|
|
5
|
-
* otherwise will pass back existing functions or null.
|
|
6
|
-
*/
|
|
7
|
-
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
|
1
|
+
/**
|
|
2
|
+
* Safe chained function.
|
|
3
|
+
*
|
|
4
|
+
* Will only create a new function if needed,
|
|
5
|
+
* otherwise will pass back existing functions or null.
|
|
6
|
+
*/
|
|
7
|
+
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
package/deepmerge.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
-
export interface DeepmergeOptions {
|
|
3
|
-
clone?: boolean;
|
|
4
|
-
}
|
|
5
|
-
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
|
1
|
+
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
|
2
|
+
export interface DeepmergeOptions {
|
|
3
|
+
clone?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
package/elementAcceptingRef.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
-
export default elementAcceptingRef;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
|
3
|
+
export default elementAcceptingRef;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
-
export default _default;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const defaultGenerator = componentName => componentName;
|
|
2
|
+
|
|
3
|
+
const createClassNameGenerator = () => {
|
|
4
|
+
let generate = defaultGenerator;
|
|
5
|
+
return {
|
|
6
|
+
configure(generator) {
|
|
7
|
+
generate = generator;
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
generate(componentName) {
|
|
11
|
+
return generate(componentName);
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
reset() {
|
|
15
|
+
generate = defaultGenerator;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ClassNameGenerator = createClassNameGenerator();
|
|
22
|
+
export default ClassNameGenerator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ClassNameGenerator';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function composeClasses(slots, getUtilityClass, classes) {
|
|
2
|
+
const output = {};
|
|
3
|
+
Object.keys(slots).forEach( // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
4
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
5
|
+
slot => {
|
|
6
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
7
|
+
if (key) {
|
|
8
|
+
if (classes && classes[key]) {
|
|
9
|
+
acc.push(classes[key]);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
acc.push(getUtilityClass(key));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return acc;
|
|
16
|
+
}, []).join(' ');
|
|
17
|
+
});
|
|
18
|
+
return output;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './composeClasses';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
+
const globalStateClassesMapping = {
|
|
3
|
+
active: 'Mui-active',
|
|
4
|
+
checked: 'Mui-checked',
|
|
5
|
+
completed: 'Mui-completed',
|
|
6
|
+
disabled: 'Mui-disabled',
|
|
7
|
+
error: 'Mui-error',
|
|
8
|
+
expanded: 'Mui-expanded',
|
|
9
|
+
focused: 'Mui-focused',
|
|
10
|
+
focusVisible: 'Mui-focusVisible',
|
|
11
|
+
required: 'Mui-required',
|
|
12
|
+
selected: 'Mui-selected'
|
|
13
|
+
};
|
|
14
|
+
export default function generateUtilityClass(componentName, slot) {
|
|
15
|
+
const globalStateClass = globalStateClassesMapping[slot];
|
|
16
|
+
return globalStateClass || `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
2
|
+
export default function generateUtilityClasses(componentName, slots) {
|
|
3
|
+
const result = {};
|
|
4
|
+
slots.forEach(slot => {
|
|
5
|
+
result[slot] = generateUtilityClass(componentName, slot);
|
|
6
|
+
});
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './generateUtilityClasses';
|
package/esm/index.js
CHANGED
|
@@ -30,4 +30,9 @@ export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft
|
|
|
30
30
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
31
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
32
|
export { default as integerPropType } from './integerPropType';
|
|
33
|
-
export { default as internal_resolveProps } from './resolveProps';
|
|
33
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
34
|
+
export { default as unstable_composeClasses } from './composeClasses';
|
|
35
|
+
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
36
|
+
export * from './generateUtilityClass';
|
|
37
|
+
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
38
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
package/exactProp.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ValidationMap } from 'prop-types';
|
|
2
|
-
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
|
1
|
+
import { ValidationMap } from 'prop-types';
|
|
2
|
+
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WARNING: Don't import this directly.
|
|
3
|
-
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
-
* @param {number} code
|
|
5
|
-
*/
|
|
6
|
-
export default function formatMuiErrorMessage(code: number): string;
|
|
1
|
+
/**
|
|
2
|
+
* WARNING: Don't import this directly.
|
|
3
|
+
* Use `MuiError` from `@mui/utils/macros/MuiError.macro` instead.
|
|
4
|
+
* @param {number} code
|
|
5
|
+
*/
|
|
6
|
+
export default function formatMuiErrorMessage(code: number): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = generateUtilityClass;
|
|
9
|
+
|
|
10
|
+
var _ClassNameGenerator = _interopRequireDefault(require("../ClassNameGenerator"));
|
|
11
|
+
|
|
12
|
+
const globalStateClassesMapping = {
|
|
13
|
+
active: 'Mui-active',
|
|
14
|
+
checked: 'Mui-checked',
|
|
15
|
+
completed: 'Mui-completed',
|
|
16
|
+
disabled: 'Mui-disabled',
|
|
17
|
+
error: 'Mui-error',
|
|
18
|
+
expanded: 'Mui-expanded',
|
|
19
|
+
focused: 'Mui-focused',
|
|
20
|
+
focusVisible: 'Mui-focusVisible',
|
|
21
|
+
required: 'Mui-required',
|
|
22
|
+
selected: 'Mui-selected'
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
function generateUtilityClass(componentName, slot) {
|
|
26
|
+
const globalStateClass = globalStateClassesMapping[slot];
|
|
27
|
+
return globalStateClass || `${_ClassNameGenerator.default.generate(componentName)}-${slot}`;
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {};
|
|
7
|
+
Object.defineProperty(exports, "default", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _generateUtilityClass.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
var _generateUtilityClass = _interopRequireWildcard(require("./generateUtilityClass"));
|
|
15
|
+
|
|
16
|
+
Object.keys(_generateUtilityClass).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _generateUtilityClass[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _generateUtilityClass[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
+
|
|
30
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[]): Record<T, string>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = generateUtilityClasses;
|
|
9
|
+
|
|
10
|
+
var _generateUtilityClass = _interopRequireDefault(require("../generateUtilityClass"));
|
|
11
|
+
|
|
12
|
+
function generateUtilityClasses(componentName, slots) {
|
|
13
|
+
const result = {};
|
|
14
|
+
slots.forEach(slot => {
|
|
15
|
+
result[slot] = (0, _generateUtilityClass.default)(componentName, slot);
|
|
16
|
+
});
|
|
17
|
+
return result;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './generateUtilityClasses';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "default", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return _generateUtilityClasses.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
var _generateUtilityClasses = _interopRequireDefault(require("./generateUtilityClasses"));
|
package/getDisplayName.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function getFunctionName(fn: Function): string;
|
|
3
|
-
/**
|
|
4
|
-
* cherry-pick from
|
|
5
|
-
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
-
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
-
*/
|
|
8
|
-
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function getFunctionName(fn: Function): string;
|
|
3
|
+
/**
|
|
4
|
+
* cherry-pick from
|
|
5
|
+
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
|
6
|
+
* originally forked from recompose/getDisplayName with added IE11 support
|
|
7
|
+
*/
|
|
8
|
+
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
package/getScrollbarSize.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function getScrollbarSize(doc: Document): number;
|
|
1
|
+
export default function getScrollbarSize(doc: Document): number;
|
package/index.d.ts
CHANGED
|
@@ -1,33 +1,38 @@
|
|
|
1
|
-
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
-
export { default as deepmerge } from './deepmerge';
|
|
3
|
-
export { isPlainObject } from './deepmerge';
|
|
4
|
-
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
-
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
-
export { default as exactProp } from './exactProp';
|
|
7
|
-
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
-
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
-
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
-
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
-
export { default as refType } from './refType';
|
|
12
|
-
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
-
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
-
export { default as unstable_debounce } from './debounce';
|
|
15
|
-
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
-
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
-
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
-
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
-
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
-
export { default as unstable_setRef } from './setRef';
|
|
21
|
-
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
-
export { default as unstable_useId } from './useId';
|
|
23
|
-
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
-
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
-
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
-
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
-
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
-
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
-
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
-
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
-
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
-
export { default as integerPropType } from './integerPropType';
|
|
33
|
-
export { default as internal_resolveProps } from './resolveProps';
|
|
1
|
+
export { default as chainPropTypes } from './chainPropTypes';
|
|
2
|
+
export { default as deepmerge } from './deepmerge';
|
|
3
|
+
export { isPlainObject } from './deepmerge';
|
|
4
|
+
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
|
5
|
+
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
|
6
|
+
export { default as exactProp } from './exactProp';
|
|
7
|
+
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
|
8
|
+
export { default as getDisplayName } from './getDisplayName';
|
|
9
|
+
export { default as HTMLElementType } from './HTMLElementType';
|
|
10
|
+
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
|
11
|
+
export { default as refType } from './refType';
|
|
12
|
+
export { default as unstable_capitalize } from './capitalize';
|
|
13
|
+
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
|
14
|
+
export { default as unstable_debounce } from './debounce';
|
|
15
|
+
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
|
16
|
+
export { default as unstable_isMuiElement } from './isMuiElement';
|
|
17
|
+
export { default as unstable_ownerDocument } from './ownerDocument';
|
|
18
|
+
export { default as unstable_ownerWindow } from './ownerWindow';
|
|
19
|
+
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
|
20
|
+
export { default as unstable_setRef } from './setRef';
|
|
21
|
+
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
|
22
|
+
export { default as unstable_useId } from './useId';
|
|
23
|
+
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
|
24
|
+
export { default as unstable_useControlled } from './useControlled';
|
|
25
|
+
export { default as unstable_useEventCallback } from './useEventCallback';
|
|
26
|
+
export { default as unstable_useForkRef } from './useForkRef';
|
|
27
|
+
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
|
28
|
+
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
|
29
|
+
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
|
30
|
+
export { default as usePreviousProps } from './usePreviousProps';
|
|
31
|
+
export { default as visuallyHidden } from './visuallyHidden';
|
|
32
|
+
export { default as integerPropType } from './integerPropType';
|
|
33
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
34
|
+
export { default as unstable_composeClasses } from './composeClasses';
|
|
35
|
+
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
36
|
+
export * from './generateUtilityClass';
|
|
37
|
+
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
38
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
package/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.8.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -10,6 +10,46 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", {
|
|
11
11
|
value: true
|
|
12
12
|
});
|
|
13
|
+
var _exportNames = {
|
|
14
|
+
chainPropTypes: true,
|
|
15
|
+
deepmerge: true,
|
|
16
|
+
isPlainObject: true,
|
|
17
|
+
elementAcceptingRef: true,
|
|
18
|
+
elementTypeAcceptingRef: true,
|
|
19
|
+
exactProp: true,
|
|
20
|
+
formatMuiErrorMessage: true,
|
|
21
|
+
getDisplayName: true,
|
|
22
|
+
HTMLElementType: true,
|
|
23
|
+
ponyfillGlobal: true,
|
|
24
|
+
refType: true,
|
|
25
|
+
unstable_capitalize: true,
|
|
26
|
+
unstable_createChainedFunction: true,
|
|
27
|
+
unstable_debounce: true,
|
|
28
|
+
unstable_deprecatedPropType: true,
|
|
29
|
+
unstable_isMuiElement: true,
|
|
30
|
+
unstable_ownerDocument: true,
|
|
31
|
+
unstable_ownerWindow: true,
|
|
32
|
+
unstable_requirePropFactory: true,
|
|
33
|
+
unstable_setRef: true,
|
|
34
|
+
unstable_useEnhancedEffect: true,
|
|
35
|
+
unstable_useId: true,
|
|
36
|
+
unstable_unsupportedProp: true,
|
|
37
|
+
unstable_useControlled: true,
|
|
38
|
+
unstable_useEventCallback: true,
|
|
39
|
+
unstable_useForkRef: true,
|
|
40
|
+
unstable_useIsFocusVisible: true,
|
|
41
|
+
unstable_getScrollbarSize: true,
|
|
42
|
+
unstable_detectScrollType: true,
|
|
43
|
+
unstable_getNormalizedScrollLeft: true,
|
|
44
|
+
usePreviousProps: true,
|
|
45
|
+
visuallyHidden: true,
|
|
46
|
+
integerPropType: true,
|
|
47
|
+
internal_resolveProps: true,
|
|
48
|
+
unstable_composeClasses: true,
|
|
49
|
+
unstable_generateUtilityClass: true,
|
|
50
|
+
unstable_generateUtilityClasses: true,
|
|
51
|
+
unstable_ClassNameGenerator: true
|
|
52
|
+
};
|
|
13
53
|
Object.defineProperty(exports, "HTMLElementType", {
|
|
14
54
|
enumerable: true,
|
|
15
55
|
get: function () {
|
|
@@ -88,12 +128,24 @@ Object.defineProperty(exports, "refType", {
|
|
|
88
128
|
return _refType.default;
|
|
89
129
|
}
|
|
90
130
|
});
|
|
131
|
+
Object.defineProperty(exports, "unstable_ClassNameGenerator", {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _ClassNameGenerator.default;
|
|
135
|
+
}
|
|
136
|
+
});
|
|
91
137
|
Object.defineProperty(exports, "unstable_capitalize", {
|
|
92
138
|
enumerable: true,
|
|
93
139
|
get: function () {
|
|
94
140
|
return _capitalize.default;
|
|
95
141
|
}
|
|
96
142
|
});
|
|
143
|
+
Object.defineProperty(exports, "unstable_composeClasses", {
|
|
144
|
+
enumerable: true,
|
|
145
|
+
get: function () {
|
|
146
|
+
return _composeClasses.default;
|
|
147
|
+
}
|
|
148
|
+
});
|
|
97
149
|
Object.defineProperty(exports, "unstable_createChainedFunction", {
|
|
98
150
|
enumerable: true,
|
|
99
151
|
get: function () {
|
|
@@ -118,6 +170,18 @@ Object.defineProperty(exports, "unstable_detectScrollType", {
|
|
|
118
170
|
return _scrollLeft.detectScrollType;
|
|
119
171
|
}
|
|
120
172
|
});
|
|
173
|
+
Object.defineProperty(exports, "unstable_generateUtilityClass", {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
get: function () {
|
|
176
|
+
return _generateUtilityClass.default;
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
Object.defineProperty(exports, "unstable_generateUtilityClasses", {
|
|
180
|
+
enumerable: true,
|
|
181
|
+
get: function () {
|
|
182
|
+
return _generateUtilityClasses.default;
|
|
183
|
+
}
|
|
184
|
+
});
|
|
121
185
|
Object.defineProperty(exports, "unstable_getNormalizedScrollLeft", {
|
|
122
186
|
enumerable: true,
|
|
123
187
|
get: function () {
|
|
@@ -279,6 +343,26 @@ var _integerPropType = _interopRequireDefault(require("./integerPropType"));
|
|
|
279
343
|
|
|
280
344
|
var _resolveProps = _interopRequireDefault(require("./resolveProps"));
|
|
281
345
|
|
|
346
|
+
var _composeClasses = _interopRequireDefault(require("./composeClasses"));
|
|
347
|
+
|
|
348
|
+
var _generateUtilityClass = _interopRequireWildcard(require("./generateUtilityClass"));
|
|
349
|
+
|
|
350
|
+
Object.keys(_generateUtilityClass).forEach(function (key) {
|
|
351
|
+
if (key === "default" || key === "__esModule") return;
|
|
352
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
353
|
+
if (key in exports && exports[key] === _generateUtilityClass[key]) return;
|
|
354
|
+
Object.defineProperty(exports, key, {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function () {
|
|
357
|
+
return _generateUtilityClass[key];
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
var _generateUtilityClasses = _interopRequireDefault(require("./generateUtilityClasses"));
|
|
363
|
+
|
|
364
|
+
var _ClassNameGenerator = _interopRequireDefault(require("./ClassNameGenerator"));
|
|
365
|
+
|
|
282
366
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
283
367
|
|
|
284
368
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
package/integerPropType.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export function getTypeByValue(value: any): any;
|
|
2
|
-
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
-
declare namespace _default {
|
|
4
|
-
export { requiredInteger as isRequired };
|
|
5
|
-
}
|
|
6
|
-
export default _default;
|
|
7
|
-
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
|
1
|
+
export function getTypeByValue(value: any): any;
|
|
2
|
+
declare function _default(props: any, propName: any, ...other: any[]): RangeError | null;
|
|
3
|
+
declare namespace _default {
|
|
4
|
+
export { requiredInteger as isRequired };
|
|
5
|
+
}
|
|
6
|
+
export default _default;
|
|
7
|
+
declare function requiredInteger(props: any, propName: any, componentName: any, location: any): RangeError | null;
|
package/isMuiElement.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
|
1
|
+
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var defaultGenerator = function defaultGenerator(componentName) {
|
|
2
|
+
return componentName;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
var createClassNameGenerator = function createClassNameGenerator() {
|
|
6
|
+
var _generate = defaultGenerator;
|
|
7
|
+
return {
|
|
8
|
+
configure: function configure(generator) {
|
|
9
|
+
_generate = generator;
|
|
10
|
+
},
|
|
11
|
+
generate: function generate(componentName) {
|
|
12
|
+
return _generate(componentName);
|
|
13
|
+
},
|
|
14
|
+
reset: function reset() {
|
|
15
|
+
_generate = defaultGenerator;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
var ClassNameGenerator = createClassNameGenerator();
|
|
21
|
+
export default ClassNameGenerator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ClassNameGenerator';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function composeClasses(slots, getUtilityClass, classes) {
|
|
2
|
+
var output = {};
|
|
3
|
+
Object.keys(slots).forEach( // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
4
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
5
|
+
function (slot) {
|
|
6
|
+
output[slot] = slots[slot].reduce(function (acc, key) {
|
|
7
|
+
if (key) {
|
|
8
|
+
if (classes && classes[key]) {
|
|
9
|
+
acc.push(classes[key]);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
acc.push(getUtilityClass(key));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return acc;
|
|
16
|
+
}, []).join(' ');
|
|
17
|
+
});
|
|
18
|
+
return output;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './composeClasses';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
+
var globalStateClassesMapping = {
|
|
3
|
+
active: 'Mui-active',
|
|
4
|
+
checked: 'Mui-checked',
|
|
5
|
+
completed: 'Mui-completed',
|
|
6
|
+
disabled: 'Mui-disabled',
|
|
7
|
+
error: 'Mui-error',
|
|
8
|
+
expanded: 'Mui-expanded',
|
|
9
|
+
focused: 'Mui-focused',
|
|
10
|
+
focusVisible: 'Mui-focusVisible',
|
|
11
|
+
required: 'Mui-required',
|
|
12
|
+
selected: 'Mui-selected'
|
|
13
|
+
};
|
|
14
|
+
export default function generateUtilityClass(componentName, slot) {
|
|
15
|
+
var globalStateClass = globalStateClassesMapping[slot];
|
|
16
|
+
return globalStateClass || "".concat(ClassNameGenerator.generate(componentName), "-").concat(slot);
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
2
|
+
export default function generateUtilityClasses(componentName, slots) {
|
|
3
|
+
var result = {};
|
|
4
|
+
slots.forEach(function (slot) {
|
|
5
|
+
result[slot] = generateUtilityClass(componentName, slot);
|
|
6
|
+
});
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './generateUtilityClasses';
|
package/legacy/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.8.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -35,4 +35,9 @@ export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft
|
|
|
35
35
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
36
36
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
37
37
|
export { default as integerPropType } from './integerPropType';
|
|
38
|
-
export { default as internal_resolveProps } from './resolveProps';
|
|
38
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
39
|
+
export { default as unstable_composeClasses } from './composeClasses';
|
|
40
|
+
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
41
|
+
export * from './generateUtilityClass';
|
|
42
|
+
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
43
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const defaultGenerator = componentName => componentName;
|
|
2
|
+
|
|
3
|
+
const createClassNameGenerator = () => {
|
|
4
|
+
let generate = defaultGenerator;
|
|
5
|
+
return {
|
|
6
|
+
configure(generator) {
|
|
7
|
+
generate = generator;
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
generate(componentName) {
|
|
11
|
+
return generate(componentName);
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
reset() {
|
|
15
|
+
generate = defaultGenerator;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ClassNameGenerator = createClassNameGenerator();
|
|
22
|
+
export default ClassNameGenerator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ClassNameGenerator';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default function composeClasses(slots, getUtilityClass, classes) {
|
|
2
|
+
const output = {};
|
|
3
|
+
Object.keys(slots).forEach( // `Objet.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
|
4
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
5
|
+
slot => {
|
|
6
|
+
output[slot] = slots[slot].reduce((acc, key) => {
|
|
7
|
+
if (key) {
|
|
8
|
+
if (classes && classes[key]) {
|
|
9
|
+
acc.push(classes[key]);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
acc.push(getUtilityClass(key));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return acc;
|
|
16
|
+
}, []).join(' ');
|
|
17
|
+
});
|
|
18
|
+
return output;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './composeClasses';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ClassNameGenerator from '../ClassNameGenerator';
|
|
2
|
+
const globalStateClassesMapping = {
|
|
3
|
+
active: 'Mui-active',
|
|
4
|
+
checked: 'Mui-checked',
|
|
5
|
+
completed: 'Mui-completed',
|
|
6
|
+
disabled: 'Mui-disabled',
|
|
7
|
+
error: 'Mui-error',
|
|
8
|
+
expanded: 'Mui-expanded',
|
|
9
|
+
focused: 'Mui-focused',
|
|
10
|
+
focusVisible: 'Mui-focusVisible',
|
|
11
|
+
required: 'Mui-required',
|
|
12
|
+
selected: 'Mui-selected'
|
|
13
|
+
};
|
|
14
|
+
export default function generateUtilityClass(componentName, slot) {
|
|
15
|
+
const globalStateClass = globalStateClassesMapping[slot];
|
|
16
|
+
return globalStateClass || `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateUtilityClass from '../generateUtilityClass';
|
|
2
|
+
export default function generateUtilityClasses(componentName, slots) {
|
|
3
|
+
const result = {};
|
|
4
|
+
slots.forEach(slot => {
|
|
5
|
+
result[slot] = generateUtilityClass(componentName, slot);
|
|
6
|
+
});
|
|
7
|
+
return result;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './generateUtilityClasses';
|
package/modern/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license MUI v5.
|
|
1
|
+
/** @license MUI v5.8.0
|
|
2
2
|
*
|
|
3
3
|
* This source code is licensed under the MIT license found in the
|
|
4
4
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -35,4 +35,9 @@ export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft
|
|
|
35
35
|
export { default as usePreviousProps } from './usePreviousProps';
|
|
36
36
|
export { default as visuallyHidden } from './visuallyHidden';
|
|
37
37
|
export { default as integerPropType } from './integerPropType';
|
|
38
|
-
export { default as internal_resolveProps } from './resolveProps';
|
|
38
|
+
export { default as internal_resolveProps } from './resolveProps';
|
|
39
|
+
export { default as unstable_composeClasses } from './composeClasses';
|
|
40
|
+
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
|
41
|
+
export * from './generateUtilityClass';
|
|
42
|
+
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
|
43
|
+
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
package/ownerDocument.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerDocument(node: Node | null | undefined): Document;
|
|
1
|
+
export default function ownerDocument(node: Node | null | undefined): Document;
|
package/ownerWindow.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function ownerWindow(node: Node | undefined): Window;
|
|
1
|
+
export default function ownerWindow(node: Node | undefined): Window;
|
package/package.json
CHANGED
package/ponyfillGlobal.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: any;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: any;
|
|
2
|
+
export default _default;
|
package/refType.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
-
export default refType;
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const refType: PropTypes.Requireable<object>;
|
|
3
|
+
export default refType;
|
package/resolveProps.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3
|
-
* @param {object} defaultProps
|
|
4
|
-
* @param {object} props
|
|
5
|
-
* @returns {object} resolved props
|
|
6
|
-
*/
|
|
7
|
-
export default function resolveProps<T extends {
|
|
8
|
-
className?: string;
|
|
9
|
-
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|
|
1
|
+
/**
|
|
2
|
+
* Add keys, values of `defaultProps` that does not exist in `props`
|
|
3
|
+
* @param {object} defaultProps
|
|
4
|
+
* @param {object} props
|
|
5
|
+
* @returns {object} resolved props
|
|
6
|
+
*/
|
|
7
|
+
export default function resolveProps<T extends {
|
|
8
|
+
className?: string;
|
|
9
|
+
} & Record<string, unknown>>(defaultProps: T, props: T): T;
|
package/setRef.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* TODO v5: consider making it private
|
|
4
|
-
*
|
|
5
|
-
* passes {value} to {ref}
|
|
6
|
-
*
|
|
7
|
-
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
-
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
-
* https://github.com/mui/material-ui/issues/13539
|
|
10
|
-
*
|
|
11
|
-
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
-
* while still using it inside the component.
|
|
13
|
-
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
-
*/
|
|
15
|
-
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* TODO v5: consider making it private
|
|
4
|
+
*
|
|
5
|
+
* passes {value} to {ref}
|
|
6
|
+
*
|
|
7
|
+
* WARNING: Be sure to only call this inside a callback that is passed as a ref.
|
|
8
|
+
* Otherwise, make sure to cleanup the previous {ref} if it changes. See
|
|
9
|
+
* https://github.com/mui/material-ui/issues/13539
|
|
10
|
+
*
|
|
11
|
+
* Useful if you want to expose the ref of an inner component to the public API
|
|
12
|
+
* while still using it inside the component.
|
|
13
|
+
* @param ref A ref callback or ref object. If anything falsy, this is a no-op.
|
|
14
|
+
*/
|
|
15
|
+
export default function setRef<T>(ref: React.MutableRefObject<T | null> | ((instance: T | null) => void) | null | undefined, value: T | null): void;
|
package/useEventCallback.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
-
*/
|
|
4
|
-
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/facebook/react/issues/14099#issuecomment-440013892
|
|
3
|
+
*/
|
|
4
|
+
export default function useEventCallback<Args extends unknown[], Return>(fn: (...args: Args) => Return): (...args: Args) => Return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/useForkRef.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export default function useForkRef<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function useForkRef<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null;
|
package/useId.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @example <div id={useId()} />
|
|
4
|
-
* @param idOverride
|
|
5
|
-
* @returns {string}
|
|
6
|
-
*/
|
|
7
|
-
export default function useId(idOverride?: string): string | undefined;
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @example <div id={useId()} />
|
|
4
|
+
* @param idOverride
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export default function useId(idOverride?: string): string | undefined;
|
package/useIsFocusVisible.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare function teardown(doc: Document): void;
|
|
3
|
-
export interface UseIsFocusVisibleResult {
|
|
4
|
-
isFocusVisibleRef: React.MutableRefObject<boolean>;
|
|
5
|
-
onBlur: (event: React.FocusEvent<any>) => void;
|
|
6
|
-
onFocus: (event: React.FocusEvent<any>) => void;
|
|
7
|
-
ref: React.Ref<unknown>;
|
|
8
|
-
}
|
|
9
|
-
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function teardown(doc: Document): void;
|
|
3
|
+
export interface UseIsFocusVisibleResult {
|
|
4
|
+
isFocusVisibleRef: React.MutableRefObject<boolean>;
|
|
5
|
+
onBlur: (event: React.FocusEvent<any>) => void;
|
|
6
|
+
onFocus: (event: React.FocusEvent<any>) => void;
|
|
7
|
+
ref: React.Ref<unknown>;
|
|
8
|
+
}
|
|
9
|
+
export default function useIsFocusVisible(): UseIsFocusVisibleResult;
|
package/usePreviousProps.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const usePreviousProps: (value: object) => object;
|
|
2
|
-
export default usePreviousProps;
|
|
1
|
+
declare const usePreviousProps: (value: object) => object;
|
|
2
|
+
export default usePreviousProps;
|
package/visuallyHidden.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
-
export default visuallyHidden;
|
|
1
|
+
declare const visuallyHidden: import('react').CSSProperties;
|
|
2
|
+
export default visuallyHidden;
|