@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.
- package/CHANGELOG.md +24 -0
- package/dist/ActionList/ActionList-1940009e.css +2 -0
- package/dist/ActionList/ActionList-1940009e.css.map +1 -0
- package/dist/ActionList/ActionList.module.css.js +2 -2
- package/dist/ActionList/Item.d.ts.map +1 -1
- package/dist/ActionList/Item.js +125 -118
- package/dist/ActionList/TrailingAction.d.ts.map +1 -1
- package/dist/ActionList/TrailingAction.js +1 -0
- package/dist/ActionList/Visuals.js +6 -4
- package/dist/Dialog/Dialog.d.ts +1 -0
- package/dist/Dialog/Dialog.d.ts.map +1 -1
- package/dist/Dialog/Dialog.js +16 -2
- package/dist/KeybindingHint/KeybindingHint.d.ts +6 -1
- package/dist/KeybindingHint/KeybindingHint.d.ts.map +1 -1
- package/dist/KeybindingHint/KeybindingHint.js +6 -2
- package/dist/KeybindingHint/components/Chord.d.ts +2 -1
- package/dist/KeybindingHint/components/Chord.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Chord.js +1 -1
- package/dist/KeybindingHint/components/Key.js +10 -10
- package/dist/KeybindingHint/components/Sequence.d.ts +2 -1
- package/dist/KeybindingHint/components/Sequence.d.ts.map +1 -1
- package/dist/KeybindingHint/components/Sequence.js +2 -2
- package/dist/KeybindingHint/key-names.d.ts +4 -3
- package/dist/KeybindingHint/key-names.d.ts.map +1 -1
- package/dist/KeybindingHint/key-names.js +15 -14
- package/dist/KeybindingHint/platform.d.ts +22 -0
- package/dist/KeybindingHint/platform.d.ts.map +1 -0
- package/dist/KeybindingHint/platform.js +61 -0
- package/dist/PageLayout/PageLayout.d.ts +24 -6
- package/dist/PageLayout/PageLayout.d.ts.map +1 -1
- package/dist/PageLayout/PageLayout.js +7 -2
- package/dist/Text/{Text-ca7603b7.css → Text-d649cda5.css} +2 -2
- package/dist/Text/Text-d649cda5.css.map +1 -0
- package/dist/Text/Text.d.ts +3 -0
- package/dist/Text/Text.d.ts.map +1 -1
- package/dist/Text/Text.js +20 -14
- package/dist/Text/Text.module.css.js +1 -1
- package/dist/Timeline/Timeline.d.ts +2 -1
- package/dist/Timeline/Timeline.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.d.ts.map +1 -1
- package/dist/TooltipV2/Tooltip.js +3 -3
- package/dist/TreeView/TreeView-1bf45a33.css +2 -0
- package/dist/TreeView/TreeView-1bf45a33.css.map +1 -0
- package/dist/TreeView/TreeView.d.ts.map +1 -1
- package/dist/TreeView/TreeView.js +25 -12
- package/dist/TreeView/TreeView.module.css.js +2 -2
- package/generated/components.json +57 -10
- package/package.json +2 -2
- package/dist/ActionList/ActionList-2a35a40c.css +0 -2
- package/dist/ActionList/ActionList-2a35a40c.css.map +0 -1
- package/dist/Text/Text-ca7603b7.css.map +0 -1
- package/dist/TreeView/TreeView-0fe09f34.css +0 -2
- package/dist/TreeView/TreeView-0fe09f34.css.map +0 -1
- package/dist/hooks/useIsMacOS.js +0 -32
package/dist/hooks/useIsMacOS.js
DELETED
|
@@ -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 };
|