@equinor/mad-dfw 0.0.2 → 0.0.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @equinor/mad-dfw
2
2
 
3
+ ## 0.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 61a8d3e: Added propertyrow component
8
+
3
9
  ## 0.0.2
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,80 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+
33
+ // src/dfwcomponents/PropertyRow/PropertyRow.tsx
34
+ import React from "react";
35
+ import {
36
+ EDSStyleSheet,
37
+ useStyles,
38
+ useBreakpoint,
39
+ Icon,
40
+ Typography
41
+ } from "@equinor/mad-components";
42
+ import { View } from "react-native";
43
+ var PropertyRow = (_a) => {
44
+ var _b = _a, { label, value, iconName } = _b, rest = __objRest(_b, ["label", "value", "iconName"]);
45
+ const breakpoint = useBreakpoint();
46
+ const styles = useStyles(themeStyles, { breakpoint });
47
+ const renderIcon = () => iconName && /* @__PURE__ */ React.createElement(Icon, { name: iconName, size: 20, style: styles.iconStyle, color: "textTertiary" });
48
+ const labelProps = breakpoint === "xs" ? { group: "paragraph", variant: "overline" } : { group: "paragraph", variant: "body_short" };
49
+ return /* @__PURE__ */ React.createElement(View, __spreadProps(__spreadValues({}, rest), { style: [styles.propertyLabel, rest.style] }), breakpoint === "xs" && renderIcon(), /* @__PURE__ */ React.createElement(View, { style: styles.textContainer }, /* @__PURE__ */ React.createElement(View, { style: styles.labelStyle }, breakpoint !== "xs" && renderIcon(), /* @__PURE__ */ React.createElement(Typography, __spreadProps(__spreadValues({}, labelProps), { color: "textTertiary" }), label)), /* @__PURE__ */ React.createElement(
50
+ Typography,
51
+ {
52
+ group: "paragraph",
53
+ variant: "body_short",
54
+ color: "textTertiary",
55
+ style: { flex: 1 },
56
+ numberOfLines: 1
57
+ },
58
+ value
59
+ )));
60
+ };
61
+ var themeStyles = EDSStyleSheet.create((_, { breakpoint }) => ({
62
+ propertyLabel: {
63
+ flexDirection: "row",
64
+ alignItems: "center"
65
+ },
66
+ iconStyle: {
67
+ paddingRight: 10
68
+ },
69
+ labelStyle: {
70
+ flexDirection: "row",
71
+ minWidth: breakpoint !== "xs" ? 232 : 0
72
+ },
73
+ textContainer: {
74
+ flexDirection: breakpoint === "xs" ? "column" : "row"
75
+ }
76
+ }));
77
+
78
+ export {
79
+ PropertyRow
80
+ };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { IconName } from "@equinor/mad-components";
3
+ import { ViewProps } from "react-native";
4
+ export type PropertyRowProps = {
5
+ label: string;
6
+ value: string;
7
+ iconName?: IconName;
8
+ } & ViewProps;
9
+ export declare const PropertyRow: ({ label, value, iconName, ...rest }: PropertyRowProps) => React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import {
2
+ PropertyRow
3
+ } from "../../chunk-JLN4BW2C.js";
4
+ export {
5
+ PropertyRow
6
+ };
@@ -0,0 +1 @@
1
+ export * from "./PropertyRow";
@@ -0,0 +1,7 @@
1
+ import "../../chunk-2JQRYR7Z.js";
2
+ import {
3
+ PropertyRow
4
+ } from "../../chunk-JLN4BW2C.js";
5
+ export {
6
+ PropertyRow
7
+ };
@@ -0,0 +1 @@
1
+ export * from "./dfwcomponents/PropertyRow";
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import "./chunk-2JQRYR7Z.js";
2
+ import {
3
+ PropertyRow
4
+ } from "./chunk-JLN4BW2C.js";
5
+ export {
6
+ PropertyRow
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/mad-dfw",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A React Native component library for the Digital Field Worker applications.",
5
5
  "type": "module",
6
6
  "keywords": [
File without changes
File without changes