@primer/react 0.0.0-20260220191813 → 0.0.0-20260220193722

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 (93) hide show
  1. package/CHANGELOG.md +26 -2
  2. package/dist/ActionList/ActionList-c04a02d6.css +2 -0
  3. package/dist/ActionList/ActionList-c04a02d6.css.map +1 -0
  4. package/dist/ActionList/ActionList.module.css.js +1 -1
  5. package/dist/ActionList/Item.d.ts.map +1 -1
  6. package/dist/ActionList/Item.js +1 -0
  7. package/dist/Autocomplete/Autocomplete.js +76 -159
  8. package/dist/Autocomplete/AutocompleteMenu.js +128 -333
  9. package/dist/Autocomplete/AutocompleteOverlay.js +49 -130
  10. package/dist/Banner/Banner.js +64 -238
  11. package/dist/Blankslate/{Blankslate-f5a9755a.css → Blankslate-a039d79a.css} +2 -2
  12. package/dist/Blankslate/Blankslate-a039d79a.css.map +1 -0
  13. package/dist/Blankslate/Blankslate.module.css.js +1 -1
  14. package/dist/Button/Button.js +11 -34
  15. package/dist/Button/ButtonBase-c973d463.css +2 -0
  16. package/dist/Button/ButtonBase-c973d463.css.map +1 -0
  17. package/dist/Button/ButtonBase.js +1 -1
  18. package/dist/Button/ButtonBase.module.css.js +1 -1
  19. package/dist/Button/IconButton.js +51 -140
  20. package/dist/Button/LinkButton.js +11 -39
  21. package/dist/Checkbox/Checkbox.js +55 -163
  22. package/dist/Dialog/Dialog.js +105 -347
  23. package/dist/FilteredActionList/FilteredActionList.d.ts +16 -1
  24. package/dist/FilteredActionList/FilteredActionList.d.ts.map +1 -1
  25. package/dist/FilteredActionList/FilteredActionList.js +147 -42
  26. package/dist/PageLayout/PageLayout-06f4c069.css +2 -0
  27. package/dist/PageLayout/PageLayout-06f4c069.css.map +1 -0
  28. package/dist/PageLayout/PageLayout.d.ts +72 -2
  29. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  30. package/dist/PageLayout/PageLayout.js +750 -1235
  31. package/dist/PageLayout/PageLayout.module.css.js +2 -2
  32. package/dist/PageLayout/usePaneWidth.d.ts +18 -5
  33. package/dist/PageLayout/usePaneWidth.d.ts.map +1 -1
  34. package/dist/PageLayout/usePaneWidth.js +125 -111
  35. package/dist/SelectPanel/SelectPanel.d.ts +1 -1
  36. package/dist/SelectPanel/SelectPanel.d.ts.map +1 -1
  37. package/dist/SelectPanel/SelectPanel.js +3 -1
  38. package/dist/SplitPageLayout/SplitPageLayout.d.ts +4 -1
  39. package/dist/SplitPageLayout/SplitPageLayout.d.ts.map +1 -1
  40. package/dist/SplitPageLayout/SplitPageLayout.js +54 -2
  41. package/dist/Text/Text.d.ts +1 -1
  42. package/dist/Text/Text.d.ts.map +1 -1
  43. package/dist/Text/Text.js +10 -13
  44. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css +2 -0
  45. package/dist/UnderlineNav/UnderlineNav-4344d9b0.css.map +1 -0
  46. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  47. package/dist/UnderlineNav/UnderlineNav.js +323 -84
  48. package/dist/UnderlineNav/UnderlineNav.module.css.js +2 -2
  49. package/dist/UnderlineNav/UnderlineNavContext.d.ts +11 -4
  50. package/dist/UnderlineNav/UnderlineNavContext.d.ts.map +1 -1
  51. package/dist/UnderlineNav/UnderlineNavContext.js +3 -2
  52. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css +2 -0
  53. package/dist/UnderlineNav/UnderlineNavItem-b65e8fd3.css.map +1 -0
  54. package/dist/UnderlineNav/UnderlineNavItem.d.ts.map +1 -1
  55. package/dist/UnderlineNav/UnderlineNavItem.js +59 -161
  56. package/dist/UnderlineNav/UnderlineNavItem.module.css.js +1 -1
  57. package/dist/UnderlineNav/styles.d.ts +16 -0
  58. package/dist/UnderlineNav/styles.d.ts.map +1 -0
  59. package/dist/UnderlineNav/styles.js +19 -0
  60. package/dist/experimental/SelectPanel2/SelectPanel.js +209 -593
  61. package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css +2 -0
  62. package/dist/experimental/UnderlinePanels/UnderlinePanels-e4b325b9.css.map +1 -0
  63. package/dist/experimental/UnderlinePanels/UnderlinePanels.module.css.js +1 -1
  64. package/dist/hooks/useRefObjectAsForwardedRef.d.ts.map +1 -1
  65. package/dist/hooks/useRefObjectAsForwardedRef.js +10 -2
  66. package/dist/hooks/useScrollFlash.d.ts.map +1 -1
  67. package/dist/hooks/useScrollFlash.js +14 -22
  68. package/dist/hooks/useSlots.d.ts +50 -6
  69. package/dist/hooks/useSlots.d.ts.map +1 -1
  70. package/dist/hooks/useSlots.js +114 -36
  71. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css +2 -0
  72. package/dist/internal/components/UnderlineTabbedInterface-4197ee28.css.map +1 -0
  73. package/dist/internal/components/UnderlineTabbedInterface.d.ts +1 -0
  74. package/dist/internal/components/UnderlineTabbedInterface.d.ts.map +1 -1
  75. package/dist/internal/components/UnderlineTabbedInterface.js +48 -41
  76. package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
  77. package/generated/components.json +194 -2
  78. package/package.json +2 -2
  79. package/dist/ActionList/ActionList-f4ac3b54.css +0 -2
  80. package/dist/ActionList/ActionList-f4ac3b54.css.map +0 -1
  81. package/dist/Blankslate/Blankslate-f5a9755a.css.map +0 -1
  82. package/dist/Button/ButtonBase-781fba8b.css +0 -2
  83. package/dist/Button/ButtonBase-781fba8b.css.map +0 -1
  84. package/dist/PageLayout/PageLayout-cb491b47.css +0 -2
  85. package/dist/PageLayout/PageLayout-cb491b47.css.map +0 -1
  86. package/dist/UnderlineNav/UnderlineNav-bec9faaa.css +0 -2
  87. package/dist/UnderlineNav/UnderlineNav-bec9faaa.css.map +0 -1
  88. package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css +0 -2
  89. package/dist/UnderlineNav/UnderlineNavItem-db9dc5d0.css.map +0 -1
  90. package/dist/experimental/UnderlinePanels/UnderlinePanels-133b9c25.css +0 -2
  91. package/dist/experimental/UnderlinePanels/UnderlinePanels-133b9c25.css.map +0 -1
  92. package/dist/internal/components/UnderlineTabbedInterface-6bea1152.css +0 -2
  93. package/dist/internal/components/UnderlineTabbedInterface-6bea1152.css.map +0 -1
@@ -0,0 +1,2 @@
1
+ .prc-UnderlinePanels-StyledUnderlineWrapper-aiLna{overflow-x:auto;overflow-y:hidden;width:100%;-webkit-overflow-scrolling:auto}.prc-UnderlinePanels-StyledUnderlineWrapper-aiLna[data-icons-visible=false] [data-component=icon]{display:none}
2
+ /*# sourceMappingURL=UnderlinePanels-e4b325b9.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/experimental/UnderlinePanels/UnderlinePanels.module.css.js"],"names":[],"mappings":"AAAA,kDAEE,eAAgB,CAChB,iBAAkB,CAFlB,UAAW,CAGX,+BACF,CAEA,kGACE,YACF","file":"UnderlinePanels-e4b325b9.css","sourcesContent":[".StyledUnderlineWrapper {\n width: 100%;\n overflow-x: auto;\n overflow-y: hidden;\n -webkit-overflow-scrolling: auto;\n}\n\n.StyledUnderlineWrapper[data-icons-visible='false'] [data-component='icon'] {\n display: none;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import './UnderlinePanels-133b9c25.css';
1
+ import './UnderlinePanels-e4b325b9.css';
2
2
 
3
3
  var classes = {"StyledUnderlineWrapper":"prc-UnderlinePanels-StyledUnderlineWrapper-aiLna"};
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"useRefObjectAsForwardedRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefObjectAsForwardedRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAGlD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAEjH"}
1
+ {"version":3,"file":"useRefObjectAsForwardedRef.d.ts","sourceRoot":"","sources":["../../src/hooks/useRefObjectAsForwardedRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAE,SAAS,EAAC,MAAM,OAAO,CAAA;AAGlD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAIjH"}
@@ -9,7 +9,7 @@ import { useImperativeHandle } from 'react';
9
9
  * **NOTE**: The `refObject` should be passed to the underlying element, NOT the `forwardedRef`.
10
10
  */
11
11
  function useRefObjectAsForwardedRef(forwardedRef, refObject) {
12
- const $ = c(2);
12
+ const $ = c(4);
13
13
  let t0;
14
14
  if ($[0] !== refObject.current) {
15
15
  t0 = () => refObject.current;
@@ -18,7 +18,15 @@ function useRefObjectAsForwardedRef(forwardedRef, refObject) {
18
18
  } else {
19
19
  t0 = $[1];
20
20
  }
21
- useImperativeHandle(forwardedRef, t0);
21
+ let t1;
22
+ if ($[2] !== refObject) {
23
+ t1 = [refObject];
24
+ $[2] = refObject;
25
+ $[3] = t1;
26
+ } else {
27
+ t1 = $[3];
28
+ }
29
+ useImperativeHandle(forwardedRef, t0, t1);
22
30
  }
23
31
 
24
32
  export { useRefObjectAsForwardedRef };
@@ -1 +1 @@
1
- {"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,QAe7F"}
1
+ {"version":3,"file":"useScrollFlash.d.ts","sourceRoot":"","sources":["../../src/hooks/useScrollFlash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,kBAAkB,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,QAoB7F"}
@@ -1,4 +1,3 @@
1
- import { c } from 'react-compiler-runtime';
2
1
  import { useEffect } from 'react';
3
2
 
4
3
  /**
@@ -6,30 +5,23 @@ import { useEffect } from 'react';
6
5
  * @param scrollContainerRef The ref of the scrollable content
7
6
  */
8
7
  function useScrollFlash(scrollContainerRef) {
9
- const $ = c(3);
10
- let t0;
11
- let t1;
12
- if ($[0] !== scrollContainerRef) {
13
- t0 = () => {
14
- const scrollContainer = scrollContainerRef.current;
15
- if (!scrollContainer) {
16
- return;
17
- }
8
+ // https://adxlv.computer/projects/flash-scrollers/
9
+ useEffect(() => {
10
+ const scrollContainer = scrollContainerRef.current;
11
+ if (!scrollContainer) {
12
+ return;
13
+ }
14
+
15
+ // Defer to the next frame to avoid forcing a synchronous reflow
16
+ // when the effect runs immediately after React commits DOM changes.
17
+ const id = requestAnimationFrame(() => {
18
18
  const currentScroll = scrollContainer.scrollTop;
19
- const maxScroll = scrollContainer.scrollHeight;
20
- const altScroll = currentScroll < Math.min(1, maxScroll) ? currentScroll + 1 : currentScroll - 1;
19
+ const altScroll = currentScroll < 1 ? currentScroll + 1 : currentScroll - 1;
21
20
  scrollContainer.scrollTop = altScroll;
22
21
  scrollContainer.scrollTop = currentScroll;
23
- };
24
- t1 = [scrollContainerRef];
25
- $[0] = scrollContainerRef;
26
- $[1] = t0;
27
- $[2] = t1;
28
- } else {
29
- t0 = $[1];
30
- t1 = $[2];
31
- }
32
- useEffect(t0, t1);
22
+ });
23
+ return () => cancelAnimationFrame(id);
24
+ }, [scrollContainerRef]);
33
25
  }
34
26
 
35
27
  export { useScrollFlash as default };
@@ -1,8 +1,56 @@
1
1
  import React from 'react';
2
+ /**
3
+ * useSlots - Extract slot components from children for SSR-compatible slot APIs.
4
+ *
5
+ * Given a list of children and a config mapping slot names to component types,
6
+ * separates children into two groups: matched slots and the rest.
7
+ *
8
+ * Config: { leadingVisual: LeadingVisual, description: Description }
9
+ *
10
+ * Children: Matching: Output:
11
+ * +----------------+ slots = {
12
+ * | LeadingVisual | -> matches slot 0 --> leadingVisual: <LeadingVisual />
13
+ * | "Project name" | -> no match --> description: <Description />
14
+ * | Description | -> matches slot 1 --> }
15
+ * | TrailingVisual | -> no match --> rest = ["Project name", <TrailingVisual />]
16
+ * +----------------+
17
+ *
18
+ * Performance-sensitive: called per item in lists (e.g. 100-item ActionList
19
+ * calls this 101 times per render).
20
+ *
21
+ * Once all slots are filled, remaining children skip matching entirely in
22
+ * production (single integer comparison). In dev, we still scan for duplicates
23
+ * to emit a warning.
24
+ *
25
+ * Flow per child:
26
+ *
27
+ * child ──> isValidElement? ──no──> rest[]
28
+ * |
29
+ * yes
30
+ * |
31
+ * v
32
+ * all slots filled? ──yes──> rest[] (prod)
33
+ * | |
34
+ * no [dev: check for
35
+ * | duplicate warning]
36
+ * v
37
+ * match against unfilled slots
38
+ * |
39
+ * found match? ──no──> rest[]
40
+ * |
41
+ * yes
42
+ * |
43
+ * v
44
+ * slots[key] = child, slotsFound++
45
+ *
46
+ * Slot config supports two matcher styles:
47
+ * 1. Component reference: { visual: LeadingVisual }
48
+ * 2. Component + test fn: { block: [Description, props => props.variant === 'block'] }
49
+ */
50
+ type Props = any;
2
51
  type ComponentMatcher = React.ElementType<Props>;
3
52
  type ComponentAndPropsMatcher = [ComponentMatcher, (props: Props) => boolean];
4
53
  export type SlotConfig = Record<string, ComponentMatcher | ComponentAndPropsMatcher>;
5
- type Props = any;
6
54
  type SlotElements<Config extends SlotConfig> = {
7
55
  [Property in keyof Config]: SlotValue<Config, Property>;
8
56
  };
@@ -10,11 +58,7 @@ type SlotValue<Config, Property extends keyof Config> = Config[Property] extends
10
58
  infer ElementType extends React.ElementType,
11
59
  infer _testFn
12
60
  ] ? React.ReactElement<React.ComponentPropsWithoutRef<ElementType>, ElementType> : never;
13
- /**
14
- * Extract components from `children` so we can render them in different places,
15
- * allowing us to implement components with SSR-compatible slot APIs.
16
- * Note: We can only extract direct children, not nested ones.
17
- */
61
+ /** Extract slot components from children. See file header for details. */
18
62
  export declare function useSlots<Config extends SlotConfig>(children: React.ReactNode, config: Config): [Partial<SlotElements<Config>>, React.ReactNode[]];
19
63
  export {};
20
64
  //# sourceMappingURL=useSlots.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSlots.d.ts","sourceRoot":"","sources":["../../src/hooks/useSlots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,KAAK,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAEhD,KAAK,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAA;AAE7E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,CAAC,CAAA;AAIpF,KAAK,KAAK,GAAG,GAAG,CAAA;AAEhB,KAAK,YAAY,CAAC,MAAM,SAAS,UAAU,IAAI;KAC5C,QAAQ,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC;CACxD,CAAA;AAED,KAAK,SAAS,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC,WAAW,GAC9F,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,GACtF,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAS;IAC9B,MAAM,WAAW,SAAS,KAAK,CAAC,WAAW;IAE3C,MAAM,OAAO;CACd,GACD,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,GAC5E,KAAK,CAAA;AAEX;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,UAAU,EAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CA8CpD"}
1
+ {"version":3,"file":"useSlots.d.ts","sourceRoot":"","sources":["../../src/hooks/useSlots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAKH,KAAK,KAAK,GAAG,GAAG,CAAA;AAChB,KAAK,gBAAgB,GAAG,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;AAChD,KAAK,wBAAwB,GAAG,CAAC,gBAAgB,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC,CAAA;AAE7E,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,wBAAwB,CAAC,CAAA;AAEpF,KAAK,YAAY,CAAC,MAAM,SAAS,UAAU,IAAI;KAC5C,QAAQ,IAAI,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC;CACxD,CAAA;AAED,KAAK,SAAS,CAAC,MAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK,CAAC,WAAW,GAC9F,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,GACtF,MAAM,CAAC,QAAQ,CAAC,SAAS,SAAS;IAC9B,MAAM,WAAW,SAAS,KAAK,CAAC,WAAW;IAE3C,MAAM,OAAO;CACd,GACD,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,GAC5E,KAAK,CAAA;AAeX,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,SAAS,UAAU,EAChD,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,MAAM,EAAE,MAAM,GACb,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAqDpD"}
@@ -2,29 +2,85 @@ import React from 'react';
2
2
  import { warning } from '../utils/warning.js';
3
3
  import { isSlot } from '../utils/is-slot.js';
4
4
 
5
- // slot config allows 2 options:
6
- // 1. Component to match, example: { leadingVisual: LeadingVisual }
5
+ /**
6
+ * useSlots - Extract slot components from children for SSR-compatible slot APIs.
7
+ *
8
+ * Given a list of children and a config mapping slot names to component types,
9
+ * separates children into two groups: matched slots and the rest.
10
+ *
11
+ * Config: { leadingVisual: LeadingVisual, description: Description }
12
+ *
13
+ * Children: Matching: Output:
14
+ * +----------------+ slots = {
15
+ * | LeadingVisual | -> matches slot 0 --> leadingVisual: <LeadingVisual />
16
+ * | "Project name" | -> no match --> description: <Description />
17
+ * | Description | -> matches slot 1 --> }
18
+ * | TrailingVisual | -> no match --> rest = ["Project name", <TrailingVisual />]
19
+ * +----------------+
20
+ *
21
+ * Performance-sensitive: called per item in lists (e.g. 100-item ActionList
22
+ * calls this 101 times per render).
23
+ *
24
+ * Once all slots are filled, remaining children skip matching entirely in
25
+ * production (single integer comparison). In dev, we still scan for duplicates
26
+ * to emit a warning.
27
+ *
28
+ * Flow per child:
29
+ *
30
+ * child ──> isValidElement? ──no──> rest[]
31
+ * |
32
+ * yes
33
+ * |
34
+ * v
35
+ * all slots filled? ──yes──> rest[] (prod)
36
+ * | |
37
+ * no [dev: check for
38
+ * | duplicate warning]
39
+ * v
40
+ * match against unfilled slots
41
+ * |
42
+ * found match? ──no──> rest[]
43
+ * |
44
+ * yes
45
+ * |
46
+ * v
47
+ * slots[key] = child, slotsFound++
48
+ *
49
+ * Slot config supports two matcher styles:
50
+ * 1. Component reference: { visual: LeadingVisual }
51
+ * 2. Component + test fn: { block: [Description, props => props.variant === 'block'] }
52
+ */
7
53
 
8
- // 2. Component to match + a test function, example: { blockDescription: [Description, props => props.variant === 'block'] }
54
+ // --- Types ---
9
55
 
10
- // We don't know what the props are yet, we set them later based on slot config
11
56
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
57
 
13
- // useful for narrowing types, third option is not possible
58
+ // --- Matching ---
14
59
 
15
- /**
16
- * Extract components from `children` so we can render them in different places,
17
- * allowing us to implement components with SSR-compatible slot APIs.
18
- * Note: We can only extract direct children, not nested ones.
19
- */
20
- function useSlots(children, config) {
21
- // Object mapping slot names to their elements
22
- const slots = mapValues(config, () => undefined);
60
+ /** Check if a child element matches a slot config entry, either by direct type comparison or slot symbol. */
61
+ function childMatchesSlot(child, slotValue) {
62
+ if (Array.isArray(slotValue)) {
63
+ const [component, testFn] = slotValue;
64
+ return (child.type === component || isSlot(child, component)) && testFn(child.props);
65
+ }
66
+ return child.type === slotValue || isSlot(child, slotValue);
67
+ }
23
68
 
24
- // Array of elements that are not slots
69
+ // --- Hook ---
70
+
71
+ /** Extract slot components from children. See file header for details. */
72
+ function useSlots(children, config) {
25
73
  const rest = [];
26
74
  const keys = Object.keys(config);
27
75
  const values = Object.values(config);
76
+ const totalSlots = keys.length;
77
+
78
+ // Initialize all slot keys to undefined so callers can check `slots.x === undefined`
79
+ const slots = {};
80
+ for (let i = 0; i < totalSlots; i++) {
81
+ slots[keys[i]] = undefined;
82
+ }
83
+ let slotsFound = 0;
28
84
 
29
85
  // eslint-disable-next-line github/array-foreach
30
86
  React.Children.forEach(children, child => {
@@ -32,41 +88,63 @@ function useSlots(children, config) {
32
88
  rest.push(child);
33
89
  return;
34
90
  }
35
- const index = values.findIndex(value => {
36
- if (Array.isArray(value)) {
37
- const [component, testFn] = value;
38
- return (child.type === component || isSlot(child, component)) && testFn(child.props);
39
- } else {
40
- return child.type === value || isSlot(child, value);
41
- }
42
- });
43
91
 
44
- // If the child is not a slot, add it to the `rest` array
45
- if (index === -1) {
92
+ // Short-circuit: all slots filled, no more matching needed
93
+ if (slotsFound === totalSlots) {
94
+ if (process.env.NODE_ENV !== "production" && warnIfDuplicate(child, keys, values, totalSlots)) {
95
+ return;
96
+ }
46
97
  rest.push(child);
47
98
  return;
48
99
  }
49
- const slotKey = keys[index];
50
100
 
51
- // If slot is already filled, ignore duplicates
52
- if (slots[slotKey]) {
53
- process.env.NODE_ENV !== "production" ? warning(true, `Found duplicate "${String(slotKey)}" slot. Only the first will be rendered.`) : void 0;
101
+ // Try to match child against a slot
102
+ const matchedIndex = findMatchingSlot(child, values, totalSlots);
103
+ if (matchedIndex === -1) {
104
+ rest.push(child);
54
105
  return;
55
106
  }
107
+ const slotKey = keys[matchedIndex];
56
108
 
57
- // If the child is a slot, add it to the `slots` object
58
-
109
+ // Duplicate: slot already filled by an earlier child
110
+ if (slots[slotKey] !== undefined) {
111
+ if (process.env.NODE_ENV !== "production") {
112
+ process.env.NODE_ENV !== "production" ? warning(true, `Found duplicate "${String(slotKey)}" slot. Only the first will be rendered.`) : void 0;
113
+ }
114
+ return;
115
+ }
59
116
  slots[slotKey] = child;
117
+ slotsFound++;
60
118
  });
61
119
  return [slots, rest];
62
120
  }
63
121
 
64
- /** Map the values of an object */
65
- function mapValues(obj, fn) {
66
- return Object.keys(obj).reduce((result, key) => {
67
- result[key] = fn(obj[key]);
68
- return result;
69
- }, {});
122
+ // --- Helpers ---
123
+
124
+ /**
125
+ * Find the first slot config entry matching this child.
126
+ * Returns the config index, or -1 if no match.
127
+ */
128
+ function findMatchingSlot(child, values, totalSlots) {
129
+ for (let i = 0; i < totalSlots; i++) {
130
+ if (childMatchesSlot(child, values[i])) return i;
131
+ }
132
+ return -1;
133
+ }
134
+
135
+ /**
136
+ * Dev-only: check if a child duplicates an already-filled slot.
137
+ * Returns true (and warns) if a duplicate is found, false otherwise.
138
+ * Used in the short-circuit path where all slots are already filled.
139
+ */
140
+ function warnIfDuplicate(child, keys, values, totalSlots) {
141
+ for (let i = 0; i < totalSlots; i++) {
142
+ if (childMatchesSlot(child, values[i])) {
143
+ process.env.NODE_ENV !== "production" ? warning(true, `Found duplicate "${String(keys[i])}" slot. Only the first will be rendered.`) : void 0;
144
+ return true;
145
+ }
146
+ }
147
+ return false;
70
148
  }
71
149
 
72
150
  export { useSlots };
@@ -0,0 +1,2 @@
1
+ .prc-components-UnderlineWrapper-eT-Yj{align-items:center;box-shadow:inset 0 -1px var(--borderColor-muted,var(--color-border-muted));display:flex;justify-content:flex-start;min-height:var(--control-xlarge-size,48px);overflow:visible;padding-inline:var(--stack-padding-normal,1rem)}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-measured=false]{overflow:hidden}.prc-components-UnderlineWrapper-eT-Yj[data-overflow-measured=true]{overflow:visible}.prc-components-UnderlineWrapper-eT-Yj[data-variant=flush]{padding-inline:unset}.prc-components-UnderlineItemList-xKlKC{display:flex;gap:8px;list-style:none;margin:0;padding:0;white-space:nowrap}.prc-components-UnderlineItem-7fP-n,.prc-components-UnderlineItemList-xKlKC{align-items:center;position:relative}.prc-components-UnderlineItem-7fP-n{appearance:none;background-color:transparent;border:0;border-radius:var(--borderRadius-medium,var(--borderRadius-small,.1875rem));color:var(--fgColor-default,var(--color-fg-default));cursor:pointer;display:inline-flex;font:inherit;font-size:var(--text-body-size-medium,.875rem);line-height:var(--text-body-lineHeight-medium,1.4285);padding-block:var(--base-size-6,.375rem);padding-inline:var(--base-size-8,.5rem);text-align:center;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.prc-components-UnderlineItem-7fP-n:hover{background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));-webkit-text-decoration:none;text-decoration:none;transition:background-color .12s ease-out}}.prc-components-UnderlineItem-7fP-n:focus{box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--color-accent-fg));outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n:focus:not(:focus-visible){box-shadow:none}.prc-components-UnderlineItem-7fP-n:focus-visible{box-shadow:inset 0 0 0 2px var(--fgColor-accent,var(--color-accent-fg));outline:2px solid transparent}.prc-components-UnderlineItem-7fP-n [data-content]:before{content:attr(data-content);display:block;font-weight:var(--base-text-weight-semibold,600);height:0;visibility:hidden;white-space:nowrap}.prc-components-UnderlineItem-7fP-n [data-component=icon]{align-items:center;color:var(--fgColor-muted,var(--color-fg-muted));display:inline-flex;margin-inline-end:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n [data-component=counter]{align-items:center;display:flex;margin-inline-start:var(--base-size-8,.5rem)}.prc-components-UnderlineItem-7fP-n:after{background-color:transparent;border-radius:0;bottom:calc(50% - var(--control-xlarge-size, var(--base-size-48,3rem))/2 - 1px);content:"";height:2px;pointer-events:none;position:absolute;right:50%;transform:translate(50%,-50%);width:100%}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]) [data-component=text],.prc-components-UnderlineItem-7fP-n[aria-selected=true] [data-component=text]{font-weight:var(--base-text-weight-semibold,600)}.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:var(--underlineNav-borderColor-active,var(--color-primer-border-active,#fd8c73))}@media (forced-colors:active){.prc-components-UnderlineItem-7fP-n[aria-current]:not([aria-current=false]):after,.prc-components-UnderlineItem-7fP-n[aria-selected=true]:after{background-color:LinkText}}.prc-components-LoadingCounter-dBuLy{animation:prc-components-loadingCounterKeyFrames-8tMlf 1.2s ease-in-out infinite alternate;background-color:var(--bgColor-neutral-muted,var(--color-neutral-subtle));border-color:var(--borderColor-default,var(--color-border-default));border-radius:20px;display:inline-block;height:1rem;width:1.5rem}@keyframes prc-components-loadingCounterKeyFrames-8tMlf{0%{opacity:1}to{opacity:.2}}
2
+ /*# sourceMappingURL=UnderlineTabbedInterface-4197ee28.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/components/UnderlineTabbedInterface.module.css.js"],"names":[],"mappings":"AAAA,uCAKE,kBAAmB,CAOnB,0EAAiD,CAXjD,YAAa,CAGb,0BAA2B,CAI3B,0CAA4C,CAO5C,gBAAiB,CAZjB,+CA0BF,CAZE,qEACE,eACF,CAEA,oEACE,gBACF,CAEA,2DAEE,oBACF,CAGF,wCAEE,YAAa,CAMb,OAAQ,CAFR,eAAgB,CAFhB,QAAS,CADT,SAAU,CAEV,kBAIF,CAEA,4EAJE,kBAAmB,CANnB,iBAsCF,CA5BA,oCAgBE,eAAgB,CALhB,4BAA6B,CAC7B,QAAS,CACT,2EAAoE,CANpE,oDAA6B,CAG7B,cAAe,CAPf,mBAAoB,CACpB,YAAa,CACb,8CAAuC,CACvC,qDAAuD,CAYvD,wCAAiC,CADjC,uCAAkC,CATlC,iBAAkB,CAClB,4BAAqB,CAArB,oBAmBF,CAPE,qBACE,0CAEE,yEAA8C,CAD9C,4BAAqB,CAArB,oBAAqB,CAErB,yCACF,CACF,CAGF,0CAGE,uEAAiD,CAFjD,6BAQF,CAHE,8DACE,eACF,CAGF,kDAGE,uEAAiD,CAFjD,6BAGF,CAGA,0DAME,0BAA2B,CAL3B,aAAc,CAEd,gDAA6C,CAD7C,QAAS,CAGT,iBAAkB,CADlB,kBAGF,CAEA,0DAGE,kBAAmB,CADnB,gDAA2B,CAD3B,mBAAoB,CAGpB,0CACF,CAEA,6DAGE,kBAAmB,CADnB,YAAa,CADb,4CAGF,CAEA,0CAaE,4BAA6B,CAC7B,eAAgB,CANhB,+EAAmF,CAInF,UAAW,CAFX,UAAW,CACX,mBAAoB,CAVpB,iBAAkB,CAClB,SAAU,CAaV,6BAA+B,CAN/B,UAOF,CAEA,gLAEE,gDACF,CAEA,gJAGE,iGAMF,CAJE,8BALF,gJAOI,yBAEJ,CADE,CAGF,qCASE,0FAAsE,CAJtE,yEAA8C,CAC9C,mEAAwC,CAExC,kBAAmB,CAPnB,oBAAqB,CAErB,WAAY,CADZ,YAQF,CAEA,wDACE,GACE,SACF,CAEA,GACE,UACF,CACF","file":"UnderlineTabbedInterface-4197ee28.css","sourcesContent":[".UnderlineWrapper {\n display: flex;\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: var(--stack-padding-normal);\n justify-content: flex-start;\n align-items: center;\n\n /* make space for the underline */\n min-height: var(--control-xlarge-size, 48px);\n\n /* using a box-shadow instead of a border to accommodate 'overflow-y: hidden' on UnderlinePanels */\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 -1px var(--borderColor-muted);\n\n /* Hide overflow until calculation is complete to prevent CLS */\n overflow: visible;\n\n &[data-overflow-measured='false'] {\n overflow: hidden;\n }\n\n &[data-overflow-measured='true'] {\n overflow: visible;\n }\n\n &[data-variant='flush'] {\n /* stylelint-disable-next-line primer/spacing */\n padding-inline: unset;\n }\n}\n\n.UnderlineItemList {\n position: relative;\n display: flex;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n list-style: none;\n align-items: center;\n gap: 8px;\n}\n\n.UnderlineItem {\n /* underline tab specific styles */\n position: relative;\n display: inline-flex;\n font: inherit;\n font-size: var(--text-body-size-medium);\n line-height: var(--text-body-lineHeight-medium, 1.4285);\n color: var(--fgColor-default);\n text-align: center;\n text-decoration: none;\n cursor: pointer;\n background-color: transparent;\n border: 0;\n border-radius: var(--borderRadius-medium, var(--borderRadius-small));\n\n /* button resets */\n appearance: none;\n padding-inline: var(--base-size-8);\n padding-block: var(--base-size-6);\n align-items: center;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: none;\n background-color: var(--bgColor-neutral-muted);\n transition: background-color 0.12s ease-out;\n }\n }\n}\n\n.UnderlineItem:focus {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n\n /* where focus-visible is supported, remove the focus box-shadow */\n &:not(:focus-visible) {\n box-shadow: none;\n }\n}\n\n.UnderlineItem:focus-visible {\n outline: 2px solid transparent;\n /* stylelint-disable-next-line primer/box-shadow */\n box-shadow: inset 0 0 0 2px var(--fgColor-accent);\n}\n\n/* renders a visibly hidden \"copy\" of the label in bold, reserving box space for when label becomes bold on selected */\n.UnderlineItem [data-content]::before {\n display: block;\n height: 0;\n font-weight: var(--base-text-weight-semibold);\n white-space: nowrap;\n visibility: hidden;\n content: attr(data-content);\n}\n\n.UnderlineItem [data-component='icon'] {\n display: inline-flex;\n color: var(--fgColor-muted);\n align-items: center;\n margin-inline-end: var(--base-size-8);\n}\n\n.UnderlineItem [data-component='counter'] {\n margin-inline-start: var(--base-size-8);\n display: flex;\n align-items: center;\n}\n\n.UnderlineItem::after {\n position: absolute;\n right: 50%;\n\n /* TODO: see if we can simplify this positioning */\n\n /* 48px total height / 2 (24px) + 1px */\n /* stylelint-disable-next-line primer/spacing */\n bottom: calc(50% - calc(var(--control-xlarge-size, var(--base-size-48)) / 2 + 1px));\n width: 100%;\n height: 2px;\n pointer-events: none;\n content: '';\n background-color: transparent;\n border-radius: 0;\n transform: translate(50%, -50%);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false']) [data-component='text'],\n.UnderlineItem[aria-selected='true'] [data-component='text'] {\n font-weight: var(--base-text-weight-semibold);\n}\n\n.UnderlineItem[aria-current]:not([aria-current='false'])::after,\n.UnderlineItem[aria-selected='true']::after {\n /* stylelint-disable-next-line primer/colors */\n background-color: var(--underlineNav-borderColor-active, var(--color-primer-border-active, #fd8c73));\n\n @media (forced-colors: active) {\n /* Support for Window Force Color Mode https://learn.microsoft.com/en-us/fluent-ui/web-components/design-system/high-contrast */\n background-color: LinkText;\n }\n}\n\n.LoadingCounter {\n display: inline-block;\n width: 1.5rem;\n height: 1rem;\n /* 16px */\n background-color: var(--bgColor-neutral-muted);\n border-color: var(--borderColor-default);\n /* stylelint-disable-next-line primer/borders */\n border-radius: 20px;\n animation: loadingCounterKeyFrames 1.2s ease-in-out infinite alternate;\n}\n\n@keyframes loadingCounterKeyFrames {\n from {\n opacity: 1;\n }\n\n to {\n opacity: 0.2;\n }\n}\n"]}
@@ -15,6 +15,7 @@ export declare const LoadingCounter: () => React.JSX.Element;
15
15
  export type UnderlineItemProps<As extends React.ElementType> = {
16
16
  as?: As | 'a' | 'button';
17
17
  className?: string;
18
+ iconsVisible?: boolean;
18
19
  loadingCounters?: boolean;
19
20
  counter?: number | string;
20
21
  icon?: FC<IconProps> | React.ReactElement<any>;
@@ -1 +1 @@
1
- {"version":3,"file":"UnderlineTabbedInterface.d.ts","sourceRoot":"","sources":["../../../src/internal/components/UnderlineTabbedInterface.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgC,KAAK,EAAE,EAA0B,KAAK,WAAW,EAAC,MAAM,OAAO,CAAA;AAEtG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,yBAAyB,CAAA;AAMlG,eAAO,MAAM,GAAG,IAAI,CAAA;AAgBpB,KAAK,qBAAqB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAYvB,8BAA8B,CAAC,WAAW,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAA;AAErF,eAAO,MAAM,iBAAiB,EAMxB,8BAA8B,CAAC,IAAI,CAAC,CAAA;AAE1C,eAAO,MAAM,cAAc,yBAE1B,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IAC7D,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEzB,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB,GAAG,KAAK,CAAC,wBAAwB,CAAC,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,EAAE,SAAS,QAAQ,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAA;AAE9F,eAAO,MAAM,aAAa,EAwBpB,8BAA8B,CAAC,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"UnderlineTabbedInterface.d.ts","sourceRoot":"","sources":["../../../src/internal/components/UnderlineTabbedInterface.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAgC,KAAK,EAAE,EAA0B,KAAK,WAAW,EAAC,MAAM,OAAO,CAAA;AAEtG,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,wBAAwB,CAAA;AAErD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,yBAAyB,CAAA;AAMlG,eAAO,MAAM,GAAG,IAAI,CAAA;AAgBpB,KAAK,qBAAqB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IACzD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,EAAE,CAAA;IACP,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAWvB,8BAA8B,CAAC,WAAW,EAAE,qBAAqB,CAAC,WAAW,CAAC,CAAC,CAAA;AAErF,eAAO,MAAM,iBAAiB,EAMxB,8BAA8B,CAAC,IAAI,CAAC,CAAA;AAE1C,eAAO,MAAM,cAAc,yBAE1B,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,EAAE,SAAS,KAAK,CAAC,WAAW,IAAI;IAC7D,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,QAAQ,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEzB,IAAI,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;IAC9C,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;CACzB,GAAG,KAAK,CAAC,wBAAwB,CAAC,EAAE,SAAS,GAAG,GAAG,GAAG,GAAG,EAAE,SAAS,QAAQ,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAA;AAE9F,eAAO,MAAM,aAAa,EAwBpB,8BAA8B,CAAC,WAAW,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAA"}
@@ -6,6 +6,8 @@ import { clsx } from 'clsx';
6
6
  import { jsx, jsxs } from 'react/jsx-runtime';
7
7
  import CounterLabel from '../../CounterLabel/CounterLabel.js';
8
8
 
9
+ const GAP = 8;
10
+
9
11
  // Helper to extract direct text content from children for the data-content attribute.
10
12
  // This is used by CSS to reserve space for bold text (preventing layout shift).
11
13
  // Only extracts strings/numbers, not text from nested React elements (e.g., Popovers).
@@ -119,11 +121,12 @@ const LoadingCounter = () => {
119
121
  return t0;
120
122
  };
121
123
  const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
122
- const $ = c(28);
124
+ const $ = c(30);
123
125
  let Icon;
124
126
  let children;
125
127
  let className;
126
128
  let counter;
129
+ let iconsVisible;
127
130
  let loadingCounters;
128
131
  let rest;
129
132
  let t0;
@@ -133,6 +136,7 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
133
136
  children,
134
137
  counter,
135
138
  icon: Icon,
139
+ iconsVisible,
136
140
  loadingCounters,
137
141
  className,
138
142
  ...rest
@@ -142,62 +146,65 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
142
146
  $[2] = children;
143
147
  $[3] = className;
144
148
  $[4] = counter;
145
- $[5] = loadingCounters;
146
- $[6] = rest;
147
- $[7] = t0;
149
+ $[5] = iconsVisible;
150
+ $[6] = loadingCounters;
151
+ $[7] = rest;
152
+ $[8] = t0;
148
153
  } else {
149
154
  Icon = $[1];
150
155
  children = $[2];
151
156
  className = $[3];
152
157
  counter = $[4];
153
- loadingCounters = $[5];
154
- rest = $[6];
155
- t0 = $[7];
158
+ iconsVisible = $[5];
159
+ loadingCounters = $[6];
160
+ rest = $[7];
161
+ t0 = $[8];
156
162
  }
157
163
  const Component = t0 === undefined ? "a" : t0;
158
164
  let t1;
159
- if ($[8] !== children) {
165
+ if ($[9] !== children) {
160
166
  t1 = getTextContent(children);
161
- $[8] = children;
162
- $[9] = t1;
167
+ $[9] = children;
168
+ $[10] = t1;
163
169
  } else {
164
- t1 = $[9];
170
+ t1 = $[10];
165
171
  }
166
172
  const textContent = t1;
167
173
  let t2;
168
- if ($[10] !== className) {
174
+ if ($[11] !== className) {
169
175
  t2 = clsx(classes.UnderlineItem, className);
170
- $[10] = className;
171
- $[11] = t2;
176
+ $[11] = className;
177
+ $[12] = t2;
172
178
  } else {
173
- t2 = $[11];
179
+ t2 = $[12];
174
180
  }
175
181
  let t3;
176
- if ($[12] !== Icon) {
177
- t3 = Icon && /*#__PURE__*/jsx("span", {
182
+ if ($[13] !== Icon || $[14] !== iconsVisible) {
183
+ t3 = iconsVisible && Icon && /*#__PURE__*/jsx("span", {
178
184
  "data-component": "icon",
179
185
  children: isElement(Icon) ? Icon : /*#__PURE__*/jsx(Icon, {})
180
186
  });
181
- $[12] = Icon;
182
- $[13] = t3;
187
+ $[13] = Icon;
188
+ $[14] = iconsVisible;
189
+ $[15] = t3;
183
190
  } else {
184
- t3 = $[13];
191
+ t3 = $[15];
185
192
  }
186
193
  let t4;
187
- if ($[14] !== children || $[15] !== textContent) {
194
+ if ($[16] !== children || $[17] !== textContent) {
188
195
  t4 = children && /*#__PURE__*/jsx("span", {
189
196
  "data-component": "text",
190
197
  "data-content": textContent || undefined,
191
198
  children: children
192
199
  });
193
- $[14] = children;
194
- $[15] = textContent;
195
- $[16] = t4;
200
+ $[16] = children;
201
+ $[17] = textContent;
202
+ $[18] = t4;
196
203
  } else {
197
- t4 = $[16];
204
+ t4 = $[18];
198
205
  }
199
206
  let t5;
200
- if ($[17] !== counter || $[18] !== loadingCounters) {
207
+ if ($[19] !== counter || $[20] !== loadingCounters) {
201
208
  t5 = counter !== undefined ? loadingCounters ? /*#__PURE__*/jsx("span", {
202
209
  "data-component": "counter",
203
210
  children: /*#__PURE__*/jsx(LoadingCounter, {})
@@ -207,32 +214,32 @@ const UnderlineItem = /*#__PURE__*/React.forwardRef((props, ref) => {
207
214
  children: counter
208
215
  })
209
216
  }) : null;
210
- $[17] = counter;
211
- $[18] = loadingCounters;
212
- $[19] = t5;
217
+ $[19] = counter;
218
+ $[20] = loadingCounters;
219
+ $[21] = t5;
213
220
  } else {
214
- t5 = $[19];
221
+ t5 = $[21];
215
222
  }
216
223
  let t6;
217
- if ($[20] !== Component || $[21] !== ref || $[22] !== rest || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5) {
224
+ if ($[22] !== Component || $[23] !== ref || $[24] !== rest || $[25] !== t2 || $[26] !== t3 || $[27] !== t4 || $[28] !== t5) {
218
225
  t6 = /*#__PURE__*/jsxs(Component, {
219
226
  ...rest,
220
227
  ref: ref,
221
228
  className: t2,
222
229
  children: [t3, t4, t5]
223
230
  });
224
- $[20] = Component;
225
- $[21] = ref;
226
- $[22] = rest;
227
- $[23] = t2;
228
- $[24] = t3;
229
- $[25] = t4;
230
- $[26] = t5;
231
- $[27] = t6;
231
+ $[22] = Component;
232
+ $[23] = ref;
233
+ $[24] = rest;
234
+ $[25] = t2;
235
+ $[26] = t3;
236
+ $[27] = t4;
237
+ $[28] = t5;
238
+ $[29] = t6;
232
239
  } else {
233
- t6 = $[27];
240
+ t6 = $[29];
234
241
  }
235
242
  return t6;
236
243
  });
237
244
 
238
- export { LoadingCounter, UnderlineItem, UnderlineItemList, UnderlineWrapper };
245
+ export { GAP, LoadingCounter, UnderlineItem, UnderlineItemList, UnderlineWrapper };
@@ -1,4 +1,4 @@
1
- import './UnderlineTabbedInterface-6bea1152.css';
1
+ import './UnderlineTabbedInterface-4197ee28.css';
2
2
 
3
3
  var classes = {"UnderlineWrapper":"prc-components-UnderlineWrapper-eT-Yj","UnderlineItemList":"prc-components-UnderlineItemList-xKlKC","UnderlineItem":"prc-components-UnderlineItem-7fP-n","LoadingCounter":"prc-components-LoadingCounter-dBuLy","loadingCounterKeyFrames":"prc-components-loadingCounterKeyFrames-8tMlf"};
4
4