@primer/react 38.26.0 → 38.27.0-rc.040f4cc18

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 (54) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/ActionList/ActionList-1940009e.css +2 -0
  3. package/dist/ActionList/ActionList-1940009e.css.map +1 -0
  4. package/dist/ActionList/ActionList.module.css.js +2 -2
  5. package/dist/ActionList/Item.d.ts.map +1 -1
  6. package/dist/ActionList/Item.js +125 -118
  7. package/dist/ActionList/TrailingAction.d.ts.map +1 -1
  8. package/dist/ActionList/TrailingAction.js +1 -0
  9. package/dist/ActionList/Visuals.js +6 -4
  10. package/dist/Dialog/Dialog.d.ts +1 -0
  11. package/dist/Dialog/Dialog.d.ts.map +1 -1
  12. package/dist/Dialog/Dialog.js +16 -2
  13. package/dist/KeybindingHint/KeybindingHint.d.ts +6 -1
  14. package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
  15. package/dist/KeybindingHint/KeybindingHint.js +6 -2
  16. package/dist/KeybindingHint/components/Chord.d.ts +2 -1
  17. package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
  18. package/dist/KeybindingHint/components/Chord.js +1 -1
  19. package/dist/KeybindingHint/components/Key.js +10 -10
  20. package/dist/KeybindingHint/components/Sequence.d.ts +2 -1
  21. package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
  22. package/dist/KeybindingHint/components/Sequence.js +2 -2
  23. package/dist/KeybindingHint/key-names.d.ts +4 -3
  24. package/dist/KeybindingHint/key-names.d.ts.map +1 -1
  25. package/dist/KeybindingHint/key-names.js +15 -14
  26. package/dist/KeybindingHint/platform.d.ts +22 -0
  27. package/dist/KeybindingHint/platform.d.ts.map +1 -0
  28. package/dist/KeybindingHint/platform.js +61 -0
  29. package/dist/PageLayout/PageLayout.d.ts +24 -6
  30. package/dist/PageLayout/PageLayout.d.ts.map +1 -1
  31. package/dist/PageLayout/PageLayout.js +7 -2
  32. package/dist/Text/{Text-ca7603b7.css → Text-d649cda5.css} +2 -2
  33. package/dist/Text/Text-d649cda5.css.map +1 -0
  34. package/dist/Text/Text.d.ts +3 -0
  35. package/dist/Text/Text.d.ts.map +1 -1
  36. package/dist/Text/Text.js +20 -14
  37. package/dist/Text/Text.module.css.js +1 -1
  38. package/dist/Timeline/Timeline.d.ts +2 -1
  39. package/dist/Timeline/Timeline.d.ts.map +1 -1
  40. package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
  41. package/dist/TooltipV2/Tooltip.js +3 -3
  42. package/dist/TreeView/TreeView-1bf45a33.css +2 -0
  43. package/dist/TreeView/TreeView-1bf45a33.css.map +1 -0
  44. package/dist/TreeView/TreeView.d.ts.map +1 -1
  45. package/dist/TreeView/TreeView.js +25 -12
  46. package/dist/TreeView/TreeView.module.css.js +2 -2
  47. package/generated/components.json +57 -10
  48. package/package.json +2 -2
  49. package/dist/ActionList/ActionList-2a35a40c.css +0 -2
  50. package/dist/ActionList/ActionList-2a35a40c.css.map +0 -1
  51. package/dist/Text/Text-ca7603b7.css.map +0 -1
  52. package/dist/TreeView/TreeView-0fe09f34.css +0 -2
  53. package/dist/TreeView/TreeView-0fe09f34.css.map +0 -1
  54. package/dist/hooks/useIsMacOS.js +0 -32
@@ -1,32 +0,0 @@
1
- import { isMacOS } from '@primer/behaviors/utils';
2
- import { useSyncExternalStore } from 'react';
3
-
4
- // No-op. The platform never changes at runtime, so there is nothing to
5
- // subscribe to. Hoisted to avoid creating a new function on every call.
6
- const subscribe = () => () => {};
7
-
8
- // Safe default for SSR since we can't detect the platform on the server.
9
- const getServerSnapshot = () => false;
10
-
11
- /**
12
- * SSR-safe hook for determining if the current platform is MacOS.
13
- *
14
- * Uses `useSyncExternalStore` to read the platform value:
15
- *
16
- * - On the **client**, `ssrUnsafeIsMacOS` reads `navigator.userAgent` and
17
- * returns the real value immediately, with no extra render pass.
18
- *
19
- * - On the **server**, returns `false`. During hydration, if the snapshots
20
- * differ, React handles the mismatch internally in a single synchronous
21
- * pass, avoiding the layout shift that a deferred `useEffect` + `setState`
22
- * would cause.
23
- *
24
- * Previous implementation used `useState` + `useEffect`, which caused an
25
- * unconditional second render on every mount (even on the client where the
26
- * initial value was already correct).
27
- */
28
- function useIsMacOS() {
29
- return useSyncExternalStore(subscribe, isMacOS, getServerSnapshot);
30
- }
31
-
32
- export { useIsMacOS };