This commit is contained in:
root
2025-11-25 09:56:15 +03:00
commit 68c8f0e80d
23717 changed files with 3200521 additions and 0 deletions

21
mc_test/node_modules/@emotion/styled/LICENSE generated vendored Executable file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) Emotion team and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

31
mc_test/node_modules/@emotion/styled/README.md generated vendored Executable file
View File

@ -0,0 +1,31 @@
# @emotion/styled
> The styled API for @emotion/react
## Install
```bash
yarn add @emotion/react @emotion/styled
```
## Usage
```jsx
import styled from '@emotion/styled'
let SomeComp = styled.div({
color: 'hotpink'
})
let AnotherComp = styled.div`
color: ${props => props.color};
`
render(
<SomeComp>
<AnotherComp color="green" />
</SomeComp>
)
```
More documentation is available at [https://emotion.sh/docs/styled](https://emotion.sh/docs/styled).

View File

@ -0,0 +1,177 @@
import _extends from '@babel/runtime/helpers/esm/extends';
import * as React from 'react';
import isPropValid from '@emotion/is-prop-valid';
import { withEmotionCache, ThemeContext } from '@emotion/react';
import { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';
import { serializeStyles } from '@emotion/serialize';
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
return null;
};
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React.useContext(ThemeContext);
}
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
export { createStyled as default };

View File

@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/base.js";
export { _default as default } from "./emotion-styled-base.cjs.default.js";
//# sourceMappingURL=emotion-styled-base.cjs.d.mts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"emotion-styled-base.cjs.d.mts","sourceRoot":"","sources":["../../dist/declarations/src/base.d.ts"],"names":[],"mappings":"AAAA"}

View File

@ -0,0 +1,3 @@
export * from "../../dist/declarations/src/base";
export { default } from "../../dist/declarations/src/base";
//# sourceMappingURL=emotion-styled-base.cjs.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"emotion-styled-base.cjs.d.ts","sourceRoot":"","sources":["../../dist/declarations/src/base.d.ts"],"names":[],"mappings":"AAAA"}

View File

@ -0,0 +1 @@
export { default as _default } from "../../dist/declarations/src/base.js"

View File

@ -0,0 +1 @@
exports._default = require("./emotion-styled-base.cjs.js").default;

View File

@ -0,0 +1,221 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _extends = require('@babel/runtime/helpers/extends');
var React = require('react');
var isPropValid = require('@emotion/is-prop-valid');
var react = require('@emotion/react');
var utils = require('@emotion/utils');
var serialize = require('@emotion/serialize');
var useInsertionEffectWithFallbacks = require('@emotion/use-insertion-effect-with-fallbacks');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
var isPropValid__default = /*#__PURE__*/_interopDefault(isPropValid);
var testOmitPropsOnStringTag = isPropValid__default["default"];
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var isBrowser = typeof document !== 'undefined';
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
utils.registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function () {
return utils.insertStyles(cache, serialized, isStringTag);
});
if (!isBrowser && rules !== undefined) {
var _ref2;
var serializedNames = serialized.name;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
next = next.next;
}
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = react.withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React__namespace.useContext(react.ThemeContext);
}
if (typeof props.className === 'string') {
className = utils.getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serialize.serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React__namespace.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
exports["default"] = createStyled;

View File

@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./emotion-styled-base.cjs.prod.js");
} else {
module.exports = require("./emotion-styled-base.cjs.dev.js");
}

View File

@ -0,0 +1,3 @@
// @flow
export * from "../../src/base.js";
export { default } from "../../src/base.js";

View File

@ -0,0 +1,4 @@
export {
} from "./emotion-styled-base.cjs.js";
export { _default as default } from "./emotion-styled-base.cjs.default.js";

View File

@ -0,0 +1,209 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var _extends = require('@babel/runtime/helpers/extends');
var React = require('react');
var isPropValid = require('@emotion/is-prop-valid');
var react = require('@emotion/react');
var utils = require('@emotion/utils');
var serialize = require('@emotion/serialize');
var useInsertionEffectWithFallbacks = require('@emotion/use-insertion-effect-with-fallbacks');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
var isPropValid__default = /*#__PURE__*/_interopDefault(isPropValid);
var testOmitPropsOnStringTag = isPropValid__default["default"];
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var isBrowser = typeof document !== 'undefined';
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
utils.registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function () {
return utils.insertStyles(cache, serialized, isStringTag);
});
if (!isBrowser && rules !== undefined) {
var _ref2;
var serializedNames = serialized.name;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
next = next.next;
}
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var createStyled = function createStyled(tag, options) {
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = react.withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React__namespace.useContext(react.ThemeContext);
}
if (typeof props.className === 'string') {
className = utils.getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serialize.serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React__namespace.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && "production" !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
exports["default"] = createStyled;

View File

@ -0,0 +1,194 @@
import _extends from '@babel/runtime/helpers/esm/extends';
import * as React from 'react';
import isPropValid from '@emotion/is-prop-valid';
import { withEmotionCache, ThemeContext } from '@emotion/react';
import { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';
import { serializeStyles } from '@emotion/serialize';
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var isBrowser = typeof document !== 'undefined';
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
if (!isBrowser && rules !== undefined) {
var _ref2;
var serializedNames = serialized.name;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
next = next.next;
}
return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React.useContext(ThemeContext);
}
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
export { createStyled as default };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,193 @@
import _extends from '@babel/runtime/helpers/esm/extends';
import * as React from 'react';
import isPropValid from '@emotion/is-prop-valid';
import { withEmotionCache, ThemeContext } from '@emotion/react';
import { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';
import { serializeStyles } from '@emotion/serialize';
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';
var testOmitPropsOnStringTag = isPropValid;
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
return key !== 'theme';
};
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
return typeof tag === 'string' && // 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
};
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
var shouldForwardProp;
if (options) {
var optionsShouldForwardProp = options.shouldForwardProp;
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
} : optionsShouldForwardProp;
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp;
}
return shouldForwardProp;
};
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serialized = _ref.serialized,
isStringTag = _ref.isStringTag;
registerStyles(cache, serialized, isStringTag);
var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
return insertStyles(cache, serialized, isStringTag);
});
if (rules !== undefined) {
var _ref2;
var serializedNames = serialized.name;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
next = next.next;
}
return /*#__PURE__*/React.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var createStyled = function createStyled(tag, options) {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
}
}
var isReal = tag.__emotion_real === tag;
var baseTag = isReal && tag.__emotion_base || tag;
var identifierName;
var targetClassName;
if (options !== undefined) {
identifierName = options.label;
targetClassName = options.target;
}
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
var shouldUseAs = !defaultShouldForwardProp('as');
return function () {
var args = arguments;
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
if (identifierName !== undefined) {
styles.push("label:" + identifierName + ";");
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args);
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[0][0]);
var len = args.length;
var i = 1;
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
}
styles.push(args[i], args[0][i]);
}
} // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
var Styled = withEmotionCache(function (props, cache, ref) {
var FinalTag = shouldUseAs && props.as || baseTag;
var className = '';
var classInterpolations = [];
var mergedProps = props;
if (props.theme == null) {
mergedProps = {};
for (var key in props) {
mergedProps[key] = props[key];
}
mergedProps.theme = React.useContext(ThemeContext);
}
if (typeof props.className === 'string') {
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
} else if (props.className != null) {
className = props.className + " ";
}
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
className += cache.key + "-" + serialized.name;
if (targetClassName !== undefined) {
className += " " + targetClassName;
}
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
var newProps = {};
for (var _key in props) {
if (shouldUseAs && _key === 'as') continue;
if ( // $FlowFixMe
finalShouldForwardProp(_key)) {
newProps[_key] = props[_key];
}
}
newProps.className = className;
newProps.ref = ref;
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
cache: cache,
serialized: serialized,
isStringTag: typeof FinalTag === 'string'
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
});
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
Styled.defaultProps = tag.defaultProps;
Styled.__emotion_real = Styled;
Styled.__emotion_base = baseTag;
Styled.__emotion_styles = styles;
Styled.__emotion_forwardProp = shouldForwardProp;
Object.defineProperty(Styled, 'toString', {
value: function value() {
if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
return 'NO_COMPONENT_SELECTOR';
} // $FlowFixMe: coerce undefined to string
return "." + targetClassName;
}
});
Styled.withComponent = function (nextTag, nextOptions) {
return createStyled(nextTag, _extends({}, options, nextOptions, {
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})).apply(void 0, styles);
};
return Styled;
};
};
export { createStyled as default };

12
mc_test/node_modules/@emotion/styled/base/package.json generated vendored Executable file
View File

@ -0,0 +1,12 @@
{
"main": "dist/emotion-styled-base.cjs.js",
"module": "dist/emotion-styled-base.esm.js",
"umd:main": "dist/emotion-styled-base.umd.min.js",
"browser": {
"./dist/emotion-styled-base.esm.js": "./dist/emotion-styled-base.browser.esm.js"
},
"types": "../types/base",
"preconstruct": {
"umdName": "emotionStyledBase"
}
}

View File

@ -0,0 +1,2 @@
export * from '../types/base'
export { default } from '../types/base'

View File

@ -0,0 +1,2 @@
export * from '../types'
export { default } from '../types'

View File

@ -0,0 +1,193 @@
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 3.2
import * as React from 'react'
import { ComponentSelector, Interpolation } from '@emotion/serialize'
import { PropsOf, Theme } from '@emotion/react'
export {
ArrayInterpolation,
CSSObject,
FunctionInterpolation
} from '@emotion/serialize'
export { ComponentSelector, Interpolation }
/** Same as StyledOptions but shouldForwardProp must be a type guard */
export interface FilteringStyledOptions<
Props = Record<string, any>,
ForwardedProps extends keyof Props & string = keyof Props & string
> {
label?: string
shouldForwardProp?: (propName: string) => propName is ForwardedProps
target?: string
}
export interface StyledOptions<Props = Record<string, any>> {
label?: string
shouldForwardProp?: (propName: string) => boolean
target?: string
}
/**
* @typeparam ComponentProps Props which will be included when withComponent is called
* @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
*/
export interface StyledComponent<
ComponentProps extends {},
SpecificComponentProps extends {} = {},
JSXProps extends {} = {}
> extends React.FC<ComponentProps & SpecificComponentProps & JSXProps>,
ComponentSelector {
withComponent<C extends React.ComponentClass<React.ComponentProps<C>>>(
component: C
): StyledComponent<
ComponentProps & PropsOf<C>,
{},
{ ref?: React.Ref<InstanceType<C>> }
>
withComponent<C extends React.ComponentType<React.ComponentProps<C>>>(
component: C
): StyledComponent<ComponentProps & PropsOf<C>>
withComponent<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag
): StyledComponent<ComponentProps, JSX.IntrinsicElements[Tag]>
}
/**
* @typeparam ComponentProps Props which will be included when withComponent is called
* @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
*/
export interface CreateStyledComponent<
ComponentProps extends {},
SpecificComponentProps extends {} = {},
JSXProps extends {} = {}
> {
/**
* @typeparam AdditionalProps Additional props to add to your styled component
*/
<AdditionalProps extends {} = {}>(
...styles: Array<
Interpolation<
ComponentProps &
SpecificComponentProps &
AdditionalProps & { theme: Theme }
>
>
): StyledComponent<
ComponentProps & AdditionalProps,
SpecificComponentProps,
JSXProps
>
(
template: TemplateStringsArray,
...styles: Array<
Interpolation<ComponentProps & SpecificComponentProps & { theme: Theme }>
>
): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>
/**
* @typeparam AdditionalProps Additional props to add to your styled component
*/
<AdditionalProps extends {}>(
template: TemplateStringsArray,
...styles: Array<
Interpolation<
ComponentProps &
SpecificComponentProps &
AdditionalProps & { theme: Theme }
>
>
): StyledComponent<
ComponentProps & AdditionalProps,
SpecificComponentProps,
JSXProps
>
}
/**
* @desc
* This function accepts a React component or tag ('div', 'a' etc).
*
* @example styled(MyComponent)({ width: 100 })
* @example styled(MyComponent)(myComponentProps => ({ width: myComponentProps.width })
* @example styled('div')({ width: 100 })
* @example styled('div')<Props>(props => ({ width: props.width })
*/
export interface CreateStyled {
<
C extends React.ComponentClass<React.ComponentProps<C>>,
ForwardedProps extends keyof React.ComponentProps<C> &
string = keyof React.ComponentProps<C> & string
>(
component: C,
options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>
): CreateStyledComponent<
Pick<PropsOf<C>, ForwardedProps> & {
theme?: Theme
},
{},
{
ref?: React.Ref<InstanceType<C>>
}
>
<C extends React.ComponentClass<React.ComponentProps<C>>>(
component: C,
options?: StyledOptions<React.ComponentProps<C>>
): CreateStyledComponent<
PropsOf<C> & {
theme?: Theme
},
{},
{
ref?: React.Ref<InstanceType<C>>
}
>
<
C extends React.ComponentType<React.ComponentProps<C>>,
ForwardedProps extends keyof React.ComponentProps<C> &
string = keyof React.ComponentProps<C> & string
>(
component: C,
options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>
): CreateStyledComponent<
Pick<PropsOf<C>, ForwardedProps> & {
theme?: Theme
}
>
<C extends React.ComponentType<React.ComponentProps<C>>>(
component: C,
options?: StyledOptions<React.ComponentProps<C>>
): CreateStyledComponent<
PropsOf<C> & {
theme?: Theme
}
>
<
Tag extends keyof JSX.IntrinsicElements,
ForwardedProps extends keyof JSX.IntrinsicElements[Tag] &
string = keyof JSX.IntrinsicElements[Tag] & string
>(
tag: Tag,
options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps>
): CreateStyledComponent<
{ theme?: Theme; as?: React.ElementType },
Pick<JSX.IntrinsicElements[Tag], ForwardedProps>
>
<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag,
options?: StyledOptions<JSX.IntrinsicElements[Tag]>
): CreateStyledComponent<
{ theme?: Theme; as?: React.ElementType },
JSX.IntrinsicElements[Tag]
>
}
declare const styled: CreateStyled
export default styled

View File

@ -0,0 +1,32 @@
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 3.2
import { Theme } from '@emotion/react'
import { CreateStyled as BaseCreateStyled, CreateStyledComponent } from './base'
export {
ArrayInterpolation,
ComponentSelector,
CSSObject,
FunctionInterpolation,
Interpolation,
StyledComponent,
StyledOptions,
FilteringStyledOptions,
CreateStyledComponent
} from './base'
export type StyledTags = {
[Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<
{
theme?: Theme
as?: React.ElementType
},
JSX.IntrinsicElements[Tag]
>
}
export interface CreateStyled extends BaseCreateStyled, StyledTags {}
declare const styled: CreateStyled
export default styled

View File

@ -0,0 +1,19 @@
import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';
import '@babel/runtime/helpers/extends';
import 'react';
import '@emotion/is-prop-valid';
import '@emotion/react';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = createStyled.bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
export { newStyled as default };

View File

@ -0,0 +1,3 @@
export * from "./declarations/src/index.js";
export { _default as default } from "./emotion-styled.cjs.default.js";
//# sourceMappingURL=emotion-styled.cjs.d.mts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"emotion-styled.cjs.d.mts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}

View File

@ -0,0 +1,3 @@
export * from "./declarations/src/index";
export { default } from "./declarations/src/index";
//# sourceMappingURL=emotion-styled.cjs.d.ts.map

View File

@ -0,0 +1 @@
{"version":3,"file":"emotion-styled.cjs.d.ts","sourceRoot":"","sources":["./declarations/src/index.d.ts"],"names":[],"mappings":"AAAA"}

View File

@ -0,0 +1 @@
export { default as _default } from "./declarations/src/index.js"

View File

@ -0,0 +1 @@
exports._default = require("./emotion-styled.cjs.js").default;

View File

@ -0,0 +1,23 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var base_dist_emotionStyledBase = require('../base/dist/emotion-styled-base.cjs.dev.js');
require('@babel/runtime/helpers/extends');
require('react');
require('@emotion/is-prop-valid');
require('@emotion/react');
require('@emotion/utils');
require('@emotion/serialize');
require('@emotion/use-insertion-effect-with-fallbacks');
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = base_dist_emotionStyledBase["default"].bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
exports["default"] = newStyled;

View File

@ -0,0 +1,7 @@
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./emotion-styled.cjs.prod.js");
} else {
module.exports = require("./emotion-styled.cjs.dev.js");
}

View File

@ -0,0 +1,3 @@
// @flow
export * from "../src/index.js";
export { default } from "../src/index.js";

View File

@ -0,0 +1,4 @@
export {
} from "./emotion-styled.cjs.js";
export { _default as default } from "./emotion-styled.cjs.default.js";

View File

@ -0,0 +1,23 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var base_dist_emotionStyledBase = require('../base/dist/emotion-styled-base.cjs.prod.js');
require('@babel/runtime/helpers/extends');
require('react');
require('@emotion/is-prop-valid');
require('@emotion/react');
require('@emotion/utils');
require('@emotion/serialize');
require('@emotion/use-insertion-effect-with-fallbacks');
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = base_dist_emotionStyledBase["default"].bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
exports["default"] = newStyled;

View File

@ -0,0 +1,19 @@
import createStyled from '../base/dist/emotion-styled-base.esm.js';
import '@babel/runtime/helpers/extends';
import 'react';
import '@emotion/is-prop-valid';
import '@emotion/react';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = createStyled.bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
export { newStyled as default };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
import createStyled from '../base/dist/emotion-styled-base.worker.esm.js';
import '@babel/runtime/helpers/extends';
import 'react';
import '@emotion/is-prop-valid';
import '@emotion/react';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
var newStyled = createStyled.bind();
tags.forEach(function (tagName) {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName);
});
export { newStyled as default };

3
mc_test/node_modules/@emotion/styled/macro.d.mts generated vendored Executable file
View File

@ -0,0 +1,3 @@
import styled from '@emotion/styled'
export * from '@emotion/styled'
export default styled

3
mc_test/node_modules/@emotion/styled/macro.d.ts generated vendored Executable file
View File

@ -0,0 +1,3 @@
import styled from '@emotion/styled'
export * from '@emotion/styled'
export default styled

1
mc_test/node_modules/@emotion/styled/macro.js generated vendored Executable file
View File

@ -0,0 +1 @@
module.exports = require('@emotion/babel-plugin').macros.webStyled

3
mc_test/node_modules/@emotion/styled/macro.js.flow generated vendored Executable file
View File

@ -0,0 +1,3 @@
// @flow
export * from './src/index.js'
export { default } from './src/index.js'

100
mc_test/node_modules/@emotion/styled/package.json generated vendored Executable file
View File

@ -0,0 +1,100 @@
{
"name": "@emotion/styled",
"version": "11.11.0",
"description": "styled API for emotion",
"main": "dist/emotion-styled.cjs.js",
"module": "dist/emotion-styled.esm.js",
"types": "types/index.d.ts",
"license": "MIT",
"repository": "https://github.com/emotion-js/emotion/tree/main/packages/styled",
"scripts": {
"test:typescript": "dtslint types"
},
"dependencies": {
"@babel/runtime": "^7.18.3",
"@emotion/babel-plugin": "^11.11.0",
"@emotion/is-prop-valid": "^1.2.1",
"@emotion/serialize": "^1.1.2",
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
"@emotion/utils": "^1.2.1"
},
"peerDependencies": {
"@emotion/react": "^11.0.0-rc.0",
"react": ">=16.8.0"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"devDependencies": {
"@definitelytyped/dtslint": "0.0.112",
"@emotion/react": "11.11.0",
"react": "16.14.0",
"typescript": "^4.5.5"
},
"publishConfig": {
"access": "public"
},
"files": [
"src",
"dist",
"base",
"types/*.d.ts",
"macro.*"
],
"umd:main": "dist/emotion-styled.umd.min.js",
"browser": {
"./dist/emotion-styled.esm.js": "./dist/emotion-styled.browser.esm.js"
},
"exports": {
"./base": {
"module": {
"worker": "./base/dist/emotion-styled-base.worker.esm.js",
"browser": "./base/dist/emotion-styled-base.browser.esm.js",
"default": "./base/dist/emotion-styled-base.esm.js"
},
"import": "./base/dist/emotion-styled-base.cjs.mjs",
"default": "./base/dist/emotion-styled-base.cjs.js"
},
".": {
"module": {
"worker": "./dist/emotion-styled.worker.esm.js",
"browser": "./dist/emotion-styled.browser.esm.js",
"default": "./dist/emotion-styled.esm.js"
},
"import": "./dist/emotion-styled.cjs.mjs",
"default": "./dist/emotion-styled.cjs.js"
},
"./package.json": "./package.json",
"./macro": {
"types": {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
},
"preconstruct": {
"umdName": "emotionStyled",
"entrypoints": [
"./index.js",
"./base.js"
],
"exports": {
"envConditions": [
"browser",
"worker"
],
"extra": {
"./macro": {
"types": {
"import": "./macro.d.mts",
"default": "./macro.d.ts"
},
"default": "./macro.js"
}
}
}
}
}

2
mc_test/node_modules/@emotion/styled/src/base.d.ts generated vendored Executable file
View File

@ -0,0 +1,2 @@
export * from '../types/base'
export { default } from '../types/base'

218
mc_test/node_modules/@emotion/styled/src/base.js generated vendored Executable file
View File

@ -0,0 +1,218 @@
// @flow
import * as React from 'react'
import {
getDefaultShouldForwardProp,
composeShouldForwardProps,
type StyledOptions,
type CreateStyled,
type PrivateStyledComponent,
type StyledElementType
} from './utils'
import { withEmotionCache, ThemeContext } from '@emotion/react'
import {
getRegisteredStyles,
insertStyles,
registerStyles
} from '@emotion/utils'
import { serializeStyles } from '@emotion/serialize'
import { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks'
const ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
You can read more about this here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`
let isBrowser = typeof document !== 'undefined'
const Insertion = ({ cache, serialized, isStringTag }) => {
registerStyles(cache, serialized, isStringTag)
const rules = useInsertionEffectAlwaysWithSyncFallback(() =>
insertStyles(cache, serialized, isStringTag)
)
if (!isBrowser && rules !== undefined) {
let serializedNames = serialized.name
let next = serialized.next
while (next !== undefined) {
serializedNames += ' ' + next.name
next = next.next
}
return (
<style
{...{
[`data-emotion`]: `${cache.key} ${serializedNames}`,
dangerouslySetInnerHTML: { __html: rules },
nonce: cache.sheet.nonce
}}
/>
)
}
return null
}
let createStyled: CreateStyled = (tag: any, options?: StyledOptions) => {
if (process.env.NODE_ENV !== 'production') {
if (tag === undefined) {
throw new Error(
'You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.'
)
}
}
const isReal = tag.__emotion_real === tag
const baseTag = (isReal && tag.__emotion_base) || tag
let identifierName
let targetClassName
if (options !== undefined) {
identifierName = options.label
targetClassName = options.target
}
const shouldForwardProp = composeShouldForwardProps(tag, options, isReal)
const defaultShouldForwardProp =
shouldForwardProp || getDefaultShouldForwardProp(baseTag)
const shouldUseAs = !defaultShouldForwardProp('as')
return function <Props>(): PrivateStyledComponent<Props> {
let args = arguments
let styles =
isReal && tag.__emotion_styles !== undefined
? tag.__emotion_styles.slice(0)
: []
if (identifierName !== undefined) {
styles.push(`label:${identifierName};`)
}
if (args[0] == null || args[0].raw === undefined) {
styles.push.apply(styles, args)
} else {
if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR)
}
styles.push(args[0][0])
let len = args.length
let i = 1
for (; i < len; i++) {
if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR)
}
styles.push(args[i], args[0][i])
}
}
// $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
const Styled: PrivateStyledComponent<Props> = withEmotionCache(
(props, cache, ref) => {
const FinalTag = (shouldUseAs && props.as) || baseTag
let className = ''
let classInterpolations = []
let mergedProps = props
if (props.theme == null) {
mergedProps = {}
for (let key in props) {
mergedProps[key] = props[key]
}
mergedProps.theme = React.useContext(ThemeContext)
}
if (typeof props.className === 'string') {
className = getRegisteredStyles(
cache.registered,
classInterpolations,
props.className
)
} else if (props.className != null) {
className = `${props.className} `
}
const serialized = serializeStyles(
styles.concat(classInterpolations),
cache.registered,
mergedProps
)
className += `${cache.key}-${serialized.name}`
if (targetClassName !== undefined) {
className += ` ${targetClassName}`
}
const finalShouldForwardProp =
shouldUseAs && shouldForwardProp === undefined
? getDefaultShouldForwardProp(FinalTag)
: defaultShouldForwardProp
let newProps = {}
for (let key in props) {
if (shouldUseAs && key === 'as') continue
if (
// $FlowFixMe
finalShouldForwardProp(key)
) {
newProps[key] = props[key]
}
}
newProps.className = className
newProps.ref = ref
return (
<>
<Insertion
cache={cache}
serialized={serialized}
isStringTag={typeof FinalTag === 'string'}
/>
<FinalTag {...newProps} />
</>
)
}
)
Styled.displayName =
identifierName !== undefined
? identifierName
: `Styled(${
typeof baseTag === 'string'
? baseTag
: baseTag.displayName || baseTag.name || 'Component'
})`
Styled.defaultProps = tag.defaultProps
Styled.__emotion_real = Styled
Styled.__emotion_base = baseTag
Styled.__emotion_styles = styles
Styled.__emotion_forwardProp = shouldForwardProp
Object.defineProperty(Styled, 'toString', {
value() {
if (
targetClassName === undefined &&
process.env.NODE_ENV !== 'production'
) {
return 'NO_COMPONENT_SELECTOR'
}
// $FlowFixMe: coerce undefined to string
return `.${targetClassName}`
}
})
Styled.withComponent = (
nextTag: StyledElementType<Props>,
nextOptions?: StyledOptions
) => {
return createStyled(nextTag, {
...options,
// $FlowFixMe
...nextOptions,
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
})(...styles)
}
return Styled
}
}
export default createStyled

2
mc_test/node_modules/@emotion/styled/src/index.d.ts generated vendored Executable file
View File

@ -0,0 +1,2 @@
export * from '../types'
export { default } from '../types'

13
mc_test/node_modules/@emotion/styled/src/index.js generated vendored Executable file
View File

@ -0,0 +1,13 @@
// @flow
import styled from './base'
import { tags } from './tags'
// bind it to avoid mutating the original function
const newStyled = styled.bind()
tags.forEach(tagName => {
// $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
newStyled[tagName] = newStyled(tagName)
})
export default newStyled

139
mc_test/node_modules/@emotion/styled/src/tags.js generated vendored Executable file
View File

@ -0,0 +1,139 @@
// @flow
export const tags = [
'a',
'abbr',
'address',
'area',
'article',
'aside',
'audio',
'b',
'base',
'bdi',
'bdo',
'big',
'blockquote',
'body',
'br',
'button',
'canvas',
'caption',
'cite',
'code',
'col',
'colgroup',
'data',
'datalist',
'dd',
'del',
'details',
'dfn',
'dialog',
'div',
'dl',
'dt',
'em',
'embed',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'head',
'header',
'hgroup',
'hr',
'html',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'keygen',
'label',
'legend',
'li',
'link',
'main',
'map',
'mark',
'marquee',
'menu',
'menuitem',
'meta',
'meter',
'nav',
'noscript',
'object',
'ol',
'optgroup',
'option',
'output',
'p',
'param',
'picture',
'pre',
'progress',
'q',
'rp',
'rt',
'ruby',
's',
'samp',
'script',
'section',
'select',
'small',
'source',
'span',
'strong',
'style',
'sub',
'summary',
'sup',
'table',
'tbody',
'td',
'textarea',
'tfoot',
'th',
'thead',
'time',
'title',
'tr',
'track',
'u',
'ul',
'var',
'video',
'wbr',
// SVG
'circle',
'clipPath',
'defs',
'ellipse',
'foreignObject',
'g',
'image',
'line',
'linearGradient',
'mask',
'path',
'pattern',
'polygon',
'polyline',
'radialGradient',
'rect',
'stop',
'svg',
'text',
'tspan'
]

83
mc_test/node_modules/@emotion/styled/src/utils.js generated vendored Executable file
View File

@ -0,0 +1,83 @@
// @flow
import type {
ElementType,
StatelessFunctionalComponent,
AbstractComponent
} from 'react'
import isPropValid from '@emotion/is-prop-valid'
export type Interpolations = Array<any>
export type StyledElementType<Props> =
| string
| AbstractComponent<{ ...Props, className: string }, mixed>
export type StyledOptions = {
label?: string,
shouldForwardProp?: string => boolean,
target?: string
}
export type StyledComponent<Props> = StatelessFunctionalComponent<Props> & {
defaultProps: any,
toString: () => string,
withComponent: (
nextTag: StyledElementType<Props>,
nextOptions?: StyledOptions
) => StyledComponent<Props>
}
export type PrivateStyledComponent<Props> = StyledComponent<Props> & {
__emotion_real: StyledComponent<Props>,
__emotion_base: any,
__emotion_styles: any,
__emotion_forwardProp: any
}
const testOmitPropsOnStringTag = isPropValid
const testOmitPropsOnComponent = (key: string) => key !== 'theme'
export const getDefaultShouldForwardProp = (tag: ElementType) =>
typeof tag === 'string' &&
// 96 is one less than the char code
// for "a" so this is checking that
// it's a lowercase character
tag.charCodeAt(0) > 96
? testOmitPropsOnStringTag
: testOmitPropsOnComponent
export const composeShouldForwardProps = (
tag: PrivateStyledComponent<any>,
options: StyledOptions | void,
isReal: boolean
) => {
let shouldForwardProp
if (options) {
const optionsShouldForwardProp = options.shouldForwardProp
shouldForwardProp =
tag.__emotion_forwardProp && optionsShouldForwardProp
? (propName: string) =>
tag.__emotion_forwardProp(propName) &&
optionsShouldForwardProp(propName)
: optionsShouldForwardProp
}
if (typeof shouldForwardProp !== 'function' && isReal) {
shouldForwardProp = tag.__emotion_forwardProp
}
return shouldForwardProp
}
export type CreateStyledComponent = <Props>(
...args: Interpolations
) => StyledComponent<Props>
export type CreateStyled = {
<Props>(
tag: StyledElementType<Props>,
options?: StyledOptions
): (...args: Interpolations) => StyledComponent<Props>,
[key: string]: CreateStyledComponent,
bind: () => CreateStyled
}

193
mc_test/node_modules/@emotion/styled/types/base.d.ts generated vendored Executable file
View File

@ -0,0 +1,193 @@
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 3.2
import * as React from 'react'
import { ComponentSelector, Interpolation } from '@emotion/serialize'
import { PropsOf, Theme } from '@emotion/react'
export {
ArrayInterpolation,
CSSObject,
FunctionInterpolation
} from '@emotion/serialize'
export { ComponentSelector, Interpolation }
/** Same as StyledOptions but shouldForwardProp must be a type guard */
export interface FilteringStyledOptions<
Props = Record<string, any>,
ForwardedProps extends keyof Props & string = keyof Props & string
> {
label?: string
shouldForwardProp?: (propName: string) => propName is ForwardedProps
target?: string
}
export interface StyledOptions<Props = Record<string, any>> {
label?: string
shouldForwardProp?: (propName: string) => boolean
target?: string
}
/**
* @typeparam ComponentProps Props which will be included when withComponent is called
* @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
*/
export interface StyledComponent<
ComponentProps extends {},
SpecificComponentProps extends {} = {},
JSXProps extends {} = {}
> extends React.FC<ComponentProps & SpecificComponentProps & JSXProps>,
ComponentSelector {
withComponent<C extends React.ComponentClass<React.ComponentProps<C>>>(
component: C
): StyledComponent<
ComponentProps & PropsOf<C>,
{},
{ ref?: React.Ref<InstanceType<C>> }
>
withComponent<C extends React.ComponentType<React.ComponentProps<C>>>(
component: C
): StyledComponent<ComponentProps & PropsOf<C>>
withComponent<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag
): StyledComponent<ComponentProps, JSX.IntrinsicElements[Tag]>
}
/**
* @typeparam ComponentProps Props which will be included when withComponent is called
* @typeparam SpecificComponentProps Props which will *not* be included when withComponent is called
*/
export interface CreateStyledComponent<
ComponentProps extends {},
SpecificComponentProps extends {} = {},
JSXProps extends {} = {}
> {
/**
* @typeparam AdditionalProps Additional props to add to your styled component
*/
<AdditionalProps extends {} = {}>(
...styles: Array<
Interpolation<
ComponentProps &
SpecificComponentProps &
AdditionalProps & { theme: Theme }
>
>
): StyledComponent<
ComponentProps & AdditionalProps,
SpecificComponentProps,
JSXProps
>
(
template: TemplateStringsArray,
...styles: Array<
Interpolation<ComponentProps & SpecificComponentProps & { theme: Theme }>
>
): StyledComponent<ComponentProps, SpecificComponentProps, JSXProps>
/**
* @typeparam AdditionalProps Additional props to add to your styled component
*/
<AdditionalProps extends {}>(
template: TemplateStringsArray,
...styles: Array<
Interpolation<
ComponentProps &
SpecificComponentProps &
AdditionalProps & { theme: Theme }
>
>
): StyledComponent<
ComponentProps & AdditionalProps,
SpecificComponentProps,
JSXProps
>
}
/**
* @desc
* This function accepts a React component or tag ('div', 'a' etc).
*
* @example styled(MyComponent)({ width: 100 })
* @example styled(MyComponent)(myComponentProps => ({ width: myComponentProps.width })
* @example styled('div')({ width: 100 })
* @example styled('div')<Props>(props => ({ width: props.width })
*/
export interface CreateStyled {
<
C extends React.ComponentClass<React.ComponentProps<C>>,
ForwardedProps extends keyof React.ComponentProps<C> &
string = keyof React.ComponentProps<C> & string
>(
component: C,
options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>
): CreateStyledComponent<
Pick<PropsOf<C>, ForwardedProps> & {
theme?: Theme
},
{},
{
ref?: React.Ref<InstanceType<C>>
}
>
<C extends React.ComponentClass<React.ComponentProps<C>>>(
component: C,
options?: StyledOptions<React.ComponentProps<C>>
): CreateStyledComponent<
PropsOf<C> & {
theme?: Theme
},
{},
{
ref?: React.Ref<InstanceType<C>>
}
>
<
C extends React.ComponentType<React.ComponentProps<C>>,
ForwardedProps extends keyof React.ComponentProps<C> &
string = keyof React.ComponentProps<C> & string
>(
component: C,
options: FilteringStyledOptions<React.ComponentProps<C>, ForwardedProps>
): CreateStyledComponent<
Pick<PropsOf<C>, ForwardedProps> & {
theme?: Theme
}
>
<C extends React.ComponentType<React.ComponentProps<C>>>(
component: C,
options?: StyledOptions<React.ComponentProps<C>>
): CreateStyledComponent<
PropsOf<C> & {
theme?: Theme
}
>
<
Tag extends keyof JSX.IntrinsicElements,
ForwardedProps extends keyof JSX.IntrinsicElements[Tag] &
string = keyof JSX.IntrinsicElements[Tag] & string
>(
tag: Tag,
options: FilteringStyledOptions<JSX.IntrinsicElements[Tag], ForwardedProps>
): CreateStyledComponent<
{ theme?: Theme; as?: React.ElementType },
Pick<JSX.IntrinsicElements[Tag], ForwardedProps>
>
<Tag extends keyof JSX.IntrinsicElements>(
tag: Tag,
options?: StyledOptions<JSX.IntrinsicElements[Tag]>
): CreateStyledComponent<
{ theme?: Theme; as?: React.ElementType },
JSX.IntrinsicElements[Tag]
>
}
declare const styled: CreateStyled
export default styled

32
mc_test/node_modules/@emotion/styled/types/index.d.ts generated vendored Executable file
View File

@ -0,0 +1,32 @@
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
// TypeScript Version: 3.2
import { Theme } from '@emotion/react'
import { CreateStyled as BaseCreateStyled, CreateStyledComponent } from './base'
export {
ArrayInterpolation,
ComponentSelector,
CSSObject,
FunctionInterpolation,
Interpolation,
StyledComponent,
StyledOptions,
FilteringStyledOptions,
CreateStyledComponent
} from './base'
export type StyledTags = {
[Tag in keyof JSX.IntrinsicElements]: CreateStyledComponent<
{
theme?: Theme
as?: React.ElementType
},
JSX.IntrinsicElements[Tag]
>
}
export interface CreateStyled extends BaseCreateStyled, StyledTags {}
declare const styled: CreateStyled
export default styled