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,588 +0,0 @@
1
- import { StyleSheet } from '../../sheet/dist/emotion-sheet.esm.js';
2
- import '../../../stylis/index.js';
3
- import weakMemoize from '../../weak-memoize/dist/emotion-weak-memoize.esm.js';
4
- import memoize from '../../memoize/dist/emotion-memoize.esm.js';
5
- import { peek, token, next, slice, position, delimit, dealloc, alloc, copy } from '../../../stylis/src/Tokenizer.js';
6
- import { from, hash, charat, replace, strlen, indexof, combine, match } from '../../../stylis/src/Utility.js';
7
- import { WEBKIT, MS, MOZ, RULESET, KEYFRAMES, DECLARATION, COMMENT } from '../../../stylis/src/Enum.js';
8
- import { serialize, stringify } from '../../../stylis/src/Serializer.js';
9
- import { rulesheet, middleware } from '../../../stylis/src/Middleware.js';
10
- import { compile } from '../../../stylis/src/Parser.js';
11
-
12
- var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
13
- var previous = 0;
14
- var character = 0;
15
- while (true) {
16
- previous = character;
17
- character = peek(); // &\f
18
-
19
- if (previous === 38 && character === 12) {
20
- points[index] = 1;
21
- }
22
- if (token(character)) {
23
- break;
24
- }
25
- next();
26
- }
27
- return slice(begin, position);
28
- };
29
- var toRules = function toRules(parsed, points) {
30
- // pretend we've started with a comma
31
- var index = -1;
32
- var character = 44;
33
- do {
34
- switch (token(character)) {
35
- case 0:
36
- // &\f
37
- if (character === 38 && peek() === 12) {
38
- // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
39
- // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
40
- // and when it should just concatenate the outer and inner selectors
41
- // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
42
- points[index] = 1;
43
- }
44
- parsed[index] += identifierWithPointTracking(position - 1, points, index);
45
- break;
46
- case 2:
47
- parsed[index] += delimit(character);
48
- break;
49
- case 4:
50
- // comma
51
- if (character === 44) {
52
- // colon
53
- parsed[++index] = peek() === 58 ? '&\f' : '';
54
- points[index] = parsed[index].length;
55
- break;
56
- }
57
-
58
- // fallthrough
59
-
60
- default:
61
- parsed[index] += from(character);
62
- }
63
- } while (character = next());
64
- return parsed;
65
- };
66
- var getRules = function getRules(value, points) {
67
- return dealloc(toRules(alloc(value), points));
68
- }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
69
-
70
- var fixedElements = /* #__PURE__ */new WeakMap();
71
- var compat = function compat(element) {
72
- if (element.type !== 'rule' || !element.parent ||
73
- // positive .length indicates that this rule contains pseudo
74
- // negative .length indicates that this rule has been already prefixed
75
- element.length < 1) {
76
- return;
77
- }
78
- var value = element.value,
79
- parent = element.parent;
80
- var isImplicitRule = element.column === parent.column && element.line === parent.line;
81
- while (parent.type !== 'rule') {
82
- parent = parent.parent;
83
- if (!parent) return;
84
- } // short-circuit for the simplest case
85
-
86
- if (element.props.length === 1 && value.charCodeAt(0) !== 58
87
- /* colon */ && !fixedElements.get(parent)) {
88
- return;
89
- } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
90
- // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
91
-
92
- if (isImplicitRule) {
93
- return;
94
- }
95
- fixedElements.set(element, true);
96
- var points = [];
97
- var rules = getRules(value, points);
98
- var parentRules = parent.props;
99
- for (var i = 0, k = 0; i < rules.length; i++) {
100
- for (var j = 0; j < parentRules.length; j++, k++) {
101
- element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
102
- }
103
- }
104
- };
105
- var removeLabel = function removeLabel(element) {
106
- if (element.type === 'decl') {
107
- var value = element.value;
108
- if (
109
- // charcode for l
110
- value.charCodeAt(0) === 108 &&
111
- // charcode for b
112
- value.charCodeAt(2) === 98) {
113
- // this ignores label
114
- element["return"] = '';
115
- element.value = '';
116
- }
117
- }
118
- };
119
- var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
120
- var isIgnoringComment = function isIgnoringComment(element) {
121
- return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
122
- };
123
- var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
124
- return function (element, index, children) {
125
- if (element.type !== 'rule' || cache.compat) return;
126
- var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
127
- if (unsafePseudoClasses) {
128
- var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
129
- //
130
- // considering this input:
131
- // .a {
132
- // .b /* comm */ {}
133
- // color: hotpink;
134
- // }
135
- // we get output corresponding to this:
136
- // .a {
137
- // & {
138
- // /* comm */
139
- // color: hotpink;
140
- // }
141
- // .b {}
142
- // }
143
-
144
- var commentContainer = isNested ? element.parent.children :
145
- // global rule at the root level
146
- children;
147
- for (var i = commentContainer.length - 1; i >= 0; i--) {
148
- var node = commentContainer[i];
149
- if (node.line < element.line) {
150
- break;
151
- } // it is quite weird but comments are *usually* put at `column: element.column - 1`
152
- // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
153
- // this will also match inputs like this:
154
- // .a {
155
- // /* comm */
156
- // .b {}
157
- // }
158
- //
159
- // but that is fine
160
- //
161
- // it would be the easiest to change the placement of the comment to be the first child of the rule:
162
- // .a {
163
- // .b { /* comm */ }
164
- // }
165
- // with such inputs we wouldn't have to search for the comment at all
166
- // TODO: consider changing this comment placement in the next major version
167
-
168
- if (node.column < element.column) {
169
- if (isIgnoringComment(node)) {
170
- return;
171
- }
172
- break;
173
- }
174
- }
175
- unsafePseudoClasses.forEach(function (unsafePseudoClass) {
176
- console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
177
- });
178
- }
179
- };
180
- };
181
- var isImportRule = function isImportRule(element) {
182
- return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
183
- };
184
- var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
185
- for (var i = index - 1; i >= 0; i--) {
186
- if (!isImportRule(children[i])) {
187
- return true;
188
- }
189
- }
190
- return false;
191
- }; // use this to remove incorrect elements from further processing
192
- // so they don't get handed to the `sheet` (or anything else)
193
- // as that could potentially lead to additional logs which in turn could be overhelming to the user
194
-
195
- var nullifyElement = function nullifyElement(element) {
196
- element.type = '';
197
- element.value = '';
198
- element["return"] = '';
199
- element.children = '';
200
- element.props = '';
201
- };
202
- var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
203
- if (!isImportRule(element)) {
204
- return;
205
- }
206
- if (element.parent) {
207
- console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
208
- nullifyElement(element);
209
- } else if (isPrependedWithRegularRules(index, children)) {
210
- console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
211
- nullifyElement(element);
212
- }
213
- };
214
-
215
- /* eslint-disable no-fallthrough */
216
-
217
- function prefix(value, length) {
218
- switch (hash(value, length)) {
219
- // color-adjust
220
- case 5103:
221
- return WEBKIT + 'print-' + value + value;
222
- // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
223
-
224
- case 5737:
225
- case 4201:
226
- case 3177:
227
- case 3433:
228
- case 1641:
229
- case 4457:
230
- case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
231
-
232
- case 5572:
233
- case 6356:
234
- case 5844:
235
- case 3191:
236
- case 6645:
237
- case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
238
-
239
- case 6391:
240
- case 5879:
241
- case 5623:
242
- case 6135:
243
- case 4599:
244
- case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
245
-
246
- case 4215:
247
- case 6389:
248
- case 5109:
249
- case 5365:
250
- case 5621:
251
- case 3829:
252
- return WEBKIT + value + value;
253
- // appearance, user-select, transform, hyphens, text-size-adjust
254
-
255
- case 5349:
256
- case 4246:
257
- case 4810:
258
- case 6968:
259
- case 2756:
260
- return WEBKIT + value + MOZ + value + MS + value + value;
261
- // flex, flex-direction
262
-
263
- case 6828:
264
- case 4268:
265
- return WEBKIT + value + MS + value + value;
266
- // order
267
-
268
- case 6165:
269
- return WEBKIT + value + MS + 'flex-' + value + value;
270
- // align-items
271
-
272
- case 5187:
273
- return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
274
- // align-self
275
-
276
- case 5443:
277
- return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
278
- // align-content
279
-
280
- case 4675:
281
- return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
282
- // flex-shrink
283
-
284
- case 5548:
285
- return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
286
- // flex-basis
287
-
288
- case 5292:
289
- return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
290
- // flex-grow
291
-
292
- case 6060:
293
- return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
294
- // transition
295
-
296
- case 4554:
297
- return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
298
- // cursor
299
-
300
- case 6187:
301
- return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
302
- // background, background-image
303
-
304
- case 5495:
305
- case 3959:
306
- return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
307
- // justify-content
308
-
309
- case 4968:
310
- return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
311
- // (margin|padding)-inline-(start|end)
312
-
313
- case 4095:
314
- case 3583:
315
- case 4068:
316
- case 2532:
317
- return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
318
- // (min|max)?(width|height|inline-size|block-size)
319
-
320
- case 8116:
321
- case 7059:
322
- case 5753:
323
- case 5535:
324
- case 5445:
325
- case 5701:
326
- case 4933:
327
- case 4677:
328
- case 5533:
329
- case 5789:
330
- case 5021:
331
- case 4765:
332
- // stretch, max-content, min-content, fill-available
333
- if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
334
- // (m)ax-content, (m)in-content
335
- case 109:
336
- // -
337
- if (charat(value, length + 4) !== 45) break;
338
- // (f)ill-available, (f)it-content
339
-
340
- case 102:
341
- return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
342
- // (s)tretch
343
-
344
- case 115:
345
- return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
346
- }
347
- break;
348
- // position: sticky
349
-
350
- case 4949:
351
- // (s)ticky?
352
- if (charat(value, length + 1) !== 115) break;
353
- // display: (flex|inline-flex)
354
-
355
- case 6444:
356
- switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
357
- // stic(k)y
358
- case 107:
359
- return replace(value, ':', ':' + WEBKIT) + value;
360
- // (inline-)?fl(e)x
361
-
362
- case 101:
363
- return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
364
- }
365
- break;
366
- // writing-mode
367
-
368
- case 5936:
369
- switch (charat(value, length + 11)) {
370
- // vertical-l(r)
371
- case 114:
372
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
373
- // vertical-r(l)
374
-
375
- case 108:
376
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
377
- // horizontal(-)tb
378
-
379
- case 45:
380
- return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
381
- }
382
- return WEBKIT + value + MS + value + value;
383
- }
384
- return value;
385
- }
386
- var prefixer = function prefixer(element, index, children, callback) {
387
- if (element.length > -1) if (!element["return"]) switch (element.type) {
388
- case DECLARATION:
389
- element["return"] = prefix(element.value, element.length);
390
- break;
391
- case KEYFRAMES:
392
- return serialize([copy(element, {
393
- value: replace(element.value, '@', '@' + WEBKIT)
394
- })], callback);
395
- case RULESET:
396
- if (element.length) return combine(element.props, function (value) {
397
- switch (match(value, /(::plac\w+|:read-\w+)/)) {
398
- // :read-(only|write)
399
- case ':read-only':
400
- case ':read-write':
401
- return serialize([copy(element, {
402
- props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
403
- })], callback);
404
- // :placeholder
405
-
406
- case '::placeholder':
407
- return serialize([copy(element, {
408
- props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
409
- }), copy(element, {
410
- props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
411
- }), copy(element, {
412
- props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
413
- })], callback);
414
- }
415
- return '';
416
- });
417
- }
418
- };
419
- var isBrowser = typeof document !== 'undefined';
420
- var getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {
421
- return memoize(function () {
422
- var cache = {};
423
- return function (name) {
424
- return cache[name];
425
- };
426
- });
427
- });
428
- var defaultStylisPlugins = [prefixer];
429
- var createCache = function createCache(options) {
430
- var key = options.key;
431
- if (process.env.NODE_ENV !== 'production' && !key) {
432
- throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
433
- }
434
- if (isBrowser && key === 'css') {
435
- var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
436
- // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
437
- // note this very very intentionally targets all style elements regardless of the key to ensure
438
- // that creating a cache works inside of render of a React component
439
-
440
- Array.prototype.forEach.call(ssrStyles, function (node) {
441
- // we want to only move elements which have a space in the data-emotion attribute value
442
- // because that indicates that it is an Emotion 11 server-side rendered style elements
443
- // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
444
- // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
445
- // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
446
- // will not result in the Emotion 10 styles being destroyed
447
- var dataEmotionAttribute = node.getAttribute('data-emotion');
448
- if (dataEmotionAttribute.indexOf(' ') === -1) {
449
- return;
450
- }
451
- document.head.appendChild(node);
452
- node.setAttribute('data-s', '');
453
- });
454
- }
455
- var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
456
- if (process.env.NODE_ENV !== 'production') {
457
- // $FlowFixMe
458
- if (/[^a-z-]/.test(key)) {
459
- throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
460
- }
461
- }
462
- var inserted = {};
463
- var container;
464
- var nodesToHydrate = [];
465
- if (isBrowser) {
466
- container = options.container || document.head;
467
- Array.prototype.forEach.call(
468
- // this means we will ignore elements which don't have a space in them which
469
- // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
470
- document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
471
- var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
472
-
473
- for (var i = 1; i < attrib.length; i++) {
474
- inserted[attrib[i]] = true;
475
- }
476
- nodesToHydrate.push(node);
477
- });
478
- }
479
- var _insert;
480
- var omnipresentPlugins = [compat, removeLabel];
481
- if (process.env.NODE_ENV !== 'production') {
482
- omnipresentPlugins.push(createUnsafeSelectorsAlarm({
483
- get compat() {
484
- return cache.compat;
485
- }
486
- }), incorrectImportAlarm);
487
- }
488
- if (isBrowser) {
489
- var currentSheet;
490
- var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
491
- if (!element.root) {
492
- if (element["return"]) {
493
- currentSheet.insert(element["return"]);
494
- } else if (element.value && element.type !== COMMENT) {
495
- // insert empty rule in non-production environments
496
- // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
497
- currentSheet.insert(element.value + "{}");
498
- }
499
- }
500
- } : rulesheet(function (rule) {
501
- currentSheet.insert(rule);
502
- })];
503
- var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
504
- var stylis = function stylis(styles) {
505
- return serialize(compile(styles), serializer);
506
- };
507
- _insert = function insert(selector, serialized, sheet, shouldCache) {
508
- currentSheet = sheet;
509
- if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
510
- currentSheet = {
511
- insert: function insert(rule) {
512
- sheet.insert(rule + serialized.map);
513
- }
514
- };
515
- }
516
- stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
517
- if (shouldCache) {
518
- cache.inserted[serialized.name] = true;
519
- }
520
- };
521
- } else {
522
- var _finalizingPlugins = [stringify];
523
- var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
524
- var _stylis = function _stylis(styles) {
525
- return serialize(compile(styles), _serializer);
526
- }; // $FlowFixMe
527
-
528
- var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
529
- var getRules = function getRules(selector, serialized) {
530
- var name = serialized.name;
531
- if (serverStylisCache[name] === undefined) {
532
- serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
533
- }
534
- return serverStylisCache[name];
535
- };
536
- _insert = function _insert(selector, serialized, sheet, shouldCache) {
537
- var name = serialized.name;
538
- var rules = getRules(selector, serialized);
539
- if (cache.compat === undefined) {
540
- // in regular mode, we don't set the styles on the inserted cache
541
- // since we don't need to and that would be wasting memory
542
- // we return them so that they are rendered in a style tag
543
- if (shouldCache) {
544
- cache.inserted[name] = true;
545
- }
546
- if (
547
- // using === development instead of !== production
548
- // because if people do ssr in tests, the source maps showing up would be annoying
549
- process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
550
- return rules + serialized.map;
551
- }
552
- return rules;
553
- } else {
554
- // in compat mode, we put the styles on the inserted cache so
555
- // that emotion-server can pull out the styles
556
- // except when we don't want to cache it which was in Global but now
557
- // is nowhere but we don't want to do a major right now
558
- // and just in case we're going to leave the case here
559
- // it's also not affecting client side bundle size
560
- // so it's really not a big deal
561
- if (shouldCache) {
562
- cache.inserted[name] = rules;
563
- } else {
564
- return rules;
565
- }
566
- }
567
- };
568
- }
569
- var cache = {
570
- key: key,
571
- sheet: new StyleSheet({
572
- key: key,
573
- container: container,
574
- nonce: options.nonce,
575
- speedy: options.speedy,
576
- prepend: options.prepend,
577
- insertionPoint: options.insertionPoint
578
- }),
579
- nonce: options.nonce,
580
- inserted: inserted,
581
- registered: {},
582
- insert: _insert
583
- };
584
- cache.sheet.hydrate(nodesToHydrate);
585
- return cache;
586
- };
587
-
588
- export { createCache as default };
@@ -1,44 +0,0 @@
1
- /* eslint-disable */
2
- // Inspired by https://github.com/garycourt/murmurhash-js
3
- // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
4
- function murmur2(str) {
5
- // 'm' and 'r' are mixing constants generated offline.
6
- // They're not really 'magic', they just happen to work well.
7
- // const m = 0x5bd1e995;
8
- // const r = 24;
9
- // Initialize the hash
10
- var h = 0; // Mix 4 bytes at a time into the hash
11
-
12
- var k,
13
- i = 0,
14
- len = str.length;
15
- for (; len >= 4; ++i, len -= 4) {
16
- k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
17
- k = /* Math.imul(k, m): */
18
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
19
- k ^= /* k >>> r: */
20
- k >>> 24;
21
- h = /* Math.imul(k, m): */
22
- (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */
23
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
24
- } // Handle the last few bytes of the input array
25
-
26
- switch (len) {
27
- case 3:
28
- h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
29
- case 2:
30
- h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
31
- case 1:
32
- h ^= str.charCodeAt(i) & 0xff;
33
- h = /* Math.imul(h, m): */
34
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
35
- } // Do a few final mixes of the hash to ensure the last few
36
- // bytes are well-incorporated.
37
-
38
- h ^= h >>> 13;
39
- h = /* Math.imul(h, m): */
40
- (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
41
- return ((h ^ h >>> 15) >>> 0).toString(36);
42
- }
43
-
44
- export { murmur2 as default };
@@ -1,12 +0,0 @@
1
- import memoize from '../../memoize/dist/emotion-memoize.esm.js';
2
-
3
- var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
4
-
5
- var isPropValid = /* #__PURE__ */memoize(function (prop) {
6
- return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
7
- /* o */ && prop.charCodeAt(1) === 110
8
- /* n */ && prop.charCodeAt(2) < 91;
9
- }
10
- /* Z+1 */);
11
-
12
- export { isPropValid as default };
@@ -1,9 +0,0 @@
1
- function memoize(fn) {
2
- var cache = Object.create(null);
3
- return function (arg) {
4
- if (cache[arg] === undefined) cache[arg] = fn(arg);
5
- return cache[arg];
6
- };
7
- }
8
-
9
- export { memoize as default };
@@ -1,11 +0,0 @@
1
- import hoistNonReactStatics$1 from '../../../../hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js';
2
-
3
- // this file isolates this package that is not tree-shakeable
4
- // and if this module doesn't actually contain any logic of its own
5
- // then Rollup just use 'hoist-non-react-statics' directly in other chunks
6
-
7
- var hoistNonReactStatics = function hoistNonReactStatics(targetComponent, sourceComponent) {
8
- return hoistNonReactStatics$1(targetComponent, sourceComponent);
9
- };
10
-
11
- export { hoistNonReactStatics as default };