@primer/react 38.29.0-rc.d35810c2f → 38.29.0-rc.dc2cb3e06

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 (166) hide show
  1. package/dist/ActionList/Group.d.ts +0 -5
  2. package/dist/ActionList/Group.d.ts.map +1 -1
  3. package/dist/ActionList/Group.js +2 -5
  4. package/dist/ActionList/GroupContext.d.ts +8 -0
  5. package/dist/ActionList/GroupContext.d.ts.map +1 -0
  6. package/dist/ActionList/GroupContext.js +8 -0
  7. package/dist/ActionList/Item.js +3 -2
  8. package/dist/ActionList/Selection.js +1 -1
  9. package/dist/ActionList/index.d.ts.map +1 -1
  10. package/dist/ActionList/index.js +2 -1
  11. package/dist/ActionMenu/ActionMenu.js +1 -1
  12. package/dist/AnchoredOverlay/AnchoredOverlay.js +2 -1
  13. package/dist/Button/IconButton.d.ts.map +1 -1
  14. package/dist/Button/IconButton.js +3 -2
  15. package/dist/ConfirmationDialog/ConfirmationDialog.d.ts +0 -9
  16. package/dist/ConfirmationDialog/ConfirmationDialog.d.ts.map +1 -1
  17. package/dist/ConfirmationDialog/ConfirmationDialog.js +1 -42
  18. package/dist/ConfirmationDialog/useConfirm.d.ts +12 -0
  19. package/dist/ConfirmationDialog/useConfirm.d.ts.map +1 -0
  20. package/dist/ConfirmationDialog/useConfirm.js +44 -0
  21. package/dist/Dialog/Dialog.d.ts +0 -1
  22. package/dist/Dialog/Dialog.d.ts.map +1 -1
  23. package/dist/Dialog/Dialog.js +2 -4
  24. package/dist/Dialog/DialogContext.d.ts +3 -0
  25. package/dist/Dialog/DialogContext.d.ts.map +1 -0
  26. package/dist/Dialog/DialogContext.js +5 -0
  27. package/dist/FilteredActionList/FilteredActionList.js +2 -1
  28. package/dist/FilteredActionList/FilteredActionListLoaders.d.ts +2 -10
  29. package/dist/FilteredActionList/FilteredActionListLoaders.d.ts.map +1 -1
  30. package/dist/FilteredActionList/FilteredActionListLoaders.js +3 -12
  31. package/dist/FilteredActionList/constants.d.ts +11 -0
  32. package/dist/FilteredActionList/constants.d.ts.map +1 -0
  33. package/dist/FilteredActionList/constants.js +13 -0
  34. package/dist/FilteredActionList/index.js +0 -1
  35. package/dist/KeybindingHint/KeybindingHint.d.ts +0 -14
  36. package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
  37. package/dist/KeybindingHint/KeybindingHint.js +2 -16
  38. package/dist/KeybindingHint/components/Chord.d.ts +0 -3
  39. package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
  40. package/dist/KeybindingHint/components/Chord.js +2 -21
  41. package/dist/KeybindingHint/components/Sequence.d.ts +0 -3
  42. package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
  43. package/dist/KeybindingHint/components/Sequence.js +2 -5
  44. package/dist/KeybindingHint/components/utils.d.ts +8 -0
  45. package/dist/KeybindingHint/components/utils.d.ts.map +1 -0
  46. package/dist/KeybindingHint/components/utils.js +32 -0
  47. package/dist/KeybindingHint/index.d.ts +2 -1
  48. package/dist/KeybindingHint/index.d.ts.map +1 -1
  49. package/dist/KeybindingHint/utils.d.ts +15 -0
  50. package/dist/KeybindingHint/utils.d.ts.map +1 -0
  51. package/dist/KeybindingHint/utils.js +17 -0
  52. package/dist/Overlay/Overlay.d.ts +1 -18
  53. package/dist/Overlay/Overlay.d.ts.map +1 -1
  54. package/dist/Overlay/Overlay.js +1 -20
  55. package/dist/Overlay/constants.d.ts +19 -0
  56. package/dist/Overlay/constants.d.ts.map +1 -0
  57. package/dist/Overlay/constants.js +20 -0
  58. package/dist/Portal/Portal.d.ts +0 -14
  59. package/dist/Portal/Portal.d.ts.map +1 -1
  60. package/dist/Portal/Portal.js +4 -46
  61. package/dist/Portal/PortalContext.d.ts +5 -0
  62. package/dist/Portal/PortalContext.d.ts.map +1 -0
  63. package/dist/Portal/PortalContext.js +5 -0
  64. package/dist/Portal/index.d.ts +3 -1
  65. package/dist/Portal/index.d.ts.map +1 -1
  66. package/dist/Portal/index.js +0 -1
  67. package/dist/Portal/portalRoot.d.ts +11 -0
  68. package/dist/Portal/portalRoot.d.ts.map +1 -0
  69. package/dist/Portal/portalRoot.js +39 -0
  70. package/dist/Radio/Radio.js +1 -1
  71. package/dist/RadioGroup/RadioGroup.d.ts +1 -6
  72. package/dist/RadioGroup/RadioGroup.d.ts.map +1 -1
  73. package/dist/RadioGroup/RadioGroup.js +2 -3
  74. package/dist/RadioGroup/RadioGroupContext.d.ts +7 -0
  75. package/dist/RadioGroup/RadioGroupContext.d.ts.map +1 -0
  76. package/dist/RadioGroup/RadioGroupContext.js +5 -0
  77. package/dist/RadioGroup/index.d.ts +2 -1
  78. package/dist/RadioGroup/index.d.ts.map +1 -1
  79. package/dist/SelectPanel/SelectPanel.js +2 -1
  80. package/dist/ThemeContext.d.ts +15 -0
  81. package/dist/ThemeContext.d.ts.map +1 -0
  82. package/dist/ThemeContext.js +9 -0
  83. package/dist/ThemeProvider.d.ts +1 -14
  84. package/dist/ThemeProvider.d.ts.map +1 -1
  85. package/dist/ThemeProvider.js +3 -18
  86. package/dist/Timeline/Timeline.d.ts +1 -1
  87. package/dist/Timeline/Timeline.d.ts.map +1 -1
  88. package/dist/Timeline/constants.d.ts +2 -0
  89. package/dist/Timeline/constants.d.ts.map +1 -0
  90. package/dist/Token/IssueLabelToken.d.ts.map +1 -1
  91. package/dist/Token/IssueLabelToken.js +3 -1
  92. package/dist/Token/Token.d.ts.map +1 -1
  93. package/dist/Token/Token.js +3 -1
  94. package/dist/Token/TokenBase.d.ts +2 -5
  95. package/dist/Token/TokenBase.d.ts.map +1 -1
  96. package/dist/Token/TokenBase.js +3 -14
  97. package/dist/Token/_RemoveTokenButton.js +1 -1
  98. package/dist/Token/constants.d.ts +4 -0
  99. package/dist/Token/constants.d.ts.map +1 -0
  100. package/dist/Token/constants.js +3 -0
  101. package/dist/Token/utils.d.ts +3 -0
  102. package/dist/Token/utils.d.ts.map +1 -0
  103. package/dist/Token/utils.js +14 -0
  104. package/dist/Tooltip/Tooltip.d.ts +0 -3
  105. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  106. package/dist/Tooltip/Tooltip.js +2 -3
  107. package/dist/Tooltip/TooltipContext.d.ts +5 -0
  108. package/dist/Tooltip/TooltipContext.d.ts.map +1 -0
  109. package/dist/Tooltip/TooltipContext.js +5 -0
  110. package/dist/TooltipV2/Tooltip.d.ts +0 -3
  111. package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
  112. package/dist/TooltipV2/Tooltip.js +4 -3
  113. package/dist/TooltipV2/TooltipContext.d.ts +5 -0
  114. package/dist/TooltipV2/TooltipContext.d.ts.map +1 -0
  115. package/dist/TooltipV2/TooltipContext.js +5 -0
  116. package/dist/TreeView/TreeView.js +1 -1
  117. package/dist/UnderlineNav/UnderlineNav.d.ts +0 -1
  118. package/dist/UnderlineNav/UnderlineNav.d.ts.map +1 -1
  119. package/dist/UnderlineNav/UnderlineNav.js +2 -5
  120. package/dist/UnderlineNav/utils.d.ts +3 -0
  121. package/dist/UnderlineNav/utils.d.ts.map +1 -0
  122. package/dist/UnderlineNav/utils.js +8 -0
  123. package/dist/experimental/SelectPanel2/SelectPanel.d.ts.map +1 -1
  124. package/dist/experimental/SelectPanel2/SelectPanel.js +2 -1
  125. package/dist/experimental/SelectPanel2/index.d.ts +2 -1
  126. package/dist/experimental/SelectPanel2/index.d.ts.map +1 -1
  127. package/dist/experimental/Tabs/Tabs.d.ts +3 -111
  128. package/dist/experimental/Tabs/Tabs.d.ts.map +1 -1
  129. package/dist/experimental/Tabs/Tabs.js +3 -237
  130. package/dist/experimental/Tabs/TabsContext.d.ts +3 -0
  131. package/dist/experimental/Tabs/TabsContext.d.ts.map +1 -0
  132. package/dist/experimental/Tabs/TabsContext.js +5 -0
  133. package/dist/experimental/Tabs/index.d.ts +5 -2
  134. package/dist/experimental/Tabs/index.d.ts.map +1 -1
  135. package/dist/experimental/Tabs/types.d.ts +107 -0
  136. package/dist/experimental/Tabs/types.d.ts.map +1 -0
  137. package/dist/experimental/Tabs/useTab.d.ts +7 -0
  138. package/dist/experimental/Tabs/useTab.d.ts.map +1 -0
  139. package/dist/experimental/Tabs/useTab.js +97 -0
  140. package/dist/experimental/Tabs/useTabList.d.ts +3 -0
  141. package/dist/experimental/Tabs/useTabList.d.ts.map +1 -0
  142. package/dist/experimental/Tabs/useTabList.js +100 -0
  143. package/dist/experimental/Tabs/useTabPanel.d.ts +4 -0
  144. package/dist/experimental/Tabs/useTabPanel.d.ts.map +1 -0
  145. package/dist/experimental/Tabs/useTabPanel.js +37 -0
  146. package/dist/experimental/Tabs/useTabs.d.ts +3 -0
  147. package/dist/experimental/Tabs/useTabs.d.ts.map +1 -0
  148. package/dist/experimental/Tabs/useTabs.js +12 -0
  149. package/dist/experimental/index.js +7 -3
  150. package/dist/hooks/MatchMedia.d.ts +23 -0
  151. package/dist/hooks/MatchMedia.d.ts.map +1 -0
  152. package/dist/hooks/MatchMediaContext.d.ts +5 -0
  153. package/dist/hooks/MatchMediaContext.d.ts.map +1 -0
  154. package/dist/hooks/MatchMediaContext.js +8 -0
  155. package/dist/hooks/useMedia.d.ts +1 -24
  156. package/dist/hooks/useMedia.d.ts.map +1 -1
  157. package/dist/hooks/useMedia.js +15 -6
  158. package/dist/index.d.ts +3 -2
  159. package/dist/index.d.ts.map +1 -1
  160. package/dist/index.js +7 -3
  161. package/dist/useTheme.d.ts +15 -0
  162. package/dist/useTheme.d.ts.map +1 -0
  163. package/dist/useTheme.js +16 -0
  164. package/dist/utils/story-helpers.d.ts +70 -0
  165. package/dist/utils/story-helpers.d.ts.map +1 -0
  166. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import type { Platform } from '../platform';
2
+ /** Split and sort the chord keys in standard order. */
3
+ export declare const splitChord: (chord: string) => string[];
4
+ /** Plain string version of `Chord` for use in `aria` string attributes. */
5
+ export declare const accessibleChordString: (chord: string, platform: Platform) => string;
6
+ /** Plain string version of `Sequence` for use in `aria` string attributes. */
7
+ export declare const accessibleSequenceString: (sequence: string, platform: Platform) => string;
8
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/KeybindingHint/components/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAoBzC,uDAAuD;AACvD,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,aAIT,CAAA;AAI/B,2EAA2E;AAC3E,eAAO,MAAM,qBAAqB,GAAI,OAAO,MAAM,EAAE,UAAU,QAAQ,WAGzD,CAAA;AAEd,8EAA8E;AAC9E,eAAO,MAAM,wBAAwB,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,WAG1D,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { accessibleKeyName } from '../key-names.js';
2
+
3
+ /**
4
+ * Consistent sort order for modifier keys. There should never be more than one non-modifier
5
+ * key in a chord, so we don't need to worry about sorting those - we just put them at
6
+ * the end.
7
+ */
8
+ const keySortPriorities = {
9
+ control: 1,
10
+ meta: 2,
11
+ alt: 3,
12
+ option: 4,
13
+ shift: 5,
14
+ function: 6
15
+ };
16
+ const keySortPriority = priority => {
17
+ var _keySortPriorities$pr;
18
+ return (_keySortPriorities$pr = keySortPriorities[priority]) !== null && _keySortPriorities$pr !== void 0 ? _keySortPriorities$pr : Infinity;
19
+ };
20
+ const compareLowercaseKeys = (a, b) => keySortPriority(a) - keySortPriority(b);
21
+
22
+ /** Split and sort the chord keys in standard order. */
23
+ const splitChord = chord => chord.split('+').map(k => k.toLowerCase()).sort(compareLowercaseKeys);
24
+ const splitSequence = sequence => sequence.split(' ');
25
+
26
+ /** Plain string version of `Chord` for use in `aria` string attributes. */
27
+ const accessibleChordString = (chord, platform) => splitChord(chord).map(key => accessibleKeyName(key, platform)).join(' ');
28
+
29
+ /** Plain string version of `Sequence` for use in `aria` string attributes. */
30
+ const accessibleSequenceString = (sequence, platform) => splitSequence(sequence).map(chord => accessibleChordString(chord, platform)).join(' then ');
31
+
32
+ export { accessibleChordString, accessibleSequenceString, splitChord };
@@ -1,3 +1,4 @@
1
- export * from './KeybindingHint';
1
+ export { KeybindingHint } from './KeybindingHint';
2
+ export { getAccessibleKeybindingHintString } from './utils';
2
3
  export type { KeybindingHintProps } from './props';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA;AAEhC,YAAY,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,iCAAiC,EAAC,MAAM,SAAS,CAAA;AAEzD,YAAY,EAAC,mBAAmB,EAAC,MAAM,SAAS,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { Platform } from './platform';
2
+ /**
3
+ * AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
4
+ * However, there may be cases where we need a plain string version, such as when building `aria-label` or
5
+ * `aria-description`. In that case, this plain string builder can be used instead.
6
+ *
7
+ * NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
8
+ * visibly) and should nearly always also be paired with a visible hint for sighted users.
9
+ *
10
+ * The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
11
+ * backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` is
12
+ * treated as `'other'`.
13
+ */
14
+ export declare const getAccessibleKeybindingHintString: (sequence: string, platform: Platform | boolean) => string;
15
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/KeybindingHint/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,GAAI,UAAU,MAAM,EAAE,UAAU,QAAQ,GAAG,OAAO,WACe,CAAA"}
@@ -0,0 +1,17 @@
1
+ import { accessibleSequenceString } from './components/utils.js';
2
+
3
+ /**
4
+ * AVOID: `KeybindingHint` is nearly always sufficient for providing both visible and accessible keyboard hints.
5
+ * However, there may be cases where we need a plain string version, such as when building `aria-label` or
6
+ * `aria-description`. In that case, this plain string builder can be used instead.
7
+ *
8
+ * NOTE that this string should _only_ be used when building `aria-label` or `aria-description` props (never rendered
9
+ * visibly) and should nearly always also be paired with a visible hint for sighted users.
10
+ *
11
+ * The `platform` argument controls how platform-specific keys (such as `Meta`, `Alt`, and `Mod`) are named. For
12
+ * backwards compatibility, a `boolean` may be passed instead, where `true` is treated as `'apple'` and `false` is
13
+ * treated as `'other'`.
14
+ */
15
+ const getAccessibleKeybindingHintString = (sequence, platform) => accessibleSequenceString(sequence, typeof platform === 'boolean' ? platform ? 'apple' : 'other' : platform);
16
+
17
+ export { getAccessibleKeybindingHintString };
@@ -4,6 +4,7 @@ import type { AriaRole, Merge } from '../utils/types';
4
4
  import type { TouchOrMouseEvent } from '../hooks';
5
5
  import type { AnchorSide } from '@primer/behaviors';
6
6
  import type { ForwardRefComponent as PolymorphicForwardRefComponent } from '../utils/polymorphic';
7
+ import type { heightMap, widthMap } from './constants';
7
8
  type StyledOverlayProps = {
8
9
  width?: keyof typeof widthMap;
9
10
  height?: keyof typeof heightMap;
@@ -13,24 +14,6 @@ type StyledOverlayProps = {
13
14
  overflow?: 'auto' | 'hidden' | 'scroll' | 'visible';
14
15
  style?: React.CSSProperties;
15
16
  };
16
- export declare const heightMap: {
17
- xsmall: string;
18
- small: string;
19
- medium: string;
20
- large: string;
21
- xlarge: string;
22
- auto: string;
23
- initial: string;
24
- 'fit-content': string;
25
- };
26
- export declare const widthMap: {
27
- small: string;
28
- medium: string;
29
- large: string;
30
- xlarge: string;
31
- xxlarge: string;
32
- auto: string;
33
- };
34
17
  type BaseOverlayProps = {
35
18
  visibility?: 'visible' | 'hidden';
36
19
  'data-test-id'?: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"Overlay.d.ts","sourceRoot":"","sources":["../../src/Overlay/Overlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,qBAAqB,EAAe,MAAM,OAAO,CAAA;AAC9D,OAAO,KAA0B,MAAM,OAAO,CAAA;AAE9C,OAAO,KAAK,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,gBAAgB,CAAA;AACnD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAA;AAG/C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACjD,OAAO,KAAK,EAAC,mBAAmB,IAAI,8BAA8B,EAAC,MAAM,sBAAsB,CAAA;AAK/F,KAAK,kBAAkB,GAAG;IACxB,KAAK,CAAC,EAAE,MAAM,OAAO,QAAQ,CAAA;IAC7B,MAAM,CAAC,EAAE,MAAM,OAAO,SAAS,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC,OAAO,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC9C,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAA;IACnD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA;AAiBD,KAAK,gBAAgB,GAAG;IACtB,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,CA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AA;IACrD,cAAc,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,CAAA;IAC9C,QAAQ,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACpC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CACpD,CAAA;AAED,KAAK,oBAAoB,GAAG,KAAK,CAAC,eAAe,EAAE,cAAc,CAAC,CAAA;AAElE;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,OAAO,EA6FR,8BAA8B,CAAC,KAAK,EAAE,oBAAoB,CAAC,CAAA;AAEhE,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAA;AAEhE,eAAe,OAAO,CAAA"}
@@ -9,25 +9,6 @@ import { useMergedRefs } from '../hooks/useMergedRefs.js';
9
9
  import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
10
10
  import { useOverlay } from '../hooks/useOverlay.js';
11
11
 
12
- const heightMap = {
13
- xsmall: '192px',
14
- small: '256px',
15
- medium: '320px',
16
- large: '432px',
17
- xlarge: '600px',
18
- auto: 'auto',
19
- initial: 'auto',
20
- // Passing 'initial' initially applies 'auto'
21
- 'fit-content': 'fit-content'
22
- };
23
- const widthMap = {
24
- small: '256px',
25
- medium: '320px',
26
- large: '480px',
27
- xlarge: '640px',
28
- xxlarge: '960px',
29
- auto: 'auto'
30
- };
31
12
  const animationDuration = 200;
32
13
  function getSlideAnimationStartingVector(anchorSide) {
33
14
  if (anchorSide !== null && anchorSide !== void 0 && anchorSide.endsWith('bottom')) {
@@ -329,4 +310,4 @@ const Overlay = /*#__PURE__*/React.forwardRef((t0, forwardedRef) => {
329
310
  return t13;
330
311
  });
331
312
 
332
- export { BaseOverlay, Overlay as default, heightMap, widthMap };
313
+ export { BaseOverlay, Overlay as default };
@@ -0,0 +1,19 @@
1
+ export declare const heightMap: {
2
+ xsmall: string;
3
+ small: string;
4
+ medium: string;
5
+ large: string;
6
+ xlarge: string;
7
+ auto: string;
8
+ initial: string;
9
+ 'fit-content': string;
10
+ };
11
+ export declare const widthMap: {
12
+ small: string;
13
+ medium: string;
14
+ large: string;
15
+ xlarge: string;
16
+ xxlarge: string;
17
+ auto: string;
18
+ };
19
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/Overlay/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;CASrB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA"}
@@ -0,0 +1,20 @@
1
+ const heightMap = {
2
+ xsmall: '192px',
3
+ small: '256px',
4
+ medium: '320px',
5
+ large: '432px',
6
+ xlarge: '600px',
7
+ auto: 'auto',
8
+ initial: 'auto',
9
+ 'fit-content': 'fit-content'
10
+ };
11
+ const widthMap = {
12
+ small: '256px',
13
+ medium: '320px',
14
+ large: '480px',
15
+ xlarge: '640px',
16
+ xxlarge: '960px',
17
+ auto: 'auto'
18
+ };
19
+
20
+ export { heightMap, widthMap };
@@ -1,18 +1,4 @@
1
1
  import React from 'react';
2
- /**
3
- * Register a container to serve as a portal root.
4
- * @param root The element that will be the root for portals created in this container
5
- * @param name The name of the container, to be used with the `containerName` prop on the Portal Component.
6
- * If name is not specified, registers the default portal root.
7
- */
8
- export declare function registerPortalRoot(root: Element, name?: string): void;
9
- /**
10
- * Provides the ability for component trees to override the portal root container for a sub-set of the experience.
11
- * The portal will prioritize the context value unless overridden by their own `containerName` prop, and fallback to the default root if neither are specified
12
- */
13
- export declare const PortalContext: React.Context<{
14
- portalContainerName?: string;
15
- }>;
16
2
  export interface PortalProps {
17
3
  /**
18
4
  * Called when this portal is added to the DOM
@@ -1 +1 @@
1
- {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../src/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AASvC;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAgC,GAAG,IAAI,CAE5F;AA4BD;;;GAGG;AACH,eAAO,MAAM,aAAa;0BACF,MAAM;EACxB,CAAA;AAEN,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA6CjE,CAAA"}
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../src/Portal/Portal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAMvC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,CA6CjE,CAAA"}
@@ -1,51 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { createPortal } from 'react-dom';
3
3
  import useIsomorphicLayoutEffect from '../utils/useIsomorphicLayoutEffect.js';
4
+ import { PortalContext } from './PortalContext.js';
5
+ import { DEFAULT_PORTAL_CONTAINER_NAME, ensureDefaultPortal, getPortalRoot } from './portalRoot.js';
4
6
 
5
- const PRIMER_PORTAL_ROOT_ID = '__primerPortalRoot__';
6
- const DEFAULT_PORTAL_CONTAINER_NAME = '__default__';
7
- const portalRootRegistry = {};
8
-
9
- /**
10
- * Register a container to serve as a portal root.
11
- * @param root The element that will be the root for portals created in this container
12
- * @param name The name of the container, to be used with the `containerName` prop on the Portal Component.
13
- * If name is not specified, registers the default portal root.
14
- */
15
- function registerPortalRoot(root, name = DEFAULT_PORTAL_CONTAINER_NAME) {
16
- portalRootRegistry[name] = root;
17
- }
18
-
19
- // Ensures that a default portal root exists and is registered. If a DOM element exists
20
- // with id __primerPortalRoot__, allow that element to serve as the default portal root.
21
- // Otherwise, create that element and attach it to the end of document.body.
22
- function ensureDefaultPortal() {
23
- const existingDefaultPortalContainer = portalRootRegistry[DEFAULT_PORTAL_CONTAINER_NAME];
24
- if (!existingDefaultPortalContainer || !document.body.contains(existingDefaultPortalContainer)) {
25
- let defaultPortalContainer = document.getElementById(PRIMER_PORTAL_ROOT_ID);
26
- if (!(defaultPortalContainer instanceof Element)) {
27
- defaultPortalContainer = document.createElement('div');
28
- defaultPortalContainer.setAttribute('id', PRIMER_PORTAL_ROOT_ID);
29
- defaultPortalContainer.style.position = 'absolute';
30
- defaultPortalContainer.style.top = '0';
31
- defaultPortalContainer.style.left = '0';
32
- defaultPortalContainer.style.width = '100%';
33
- const suitablePortalRoot = document.querySelector('[data-portal-root]');
34
- if (suitablePortalRoot) {
35
- suitablePortalRoot.appendChild(defaultPortalContainer);
36
- } else {
37
- document.body.appendChild(defaultPortalContainer);
38
- }
39
- }
40
- registerPortalRoot(defaultPortalContainer);
41
- }
42
- }
43
-
44
- /**
45
- * Provides the ability for component trees to override the portal root container for a sub-set of the experience.
46
- * The portal will prioritize the context value unless overridden by their own `containerName` prop, and fallback to the default root if neither are specified
47
- */
48
- const PortalContext = /*#__PURE__*/React.createContext({});
49
7
  /**
50
8
  * Creates a React Portal, placing all children in a separate physical DOM root node.
51
9
  * @see https://reactjs.org/docs/portals.html
@@ -79,7 +37,7 @@ const Portal = ({
79
37
  containerName = DEFAULT_PORTAL_CONTAINER_NAME;
80
38
  ensureDefaultPortal();
81
39
  }
82
- const parentElement = portalRootRegistry[containerName];
40
+ const parentElement = getPortalRoot(containerName);
83
41
  if (!parentElement) {
84
42
  throw new Error(`Portal container '${containerName}' is not yet registered. Container must be registered with registerPortalRoot before use.`);
85
43
  }
@@ -93,4 +51,4 @@ const Portal = ({
93
51
  return /*#__PURE__*/createPortal(children, element);
94
52
  };
95
53
 
96
- export { Portal, PortalContext, registerPortalRoot };
54
+ export { Portal };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare const PortalContext: React.Context<{
3
+ portalContainerName?: string;
4
+ }>;
5
+ //# sourceMappingURL=PortalContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalContext.d.ts","sourceRoot":"","sources":["../../src/Portal/PortalContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,aAAa;0BACF,MAAM;EACxB,CAAA"}
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+
3
+ const PortalContext = /*#__PURE__*/React.createContext({});
4
+
5
+ export { PortalContext };
@@ -1,5 +1,7 @@
1
1
  import type { PortalProps } from './Portal';
2
- import { Portal, registerPortalRoot, PortalContext } from './Portal';
2
+ import { Portal } from './Portal';
3
+ import { PortalContext } from './PortalContext';
4
+ import { registerPortalRoot } from './portalRoot';
3
5
  export default Portal;
4
6
  export { registerPortalRoot };
5
7
  export type { PortalProps };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Portal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AACzC,OAAO,EAAC,MAAM,EAAE,kBAAkB,EAAE,aAAa,EAAC,MAAM,UAAU,CAAA;AAElE,eAAe,MAAM,CAAA;AACrB,OAAO,EAAC,kBAAkB,EAAC,CAAA;AAC3B,YAAY,EAAC,WAAW,EAAC,CAAA;AACzB,OAAO,EAAC,aAAa,EAAC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Portal/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,UAAU,CAAA;AACzC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAA;AAE/C,eAAe,MAAM,CAAA;AACrB,OAAO,EAAC,kBAAkB,EAAC,CAAA;AAC3B,YAAY,EAAC,WAAW,EAAC,CAAA;AACzB,OAAO,EAAC,aAAa,EAAC,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { Portal } from './Portal.js';
2
- export { PortalContext, registerPortalRoot } from './Portal.js';
3
2
 
4
3
 
5
4
 
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_PORTAL_CONTAINER_NAME = "__default__";
2
+ /**
3
+ * Register a container to serve as a portal root.
4
+ * @param root The element that will be the root for portals created in this container
5
+ * @param name The name of the container, to be used with the `containerName` prop on the Portal Component.
6
+ * If name is not specified, registers the default portal root.
7
+ */
8
+ export declare function registerPortalRoot(root: Element, name?: string): void;
9
+ export declare function ensureDefaultPortal(): void;
10
+ export declare function getPortalRoot(name: string): Element | undefined;
11
+ //# sourceMappingURL=portalRoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portalRoot.d.ts","sourceRoot":"","sources":["../../src/Portal/portalRoot.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,6BAA6B,gBAAgB,CAAA;AAI1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,SAAgC,GAAG,IAAI,CAE5F;AAED,wBAAgB,mBAAmB,SAqBlC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,uBAEzC"}
@@ -0,0 +1,39 @@
1
+ const PRIMER_PORTAL_ROOT_ID = '__primerPortalRoot__';
2
+ const DEFAULT_PORTAL_CONTAINER_NAME = '__default__';
3
+ const portalRootRegistry = {};
4
+
5
+ /**
6
+ * Register a container to serve as a portal root.
7
+ * @param root The element that will be the root for portals created in this container
8
+ * @param name The name of the container, to be used with the `containerName` prop on the Portal Component.
9
+ * If name is not specified, registers the default portal root.
10
+ */
11
+ function registerPortalRoot(root, name = DEFAULT_PORTAL_CONTAINER_NAME) {
12
+ portalRootRegistry[name] = root;
13
+ }
14
+ function ensureDefaultPortal() {
15
+ const existingDefaultPortalContainer = portalRootRegistry[DEFAULT_PORTAL_CONTAINER_NAME];
16
+ if (!existingDefaultPortalContainer || !document.body.contains(existingDefaultPortalContainer)) {
17
+ let defaultPortalContainer = document.getElementById(PRIMER_PORTAL_ROOT_ID);
18
+ if (!(defaultPortalContainer instanceof Element)) {
19
+ defaultPortalContainer = document.createElement('div');
20
+ defaultPortalContainer.setAttribute('id', PRIMER_PORTAL_ROOT_ID);
21
+ defaultPortalContainer.style.position = 'absolute';
22
+ defaultPortalContainer.style.top = '0';
23
+ defaultPortalContainer.style.left = '0';
24
+ defaultPortalContainer.style.width = '100%';
25
+ const suitablePortalRoot = document.querySelector('[data-portal-root]');
26
+ if (suitablePortalRoot) {
27
+ suitablePortalRoot.appendChild(defaultPortalContainer);
28
+ } else {
29
+ document.body.appendChild(defaultPortalContainer);
30
+ }
31
+ }
32
+ registerPortalRoot(defaultPortalContainer);
33
+ }
34
+ }
35
+ function getPortalRoot(name) {
36
+ return portalRootRegistry[name];
37
+ }
38
+
39
+ export { DEFAULT_PORTAL_CONTAINER_NAME, ensureDefaultPortal, getPortalRoot, registerPortalRoot };
@@ -1,6 +1,6 @@
1
1
  import { c } from 'react-compiler-runtime';
2
2
  import React, { useContext } from 'react';
3
- import { RadioGroupContext } from '../RadioGroup/RadioGroup.js';
3
+ import { RadioGroupContext } from '../RadioGroup/RadioGroupContext.js';
4
4
  import { clsx } from 'clsx';
5
5
  import sharedClasses from '../Checkbox/shared.module.css.js';
6
6
  import classes from './Radio.module.css.js';
@@ -1,4 +1,4 @@
1
- import type { ChangeEvent, ChangeEventHandler, FC } from 'react';
1
+ import type { ChangeEvent, FC } from 'react';
2
2
  import type React from 'react';
3
3
  import type { CheckboxOrRadioGroupProps } from '../internal/components/CheckboxOrRadioGroup';
4
4
  export type RadioGroupProps = {
@@ -11,11 +11,6 @@ export type RadioGroupProps = {
11
11
  */
12
12
  name: string;
13
13
  } & CheckboxOrRadioGroupProps;
14
- export declare const RadioGroupContext: React.Context<{
15
- disabled?: boolean;
16
- onChange?: ChangeEventHandler<HTMLInputElement>;
17
- name: string;
18
- } | null>;
19
14
  declare const _default: FC<React.PropsWithChildren<RadioGroupProps>> & {
20
15
  Caption: import("..").FCWithSlotMarker<{
21
16
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAE,kBAAkB,EAAE,EAAE,EAAC,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,6CAA6C,CAAA;AAO1F,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAC/E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,yBAAyB,CAAA;AAE7B,eAAO,MAAM,iBAAiB;eACjB,OAAO;eACP,kBAAkB,CAAC,gBAAgB,CAAC;UACzC,MAAM;SACC,CAAA;;;;;;;;;;AAkCf,wBAIE"}
1
+ {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAsB,EAAE,EAAC,MAAM,OAAO,CAAA;AAC9D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAC,yBAAyB,EAAC,MAAM,6CAA6C,CAAA;AAQ1F,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAC/E;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,yBAAyB,CAAA;;;;;;;;;;AAkC7B,wBAIE"}
@@ -1,13 +1,12 @@
1
1
  import { c } from 'react-compiler-runtime';
2
- import { createContext } from 'react';
3
2
  import CheckboxOrRadioGroupCaption from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.js';
4
3
  import CheckboxOrRadioGroupLabel from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.js';
5
4
  import CheckboxOrRadioGroupValidation from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.js';
5
+ import { RadioGroupContext } from './RadioGroupContext.js';
6
6
  import { jsx } from 'react/jsx-runtime';
7
7
  import { useRenderForcingRef } from '../hooks/useRenderForcingRef.js';
8
8
  import CheckboxOrRadioGroup from '../internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js';
9
9
 
10
- const RadioGroupContext = /*#__PURE__*/createContext(null);
11
10
  const RadioGroup = t0 => {
12
11
  const $ = c(23);
13
12
  let children;
@@ -118,4 +117,4 @@ var RadioGroup_default = Object.assign(RadioGroup, {
118
117
  Validation: CheckboxOrRadioGroupValidation
119
118
  });
120
119
 
121
- export { RadioGroupContext, RadioGroup_default as default };
120
+ export { RadioGroup_default as default };
@@ -0,0 +1,7 @@
1
+ import { type ChangeEventHandler } from 'react';
2
+ export declare const RadioGroupContext: import("react").Context<{
3
+ disabled?: boolean;
4
+ onChange?: ChangeEventHandler<HTMLInputElement>;
5
+ name: string;
6
+ } | null>;
7
+ //# sourceMappingURL=RadioGroupContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RadioGroupContext.d.ts","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroupContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,kBAAkB,EAAgB,MAAM,OAAO,CAAA;AAE5D,eAAO,MAAM,iBAAiB;eACjB,OAAO;eACP,kBAAkB,CAAC,gBAAgB,CAAC;UACzC,MAAM;SACC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { createContext } from 'react';
2
+
3
+ const RadioGroupContext = /*#__PURE__*/createContext(null);
4
+
5
+ export { RadioGroupContext };
@@ -1,3 +1,4 @@
1
- export { default, RadioGroupContext } from './RadioGroup';
1
+ export { default } from './RadioGroup';
2
+ export { RadioGroupContext } from './RadioGroupContext';
2
3
  export type { RadioGroupProps } from './RadioGroup';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RadioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,cAAc,CAAA;AAEvD,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RadioGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAA;AACpC,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAA;AAErD,YAAY,EAAC,eAAe,EAAC,MAAM,cAAc,CAAA"}
@@ -8,7 +8,7 @@ import { ButtonComponent } from '../Button/Button.js';
8
8
  import { useId } from '../hooks/useId.js';
9
9
  import { useProvidedStateOrCreate } from '../hooks/useProvidedStateOrCreate.js';
10
10
  import useSafeTimeout from '../hooks/useSafeTimeout.js';
11
- import { FilteredActionListLoadingTypes } from '../FilteredActionList/FilteredActionListLoaders.js';
11
+ import '../FilteredActionList/FilteredActionListLoaders.js';
12
12
  import { announceFromElement, announce } from '@primer/live-region-element';
13
13
  import classes from './SelectPanel.module.css.js';
14
14
  import { clsx } from 'clsx';
@@ -22,6 +22,7 @@ import { useFeatureFlag } from '../FeatureFlags/useFeatureFlag.js';
22
22
  import { useProvidedRefOrCreate } from '../hooks/useProvidedRefOrCreate.js';
23
23
  import { AnchoredOverlay } from '../AnchoredOverlay/AnchoredOverlay.js';
24
24
  import Heading from '../Heading/Heading.js';
25
+ import { FilteredActionListLoadingTypes } from '../FilteredActionList/constants.js';
25
26
 
26
27
  const SHORT_DELAY_MS = 500;
27
28
  const LONG_DELAY_MS = 1000;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { ColorMode, ColorModeWithAuto, Theme } from './ThemeProvider';
3
+ export declare const ThemeContext: React.Context<{
4
+ theme?: Theme;
5
+ colorScheme?: string;
6
+ colorMode?: ColorModeWithAuto;
7
+ resolvedColorMode?: ColorMode;
8
+ resolvedColorScheme?: string;
9
+ dayScheme?: string;
10
+ nightScheme?: string;
11
+ setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
12
+ setDayScheme: React.Dispatch<React.SetStateAction<string>>;
13
+ setNightScheme: React.Dispatch<React.SetStateAction<string>>;
14
+ }>;
15
+ //# sourceMappingURL=ThemeContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeContext.d.ts","sourceRoot":"","sources":["../src/ThemeContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAC,MAAM,iBAAiB,CAAA;AAExE,eAAO,MAAM,YAAY;YACf,KAAK;kBACC,MAAM;gBACR,iBAAiB;wBACT,SAAS;0BACP,MAAM;gBAChB,MAAM;kBACJ,MAAM;kBACN,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;kBACvD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;oBAC1C,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;EAK5D,CAAA"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+
3
+ const ThemeContext = /*#__PURE__*/React.createContext({
4
+ setColorMode: () => null,
5
+ setDayScheme: () => null,
6
+ setNightScheme: () => null
7
+ });
8
+
9
+ export { ThemeContext };
@@ -3,7 +3,7 @@ export declare const defaultColorMode = "day";
3
3
  export type Theme = {
4
4
  [key: string]: any;
5
5
  };
6
- type ColorMode = 'day' | 'night' | 'light' | 'dark';
6
+ export type ColorMode = 'day' | 'night' | 'light' | 'dark';
7
7
  export type ColorModeWithAuto = ColorMode | 'auto';
8
8
  export type ThemeProviderProps = {
9
9
  colorMode?: ColorModeWithAuto;
@@ -21,18 +21,5 @@ export type ThemeProviderProps = {
21
21
  contextOnly?: boolean;
22
22
  };
23
23
  export declare const ThemeProvider: React.FC<React.PropsWithChildren<ThemeProviderProps>>;
24
- export declare function useTheme(): {
25
- theme?: Theme;
26
- colorScheme?: string;
27
- colorMode?: ColorModeWithAuto;
28
- resolvedColorMode?: ColorMode;
29
- resolvedColorScheme?: string;
30
- dayScheme?: string;
31
- nightScheme?: string;
32
- setColorMode: React.Dispatch<React.SetStateAction<ColorModeWithAuto>>;
33
- setDayScheme: React.Dispatch<React.SetStateAction<string>>;
34
- setNightScheme: React.Dispatch<React.SetStateAction<string>>;
35
- };
36
- export declare function useColorSchemeVar(values: Partial<Record<string, string>>, fallback: string): string;
37
24
  export default ThemeProvider;
38
25
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings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"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,eAAO,MAAM,gBAAgB,QAAQ,CAAA;AAKrC,MAAM,MAAM,KAAK,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAC,CAAA;AACxC,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAA;AAC1D,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,MAAM,CAAA;AAElD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AA6BD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CA2F/E,CAAA;AAqED,eAAe,aAAa,CAAA"}
@@ -3,6 +3,8 @@ import React from 'react';
3
3
  import theme from './theme.js';
4
4
  import deepmerge from 'deepmerge';
5
5
  import { useSyncedState } from './hooks/useSyncedState.js';
6
+ import { ThemeContext } from './ThemeContext.js';
7
+ import { useTheme } from './useTheme.js';
6
8
  import { jsx, jsxs } from 'react/jsx-runtime';
7
9
  import { useFeatureFlag } from './FeatureFlags/useFeatureFlag.js';
8
10
  import { useId } from './hooks/useId.js';
@@ -13,12 +15,6 @@ const defaultNightScheme = 'dark';
13
15
 
14
16
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
17
 
16
- const ThemeContext = /*#__PURE__*/React.createContext({
17
- setColorMode: () => null,
18
- setDayScheme: () => null,
19
- setNightScheme: () => null
20
- });
21
-
22
18
  // inspired from __NEXT_DATA__, we use application/json to avoid CSRF policy with inline scripts
23
19
  const serverHandoffCache = new Map();
24
20
  const emptyHandoff = {};
@@ -225,17 +221,6 @@ const ThemeProvider = t0 => {
225
221
  }
226
222
  return t10;
227
223
  };
228
- function useTheme() {
229
- return React.useContext(ThemeContext);
230
- }
231
- function useColorSchemeVar(values, fallback) {
232
- var _values$colorScheme;
233
- const {
234
- colorScheme: t0
235
- } = useTheme();
236
- const colorScheme = t0 === undefined ? "" : t0;
237
- return (_values$colorScheme = values[colorScheme]) !== null && _values$colorScheme !== void 0 ? _values$colorScheme : fallback;
238
- }
239
224
  function subscribeToSystemColorMode(callback) {
240
225
  var _window, _window$matchMedia;
241
226
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
@@ -298,4 +283,4 @@ function applyColorScheme(theme, colorScheme) {
298
283
  };
299
284
  }
300
285
 
301
- export { ThemeProvider, ThemeProvider as default, defaultColorMode, useColorSchemeVar, useTheme };
286
+ export { ThemeProvider, ThemeProvider as default, defaultColorMode };