@muraldevkit/ui-toolkit 1.21.10 → 1.22.0
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.
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* browser: mobile and desktop browsers
|
|
4
|
+
* native: native app running on tablets and phones
|
|
5
|
+
* display: SmartHubs and other big displays
|
|
6
|
+
*/
|
|
7
|
+
export type MrlDeviceClient = 'browser' | 'native' | 'display';
|
|
8
|
+
export interface MrlDeviceProviderProps {
|
|
9
|
+
/** The child elements to be wrapped by the MrlDeviceProvider. */
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/** The type of client where the UI toolkit is running: 'browser', 'native', or 'display'. */
|
|
12
|
+
client: MrlDeviceClient;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Provides context for switching the views according to the client type (browser, mobile or display).
|
|
16
|
+
*
|
|
17
|
+
* `client` can be retrieved using the `useDeviceClient()` hook. Defaults to `browser` when running outside the provider.
|
|
18
|
+
*
|
|
19
|
+
* @param {MrlDeviceClient} props.client The client type where ui-toolkit is running
|
|
20
|
+
* @returns the devices provider component
|
|
21
|
+
*/
|
|
22
|
+
export declare function MrlDeviceProvider({ children, client }: MrlDeviceProviderProps): React.ReactElement;
|
|
23
|
+
/**
|
|
24
|
+
* React hook for customizing the UI according to the client type.
|
|
25
|
+
*
|
|
26
|
+
* @returns {MrlDeviceClient} 'browser' | 'native' | 'display' (defaults to 'browser' called outside MrlDeviceProvider is present)
|
|
27
|
+
*/
|
|
28
|
+
export declare function useDeviceClient(): MrlDeviceClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlDeviceProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlDeviceProvider';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './components';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export * from './contexts';
|