@splunk/react-ui 5.8.0 → 5.9.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.
Files changed (69) hide show
  1. package/Anchor.js +2 -1
  2. package/ButtonSimple.js +1 -1
  3. package/CHANGELOG.md +38 -0
  4. package/Calendar.js +134 -134
  5. package/Clickable.js +131 -94
  6. package/Code.js +177 -170
  7. package/CollapsiblePanel.js +173 -135
  8. package/ColumnLayout.js +69 -45
  9. package/ComboBox.js +1 -0
  10. package/Dropdown.js +87 -72
  11. package/File.js +35 -35
  12. package/LICENSE +1 -1
  13. package/MIGRATION.md +40 -0
  14. package/Markdown.js +331 -306
  15. package/Menu.js +259 -215
  16. package/Modal.js +174 -181
  17. package/Monogram.js +2 -2
  18. package/Multiselect.js +414 -334
  19. package/Number.js +237 -242
  20. package/Search.js +15 -14
  21. package/SelectBase.js +777 -719
  22. package/SimpleTable.d.ts +2 -0
  23. package/SimpleTable.js +433 -0
  24. package/SlidingPanels.js +224 -153
  25. package/SpotLight.d.ts +2 -0
  26. package/SpotLight.js +687 -0
  27. package/Table.js +1232 -1238
  28. package/Text.js +26 -26
  29. package/docker-compose.yml +12 -18
  30. package/docs-llm/Avatar.md +2 -8
  31. package/docs-llm/Collapsible Panel.md +11 -57
  32. package/docs-llm/Column Layout.md +2 -2
  33. package/docs-llm/Divider.md +33 -0
  34. package/docs-llm/Message Bar.md +4 -1
  35. package/docs-llm/Multiselect.md +185 -162
  36. package/docs-llm/Notifications.md +46 -0
  37. package/docs-llm/Table.md +7 -7
  38. package/docs-llm/Tree.md +7 -2
  39. package/docs-llm/Typography.md +1 -1
  40. package/docs-llm/llms.txt +7 -3
  41. package/package.json +9 -11
  42. package/test-runner-jest.config.js +4 -53
  43. package/types/src/CollapsiblePanel/docs/examples/Actions.d.ts +1 -1
  44. package/types/src/ColumnLayout/ColumnLayout.d.ts +2 -2
  45. package/types/src/Divider/docs/examples/VerticalWithAlignItems.d.ts +8 -0
  46. package/types/src/Markdown/Markdown.d.ts +14 -2
  47. package/types/src/Markdown/renderers/MarkdownTable.d.ts +2 -22
  48. package/types/src/Markdown/renderers/MarkdownWrapper.d.ts +11 -0
  49. package/types/src/Markdown/renderers/index.d.ts +3 -1
  50. package/types/src/Multiselect/Compact.d.ts +12 -3
  51. package/types/src/Multiselect/Multiselect.d.ts +12 -3
  52. package/types/src/Multiselect/Normal.d.ts +8 -3
  53. package/types/src/Multiselect/Option.d.ts +6 -3
  54. package/types/src/Multiselect/docs/examples/Disabled.d.ts +1 -0
  55. package/types/src/Multiselect/docs/examples/LoadMoreWithSelectAll.d.ts +9 -0
  56. package/types/src/SelectBase/SelectBase.d.ts +5 -1
  57. package/types/src/SimpleTable/Body.d.ts +25 -0
  58. package/types/src/SimpleTable/Cell.d.ts +20 -0
  59. package/types/src/SimpleTable/Head.d.ts +20 -0
  60. package/types/src/SimpleTable/HeadCell.d.ts +20 -0
  61. package/types/src/SimpleTable/Row.d.ts +20 -0
  62. package/types/src/SimpleTable/SimpleTable.d.ts +37 -0
  63. package/types/src/SimpleTable/index.d.ts +3 -0
  64. package/types/src/SpotLight/SpotLight.d.ts +88 -0
  65. package/types/src/SpotLight/index.d.ts +2 -0
  66. package/types/src/Table/Row.d.ts +1 -1
  67. package/types/src/Table/Table.d.ts +1 -1
  68. package/types/src/Typography/Typography.d.ts +1 -1
  69. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +0 -7
package/Code.js CHANGED
@@ -837,11 +837,11 @@
837
837
  var b = m.inside;
838
838
  var h = !!m.lookbehind;
839
839
  var v = !!m.greedy;
840
- var E = m.alias;
840
+ var y = m.alias;
841
841
  if (v && !m.pattern.global) {
842
842
  // Without the global flag, lastIndex won't work
843
- var y = m.pattern.toString().match(/[imsuy]*$/)[0];
844
- m.pattern = RegExp(m.pattern.source, y + "g");
843
+ var E = m.pattern.toString().match(/[imsuy]*$/)[0];
844
+ m.pattern = RegExp(m.pattern.source, E + "g");
845
845
  }
846
846
  /** @type {RegExp} */ var S = m.pattern || m;
847
847
  for (// iterate the token list and keep track of the current token/string position
@@ -911,7 +911,7 @@
911
911
  k += L.length;
912
912
  }
913
913
  p(t, D, T);
914
- var P = new i(d, b ? s.tokenize(_, b) : _, E, _);
914
+ var P = new i(d, b ? s.tokenize(_, b) : _, y, _);
915
915
  A = c(t, D, P);
916
916
  if (F) {
917
917
  c(t, A, F);
@@ -2283,8 +2283,8 @@
2283
2283
  var b = t(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source, [ f, m ]);
2284
2284
  var h = t(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source, [ c, p, m ]);
2285
2285
  var v = t(/\(<<0>>+(?:,<<0>>+)+\)/.source, [ h ]);
2286
- var E = t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ v, f, m ]);
2287
- var y = {
2286
+ var y = t(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source, [ v, f, m ]);
2287
+ var E = {
2288
2288
  keyword: o,
2289
2289
  punctuation: /[<>()?,.:[\]]/
2290
2290
  };
@@ -2310,13 +2310,13 @@
2310
2310
  // using static System.Math;
2311
2311
  pattern: n(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source, [ f ]),
2312
2312
  lookbehind: true,
2313
- inside: y
2313
+ inside: E
2314
2314
  }, {
2315
2315
  // Using alias (type)
2316
2316
  // using Project = PC.MyCompany.Project;
2317
- pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ d, E ]),
2317
+ pattern: n(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source, [ d, y ]),
2318
2318
  lookbehind: true,
2319
- inside: y
2319
+ inside: E
2320
2320
  }, {
2321
2321
  // Using alias (alias)
2322
2322
  // using Project = PC.MyCompany.Project;
@@ -2328,14 +2328,14 @@
2328
2328
  // interface Foo<out A, B>
2329
2329
  pattern: n(/(\b<<0>>\s+)<<1>>/.source, [ i, g ]),
2330
2330
  lookbehind: true,
2331
- inside: y
2331
+ inside: E
2332
2332
  }, {
2333
2333
  // Single catch exception declaration
2334
2334
  // catch(Foo)
2335
2335
  // (things like catch(Foo e) is covered by variable declaration)
2336
2336
  pattern: n(/(\bcatch\s*\(\s*)<<0>>/.source, [ f ]),
2337
2337
  lookbehind: true,
2338
- inside: y
2338
+ inside: E
2339
2339
  }, {
2340
2340
  // Name of the type parameter of generic constraints
2341
2341
  // where Foo : class
@@ -2347,12 +2347,12 @@
2347
2347
  // (things like if(a is Foo b) is covered by variable declaration)
2348
2348
  pattern: n(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source, [ b ]),
2349
2349
  lookbehind: true,
2350
- inside: y
2350
+ inside: E
2351
2351
  }, {
2352
2352
  // Variable, field and parameter declaration
2353
2353
  // (Foo bar, Bar baz, Foo[,,] bay, Foo<Bar, FooBar<Bar>> bax)
2354
- pattern: n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ E, u, d ]),
2355
- inside: y
2354
+ pattern: n(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source, [ y, u, d ]),
2355
+ inside: E
2356
2356
  } ],
2357
2357
  keyword: o,
2358
2358
  // https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/lexical-structure#literals
@@ -2388,21 +2388,21 @@
2388
2388
  pattern: n(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source, [ p ]),
2389
2389
  lookbehind: true,
2390
2390
  alias: "class-name",
2391
- inside: y
2391
+ inside: E
2392
2392
  },
2393
2393
  "return-type": {
2394
2394
  // Foo<Bar> ForBar(); Foo IFoo.Bar() => 0
2395
2395
  // int this[int index] => 0; T IReadOnlyList<T>.this[int index] => this[index];
2396
2396
  // int Foo => 0; int Foo { get; set } = 0;
2397
- pattern: n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ E, f ]),
2398
- inside: y,
2397
+ pattern: n(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source, [ y, f ]),
2398
+ inside: E,
2399
2399
  alias: "class-name"
2400
2400
  },
2401
2401
  "constructor-invocation": {
2402
2402
  // new List<Foo<Bar[]>> { }
2403
- pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [ E ]),
2403
+ pattern: n(/(\bnew\s+)<<0>>(?=\s*[[({])/.source, [ y ]),
2404
2404
  lookbehind: true,
2405
- inside: y,
2405
+ inside: E,
2406
2406
  alias: "class-name"
2407
2407
  },
2408
2408
  /*'explicit-implementation': {
@@ -2419,7 +2419,7 @@
2419
2419
  generic: {
2420
2420
  pattern: RegExp(c),
2421
2421
  alias: "class-name",
2422
- inside: y
2422
+ inside: E
2423
2423
  }
2424
2424
  }
2425
2425
  },
@@ -2427,7 +2427,7 @@
2427
2427
  // The list of types inherited or of generic constraints
2428
2428
  // class Foo<F> : Bar, IList<FooBar>
2429
2429
  // where F : Bar, IList<int>
2430
- pattern: n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ i, g, d, E, o.source, p, /\bnew\s*\(\s*\)/.source ]),
2430
+ pattern: n(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source, [ i, g, d, y, o.source, p, /\bnew\s*\(\s*\)/.source ]),
2431
2431
  lookbehind: true,
2432
2432
  inside: {
2433
2433
  "record-arguments": {
@@ -2438,9 +2438,9 @@
2438
2438
  },
2439
2439
  keyword: o,
2440
2440
  "class-name": {
2441
- pattern: RegExp(E),
2441
+ pattern: RegExp(y),
2442
2442
  greedy: true,
2443
- inside: y
2443
+ inside: E
2444
2444
  },
2445
2445
  punctuation: /[,()]/
2446
2446
  }
@@ -2741,7 +2741,7 @@
2741
2741
  n.r(r);
2742
2742
  // EXPORTS
2743
2743
  n.d(r, {
2744
- default: () => /* reexport */ se
2744
+ default: () => /* reexport */ ie
2745
2745
  });
2746
2746
  // CONCATENATED MODULE: external "react"
2747
2747
  const e = require("react");
@@ -2767,73 +2767,78 @@
2767
2767
  // CONCATENATED MODULE: external "@splunk/react-ui/useResizeObserver"
2768
2768
  const b = require("@splunk/react-ui/useResizeObserver");
2769
2769
  var h = n.n(b);
2770
+ // CONCATENATED MODULE: external "@splunk/ui-utils/logger"
2771
+ const v = require("@splunk/ui-utils/logger");
2770
2772
  // CONCATENATED MODULE: external "styled-components"
2771
- const v = require("styled-components");
2772
- var E = n.n(v);
2773
+ const y = require("styled-components");
2774
+ var E = n.n(y);
2773
2775
  // CONCATENATED MODULE: external "@splunk/themes"
2774
- const y = require("@splunk/themes");
2776
+ const S = require("@splunk/themes");
2775
2777
  // CONCATENATED MODULE: ./src/Code/CodeStyles.ts
2776
- var S = "lineHeightSpacious";
2777
- var A = "spacingLarge";
2778
- var k = E().code.withConfig({
2778
+ var A = "lineHeightSpacious";
2779
+ var k = "spacingLarge";
2780
+ var x = E().code.withConfig({
2779
2781
  displayName: "CodeStyles__StyledCode",
2780
2782
  componentId: "sc-1eq4k68-0"
2781
- })([ "font-family:", ";position:relative;z-index:1;", ";" ], y.variables.monoFontFamily, (function(e) {
2783
+ })([ "font-family:", ";position:relative;z-index:1;", ";" ], S.variables.monoFontFamily, (function(e) {
2782
2784
  var t = e.$isPlaintext;
2783
- return !t && (0, v.css)([ "color:", ";" ], y.variables.syntaxTeal);
2785
+ return !t && (0, S.pick)({
2786
+ light: (0, y.css)([ "color:", ";" ], S.variables.syntaxBlack),
2787
+ dark: (0, y.css)([ "color:", ";" ], S.variables.syntaxWhite)
2788
+ });
2784
2789
  }));
2785
- var x = E().pre.withConfig({
2790
+ var T = E().pre.withConfig({
2786
2791
  displayName: "CodeStyles__StyledPre",
2787
2792
  componentId: "sc-1eq4k68-1"
2788
- })([ "", ";", ";line-height:", ";position:relative;text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;&:focus-visible{box-shadow:", ";}", " ", ";" ], y.mixins.reset("grid"), y.mixins.typography("monoBody"), y.variables[S], y.variables.focusShadow, (function(e) {
2793
+ })([ "", ";", ";line-height:", ";position:relative;text-align:left;tab-size:4;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;hyphens:none;overflow-x:auto;&:focus-visible{box-shadow:", ";}", " ", ";" ], S.mixins.reset("grid"), S.mixins.typography("monoBody"), S.variables[A], S.variables.focusShadow, (function(e) {
2789
2794
  var t = e.$showLineNumbers, n = e.$counterReset;
2790
- return t && (0, v.css)([ "grid-template-columns:min-content auto;counter-reset:linenumber ", ";" ], n);
2795
+ return t && (0, y.css)([ "grid-template-columns:min-content auto;counter-reset:linenumber ", ";" ], n);
2791
2796
  }), (function(e) {
2792
2797
  var t = e.$containerAppearance;
2793
- return t === "none" ? (0, v.css)([ "gap:", ";" ], y.variables.spacingMedium) : (0,
2794
- v.css)([ "background-color:", ";border-radius:", ";", "{margin:", ";}" ], y.variables.neutral50, y.variables.borderRadius, /* sc-sel */ k, y.variables[A]);
2798
+ return t === "none" ? (0, y.css)([ "gap:", ";" ], S.variables.spacingMedium) : (0,
2799
+ y.css)([ "background-color:", ";border-radius:", ";", "{margin:", ";}" ], S.variables.neutral50, S.variables.borderRadius, /* sc-sel */ x, S.variables[k]);
2795
2800
  }));
2796
- var T = E().span.withConfig({
2801
+ var I = E().span.withConfig({
2797
2802
  displayName: "CodeStyles__StyledIndent",
2798
2803
  componentId: "sc-1eq4k68-2"
2799
- })([ "&:not(:last-child){background-image:linear-gradient( to left,", " 1px,transparent 1px,transparent );}" ], y.variables.syntaxGray);
2800
- var I = {
2801
- comment: y.variables.syntaxGray,
2802
- prolog: y.variables.syntaxGray,
2803
- doctype: y.variables.syntaxGray,
2804
- cdata: y.variables.syntaxGray,
2805
- punctuation: y.variables.syntaxGray,
2806
- property: y.variables.syntaxPurple,
2807
- tag: y.variables.syntaxPurple,
2808
- boolean: y.variables.syntaxPurple,
2809
- number: y.variables.syntaxPurple,
2810
- constant: y.variables.syntaxPurple,
2811
- symbol: y.variables.syntaxPurple,
2812
- deleted: y.variables.syntaxPurple,
2813
- key: y.variables.syntaxPurple,
2814
- selector: y.variables.syntaxGreen,
2815
- "attr-name": y.variables.syntaxGreen,
2816
- string: y.variables.syntaxGreen,
2817
- char: y.variables.syntaxGreen,
2818
- builtin: y.variables.syntaxGreen,
2819
- inserted: y.variables.syntaxGreen,
2820
- operator: y.variables.syntaxBrown,
2821
- entity: y.variables.syntaxBrown,
2822
- url: y.variables.syntaxBrown,
2823
- atrule: y.variables.syntaxBlue,
2824
- "attr-value": y.variables.syntaxBlue,
2825
- keyword: y.variables.syntaxBlue,
2826
- function: y.variables.syntaxRed,
2827
- regex: y.variables.syntaxOrange,
2828
- important: y.variables.syntaxOrange,
2829
- variable: y.variables.syntaxOrange
2804
+ })([ "&:not(:last-child){background-image:linear-gradient( to left,", " 1px,transparent 1px,transparent );}" ], S.variables.syntaxGray);
2805
+ var R = {
2806
+ comment: S.variables.syntaxGray,
2807
+ prolog: S.variables.syntaxGray,
2808
+ doctype: S.variables.syntaxGray,
2809
+ cdata: S.variables.syntaxGray,
2810
+ punctuation: S.variables.syntaxGray,
2811
+ property: S.variables.syntaxPurple,
2812
+ constant: S.variables.syntaxPurple,
2813
+ symbol: S.variables.syntaxPurple,
2814
+ deleted: S.variables.syntaxPurple,
2815
+ key: S.variables.syntaxPurple,
2816
+ tag: S.variables.syntaxPurple,
2817
+ boolean: S.variables.syntaxGreen,
2818
+ number: S.variables.syntaxGreen,
2819
+ selector: S.variables.syntaxGreen,
2820
+ "attr-name": S.variables.syntaxGreen,
2821
+ string: S.variables.syntaxGreen,
2822
+ char: S.variables.syntaxGreen,
2823
+ builtin: S.variables.syntaxGreen,
2824
+ inserted: S.variables.syntaxGreen,
2825
+ operator: S.variables.syntaxBrown,
2826
+ entity: S.variables.syntaxBrown,
2827
+ url: S.variables.syntaxBrown,
2828
+ atrule: S.variables.syntaxBlue,
2829
+ "attr-value": S.variables.syntaxBlue,
2830
+ keyword: S.variables.syntaxBlue,
2831
+ function: S.variables.syntaxRed,
2832
+ regex: S.variables.syntaxOrange,
2833
+ important: S.variables.syntaxOrange,
2834
+ variable: S.variables.syntaxOrange
2830
2835
  };
2831
- var R = E().span.withConfig({
2836
+ var w = E().span.withConfig({
2832
2837
  displayName: "CodeStyles__StyledToken",
2833
2838
  componentId: "sc-1eq4k68-3"
2834
2839
  })([ "color:", ";cursor:", ";opacity:", ";font-style:", ";font-weight:", ";" ], (function(e) {
2835
2840
  var t = e.partType;
2836
- return I[t];
2841
+ return R[t];
2837
2842
  }), (function(e) {
2838
2843
  var t = e.partType;
2839
2844
  return t === "entity" ? "help" : null;
@@ -2845,42 +2850,42 @@
2845
2850
  return t === "italic" ? "italic" : null;
2846
2851
  }), (function(e) {
2847
2852
  var t = e.partType;
2848
- return t === "important" || t === "bold" ? y.variables.fontWeightBold : null;
2853
+ return t === "important" || t === "bold" ? S.variables.fontWeightBold : null;
2849
2854
  }));
2850
2855
  // CONCATENATED MODULE: ./src/Code/LineHighlightsStyles.ts
2851
- var w = E().div.withConfig({
2856
+ var N = E().div.withConfig({
2852
2857
  displayName: "LineHighlightsStyles__StyledLineHighlight",
2853
2858
  componentId: "sc-1x2b02z-0"
2854
- })([ "position:absolute;left:0;height:1lh;background:", ";border-left:2px solid ", ";pointer-events:none;line-height:inherit;width:", "px;", ";" ], y.variables.notificationColorInfoWeak, y.variables.notificationColorInfo, (function(e) {
2859
+ })([ "position:absolute;left:0;height:1lh;background:", ";border-left:2px solid ", ";pointer-events:none;line-height:inherit;width:", "px;", ";" ], S.variables.notificationColorInfoWeak, S.variables.notificationColorInfo, (function(e) {
2855
2860
  var t = e.$width;
2856
2861
  return t;
2857
2862
  }), (function(e) {
2858
2863
  var t = e.$containerAppearance, n = e.$lineNum;
2859
- return t === "none" ? (0, v.css)([ "top:calc(", " * ", "em);" ], n - 1, y.variables[S]) : (0,
2860
- v.css)([ "top:calc( ", " * ", "em + ", " );" ], n - 1, y.variables[S], y.variables[A]);
2864
+ return t === "none" ? (0, y.css)([ "top:calc(", " * ", "em);" ], n - 1, S.variables[A]) : (0,
2865
+ y.css)([ "top:calc( ", " * ", "em + ", " );" ], n - 1, S.variables[A], S.variables[k]);
2861
2866
  }));
2862
2867
  // CONCATENATED MODULE: ./src/Code/LineHighlights.tsx
2863
- function N(e, t) {
2864
- return C(e) || F(e, t) || _(e, t) || O();
2868
+ function O(e, t) {
2869
+ return D(e) || C(e, t) || L(e, t) || _();
2865
2870
  }
2866
- function O() {
2871
+ function _() {
2867
2872
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2868
2873
  }
2869
- function _(e, t) {
2874
+ function L(e, t) {
2870
2875
  if (e) {
2871
- if ("string" == typeof e) return L(e, t);
2876
+ if ("string" == typeof e) return F(e, t);
2872
2877
  var n = {}.toString.call(e).slice(8, -1);
2873
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? L(e, t) : void 0;
2878
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? F(e, t) : void 0;
2874
2879
  }
2875
2880
  }
2876
- function L(e, t) {
2881
+ function F(e, t) {
2877
2882
  (null == t || t > e.length) && (t = e.length);
2878
2883
  for (var n = 0, r = Array(t); n < t; n++) {
2879
2884
  r[n] = e[n];
2880
2885
  }
2881
2886
  return r;
2882
2887
  }
2883
- function F(e, t) {
2888
+ function C(e, t) {
2884
2889
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
2885
2890
  if (null != n) {
2886
2891
  var r, a, s, i, o = [], l = !0, u = !1;
@@ -2902,21 +2907,21 @@
2902
2907
  return o;
2903
2908
  }
2904
2909
  }
2905
- function C(e) {
2910
+ function D(e) {
2906
2911
  if (Array.isArray(e)) return e;
2907
2912
  }
2908
2913
  // parseHighlightLines will turn a string like "2,4-5" into an array of ranges like [[2, 2], [4, 5]]
2909
- var D = function e(t) {
2914
+ var P = function e(t) {
2910
2915
  return t.replace(/\s+/g, "").split(",").filter(Boolean).map((function(e) {
2911
- var t = e.split("-").map(Number), n = N(t, 2), r = n[0], a = n[1];
2916
+ var t = e.split("-").map(Number), n = O(t, 2), r = n[0], a = n[1];
2912
2917
  return [ r, a || r ];
2913
2918
  }));
2914
2919
  };
2915
2920
  // Flatten the array of ranges into a single array of line numbers
2916
2921
  // example: [[2, 2], [4, 5]] will become [2, 4, 5]
2917
- var P = function e(t) {
2922
+ var $ = function e(t) {
2918
2923
  var n = t.map((function(e) {
2919
- var t = N(e, 2), n = t[0], r = t[1];
2924
+ var t = O(e, 2), n = t[0], r = t[1];
2920
2925
  return Array.from({
2921
2926
  length: r - n + 1
2922
2927
  }, (function(e, t) {
@@ -2928,14 +2933,14 @@
2928
2933
  return Array.from(new Set(n));
2929
2934
  // Remove duplicates
2930
2935
  };
2931
- var $ = function e(n) {
2936
+ var U = function e(n) {
2932
2937
  var r = n.containerAppearance, a = n.highlight, s = n.width;
2933
- var i = D(a);
2934
- var o = P(i);
2938
+ var i = P(a);
2939
+ var o = $(i);
2935
2940
 
2936
2941
  return t().createElement(t().Fragment, null, o.map((function(e) {
2937
2942
 
2938
- return t().createElement(w, {
2943
+ return t().createElement(N, {
2939
2944
  key: e,
2940
2945
  className: "line-highlight",
2941
2946
  "aria-hidden": "true",
@@ -2945,21 +2950,21 @@
2945
2950
  });
2946
2951
  })));
2947
2952
  };
2948
- /* harmony default export */ const U = $;
2953
+ /* harmony default export */ const B = U;
2949
2954
  // CONCATENATED MODULE: ./src/Code/LineNumbersStyles.ts
2950
- var B = E().span.withConfig({
2955
+ var M = E().span.withConfig({
2951
2956
  displayName: "LineNumbersStyles__StyledLineNumberRows",
2952
2957
  componentId: "sc-1h4k3dh-0"
2953
2958
  })([ "pointer-events:none;user-select:none;", ";& > span{display:block;counter-increment:linenumber;position:relative;z-index:1;&::before{display:block;content:counter(linenumber);color:", ";text-align:right;", "}}" ], (function(e) {
2954
2959
  var t = e.$containerAppearance;
2955
- return t === "none" ? (0, v.css)([ "border-right:1px solid ", ";z-index:1;" ], y.variables.borderColor) : (0,
2956
- v.css)([ "padding:", ";background-color:", ";" ], y.variables[A], y.variables.neutral200);
2957
- }), y.variables.contentColorDefault, (function(e) {
2960
+ return t === "none" ? (0, y.css)([ "border-right:1px solid ", ";z-index:1;" ], S.variables.borderColor) : (0,
2961
+ y.css)([ "padding:", ";background-color:", ";" ], S.variables[k], S.variables.neutral200);
2962
+ }), S.variables.contentColorDefault, (function(e) {
2958
2963
  var t = e.$containerAppearance;
2959
- return t === "none" && (0, v.css)([ "padding-inline-end:", ";" ], y.variables.spacingSmall);
2964
+ return t === "none" && (0, y.css)([ "padding-inline-end:", ";" ], S.variables.spacingSmall);
2960
2965
  }));
2961
2966
  // CONCATENATED MODULE: ./src/Code/LineNumbers.tsx
2962
- function M(e) {
2967
+ function G(e) {
2963
2968
  var n = e.containerAppearance, r = n === void 0 ? "none" : n, a = e.value, s = a === void 0 ? "" : a;
2964
2969
  // Use a regex to see how many lines there are in the value, then output an
2965
2970
  // empty span for each line. The numbers themselves are handled by the CSS counter.
@@ -2974,15 +2979,15 @@
2974
2979
  });
2975
2980
  }));
2976
2981
 
2977
- return t().createElement(B, {
2982
+ return t().createElement(M, {
2978
2983
  $containerAppearance: r,
2979
2984
  "aria-hidden": true
2980
2985
  }, l);
2981
2986
  }
2982
- /* harmony default export */ const G = M;
2987
+ /* harmony default export */ const j = G;
2983
2988
  // EXTERNAL MODULE: ./src/Code/prism/prism.empty
2984
- var j = n(74);
2985
- var H = n.n(j);
2989
+ var H = n(74);
2990
+ var z = n.n(H);
2986
2991
  // CONCATENATED MODULE: ./src/utils/updateReactRef.ts
2987
2992
  /**
2988
2993
  * Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
@@ -2990,7 +2995,7 @@
2990
2995
  * @param ref - The React callback or object ref. Can be `null` or `undefined`.
2991
2996
  * @param current - The new value of the ref.
2992
2997
  */
2993
- function z(e, t) {
2998
+ function W(e, t) {
2994
2999
  if (e) {
2995
3000
  if (typeof e === "function") {
2996
3001
  e(t);
@@ -3003,8 +3008,8 @@
3003
3008
  }
3004
3009
  }
3005
3010
  // CONCATENATED MODULE: ./src/Code/Code.tsx
3006
- function W() {
3007
- return W = Object.assign ? Object.assign.bind() : function(e) {
3011
+ function q() {
3012
+ return q = Object.assign ? Object.assign.bind() : function(e) {
3008
3013
  for (var t = 1; t < arguments.length; t++) {
3009
3014
  var n = arguments[t];
3010
3015
  for (var r in n) {
@@ -3012,29 +3017,29 @@
3012
3017
  }
3013
3018
  }
3014
3019
  return e;
3015
- }, W.apply(null, arguments);
3020
+ }, q.apply(null, arguments);
3016
3021
  }
3017
3022
  function Y(e, t) {
3018
- return V(e) || Z(e, t) || X(e, t) || q();
3023
+ return J(e) || V(e, t) || K(e, t) || X();
3019
3024
  }
3020
- function q() {
3025
+ function X() {
3021
3026
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3022
3027
  }
3023
- function X(e, t) {
3028
+ function K(e, t) {
3024
3029
  if (e) {
3025
- if ("string" == typeof e) return K(e, t);
3030
+ if ("string" == typeof e) return Z(e, t);
3026
3031
  var n = {}.toString.call(e).slice(8, -1);
3027
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? K(e, t) : void 0;
3032
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Z(e, t) : void 0;
3028
3033
  }
3029
3034
  }
3030
- function K(e, t) {
3035
+ function Z(e, t) {
3031
3036
  (null == t || t > e.length) && (t = e.length);
3032
3037
  for (var n = 0, r = Array(t); n < t; n++) {
3033
3038
  r[n] = e[n];
3034
3039
  }
3035
3040
  return r;
3036
3041
  }
3037
- function Z(e, t) {
3042
+ function V(e, t) {
3038
3043
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
3039
3044
  if (null != n) {
3040
3045
  var r, a, s, i, o = [], l = !0, u = !1;
@@ -3056,12 +3061,12 @@
3056
3061
  return o;
3057
3062
  }
3058
3063
  }
3059
- function V(e) {
3064
+ function J(e) {
3060
3065
  if (Array.isArray(e)) return e;
3061
3066
  }
3062
- function J(e, t) {
3067
+ function Q(e, t) {
3063
3068
  if (null == e) return {};
3064
- var n, r, a = Q(e, t);
3069
+ var n, r, a = ee(e, t);
3065
3070
  if (Object.getOwnPropertySymbols) {
3066
3071
  var s = Object.getOwnPropertySymbols(e);
3067
3072
  for (r = 0; r < s.length; r++) {
@@ -3070,7 +3075,7 @@
3070
3075
  }
3071
3076
  return a;
3072
3077
  }
3073
- function Q(e, t) {
3078
+ function ee(e, t) {
3074
3079
  if (null == e) return {};
3075
3080
  var n = {};
3076
3081
  for (var r in e) {
@@ -3085,74 +3090,76 @@
3085
3090
  // auto formatting. The import below points to an empty file which is replaced at build
3086
3091
  // time, see ./prism/build-isolated-prism.js for details.
3087
3092
  // typed as 'prismjs'
3088
- var ee = [ "bash", "c", "clike", "cpp", "cs", "csharp", "css", "html", "javascript", "js", "json", "jsx", "markup", "mathml", "plain", "plaintext", "powershell", "py", "python", "sh", "shell", "splunk-spl", "sql", "svg", "text", "ts", "tsx", "txt", "typescript", "xml", "yaml", "yml" ];
3089
- function te(e) {
3093
+ var te = [ "bash", "c", "clike", "cpp", "cs", "csharp", "css", "html", "javascript", "js", "json", "jsx", "markup", "mathml", "plain", "plaintext", "powershell", "py", "python", "sh", "shell", "splunk-spl", "sql", "svg", "text", "ts", "tsx", "txt", "typescript", "xml", "yaml", "yml" ];
3094
+ function ne(e) {
3090
3095
  return [ "plain", "plaintext", "text", "txt" ].includes(e);
3091
3096
  }
3092
- function ne(e, t) {
3093
- if (te(t)) {
3094
- return H().tokenize(e, {});
3097
+ function re(e, t) {
3098
+ if (ne(t)) {
3099
+ return z().tokenize(e, {});
3095
3100
  }
3096
- return H().tokenize(e, H().languages[t]);
3101
+ return z().tokenize(e, z().languages[t]);
3097
3102
  }
3098
- var re = {
3103
+ var ae = {
3099
3104
  containerAppearance: m().oneOf([ "none", "section" ]),
3100
3105
  elementRef: m().oneOfType([ m().func, m().object ]),
3101
3106
  indentChars: m().number,
3102
- language: m().oneOf(ee),
3103
- languageFallback: m().oneOf(ee),
3107
+ language: m().oneOf(te),
3108
+ languageFallback: m().oneOf(te),
3104
3109
  lineHighlights: m().string,
3105
3110
  lineNumberStart: m().number,
3106
3111
  showIndentGuide: m().bool,
3107
3112
  showLineNumbers: m().bool,
3108
3113
  value: m().string
3109
3114
  };
3110
- function ae(n) {
3111
- var r = n.containerAppearance, a = r === void 0 ? "none" : r, i = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, b = n.lineHighlights, v = n.lineNumberStart, E = n.showIndentGuide, y = E === void 0 ? true : E, S = n.showLineNumbers, A = n.value, I = A === void 0 ? "" : A, w = J(n, [ "containerAppearance", "elementRef", "indentChars", "language", "languageFallback", "lineHighlights", "lineNumberStart", "showIndentGuide", "showLineNumbers", "value" ]);
3115
+ function se(n) {
3116
+ var r = n.containerAppearance, a = r === void 0 ? "none" : r, i = n.elementRef, l = n.indentChars, c = l === void 0 ? 4 : l, d = n.language, f = n.languageFallback, m = f === void 0 ? "javascript" : f, b = n.lineHighlights, y = n.lineNumberStart, E = n.showIndentGuide, S = E === void 0 ? true : E, A = n.showLineNumbers, k = n.value, R = k === void 0 ? "" : k, N = Q(n, [ "containerAppearance", "elementRef", "indentChars", "language", "languageFallback", "lineHighlights", "lineNumberStart", "showIndentGuide", "showLineNumbers", "value" ]);
3112
3117
  // @docs-props-type CodePropsBase
3113
- var N = (0, e.useRef)(null);
3114
- var O = (0, e.useState)(undefined), _ = Y(O, 2), L = _[0], F = _[1];
3115
- var C = h()(N), D = C.width, P = C.height;
3116
- var $ = (0, e.useCallback)((function(e) {
3117
- z(N, e);
3118
- z(i, e);
3118
+ var O = (0, e.useRef)(null);
3119
+ var _ = (0, e.useState)(undefined), L = Y(_, 2), F = L[0], C = L[1];
3120
+ var D = h()(O), P = D.width, $ = D.height;
3121
+ var U = (0, e.useCallback)((function(e) {
3122
+ W(O, e);
3123
+ W(i, e);
3119
3124
  }), [ i ]);
3120
3125
  (0, e.useEffect)((function() {
3121
- var e = N.current;
3126
+ var e = O.current;
3122
3127
  if (e) {
3123
- var t = e.scrollHeight > Math.round(P);
3124
- var n = e.scrollWidth > Math.round(D);
3128
+ var t = e.scrollHeight > Math.round($);
3129
+ var n = e.scrollWidth > Math.round(P);
3125
3130
  var r = t || n;
3126
- F(r ? 0 : undefined);
3131
+ C(r ? 0 : undefined);
3127
3132
  }
3128
- }), [ N, D, P ]);
3129
- var B = p()(" ", c);
3130
- var M = function e(n) {
3133
+ }), [ O, P, $ ]);
3134
+ var M = p()(" ", c);
3135
+ var G = function e(n) {
3131
3136
  var r = Math.floor(n / c);
3132
3137
  var a = n % c;
3133
3138
  var s = g()(r, (function(e) {
3134
3139
 
3135
- return t().createElement(T, {
3140
+ return t().createElement(I, {
3136
3141
  key: e.toString()
3137
- }, B);
3142
+ }, M);
3138
3143
  }));
3139
3144
  if (a) {
3140
3145
  s.push(p()(" ", a));
3141
3146
  }
3142
3147
  return s;
3143
3148
  };
3144
- var j = d ? u()(ee, d) > -1 : true;
3149
+ var H = d ? u()(te, d) > -1 : true;
3145
3150
  (0, e.useEffect)((function() {
3146
3151
  // a fix for SUI-5425, where the Markdown component doesn't pass a valid language in some circumstances
3147
- if (false) {}
3148
- }), [ j, d, m ]);
3149
- var H = j && d ? d : m;
3150
- var q = ne(I, H);
3151
- var X = te(H);
3152
- var K = function e(n) {
3152
+ if (d && !H) {
3153
+ (0, v.log)("warn", "Unsupported language ".concat(d, ", falling back to ").concat(m, ". Supported languages are: ").concat(te.join(", ")));
3154
+ }
3155
+ }), [ H, d, m ]);
3156
+ var z = H && d ? d : m;
3157
+ var X = re(R, z);
3158
+ var K = ne(z);
3159
+ var Z = function e(n) {
3153
3160
  return s()(n).map((function(n, r) {
3154
3161
  if (typeof n === "string") {
3155
- if (!y) {
3162
+ if (!S) {
3156
3163
  return n;
3157
3164
  }
3158
3165
  var a = n.split("\n");
@@ -3167,7 +3174,7 @@
3167
3174
  } else {
3168
3175
  a.push( t().createElement("span", {
3169
3176
  key: "".concat(r.toString(), ":").concat(n.toString())
3170
- }, M(s[1].length)), s[2]);
3177
+ }, G(s[1].length)), s[2]);
3171
3178
  }
3172
3179
  return a;
3173
3180
  })));
@@ -3175,36 +3182,36 @@
3175
3182
  var s = typeof n.content === "string" ? n.content : e(n.content);
3176
3183
 
3177
3184
  // eslint-disable-next-line react/no-array-index-key
3178
- return t().createElement(R, {
3185
+ return t().createElement(w, {
3179
3186
  "data-part-type": n.type,
3180
3187
  partType: n.type,
3181
3188
  key: r.toString()
3182
3189
  }, s);
3183
3190
  }));
3184
3191
  };
3185
- var Z = K(q);
3192
+ var V = Z(X);
3186
3193
 
3187
- return t().createElement(x, W({
3194
+ return t().createElement(T, q({
3188
3195
  "data-test": "code",
3189
- ref: $,
3190
- tabIndex: L,
3196
+ ref: U,
3197
+ tabIndex: F,
3191
3198
  $containerAppearance: a,
3192
- $showLineNumbers: S,
3193
- $counterReset: v && v - 1
3194
- }, w), S && t().createElement(G, {
3199
+ $showLineNumbers: A,
3200
+ $counterReset: y && y - 1
3201
+ }, N), A && t().createElement(j, {
3195
3202
  containerAppearance: a,
3196
- value: I
3197
- }), t().createElement(k, {
3198
- className: "language-".concat(H),
3199
- $isPlaintext: X
3200
- }, Z), b && t().createElement(U, {
3203
+ value: R
3204
+ }), t().createElement(x, {
3205
+ className: "language-".concat(z),
3206
+ $isPlaintext: K
3207
+ }, V), b && t().createElement(B, {
3201
3208
  containerAppearance: a,
3202
- width: D,
3209
+ width: P,
3203
3210
  highlight: b
3204
3211
  }));
3205
3212
  }
3206
- ae.propTypes = re;
3207
- /* harmony default export */ const se = ae;
3213
+ se.propTypes = ae;
3214
+ /* harmony default export */ const ie = se;
3208
3215
  }) // CONCATENATED MODULE: ./src/Code/index.ts
3209
3216
  ();
3210
3217
  module.exports = r;