@pantheon-systems/pds-toolkit-react 2.0.0-alpha.45 → 2.0.0-alpha.46
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/dist/components/icons/Icon/generated-icon-data.d.ts +1 -1
- package/dist/css/component-css/pds-index.css +1 -1
- package/dist/css/component-css/pds-navbar.css +1 -1
- package/dist/css/pds-components.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1217 -1220
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +1 -0
- package/dist/utilities/hooks/useIsMobile/useIsMobile.d.ts +16 -0
- package/package.json +1 -1
package/dist/index.source.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ export * from './utilities/grid/GridItem';
|
|
|
126
126
|
export * from './utilities/hooks/useBreakpoint/useBreakpoint';
|
|
127
127
|
export * from './utilities/hooks/useClipboard/useClipboard';
|
|
128
128
|
export * from './utilities/hooks/useDropdown';
|
|
129
|
+
export * from './utilities/hooks/useIsMobile/useIsMobile';
|
|
129
130
|
export * from './utilities/hooks/useKeyPress/useKeyPress';
|
|
130
131
|
export * from './utilities/hooks/useMediaQuery/useMediaQuery';
|
|
131
132
|
export * from './utilities/hooks/useWindowWidth/useWindowWidth';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns whether the layout is currently in its mobile presentation, tracking
|
|
3
|
+
* the `data-pds-mobile` attribute that `GlobalWrapper` sets on the document
|
|
4
|
+
* root. Reactive: updates when the breakpoint is crossed.
|
|
5
|
+
*
|
|
6
|
+
* Use this to render only the active responsive variant of a component, rather
|
|
7
|
+
* than mounting both a mobile and a desktop tree and toggling them with CSS —
|
|
8
|
+
* mounting both duplicates any ids in the slotted content (invalid HTML) and
|
|
9
|
+
* makes `getElementById`/`htmlFor`/`aria-controls` resolve to the hidden copy.
|
|
10
|
+
*
|
|
11
|
+
* SSR-safe: resolves to `false` (desktop) on the server and on the first client
|
|
12
|
+
* render, then updates after `GlobalWrapper` applies the attribute.
|
|
13
|
+
*
|
|
14
|
+
* @returns {boolean} `true` when the mobile presentation is active.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useIsMobile: () => boolean;
|
package/package.json
CHANGED