@sps-woodland/feedback-block 7.17.13 → 7.19.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.
- package/lib/{index.es.js → index.js} +61 -61
- package/lib/index.umd.cjs +101 -0
- package/lib/style.css +1 -1
- package/package.json +10 -10
- package/sps-woodland-feedback-block-7.19.0.tgz +0 -0
- package/vite.config.js +13 -4
- package/lib/index.cjs.js +0 -101
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { Metadata as
|
|
3
|
-
import { code as
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
value:
|
|
1
|
+
import * as c from "react";
|
|
2
|
+
import { Metadata as u, cl as h, Icon as g } from "@sps-woodland/core";
|
|
3
|
+
import { code as t } from "@spscommerce/utils";
|
|
4
|
+
function w(e, r, o) {
|
|
5
|
+
return r in e ? Object.defineProperty(e, r, {
|
|
6
|
+
value: o,
|
|
7
7
|
enumerable: !0,
|
|
8
8
|
configurable: !0,
|
|
9
9
|
writable: !0
|
|
10
|
-
}) : e[
|
|
10
|
+
}) : e[r] = o, e;
|
|
11
11
|
}
|
|
12
|
-
function p(e,
|
|
13
|
-
var
|
|
12
|
+
function p(e, r) {
|
|
13
|
+
var o = Object.keys(e);
|
|
14
14
|
if (Object.getOwnPropertySymbols) {
|
|
15
15
|
var a = Object.getOwnPropertySymbols(e);
|
|
16
|
-
|
|
17
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
18
|
-
})),
|
|
16
|
+
r && (a = a.filter(function(n) {
|
|
17
|
+
return Object.getOwnPropertyDescriptor(e, n).enumerable;
|
|
18
|
+
})), o.push.apply(o, a);
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
for (var
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(
|
|
28
|
-
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(
|
|
22
|
+
function b(e) {
|
|
23
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
24
|
+
var o = arguments[r] != null ? arguments[r] : {};
|
|
25
|
+
r % 2 ? p(Object(o), !0).forEach(function(a) {
|
|
26
|
+
w(e, a, o[a]);
|
|
27
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : p(Object(o)).forEach(function(a) {
|
|
28
|
+
Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(o, a));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
return e;
|
|
32
32
|
}
|
|
33
|
-
var
|
|
33
|
+
var v = (e, r, o) => {
|
|
34
34
|
for (var a of Object.keys(e)) {
|
|
35
|
-
var
|
|
36
|
-
if (e[a] !== ((
|
|
35
|
+
var n;
|
|
36
|
+
if (e[a] !== ((n = r[a]) !== null && n !== void 0 ? n : o[a]))
|
|
37
37
|
return !1;
|
|
38
38
|
}
|
|
39
39
|
return !0;
|
|
40
|
-
},
|
|
41
|
-
var
|
|
42
|
-
for (var
|
|
43
|
-
var
|
|
40
|
+
}, l = (e) => (r) => {
|
|
41
|
+
var o = e.defaultClassName, a = b(b({}, e.defaultVariants), r);
|
|
42
|
+
for (var n in a) {
|
|
43
|
+
var d, k = (d = a[n]) !== null && d !== void 0 ? d : e.defaultVariants[n];
|
|
44
44
|
if (k != null) {
|
|
45
|
-
var
|
|
46
|
-
typeof
|
|
47
|
-
var
|
|
48
|
-
|
|
45
|
+
var i = k;
|
|
46
|
+
typeof i == "boolean" && (i = i === !0 ? "true" : "false");
|
|
47
|
+
var _ = e.variantClassNames[n][i];
|
|
48
|
+
_ && (o += " " + _);
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
for (var [
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
},
|
|
55
|
-
const
|
|
51
|
+
for (var [f, m] of e.compoundVariants)
|
|
52
|
+
v(f, a, e.defaultVariants) && (o += " " + m);
|
|
53
|
+
return o;
|
|
54
|
+
}, F = l({ defaultClassName: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l560", variantClassNames: { kind: { tip: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l561", success: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l562", warning: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l563", info: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l564", error: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l565" }, micro: { true: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l566", false: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l567" } }, defaultVariants: { kind: "tip", micro: !1 }, compoundVariants: [] }), B = l({ defaultClassName: "", variantClassNames: { kind: { tip: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l568", success: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l569", warning: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56a", info: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56b", error: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56c" }, micro: { true: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56d", false: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56e" } }, defaultVariants: { kind: "tip", micro: !1 }, compoundVariants: [[{ kind: "tip", micro: !0 }, "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56f"]] }), y = l({ defaultClassName: "", variantClassNames: { micro: { true: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56g", false: "pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56h" } }, defaultVariants: { micro: !1 }, compoundVariants: [] });
|
|
55
|
+
const C = Object.freeze({
|
|
56
56
|
tip: "lightbulb",
|
|
57
57
|
success: "checkmark",
|
|
58
58
|
warning: "exclamation-triangle",
|
|
59
59
|
error: "exclamation-circle",
|
|
60
60
|
info: "info-circle"
|
|
61
61
|
});
|
|
62
|
-
function
|
|
62
|
+
function s({
|
|
63
63
|
children: e,
|
|
64
|
-
className:
|
|
65
|
-
kind:
|
|
64
|
+
className: r,
|
|
65
|
+
kind: o = "tip",
|
|
66
66
|
micro: a,
|
|
67
|
-
...
|
|
67
|
+
...n
|
|
68
68
|
}) {
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ c.createElement("div", { className: h(F({ kind: o, micro: a }), r), ...n }, /* @__PURE__ */ c.createElement(
|
|
70
70
|
g,
|
|
71
71
|
{
|
|
72
|
-
className:
|
|
73
|
-
icon:
|
|
72
|
+
className: B({ kind: o, micro: a }),
|
|
73
|
+
icon: C[o],
|
|
74
74
|
"aria-hidden": "true"
|
|
75
75
|
}
|
|
76
|
-
), /* @__PURE__ */
|
|
76
|
+
), /* @__PURE__ */ c.createElement("span", { className: y({ micro: a }) }, e));
|
|
77
77
|
}
|
|
78
|
-
|
|
78
|
+
u.set(s, {
|
|
79
79
|
name: "FeedbackBlock",
|
|
80
80
|
props: {
|
|
81
81
|
kind: { type: "FeedbackBlockKind", default: "tip" },
|
|
82
82
|
micro: { type: "boolean", default: "false" }
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const
|
|
86
|
-
components: [
|
|
87
|
-
description: ({ NavigateTo: e }) => /* @__PURE__ */
|
|
85
|
+
const E = {
|
|
86
|
+
components: [s],
|
|
87
|
+
description: ({ NavigateTo: e }) => /* @__PURE__ */ c.createElement(c.Fragment, null, /* @__PURE__ */ c.createElement("p", null, "Feedback Blocks show static informational messages on a page. They should not dynamically appear or disappear. For feedback that responds to a user action, Use a", " ", /* @__PURE__ */ c.createElement(e, { to: "growler" }, "Growler"), " instead."), /* @__PURE__ */ c.createElement("h5", null, "Variants"), /* @__PURE__ */ c.createElement("p", null, "Variants are generally tied to a specific color and an accompanying icon."), /* @__PURE__ */ c.createElement(s, { kind: "error", micro: !0 }, "Error"), /* @__PURE__ */ c.createElement(s, { kind: "info", micro: !0 }, "Information"), /* @__PURE__ */ c.createElement(s, { kind: "tip", micro: !0 }, "Tip"), /* @__PURE__ */ c.createElement(s, { kind: "success", micro: !0 }, "Success"), /* @__PURE__ */ c.createElement(s, { kind: "warning", micro: !0 }, "Warning")),
|
|
88
88
|
examples: {
|
|
89
89
|
standard: {
|
|
90
90
|
label: "Standard Size",
|
|
@@ -92,7 +92,7 @@ const O = {
|
|
|
92
92
|
examples: {
|
|
93
93
|
error: {
|
|
94
94
|
description: "Error",
|
|
95
|
-
react:
|
|
95
|
+
react: t`
|
|
96
96
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
97
97
|
|
|
98
98
|
function Component() {
|
|
@@ -106,7 +106,7 @@ const O = {
|
|
|
106
106
|
},
|
|
107
107
|
info: {
|
|
108
108
|
description: "Information",
|
|
109
|
-
react:
|
|
109
|
+
react: t`
|
|
110
110
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
111
111
|
|
|
112
112
|
function Component() {
|
|
@@ -120,7 +120,7 @@ const O = {
|
|
|
120
120
|
},
|
|
121
121
|
proTip: {
|
|
122
122
|
description: "Pro Tip",
|
|
123
|
-
react:
|
|
123
|
+
react: t`
|
|
124
124
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
125
125
|
|
|
126
126
|
function Component() {
|
|
@@ -134,7 +134,7 @@ const O = {
|
|
|
134
134
|
},
|
|
135
135
|
success: {
|
|
136
136
|
description: "Success",
|
|
137
|
-
react:
|
|
137
|
+
react: t`
|
|
138
138
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
139
139
|
|
|
140
140
|
function Component() {
|
|
@@ -148,7 +148,7 @@ const O = {
|
|
|
148
148
|
},
|
|
149
149
|
warning: {
|
|
150
150
|
description: "Warning",
|
|
151
|
-
react:
|
|
151
|
+
react: t`
|
|
152
152
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
153
153
|
|
|
154
154
|
function Component() {
|
|
@@ -168,7 +168,7 @@ const O = {
|
|
|
168
168
|
examples: {
|
|
169
169
|
error: {
|
|
170
170
|
description: "Error",
|
|
171
|
-
react:
|
|
171
|
+
react: t`
|
|
172
172
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
173
173
|
|
|
174
174
|
function Component() {
|
|
@@ -182,7 +182,7 @@ const O = {
|
|
|
182
182
|
},
|
|
183
183
|
info: {
|
|
184
184
|
description: "Information",
|
|
185
|
-
react:
|
|
185
|
+
react: t`
|
|
186
186
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
187
187
|
|
|
188
188
|
function Component() {
|
|
@@ -196,7 +196,7 @@ const O = {
|
|
|
196
196
|
},
|
|
197
197
|
proTip: {
|
|
198
198
|
description: "Pro Tip",
|
|
199
|
-
react:
|
|
199
|
+
react: t`
|
|
200
200
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
201
201
|
|
|
202
202
|
function Component() {
|
|
@@ -210,7 +210,7 @@ const O = {
|
|
|
210
210
|
},
|
|
211
211
|
success: {
|
|
212
212
|
description: "Success",
|
|
213
|
-
react:
|
|
213
|
+
react: t`
|
|
214
214
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
215
215
|
|
|
216
216
|
function Component() {
|
|
@@ -224,7 +224,7 @@ const O = {
|
|
|
224
224
|
},
|
|
225
225
|
warning: {
|
|
226
226
|
description: "Warning",
|
|
227
|
-
react:
|
|
227
|
+
react: t`
|
|
228
228
|
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
229
229
|
|
|
230
230
|
function Component() {
|
|
@@ -240,10 +240,10 @@ const O = {
|
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
242
|
}, S = {
|
|
243
|
-
"Feedback Blocks":
|
|
243
|
+
"Feedback Blocks": E
|
|
244
244
|
};
|
|
245
245
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
s as FeedbackBlock,
|
|
247
|
+
C as FeedbackBlockIcons,
|
|
248
248
|
S as MANIFEST
|
|
249
249
|
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
(function(n,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils"],i):(n=typeof globalThis<"u"?globalThis:n||self,i(n.FeedbackBlock={},n.React,n.core,n.utils))})(this,function(n,i,k,s){"use strict";function g(e){if(e&&e.__esModule)return e;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const c=g(i),S="";function w(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function f(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);r&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,a)}return o}function b(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?f(Object(o),!0).forEach(function(a){w(e,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):f(Object(o)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(o,a))})}return e}var v=(e,r,o)=>{for(var a of Object.keys(e)){var t;if(e[a]!==((t=r[a])!==null&&t!==void 0?t:o[a]))return!1}return!0},_=e=>r=>{var o=e.defaultClassName,a=b(b({},e.defaultVariants),r);for(var t in a){var p,m=(p=a[t])!==null&&p!==void 0?p:e.defaultVariants[t];if(m!=null){var l=m;typeof l=="boolean"&&(l=l===!0?"true":"false");var h=e.variantClassNames[t][l];h&&(o+=" "+h)}}for(var[E,C]of e.compoundVariants)v(E,a,e.defaultVariants)&&(o+=" "+C);return o},F=_({defaultClassName:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l560",variantClassNames:{kind:{tip:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l561",success:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l562",warning:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l563",info:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l564",error:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l565"},micro:{true:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l566",false:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l567"}},defaultVariants:{kind:"tip",micro:!1},compoundVariants:[]}),B=_({defaultClassName:"",variantClassNames:{kind:{tip:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l568",success:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l569",warning:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56a",info:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56b",error:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56c"},micro:{true:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56d",false:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56e"}},defaultVariants:{kind:"tip",micro:!1},compoundVariants:[[{kind:"tip",micro:!0},"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56f"]]}),y=_({defaultClassName:"",variantClassNames:{micro:{true:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56g",false:"pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56h"}},defaultVariants:{micro:!1},compoundVariants:[]});const u=Object.freeze({tip:"lightbulb",success:"checkmark",warning:"exclamation-triangle",error:"exclamation-circle",info:"info-circle"});function d({children:e,className:r,kind:o="tip",micro:a,...t}){return c.createElement("div",{className:k.cl(F({kind:o,micro:a}),r),...t},c.createElement(k.Icon,{className:B({kind:o,micro:a}),icon:u[o],"aria-hidden":"true"}),c.createElement("span",{className:y({micro:a})},e))}k.Metadata.set(d,{name:"FeedbackBlock",props:{kind:{type:"FeedbackBlockKind",default:"tip"},micro:{type:"boolean",default:"false"}}});const O={"Feedback Blocks":{components:[d],description:({NavigateTo:e})=>c.createElement(c.Fragment,null,c.createElement("p",null,"Feedback Blocks show static informational messages on a page. They should not dynamically appear or disappear. For feedback that responds to a user action, Use a"," ",c.createElement(e,{to:"growler"},"Growler")," instead."),c.createElement("h5",null,"Variants"),c.createElement("p",null,"Variants are generally tied to a specific color and an accompanying icon."),c.createElement(d,{kind:"error",micro:!0},"Error"),c.createElement(d,{kind:"info",micro:!0},"Information"),c.createElement(d,{kind:"tip",micro:!0},"Tip"),c.createElement(d,{kind:"success",micro:!0},"Success"),c.createElement(d,{kind:"warning",micro:!0},"Warning")),examples:{standard:{label:"Standard Size",description:"Use Standard Size Feedback Blocks for the majority of cases. If a smaller or more subtle solution is needed, use the Micro Size Feedback Block.",examples:{error:{description:"Error",react:s.code`
|
|
2
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
3
|
+
|
|
4
|
+
function Component() {
|
|
5
|
+
return (
|
|
6
|
+
<FeedbackBlock kind="error" data-testid="feedback-block-error">
|
|
7
|
+
We are experiencing difficulties communicating to the server. Please try again later.
|
|
8
|
+
</FeedbackBlock>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
`},info:{description:"Information",react:s.code`
|
|
12
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
13
|
+
|
|
14
|
+
function Component() {
|
|
15
|
+
return (
|
|
16
|
+
<FeedbackBlock kind="info" data-testid="feedback-block-info">
|
|
17
|
+
FYI - This page has been updated. Click refresh to see the most recent version.
|
|
18
|
+
</FeedbackBlock>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
`},proTip:{description:"Pro Tip",react:s.code`
|
|
22
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
23
|
+
|
|
24
|
+
function Component() {
|
|
25
|
+
return (
|
|
26
|
+
<FeedbackBlock kind="tip" data-testid="feedback-block-tip">
|
|
27
|
+
Please Note: Click the Receive button above to check for new transactions from QuickBooks.
|
|
28
|
+
</FeedbackBlock>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
`},success:{description:"Success",react:s.code`
|
|
32
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
33
|
+
|
|
34
|
+
function Component() {
|
|
35
|
+
return (
|
|
36
|
+
<FeedbackBlock kind="success" data-testid="feedback-block-success">
|
|
37
|
+
All items have been uploaded and are ready for export.
|
|
38
|
+
</FeedbackBlock>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
`},warning:{description:"Warning",react:s.code`
|
|
42
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
43
|
+
|
|
44
|
+
function Component() {
|
|
45
|
+
return (
|
|
46
|
+
<FeedbackBlock kind="warning" data-testid="feedback-block-warning">
|
|
47
|
+
Warning! This order is missing a shipment date and is in jeopardy of being past due.
|
|
48
|
+
</FeedbackBlock>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
`}}},micro:{label:"Micro Size",description:"Use Micro Size Feedback Blocks when a Standard Size Feedback Block is too large or too visually overwhelming.",examples:{error:{description:"Error",react:s.code`
|
|
52
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
53
|
+
|
|
54
|
+
function Component() {
|
|
55
|
+
return (
|
|
56
|
+
<FeedbackBlock kind="error" micro data-testid="feedback-block-micro-error">
|
|
57
|
+
We are experiencing difficulties communicating to the server. Please try again later.
|
|
58
|
+
</FeedbackBlock>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
`},info:{description:"Information",react:s.code`
|
|
62
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
63
|
+
|
|
64
|
+
function Component() {
|
|
65
|
+
return (
|
|
66
|
+
<FeedbackBlock kind="info" micro data-testid="feedback-block-micro-info">
|
|
67
|
+
Refresh the page to see the most recent version.
|
|
68
|
+
</FeedbackBlock>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
`},proTip:{description:"Pro Tip",react:s.code`
|
|
72
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
73
|
+
|
|
74
|
+
function Component() {
|
|
75
|
+
return (
|
|
76
|
+
<FeedbackBlock kind="tip" micro data-testid="feedback-block-micro-tip">
|
|
77
|
+
Tip: Click the Receive button to check for new transactions.
|
|
78
|
+
</FeedbackBlock>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
`},success:{description:"Success",react:s.code`
|
|
82
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
83
|
+
|
|
84
|
+
function Component() {
|
|
85
|
+
return (
|
|
86
|
+
<FeedbackBlock kind="success" micro data-testid="feedback-block-micro-success">
|
|
87
|
+
All items have been uploaded and are ready for export.
|
|
88
|
+
</FeedbackBlock>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
`},warning:{description:"Warning",react:s.code`
|
|
92
|
+
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
93
|
+
|
|
94
|
+
function Component() {
|
|
95
|
+
return (
|
|
96
|
+
<FeedbackBlock kind="warning" micro data-testid="feedback-block-micro-warning">
|
|
97
|
+
This order is missing a shipment date.
|
|
98
|
+
</FeedbackBlock>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
`}}}}}};n.FeedbackBlock=d,n.FeedbackBlockIcons=u,n.MANIFEST=O,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l560{display:flex}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l561{background-color:#fff8e0;border-color:#fc0}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l562{background-color:#e7f3ec;border-color:#0b8940}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l563{background-color:#fcf1e7;border-color:#e7760b}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l564{background-color:#e6f2f8;border-color:#09638d}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l565{background-color:#fbe6ea;border-color:#de002e}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l566{height:1rem;border:none;background-color:transparent}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l567{border-radius:.125rem;border-style:solid;border-width:.0625rem;font-size:.875rem;font-weight:400;line-height:1.25rem;margin-bottom:1rem;padding:.5rem 1rem}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l568{color:#fc0}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l569{color:#0b8940}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56a{color:#e7760b}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56b{color:#09638d}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56c{color:#de002e}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56d{font-size:.875rem;font-weight:400;line-height:1.125rem;vertical-align:middle}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56e{margin-right:.5rem;font-size:1.25rem;vertical-align:middle}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56f{color:#09638d}.pkg_sps-woodland_feedback-block__version_7_19_0__hash_1r00l56g{color:#4b5356;font-size:.75rem;font-weight:600;line-height:1.125rem;margin-left:.25rem}
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/feedback-block",
|
|
3
3
|
"description": "SPS Woodland Design System feedback block component",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.19.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/feedback-block",
|
|
8
8
|
"homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/feedback-block#readme",
|
|
9
|
-
"module": "./lib/index.es.js",
|
|
10
9
|
"type": "module",
|
|
11
|
-
"
|
|
10
|
+
"module": "./lib/index.js",
|
|
11
|
+
"main": "./lib/index.umd.cjs",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"default": "./lib/index.
|
|
15
|
+
"require": "./lib/index.umd.cjs",
|
|
16
|
+
"import": "./lib/index.js",
|
|
17
|
+
"default": "./lib/index.js",
|
|
18
18
|
"types": "./lib/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./lib/style.css": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@spscommerce/utils": "^6.12.1",
|
|
30
30
|
"react": "^16.14.0",
|
|
31
31
|
"react-dom": "^16.14.0",
|
|
32
|
-
"@sps-woodland/core": "7.
|
|
33
|
-
"@sps-woodland/tokens": "7.
|
|
32
|
+
"@sps-woodland/core": "7.19.0",
|
|
33
|
+
"@sps-woodland/tokens": "7.19.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@spscommerce/utils": "^6.12.1",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"@vanilla-extract/recipes": "^0.2.5",
|
|
39
39
|
"react": "^16.14.0",
|
|
40
40
|
"react-dom": "^16.14.0",
|
|
41
|
-
"@sps-woodland/tokens": "7.
|
|
42
|
-
"@sps-woodland/core": "7.
|
|
41
|
+
"@sps-woodland/tokens": "7.19.0",
|
|
42
|
+
"@sps-woodland/core": "7.19.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "pnpm run build:js && pnpm run build:types",
|
|
Binary file
|
package/vite.config.js
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
3
|
import { defineConfig } from "vite";
|
|
4
|
-
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.js";
|
|
5
5
|
import pkg from "./package.json";
|
|
6
6
|
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
8
|
+
|
|
7
9
|
export default defineConfig({
|
|
8
|
-
plugins: [
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
9
18
|
build: {
|
|
10
19
|
lib: {
|
|
11
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
12
|
-
|
|
13
|
-
fileName:
|
|
21
|
+
name: "FeedbackBlock",
|
|
22
|
+
fileName: "index",
|
|
14
23
|
},
|
|
15
24
|
outDir: path.resolve(__dirname, "./lib"),
|
|
16
25
|
emptyOutDir: false,
|
package/lib/index.cjs.js
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=require("react"),d=require("@sps-woodland/core"),n=require("@spscommerce/utils");function w(e){if(e&&e.__esModule)return e;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return a.default=e,Object.freeze(a)}const t=w(g);function h(e,a,r){return a in e?Object.defineProperty(e,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[a]=r,e}function p(e,a){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);a&&(o=o.filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable})),r.push.apply(r,o)}return r}function b(e){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?p(Object(r),!0).forEach(function(o){h(e,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))})}return e}var v=(e,a,r)=>{for(var o of Object.keys(e)){var c;if(e[o]!==((c=a[o])!==null&&c!==void 0?c:r[o]))return!1}return!0},k=e=>a=>{var r=e.defaultClassName,o=b(b({},e.defaultVariants),a);for(var c in o){var l,f=(l=o[c])!==null&&l!==void 0?l:e.defaultVariants[c];if(f!=null){var s=f;typeof s=="boolean"&&(s=s===!0?"true":"false");var u=e.variantClassNames[c][s];u&&(r+=" "+u)}}for(var[F,B]of e.compoundVariants)v(F,o,e.defaultVariants)&&(r+=" "+B);return r},y=k({defaultClassName:"_1r00l560",variantClassNames:{kind:{tip:"_1r00l561",success:"_1r00l562",warning:"_1r00l563",info:"_1r00l564",error:"_1r00l565"},micro:{true:"_1r00l566",false:"_1r00l567"}},defaultVariants:{kind:"tip",micro:!1},compoundVariants:[]}),O=k({defaultClassName:"",variantClassNames:{kind:{tip:"_1r00l568",success:"_1r00l569",warning:"_1r00l56a",info:"_1r00l56b",error:"_1r00l56c"},micro:{true:"_1r00l56d",false:"_1r00l56e"}},defaultVariants:{kind:"tip",micro:!1},compoundVariants:[[{kind:"tip",micro:!0},"_1r00l56f"]]}),_=k({defaultClassName:"",variantClassNames:{micro:{true:"_1r00l56g",false:"_1r00l56h"}},defaultVariants:{micro:!1},compoundVariants:[]});const m=Object.freeze({tip:"lightbulb",success:"checkmark",warning:"exclamation-triangle",error:"exclamation-circle",info:"info-circle"});function i({children:e,className:a,kind:r="tip",micro:o,...c}){return t.createElement("div",{className:d.cl(y({kind:r,micro:o}),a),...c},t.createElement(d.Icon,{className:O({kind:r,micro:o}),icon:m[r],"aria-hidden":"true"}),t.createElement("span",{className:_({micro:o})},e))}d.Metadata.set(i,{name:"FeedbackBlock",props:{kind:{type:"FeedbackBlockKind",default:"tip"},micro:{type:"boolean",default:"false"}}});const E={components:[i],description:({NavigateTo:e})=>t.createElement(t.Fragment,null,t.createElement("p",null,"Feedback Blocks show static informational messages on a page. They should not dynamically appear or disappear. For feedback that responds to a user action, Use a"," ",t.createElement(e,{to:"growler"},"Growler")," instead."),t.createElement("h5",null,"Variants"),t.createElement("p",null,"Variants are generally tied to a specific color and an accompanying icon."),t.createElement(i,{kind:"error",micro:!0},"Error"),t.createElement(i,{kind:"info",micro:!0},"Information"),t.createElement(i,{kind:"tip",micro:!0},"Tip"),t.createElement(i,{kind:"success",micro:!0},"Success"),t.createElement(i,{kind:"warning",micro:!0},"Warning")),examples:{standard:{label:"Standard Size",description:"Use Standard Size Feedback Blocks for the majority of cases. If a smaller or more subtle solution is needed, use the Micro Size Feedback Block.",examples:{error:{description:"Error",react:n.code`
|
|
2
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
3
|
-
|
|
4
|
-
function Component() {
|
|
5
|
-
return (
|
|
6
|
-
<FeedbackBlock kind="error" data-testid="feedback-block-error">
|
|
7
|
-
We are experiencing difficulties communicating to the server. Please try again later.
|
|
8
|
-
</FeedbackBlock>
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
`},info:{description:"Information",react:n.code`
|
|
12
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
13
|
-
|
|
14
|
-
function Component() {
|
|
15
|
-
return (
|
|
16
|
-
<FeedbackBlock kind="info" data-testid="feedback-block-info">
|
|
17
|
-
FYI - This page has been updated. Click refresh to see the most recent version.
|
|
18
|
-
</FeedbackBlock>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
`},proTip:{description:"Pro Tip",react:n.code`
|
|
22
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
23
|
-
|
|
24
|
-
function Component() {
|
|
25
|
-
return (
|
|
26
|
-
<FeedbackBlock kind="tip" data-testid="feedback-block-tip">
|
|
27
|
-
Please Note: Click the Receive button above to check for new transactions from QuickBooks.
|
|
28
|
-
</FeedbackBlock>
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
`},success:{description:"Success",react:n.code`
|
|
32
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
33
|
-
|
|
34
|
-
function Component() {
|
|
35
|
-
return (
|
|
36
|
-
<FeedbackBlock kind="success" data-testid="feedback-block-success">
|
|
37
|
-
All items have been uploaded and are ready for export.
|
|
38
|
-
</FeedbackBlock>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
`},warning:{description:"Warning",react:n.code`
|
|
42
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
43
|
-
|
|
44
|
-
function Component() {
|
|
45
|
-
return (
|
|
46
|
-
<FeedbackBlock kind="warning" data-testid="feedback-block-warning">
|
|
47
|
-
Warning! This order is missing a shipment date and is in jeopardy of being past due.
|
|
48
|
-
</FeedbackBlock>
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
`}}},micro:{label:"Micro Size",description:"Use Micro Size Feedback Blocks when a Standard Size Feedback Block is too large or too visually overwhelming.",examples:{error:{description:"Error",react:n.code`
|
|
52
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
53
|
-
|
|
54
|
-
function Component() {
|
|
55
|
-
return (
|
|
56
|
-
<FeedbackBlock kind="error" micro data-testid="feedback-block-micro-error">
|
|
57
|
-
We are experiencing difficulties communicating to the server. Please try again later.
|
|
58
|
-
</FeedbackBlock>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
`},info:{description:"Information",react:n.code`
|
|
62
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
63
|
-
|
|
64
|
-
function Component() {
|
|
65
|
-
return (
|
|
66
|
-
<FeedbackBlock kind="info" micro data-testid="feedback-block-micro-info">
|
|
67
|
-
Refresh the page to see the most recent version.
|
|
68
|
-
</FeedbackBlock>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
`},proTip:{description:"Pro Tip",react:n.code`
|
|
72
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
73
|
-
|
|
74
|
-
function Component() {
|
|
75
|
-
return (
|
|
76
|
-
<FeedbackBlock kind="tip" micro data-testid="feedback-block-micro-tip">
|
|
77
|
-
Tip: Click the Receive button to check for new transactions.
|
|
78
|
-
</FeedbackBlock>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
`},success:{description:"Success",react:n.code`
|
|
82
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
83
|
-
|
|
84
|
-
function Component() {
|
|
85
|
-
return (
|
|
86
|
-
<FeedbackBlock kind="success" micro data-testid="feedback-block-micro-success">
|
|
87
|
-
All items have been uploaded and are ready for export.
|
|
88
|
-
</FeedbackBlock>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
`},warning:{description:"Warning",react:n.code`
|
|
92
|
-
import { FeedbackBlock } from "@sps-woodland/feedback-block";
|
|
93
|
-
|
|
94
|
-
function Component() {
|
|
95
|
-
return (
|
|
96
|
-
<FeedbackBlock kind="warning" micro data-testid="feedback-block-micro-warning">
|
|
97
|
-
This order is missing a shipment date.
|
|
98
|
-
</FeedbackBlock>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
`}}}}},C={"Feedback Blocks":E};exports.FeedbackBlock=i;exports.FeedbackBlockIcons=m;exports.MANIFEST=C;
|