colibri-ui 0.0.1 → 0.2.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.
Files changed (81) hide show
  1. package/Button/index.js +1 -40
  2. package/Button/styles.js +1 -44
  3. package/README.md +9 -0
  4. package/Theme/breakpoints.js +1 -38
  5. package/Theme/color.js +1 -36
  6. package/Theme/global.js +1 -14
  7. package/Theme/index.js +1 -25
  8. package/Theme/themes/buenos_aires.js +1 -42
  9. package/Theme/themes/default.js +1 -41
  10. package/esm/Button/index.js +1 -36
  11. package/esm/Button/styles.js +1 -41
  12. package/esm/Theme/breakpoints.js +1 -34
  13. package/esm/Theme/color.js +1 -32
  14. package/esm/Theme/global.js +1 -10
  15. package/esm/Theme/index.js +1 -22
  16. package/esm/Theme/themes/buenos_aires.js +1 -39
  17. package/esm/Theme/themes/default.js +1 -38
  18. package/esm/index.js +1 -2
  19. package/index.js +1 -10
  20. package/package.json +2 -1
  21. package/_virtual/_commonjsHelpers.js +0 -46
  22. package/_virtual/index.js +0 -5
  23. package/_virtual/index2.js +0 -9
  24. package/_virtual/index3.js +0 -9
  25. package/_virtual/index4.js +0 -5
  26. package/_virtual/jsx-runtime.js +0 -5
  27. package/_virtual/package.json +0 -6
  28. package/_virtual/react-is.development.js +0 -5
  29. package/_virtual/react-is.production.min.js +0 -5
  30. package/_virtual/react-jsx-runtime.development.js +0 -5
  31. package/_virtual/react-jsx-runtime.production.min.js +0 -5
  32. package/_virtual/react.development.js +0 -5
  33. package/_virtual/react.production.min.js +0 -5
  34. package/esm/_virtual/_commonjsHelpers.js +0 -40
  35. package/esm/_virtual/index.js +0 -3
  36. package/esm/_virtual/index2.js +0 -1
  37. package/esm/_virtual/index3.js +0 -1
  38. package/esm/_virtual/index4.js +0 -3
  39. package/esm/_virtual/jsx-runtime.js +0 -3
  40. package/esm/_virtual/react-is.development.js +0 -3
  41. package/esm/_virtual/react-is.production.min.js +0 -3
  42. package/esm/_virtual/react-jsx-runtime.development.js +0 -3
  43. package/esm/_virtual/react-jsx-runtime.production.min.js +0 -3
  44. package/esm/_virtual/react.development.js +0 -3
  45. package/esm/_virtual/react.production.min.js +0 -3
  46. package/esm/node_modules/@babel/runtime/helpers/esm/extends.js +0 -16
  47. package/esm/node_modules/@babel/runtime/helpers/esm/typeof.js +0 -11
  48. package/esm/node_modules/@emotion/cache/dist/emotion-cache.esm.js +0 -588
  49. package/esm/node_modules/@emotion/hash/dist/emotion-hash.esm.js +0 -44
  50. package/esm/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js +0 -12
  51. package/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +0 -9
  52. package/esm/node_modules/@emotion/react/_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js +0 -11
  53. package/esm/node_modules/@emotion/react/dist/emotion-element-c16c303e.esm.js +0 -233
  54. package/esm/node_modules/@emotion/react/dist/emotion-react.esm.js +0 -390
  55. package/esm/node_modules/@emotion/react/jsx-runtime/dist/emotion-react-jsx-runtime.esm.js +0 -27
  56. package/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +0 -265
  57. package/esm/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +0 -132
  58. package/esm/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js +0 -162
  59. package/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +0 -51
  60. package/esm/node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js +0 -12
  61. package/esm/node_modules/@emotion/utils/dist/emotion-utils.esm.js +0 -49
  62. package/esm/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +0 -15
  63. package/esm/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +0 -97
  64. package/esm/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1147
  65. package/esm/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -56
  66. package/esm/node_modules/react/cjs/react.development.js +0 -2402
  67. package/esm/node_modules/react/cjs/react.production.min.js +0 -354
  68. package/esm/node_modules/react/index.js +0 -16
  69. package/esm/node_modules/react/jsx-runtime.js +0 -16
  70. package/esm/node_modules/react-is/cjs/react-is.development.js +0 -170
  71. package/esm/node_modules/react-is/cjs/react-is.production.min.js +0 -119
  72. package/esm/node_modules/react-is/index.js +0 -16
  73. package/esm/node_modules/stylis/index.js +0 -7
  74. package/esm/node_modules/stylis/src/Enum.js +0 -21
  75. package/esm/node_modules/stylis/src/Middleware.js +0 -113
  76. package/esm/node_modules/stylis/src/Parser.js +0 -184
  77. package/esm/node_modules/stylis/src/Prefixer.js +0 -197
  78. package/esm/node_modules/stylis/src/Serializer.js +0 -40
  79. package/esm/node_modules/stylis/src/Tokenizer.js +0 -252
  80. package/esm/node_modules/stylis/src/Utility.js +0 -117
  81. package/esm/node_modules/tslib/tslib.es6.js +0 -525
@@ -1,233 +0,0 @@
1
- import _typeof from '../../../@babel/runtime/helpers/esm/typeof.js';
2
- import { r as reactExports } from '../../../react/index.js';
3
- import createCache from '../../cache/dist/emotion-cache.esm.js';
4
- import _extends from '../../../@babel/runtime/helpers/esm/extends.js';
5
- import weakMemoize from '../../weak-memoize/dist/emotion-weak-memoize.esm.js';
6
- import hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';
7
- import { registerStyles, insertStyles, getRegisteredStyles } from '../../utils/dist/emotion-utils.esm.js';
8
- import { serializeStyles } from '../../serialize/dist/emotion-serialize.esm.js';
9
- import { useInsertionEffectAlwaysWithSyncFallback } from '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
10
-
11
- var isBrowser = typeof document !== 'undefined';
12
- var hasOwn = {}.hasOwnProperty;
13
- var EmotionCacheContext = /* #__PURE__ */reactExports.createContext(
14
- // we're doing this to avoid preconstruct's dead code elimination in this one case
15
- // because this module is primarily intended for the browser and node
16
- // but it's also required in react native and similar environments sometimes
17
- // and we could have a special build just for that
18
- // but this is much easier and the native packages
19
- // might use a different theme context in the future anyway
20
- typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
21
- key: 'css'
22
- }) : null);
23
- if (process.env.NODE_ENV !== 'production') {
24
- EmotionCacheContext.displayName = 'EmotionCacheContext';
25
- }
26
- var CacheProvider = EmotionCacheContext.Provider;
27
- var __unsafe_useEmotionCache = function useEmotionCache() {
28
- return reactExports.useContext(EmotionCacheContext);
29
- };
30
- var withEmotionCache = function withEmotionCache(func) {
31
- // $FlowFixMe
32
- return /*#__PURE__*/reactExports.forwardRef(function (props, ref) {
33
- // the cache will never be null in the browser
34
- var cache = reactExports.useContext(EmotionCacheContext);
35
- return func(props, cache, ref);
36
- });
37
- };
38
- if (!isBrowser) {
39
- withEmotionCache = function withEmotionCache(func) {
40
- return function (props) {
41
- var cache = reactExports.useContext(EmotionCacheContext);
42
- if (cache === null) {
43
- // yes, we're potentially creating this on every render
44
- // it doesn't actually matter though since it's only on the server
45
- // so there will only every be a single render
46
- // that could change in the future because of suspense and etc. but for now,
47
- // this works and i don't want to optimise for a future thing that we aren't sure about
48
- cache = createCache({
49
- key: 'css'
50
- });
51
- return /*#__PURE__*/reactExports.createElement(EmotionCacheContext.Provider, {
52
- value: cache
53
- }, func(props, cache));
54
- } else {
55
- return func(props, cache);
56
- }
57
- };
58
- };
59
- }
60
- var ThemeContext = /* #__PURE__ */reactExports.createContext({});
61
- if (process.env.NODE_ENV !== 'production') {
62
- ThemeContext.displayName = 'EmotionThemeContext';
63
- }
64
- var useTheme = function useTheme() {
65
- return reactExports.useContext(ThemeContext);
66
- };
67
- var getTheme = function getTheme(outerTheme, theme) {
68
- if (typeof theme === 'function') {
69
- var mergedTheme = theme(outerTheme);
70
- if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || _typeof(mergedTheme) !== 'object' || Array.isArray(mergedTheme))) {
71
- throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
72
- }
73
- return mergedTheme;
74
- }
75
- if (process.env.NODE_ENV !== 'production' && (theme == null || _typeof(theme) !== 'object' || Array.isArray(theme))) {
76
- throw new Error('[ThemeProvider] Please make your theme prop a plain object');
77
- }
78
- return _extends({}, outerTheme, theme);
79
- };
80
- var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
81
- return weakMemoize(function (theme) {
82
- return getTheme(outerTheme, theme);
83
- });
84
- });
85
- var ThemeProvider = function ThemeProvider(props) {
86
- var theme = reactExports.useContext(ThemeContext);
87
- if (props.theme !== theme) {
88
- theme = createCacheWithTheme(theme)(props.theme);
89
- }
90
- return /*#__PURE__*/reactExports.createElement(ThemeContext.Provider, {
91
- value: theme
92
- }, props.children);
93
- };
94
- function withTheme(Component) {
95
- var componentName = Component.displayName || Component.name || 'Component';
96
- var render = function render(props, ref) {
97
- var theme = reactExports.useContext(ThemeContext);
98
- return /*#__PURE__*/reactExports.createElement(Component, _extends({
99
- theme: theme,
100
- ref: ref
101
- }, props));
102
- }; // $FlowFixMe
103
-
104
- var WithTheme = /*#__PURE__*/reactExports.forwardRef(render);
105
- WithTheme.displayName = "WithTheme(" + componentName + ")";
106
- return hoistNonReactStatics(WithTheme, Component);
107
- }
108
- var getLastPart = function getLastPart(functionName) {
109
- // The match may be something like 'Object.createEmotionProps' or
110
- // 'Loader.prototype.render'
111
- var parts = functionName.split('.');
112
- return parts[parts.length - 1];
113
- };
114
- var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
115
- // V8
116
- var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
117
- if (match) return getLastPart(match[1]); // Safari / Firefox
118
-
119
- match = /^([A-Za-z0-9$.]+)@/.exec(line);
120
- if (match) return getLastPart(match[1]);
121
- return undefined;
122
- };
123
- var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
124
- // identifiers, thus we only need to replace what is a valid character for JS,
125
- // but not for CSS.
126
-
127
- var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
128
- return identifier.replace(/\$/g, '-');
129
- };
130
- var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
131
- if (!stackTrace) return undefined;
132
- var lines = stackTrace.split('\n');
133
- for (var i = 0; i < lines.length; i++) {
134
- var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
135
-
136
- if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
137
-
138
- if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
139
- // uppercase letter
140
-
141
- if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
142
- }
143
- return undefined;
144
- };
145
- var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
146
- var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
147
- var createEmotionProps = function createEmotionProps(type, props) {
148
- if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' &&
149
- // check if there is a css declaration
150
- props.css.indexOf(':') !== -1) {
151
- throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
152
- }
153
- var newProps = {};
154
- for (var key in props) {
155
- if (hasOwn.call(props, key)) {
156
- newProps[key] = props[key];
157
- }
158
- }
159
- newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
160
- // the label hasn't already been computed
161
-
162
- if (process.env.NODE_ENV !== 'production' && !!props.css && (_typeof(props.css) !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
163
- var label = getLabelFromStackTrace(new Error().stack);
164
- if (label) newProps[labelPropName] = label;
165
- }
166
- return newProps;
167
- };
168
- var Insertion = function Insertion(_ref) {
169
- var cache = _ref.cache,
170
- serialized = _ref.serialized,
171
- isStringTag = _ref.isStringTag;
172
- registerStyles(cache, serialized, isStringTag);
173
- var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
174
- return insertStyles(cache, serialized, isStringTag);
175
- });
176
- if (!isBrowser && rules !== undefined) {
177
- var _ref2;
178
- var serializedNames = serialized.name;
179
- var next = serialized.next;
180
- while (next !== undefined) {
181
- serializedNames += ' ' + next.name;
182
- next = next.next;
183
- }
184
- return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
185
- __html: rules
186
- }, _ref2.nonce = cache.sheet.nonce, _ref2));
187
- }
188
- return null;
189
- };
190
- var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
191
- var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
192
- // not passing the registered cache to serializeStyles because it would
193
- // make certain babel optimisations not possible
194
-
195
- if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
196
- cssProp = cache.registered[cssProp];
197
- }
198
- var WrappedComponent = props[typePropName];
199
- var registeredStyles = [cssProp];
200
- var className = '';
201
- if (typeof props.className === 'string') {
202
- className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
203
- } else if (props.className != null) {
204
- className = props.className + " ";
205
- }
206
- var serialized = serializeStyles(registeredStyles, undefined, reactExports.useContext(ThemeContext));
207
- if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
208
- var labelFromStack = props[labelPropName];
209
- if (labelFromStack) {
210
- serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
211
- }
212
- }
213
- className += cache.key + "-" + serialized.name;
214
- var newProps = {};
215
- for (var key in props) {
216
- if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
217
- newProps[key] = props[key];
218
- }
219
- }
220
- newProps.ref = ref;
221
- newProps.className = className;
222
- return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion, {
223
- cache: cache,
224
- serialized: serialized,
225
- isStringTag: typeof WrappedComponent === 'string'
226
- }), /*#__PURE__*/reactExports.createElement(WrappedComponent, newProps));
227
- });
228
- if (process.env.NODE_ENV !== 'production') {
229
- Emotion.displayName = 'EmotionCssPropInternal';
230
- }
231
- var Emotion$1 = Emotion;
232
-
233
- export { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isBrowser as i, useTheme as u, withEmotionCache as w };
@@ -1,390 +0,0 @@
1
- import _typeof from '../../../@babel/runtime/helpers/esm/typeof.js';
2
- import { h as hasOwn, E as Emotion$1, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser$1 } from './emotion-element-c16c303e.esm.js';
3
- export { C as CacheProvider, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, b as withTheme } from './emotion-element-c16c303e.esm.js';
4
- import { r as reactExports } from '../../../react/index.js';
5
- import { insertStyles, getRegisteredStyles, registerStyles } from '../../utils/dist/emotion-utils.esm.js';
6
- import { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
7
- import { serializeStyles } from '../../serialize/dist/emotion-serialize.esm.js';
8
- import '../../cache/dist/emotion-cache.esm.js';
9
- import '../../../@babel/runtime/helpers/esm/extends.js';
10
- import '../../weak-memoize/dist/emotion-weak-memoize.esm.js';
11
- import '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';
12
- import '../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js';
13
-
14
- var pkg = {
15
- name: "@emotion/react",
16
- version: "11.11.4",
17
- main: "dist/emotion-react.cjs.js",
18
- module: "dist/emotion-react.esm.js",
19
- browser: {
20
- "./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
21
- },
22
- exports: {
23
- ".": {
24
- module: {
25
- worker: "./dist/emotion-react.worker.esm.js",
26
- browser: "./dist/emotion-react.browser.esm.js",
27
- "default": "./dist/emotion-react.esm.js"
28
- },
29
- "import": "./dist/emotion-react.cjs.mjs",
30
- "default": "./dist/emotion-react.cjs.js"
31
- },
32
- "./jsx-runtime": {
33
- module: {
34
- worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
35
- browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
36
- "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
37
- },
38
- "import": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.mjs",
39
- "default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
40
- },
41
- "./_isolated-hnrs": {
42
- module: {
43
- worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
44
- browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
45
- "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
46
- },
47
- "import": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.mjs",
48
- "default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
49
- },
50
- "./jsx-dev-runtime": {
51
- module: {
52
- worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
53
- browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
54
- "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
55
- },
56
- "import": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.mjs",
57
- "default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
58
- },
59
- "./package.json": "./package.json",
60
- "./types/css-prop": "./types/css-prop.d.ts",
61
- "./macro": {
62
- types: {
63
- "import": "./macro.d.mts",
64
- "default": "./macro.d.ts"
65
- },
66
- "default": "./macro.js"
67
- }
68
- },
69
- types: "types/index.d.ts",
70
- files: ["src", "dist", "jsx-runtime", "jsx-dev-runtime", "_isolated-hnrs", "types/*.d.ts", "macro.*"],
71
- sideEffects: false,
72
- author: "Emotion Contributors",
73
- license: "MIT",
74
- scripts: {
75
- "test:typescript": "dtslint types"
76
- },
77
- dependencies: {
78
- "@babel/runtime": "^7.18.3",
79
- "@emotion/babel-plugin": "^11.11.0",
80
- "@emotion/cache": "^11.11.0",
81
- "@emotion/serialize": "^1.1.3",
82
- "@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
83
- "@emotion/utils": "^1.2.1",
84
- "@emotion/weak-memoize": "^0.3.1",
85
- "hoist-non-react-statics": "^3.3.1"
86
- },
87
- peerDependencies: {
88
- react: ">=16.8.0"
89
- },
90
- peerDependenciesMeta: {
91
- "@types/react": {
92
- optional: true
93
- }
94
- },
95
- devDependencies: {
96
- "@definitelytyped/dtslint": "0.0.112",
97
- "@emotion/css": "11.11.2",
98
- "@emotion/css-prettifier": "1.1.3",
99
- "@emotion/server": "11.11.0",
100
- "@emotion/styled": "11.11.0",
101
- "html-tag-names": "^1.1.2",
102
- react: "16.14.0",
103
- "svg-tag-names": "^1.1.1",
104
- typescript: "^4.5.5"
105
- },
106
- repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
107
- publishConfig: {
108
- access: "public"
109
- },
110
- "umd:main": "dist/emotion-react.umd.min.js",
111
- preconstruct: {
112
- entrypoints: ["./index.js", "./jsx-runtime.js", "./jsx-dev-runtime.js", "./_isolated-hnrs.js"],
113
- umdName: "emotionReact",
114
- exports: {
115
- envConditions: ["browser", "worker"],
116
- extra: {
117
- "./types/css-prop": "./types/css-prop.d.ts",
118
- "./macro": {
119
- types: {
120
- "import": "./macro.d.mts",
121
- "default": "./macro.d.ts"
122
- },
123
- "default": "./macro.js"
124
- }
125
- }
126
- }
127
- }
128
- };
129
- var jsx = function jsx(type, props) {
130
- var args = arguments;
131
- if (props == null || !hasOwn.call(props, 'css')) {
132
- // $FlowFixMe
133
- return reactExports.createElement.apply(undefined, args);
134
- }
135
- var argsLength = args.length;
136
- var createElementArgArray = new Array(argsLength);
137
- createElementArgArray[0] = Emotion$1;
138
- createElementArgArray[1] = createEmotionProps(type, props);
139
- for (var i = 2; i < argsLength; i++) {
140
- createElementArgArray[i] = args[i];
141
- } // $FlowFixMe
142
-
143
- return reactExports.createElement.apply(null, createElementArgArray);
144
- };
145
- var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
146
- // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
147
- // initial client-side render from SSR, use place of hydrating tag
148
-
149
- var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
150
- if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && (
151
- // check for className as well since the user is
152
- // probably using the custom createElement which
153
- // means it will be turned into a className prop
154
- // $FlowFixMe I don't really want to add it to the type since it shouldn't be used
155
- props.className || props.css)) {
156
- console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
157
- warnedAboutCssPropForGlobal = true;
158
- }
159
- var styles = props.styles;
160
- var serialized = serializeStyles([styles], undefined, reactExports.useContext(ThemeContext));
161
- if (!isBrowser$1) {
162
- var _ref;
163
- var serializedNames = serialized.name;
164
- var serializedStyles = serialized.styles;
165
- var next = serialized.next;
166
- while (next !== undefined) {
167
- serializedNames += ' ' + next.name;
168
- serializedStyles += next.styles;
169
- next = next.next;
170
- }
171
- var shouldCache = cache.compat === true;
172
- var rules = cache.insert("", {
173
- name: serializedNames,
174
- styles: serializedStyles
175
- }, cache.sheet, shouldCache);
176
- if (shouldCache) {
177
- return null;
178
- }
179
- return /*#__PURE__*/reactExports.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
180
- __html: rules
181
- }, _ref.nonce = cache.sheet.nonce, _ref));
182
- } // yes, i know these hooks are used conditionally
183
- // but it is based on a constant that will never change at runtime
184
- // it's effectively like having two implementations and switching them out
185
- // so it's not actually breaking anything
186
-
187
- var sheetRef = reactExports.useRef();
188
- useInsertionEffectWithLayoutFallback(function () {
189
- var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
190
-
191
- var sheet = new cache.sheet.constructor({
192
- key: key,
193
- nonce: cache.sheet.nonce,
194
- container: cache.sheet.container,
195
- speedy: cache.sheet.isSpeedy
196
- });
197
- var rehydrating = false; // $FlowFixMe
198
-
199
- var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
200
- if (cache.sheet.tags.length) {
201
- sheet.before = cache.sheet.tags[0];
202
- }
203
- if (node !== null) {
204
- rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
205
-
206
- node.setAttribute('data-emotion', key);
207
- sheet.hydrate([node]);
208
- }
209
- sheetRef.current = [sheet, rehydrating];
210
- return function () {
211
- sheet.flush();
212
- };
213
- }, [cache]);
214
- useInsertionEffectWithLayoutFallback(function () {
215
- var sheetRefCurrent = sheetRef.current;
216
- var sheet = sheetRefCurrent[0],
217
- rehydrating = sheetRefCurrent[1];
218
- if (rehydrating) {
219
- sheetRefCurrent[1] = false;
220
- return;
221
- }
222
- if (serialized.next !== undefined) {
223
- // insert keyframes
224
- insertStyles(cache, serialized.next, true);
225
- }
226
- if (sheet.tags.length) {
227
- // if this doesn't exist then it will be null so the style element will be appended
228
- var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
229
- sheet.before = element;
230
- sheet.flush();
231
- }
232
- cache.insert("", serialized, sheet, false);
233
- }, [cache, serialized.name]);
234
- return null;
235
- });
236
- if (process.env.NODE_ENV !== 'production') {
237
- Global.displayName = 'EmotionGlobal';
238
- }
239
- function css() {
240
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
241
- args[_key] = arguments[_key];
242
- }
243
- return serializeStyles(args);
244
- }
245
- var keyframes = function keyframes() {
246
- var insertable = css.apply(void 0, arguments);
247
- var name = "animation-" + insertable.name; // $FlowFixMe
248
-
249
- return {
250
- name: name,
251
- styles: "@keyframes " + name + "{" + insertable.styles + "}",
252
- anim: 1,
253
- toString: function toString() {
254
- return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
255
- }
256
- };
257
- };
258
- var classnames = function classnames(args) {
259
- var len = args.length;
260
- var i = 0;
261
- var cls = '';
262
- for (; i < len; i++) {
263
- var arg = args[i];
264
- if (arg == null) continue;
265
- var toAdd = void 0;
266
- switch (_typeof(arg)) {
267
- case 'boolean':
268
- break;
269
- case 'object':
270
- {
271
- if (Array.isArray(arg)) {
272
- toAdd = classnames(arg);
273
- } else {
274
- if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
275
- console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.');
276
- }
277
- toAdd = '';
278
- for (var k in arg) {
279
- if (arg[k] && k) {
280
- toAdd && (toAdd += ' ');
281
- toAdd += k;
282
- }
283
- }
284
- }
285
- break;
286
- }
287
- default:
288
- {
289
- toAdd = arg;
290
- }
291
- }
292
- if (toAdd) {
293
- cls && (cls += ' ');
294
- cls += toAdd;
295
- }
296
- }
297
- return cls;
298
- };
299
- function merge(registered, css, className) {
300
- var registeredStyles = [];
301
- var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
302
- if (registeredStyles.length < 2) {
303
- return className;
304
- }
305
- return rawClassName + css(registeredStyles);
306
- }
307
- var Insertion = function Insertion(_ref) {
308
- var cache = _ref.cache,
309
- serializedArr = _ref.serializedArr;
310
- var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
311
- var rules = '';
312
- for (var i = 0; i < serializedArr.length; i++) {
313
- var res = insertStyles(cache, serializedArr[i], false);
314
- if (!isBrowser$1 && res !== undefined) {
315
- rules += res;
316
- }
317
- }
318
- if (!isBrowser$1) {
319
- return rules;
320
- }
321
- });
322
- if (!isBrowser$1 && rules.length !== 0) {
323
- var _ref2;
324
- return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
325
- return serialized.name;
326
- }).join(' '), _ref2.dangerouslySetInnerHTML = {
327
- __html: rules
328
- }, _ref2.nonce = cache.sheet.nonce, _ref2));
329
- }
330
- return null;
331
- };
332
- var ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {
333
- var hasRendered = false;
334
- var serializedArr = [];
335
- var css = function css() {
336
- if (hasRendered && process.env.NODE_ENV !== 'production') {
337
- throw new Error('css can only be used during render');
338
- }
339
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
340
- args[_key] = arguments[_key];
341
- }
342
- var serialized = serializeStyles(args, cache.registered);
343
- serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
344
-
345
- registerStyles(cache, serialized, false);
346
- return cache.key + "-" + serialized.name;
347
- };
348
- var cx = function cx() {
349
- if (hasRendered && process.env.NODE_ENV !== 'production') {
350
- throw new Error('cx can only be used during render');
351
- }
352
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
353
- args[_key2] = arguments[_key2];
354
- }
355
- return merge(cache.registered, css, classnames(args));
356
- };
357
- var content = {
358
- css: css,
359
- cx: cx,
360
- theme: reactExports.useContext(ThemeContext)
361
- };
362
- var ele = props.children(content);
363
- hasRendered = true;
364
- return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion, {
365
- cache: cache,
366
- serializedArr: serializedArr
367
- }), ele);
368
- });
369
- if (process.env.NODE_ENV !== 'production') {
370
- ClassNames.displayName = 'EmotionClassNames';
371
- }
372
- if (process.env.NODE_ENV !== 'production') {
373
- var isBrowser = typeof document !== 'undefined'; // #1727, #2905 for some reason Jest and Vitest evaluate modules twice if some consuming module gets mocked
374
-
375
- var isTestEnv = typeof jest !== 'undefined' || typeof vi !== 'undefined';
376
- if (isBrowser && !isTestEnv) {
377
- // globalThis has wide browser support - https://caniuse.com/?search=globalThis, Node.js 12 and later
378
- var globalContext =
379
- // $FlowIgnore
380
- typeof globalThis !== 'undefined' ? globalThis // eslint-disable-line no-undef
381
- : isBrowser ? window : global;
382
- var globalKey = "__EMOTION_REACT_" + pkg.version.split('.')[0] + "__";
383
- if (globalContext[globalKey]) {
384
- console.warn('You are loading @emotion/react when it is already loaded. Running ' + 'multiple instances may cause problems. This can happen if multiple ' + 'versions are used, or if multiple builds of the same version are ' + 'used.');
385
- }
386
- globalContext[globalKey] = true;
387
- }
388
- }
389
-
390
- export { ClassNames, Global, ThemeContext, jsx as createElement, css, jsx, keyframes, withEmotionCache };
@@ -1,27 +0,0 @@
1
- import { j as jsxRuntimeExports } from '../../../../react/jsx-runtime.js';
2
- import { h as hasOwn, E as Emotion$1, c as createEmotionProps } from '../../dist/emotion-element-c16c303e.esm.js';
3
- import '../../../../react/index.js';
4
- import '../../../cache/dist/emotion-cache.esm.js';
5
- import '../../../../@babel/runtime/helpers/esm/extends.js';
6
- import '../../../weak-memoize/dist/emotion-weak-memoize.esm.js';
7
- import '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';
8
- import '../../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js';
9
- import '../../../utils/dist/emotion-utils.esm.js';
10
- import '../../../serialize/dist/emotion-serialize.esm.js';
11
- import '../../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
12
-
13
- var Fragment = jsxRuntimeExports.Fragment;
14
- function jsx(type, props, key) {
15
- if (!hasOwn.call(props, 'css')) {
16
- return jsxRuntimeExports.jsx(type, props, key);
17
- }
18
- return jsxRuntimeExports.jsx(Emotion$1, createEmotionProps(type, props), key);
19
- }
20
- function jsxs(type, props, key) {
21
- if (!hasOwn.call(props, 'css')) {
22
- return jsxRuntimeExports.jsxs(type, props, key);
23
- }
24
- return jsxRuntimeExports.jsxs(Emotion$1, createEmotionProps(type, props), key);
25
- }
26
-
27
- export { Fragment, jsx, jsxs };