trimble-terra 1.5.0 → 1.6.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
.ter-cart-item+.ter-cart-item{border-top:1px solid #e0e1e9}.ter-cart-item{display:flex;justify-content:flex-start;gap:16px;padding:32px 0}.ter-cart-item .t2-quantity-tracker__wrapper{flex:0 1 140px;min-width:72px}.ter-cart-item .t2-quantity-tracker__input-wrapper{width:100%}.ter-cart-item__figure{all:unset;outline:1px solid #f1f1f6;min-width:115px;width:115px;height:115px}.ter-cart-item__figure__img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ter-cart-item__details{flex-grow:1}.ter-cart-item__product-name{font-size:1.25rem;line-height:1.75rem;font-weight:700;margin-bottom:4px;margin-top:0}.ter-cart-item__sku{font-size:.875rem;line-height:1.125rem;margin-bottom:4px;line-height:24px}.ter-cart-item__price-wrapper{margin:4px 0}.ter-cart-item__price{font-size:1rem;line-height:1.75rem;font-weight:800}.ter-cart-item__price--strike{display:block;font-size:16px;font-weight:600;color:#90939f;text-decoration:line-through;line-height:28px}.ter-cart-item__duration{font-size:.875rem;line-height:1.125rem}.ter-cart-item__discount{margin:4px 0}.ter-cart-item__qty{display:flex;align-items:center;flex-wrap:nowrap;gap:12px;margin-top:16px}.ter-cart-item__qty__label{font-weight:600;font-size:.875rem;line-height:1.25rem;font-weight:700}.ter-cart-item__credit-notice{margin-top:16px;display:flex;flex-direction:column;gap:16px}.ter-cart-item__credit-notice__line{font-size:.875rem;line-height:1.125rem;margin:0;color:#353a40}.ter-cart-item__credit-notice__line strong{font-weight:700!important}.ter-cart-item__remove{all:unset;font-weight:600;font-size:.875rem;line-height:1.25rem;color:#252a2e;font-weight:700;-webkit-text-decoration:underline solid 2px #fbad26;text-decoration:underline solid 2px #fbad26;text-underline-offset:4px;cursor:pointer;display:flex;align-items:center;flex-shrink:0;margin-top:16px}.ter-cart-item__remove:focus,.ter-cart-item__remove:active{font-weight:700}.ter-cart-item__remove svg{color:#252a2e;flex-shrink:0}.ter-cart-item__link{font-weight:600;font-size:.875rem;line-height:1.25rem;font-weight:700}.ter-cart-item .t2-credits-tracker__error{margin-bottom:0}.ter-cart-item__credits-tracker.t2-credits-tracker{width:
|
|
1
|
+
.ter-cart-item+.ter-cart-item{border-top:1px solid #e0e1e9}.ter-cart-item{display:flex;justify-content:flex-start;gap:16px;padding:32px 0}.ter-cart-item .t2-quantity-tracker__wrapper{flex:0 1 140px;min-width:72px}.ter-cart-item .t2-quantity-tracker__input-wrapper{width:100%}.ter-cart-item__figure{all:unset;outline:1px solid #f1f1f6;min-width:115px;width:115px;height:115px}.ter-cart-item__figure__img{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.ter-cart-item__details{flex-grow:1}.ter-cart-item__product-name{font-size:1.25rem;line-height:1.75rem;font-weight:700;margin-bottom:4px;margin-top:0}.ter-cart-item__sku{font-size:.875rem;line-height:1.125rem;margin-bottom:4px;line-height:24px}.ter-cart-item__price-wrapper{margin:4px 0}.ter-cart-item__price{font-size:1rem;line-height:1.75rem;font-weight:800}.ter-cart-item__price--strike{display:block;font-size:16px;font-weight:600;color:#90939f;text-decoration:line-through;line-height:28px}.ter-cart-item__duration{font-size:.875rem;line-height:1.125rem}.ter-cart-item__discount{margin:4px 0}.ter-cart-item__qty{display:flex;align-items:center;flex-wrap:nowrap;gap:12px;margin-top:16px}.ter-cart-item__qty__label{font-weight:600;font-size:.875rem;line-height:1.25rem;font-weight:700}.ter-cart-item__qty--credits{flex-direction:column;align-items:stretch;gap:8px}.ter-cart-item__qty--credits .ter-cart-item__qty__label{white-space:nowrap}.ter-cart-item__credit-notice{margin-top:16px;display:flex;flex-direction:column;gap:16px}.ter-cart-item__credit-notice__line{font-size:.875rem;line-height:1.125rem;margin:0;color:#353a40}.ter-cart-item__credit-notice__line strong{font-weight:700!important}.ter-cart-item__remove{all:unset;font-weight:600;font-size:.875rem;line-height:1.25rem;color:#252a2e;font-weight:700;-webkit-text-decoration:underline solid 2px #fbad26;text-decoration:underline solid 2px #fbad26;text-underline-offset:4px;cursor:pointer;display:flex;align-items:center;flex-shrink:0;margin-top:16px}.ter-cart-item__remove:focus,.ter-cart-item__remove:active{font-weight:700}.ter-cart-item__remove svg{color:#252a2e;flex-shrink:0}.ter-cart-item__link{font-weight:600;font-size:.875rem;line-height:1.25rem;font-weight:700}.ter-cart-item .t2-credits-tracker__error{margin-bottom:0}.ter-cart-item__credits-tracker.t2-credits-tracker{width:100%!important;max-width:none!important;height:32px!important}.ter-cart-item__credits-tracker.t2-credits-tracker .t2-credits-tracker__input{padding:0 34px!important;font-size:14px!important}.ter-cart-item__credits-tracker.t2-credits-tracker .t2-credits-tracker__button{width:24px!important}.ter-cart-item__credits-tracker.t2-credits-tracker .t2-credits-tracker__button.t2-credits-tracker__button--decrease{left:10px!important}.ter-cart-item__credits-tracker.t2-credits-tracker .t2-credits-tracker__button.t2-credits-tracker__button--increase{right:10px!important}.ter-cart-item__credits-tracker.t2-credits-tracker .t2-credits-tracker__button svg{transform:scale(.7)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlyoutCartComponent.d.ts","sourceRoot":"","sources":["../../../../src/component/FlyoutCartComponent/FlyoutCartComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,4BAA4B,CAAC;AAEpC,UAAU,SAAS;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;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ACN,QAAiC,EACjC,SAAiB,EACjB,aAAqB,EACrB,GAAG,EACH,GAAG,EACH,SAAS,EACT,MAAM,EACN,gBAA2B,EAC3B,QAAmB,EACnB,aAAa,GACd,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"FlyoutCartComponent.d.ts","sourceRoot":"","sources":["../../../../src/component/FlyoutCartComponent/FlyoutCartComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAM3D,OAAO,4BAA4B,CAAC;AAEpC,UAAU,SAAS;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,QAAQ;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,UAAU;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC3B,gBAAgB,CAAC,EAAE,CACjB,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,aAAa,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CAC1C;AASD,iBAAS,aAAa,CAAC,EACrB,EAAE,EACF,QAAQ,EACR,IAAI,EACJ,QAAY,EACZ,GAAG,EACH,KAAK,EACL,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,mBAA2B,EAC3B,mBAA2B,EAC3B,IAAI,EACJ,MAAM,EACN,QAAiC,EACjC,SAAiB,EACjB,aAAqB,EACrB,GAAG,EACH,GAAG,EACH,SAAS,EACT,MAAM,EACN,gBAA2B,EAC3B,QAAmB,EACnB,aAAa,GACd,EAAE,kBAAkB,qBA0SpB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import T, { useRef as ae, useState as
|
|
2
|
+
import T, { useRef as ae, useState as q, useEffect as ie } from "react";
|
|
3
3
|
import { QuantityTracker as ne } from "../QuantityTracker/QuantityTracker.js";
|
|
4
4
|
import { ErrorMessage as L } from "../QuantityTracker/ErrorMessage.js";
|
|
5
5
|
import ce from "../CreditsTracker/CreditsTracker.js";
|
|
@@ -20,15 +20,15 @@ function ye({
|
|
|
20
20
|
price: b,
|
|
21
21
|
strikePrice: Q,
|
|
22
22
|
discount: $,
|
|
23
|
-
discountCode:
|
|
23
|
+
discountCode: V,
|
|
24
24
|
duration: F,
|
|
25
25
|
isMinThresholdError: B = !1,
|
|
26
26
|
isMaxThresholdError: Z = !1,
|
|
27
|
-
link:
|
|
27
|
+
link: g,
|
|
28
28
|
labels: D,
|
|
29
29
|
settings: _ = { ...oe },
|
|
30
30
|
isLoading: E = !1,
|
|
31
|
-
creditProduct:
|
|
31
|
+
creditProduct: y = !1,
|
|
32
32
|
min: M,
|
|
33
33
|
max: j,
|
|
34
34
|
increment: I,
|
|
@@ -39,7 +39,7 @@ function ye({
|
|
|
39
39
|
},
|
|
40
40
|
LinkComponent: K
|
|
41
41
|
}) {
|
|
42
|
-
const v = ae(null), [r, l] =
|
|
42
|
+
const v = ae(null), [r, l] = q(p), [m, u] = q(null);
|
|
43
43
|
ie(() => {
|
|
44
44
|
typeof p == "number" && l(p);
|
|
45
45
|
}, [p]);
|
|
@@ -97,16 +97,16 @@ function ye({
|
|
|
97
97
|
if (!f || f.length === 0) return "";
|
|
98
98
|
const t = [(I ?? 0).toLocaleString(C)];
|
|
99
99
|
let i = 0;
|
|
100
|
-
const S = (
|
|
100
|
+
const S = (N, s) => N.split(/(\{[^}]+\})/g).map((d, R) => {
|
|
101
101
|
if (/^\{[^}]+\}$/.test(d)) {
|
|
102
102
|
const re = t[i++] ?? d;
|
|
103
103
|
return /* @__PURE__ */ e(T.Fragment, { children: re }, `${s}-${R}`);
|
|
104
104
|
}
|
|
105
105
|
return /* @__PURE__ */ e(T.Fragment, { children: d }, `${s}-${R}`);
|
|
106
106
|
});
|
|
107
|
-
return f.split(/(\*\*[^*]+\*\*)/g).map((
|
|
108
|
-
const d = /^\*\*([^*]+)\*\*$/.exec(
|
|
109
|
-
return d ? /* @__PURE__ */ e("strong", { children: S(d[1], `b-${s}`) }, `b-${s}`) : /* @__PURE__ */ e(T.Fragment, { children: S(
|
|
107
|
+
return f.split(/(\*\*[^*]+\*\*)/g).map((N, s) => {
|
|
108
|
+
const d = /^\*\*([^*]+)\*\*$/.exec(N);
|
|
109
|
+
return d ? /* @__PURE__ */ e("strong", { children: S(d[1], `b-${s}`) }, `b-${s}`) : /* @__PURE__ */ e(T.Fragment, { children: S(N, `p-${s}`) }, `p-${s}`);
|
|
110
110
|
});
|
|
111
111
|
})(), te = new Intl.NumberFormat(void 0, {
|
|
112
112
|
style: "currency",
|
|
@@ -126,7 +126,7 @@ function ye({
|
|
|
126
126
|
) }),
|
|
127
127
|
/* @__PURE__ */ n("div", { className: "ter-cart-item__details", children: [
|
|
128
128
|
a && /* @__PURE__ */ e("h3", { className: "ter-cart-item__product-name", children: a }),
|
|
129
|
-
c && /* @__PURE__ */ n("div", { className: "ter-cart-item__sku", children: [
|
|
129
|
+
c && !y && /* @__PURE__ */ n("div", { className: "ter-cart-item__sku", children: [
|
|
130
130
|
"SKU: ",
|
|
131
131
|
c
|
|
132
132
|
] }),
|
|
@@ -144,11 +144,11 @@ function ye({
|
|
|
144
144
|
se,
|
|
145
145
|
{
|
|
146
146
|
discount: $,
|
|
147
|
-
discountCode:
|
|
147
|
+
discountCode: V,
|
|
148
148
|
className: "ter-cart-item__discount"
|
|
149
149
|
}
|
|
150
150
|
),
|
|
151
|
-
|
|
151
|
+
y && /* @__PURE__ */ n("div", { className: "ter-cart-item__qty ter-cart-item__qty--credits", children: [
|
|
152
152
|
/* @__PURE__ */ e("span", { className: "ter-cart-item__qty__label", children: D?.creditsLabel ?? "Number of Credits" }),
|
|
153
153
|
/* @__PURE__ */ e(
|
|
154
154
|
ce,
|
|
@@ -167,11 +167,11 @@ function ye({
|
|
|
167
167
|
}
|
|
168
168
|
)
|
|
169
169
|
] }),
|
|
170
|
-
|
|
170
|
+
y && (f || w) && /* @__PURE__ */ n("div", { className: "ter-cart-item__credit-notice", children: [
|
|
171
171
|
f && /* @__PURE__ */ e("p", { className: "ter-cart-item__credit-notice__line", children: ee }),
|
|
172
172
|
w && /* @__PURE__ */ e("p", { className: "ter-cart-item__credit-notice__line", children: w })
|
|
173
173
|
] }),
|
|
174
|
-
!
|
|
174
|
+
!y && /* @__PURE__ */ n("div", { className: "ter-cart-item__qty", children: [
|
|
175
175
|
/* @__PURE__ */ e("span", { className: "ter-cart-item__qty__label", children: _?.quantityLabel ?? D?.quantityLabel ?? "Quantity" }),
|
|
176
176
|
/* @__PURE__ */ e(
|
|
177
177
|
ne,
|
|
@@ -213,11 +213,11 @@ function ye({
|
|
|
213
213
|
Number(r) < 0 && /* @__PURE__ */ e(L, { errorMessage: _?.errorMessageForMinQuantity }),
|
|
214
214
|
B && /* @__PURE__ */ e(L, { errorMessage: P }),
|
|
215
215
|
Z && /* @__PURE__ */ e(L, { errorMessage: _?.errorMessageForMaxQuantity }),
|
|
216
|
-
|
|
216
|
+
g && /* @__PURE__ */ e("div", { className: "ter-cart-item__link-wrapper", children: /* @__PURE__ */ e(
|
|
217
217
|
le,
|
|
218
218
|
{
|
|
219
|
-
label:
|
|
220
|
-
destination:
|
|
219
|
+
label: g.text,
|
|
220
|
+
destination: g.url,
|
|
221
221
|
linkType: "text",
|
|
222
222
|
className: "ter-cart-item__link",
|
|
223
223
|
LinkComponent: K
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trimble-terra",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Trimble Terra — React component library for Trimble MXP2 web experiences",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,7 +84,11 @@
|
|
|
84
84
|
"release:patch": "git checkout main && git pull && npm version patch && git push --follow-tags",
|
|
85
85
|
"release:minor": "git checkout main && git pull && npm version minor && git push --follow-tags",
|
|
86
86
|
"release:major": "git checkout main && git pull && npm version major && git push --follow-tags",
|
|
87
|
-
"release:prerelease": "git pull && npm version prerelease --preid=%npm_config_preid% && git push --follow-tags"
|
|
87
|
+
"release:prerelease": "git pull && npm version prerelease --preid=%npm_config_preid% && git push --follow-tags",
|
|
88
|
+
"prepare": "husky"
|
|
89
|
+
},
|
|
90
|
+
"lint-staged": {
|
|
91
|
+
"src/**/*.{ts,tsx,js,jsx}": "prettier --write"
|
|
88
92
|
},
|
|
89
93
|
"peerDependencies": {
|
|
90
94
|
"@trimble-creative-strategy/trimble-mxp-icons": "^1.2.0",
|
|
@@ -121,6 +125,8 @@
|
|
|
121
125
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
122
126
|
"eslint-plugin-react-refresh": "^0.5.0",
|
|
123
127
|
"eslint-plugin-storybook": "^10.2.9",
|
|
128
|
+
"husky": "^9.1.7",
|
|
129
|
+
"lint-staged": "^17.6.0",
|
|
124
130
|
"postcss": "^8.5.6",
|
|
125
131
|
"prettier": "3.8.1",
|
|
126
132
|
"rollup-plugin-visualizer": "^7.0.0",
|