grep-components 1.9.0 → 1.11.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 (29) hide show
  1. package/dist/components/AppBarNavList/styles/index.d.ts +12 -2
  2. package/dist/components/AppBarProfile/styles/index.d.ts +6 -1
  3. package/dist/components/ConfirmationDialog/styles/index.d.ts +6 -1
  4. package/dist/components/ContainedLinkList/styles/index.d.ts +6 -1
  5. package/dist/components/DropdownMenu/styles/collapsable-menu-item.style.d.ts +6 -1
  6. package/dist/components/DropdownMenu/styles/dropdown-menu.style.d.ts +6 -1
  7. package/dist/components/Footer/styles/index.d.ts +6 -1
  8. package/dist/components/GDPR/styles/index.d.ts +6 -1
  9. package/dist/components/GrepCrumbs/styles/styles.d.ts +6 -1
  10. package/dist/components/GrepEditor/styles/buttonStyles.d.ts +6 -1
  11. package/dist/components/GrepEditor/styles/editorStyles.d.ts +6 -1
  12. package/dist/components/GrepEditor/styles/toolbarStyles.d.ts +6 -1
  13. package/dist/components/GrepTable/index.d.ts +6 -1
  14. package/dist/components/GrepTable/styles/index.d.ts +18 -3
  15. package/dist/components/GrepTableCard/styles/index.d.ts +6 -1
  16. package/dist/components/GreyCover/styles/index.d.ts +6 -1
  17. package/dist/components/LoadingOverlay/index.d.ts +3 -0
  18. package/dist/components/ProfileInfo/styles/index.d.ts +6 -1
  19. package/dist/components/SearchBar/styles/index.d.ts +6 -1
  20. package/dist/components/ServiceMessage/styles/index.d.ts +6 -1
  21. package/dist/components/Sidebar/styles/index.d.ts +6 -1
  22. package/dist/components/SortableTable/styles/row.style.d.ts +6 -1
  23. package/dist/components/ToC/styles/nav-tree-node.style.d.ts +6 -1
  24. package/dist/components/ToC/styles/nav-tree.style.d.ts +6 -1
  25. package/dist/components/ToC/styles/nav.style.d.ts +6 -1
  26. package/dist/index.js +256 -240
  27. package/dist/index.js.map +1 -1
  28. package/dist/styling/makeStyles.d.ts +11 -4
  29. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -429,103 +429,6 @@ var tssReact = {};
429
429
 
430
430
  var cssAndCx = {};
431
431
 
432
- var Array_prototype_find = {};
433
-
434
- /* eslint-disable @typescript-eslint/no-explicit-any */
435
- /* eslint-disable prefer-rest-params */
436
- /* eslint-disable no-var */
437
- Object.defineProperty(Array_prototype_find, "__esModule", { value: true });
438
- // https://tc39.github.io/ecma262/#sec-array.prototype.find
439
- if (!Array.prototype.find) {
440
- Object.defineProperty(Array.prototype, "find", {
441
- value: function (predicate) {
442
- // 1. Let O be ? ToObject(this value).
443
- if (this == null) {
444
- throw new TypeError('"this" is null or not defined');
445
- }
446
- var o = Object(this);
447
- // 2. Let len be ? ToLength(? Get(O, "length")).
448
- var len = o.length >>> 0;
449
- // 3. If IsCallable(predicate) is false, throw a TypeError exception.
450
- if (typeof predicate !== "function") {
451
- throw new TypeError("predicate must be a function");
452
- }
453
- // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.
454
- var thisArg = arguments[1];
455
- // 5. Let k be 0.
456
- var k = 0;
457
- // 6. Repeat, while k < len
458
- while (k < len) {
459
- // a. Let Pk be ! ToString(k).
460
- // b. Let kValue be ? Get(O, Pk).
461
- // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).
462
- // d. If testResult is true, return kValue.
463
- var kValue = o[k];
464
- if (predicate.call(thisArg, kValue, k, o)) {
465
- return kValue;
466
- }
467
- // e. Increase k by 1.
468
- k++;
469
- }
470
- // 7. Return undefined.
471
- return undefined;
472
- },
473
- configurable: true,
474
- writable: true,
475
- });
476
- }
477
-
478
- var _WeakMap = {};
479
-
480
- var _Map = {};
481
-
482
- Object.defineProperty(_Map, "__esModule", { value: true });
483
- _Map.Polyfill = _Map.LightMapImpl = void 0;
484
- class LightMapImpl {
485
- constructor() {
486
- this.record = [];
487
- }
488
- has(key) {
489
- return this.record.map(([_key]) => _key).indexOf(key) >= 0;
490
- }
491
- get(key) {
492
- const [entry] = this.record.filter(([_key]) => _key === key);
493
- if (entry === undefined) {
494
- return undefined;
495
- }
496
- return entry[1];
497
- }
498
- set(key, value) {
499
- const [entry] = this.record.filter(([_key]) => _key === key);
500
- if (entry === undefined) {
501
- this.record.push([key, value]);
502
- }
503
- else {
504
- entry[1] = value;
505
- }
506
- return this;
507
- }
508
- delete(key) {
509
- const index = this.record.map(([key]) => key).indexOf(key);
510
- if (index < 0) {
511
- return false;
512
- }
513
- this.record.splice(index, 1);
514
- return true;
515
- }
516
- keys() {
517
- return this.record.map(([key]) => key);
518
- }
519
- }
520
- _Map.LightMapImpl = LightMapImpl;
521
- _Map.Polyfill = typeof Map !== "undefined" ? Map : LightMapImpl;
522
-
523
- /* eslint-disable @typescript-eslint/ban-types */
524
- Object.defineProperty(_WeakMap, "__esModule", { value: true });
525
- _WeakMap.Polyfill = void 0;
526
- const Map_1 = _Map;
527
- _WeakMap.Polyfill = typeof WeakMap !== "undefined" ? WeakMap : Map_1.Polyfill;
528
-
529
432
  var classnames$1 = {};
530
433
 
531
434
  var assert$1 = {};
@@ -1033,7 +936,7 @@ var emotionSerialize_esm = /*#__PURE__*/Object.freeze({
1033
936
  serializeStyles: serializeStyles
1034
937
  });
1035
938
 
1036
- var require$$2$1 = /*@__PURE__*/getAugmentedNamespace(emotionSerialize_esm);
939
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(emotionSerialize_esm);
1037
940
 
1038
941
  var isBrowser$3 = typeof document !== 'undefined';
1039
942
  function getRegisteredStyles(registered, registeredStyles, classNames) {
@@ -1094,17 +997,17 @@ var emotionUtils_esm = /*#__PURE__*/Object.freeze({
1094
997
  registerStyles: registerStyles
1095
998
  });
1096
999
 
1097
- var require$$3$1 = /*@__PURE__*/getAugmentedNamespace(emotionUtils_esm);
1000
+ var require$$2$1 = /*@__PURE__*/getAugmentedNamespace(emotionUtils_esm);
1098
1001
 
1099
1002
  var useGuaranteedMemo$1 = {};
1100
1003
 
1101
1004
  Object.defineProperty(useGuaranteedMemo$1, "__esModule", { value: true });
1102
1005
  useGuaranteedMemo$1.useGuaranteedMemo = void 0;
1103
- const react_1$2 = React__default;
1006
+ const react_1$4 = React__default;
1104
1007
  /** Like react's useMemo but with guarantee that the fn
1105
1008
  * won't be invoked again if deps hasn't change */
1106
1009
  function useGuaranteedMemo(fn, deps) {
1107
- const ref = (0, react_1$2.useRef)();
1010
+ const ref = (0, react_1$4.useRef)();
1108
1011
  if (!ref.current ||
1109
1012
  deps.length !== ref.current.prevDeps.length ||
1110
1013
  ref.current.prevDeps.map((v, i) => v === deps[i]).indexOf(false) >= 0) {
@@ -2432,50 +2335,69 @@ var emotionCache_esm = /*#__PURE__*/Object.freeze({
2432
2335
 
2433
2336
  var require$$2 = /*@__PURE__*/getAugmentedNamespace(emotionCache_esm);
2434
2337
 
2435
- (function (exports) {
2436
2338
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
2437
2339
  return (mod && mod.__esModule) ? mod : { "default": mod };
2438
2340
  };
2439
- var _a;
2440
- Object.defineProperty(exports, "__esModule", { value: true });
2441
- exports.TssCacheProvider = exports.useTssEmotionCache = exports.getDoExistsTssDefaultEmotionCacheMemoizedValue = exports.getTssDefaultEmotionCache = void 0;
2442
- const jsx_runtime_1 = require$$0;
2443
- const react_1 = React__default;
2444
- const cache_1 = __importDefault(require$$2);
2445
- _a = (() => {
2446
- let cache = undefined;
2447
- /**
2448
- * Lazily initialized singleton
2449
- * If doReset is set to true the memoized instance will be
2450
- * discarded and a new one created.
2451
- * */
2452
- function getTssDefaultEmotionCache(params) {
2453
- const { doReset = false } = params !== null && params !== void 0 ? params : {};
2454
- if (doReset) {
2455
- cache = undefined;
2456
- }
2457
- if (cache === undefined) {
2458
- cache = (0, cache_1.default)({ "key": "tss" });
2459
- }
2460
- return cache;
2341
+ Object.defineProperty(cache, "__esModule", { value: true });
2342
+ cache.TssCacheProvider = cache.useTssEmotionCache = cache.getTssDefaultEmotionCache = cache.getDoExistsTssDefaultEmotionCacheMemoizedValue = void 0;
2343
+ const jsx_runtime_1$2 = require$$0;
2344
+ const react_1$3 = React__default;
2345
+ const cache_1$1 = __importDefault(require$$2);
2346
+ const { getDoExistsTssDefaultEmotionCacheMemoizedValue, getTssDefaultEmotionCache, reactContext, } = (() => {
2347
+ const propertyKey = "__tss-react_context";
2348
+ const peerDepObj =
2349
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2350
+ react_1$3.createContext;
2351
+ let sharedContext = peerDepObj["__tss-react_context"];
2352
+ if (sharedContext === undefined) {
2353
+ const { getTssDefaultEmotionCache, getDoExistsTssDefaultEmotionCacheMemoizedValue, } = (() => {
2354
+ let cache = undefined;
2355
+ /**
2356
+ * Lazily initialized singleton
2357
+ * If doReset is set to true the memoized instance will be
2358
+ * discarded and a new one created.
2359
+ * */
2360
+ function getTssDefaultEmotionCache(params) {
2361
+ const { doReset = false } = params !== null && params !== void 0 ? params : {};
2362
+ if (doReset) {
2363
+ cache = undefined;
2364
+ }
2365
+ if (cache === undefined) {
2366
+ cache = (0, cache_1$1.default)({ "key": "tss" });
2367
+ }
2368
+ return cache;
2369
+ }
2370
+ return {
2371
+ getTssDefaultEmotionCache,
2372
+ "getDoExistsTssDefaultEmotionCacheMemoizedValue": () => cache !== undefined,
2373
+ };
2374
+ })();
2375
+ sharedContext = {
2376
+ getTssDefaultEmotionCache,
2377
+ getDoExistsTssDefaultEmotionCacheMemoizedValue,
2378
+ "reactContext": (0, react_1$3.createContext)(undefined),
2379
+ };
2380
+ Object.defineProperty(peerDepObj, propertyKey, {
2381
+ "configurable": false,
2382
+ "enumerable": false,
2383
+ "writable": false,
2384
+ "value": sharedContext,
2385
+ });
2461
2386
  }
2462
- return {
2463
- getTssDefaultEmotionCache,
2464
- "getDoExistsTssDefaultEmotionCacheMemoizedValue": () => cache !== undefined,
2465
- };
2466
- })(), exports.getTssDefaultEmotionCache = _a.getTssDefaultEmotionCache, exports.getDoExistsTssDefaultEmotionCacheMemoizedValue = _a.getDoExistsTssDefaultEmotionCacheMemoizedValue;
2467
- const context = (0, react_1.createContext)(undefined);
2387
+ return sharedContext;
2388
+ })();
2389
+ cache.getDoExistsTssDefaultEmotionCacheMemoizedValue = getDoExistsTssDefaultEmotionCacheMemoizedValue;
2390
+ cache.getTssDefaultEmotionCache = getTssDefaultEmotionCache;
2468
2391
  function useTssEmotionCache() {
2469
- const cacheExplicitlyProvidedForTss = (0, react_1.useContext)(context);
2470
- return cacheExplicitlyProvidedForTss !== null && cacheExplicitlyProvidedForTss !== void 0 ? cacheExplicitlyProvidedForTss : (0, exports.getTssDefaultEmotionCache)();
2392
+ const cacheExplicitlyProvidedForTss = (0, react_1$3.useContext)(reactContext);
2393
+ return cacheExplicitlyProvidedForTss !== null && cacheExplicitlyProvidedForTss !== void 0 ? cacheExplicitlyProvidedForTss : getTssDefaultEmotionCache();
2471
2394
  }
2472
- exports.useTssEmotionCache = useTssEmotionCache;
2395
+ cache.useTssEmotionCache = useTssEmotionCache;
2473
2396
  function TssCacheProvider(props) {
2474
2397
  const { children, value } = props;
2475
- return (0, jsx_runtime_1.jsx)(context.Provider, Object.assign({ value: value }, { children: children }), void 0);
2398
+ return ((0, jsx_runtime_1$2.jsx)(reactContext.Provider, Object.assign({ value: value }, { children: children })));
2476
2399
  }
2477
- exports.TssCacheProvider = TssCacheProvider;
2478
- }(cache));
2400
+ cache.TssCacheProvider = TssCacheProvider;
2479
2401
 
2480
2402
  var types = {};
2481
2403
 
@@ -2492,15 +2414,12 @@ types.matchCSSObject = matchCSSObject;
2492
2414
  (function (exports) {
2493
2415
  Object.defineProperty(exports, "__esModule", { value: true });
2494
2416
  exports.useCssAndCx = exports.createCssAndCx = void 0;
2495
-
2496
- const WeakMap_1 = _WeakMap;
2497
2417
  const classnames_1 = classnames$1;
2498
- const serialize_1 = require$$2$1;
2499
- const utils_1 = require$$3$1;
2418
+ const serialize_1 = require$$1;
2419
+ const utils_1 = require$$2$1;
2500
2420
  const useGuaranteedMemo_1 = useGuaranteedMemo$1;
2501
2421
  const cache_1 = cache;
2502
2422
  const types_1 = types;
2503
- const refPropertyName = "ref";
2504
2423
  exports.createCssAndCx = (() => {
2505
2424
  function merge(registered, css, className) {
2506
2425
  const registeredStyles = [];
@@ -2513,31 +2432,9 @@ exports.createCssAndCx = (() => {
2513
2432
  function createCssAndCx(params) {
2514
2433
  const { cache } = params;
2515
2434
  const css = (...args) => {
2516
- let ref = undefined;
2517
- scope: {
2518
- if (args.length !== 1) {
2519
- break scope;
2520
- }
2521
- const [arg] = args;
2522
- if (!(arg instanceof Object)) {
2523
- break scope;
2524
- }
2525
- if (!(refPropertyName in arg)) {
2526
- break scope;
2527
- }
2528
- const mostLikelyRef = arg[refPropertyName];
2529
- if (typeof mostLikelyRef !== "string" &&
2530
- mostLikelyRef !== undefined) {
2531
- break scope;
2532
- }
2533
- ref = mostLikelyRef;
2534
- const argCopy = Object.assign({}, arg);
2535
- delete argCopy[refPropertyName];
2536
- args = [argCopy];
2537
- }
2538
2435
  const serialized = (0, serialize_1.serializeStyles)(args, cache.registered);
2539
2436
  (0, utils_1.insertStyles)(cache, serialized, false);
2540
- const className = `${cache.key}-${serialized.name}${ref === undefined ? "" : ` ${ref}`}`;
2437
+ const className = `${cache.key}-${serialized.name}`;
2541
2438
  scope: {
2542
2439
  const arg = args[0];
2543
2440
  if (!(0, types_1.matchCSSObject)(arg)) {
@@ -2566,7 +2463,7 @@ function useCssAndCx() {
2566
2463
  exports.useCssAndCx = useCssAndCx;
2567
2464
  // https://github.com/garronej/tss-react/issues/27
2568
2465
  const increaseSpecificityToTakePrecedenceOverMediaQuerries = (() => {
2569
- const cssObjectMapByCache = new WeakMap_1.Polyfill();
2466
+ const cssObjectMapByCache = new WeakMap();
2570
2467
  return {
2571
2468
  "saveClassNameCSSObjectMapping": (cache, className, cssObject) => {
2572
2469
  let cssObjectMap = cssObjectMapByCache.get(cache);
@@ -2586,8 +2483,11 @@ const increaseSpecificityToTakePrecedenceOverMediaQuerries = (() => {
2586
2483
  let out;
2587
2484
  if (!isThereAnyMediaQueriesInPreviousClasses) {
2588
2485
  out = className;
2589
- if (Object.keys(cssObject).find(key => key.startsWith("@media")) !== undefined) {
2590
- isThereAnyMediaQueriesInPreviousClasses = true;
2486
+ for (const key in cssObject) {
2487
+ if (key.startsWith("@media")) {
2488
+ isThereAnyMediaQueriesInPreviousClasses = true;
2489
+ break;
2490
+ }
2591
2491
  }
2592
2492
  }
2593
2493
  else {
@@ -2614,27 +2514,7 @@ const increaseSpecificityToTakePrecedenceOverMediaQuerries = (() => {
2614
2514
  })();
2615
2515
  }(cssAndCx));
2616
2516
 
2617
- var makeStyles$1 = {};
2618
-
2619
- var Object_fromEntries = {};
2620
-
2621
- /* eslint-disable @typescript-eslint/no-explicit-any */
2622
- Object.defineProperty(Object_fromEntries, "__esModule", { value: true });
2623
- Object_fromEntries.objectFromEntries = void 0;
2624
- Object_fromEntries.objectFromEntries = !Object
2625
- .fromEntries
2626
- ? (entries) => {
2627
- if (!entries || !entries[Symbol.iterator]) {
2628
- throw new Error("Object.fromEntries() requires a single iterable argument");
2629
- }
2630
- const o = {};
2631
- Object.keys(entries).forEach(key => {
2632
- const [k, v] = entries[key];
2633
- o[k] = v;
2634
- });
2635
- return o;
2636
- }
2637
- : Object.fromEntries;
2517
+ var mergeClasses$1 = {};
2638
2518
 
2639
2519
  var objectKeys$1 = {};
2640
2520
 
@@ -2691,58 +2571,177 @@ function getDependencyArrayRef(obj) {
2691
2571
  }
2692
2572
  getDependencyArrayRef$1.getDependencyArrayRef = getDependencyArrayRef;
2693
2573
 
2574
+ /* eslint-disable @typescript-eslint/ban-types */
2575
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2576
+ Object.defineProperty(mergeClasses$1, "__esModule", { value: true });
2577
+ mergeClasses$1.useMergedClasses = mergeClasses$1.mergeClasses = void 0;
2578
+ const objectKeys_1$1 = objectKeys$1;
2579
+ const getDependencyArrayRef_1$1 = getDependencyArrayRef$1;
2580
+ const cssAndCx_1$1 = cssAndCx;
2581
+ const react_1$2 = React__default;
2582
+ function mergeClasses(classesFromUseStyles, classesFromProps, cx) {
2583
+ //NOTE: We use this test to be resilient in case classesFromProps is not of the expected type.
2584
+ if (!(classesFromProps instanceof Object)) {
2585
+ return classesFromUseStyles;
2586
+ }
2587
+ const out = {};
2588
+ (0, objectKeys_1$1.objectKeys)(classesFromUseStyles).forEach(ruleName => (out[ruleName] = cx(classesFromUseStyles[ruleName], classesFromProps[ruleName])));
2589
+ (0, objectKeys_1$1.objectKeys)(classesFromProps).forEach(ruleName => {
2590
+ if (ruleName in classesFromUseStyles) {
2591
+ return;
2592
+ }
2593
+ const className = classesFromProps[ruleName];
2594
+ //...Same here, that why we don't do className === undefined
2595
+ if (typeof className !== "string") {
2596
+ return;
2597
+ }
2598
+ out[ruleName] = className;
2599
+ });
2600
+ return out;
2601
+ }
2602
+ mergeClasses$1.mergeClasses = mergeClasses;
2603
+ function useMergedClasses(classes, classesOv) {
2604
+ const { cx } = (0, cssAndCx_1$1.useCssAndCx)();
2605
+ return (0, react_1$2.useMemo)(() => mergeClasses(classes, classesOv, cx), [classes, (0, getDependencyArrayRef_1$1.getDependencyArrayRef)(classesOv), cx]);
2606
+ }
2607
+ mergeClasses$1.useMergedClasses = useMergedClasses;
2608
+
2609
+ var makeStyles$1 = {};
2610
+
2611
+ var Object_fromEntries = {};
2612
+
2613
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2614
+ Object.defineProperty(Object_fromEntries, "__esModule", { value: true });
2615
+ Object_fromEntries.objectFromEntries = void 0;
2616
+ Object_fromEntries.objectFromEntries = !Object
2617
+ .fromEntries
2618
+ ? (entries) => {
2619
+ if (!entries || !entries[Symbol.iterator]) {
2620
+ throw new Error("Object.fromEntries() requires a single iterable argument");
2621
+ }
2622
+ const o = {};
2623
+ Object.keys(entries).forEach(key => {
2624
+ const [k, v] = entries[key];
2625
+ o[k] = v;
2626
+ });
2627
+ return o;
2628
+ }
2629
+ : Object.fromEntries;
2630
+
2694
2631
  Object.defineProperty(makeStyles$1, "__esModule", { value: true });
2695
2632
  makeStyles$1.createMakeStyles = void 0;
2633
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2696
2634
  const react_1$1 = React__default;
2697
2635
  const Object_fromEntries_1 = Object_fromEntries;
2698
2636
  const objectKeys_1 = objectKeys$1;
2699
2637
  const cssAndCx_1 = cssAndCx;
2700
2638
  const getDependencyArrayRef_1 = getDependencyArrayRef$1;
2701
- /**
2702
- * @see {@link https://github.com/garronej/tss-react}
2703
- */
2639
+ const typeGuard_1 = typeGuard$1;
2640
+ const cache_1 = cache;
2641
+ const assert_1 = assert$1;
2642
+ const mergeClasses_1 = mergeClasses$1;
2643
+ const getCounter = (() => {
2644
+ let counter = 0;
2645
+ return () => counter++;
2646
+ })();
2704
2647
  function createMakeStyles(params) {
2705
2648
  const { useTheme } = params;
2706
- const getCounter = (() => {
2707
- let counter = 0;
2708
- return () => counter++;
2709
- })();
2710
2649
  /** returns useStyle. */
2711
2650
  function makeStyles(params) {
2712
- const { label: labelOrWrappedLabel } = params !== null && params !== void 0 ? params : {};
2713
- const label = typeof labelOrWrappedLabel !== "object"
2714
- ? labelOrWrappedLabel
2715
- : Object.keys(labelOrWrappedLabel)[0];
2651
+ const { name: nameOrWrappedName } = params !== null && params !== void 0 ? params : {};
2652
+ const name = typeof nameOrWrappedName !== "object"
2653
+ ? nameOrWrappedName
2654
+ : Object.keys(nameOrWrappedName)[0];
2716
2655
  return function (cssObjectByRuleNameOrGetCssObjectByRuleName) {
2717
2656
  const getCssObjectByRuleName = typeof cssObjectByRuleNameOrGetCssObjectByRuleName ===
2718
2657
  "function"
2719
2658
  ? cssObjectByRuleNameOrGetCssObjectByRuleName
2720
2659
  : () => cssObjectByRuleNameOrGetCssObjectByRuleName;
2721
2660
  const outerCounter = getCounter();
2722
- return function useStyles(params) {
2661
+ return function useStyles(params, styleOverrides) {
2662
+ var _a, _b;
2723
2663
  const theme = useTheme();
2724
- const { cx, css } = (0, cssAndCx_1.useCssAndCx)();
2725
- return (0, react_1$1.useMemo)(() => {
2726
- const cssObjectByRuleName = getCssObjectByRuleName(theme, params, (() => {
2727
- let count = 0;
2728
- return function createRef() {
2729
- return `tss-ref${outerCounter}x${count++}${label !== undefined ? `-${label}` : ""}`;
2730
- };
2731
- })());
2664
+ const { css, cx } = (0, cssAndCx_1.useCssAndCx)();
2665
+ const cache = (0, cache_1.useTssEmotionCache)();
2666
+ let classes = (0, react_1$1.useMemo)(() => {
2667
+ const refClassesCache = {};
2668
+ const refClasses = typeof Proxy !== "undefined" &&
2669
+ new Proxy({}, {
2670
+ "get": (_target, propertyKey) => {
2671
+ if (typeof propertyKey === "symbol") {
2672
+ (0, assert_1.assert)(false);
2673
+ }
2674
+ return (refClassesCache[propertyKey] = `${cache.key}-${outerCounter}${name !== undefined ? `-${name}` : ""}-${propertyKey}-ref`);
2675
+ },
2676
+ });
2677
+ const cssObjectByRuleName = getCssObjectByRuleName(theme, params, refClasses || {});
2732
2678
  const classes = (0, Object_fromEntries_1.objectFromEntries)((0, objectKeys_1.objectKeys)(cssObjectByRuleName).map(ruleName => {
2733
2679
  const cssObject = cssObjectByRuleName[ruleName];
2734
2680
  if (!cssObject.label) {
2735
- cssObject.label = `${label !== undefined ? `${label}-` : ""}${ruleName}`;
2681
+ cssObject.label = `${name !== undefined ? `${name}-` : ""}${ruleName}`;
2736
2682
  }
2737
- return [ruleName, css(cssObject)];
2683
+ return [
2684
+ ruleName,
2685
+ `${css(cssObject)}${(0, typeGuard_1.typeGuard)(ruleName, ruleName in refClassesCache)
2686
+ ? ` ${refClassesCache[ruleName]}`
2687
+ : ""}`,
2688
+ ];
2738
2689
  }));
2739
- return {
2740
- classes,
2741
- theme,
2690
+ (0, objectKeys_1.objectKeys)(refClassesCache).forEach(ruleName => {
2691
+ if (ruleName in classes) {
2692
+ return;
2693
+ }
2694
+ classes[ruleName] =
2695
+ refClassesCache[ruleName];
2696
+ });
2697
+ return classes;
2698
+ }, [cache, css, cx, theme, (0, getDependencyArrayRef_1.getDependencyArrayRef)(params)]);
2699
+ const propsClasses = styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props.classes;
2700
+ {
2701
+ classes = (0, react_1$1.useMemo)(() => (0, mergeClasses_1.mergeClasses)(classes, propsClasses, cx), [classes, (0, getDependencyArrayRef_1.getDependencyArrayRef)(propsClasses), cx]);
2702
+ }
2703
+ {
2704
+ let cssObjectByRuleNameOrGetCssObjectByRuleName = undefined;
2705
+ try {
2706
+ cssObjectByRuleNameOrGetCssObjectByRuleName =
2707
+ name !== undefined
2708
+ ? (_b = (_a = theme.components) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.styleOverrides
2709
+ : undefined;
2710
+ // eslint-disable-next-line no-empty
2711
+ }
2712
+ catch (_c) { }
2713
+ const themeClasses = (0, react_1$1.useMemo)(() => {
2714
+ if (!cssObjectByRuleNameOrGetCssObjectByRuleName) {
2715
+ return undefined;
2716
+ }
2717
+ const themeClasses = {};
2718
+ for (const ruleName in cssObjectByRuleNameOrGetCssObjectByRuleName) {
2719
+ const cssObjectOrGetCssObject = cssObjectByRuleNameOrGetCssObjectByRuleName[ruleName];
2720
+ if (!(cssObjectOrGetCssObject instanceof Object)) {
2721
+ continue;
2722
+ }
2723
+ themeClasses[ruleName] = css(typeof cssObjectOrGetCssObject === "function"
2724
+ ? cssObjectOrGetCssObject(Object.assign({ theme, "ownerState": styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState }, styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props))
2725
+ : cssObjectOrGetCssObject);
2726
+ }
2727
+ return themeClasses;
2728
+ }, [
2729
+ cssObjectByRuleNameOrGetCssObjectByRuleName ===
2730
+ undefined
2731
+ ? undefined
2732
+ : JSON.stringify(cssObjectByRuleNameOrGetCssObjectByRuleName),
2733
+ (0, getDependencyArrayRef_1.getDependencyArrayRef)(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props),
2734
+ (0, getDependencyArrayRef_1.getDependencyArrayRef)(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState),
2742
2735
  css,
2743
- cx,
2744
- };
2745
- }, [cx, css, theme, (0, getDependencyArrayRef_1.getDependencyArrayRef)(params)]);
2736
+ ]);
2737
+ classes = (0, react_1$1.useMemo)(() => (0, mergeClasses_1.mergeClasses)(classes, themeClasses, cx), [classes, themeClasses, cx]);
2738
+ }
2739
+ return {
2740
+ classes,
2741
+ theme,
2742
+ css,
2743
+ cx,
2744
+ };
2746
2745
  };
2747
2746
  };
2748
2747
  }
@@ -2789,7 +2788,7 @@ const capitalize_1 = capitalize$1;
2789
2788
  function createWithStyles(params) {
2790
2789
  const { useTheme } = params;
2791
2790
  const { makeStyles } = (0, makeStyles_1.createMakeStyles)({ useTheme });
2792
- function withStyles(Component, cssObjectByRuleNameOrGetCssObjectByRuleName) {
2791
+ function withStyles(Component, cssObjectByRuleNameOrGetCssObjectByRuleName, params) {
2793
2792
  const Component_ = typeof Component === "string"
2794
2793
  ? (() => {
2795
2794
  const tag = Component;
@@ -2803,17 +2802,21 @@ function createWithStyles(params) {
2803
2802
  return Out;
2804
2803
  })()
2805
2804
  : Component;
2806
- const useStyles = makeStyles()(typeof cssObjectByRuleNameOrGetCssObjectByRuleName === "function"
2807
- ? (theme, props, createRef) => incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName(theme, props, createRef))
2805
+ const name = (() => {
2806
+ const { name } = Component_;
2807
+ return typeof name === "string" ? name : undefined;
2808
+ })();
2809
+ const useStyles = makeStyles((params === null || params === void 0 ? void 0 : params.name) !== undefined ? params : { name })(typeof cssObjectByRuleNameOrGetCssObjectByRuleName === "function"
2810
+ ? (theme, props, classes) => incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName(theme, props, classes))
2808
2811
  : incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName));
2809
2812
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
2810
2813
  const Out = (0, react_1.forwardRef)(function (props, ref) {
2811
- const { classes, cx } = useStyles(props);
2812
- const { className } = props, rest = __rest(props, ["className"]);
2813
- return ((0, jsx_runtime_1$1.jsx)(Component_, Object.assign({ ref: ref, className: cx(classes.root, className) }, (typeof Component === "string" ? {} : { classes }), rest), void 0));
2814
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2815
+ const { className, classes: _classes } = props, rest = __rest(props, ["className", "classes"]);
2816
+ const { classes, cx } = useStyles(props, { props });
2817
+ return ((0, jsx_runtime_1$1.jsx)(Component_, Object.assign({ ref: ref, className: cx(classes.root, className) }, (typeof Component === "string" ? {} : { classes }), rest)));
2814
2818
  });
2815
- const { name } = Component_;
2816
- if (typeof name === "string") {
2819
+ if (name !== undefined) {
2817
2820
  Object.defineProperty(Out, "name", {
2818
2821
  "value": `${name}WithStyles`,
2819
2822
  });
@@ -3865,13 +3868,17 @@ var emotionReact_esm = /*#__PURE__*/Object.freeze({
3865
3868
  withTheme: withTheme
3866
3869
  });
3867
3870
 
3868
- var require$$3 = /*@__PURE__*/getAugmentedNamespace(emotionReact_esm);
3871
+ var require$$4 = /*@__PURE__*/getAugmentedNamespace(emotionReact_esm);
3869
3872
 
3870
3873
  var GlobalStyles$1 = {};
3871
3874
 
3872
3875
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3873
3876
  if (k2 === undefined) k2 = k;
3874
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3877
+ var desc = Object.getOwnPropertyDescriptor(m, k);
3878
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3879
+ desc = { enumerable: true, get: function() { return m[k]; } };
3880
+ }
3881
+ Object.defineProperty(o, k2, desc);
3875
3882
  }) : (function(o, m, k, k2) {
3876
3883
  if (k2 === undefined) k2 = k;
3877
3884
  o[k2] = m[k];
@@ -3891,30 +3898,36 @@ var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (
3891
3898
  Object.defineProperty(GlobalStyles$1, "__esModule", { value: true });
3892
3899
  GlobalStyles$1.GlobalStyles = void 0;
3893
3900
  const jsx_runtime_1 = require$$0;
3894
- const reactEmotion = __importStar(require$$3);
3901
+ const reactEmotion = __importStar(require$$4);
3895
3902
  function GlobalStyles(props) {
3896
3903
  const { styles } = props;
3897
- return (0, jsx_runtime_1.jsx)(reactEmotion.Global, { styles: reactEmotion.css(styles) }, void 0);
3904
+ return (0, jsx_runtime_1.jsx)(reactEmotion.Global, { styles: reactEmotion.css(styles) });
3898
3905
  }
3899
3906
  GlobalStyles$1.GlobalStyles = GlobalStyles;
3900
3907
 
3901
3908
  (function (exports) {
3902
3909
  Object.defineProperty(exports, "__esModule", { value: true });
3903
- exports.createMakeAndWithStyles = exports.TssCacheProvider = exports.getTssDefaultEmotionCache = exports.GlobalStyles = exports.keyframes = exports.createWithStyles = exports.createMakeStyles = exports.useCssAndCx = void 0;
3910
+ exports.createMakeAndWithStyles = exports.TssCacheProvider = exports.getTssDefaultEmotionCache = exports.GlobalStyles = exports.keyframes = exports.createWithStyles = exports.createMakeStyles = exports.useMergedClasses = exports.useCssAndCx = void 0;
3911
+ /** @see <https://docs.tss-react.dev/api-references> */
3904
3912
  var cssAndCx_1 = cssAndCx;
3905
3913
  Object.defineProperty(exports, "useCssAndCx", { enumerable: true, get: function () { return cssAndCx_1.useCssAndCx; } });
3914
+ var mergeClasses_1 = mergeClasses$1;
3915
+ Object.defineProperty(exports, "useMergedClasses", { enumerable: true, get: function () { return mergeClasses_1.useMergedClasses; } });
3906
3916
  const makeStyles_1 = makeStyles$1;
3907
3917
  Object.defineProperty(exports, "createMakeStyles", { enumerable: true, get: function () { return makeStyles_1.createMakeStyles; } });
3908
3918
  const withStyles_1 = withStyles$1;
3909
3919
  Object.defineProperty(exports, "createWithStyles", { enumerable: true, get: function () { return withStyles_1.createWithStyles; } });
3910
- /** Reexport from @emotion/react */
3911
- var react_1 = require$$3;
3920
+ /** @see <https://docs.tss-react.dev/api-references/keyframes> */
3921
+ var react_1 = require$$4;
3912
3922
  Object.defineProperty(exports, "keyframes", { enumerable: true, get: function () { return react_1.keyframes; } });
3923
+ /** @see <https://docs.tss-react.dev/api-references/globalstyles> */
3913
3924
  var GlobalStyles_1 = GlobalStyles$1;
3914
3925
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return GlobalStyles_1.GlobalStyles; } });
3926
+ /** @see <https://docs.tss-react.dev/cache> */
3915
3927
  var cache_1 = cache;
3916
3928
  Object.defineProperty(exports, "getTssDefaultEmotionCache", { enumerable: true, get: function () { return cache_1.getTssDefaultEmotionCache; } });
3917
3929
  Object.defineProperty(exports, "TssCacheProvider", { enumerable: true, get: function () { return cache_1.TssCacheProvider; } });
3930
+ /** @see <https://docs.tss-react.dev/api-references/makestyles-usestyles> */
3918
3931
  function createMakeAndWithStyles(params) {
3919
3932
  return Object.assign(Object.assign({}, (0, makeStyles_1.createMakeStyles)(params)), (0, withStyles_1.createWithStyles)(params));
3920
3933
  }
@@ -4759,7 +4772,7 @@ var GrepTableCard = function (props) {
4759
4772
  };
4760
4773
 
4761
4774
  var LoadingOverlay = function (_a) {
4762
- var _b = _a.overlay, overlay = _b === void 0 ? 'rgba(255,255,255, .5)' : _b, show = _a.show, children = _a.children, minTime = _a.minTime, box = __rest$1(_a, ["overlay", "show", "children", "minTime"]);
4775
+ var _b = _a.overlay, overlay = _b === void 0 ? 'rgba(255,255,255, .5)' : _b, show = _a.show, children = _a.children, minTime = _a.minTime, zIndex = _a.zIndex, sx = _a.sx, box = __rest$1(_a, ["overlay", "show", "children", "minTime", "zIndex", "sx"]);
4763
4776
  var _c = __read(useState(show), 2), enabled = _c[0], setEnabled = _c[1];
4764
4777
  useEffect(function () {
4765
4778
  var timeout = setTimeout(function () { return setEnabled(show); }, show ? 0 : minTime);
@@ -4767,11 +4780,11 @@ var LoadingOverlay = function (_a) {
4767
4780
  }, [show, minTime, setEnabled]);
4768
4781
  return (React__default.createElement(Box, { position: "relative", display: "block", overflow: show ? 'hidden' : '' },
4769
4782
  children,
4770
- React__default.createElement(Box, __assign({ position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", top: 0, left: 0, height: "100%", width: "100%", zIndex: enabled ? 999 : -999, style: {
4783
+ React__default.createElement(Box, __assign({ position: "absolute", display: "flex", alignItems: "center", justifyContent: "center", top: 0, left: 0, height: "100%", width: "100%", zIndex: enabled ? (zIndex ? zIndex : 999) : -999, style: {
4771
4784
  backgroundColor: overlay,
4772
4785
  opacity: show ? 1 : 0,
4773
4786
  transition: "opacity ".concat(show ? 0 : minTime, "ms ease"),
4774
- } }, box),
4787
+ }, sx: sx }, box),
4775
4788
  React__default.createElement(CircularProgress, null))));
4776
4789
  };
4777
4790
 
@@ -5561,10 +5574,10 @@ var textStyles = {
5561
5574
  outline: 'none',
5562
5575
  fontSize: 16,
5563
5576
  };
5564
- var useStyles$6 = makeStyles()(function (_a, _props, createRef) {
5577
+ var useStyles$6 = makeStyles()(function (_a, _props, classes) {
5565
5578
  var _b;
5566
5579
  var palette = _a.palette;
5567
- var text = __assign(__assign({ ref: createRef() }, textStyles), { color: 'inherit', fontWeight: 400 });
5580
+ var text = __assign(__assign({}, textStyles), { color: 'inherit', fontWeight: 400 });
5568
5581
  return {
5569
5582
  container: {
5570
5583
  padding: 10,
@@ -5579,7 +5592,7 @@ var useStyles$6 = makeStyles()(function (_a, _props, createRef) {
5579
5592
  color: palette.primary.main,
5580
5593
  }
5581
5594
  },
5582
- _b["&:focus .".concat(text.ref)] = {
5595
+ _b["&:focus .".concat(classes.text)] = {
5583
5596
  color: palette.primary.main,
5584
5597
  outline: 'auto',
5585
5598
  },
@@ -5747,7 +5760,9 @@ function invariant$1(condition, message) {
5747
5760
  if (isProduction$2) {
5748
5761
  throw new Error(prefix$2);
5749
5762
  }
5750
- throw new Error(prefix$2 + ": " + (message || ''));
5763
+ var provided = typeof message === 'function' ? message() : message;
5764
+ var value = provided ? prefix$2 + ": " + provided : prefix$2;
5765
+ throw new Error(value);
5751
5766
  }
5752
5767
 
5753
5768
  var getRect = function getRect(_ref) {
@@ -21468,8 +21483,9 @@ var InlineButton = function (_a) {
21468
21483
  var type = _a.type; _a.editor; var children = _a.children, props = __rest$1(_a, ["type", "editor", "children"]);
21469
21484
  var classes = useButtonStyles().classes;
21470
21485
  var _b = useContext(EditorContext), state = _b.state, setState = _b.setState;
21471
- var onClick = function (e) {
21472
- e.preventDefault();
21486
+ var onClick = function (event) {
21487
+ event.preventDefault();
21488
+ var e = event;
21473
21489
  setState(UpdateStyle(state, e.currentTarget.value));
21474
21490
  };
21475
21491
  var selected = state.getCurrentInlineStyle().has(type);