@cleartrip/talos-highlight-widget 11.0.0 → 11.1.1

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.
@@ -155,6 +155,7 @@
155
155
  neutral500: '#B3B3B3',
156
156
  neutral700: '#808080',
157
157
  neutral900: '#1A1A1A',
158
+ neutral900Muted: '#1A1A1ABF',
158
159
  orange100: '#FFF1EC',
159
160
  orange250: '#FFB8A5',
160
161
  orange500: '#FF4F17',
@@ -2408,600 +2409,52 @@
2408
2409
  styled[tagName] = styled(tagName);
2409
2410
  });
2410
2411
 
2411
- function insertWithoutScoping(cache, serialized) {
2412
- if (cache.inserted[serialized.name] === undefined) {
2413
- return cache.insert('', serialized, cache.sheet, true);
2414
- }
2415
- }
2416
- function merge(registered, css, className) {
2417
- var registeredStyles = [];
2418
- var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
2419
- if (registeredStyles.length < 2) {
2420
- return className;
2412
+ const duration = {
2413
+ shortest: 150,
2414
+ shorter: 200,
2415
+ short: 250,
2416
+ standard: 300,
2417
+ complex: 375,
2418
+ enteringScreen: 225,
2419
+ leavingScreen: 195
2420
+ };
2421
+ const easing = {
2422
+ easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
2423
+ easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
2424
+ easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
2425
+ sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
2426
+ };
2427
+ function getAutoHeightDuration(height) {
2428
+ if (!height) {
2429
+ return 0;
2421
2430
  }
2422
- return rawClassName + css(registeredStyles);
2431
+ const constant = height / 36;
2432
+ return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
2423
2433
  }
2424
- var createEmotion = function createEmotion(options) {
2425
- var cache = createCache(options);
2426
- cache.sheet.speedy = function (value) {
2427
- this.isSpeedy = value;
2428
- };
2429
- cache.compat = true;
2430
- var css = function css() {
2431
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2432
- args[_key] = arguments[_key];
2433
- }
2434
- var serialized = serializeStyles(args, cache.registered, undefined);
2435
- insertStyles(cache, serialized, false);
2436
- return cache.key + "-" + serialized.name;
2437
- };
2438
- var keyframes = function keyframes() {
2439
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2440
- args[_key2] = arguments[_key2];
2441
- }
2442
- var serialized = serializeStyles(args, cache.registered);
2443
- var animation = "animation-" + serialized.name;
2444
- insertWithoutScoping(cache, {
2445
- name: serialized.name,
2446
- styles: "@keyframes " + animation + "{" + serialized.styles + "}"
2447
- });
2448
- return animation;
2449
- };
2450
- var injectGlobal = function injectGlobal() {
2451
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2452
- args[_key3] = arguments[_key3];
2453
- }
2454
- var serialized = serializeStyles(args, cache.registered);
2455
- insertWithoutScoping(cache, serialized);
2456
- };
2457
- var cx = function cx() {
2458
- for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2459
- args[_key4] = arguments[_key4];
2460
- }
2461
- return merge(cache.registered, css, classnames(args));
2462
- };
2463
- return {
2464
- css: css,
2465
- cx: cx,
2466
- injectGlobal: injectGlobal,
2467
- keyframes: keyframes,
2468
- hydrate: function hydrate(ids) {
2469
- ids.forEach(function (key) {
2470
- cache.inserted[key] = true;
2471
- });
2472
- },
2473
- flush: function flush() {
2474
- cache.registered = {};
2475
- cache.inserted = {};
2476
- cache.sheet.flush();
2477
- },
2478
- sheet: cache.sheet,
2479
- cache: cache,
2480
- getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
2481
- merge: merge.bind(null, cache.registered, css)
2482
- };
2434
+ const create = (props = ['all'], options = {}) => {
2435
+ const {
2436
+ duration: durationOption = duration.standard,
2437
+ easing: easingOption = easing.easeInOut,
2438
+ delay = 0
2439
+ } = options;
2440
+ return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : `${durationOption}ms`} ${easingOption} ${typeof delay === 'string' ? delay : `${delay}ms`}`).join(',');
2483
2441
  };
2484
- var classnames = function classnames(args) {
2485
- var cls = '';
2486
- for (var i = 0; i < args.length; i++) {
2487
- var arg = args[i];
2488
- if (arg == null) continue;
2489
- var toAdd = void 0;
2490
- switch (typeof arg) {
2491
- case 'boolean':
2492
- break;
2493
- case 'object':
2494
- {
2495
- if (Array.isArray(arg)) {
2496
- toAdd = classnames(arg);
2497
- } else {
2498
- toAdd = '';
2499
- for (var k in arg) {
2500
- if (arg[k] && k) {
2501
- toAdd && (toAdd += ' ');
2502
- toAdd += k;
2503
- }
2504
- }
2505
- }
2506
- break;
2507
- }
2508
- default:
2509
- {
2510
- toAdd = arg;
2511
- }
2512
- }
2513
- if (toAdd) {
2514
- cls && (cls += ' ');
2515
- cls += toAdd;
2516
- }
2517
- }
2518
- return cls;
2519
- };
2520
-
2521
- var _createEmotion = createEmotion({
2522
- key: 'css'
2523
- }),
2524
- css = _createEmotion.css;
2525
-
2526
- var openParentheses = "(".charCodeAt(0);
2527
- var closeParentheses = ")".charCodeAt(0);
2528
- var singleQuote = "'".charCodeAt(0);
2529
- var doubleQuote = '"'.charCodeAt(0);
2530
- var backslash = "\\".charCodeAt(0);
2531
- var slash = "/".charCodeAt(0);
2532
- var comma = ",".charCodeAt(0);
2533
- var colon = ":".charCodeAt(0);
2534
- var star = "*".charCodeAt(0);
2535
- var uLower = "u".charCodeAt(0);
2536
- var uUpper = "U".charCodeAt(0);
2537
- var plus = "+".charCodeAt(0);
2538
- var isUnicodeRange = /^[a-f0-9?-]+$/i;
2539
- var parse$1 = function (input) {
2540
- var tokens = [];
2541
- var value = input;
2542
- var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
2543
- var pos = 0;
2544
- var code = value.charCodeAt(pos);
2545
- var max = value.length;
2546
- var stack = [{
2547
- nodes: tokens
2548
- }];
2549
- var balanced = 0;
2550
- var parent;
2551
- var name = "";
2552
- var before = "";
2553
- var after = "";
2554
- while (pos < max) {
2555
- // Whitespaces
2556
- if (code <= 32) {
2557
- next = pos;
2558
- do {
2559
- next += 1;
2560
- code = value.charCodeAt(next);
2561
- } while (code <= 32);
2562
- token = value.slice(pos, next);
2563
- prev = tokens[tokens.length - 1];
2564
- if (code === closeParentheses && balanced) {
2565
- after = token;
2566
- } else if (prev && prev.type === "div") {
2567
- prev.after = token;
2568
- prev.sourceEndIndex += token.length;
2569
- } else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) {
2570
- before = token;
2571
- } else {
2572
- tokens.push({
2573
- type: "space",
2574
- sourceIndex: pos,
2575
- sourceEndIndex: next,
2576
- value: token
2577
- });
2578
- }
2579
- pos = next;
2580
-
2581
- // Quotes
2582
- } else if (code === singleQuote || code === doubleQuote) {
2583
- next = pos;
2584
- quote = code === singleQuote ? "'" : '"';
2585
- token = {
2586
- type: "string",
2587
- sourceIndex: pos,
2588
- quote: quote
2589
- };
2590
- do {
2591
- escape = false;
2592
- next = value.indexOf(quote, next + 1);
2593
- if (~next) {
2594
- escapePos = next;
2595
- while (value.charCodeAt(escapePos - 1) === backslash) {
2596
- escapePos -= 1;
2597
- escape = !escape;
2598
- }
2599
- } else {
2600
- value += quote;
2601
- next = value.length - 1;
2602
- token.unclosed = true;
2603
- }
2604
- } while (escape);
2605
- token.value = value.slice(pos + 1, next);
2606
- token.sourceEndIndex = token.unclosed ? next : next + 1;
2607
- tokens.push(token);
2608
- pos = next + 1;
2609
- code = value.charCodeAt(pos);
2610
-
2611
- // Comments
2612
- } else if (code === slash && value.charCodeAt(pos + 1) === star) {
2613
- next = value.indexOf("*/", pos);
2614
- token = {
2615
- type: "comment",
2616
- sourceIndex: pos,
2617
- sourceEndIndex: next + 2
2618
- };
2619
- if (next === -1) {
2620
- token.unclosed = true;
2621
- next = value.length;
2622
- token.sourceEndIndex = next;
2623
- }
2624
- token.value = value.slice(pos + 2, next);
2625
- tokens.push(token);
2626
- pos = next + 2;
2627
- code = value.charCodeAt(pos);
2628
-
2629
- // Operation within calc
2630
- } else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
2631
- token = value[pos];
2632
- tokens.push({
2633
- type: "word",
2634
- sourceIndex: pos - before.length,
2635
- sourceEndIndex: pos + token.length,
2636
- value: token
2637
- });
2638
- pos += 1;
2639
- code = value.charCodeAt(pos);
2640
-
2641
- // Dividers
2642
- } else if (code === slash || code === comma || code === colon) {
2643
- token = value[pos];
2644
- tokens.push({
2645
- type: "div",
2646
- sourceIndex: pos - before.length,
2647
- sourceEndIndex: pos + token.length,
2648
- value: token,
2649
- before: before,
2650
- after: ""
2651
- });
2652
- before = "";
2653
- pos += 1;
2654
- code = value.charCodeAt(pos);
2655
-
2656
- // Open parentheses
2657
- } else if (openParentheses === code) {
2658
- // Whitespaces after open parentheses
2659
- next = pos;
2660
- do {
2661
- next += 1;
2662
- code = value.charCodeAt(next);
2663
- } while (code <= 32);
2664
- parenthesesOpenPos = pos;
2665
- token = {
2666
- type: "function",
2667
- sourceIndex: pos - name.length,
2668
- value: name,
2669
- before: value.slice(parenthesesOpenPos + 1, next)
2670
- };
2671
- pos = next;
2672
- if (name === "url" && code !== singleQuote && code !== doubleQuote) {
2673
- next -= 1;
2674
- do {
2675
- escape = false;
2676
- next = value.indexOf(")", next + 1);
2677
- if (~next) {
2678
- escapePos = next;
2679
- while (value.charCodeAt(escapePos - 1) === backslash) {
2680
- escapePos -= 1;
2681
- escape = !escape;
2682
- }
2683
- } else {
2684
- value += ")";
2685
- next = value.length - 1;
2686
- token.unclosed = true;
2687
- }
2688
- } while (escape);
2689
- // Whitespaces before closed
2690
- whitespacePos = next;
2691
- do {
2692
- whitespacePos -= 1;
2693
- code = value.charCodeAt(whitespacePos);
2694
- } while (code <= 32);
2695
- if (parenthesesOpenPos < whitespacePos) {
2696
- if (pos !== whitespacePos + 1) {
2697
- token.nodes = [{
2698
- type: "word",
2699
- sourceIndex: pos,
2700
- sourceEndIndex: whitespacePos + 1,
2701
- value: value.slice(pos, whitespacePos + 1)
2702
- }];
2703
- } else {
2704
- token.nodes = [];
2705
- }
2706
- if (token.unclosed && whitespacePos + 1 !== next) {
2707
- token.after = "";
2708
- token.nodes.push({
2709
- type: "space",
2710
- sourceIndex: whitespacePos + 1,
2711
- sourceEndIndex: next,
2712
- value: value.slice(whitespacePos + 1, next)
2713
- });
2714
- } else {
2715
- token.after = value.slice(whitespacePos + 1, next);
2716
- token.sourceEndIndex = next;
2717
- }
2718
- } else {
2719
- token.after = "";
2720
- token.nodes = [];
2721
- }
2722
- pos = next + 1;
2723
- token.sourceEndIndex = token.unclosed ? next : pos;
2724
- code = value.charCodeAt(pos);
2725
- tokens.push(token);
2726
- } else {
2727
- balanced += 1;
2728
- token.after = "";
2729
- token.sourceEndIndex = pos + 1;
2730
- tokens.push(token);
2731
- stack.push(token);
2732
- tokens = token.nodes = [];
2733
- parent = token;
2734
- }
2735
- name = "";
2736
-
2737
- // Close parentheses
2738
- } else if (closeParentheses === code && balanced) {
2739
- pos += 1;
2740
- code = value.charCodeAt(pos);
2741
- parent.after = after;
2742
- parent.sourceEndIndex += after.length;
2743
- after = "";
2744
- balanced -= 1;
2745
- stack[stack.length - 1].sourceEndIndex = pos;
2746
- stack.pop();
2747
- parent = stack[balanced];
2748
- tokens = parent.nodes;
2749
-
2750
- // Words
2751
- } else {
2752
- next = pos;
2753
- do {
2754
- if (code === backslash) {
2755
- next += 1;
2756
- }
2757
- next += 1;
2758
- code = value.charCodeAt(next);
2759
- } while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
2760
- token = value.slice(pos, next);
2761
- if (openParentheses === code) {
2762
- name = token;
2763
- } else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) {
2764
- tokens.push({
2765
- type: "unicode-range",
2766
- sourceIndex: pos,
2767
- sourceEndIndex: next,
2768
- value: token
2769
- });
2770
- } else {
2771
- tokens.push({
2772
- type: "word",
2773
- sourceIndex: pos,
2774
- sourceEndIndex: next,
2775
- value: token
2776
- });
2777
- }
2778
- pos = next;
2779
- }
2780
- }
2781
- for (pos = stack.length - 1; pos; pos -= 1) {
2782
- stack[pos].unclosed = true;
2783
- stack[pos].sourceEndIndex = value.length;
2784
- }
2785
- return stack[0].nodes;
2786
- };
2787
-
2788
- var walk$1 = function walk(nodes, cb, bubble) {
2789
- var i, max, node, result;
2790
- for (i = 0, max = nodes.length; i < max; i += 1) {
2791
- node = nodes[i];
2792
- if (!bubble) {
2793
- result = cb(node, i, nodes);
2794
- }
2795
- if (result !== false && node.type === "function" && Array.isArray(node.nodes)) {
2796
- walk(node.nodes, cb, bubble);
2797
- }
2798
- if (bubble) {
2799
- cb(node, i, nodes);
2800
- }
2801
- }
2802
- };
2803
-
2804
- function stringifyNode(node, custom) {
2805
- var type = node.type;
2806
- var value = node.value;
2807
- var buf;
2808
- var customResult;
2809
- if (custom && (customResult = custom(node)) !== undefined) {
2810
- return customResult;
2811
- } else if (type === "word" || type === "space") {
2812
- return value;
2813
- } else if (type === "string") {
2814
- buf = node.quote || "";
2815
- return buf + value + (node.unclosed ? "" : buf);
2816
- } else if (type === "comment") {
2817
- return "/*" + value + (node.unclosed ? "" : "*/");
2818
- } else if (type === "div") {
2819
- return (node.before || "") + value + (node.after || "");
2820
- } else if (Array.isArray(node.nodes)) {
2821
- buf = stringify$1(node.nodes, custom);
2822
- if (type !== "function") {
2823
- return buf;
2824
- }
2825
- return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
2826
- }
2827
- return value;
2828
- }
2829
- function stringify$1(nodes, custom) {
2830
- var result, i;
2831
- if (Array.isArray(nodes)) {
2832
- result = "";
2833
- for (i = nodes.length - 1; ~i; i -= 1) {
2834
- result = stringifyNode(nodes[i], custom) + result;
2835
- }
2836
- return result;
2837
- }
2838
- return stringifyNode(nodes, custom);
2839
- }
2840
- var stringify_1 = stringify$1;
2841
-
2842
- var unit;
2843
- var hasRequiredUnit;
2844
- function requireUnit() {
2845
- if (hasRequiredUnit) return unit;
2846
- hasRequiredUnit = 1;
2847
- var minus = "-".charCodeAt(0);
2848
- var plus = "+".charCodeAt(0);
2849
- var dot = ".".charCodeAt(0);
2850
- var exp = "e".charCodeAt(0);
2851
- var EXP = "E".charCodeAt(0);
2852
-
2853
- // Check if three code points would start a number
2854
- // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
2855
- function likeNumber(value) {
2856
- var code = value.charCodeAt(0);
2857
- var nextCode;
2858
- if (code === plus || code === minus) {
2859
- nextCode = value.charCodeAt(1);
2860
- if (nextCode >= 48 && nextCode <= 57) {
2861
- return true;
2862
- }
2863
- var nextNextCode = value.charCodeAt(2);
2864
- if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
2865
- return true;
2866
- }
2867
- return false;
2868
- }
2869
- if (code === dot) {
2870
- nextCode = value.charCodeAt(1);
2871
- if (nextCode >= 48 && nextCode <= 57) {
2872
- return true;
2873
- }
2874
- return false;
2875
- }
2876
- if (code >= 48 && code <= 57) {
2877
- return true;
2878
- }
2879
- return false;
2880
- }
2881
-
2882
- // Consume a number
2883
- // https://www.w3.org/TR/css-syntax-3/#consume-number
2884
- unit = function (value) {
2885
- var pos = 0;
2886
- var length = value.length;
2887
- var code;
2888
- var nextCode;
2889
- var nextNextCode;
2890
- if (length === 0 || !likeNumber(value)) {
2891
- return false;
2892
- }
2893
- code = value.charCodeAt(pos);
2894
- if (code === plus || code === minus) {
2895
- pos++;
2896
- }
2897
- while (pos < length) {
2898
- code = value.charCodeAt(pos);
2899
- if (code < 48 || code > 57) {
2900
- break;
2901
- }
2902
- pos += 1;
2903
- }
2904
- code = value.charCodeAt(pos);
2905
- nextCode = value.charCodeAt(pos + 1);
2906
- if (code === dot && nextCode >= 48 && nextCode <= 57) {
2907
- pos += 2;
2908
- while (pos < length) {
2909
- code = value.charCodeAt(pos);
2910
- if (code < 48 || code > 57) {
2911
- break;
2912
- }
2913
- pos += 1;
2914
- }
2915
- }
2916
- code = value.charCodeAt(pos);
2917
- nextCode = value.charCodeAt(pos + 1);
2918
- nextNextCode = value.charCodeAt(pos + 2);
2919
- if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
2920
- pos += nextCode === plus || nextCode === minus ? 3 : 2;
2921
- while (pos < length) {
2922
- code = value.charCodeAt(pos);
2923
- if (code < 48 || code > 57) {
2924
- break;
2925
- }
2926
- pos += 1;
2927
- }
2928
- }
2929
- return {
2930
- number: value.slice(0, pos),
2931
- unit: value.slice(pos)
2932
- };
2933
- };
2934
- return unit;
2935
- }
2936
-
2937
- var parse = parse$1;
2938
- var walk = walk$1;
2939
- var stringify = stringify_1;
2940
- function ValueParser(value) {
2941
- if (this instanceof ValueParser) {
2942
- this.nodes = parse(value);
2943
- return this;
2944
- }
2945
- return new ValueParser(value);
2946
- }
2947
- ValueParser.prototype.toString = function () {
2948
- return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
2949
- };
2950
- ValueParser.prototype.walk = function (cb, bubble) {
2951
- walk(this.nodes, cb, bubble);
2952
- return this;
2953
- };
2954
- ValueParser.unit = requireUnit();
2955
- ValueParser.walk = walk;
2956
- ValueParser.stringify = stringify;
2957
- var lib = ValueParser;
2958
-
2959
- const duration = {
2960
- shortest: 150,
2961
- shorter: 200,
2962
- short: 250,
2963
- standard: 300,
2964
- complex: 375,
2965
- enteringScreen: 225,
2966
- leavingScreen: 195
2967
- };
2968
- const easing = {
2969
- easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
2970
- easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
2971
- easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
2972
- sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'
2973
- };
2974
- function getAutoHeightDuration(height) {
2975
- if (!height) {
2976
- return 0;
2977
- }
2978
- const constant = height / 36;
2979
- return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);
2980
- }
2981
- const create = (props = ['all'], options = {}) => {
2982
- const {
2983
- duration: durationOption = duration.standard,
2984
- easing: easingOption = easing.easeInOut,
2985
- delay = 0
2986
- } = options;
2987
- return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : `${durationOption}ms`} ${easingOption} ${typeof delay === 'string' ? delay : `${delay}ms`}`).join(',');
2988
- };
2989
- const zIndex = {
2990
- drawer: 1200,
2991
- modal: 1300,
2992
- popOver: 1300,
2993
- tooltip: 1500,
2994
- sideNav: 100,
2995
- toolbar: 50,
2996
- bottomSheet: 100,
2997
- pageLoader: 1600
2998
- };
2999
- const counter$1 = {
3000
- enabled: {
3001
- stroke: colors.neutral900
3002
- },
3003
- disabled: {
3004
- stroke: colors.neutral500
2442
+ const zIndex = {
2443
+ drawer: 1200,
2444
+ modal: 1300,
2445
+ popOver: 1300,
2446
+ tooltip: 1500,
2447
+ sideNav: 100,
2448
+ toolbar: 50,
2449
+ bottomSheet: 100,
2450
+ pageLoader: 1600
2451
+ };
2452
+ const counter$1 = {
2453
+ enabled: {
2454
+ stroke: colors.neutral900
2455
+ },
2456
+ disabled: {
2457
+ stroke: colors.neutral500
3005
2458
  }
3006
2459
  };
3007
2460
  const BaseTheme = {
@@ -3047,6 +2500,10 @@
3047
2500
  onBrand: colors.orange200,
3048
2501
  pink500: colors.pink500,
3049
2502
  pink400: colors.pink400,
2503
+ calloutSuccessTitle: colors.couponGreen,
2504
+ calloutDangerTitle: colors.red500,
2505
+ calloutInfoTitle: colors.link,
2506
+ calloutNeutralTitle: colors.neutral900Muted,
3050
2507
  black000: colors.black000,
3051
2508
  blue550: colors.blue550,
3052
2509
  green400: colors.green400,
@@ -3082,6 +2539,16 @@
3082
2539
  outlinedNeutralLabel: colors.neutral900,
3083
2540
  outlinedNeutralBorder: colors.neutral900,
3084
2541
  outlinedNeutralBg: colors.neutral100,
2542
+ containedSuccessLabel: colors.neutral100,
2543
+ containedSuccessBg: colors.success500,
2544
+ outlinedSuccessLabel: colors.success500,
2545
+ outlinedSuccessBorder: colors.success500,
2546
+ outlinedSuccessBg: colors.neutral100,
2547
+ containedDangerLabel: colors.neutral100,
2548
+ containedDangerBg: colors.red500,
2549
+ outlinedDangerLabel: colors.red500,
2550
+ outlinedDangerBorder: colors.red500,
2551
+ outlinedDangerBg: colors.neutral100,
3085
2552
  hover: {
3086
2553
  [colors.neutral100]: colors.neutral100,
3087
2554
  [colors.neutral900]: colors.neutral900,
@@ -3138,6 +2605,10 @@
3138
2605
  alertSoft: colors.alert100,
3139
2606
  warning: colors.warning,
3140
2607
  warningLightBg: colors.warningBg,
2608
+ calloutSuccessBg: colors.freshGreen100,
2609
+ calloutDangerBg: colors.red200,
2610
+ calloutInfoBg: colors.blue100,
2611
+ calloutNeutralBg: colors.neutral300,
3141
2612
  neutral: colors.neutral100,
3142
2613
  disabled: colors.neutral300,
3143
2614
  disabledSecondaryLight: colors.neutral350,
@@ -3229,370 +2700,951 @@
3229
2700
  neutral245: colors.neutral245
3230
2701
  },
3231
2702
  spinner: {
3232
- primary: colors.neutral700,
2703
+ primary: colors.neutral700,
2704
+ primaryBg: colors.alertBg
2705
+ },
2706
+ shimmer: {
2707
+ disabledLight: colors.disabledLight,
2708
+ disabledDark: colors.disabled250
2709
+ },
2710
+ coupon: {
2711
+ primaryBg: colors.blue100
2712
+ },
2713
+ alert: {
2714
+ success: colors.successBg,
2715
+ warning: colors.alertBg,
2716
+ warningLight: colors.warningLight,
2717
+ info: colors.blue100,
2718
+ error: colors.warningBg,
2719
+ neutral: colors.neutral100
2720
+ },
2721
+ badge: {
2722
+ curacao: colors.curacao250,
2723
+ curacao900: colors.curacao900,
2724
+ pinaColada: colors.pinaColada250,
2725
+ pinaColada300: colors.pinaColada300,
2726
+ margarita250: colors.margarita250,
2727
+ default: colors.neutral300,
2728
+ green: colors.successBg,
2729
+ green100: colors.freshGreen100,
2730
+ margarita100: colors.margarita100,
2731
+ margarita900: colors.margarita900,
2732
+ yellow: colors.alertBg,
2733
+ orange100: colors.orange100,
2734
+ orange250: colors.orange250,
2735
+ orange500: colors.orange500,
2736
+ red: colors.warningBg,
2737
+ red100: colors.alert100,
2738
+ green500: colors.success500,
2739
+ green600: colors.success600,
2740
+ purple100: colors.purple100,
2741
+ purple250: colors.purple250,
2742
+ gray100: colors.gray100,
2743
+ gray250: colors.gray250,
2744
+ aqua100: colors.aqua100,
2745
+ aqua250: colors.aqua250,
2746
+ black: colors.black,
2747
+ link: colors.link,
2748
+ labelDefault: colors.labelContainerBg,
2749
+ blue100: colors.blue100,
2750
+ blue900: colors.blue900,
2751
+ blue500: colors.blue500,
2752
+ neutral100: colors.neutral100,
2753
+ neutral700: colors.neutral700,
2754
+ pinaColada750: colors.pinaColada750,
2755
+ pinaColada100: colors.pinaColada100,
2756
+ gray800: colors.gray800,
2757
+ couponGreen: colors.couponGreen,
2758
+ alert500: colors.alert500,
2759
+ alertSoft: colors.alert100,
2760
+ red200: colors.red200,
2761
+ red500: colors.red500,
2762
+ redSoft: colors.red100,
2763
+ brown: colors.brown,
2764
+ grapetini750: colors.grapetini750,
2765
+ successGreen500: colors.successGreen500,
2766
+ alertYellow500: colors.alert500,
2767
+ errorRed500: colors.red500
2768
+ },
2769
+ counter: counter$1,
2770
+ calendar: {
2771
+ accent: colors.neutral900,
2772
+ background: colors.neutral300,
2773
+ selected: colors.neutral900
2774
+ },
2775
+ cursor: {
2776
+ neutral900: colors.neutral900
2777
+ },
2778
+ chipicon: {
2779
+ default: colors.neutral900,
2780
+ blue: colors.blueSky500,
2781
+ pink: colors.pinkVibrant500,
2782
+ yellow: colors.yellowSun500,
2783
+ purple: colors.purpleRoyal500,
2784
+ green: colors.greenFresh500,
2785
+ cfwBlue: colors.blue900,
2786
+ orange: colors.orange500
2787
+ }
2788
+ },
2789
+ elevation: Object.assign({}, elevation),
2790
+ border: Object.assign({}, border),
2791
+ spacing: Object.assign({}, spacing),
2792
+ typography: Object.assign({}, typography),
2793
+ size: Object.assign({}, size),
2794
+ transitions: {
2795
+ duration,
2796
+ easing,
2797
+ create,
2798
+ getAutoHeightDuration
2799
+ },
2800
+ zIndex
2801
+ };
2802
+ const B2CTheme = Object.assign({}, BaseTheme);
2803
+ Object.assign(Object.assign({}, BaseTheme), {
2804
+ color: Object.assign(Object.assign({}, BaseTheme.color), {
2805
+ text: Object.assign(Object.assign({}, BaseTheme.color.text), {
2806
+ secondary: colors.link2,
2807
+ tertiary: colors.neutral500
2808
+ }),
2809
+ button: Object.assign(Object.assign({}, BaseTheme.color.button), {
2810
+ outlinedPrimaryLabel: colors.link2,
2811
+ outlinedPrimaryBorder: colors.link2,
2812
+ outlinedPrimaryBg: colors.neutral100,
2813
+ outlinedSecondaryLabel: colors.neutral900,
2814
+ outlinedSecondaryBorder: colors.neutral900,
2815
+ outlinedSecondaryBg: colors.neutral100,
2816
+ outlinedTertiaryLabel: colors.brand,
2817
+ outlinedTertiaryBorder: colors.brand,
2818
+ outlinedTertiaryBg: colors.neutral100,
2819
+ outlinedDisabledLabel: colors.disabledText,
2820
+ outlinedDisabledBg: colors.neutral300,
2821
+ containedPrimaryLabel: colors.neutral100,
2822
+ containedPrimaryBg: colors.link2,
2823
+ containedSecondaryLabel: colors.neutral100,
2824
+ containedSecondaryBg: colors.neutral900,
2825
+ containedTertiaryLabel: colors.neutral100,
2826
+ containedTertiaryBg: colors.brand,
2827
+ containedDisabledLabel: colors.disabledText,
2828
+ containedDisabledBg: colors.neutral300,
2829
+ hover: {
2830
+ [colors.neutral100]: colors.neutral100,
2831
+ [colors.neutral900]: colors.neutral900,
2832
+ [colors.neutral900]: colors.neutral900,
2833
+ [colors.neutral100]: colors.neutral100,
2834
+ [colors.brand]: colors.bgPrimaryHover,
2835
+ [colors.neutral100]: colors.neutral100,
2836
+ [colors.disabledText]: colors.disabledText,
2837
+ [colors.neutral300]: colors.neutral300,
2838
+ [colors.neutral100]: colors.neutral100,
2839
+ [colors.link2]: colors.link2Hover,
2840
+ [colors.neutral100]: colors.neutral100,
2841
+ [colors.neutral900]: colors.neutral900,
2842
+ [colors.neutral100]: colors.neutral100,
2843
+ [colors.disabledText]: colors.disabledText,
2844
+ [colors.neutral300]: colors.neutral300
2845
+ }
2846
+ }),
2847
+ chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
2848
+ selectedPrimaryLabel: colors.link2,
2849
+ selectedPrimaryBorder: colors.link2,
2850
+ selectedPrimaryBg: colors.linkBg
2851
+ }),
2852
+ tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
2853
+ nonSelectedPrimaryLabel: colors.neutral900,
2854
+ selectedPrimaryLabel: colors.link2
2855
+ }),
2856
+ background: Object.assign(Object.assign({}, BaseTheme.color.background), {
2857
+ primary: colors.link2,
2858
+ secondary: colors.neutral900,
2859
+ tertiary: colors.brand
2860
+ }),
2861
+ border: Object.assign(Object.assign({}, BaseTheme.color.border), {
2862
+ primary: colors.link2,
2863
+ secondary: colors.neutral900,
2864
+ tertiary: colors.brand
2865
+ }),
2866
+ spinner: {
2867
+ primary: colors.link2,
2868
+ primaryBg: colors.alertBg
2869
+ },
2870
+ coupon: {
2871
+ primaryBg: colors.blue100
2872
+ }
2873
+ })
2874
+ });
2875
+ const hover$2 = key => {
2876
+ const bg = {
2877
+ [colors.neutral100]: colors.neutral100,
2878
+ [colors.neutral900]: colors.neutral900,
2879
+ [colors.neutral900]: colors.neutral900,
2880
+ [colors.neutral100]: colors.neutral100,
2881
+ [colors.brand]: colors.bgPrimaryHover,
2882
+ [colors.neutral100]: colors.neutral100,
2883
+ [colors.disabledText]: colors.disabledText,
2884
+ [colors.neutral300]: colors.neutral300,
2885
+ [colors.neutral100]: colors.neutral100,
2886
+ [colors.link2]: colors.link2Hover,
2887
+ [colors.neutral100]: colors.neutral100,
2888
+ [colors.neutral900]: colors.neutral900,
2889
+ [colors.neutral100]: colors.neutral100,
2890
+ [colors.disabledText]: colors.disabledText,
2891
+ [colors.neutral300]: colors.neutral300,
2892
+ [colors.bluePrimary500]: colors.bluePrimary500,
2893
+ [colors.yellowSecondary]: colors.yellowSecondary
2894
+ };
2895
+ return bg[key];
2896
+ };
2897
+ const counter = {
2898
+ enabled: {
2899
+ stroke: colors.bluePrimary500
2900
+ },
2901
+ disabled: {
2902
+ stroke: colors.neutral500
2903
+ }
2904
+ };
2905
+ Object.assign(Object.assign({}, BaseTheme), {
2906
+ color: Object.assign(Object.assign({}, BaseTheme.color), {
2907
+ text: Object.assign(Object.assign({}, BaseTheme.color.text), {
2908
+ link: colors.bluePrimary500
2909
+ }),
2910
+ button: Object.assign(Object.assign({}, BaseTheme.color.button), {
2911
+ outlinedPrimaryLabel: colors.primaryNeutral900,
2912
+ outlinedPrimaryBg: colors.neutral100,
2913
+ containedPrimaryLabel: colors.neutral100,
2914
+ containedPrimaryBg: colors.bluePrimary500,
2915
+ containedPrimarySoftBg: colors.blueSecondary,
2916
+ containedSecondaryLabel: colors.primaryNeutral900,
2917
+ containedSecondaryBg: colors.yellowSecondary,
2918
+ hover: hover$2
2919
+ }),
2920
+ chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
2921
+ selectedPrimaryLabel: colors.link2,
2922
+ selectedPrimaryBorder: colors.link2,
2923
+ selectedPrimaryBg: colors.linkBg,
2924
+ nonSelectedPrimaryLabel: colors.neutral900
2925
+ }),
2926
+ tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
2927
+ nonSelectedPrimaryLabel: colors.neutral900,
2928
+ selectedPrimaryLabel: colors.bluePrimary500
2929
+ }),
2930
+ background: Object.assign(Object.assign({}, BaseTheme.color.background), {
2931
+ primary: colors.bluePrimary500,
2932
+ secondary: colors.neutral900,
2933
+ brandLightBg: colors.blueSecondary,
2934
+ tertiary: colors.brand,
2935
+ defaultDarkest: colors.bluePrimary500,
2936
+ linkLightBg: colors.blueSecondary,
2937
+ brand100: colors.bluePrimary500
2938
+ }),
2939
+ border: Object.assign(Object.assign({}, BaseTheme.color.border), {
2940
+ primary: colors.bluePrimary500,
2941
+ brand: colors.bluePrimary500
2942
+ }),
2943
+ spinner: {
2944
+ primary: colors.link2,
3233
2945
  primaryBg: colors.alertBg
3234
2946
  },
3235
- shimmer: {
3236
- disabledLight: colors.disabledLight,
3237
- disabledDark: colors.disabled250
3238
- },
3239
- coupon: {
3240
- primaryBg: colors.blue100
3241
- },
3242
- alert: {
3243
- success: colors.successBg,
3244
- warning: colors.alertBg,
3245
- warningLight: colors.warningLight,
3246
- info: colors.blue100,
3247
- error: colors.warningBg,
3248
- neutral: colors.neutral100
3249
- },
3250
- badge: {
3251
- curacao: colors.curacao250,
3252
- curacao900: colors.curacao900,
3253
- pinaColada: colors.pinaColada250,
3254
- pinaColada300: colors.pinaColada300,
3255
- margarita250: colors.margarita250,
3256
- default: colors.neutral300,
3257
- green: colors.successBg,
3258
- green100: colors.freshGreen100,
3259
- margarita100: colors.margarita100,
3260
- margarita900: colors.margarita900,
3261
- yellow: colors.alertBg,
3262
- orange100: colors.orange100,
3263
- orange250: colors.orange250,
3264
- orange500: colors.orange500,
3265
- red: colors.warningBg,
3266
- red100: colors.alert100,
3267
- green500: colors.success500,
3268
- green600: colors.success600,
3269
- purple100: colors.purple100,
3270
- purple250: colors.purple250,
3271
- gray100: colors.gray100,
3272
- gray250: colors.gray250,
3273
- aqua100: colors.aqua100,
3274
- aqua250: colors.aqua250,
3275
- black: colors.black,
3276
- link: colors.link,
3277
- labelDefault: colors.labelContainerBg,
3278
- blue100: colors.blue100,
3279
- blue900: colors.blue900,
3280
- blue500: colors.blue500,
3281
- neutral100: colors.neutral100,
3282
- neutral700: colors.neutral700,
3283
- pinaColada750: colors.pinaColada750,
3284
- pinaColada100: colors.pinaColada100,
3285
- gray800: colors.gray800,
3286
- couponGreen: colors.couponGreen,
3287
- alert500: colors.alert500,
3288
- alertSoft: colors.alert100,
3289
- red200: colors.red200,
3290
- red500: colors.red500,
3291
- redSoft: colors.red100,
3292
- brown: colors.brown,
3293
- grapetini750: colors.grapetini750,
3294
- successGreen500: colors.successGreen500,
3295
- alertYellow500: colors.alert500,
3296
- errorRed500: colors.red500
3297
- },
3298
- counter: counter$1,
2947
+ counter,
3299
2948
  calendar: {
3300
- accent: colors.neutral900,
3301
- background: colors.neutral300,
3302
- selected: colors.neutral900
2949
+ accent: colors.bluePrimary500,
2950
+ background: colors.blueSecondary,
2951
+ selected: colors.bluePrimary500
2952
+ }
2953
+ })
2954
+ });
2955
+ const hover$1 = key => {
2956
+ const bg = {
2957
+ [colors.neutral100]: colors.neutral100,
2958
+ [colors.brand]: colors.bgPrimaryHover,
2959
+ [colors.disabledText]: colors.disabledText,
2960
+ [colors.neutral300]: colors.neutral300,
2961
+ [colors.link2]: colors.link2Hover,
2962
+ [colors.neutral100]: colors.neutral100,
2963
+ [colors.neutral900]: colors.neutral900,
2964
+ [colors.superGrey700]: colors.superGrey700,
2965
+ [colors.superGrey300]: colors.superGrey300,
2966
+ [colors.superGrey800]: colors.superGrey800,
2967
+ [colors.superGreen500]: colors.superGreen500
2968
+ };
2969
+ return bg[key];
2970
+ };
2971
+ Object.assign(Object.assign({}, BaseTheme), {
2972
+ color: Object.assign(Object.assign({}, BaseTheme.color), {
2973
+ text: Object.assign(Object.assign({}, BaseTheme.color.text), {
2974
+ primary: colors.superGrey800,
2975
+ secondary: colors.superGrey500,
2976
+ tertiary: colors.superGrey400,
2977
+ warning: colors.systemRed500,
2978
+ disabled: colors.superGrey400,
2979
+ subHeading: colors.superGrey400,
2980
+ success: colors.systemGreen500,
2981
+ link: colors.superBlue500,
2982
+ link2: colors.superBlue500
2983
+ }),
2984
+ button: Object.assign(Object.assign({}, BaseTheme.color.button), {
2985
+ outlinedPrimaryLabel: colors.superGrey700,
2986
+ outlinedPrimaryBorder: colors.superGrey300,
2987
+ outlinedTertiaryLabel: colors.superGrey700,
2988
+ outlinedTertiaryBorder: colors.superGrey300,
2989
+ outlinedDisabledLabel: colors.disabledText,
2990
+ containedSecondaryLabel: colors.superGrey800,
2991
+ containedPrimaryBg: colors.superBlue500,
2992
+ containedSecondaryBg: colors.superGreen500,
2993
+ containedTertiaryLabel: colors.superGrey300,
2994
+ containedDisabledLabel: colors.disabledText,
2995
+ containedPrimaryLabel: colors.neutral100,
2996
+ hover: hover$1
2997
+ }),
2998
+ chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
2999
+ selectedPrimaryLabel: colors.superBlue500,
3000
+ selectedPrimaryBorder: colors.superBlue500,
3001
+ selectedPrimaryBg: colors.superBlue25,
3002
+ disabledPrimaryLabel: colors.superGrey400,
3003
+ nonSelectedPrimaryLabel: colors.superGrey700,
3004
+ disabledPrimaryBg: colors.superGrey200
3005
+ }),
3006
+ tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
3007
+ nonSelectedPrimaryLabel: colors.superGrey500,
3008
+ selectedPrimaryLabel: colors.superBlue500
3009
+ }),
3010
+ background: Object.assign(Object.assign({}, BaseTheme.color.background), {
3011
+ primary: colors.superBlue500,
3012
+ disabled: colors.superGrey50,
3013
+ disabledDark: colors.superGrey300,
3014
+ warning: colors.systemRed500
3015
+ }),
3016
+ border: Object.assign(Object.assign({}, BaseTheme.color.border), {
3017
+ primary: colors.superBlue500,
3018
+ secondary: colors.neutral900,
3019
+ disabledDark: colors.superGrey300,
3020
+ defaultDark: colors.superGrey400,
3021
+ default: colors.superGrey300,
3022
+ disabled: colors.superGrey200
3023
+ })
3024
+ })
3025
+ });
3026
+ const hover = key => {
3027
+ const bg = {
3028
+ [colors.neutral100]: colors.neutral100,
3029
+ [colors.neutral900]: colors.neutral900,
3030
+ [colors.blue500]: colors.blue900,
3031
+ [colors.disabledText]: colors.disabledText,
3032
+ [colors.neutral300]: colors.neutral300,
3033
+ [colors.link2]: colors.link2Hover
3034
+ };
3035
+ return bg[key];
3036
+ };
3037
+ Object.assign(Object.assign({}, B2CTheme), {
3038
+ color: Object.assign(Object.assign({}, B2CTheme.color), {
3039
+ text: Object.assign(Object.assign({}, B2CTheme.color.text), {
3040
+ secondary: colors.blue500,
3041
+ brand: colors.blue500
3042
+ }),
3043
+ button: Object.assign(Object.assign({}, B2CTheme.color.button), {
3044
+ outlinedSecondaryLabel: colors.blue500,
3045
+ outlinedSecondaryBorder: colors.blue500,
3046
+ containedSecondaryBg: colors.blue500,
3047
+ hover
3048
+ }),
3049
+ background: Object.assign(Object.assign({}, B2CTheme.color.background), {
3050
+ secondary: colors.blue500,
3051
+ brand: colors.blue500
3052
+ }),
3053
+ border: Object.assign(Object.assign({}, B2CTheme.color.border), {
3054
+ secondary: colors.blue500,
3055
+ brand: colors.blue500
3056
+ })
3057
+ })
3058
+ });
3059
+ Object.assign(Object.assign({}, B2CTheme), {
3060
+ typography: Object.assign(Object.assign({}, B2CTheme.typography), {
3061
+ fontFamily: 'Manrope'
3062
+ })
3063
+ });
3064
+ const ThemeContext = React.createContext({
3065
+ theme: B2CTheme,
3066
+ platform: 'mobile'
3067
+ });
3068
+ const useTheme = () => {
3069
+ const themeContext = React.useContext(ThemeContext);
3070
+ const {
3071
+ theme
3072
+ } = themeContext || {
3073
+ theme: B2CTheme
3074
+ };
3075
+ return theme;
3076
+ };
3077
+ class ThemeManagerClass {
3078
+ constructor() {
3079
+ if (ThemeManagerClass.instance) {
3080
+ throw new Error('You can only create one instance!');
3081
+ }
3082
+ ThemeManagerClass.instance = this;
3083
+ this.theme = B2CTheme;
3084
+ }
3085
+ set(theme) {
3086
+ switch (theme) {
3087
+ case 'B2C':
3088
+ default:
3089
+ {
3090
+ this.theme = B2CTheme;
3091
+ break;
3092
+ }
3093
+ }
3094
+ }
3095
+ get() {
3096
+ return this.theme;
3097
+ }
3098
+ }
3099
+ const ThemeManager = Object.freeze(new ThemeManagerClass());
3100
+
3101
+ function insertWithoutScoping(cache, serialized) {
3102
+ if (cache.inserted[serialized.name] === undefined) {
3103
+ return cache.insert('', serialized, cache.sheet, true);
3104
+ }
3105
+ }
3106
+ function merge(registered, css, className) {
3107
+ var registeredStyles = [];
3108
+ var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
3109
+ if (registeredStyles.length < 2) {
3110
+ return className;
3111
+ }
3112
+ return rawClassName + css(registeredStyles);
3113
+ }
3114
+ var createEmotion = function createEmotion(options) {
3115
+ var cache = createCache(options);
3116
+ cache.sheet.speedy = function (value) {
3117
+ this.isSpeedy = value;
3118
+ };
3119
+ cache.compat = true;
3120
+ var css = function css() {
3121
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3122
+ args[_key] = arguments[_key];
3123
+ }
3124
+ var serialized = serializeStyles(args, cache.registered, undefined);
3125
+ insertStyles(cache, serialized, false);
3126
+ return cache.key + "-" + serialized.name;
3127
+ };
3128
+ var keyframes = function keyframes() {
3129
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3130
+ args[_key2] = arguments[_key2];
3131
+ }
3132
+ var serialized = serializeStyles(args, cache.registered);
3133
+ var animation = "animation-" + serialized.name;
3134
+ insertWithoutScoping(cache, {
3135
+ name: serialized.name,
3136
+ styles: "@keyframes " + animation + "{" + serialized.styles + "}"
3137
+ });
3138
+ return animation;
3139
+ };
3140
+ var injectGlobal = function injectGlobal() {
3141
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
3142
+ args[_key3] = arguments[_key3];
3143
+ }
3144
+ var serialized = serializeStyles(args, cache.registered);
3145
+ insertWithoutScoping(cache, serialized);
3146
+ };
3147
+ var cx = function cx() {
3148
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
3149
+ args[_key4] = arguments[_key4];
3150
+ }
3151
+ return merge(cache.registered, css, classnames(args));
3152
+ };
3153
+ return {
3154
+ css: css,
3155
+ cx: cx,
3156
+ injectGlobal: injectGlobal,
3157
+ keyframes: keyframes,
3158
+ hydrate: function hydrate(ids) {
3159
+ ids.forEach(function (key) {
3160
+ cache.inserted[key] = true;
3161
+ });
3303
3162
  },
3304
- cursor: {
3305
- neutral900: colors.neutral900
3163
+ flush: function flush() {
3164
+ cache.registered = {};
3165
+ cache.inserted = {};
3166
+ cache.sheet.flush();
3306
3167
  },
3307
- chipicon: {
3308
- default: colors.neutral900,
3309
- blue: colors.blueSky500,
3310
- pink: colors.pinkVibrant500,
3311
- yellow: colors.yellowSun500,
3312
- purple: colors.purpleRoyal500,
3313
- green: colors.greenFresh500,
3314
- cfwBlue: colors.blue900,
3315
- orange: colors.orange500
3168
+ sheet: cache.sheet,
3169
+ cache: cache,
3170
+ getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
3171
+ merge: merge.bind(null, cache.registered, css)
3172
+ };
3173
+ };
3174
+ var classnames = function classnames(args) {
3175
+ var cls = '';
3176
+ for (var i = 0; i < args.length; i++) {
3177
+ var arg = args[i];
3178
+ if (arg == null) continue;
3179
+ var toAdd = void 0;
3180
+ switch (typeof arg) {
3181
+ case 'boolean':
3182
+ break;
3183
+ case 'object':
3184
+ {
3185
+ if (Array.isArray(arg)) {
3186
+ toAdd = classnames(arg);
3187
+ } else {
3188
+ toAdd = '';
3189
+ for (var k in arg) {
3190
+ if (arg[k] && k) {
3191
+ toAdd && (toAdd += ' ');
3192
+ toAdd += k;
3193
+ }
3194
+ }
3195
+ }
3196
+ break;
3197
+ }
3198
+ default:
3199
+ {
3200
+ toAdd = arg;
3201
+ }
3316
3202
  }
3317
- },
3318
- elevation: Object.assign({}, elevation),
3319
- border: Object.assign({}, border),
3320
- spacing: Object.assign({}, spacing),
3321
- typography: Object.assign({}, typography),
3322
- size: Object.assign({}, size),
3323
- transitions: {
3324
- duration,
3325
- easing,
3326
- create,
3327
- getAutoHeightDuration
3328
- },
3329
- zIndex
3203
+ if (toAdd) {
3204
+ cls && (cls += ' ');
3205
+ cls += toAdd;
3206
+ }
3207
+ }
3208
+ return cls;
3330
3209
  };
3331
- const B2CTheme = Object.assign({}, BaseTheme);
3332
- Object.assign(Object.assign({}, BaseTheme), {
3333
- color: Object.assign(Object.assign({}, BaseTheme.color), {
3334
- text: Object.assign(Object.assign({}, BaseTheme.color.text), {
3335
- secondary: colors.link2,
3336
- tertiary: colors.neutral500
3337
- }),
3338
- button: Object.assign(Object.assign({}, BaseTheme.color.button), {
3339
- outlinedPrimaryLabel: colors.link2,
3340
- outlinedPrimaryBorder: colors.link2,
3341
- outlinedPrimaryBg: colors.neutral100,
3342
- outlinedSecondaryLabel: colors.neutral900,
3343
- outlinedSecondaryBorder: colors.neutral900,
3344
- outlinedSecondaryBg: colors.neutral100,
3345
- outlinedTertiaryLabel: colors.brand,
3346
- outlinedTertiaryBorder: colors.brand,
3347
- outlinedTertiaryBg: colors.neutral100,
3348
- outlinedDisabledLabel: colors.disabledText,
3349
- outlinedDisabledBg: colors.neutral300,
3350
- containedPrimaryLabel: colors.neutral100,
3351
- containedPrimaryBg: colors.link2,
3352
- containedSecondaryLabel: colors.neutral100,
3353
- containedSecondaryBg: colors.neutral900,
3354
- containedTertiaryLabel: colors.neutral100,
3355
- containedTertiaryBg: colors.brand,
3356
- containedDisabledLabel: colors.disabledText,
3357
- containedDisabledBg: colors.neutral300,
3358
- hover: {
3359
- [colors.neutral100]: colors.neutral100,
3360
- [colors.neutral900]: colors.neutral900,
3361
- [colors.neutral900]: colors.neutral900,
3362
- [colors.neutral100]: colors.neutral100,
3363
- [colors.brand]: colors.bgPrimaryHover,
3364
- [colors.neutral100]: colors.neutral100,
3365
- [colors.disabledText]: colors.disabledText,
3366
- [colors.neutral300]: colors.neutral300,
3367
- [colors.neutral100]: colors.neutral100,
3368
- [colors.link2]: colors.link2Hover,
3369
- [colors.neutral100]: colors.neutral100,
3370
- [colors.neutral900]: colors.neutral900,
3371
- [colors.neutral100]: colors.neutral100,
3372
- [colors.disabledText]: colors.disabledText,
3373
- [colors.neutral300]: colors.neutral300
3210
+
3211
+ var _createEmotion = createEmotion({
3212
+ key: 'css'
3213
+ }),
3214
+ css = _createEmotion.css;
3215
+
3216
+ var openParentheses = "(".charCodeAt(0);
3217
+ var closeParentheses = ")".charCodeAt(0);
3218
+ var singleQuote = "'".charCodeAt(0);
3219
+ var doubleQuote = '"'.charCodeAt(0);
3220
+ var backslash = "\\".charCodeAt(0);
3221
+ var slash = "/".charCodeAt(0);
3222
+ var comma = ",".charCodeAt(0);
3223
+ var colon = ":".charCodeAt(0);
3224
+ var star = "*".charCodeAt(0);
3225
+ var uLower = "u".charCodeAt(0);
3226
+ var uUpper = "U".charCodeAt(0);
3227
+ var plus = "+".charCodeAt(0);
3228
+ var isUnicodeRange = /^[a-f0-9?-]+$/i;
3229
+ var parse$1 = function (input) {
3230
+ var tokens = [];
3231
+ var value = input;
3232
+ var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
3233
+ var pos = 0;
3234
+ var code = value.charCodeAt(pos);
3235
+ var max = value.length;
3236
+ var stack = [{
3237
+ nodes: tokens
3238
+ }];
3239
+ var balanced = 0;
3240
+ var parent;
3241
+ var name = "";
3242
+ var before = "";
3243
+ var after = "";
3244
+ while (pos < max) {
3245
+ // Whitespaces
3246
+ if (code <= 32) {
3247
+ next = pos;
3248
+ do {
3249
+ next += 1;
3250
+ code = value.charCodeAt(next);
3251
+ } while (code <= 32);
3252
+ token = value.slice(pos, next);
3253
+ prev = tokens[tokens.length - 1];
3254
+ if (code === closeParentheses && balanced) {
3255
+ after = token;
3256
+ } else if (prev && prev.type === "div") {
3257
+ prev.after = token;
3258
+ prev.sourceEndIndex += token.length;
3259
+ } else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) {
3260
+ before = token;
3261
+ } else {
3262
+ tokens.push({
3263
+ type: "space",
3264
+ sourceIndex: pos,
3265
+ sourceEndIndex: next,
3266
+ value: token
3267
+ });
3268
+ }
3269
+ pos = next;
3270
+
3271
+ // Quotes
3272
+ } else if (code === singleQuote || code === doubleQuote) {
3273
+ next = pos;
3274
+ quote = code === singleQuote ? "'" : '"';
3275
+ token = {
3276
+ type: "string",
3277
+ sourceIndex: pos,
3278
+ quote: quote
3279
+ };
3280
+ do {
3281
+ escape = false;
3282
+ next = value.indexOf(quote, next + 1);
3283
+ if (~next) {
3284
+ escapePos = next;
3285
+ while (value.charCodeAt(escapePos - 1) === backslash) {
3286
+ escapePos -= 1;
3287
+ escape = !escape;
3288
+ }
3289
+ } else {
3290
+ value += quote;
3291
+ next = value.length - 1;
3292
+ token.unclosed = true;
3293
+ }
3294
+ } while (escape);
3295
+ token.value = value.slice(pos + 1, next);
3296
+ token.sourceEndIndex = token.unclosed ? next : next + 1;
3297
+ tokens.push(token);
3298
+ pos = next + 1;
3299
+ code = value.charCodeAt(pos);
3300
+
3301
+ // Comments
3302
+ } else if (code === slash && value.charCodeAt(pos + 1) === star) {
3303
+ next = value.indexOf("*/", pos);
3304
+ token = {
3305
+ type: "comment",
3306
+ sourceIndex: pos,
3307
+ sourceEndIndex: next + 2
3308
+ };
3309
+ if (next === -1) {
3310
+ token.unclosed = true;
3311
+ next = value.length;
3312
+ token.sourceEndIndex = next;
3313
+ }
3314
+ token.value = value.slice(pos + 2, next);
3315
+ tokens.push(token);
3316
+ pos = next + 2;
3317
+ code = value.charCodeAt(pos);
3318
+
3319
+ // Operation within calc
3320
+ } else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
3321
+ token = value[pos];
3322
+ tokens.push({
3323
+ type: "word",
3324
+ sourceIndex: pos - before.length,
3325
+ sourceEndIndex: pos + token.length,
3326
+ value: token
3327
+ });
3328
+ pos += 1;
3329
+ code = value.charCodeAt(pos);
3330
+
3331
+ // Dividers
3332
+ } else if (code === slash || code === comma || code === colon) {
3333
+ token = value[pos];
3334
+ tokens.push({
3335
+ type: "div",
3336
+ sourceIndex: pos - before.length,
3337
+ sourceEndIndex: pos + token.length,
3338
+ value: token,
3339
+ before: before,
3340
+ after: ""
3341
+ });
3342
+ before = "";
3343
+ pos += 1;
3344
+ code = value.charCodeAt(pos);
3345
+
3346
+ // Open parentheses
3347
+ } else if (openParentheses === code) {
3348
+ // Whitespaces after open parentheses
3349
+ next = pos;
3350
+ do {
3351
+ next += 1;
3352
+ code = value.charCodeAt(next);
3353
+ } while (code <= 32);
3354
+ parenthesesOpenPos = pos;
3355
+ token = {
3356
+ type: "function",
3357
+ sourceIndex: pos - name.length,
3358
+ value: name,
3359
+ before: value.slice(parenthesesOpenPos + 1, next)
3360
+ };
3361
+ pos = next;
3362
+ if (name === "url" && code !== singleQuote && code !== doubleQuote) {
3363
+ next -= 1;
3364
+ do {
3365
+ escape = false;
3366
+ next = value.indexOf(")", next + 1);
3367
+ if (~next) {
3368
+ escapePos = next;
3369
+ while (value.charCodeAt(escapePos - 1) === backslash) {
3370
+ escapePos -= 1;
3371
+ escape = !escape;
3372
+ }
3373
+ } else {
3374
+ value += ")";
3375
+ next = value.length - 1;
3376
+ token.unclosed = true;
3377
+ }
3378
+ } while (escape);
3379
+ // Whitespaces before closed
3380
+ whitespacePos = next;
3381
+ do {
3382
+ whitespacePos -= 1;
3383
+ code = value.charCodeAt(whitespacePos);
3384
+ } while (code <= 32);
3385
+ if (parenthesesOpenPos < whitespacePos) {
3386
+ if (pos !== whitespacePos + 1) {
3387
+ token.nodes = [{
3388
+ type: "word",
3389
+ sourceIndex: pos,
3390
+ sourceEndIndex: whitespacePos + 1,
3391
+ value: value.slice(pos, whitespacePos + 1)
3392
+ }];
3393
+ } else {
3394
+ token.nodes = [];
3395
+ }
3396
+ if (token.unclosed && whitespacePos + 1 !== next) {
3397
+ token.after = "";
3398
+ token.nodes.push({
3399
+ type: "space",
3400
+ sourceIndex: whitespacePos + 1,
3401
+ sourceEndIndex: next,
3402
+ value: value.slice(whitespacePos + 1, next)
3403
+ });
3404
+ } else {
3405
+ token.after = value.slice(whitespacePos + 1, next);
3406
+ token.sourceEndIndex = next;
3407
+ }
3408
+ } else {
3409
+ token.after = "";
3410
+ token.nodes = [];
3411
+ }
3412
+ pos = next + 1;
3413
+ token.sourceEndIndex = token.unclosed ? next : pos;
3414
+ code = value.charCodeAt(pos);
3415
+ tokens.push(token);
3416
+ } else {
3417
+ balanced += 1;
3418
+ token.after = "";
3419
+ token.sourceEndIndex = pos + 1;
3420
+ tokens.push(token);
3421
+ stack.push(token);
3422
+ tokens = token.nodes = [];
3423
+ parent = token;
3374
3424
  }
3375
- }),
3376
- chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
3377
- selectedPrimaryLabel: colors.link2,
3378
- selectedPrimaryBorder: colors.link2,
3379
- selectedPrimaryBg: colors.linkBg
3380
- }),
3381
- tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
3382
- nonSelectedPrimaryLabel: colors.neutral900,
3383
- selectedPrimaryLabel: colors.link2
3384
- }),
3385
- background: Object.assign(Object.assign({}, BaseTheme.color.background), {
3386
- primary: colors.link2,
3387
- secondary: colors.neutral900,
3388
- tertiary: colors.brand
3389
- }),
3390
- border: Object.assign(Object.assign({}, BaseTheme.color.border), {
3391
- primary: colors.link2,
3392
- secondary: colors.neutral900,
3393
- tertiary: colors.brand
3394
- }),
3395
- spinner: {
3396
- primary: colors.link2,
3397
- primaryBg: colors.alertBg
3398
- },
3399
- coupon: {
3400
- primaryBg: colors.blue100
3401
- }
3402
- })
3403
- });
3404
- const hover$1 = key => {
3405
- const bg = {
3406
- [colors.neutral100]: colors.neutral100,
3407
- [colors.neutral900]: colors.neutral900,
3408
- [colors.neutral900]: colors.neutral900,
3409
- [colors.neutral100]: colors.neutral100,
3410
- [colors.brand]: colors.bgPrimaryHover,
3411
- [colors.neutral100]: colors.neutral100,
3412
- [colors.disabledText]: colors.disabledText,
3413
- [colors.neutral300]: colors.neutral300,
3414
- [colors.neutral100]: colors.neutral100,
3415
- [colors.link2]: colors.link2Hover,
3416
- [colors.neutral100]: colors.neutral100,
3417
- [colors.neutral900]: colors.neutral900,
3418
- [colors.neutral100]: colors.neutral100,
3419
- [colors.disabledText]: colors.disabledText,
3420
- [colors.neutral300]: colors.neutral300,
3421
- [colors.bluePrimary500]: colors.bluePrimary500,
3422
- [colors.yellowSecondary]: colors.yellowSecondary
3423
- };
3424
- return bg[key];
3425
- };
3426
- const counter = {
3427
- enabled: {
3428
- stroke: colors.bluePrimary500
3429
- },
3430
- disabled: {
3431
- stroke: colors.neutral500
3432
- }
3433
- };
3434
- Object.assign(Object.assign({}, BaseTheme), {
3435
- color: Object.assign(Object.assign({}, BaseTheme.color), {
3436
- text: Object.assign(Object.assign({}, BaseTheme.color.text), {
3437
- link: colors.bluePrimary500
3438
- }),
3439
- button: Object.assign(Object.assign({}, BaseTheme.color.button), {
3440
- outlinedPrimaryLabel: colors.primaryNeutral900,
3441
- outlinedPrimaryBg: colors.neutral100,
3442
- containedPrimaryLabel: colors.neutral100,
3443
- containedPrimaryBg: colors.bluePrimary500,
3444
- containedPrimarySoftBg: colors.blueSecondary,
3445
- containedSecondaryLabel: colors.primaryNeutral900,
3446
- containedSecondaryBg: colors.yellowSecondary,
3447
- hover: hover$1
3448
- }),
3449
- chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
3450
- selectedPrimaryLabel: colors.link2,
3451
- selectedPrimaryBorder: colors.link2,
3452
- selectedPrimaryBg: colors.linkBg,
3453
- nonSelectedPrimaryLabel: colors.neutral900
3454
- }),
3455
- tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
3456
- nonSelectedPrimaryLabel: colors.neutral900,
3457
- selectedPrimaryLabel: colors.bluePrimary500
3458
- }),
3459
- background: Object.assign(Object.assign({}, BaseTheme.color.background), {
3460
- primary: colors.bluePrimary500,
3461
- secondary: colors.neutral900,
3462
- brandLightBg: colors.blueSecondary,
3463
- tertiary: colors.brand,
3464
- defaultDarkest: colors.bluePrimary500,
3465
- linkLightBg: colors.blueSecondary,
3466
- brand100: colors.bluePrimary500
3467
- }),
3468
- border: Object.assign(Object.assign({}, BaseTheme.color.border), {
3469
- primary: colors.bluePrimary500,
3470
- brand: colors.bluePrimary500
3471
- }),
3472
- spinner: {
3473
- primary: colors.link2,
3474
- primaryBg: colors.alertBg
3475
- },
3476
- counter,
3477
- calendar: {
3478
- accent: colors.bluePrimary500,
3479
- background: colors.blueSecondary,
3480
- selected: colors.bluePrimary500
3425
+ name = "";
3426
+
3427
+ // Close parentheses
3428
+ } else if (closeParentheses === code && balanced) {
3429
+ pos += 1;
3430
+ code = value.charCodeAt(pos);
3431
+ parent.after = after;
3432
+ parent.sourceEndIndex += after.length;
3433
+ after = "";
3434
+ balanced -= 1;
3435
+ stack[stack.length - 1].sourceEndIndex = pos;
3436
+ stack.pop();
3437
+ parent = stack[balanced];
3438
+ tokens = parent.nodes;
3439
+
3440
+ // Words
3441
+ } else {
3442
+ next = pos;
3443
+ do {
3444
+ if (code === backslash) {
3445
+ next += 1;
3446
+ }
3447
+ next += 1;
3448
+ code = value.charCodeAt(next);
3449
+ } while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
3450
+ token = value.slice(pos, next);
3451
+ if (openParentheses === code) {
3452
+ name = token;
3453
+ } else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) {
3454
+ tokens.push({
3455
+ type: "unicode-range",
3456
+ sourceIndex: pos,
3457
+ sourceEndIndex: next,
3458
+ value: token
3459
+ });
3460
+ } else {
3461
+ tokens.push({
3462
+ type: "word",
3463
+ sourceIndex: pos,
3464
+ sourceEndIndex: next,
3465
+ value: token
3466
+ });
3467
+ }
3468
+ pos = next;
3481
3469
  }
3482
- })
3483
- });
3484
- const hover = key => {
3485
- const bg = {
3486
- [colors.neutral100]: colors.neutral100,
3487
- [colors.brand]: colors.bgPrimaryHover,
3488
- [colors.disabledText]: colors.disabledText,
3489
- [colors.neutral300]: colors.neutral300,
3490
- [colors.link2]: colors.link2Hover,
3491
- [colors.neutral100]: colors.neutral100,
3492
- [colors.neutral900]: colors.neutral900,
3493
- [colors.superGrey700]: colors.superGrey700,
3494
- [colors.superGrey300]: colors.superGrey300,
3495
- [colors.superGrey800]: colors.superGrey800,
3496
- [colors.superGreen500]: colors.superGreen500
3497
- };
3498
- return bg[key];
3470
+ }
3471
+ for (pos = stack.length - 1; pos; pos -= 1) {
3472
+ stack[pos].unclosed = true;
3473
+ stack[pos].sourceEndIndex = value.length;
3474
+ }
3475
+ return stack[0].nodes;
3499
3476
  };
3500
- Object.assign(Object.assign({}, BaseTheme), {
3501
- color: Object.assign(Object.assign({}, BaseTheme.color), {
3502
- text: Object.assign(Object.assign({}, BaseTheme.color.text), {
3503
- primary: colors.superGrey800,
3504
- secondary: colors.superGrey500,
3505
- tertiary: colors.superGrey400,
3506
- warning: colors.systemRed500,
3507
- disabled: colors.superGrey400,
3508
- subHeading: colors.superGrey400,
3509
- success: colors.systemGreen500,
3510
- link: colors.superBlue500,
3511
- link2: colors.superBlue500
3512
- }),
3513
- button: Object.assign(Object.assign({}, BaseTheme.color.button), {
3514
- outlinedPrimaryLabel: colors.superGrey700,
3515
- outlinedPrimaryBorder: colors.superGrey300,
3516
- outlinedTertiaryLabel: colors.superGrey700,
3517
- outlinedTertiaryBorder: colors.superGrey300,
3518
- outlinedDisabledLabel: colors.disabledText,
3519
- containedSecondaryLabel: colors.superGrey800,
3520
- containedPrimaryBg: colors.superBlue500,
3521
- containedSecondaryBg: colors.superGreen500,
3522
- containedTertiaryLabel: colors.superGrey300,
3523
- containedDisabledLabel: colors.disabledText,
3524
- containedPrimaryLabel: colors.neutral100,
3525
- hover: hover
3526
- }),
3527
- chip: Object.assign(Object.assign({}, BaseTheme.color.chip), {
3528
- selectedPrimaryLabel: colors.superBlue500,
3529
- selectedPrimaryBorder: colors.superBlue500,
3530
- selectedPrimaryBg: colors.superBlue25,
3531
- disabledPrimaryLabel: colors.superGrey400,
3532
- nonSelectedPrimaryLabel: colors.superGrey700,
3533
- disabledPrimaryBg: colors.superGrey200
3534
- }),
3535
- tab: Object.assign(Object.assign({}, BaseTheme.color.tab), {
3536
- nonSelectedPrimaryLabel: colors.superGrey500,
3537
- selectedPrimaryLabel: colors.superBlue500
3538
- }),
3539
- background: Object.assign(Object.assign({}, BaseTheme.color.background), {
3540
- primary: colors.superBlue500,
3541
- disabled: colors.superGrey50,
3542
- disabledDark: colors.superGrey300,
3543
- warning: colors.systemRed500
3544
- }),
3545
- border: Object.assign(Object.assign({}, BaseTheme.color.border), {
3546
- primary: colors.superBlue500,
3547
- secondary: colors.neutral900,
3548
- disabledDark: colors.superGrey300,
3549
- defaultDark: colors.superGrey400,
3550
- default: colors.superGrey300,
3551
- disabled: colors.superGrey200
3552
- })
3553
- })
3554
- });
3555
- Object.assign(Object.assign({}, B2CTheme), {
3556
- typography: Object.assign(Object.assign({}, B2CTheme.typography), {
3557
- fontFamily: 'Manrope'
3558
- })
3559
- });
3560
- const ThemeContext = React.createContext({
3561
- theme: B2CTheme,
3562
- platform: 'mobile'
3563
- });
3564
- const useTheme = () => {
3565
- const themeContext = React.useContext(ThemeContext);
3566
- const {
3567
- theme
3568
- } = themeContext || {
3569
- theme: B2CTheme
3570
- };
3571
- return theme;
3477
+
3478
+ var walk$1 = function walk(nodes, cb, bubble) {
3479
+ var i, max, node, result;
3480
+ for (i = 0, max = nodes.length; i < max; i += 1) {
3481
+ node = nodes[i];
3482
+ if (!bubble) {
3483
+ result = cb(node, i, nodes);
3484
+ }
3485
+ if (result !== false && node.type === "function" && Array.isArray(node.nodes)) {
3486
+ walk(node.nodes, cb, bubble);
3487
+ }
3488
+ if (bubble) {
3489
+ cb(node, i, nodes);
3490
+ }
3491
+ }
3572
3492
  };
3573
- class ThemeManagerClass {
3574
- constructor() {
3575
- if (ThemeManagerClass.instance) {
3576
- throw new Error('You can only create one instance!');
3493
+
3494
+ function stringifyNode(node, custom) {
3495
+ var type = node.type;
3496
+ var value = node.value;
3497
+ var buf;
3498
+ var customResult;
3499
+ if (custom && (customResult = custom(node)) !== undefined) {
3500
+ return customResult;
3501
+ } else if (type === "word" || type === "space") {
3502
+ return value;
3503
+ } else if (type === "string") {
3504
+ buf = node.quote || "";
3505
+ return buf + value + (node.unclosed ? "" : buf);
3506
+ } else if (type === "comment") {
3507
+ return "/*" + value + (node.unclosed ? "" : "*/");
3508
+ } else if (type === "div") {
3509
+ return (node.before || "") + value + (node.after || "");
3510
+ } else if (Array.isArray(node.nodes)) {
3511
+ buf = stringify$1(node.nodes, custom);
3512
+ if (type !== "function") {
3513
+ return buf;
3577
3514
  }
3578
- ThemeManagerClass.instance = this;
3579
- this.theme = B2CTheme;
3515
+ return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
3580
3516
  }
3581
- set(theme) {
3582
- switch (theme) {
3583
- case 'B2C':
3584
- default:
3585
- {
3586
- this.theme = B2CTheme;
3517
+ return value;
3518
+ }
3519
+ function stringify$1(nodes, custom) {
3520
+ var result, i;
3521
+ if (Array.isArray(nodes)) {
3522
+ result = "";
3523
+ for (i = nodes.length - 1; ~i; i -= 1) {
3524
+ result = stringifyNode(nodes[i], custom) + result;
3525
+ }
3526
+ return result;
3527
+ }
3528
+ return stringifyNode(nodes, custom);
3529
+ }
3530
+ var stringify_1 = stringify$1;
3531
+
3532
+ var unit;
3533
+ var hasRequiredUnit;
3534
+ function requireUnit() {
3535
+ if (hasRequiredUnit) return unit;
3536
+ hasRequiredUnit = 1;
3537
+ var minus = "-".charCodeAt(0);
3538
+ var plus = "+".charCodeAt(0);
3539
+ var dot = ".".charCodeAt(0);
3540
+ var exp = "e".charCodeAt(0);
3541
+ var EXP = "E".charCodeAt(0);
3542
+
3543
+ // Check if three code points would start a number
3544
+ // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number
3545
+ function likeNumber(value) {
3546
+ var code = value.charCodeAt(0);
3547
+ var nextCode;
3548
+ if (code === plus || code === minus) {
3549
+ nextCode = value.charCodeAt(1);
3550
+ if (nextCode >= 48 && nextCode <= 57) {
3551
+ return true;
3552
+ }
3553
+ var nextNextCode = value.charCodeAt(2);
3554
+ if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) {
3555
+ return true;
3556
+ }
3557
+ return false;
3558
+ }
3559
+ if (code === dot) {
3560
+ nextCode = value.charCodeAt(1);
3561
+ if (nextCode >= 48 && nextCode <= 57) {
3562
+ return true;
3563
+ }
3564
+ return false;
3565
+ }
3566
+ if (code >= 48 && code <= 57) {
3567
+ return true;
3568
+ }
3569
+ return false;
3570
+ }
3571
+
3572
+ // Consume a number
3573
+ // https://www.w3.org/TR/css-syntax-3/#consume-number
3574
+ unit = function (value) {
3575
+ var pos = 0;
3576
+ var length = value.length;
3577
+ var code;
3578
+ var nextCode;
3579
+ var nextNextCode;
3580
+ if (length === 0 || !likeNumber(value)) {
3581
+ return false;
3582
+ }
3583
+ code = value.charCodeAt(pos);
3584
+ if (code === plus || code === minus) {
3585
+ pos++;
3586
+ }
3587
+ while (pos < length) {
3588
+ code = value.charCodeAt(pos);
3589
+ if (code < 48 || code > 57) {
3590
+ break;
3591
+ }
3592
+ pos += 1;
3593
+ }
3594
+ code = value.charCodeAt(pos);
3595
+ nextCode = value.charCodeAt(pos + 1);
3596
+ if (code === dot && nextCode >= 48 && nextCode <= 57) {
3597
+ pos += 2;
3598
+ while (pos < length) {
3599
+ code = value.charCodeAt(pos);
3600
+ if (code < 48 || code > 57) {
3587
3601
  break;
3588
3602
  }
3603
+ pos += 1;
3604
+ }
3589
3605
  }
3606
+ code = value.charCodeAt(pos);
3607
+ nextCode = value.charCodeAt(pos + 1);
3608
+ nextNextCode = value.charCodeAt(pos + 2);
3609
+ if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
3610
+ pos += nextCode === plus || nextCode === minus ? 3 : 2;
3611
+ while (pos < length) {
3612
+ code = value.charCodeAt(pos);
3613
+ if (code < 48 || code > 57) {
3614
+ break;
3615
+ }
3616
+ pos += 1;
3617
+ }
3618
+ }
3619
+ return {
3620
+ number: value.slice(0, pos),
3621
+ unit: value.slice(pos)
3622
+ };
3623
+ };
3624
+ return unit;
3625
+ }
3626
+
3627
+ var parse = parse$1;
3628
+ var walk = walk$1;
3629
+ var stringify = stringify_1;
3630
+ function ValueParser(value) {
3631
+ if (this instanceof ValueParser) {
3632
+ this.nodes = parse(value);
3633
+ return this;
3590
3634
  }
3591
- get() {
3592
- return this.theme;
3593
- }
3635
+ return new ValueParser(value);
3594
3636
  }
3595
- const ThemeManager = Object.freeze(new ThemeManagerClass());
3637
+ ValueParser.prototype.toString = function () {
3638
+ return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
3639
+ };
3640
+ ValueParser.prototype.walk = function (cb, bubble) {
3641
+ walk(this.nodes, cb, bubble);
3642
+ return this;
3643
+ };
3644
+ ValueParser.unit = requireUnit();
3645
+ ValueParser.walk = walk;
3646
+ ValueParser.stringify = stringify;
3647
+ var lib = ValueParser;
3596
3648
 
3597
3649
  const useStableMemo = (callback, deps) => {
3598
3650
  return React.useMemo(() => {