trimble-terra 1.1.6 → 1.1.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"SpecialButton.d.ts","sourceRoot":"","sources":["../../../../src/component/SpecialButton/SpecialButton.tsx"],"names":[],"mappings":"AACA,OAAO,sBAAsB,CAAC;AAQ9B,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,6EAQ3B,aAAa,4CA4Hf,CAAC"}
1
+ {"version":3,"file":"SpecialButton.d.ts","sourceRoot":"","sources":["../../../../src/component/SpecialButton/SpecialButton.tsx"],"names":[],"mappings":"AACA,OAAO,sBAAsB,CAAC;AAS9B,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,aAAa,CAAC,EAAE,GAAG,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,6EAQ3B,aAAa,4CAgIf,CAAC"}
@@ -1,65 +1,66 @@
1
- import { jsxs as i, jsx as t, Fragment as _ } from "react/jsx-runtime";
2
- import { useState as y, useEffect as x } from "react";
1
+ import { jsxs as a, jsx as t, Fragment as y } from "react/jsx-runtime";
2
+ import { useState as N, useEffect as B } from "react";
3
3
  import './SpecialButton.css';/* empty css */
4
- import { Icon as N } from "@trimble-creative-strategy/trimble-mxp-icons";
5
- import { getAppleAppStoreBtn as B, getGooglePlayStoreBtn as D } from "../../utils/imageAssets.js";
6
- const L = ({
7
- primary: j = !0,
4
+ import { Icon as j } from "@trimble-creative-strategy/trimble-mxp-icons";
5
+ import D from "../../utils/isExternalLink.js";
6
+ import { getAppleAppStoreBtn as E, getGooglePlayStoreBtn as C } from "../../utils/imageAssets.js";
7
+ const O = ({
8
+ primary: v = !0,
8
9
  size: s = "medium",
9
- label: a,
10
- destination: n,
11
- iconColor: u,
12
- utmParams: v,
13
- LinkComponent: p
10
+ label: u,
11
+ destination: r,
12
+ iconColor: p,
13
+ utmParams: x,
14
+ LinkComponent: f
14
15
  }) => {
15
- const [e, f] = y(null), [C, m] = y(!0), r = !!(typeof n == "string" && n?.includes("apps.apple.com")), o = !!(typeof n == "string" && n?.includes("play.google.com"));
16
- x(() => {
16
+ const [e, m] = N(null), [I, g] = N(!0), o = !!(typeof r == "string" && r?.includes("apps.apple.com")), n = !!(typeof r == "string" && r?.includes("play.google.com"));
17
+ B(() => {
17
18
  (async () => {
18
- if (m(!0), !r && !o)
19
+ if (g(!0), !o && !n)
19
20
  return null;
20
- r ? f(await B()) : o && f(await D()), m(!1);
21
+ o ? m(await E()) : n && m(await C()), g(!1);
21
22
  })();
22
- }, [r, o]);
23
- const h = j ? "t2-spbutton--primary" : "t2-spbutton--secondary";
24
- let c = 12;
25
- s == "small" ? c = 12 : s == "medium" ? c = 18 : s == "large" && (c = 20);
26
- const S = (l, d) => {
23
+ }, [o, n]);
24
+ const h = v ? "t2-spbutton--primary" : "t2-spbutton--secondary";
25
+ let i = 12;
26
+ s == "small" ? i = 12 : s == "medium" ? i = 18 : s == "large" && (i = 20);
27
+ const S = (l, b) => {
27
28
  if (!l) return "";
28
29
  try {
29
- const b = new URL(l);
30
- return d && Object.entries(d).forEach(([$, w]) => {
31
- b.searchParams.set($, w);
32
- }), b.toString();
30
+ const _ = new URL(l);
31
+ return b && Object.entries(b).forEach(([$, w]) => {
32
+ _.searchParams.set($, w);
33
+ }), _.toString();
33
34
  } catch {
34
35
  return l;
35
36
  }
36
- }, g = (s == "large", "t2u-chevron-right");
37
- if (p)
38
- return /* @__PURE__ */ i(
39
- p,
37
+ }, d = (s == "large", "t2u-chevron-right"), c = D(r);
38
+ if (f && !c)
39
+ return /* @__PURE__ */ a(
40
+ f,
40
41
  {
41
42
  className: ["t2-spbutton__wrap", `${h}`].join(" "),
42
- href: n || "#default",
43
+ href: r || "#default",
43
44
  tabIndex: 0,
44
45
  children: [
45
- r && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
46
46
  o && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
47
- !r && !o ? /* @__PURE__ */ i(_, { children: [
48
- /* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: a }),
47
+ n && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
48
+ !o && !n ? /* @__PURE__ */ a(y, { children: [
49
+ /* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: u }),
49
50
  /* @__PURE__ */ t(
50
51
  "div",
51
52
  {
52
53
  className: [
53
54
  "t2-spbutton",
54
- `t2-spbutton-${u}`,
55
+ `t2-spbutton-${p}`,
55
56
  `t2-spbutton--${s}`
56
57
  ].join(" "),
57
58
  children: /* @__PURE__ */ t(
58
- N,
59
+ j,
59
60
  {
60
61
  className: "t2-spbutton__submit-icon",
61
- type: g,
62
- size: c,
62
+ type: d,
63
+ size: i,
63
64
  fillColor: "currentColor"
64
65
  }
65
66
  )
@@ -70,32 +71,34 @@ const L = ({
70
71
  }
71
72
  );
72
73
  {
73
- const l = S(n, v);
74
- return /* @__PURE__ */ i(
74
+ const l = S(r, x);
75
+ return /* @__PURE__ */ a(
75
76
  "a",
76
77
  {
77
78
  className: ["t2-spbutton__wrap", `${h}`].join(" "),
78
79
  href: l,
79
80
  tabIndex: 0,
81
+ target: c ? "_blank" : "_self",
82
+ rel: c ? "noopener noreferrer" : void 0,
80
83
  children: [
81
- r && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
82
84
  o && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
83
- !r && !o ? /* @__PURE__ */ i(_, { children: [
84
- /* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: a }),
85
+ n && e && /* @__PURE__ */ t("img", { src: e, height: 65 }),
86
+ !o && !n ? /* @__PURE__ */ a(y, { children: [
87
+ /* @__PURE__ */ t("div", { className: "t2-spbutton__field", children: u }),
85
88
  /* @__PURE__ */ t(
86
89
  "div",
87
90
  {
88
91
  className: [
89
92
  "t2-spbutton",
90
- `t2-spbutton-${u}`,
93
+ `t2-spbutton-${p}`,
91
94
  `t2-spbutton--${s}`
92
95
  ].join(" "),
93
96
  children: /* @__PURE__ */ t(
94
- N,
97
+ j,
95
98
  {
96
99
  className: "t2-spbutton__submit-icon",
97
- type: g,
98
- size: c,
100
+ type: d,
101
+ size: i,
99
102
  fillColor: "currentColor"
100
103
  }
101
104
  )
@@ -108,5 +111,5 @@ const L = ({
108
111
  }
109
112
  };
110
113
  export {
111
- L as SpecialButton
114
+ O as SpecialButton
112
115
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trimble-terra",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "Trimble Terra — React component library for Trimble MXP2 web experiences",
5
5
  "publishConfig": {
6
6
  "access": "public"