@pantheon-systems/pds-toolkit-react 2.0.0-beta.16 → 2.0.0-beta.17
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/components/media/Illustration/generated-illustration-data.d.ts +1 -1
- package/dist/css/component-css/pds-button.css +1 -1
- package/dist/css/component-css/pds-index.css +1 -1
- package/dist/css/layout-css/pds-app-layout.css +1 -1
- package/dist/css/layout-css/pds-index.css +1 -1
- package/dist/css/pds-components.css +1 -1
- package/dist/css/pds-layouts.css +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +993 -1008
- package/dist/index.js.map +1 -1
- package/dist/utilities/hooks/useBreakpoint/useBreakpoint.d.ts +3 -0
- package/dist/utilities/hooks/useMediaQuery/subscribeToMediaQuery.d.ts +6 -0
- package/dist/utilities/hooks/useMediaQuery/useMediaQuery.d.ts +0 -16
- package/package.json +1 -1
|
@@ -8,6 +8,9 @@ export type Breakpoint = 'sm' | 'md' | 'lg' | 'xl';
|
|
|
8
8
|
* - lg: 1280-1439px (desktop)
|
|
9
9
|
* - xl: 1440px+ (large desktop)
|
|
10
10
|
*
|
|
11
|
+
* Server-rendered output and the first hydration render use `lg`; the real
|
|
12
|
+
* breakpoint applies right after hydration.
|
|
13
|
+
*
|
|
11
14
|
* @returns {Breakpoint} Current breakpoint name
|
|
12
15
|
*
|
|
13
16
|
* @example
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscribes to changes of a media query and returns the cleanup function.
|
|
3
|
+
* Shared by `useMediaQuery` and `useBreakpoint`; browser-only, so call it from
|
|
4
|
+
* a `useSyncExternalStore` subscribe function, never during render.
|
|
5
|
+
*/
|
|
6
|
+
export declare const subscribeToMediaQuery: (query: string, onChange: () => void) => (() => void);
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for matching CSS media queries in JavaScript.
|
|
3
|
-
*
|
|
4
|
-
* @param {string} query - CSS media query string (e.g., "(min-width: 768px)")
|
|
5
|
-
* @returns {boolean} Whether the media query currently matches
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* // Using with breakpoint constants
|
|
9
|
-
* import { BP_M } from '@pantheon-systems/pds-design-tokens/build/js/variables.global.js';
|
|
10
|
-
* const isTabletOrLarger = useMediaQuery(`(min-width: ${BP_M}px)`);
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* // Using with custom query
|
|
14
|
-
* const prefersReducedMotion = useMediaQuery('(prefers-reduced-motion: reduce)');
|
|
15
|
-
* const isDarkMode = useMediaQuery('(prefers-color-scheme: dark)');
|
|
16
|
-
*/
|
|
17
1
|
export declare const useMediaQuery: (query: string) => boolean;
|
package/package.json
CHANGED