@sudobility/components-rn 1.0.39 → 1.0.40
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/index.cjs.js +21 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +21 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/ui/AppVersion/AppVersion.d.ts +24 -0
- package/dist/ui/AppVersion/AppVersion.d.ts.map +1 -0
- package/dist/ui/AppVersion/index.d.ts +3 -0
- package/dist/ui/AppVersion/index.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/ui/AppVersion/AppVersion.tsx +42 -0
- package/src/ui/AppVersion/index.ts +2 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface AppVersionProps {
|
|
3
|
+
/** App display name */
|
|
4
|
+
appName: string;
|
|
5
|
+
/** Version string (e.g. from package.json) */
|
|
6
|
+
version: string;
|
|
7
|
+
/** Additional className */
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AppVersion Component
|
|
12
|
+
*
|
|
13
|
+
* Displays the app name and version in a muted text style.
|
|
14
|
+
* Reads the version from the consuming app's package.json.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { version } from '../package.json';
|
|
19
|
+
* <AppVersion appName="MyApp" version={version} />
|
|
20
|
+
* // renders: "MyApp v1.0.0"
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare const AppVersion: React.FC<AppVersionProps>;
|
|
24
|
+
//# sourceMappingURL=AppVersion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppVersion.d.ts","sourceRoot":"","sources":["../../../src/ui/AppVersion/AppVersion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAehD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ui/AppVersion/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { cn } from '../../lib/utils';
|
|
4
|
+
|
|
5
|
+
export interface AppVersionProps {
|
|
6
|
+
/** App display name */
|
|
7
|
+
appName: string;
|
|
8
|
+
/** Version string (e.g. from package.json) */
|
|
9
|
+
version: string;
|
|
10
|
+
/** Additional className */
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* AppVersion Component
|
|
16
|
+
*
|
|
17
|
+
* Displays the app name and version in a muted text style.
|
|
18
|
+
* Reads the version from the consuming app's package.json.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* import { version } from '../package.json';
|
|
23
|
+
* <AppVersion appName="MyApp" version={version} />
|
|
24
|
+
* // renders: "MyApp v1.0.0"
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const AppVersion: React.FC<AppVersionProps> = ({
|
|
28
|
+
appName,
|
|
29
|
+
version,
|
|
30
|
+
className,
|
|
31
|
+
}) => {
|
|
32
|
+
return (
|
|
33
|
+
<Text
|
|
34
|
+
className={cn(
|
|
35
|
+
'text-sm text-gray-500 dark:text-gray-400 text-center',
|
|
36
|
+
className
|
|
37
|
+
)}
|
|
38
|
+
>
|
|
39
|
+
{appName} v{version}
|
|
40
|
+
</Text>
|
|
41
|
+
);
|
|
42
|
+
};
|