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,265 +0,0 @@
1
- import _typeof from '../../../@babel/runtime/helpers/esm/typeof.js';
2
- import murmur2 from '../../hash/dist/emotion-hash.esm.js';
3
- import unitlessKeys from '../../unitless/dist/emotion-unitless.esm.js';
4
- import memoize from '../../memoize/dist/emotion-memoize.esm.js';
5
-
6
- 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";
7
- var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
8
- var hyphenateRegex = /[A-Z]|^ms/g;
9
- var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
10
- var isCustomProperty = function isCustomProperty(property) {
11
- return property.charCodeAt(1) === 45;
12
- };
13
- var isProcessableValue = function isProcessableValue(value) {
14
- return value != null && typeof value !== 'boolean';
15
- };
16
- var processStyleName = /* #__PURE__ */memoize(function (styleName) {
17
- return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
18
- });
19
- var processStyleValue = function processStyleValue(key, value) {
20
- switch (key) {
21
- case 'animation':
22
- case 'animationName':
23
- {
24
- if (typeof value === 'string') {
25
- return value.replace(animationRegex, function (match, p1, p2) {
26
- cursor = {
27
- name: p1,
28
- styles: p2,
29
- next: cursor
30
- };
31
- return p1;
32
- });
33
- }
34
- }
35
- }
36
- if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
37
- return value + 'px';
38
- }
39
- return value;
40
- };
41
- if (process.env.NODE_ENV !== 'production') {
42
- var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
43
- var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
44
- var oldProcessStyleValue = processStyleValue;
45
- var msPattern = /^-ms-/;
46
- var hyphenPattern = /-(.)/g;
47
- var hyphenatedCache = {};
48
- processStyleValue = function processStyleValue(key, value) {
49
- if (key === 'content') {
50
- if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
51
- throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
52
- }
53
- }
54
- var processed = oldProcessStyleValue(key, value);
55
- if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
56
- hyphenatedCache[key] = true;
57
- console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
58
- return _char.toUpperCase();
59
- }) + "?");
60
- }
61
- return processed;
62
- };
63
- }
64
- var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
65
- function handleInterpolation(mergedProps, registered, interpolation) {
66
- if (interpolation == null) {
67
- return '';
68
- }
69
- if (interpolation.__emotion_styles !== undefined) {
70
- if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
71
- throw new Error(noComponentSelectorMessage);
72
- }
73
- return interpolation;
74
- }
75
- switch (_typeof(interpolation)) {
76
- case 'boolean':
77
- {
78
- return '';
79
- }
80
- case 'object':
81
- {
82
- if (interpolation.anim === 1) {
83
- cursor = {
84
- name: interpolation.name,
85
- styles: interpolation.styles,
86
- next: cursor
87
- };
88
- return interpolation.name;
89
- }
90
- if (interpolation.styles !== undefined) {
91
- var next = interpolation.next;
92
- if (next !== undefined) {
93
- // not the most efficient thing ever but this is a pretty rare case
94
- // and there will be very few iterations of this generally
95
- while (next !== undefined) {
96
- cursor = {
97
- name: next.name,
98
- styles: next.styles,
99
- next: cursor
100
- };
101
- next = next.next;
102
- }
103
- }
104
- var styles = interpolation.styles + ";";
105
- if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
106
- styles += interpolation.map;
107
- }
108
- return styles;
109
- }
110
- return createStringFromObject(mergedProps, registered, interpolation);
111
- }
112
- case 'function':
113
- {
114
- if (mergedProps !== undefined) {
115
- var previousCursor = cursor;
116
- var result = interpolation(mergedProps);
117
- cursor = previousCursor;
118
- return handleInterpolation(mergedProps, registered, result);
119
- } else if (process.env.NODE_ENV !== 'production') {
120
- console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
121
- }
122
- break;
123
- }
124
- case 'string':
125
- if (process.env.NODE_ENV !== 'production') {
126
- var matched = [];
127
- var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
128
- var fakeVarName = "animation" + matched.length;
129
- matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
130
- return "${" + fakeVarName + "}";
131
- });
132
- if (matched.length) {
133
- console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
134
- }
135
- }
136
- break;
137
- } // finalize string values (regular strings and functions interpolated into css calls)
138
-
139
- if (registered == null) {
140
- return interpolation;
141
- }
142
- var cached = registered[interpolation];
143
- return cached !== undefined ? cached : interpolation;
144
- }
145
- function createStringFromObject(mergedProps, registered, obj) {
146
- var string = '';
147
- if (Array.isArray(obj)) {
148
- for (var i = 0; i < obj.length; i++) {
149
- string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
150
- }
151
- } else {
152
- for (var _key in obj) {
153
- var value = obj[_key];
154
- if (_typeof(value) !== 'object') {
155
- if (registered != null && registered[value] !== undefined) {
156
- string += _key + "{" + registered[value] + "}";
157
- } else if (isProcessableValue(value)) {
158
- string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
159
- }
160
- } else {
161
- if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
162
- throw new Error(noComponentSelectorMessage);
163
- }
164
- if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
165
- for (var _i = 0; _i < value.length; _i++) {
166
- if (isProcessableValue(value[_i])) {
167
- string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
168
- }
169
- }
170
- } else {
171
- var interpolated = handleInterpolation(mergedProps, registered, value);
172
- switch (_key) {
173
- case 'animation':
174
- case 'animationName':
175
- {
176
- string += processStyleName(_key) + ":" + interpolated + ";";
177
- break;
178
- }
179
- default:
180
- {
181
- if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
182
- console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
183
- }
184
- string += _key + "{" + interpolated + "}";
185
- }
186
- }
187
- }
188
- }
189
- }
190
- }
191
- return string;
192
- }
193
- var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
194
- var sourceMapPattern;
195
- if (process.env.NODE_ENV !== 'production') {
196
- sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
197
- } // this is the cursor for keyframes
198
- // keyframes are stored on the SerializedStyles object as a linked list
199
-
200
- var cursor;
201
- var serializeStyles = function serializeStyles(args, registered, mergedProps) {
202
- if (args.length === 1 && _typeof(args[0]) === 'object' && args[0] !== null && args[0].styles !== undefined) {
203
- return args[0];
204
- }
205
- var stringMode = true;
206
- var styles = '';
207
- cursor = undefined;
208
- var strings = args[0];
209
- if (strings == null || strings.raw === undefined) {
210
- stringMode = false;
211
- styles += handleInterpolation(mergedProps, registered, strings);
212
- } else {
213
- if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
214
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
215
- }
216
- styles += strings[0];
217
- } // we start at 1 since we've already handled the first arg
218
-
219
- for (var i = 1; i < args.length; i++) {
220
- styles += handleInterpolation(mergedProps, registered, args[i]);
221
- if (stringMode) {
222
- if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
223
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
224
- }
225
- styles += strings[i];
226
- }
227
- }
228
- var sourceMap;
229
- if (process.env.NODE_ENV !== 'production') {
230
- styles = styles.replace(sourceMapPattern, function (match) {
231
- sourceMap = match;
232
- return '';
233
- });
234
- } // using a global regex with .exec is stateful so lastIndex has to be reset each time
235
-
236
- labelPattern.lastIndex = 0;
237
- var identifierName = '';
238
- var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
239
-
240
- while ((match = labelPattern.exec(styles)) !== null) {
241
- identifierName += '-' +
242
- // $FlowFixMe we know it's not null
243
- match[1];
244
- }
245
- var name = murmur2(styles) + identifierName;
246
- if (process.env.NODE_ENV !== 'production') {
247
- // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
248
- return {
249
- name: name,
250
- styles: styles,
251
- map: sourceMap,
252
- next: cursor,
253
- toString: function toString() {
254
- return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
255
- }
256
- };
257
- }
258
- return {
259
- name: name,
260
- styles: styles,
261
- next: cursor
262
- };
263
- };
264
-
265
- export { serializeStyles };
@@ -1,132 +0,0 @@
1
- /*
2
-
3
- Based off glamor's StyleSheet, thanks Sunil ❤️
4
-
5
- high performance StyleSheet for css-in-js systems
6
-
7
- - uses multiple style tags behind the scenes for millions of rules
8
- - uses `insertRule` for appending in production for *much* faster performance
9
-
10
- // usage
11
-
12
- import { StyleSheet } from '@emotion/sheet'
13
-
14
- let styleSheet = new StyleSheet({ key: '', container: document.head })
15
-
16
- styleSheet.insert('#box { border: 1px solid red; }')
17
- - appends a css rule into the stylesheet
18
-
19
- styleSheet.flush()
20
- - empties the stylesheet of all its contents
21
-
22
- */
23
- // $FlowFixMe
24
- function sheetForTag(tag) {
25
- if (tag.sheet) {
26
- // $FlowFixMe
27
- return tag.sheet;
28
- } // this weirdness brought to you by firefox
29
-
30
- /* istanbul ignore next */
31
-
32
- for (var i = 0; i < document.styleSheets.length; i++) {
33
- if (document.styleSheets[i].ownerNode === tag) {
34
- // $FlowFixMe
35
- return document.styleSheets[i];
36
- }
37
- }
38
- }
39
- function createStyleElement(options) {
40
- var tag = document.createElement('style');
41
- tag.setAttribute('data-emotion', options.key);
42
- if (options.nonce !== undefined) {
43
- tag.setAttribute('nonce', options.nonce);
44
- }
45
- tag.appendChild(document.createTextNode(''));
46
- tag.setAttribute('data-s', '');
47
- return tag;
48
- }
49
- var StyleSheet = /*#__PURE__*/function () {
50
- // Using Node instead of HTMLElement since container may be a ShadowRoot
51
- function StyleSheet(options) {
52
- var _this = this;
53
- this._insertTag = function (tag) {
54
- var before;
55
- if (_this.tags.length === 0) {
56
- if (_this.insertionPoint) {
57
- before = _this.insertionPoint.nextSibling;
58
- } else if (_this.prepend) {
59
- before = _this.container.firstChild;
60
- } else {
61
- before = _this.before;
62
- }
63
- } else {
64
- before = _this.tags[_this.tags.length - 1].nextSibling;
65
- }
66
- _this.container.insertBefore(tag, before);
67
- _this.tags.push(tag);
68
- };
69
- this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
70
- this.tags = [];
71
- this.ctr = 0;
72
- this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
73
-
74
- this.key = options.key;
75
- this.container = options.container;
76
- this.prepend = options.prepend;
77
- this.insertionPoint = options.insertionPoint;
78
- this.before = null;
79
- }
80
- var _proto = StyleSheet.prototype;
81
- _proto.hydrate = function hydrate(nodes) {
82
- nodes.forEach(this._insertTag);
83
- };
84
- _proto.insert = function insert(rule) {
85
- // the max length is how many rules we have per style tag, it's 65000 in speedy mode
86
- // it's 1 in dev because we insert source maps that map a single rule to a location
87
- // and you can only have one source map per style tag
88
- if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
89
- this._insertTag(createStyleElement(this));
90
- }
91
- var tag = this.tags[this.tags.length - 1];
92
- if (process.env.NODE_ENV !== 'production') {
93
- var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
94
- if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
95
- // this would only cause problem in speedy mode
96
- // but we don't want enabling speedy to affect the observable behavior
97
- // so we report this error at all times
98
- console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
99
- }
100
- this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
101
- }
102
- if (this.isSpeedy) {
103
- var sheet = sheetForTag(tag);
104
- try {
105
- // this is the ultrafast version, works across browsers
106
- // the big drawback is that the css won't be editable in devtools
107
- sheet.insertRule(rule, sheet.cssRules.length);
108
- } catch (e) {
109
- if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
110
- console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
111
- }
112
- }
113
- } else {
114
- tag.appendChild(document.createTextNode(rule));
115
- }
116
- this.ctr++;
117
- };
118
- _proto.flush = function flush() {
119
- // $FlowFixMe
120
- this.tags.forEach(function (tag) {
121
- return tag.parentNode && tag.parentNode.removeChild(tag);
122
- });
123
- this.tags = [];
124
- this.ctr = 0;
125
- if (process.env.NODE_ENV !== 'production') {
126
- this._alreadyInsertedOrderInsensitiveRule = false;
127
- }
128
- };
129
- return StyleSheet;
130
- }();
131
-
132
- export { StyleSheet };
@@ -1,162 +0,0 @@
1
- import _extends from '../../../../@babel/runtime/helpers/esm/extends.js';
2
- import { r as reactExports } from '../../../../react/index.js';
3
- import isPropValid from '../../../is-prop-valid/dist/emotion-is-prop-valid.esm.js';
4
- import '../../../react/dist/emotion-react.esm.js';
5
- import { registerStyles, insertStyles, getRegisteredStyles } from '../../../utils/dist/emotion-utils.esm.js';
6
- import { serializeStyles } from '../../../serialize/dist/emotion-serialize.esm.js';
7
- import { useInsertionEffectAlwaysWithSyncFallback } from '../../../use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js';
8
- import { w as withEmotionCache, T as ThemeContext } from '../../../react/dist/emotion-element-c16c303e.esm.js';
9
-
10
- var testOmitPropsOnStringTag = isPropValid;
11
- var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
12
- return key !== 'theme';
13
- };
14
- var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
15
- return typeof tag === 'string' &&
16
- // 96 is one less than the char code
17
- // for "a" so this is checking that
18
- // it's a lowercase character
19
- tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
20
- };
21
- var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
22
- var shouldForwardProp;
23
- if (options) {
24
- var optionsShouldForwardProp = options.shouldForwardProp;
25
- shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
26
- return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
27
- } : optionsShouldForwardProp;
28
- }
29
- if (typeof shouldForwardProp !== 'function' && isReal) {
30
- shouldForwardProp = tag.__emotion_forwardProp;
31
- }
32
- return shouldForwardProp;
33
- };
34
- 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";
35
- var isBrowser = typeof document !== 'undefined';
36
- var Insertion = function Insertion(_ref) {
37
- var cache = _ref.cache,
38
- serialized = _ref.serialized,
39
- isStringTag = _ref.isStringTag;
40
- registerStyles(cache, serialized, isStringTag);
41
- var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
42
- return insertStyles(cache, serialized, isStringTag);
43
- });
44
- if (!isBrowser && rules !== undefined) {
45
- var _ref2;
46
- var serializedNames = serialized.name;
47
- var next = serialized.next;
48
- while (next !== undefined) {
49
- serializedNames += ' ' + next.name;
50
- next = next.next;
51
- }
52
- return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
53
- __html: rules
54
- }, _ref2.nonce = cache.sheet.nonce, _ref2));
55
- }
56
- return null;
57
- };
58
- var createStyled = function createStyled(tag, options) {
59
- if (process.env.NODE_ENV !== 'production') {
60
- if (tag === undefined) {
61
- throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
62
- }
63
- }
64
- var isReal = tag.__emotion_real === tag;
65
- var baseTag = isReal && tag.__emotion_base || tag;
66
- var identifierName;
67
- var targetClassName;
68
- if (options !== undefined) {
69
- identifierName = options.label;
70
- targetClassName = options.target;
71
- }
72
- var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
73
- var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
74
- var shouldUseAs = !defaultShouldForwardProp('as');
75
- return function () {
76
- var args = arguments;
77
- var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
78
- if (identifierName !== undefined) {
79
- styles.push("label:" + identifierName + ";");
80
- }
81
- if (args[0] == null || args[0].raw === undefined) {
82
- styles.push.apply(styles, args);
83
- } else {
84
- if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
85
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
86
- }
87
- styles.push(args[0][0]);
88
- var len = args.length;
89
- var i = 1;
90
- for (; i < len; i++) {
91
- if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
92
- console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
93
- }
94
- styles.push(args[i], args[0][i]);
95
- }
96
- } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
97
-
98
- var Styled = withEmotionCache(function (props, cache, ref) {
99
- var FinalTag = shouldUseAs && props.as || baseTag;
100
- var className = '';
101
- var classInterpolations = [];
102
- var mergedProps = props;
103
- if (props.theme == null) {
104
- mergedProps = {};
105
- for (var key in props) {
106
- mergedProps[key] = props[key];
107
- }
108
- mergedProps.theme = reactExports.useContext(ThemeContext);
109
- }
110
- if (typeof props.className === 'string') {
111
- className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
112
- } else if (props.className != null) {
113
- className = props.className + " ";
114
- }
115
- var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
116
- className += cache.key + "-" + serialized.name;
117
- if (targetClassName !== undefined) {
118
- className += " " + targetClassName;
119
- }
120
- var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
121
- var newProps = {};
122
- for (var _key in props) {
123
- if (shouldUseAs && _key === 'as') continue;
124
- if (
125
- // $FlowFixMe
126
- finalShouldForwardProp(_key)) {
127
- newProps[_key] = props[_key];
128
- }
129
- }
130
- newProps.className = className;
131
- newProps.ref = ref;
132
- return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion, {
133
- cache: cache,
134
- serialized: serialized,
135
- isStringTag: typeof FinalTag === 'string'
136
- }), /*#__PURE__*/reactExports.createElement(FinalTag, newProps));
137
- });
138
- Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
139
- Styled.defaultProps = tag.defaultProps;
140
- Styled.__emotion_real = Styled;
141
- Styled.__emotion_base = baseTag;
142
- Styled.__emotion_styles = styles;
143
- Styled.__emotion_forwardProp = shouldForwardProp;
144
- Object.defineProperty(Styled, 'toString', {
145
- value: function value() {
146
- if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
147
- return 'NO_COMPONENT_SELECTOR';
148
- } // $FlowFixMe: coerce undefined to string
149
-
150
- return "." + targetClassName;
151
- }
152
- });
153
- Styled.withComponent = function (nextTag, nextOptions) {
154
- return createStyled(nextTag, _extends({}, options, nextOptions, {
155
- shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
156
- })).apply(void 0, styles);
157
- };
158
- return Styled;
159
- };
160
- };
161
-
162
- export { createStyled as default };
@@ -1,51 +0,0 @@
1
- var unitlessKeys = {
2
- animationIterationCount: 1,
3
- aspectRatio: 1,
4
- borderImageOutset: 1,
5
- borderImageSlice: 1,
6
- borderImageWidth: 1,
7
- boxFlex: 1,
8
- boxFlexGroup: 1,
9
- boxOrdinalGroup: 1,
10
- columnCount: 1,
11
- columns: 1,
12
- flex: 1,
13
- flexGrow: 1,
14
- flexPositive: 1,
15
- flexShrink: 1,
16
- flexNegative: 1,
17
- flexOrder: 1,
18
- gridRow: 1,
19
- gridRowEnd: 1,
20
- gridRowSpan: 1,
21
- gridRowStart: 1,
22
- gridColumn: 1,
23
- gridColumnEnd: 1,
24
- gridColumnSpan: 1,
25
- gridColumnStart: 1,
26
- msGridRow: 1,
27
- msGridRowSpan: 1,
28
- msGridColumn: 1,
29
- msGridColumnSpan: 1,
30
- fontWeight: 1,
31
- lineHeight: 1,
32
- opacity: 1,
33
- order: 1,
34
- orphans: 1,
35
- tabSize: 1,
36
- widows: 1,
37
- zIndex: 1,
38
- zoom: 1,
39
- WebkitLineClamp: 1,
40
- // SVG-related properties
41
- fillOpacity: 1,
42
- floodOpacity: 1,
43
- stopOpacity: 1,
44
- strokeDasharray: 1,
45
- strokeDashoffset: 1,
46
- strokeMiterlimit: 1,
47
- strokeOpacity: 1,
48
- strokeWidth: 1
49
- };
50
-
51
- export { unitlessKeys as default };
@@ -1,12 +0,0 @@
1
- import * as index from '../../../react/index.js';
2
- import { r as reactExports } from '../../../react/index.js';
3
-
4
- var isBrowser = typeof document !== 'undefined';
5
- var syncFallback = function syncFallback(create) {
6
- return create();
7
- };
8
- var useInsertionEffect = index['useInsertion' + 'Effect'] ? index['useInsertion' + 'Effect'] : false;
9
- var useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;
10
- var useInsertionEffectWithLayoutFallback = useInsertionEffect || reactExports.useLayoutEffect;
11
-
12
- export { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };
@@ -1,49 +0,0 @@
1
- var isBrowser = typeof document !== 'undefined';
2
- function getRegisteredStyles(registered, registeredStyles, classNames) {
3
- var rawClassName = '';
4
- classNames.split(' ').forEach(function (className) {
5
- if (registered[className] !== undefined) {
6
- registeredStyles.push(registered[className] + ";");
7
- } else {
8
- rawClassName += className + " ";
9
- }
10
- });
11
- return rawClassName;
12
- }
13
- var registerStyles = function registerStyles(cache, serialized, isStringTag) {
14
- var className = cache.key + "-" + serialized.name;
15
- if (
16
- // we only need to add the styles to the registered cache if the
17
- // class name could be used further down
18
- // the tree but if it's a string tag, we know it won't
19
- // so we don't have to add it to registered cache.
20
- // this improves memory usage since we can avoid storing the whole style string
21
- (isStringTag === false ||
22
- // we need to always store it if we're in compat mode and
23
- // in node since emotion-server relies on whether a style is in
24
- // the registered cache to know whether a style is global or not
25
- // also, note that this check will be dead code eliminated in the browser
26
- isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
27
- cache.registered[className] = serialized.styles;
28
- }
29
- };
30
- var insertStyles = function insertStyles(cache, serialized, isStringTag) {
31
- registerStyles(cache, serialized, isStringTag);
32
- var className = cache.key + "-" + serialized.name;
33
- if (cache.inserted[serialized.name] === undefined) {
34
- var stylesForSSR = '';
35
- var current = serialized;
36
- do {
37
- var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
38
- if (!isBrowser && maybeStyles !== undefined) {
39
- stylesForSSR += maybeStyles;
40
- }
41
- current = current.next;
42
- } while (current !== undefined);
43
- if (!isBrowser && stylesForSSR.length !== 0) {
44
- return stylesForSSR;
45
- }
46
- }
47
- };
48
-
49
- export { getRegisteredStyles, insertStyles, registerStyles };