@sps-woodland/feedback-block 7.0.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ ## [@sps-woodland/feedback-block](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/feedback-block#readme)
2
+
3
+ SPS Woodland Design System feedback block component
@@ -0,0 +1,11 @@
1
+ import { Tokens } from "@sps-woodland/tokens";
2
+ import type { VariantDefinitions, RecipeVariant, BooleanRecipeVariant } from "@sps-woodland/core";
3
+ export declare type FeedbackBlockKind = keyof typeof Tokens.component["feedback-block"]["kind"];
4
+ interface FeedbackBlockVariantDefinitions extends VariantDefinitions {
5
+ kind: RecipeVariant<FeedbackBlockKind>;
6
+ micro: BooleanRecipeVariant;
7
+ }
8
+ export declare const feedbackBlock: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<FeedbackBlockVariantDefinitions>;
9
+ export declare const feedbackBlockIcon: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<FeedbackBlockVariantDefinitions>;
10
+ export declare const feedbackBlockText: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<FeedbackBlockVariantDefinitions, "micro">>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ import type { ComponentProps } from "@sps-woodland/core";
3
+ import type { IconName } from "@sps-woodland/tokens";
4
+ import type { FeedbackBlockKind } from "./FeedbackBlock.css";
5
+ export declare const FeedbackBlockIcons: Record<FeedbackBlockKind, IconName>;
6
+ export declare function FeedbackBlock({ children, className, kind, micro, ...rest }: ComponentProps<{
7
+ kind?: FeedbackBlockKind;
8
+ micro?: boolean;
9
+ }, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifestEntry } from "@sps-woodland/core";
2
+ export declare const FeedbackBlockExamples: ComponentManifestEntry;
@@ -0,0 +1,101 @@
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;
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./FeedbackBlock";
2
+ export * from "./manifest";
@@ -0,0 +1,268 @@
1
+ import * as t from "react";
2
+ import { Metadata as F, cl as B, Icon as g } from "@sps-woodland/core";
3
+ import { code as n } from "@spscommerce/utils";
4
+ function h(e, o, r) {
5
+ return o in e ? Object.defineProperty(e, o, {
6
+ value: r,
7
+ enumerable: !0,
8
+ configurable: !0,
9
+ writable: !0
10
+ }) : e[o] = r, e;
11
+ }
12
+ function p(e, o) {
13
+ var r = Object.keys(e);
14
+ if (Object.getOwnPropertySymbols) {
15
+ var a = Object.getOwnPropertySymbols(e);
16
+ o && (a = a.filter(function(c) {
17
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
18
+ })), r.push.apply(r, a);
19
+ }
20
+ return r;
21
+ }
22
+ function m(e) {
23
+ for (var o = 1; o < arguments.length; o++) {
24
+ var r = arguments[o] != null ? arguments[o] : {};
25
+ o % 2 ? p(Object(r), !0).forEach(function(a) {
26
+ h(e, a, r[a]);
27
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : p(Object(r)).forEach(function(a) {
28
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
29
+ });
30
+ }
31
+ return e;
32
+ }
33
+ var w = (e, o, r) => {
34
+ for (var a of Object.keys(e)) {
35
+ var c;
36
+ if (e[a] !== ((c = o[a]) !== null && c !== void 0 ? c : r[a]))
37
+ return !1;
38
+ }
39
+ return !0;
40
+ }, d = (e) => (o) => {
41
+ var r = e.defaultClassName, a = m(m({}, e.defaultVariants), o);
42
+ for (var c in a) {
43
+ var s, k = (s = a[c]) !== null && s !== void 0 ? s : e.defaultVariants[c];
44
+ if (k != null) {
45
+ var l = k;
46
+ typeof l == "boolean" && (l = l === !0 ? "true" : "false");
47
+ var f = e.variantClassNames[c][l];
48
+ f && (r += " " + f);
49
+ }
50
+ }
51
+ for (var [b, u] of e.compoundVariants)
52
+ w(b, a, e.defaultVariants) && (r += " " + u);
53
+ return r;
54
+ }, v = d({ 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: [] }), y = d({ 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"]] }), C = d({ defaultClassName: "", variantClassNames: { micro: { true: "_1r00l56g", false: "_1r00l56h" } }, defaultVariants: { micro: !1 }, compoundVariants: [] });
55
+ const E = Object.freeze({
56
+ tip: "lightbulb",
57
+ success: "checkmark",
58
+ warning: "exclamation-triangle",
59
+ error: "exclamation-circle",
60
+ info: "info-circle"
61
+ });
62
+ function i({
63
+ children: e,
64
+ className: o,
65
+ kind: r = "tip",
66
+ micro: a,
67
+ ...c
68
+ }) {
69
+ return /* @__PURE__ */ t.createElement("div", {
70
+ className: B(v({ kind: r, micro: a }), o),
71
+ ...c
72
+ }, /* @__PURE__ */ t.createElement(g, {
73
+ className: y({ kind: r, micro: a }),
74
+ icon: E[r],
75
+ "aria-hidden": "true"
76
+ }), /* @__PURE__ */ t.createElement("span", {
77
+ className: C({ micro: a })
78
+ }, e));
79
+ }
80
+ F.set(i, {
81
+ name: "FeedbackBlock",
82
+ props: {
83
+ kind: { type: "FeedbackBlockKind", default: "tip" },
84
+ micro: { type: "boolean", default: "false" }
85
+ }
86
+ });
87
+ const O = {
88
+ components: [i],
89
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ 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", " ", /* @__PURE__ */ t.createElement(e, {
90
+ to: "growler"
91
+ }, "Growler"), " instead."), /* @__PURE__ */ t.createElement("h5", null, "Variants"), /* @__PURE__ */ t.createElement("p", null, "Variants are generally tied to a specific color and an accompanying icon."), /* @__PURE__ */ t.createElement(i, {
92
+ kind: "error",
93
+ micro: !0
94
+ }, "Error"), /* @__PURE__ */ t.createElement(i, {
95
+ kind: "info",
96
+ micro: !0
97
+ }, "Information"), /* @__PURE__ */ t.createElement(i, {
98
+ kind: "tip",
99
+ micro: !0
100
+ }, "Tip"), /* @__PURE__ */ t.createElement(i, {
101
+ kind: "success",
102
+ micro: !0
103
+ }, "Success"), /* @__PURE__ */ t.createElement(i, {
104
+ kind: "warning",
105
+ micro: !0
106
+ }, "Warning")),
107
+ examples: {
108
+ standard: {
109
+ label: "Standard Size",
110
+ 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.",
111
+ examples: {
112
+ error: {
113
+ description: "Error",
114
+ react: n`
115
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
116
+
117
+ function Component() {
118
+ return (
119
+ <FeedbackBlock kind="error" data-testid="feedback-block-error">
120
+ We are experiencing difficulties communicating to the server. Please try again later.
121
+ </FeedbackBlock>
122
+ );
123
+ }
124
+ `
125
+ },
126
+ info: {
127
+ description: "Information",
128
+ react: n`
129
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
130
+
131
+ function Component() {
132
+ return (
133
+ <FeedbackBlock kind="info" data-testid="feedback-block-info">
134
+ FYI - This page has been updated. Click refresh to see the most recent version.
135
+ </FeedbackBlock>
136
+ );
137
+ }
138
+ `
139
+ },
140
+ proTip: {
141
+ description: "Pro Tip",
142
+ react: n`
143
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
144
+
145
+ function Component() {
146
+ return (
147
+ <FeedbackBlock kind="tip" data-testid="feedback-block-tip">
148
+ Please Note: Click the Receive button above to check for new transactions from QuickBooks.
149
+ </FeedbackBlock>
150
+ );
151
+ }
152
+ `
153
+ },
154
+ success: {
155
+ description: "Success",
156
+ react: n`
157
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
158
+
159
+ function Component() {
160
+ return (
161
+ <FeedbackBlock kind="success" data-testid="feedback-block-success">
162
+ All items have been uploaded and are ready for export.
163
+ </FeedbackBlock>
164
+ );
165
+ }
166
+ `
167
+ },
168
+ warning: {
169
+ description: "Warning",
170
+ react: n`
171
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
172
+
173
+ function Component() {
174
+ return (
175
+ <FeedbackBlock kind="warning" data-testid="feedback-block-warning">
176
+ Warning! This order is missing a shipment date and is in jeopardy of being past due.
177
+ </FeedbackBlock>
178
+ );
179
+ }
180
+ `
181
+ }
182
+ }
183
+ },
184
+ micro: {
185
+ label: "Micro Size",
186
+ description: "Use Micro Size Feedback Blocks when a Standard Size Feedback Block is too large or too visually overwhelming.",
187
+ examples: {
188
+ error: {
189
+ description: "Error",
190
+ react: n`
191
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
192
+
193
+ function Component() {
194
+ return (
195
+ <FeedbackBlock kind="error" micro data-testid="feedback-block-micro-error">
196
+ We are experiencing difficulties communicating to the server. Please try again later.
197
+ </FeedbackBlock>
198
+ );
199
+ }
200
+ `
201
+ },
202
+ info: {
203
+ description: "Information",
204
+ react: n`
205
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
206
+
207
+ function Component() {
208
+ return (
209
+ <FeedbackBlock kind="info" micro data-testid="feedback-block-micro-info">
210
+ Refresh the page to see the most recent version.
211
+ </FeedbackBlock>
212
+ );
213
+ }
214
+ `
215
+ },
216
+ proTip: {
217
+ description: "Pro Tip",
218
+ react: n`
219
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
220
+
221
+ function Component() {
222
+ return (
223
+ <FeedbackBlock kind="tip" micro data-testid="feedback-block-micro-tip">
224
+ Tip: Click the Receive button to check for new transactions.
225
+ </FeedbackBlock>
226
+ );
227
+ }
228
+ `
229
+ },
230
+ success: {
231
+ description: "Success",
232
+ react: n`
233
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
234
+
235
+ function Component() {
236
+ return (
237
+ <FeedbackBlock kind="success" micro data-testid="feedback-block-micro-success">
238
+ All items have been uploaded and are ready for export.
239
+ </FeedbackBlock>
240
+ );
241
+ }
242
+ `
243
+ },
244
+ warning: {
245
+ description: "Warning",
246
+ react: n`
247
+ import { FeedbackBlock } from "@sps-woodland/feedback-block";
248
+
249
+ function Component() {
250
+ return (
251
+ <FeedbackBlock kind="warning" micro data-testid="feedback-block-micro-warning">
252
+ This order is missing a shipment date.
253
+ </FeedbackBlock>
254
+ );
255
+ }
256
+ `
257
+ }
258
+ }
259
+ }
260
+ }
261
+ }, S = {
262
+ "Feedback Blocks": O
263
+ };
264
+ export {
265
+ i as FeedbackBlock,
266
+ E as FeedbackBlockIcons,
267
+ S as MANIFEST
268
+ };
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifest } from "@sps-woodland/core";
2
+ export declare const MANIFEST: ComponentManifest;
package/lib/style.css ADDED
@@ -0,0 +1 @@
1
+ ._1r00l560{display:flex}._1r00l561{background-color:#fff8e0;border-color:#fc0}._1r00l562{background-color:#e7f3ec;border-color:#0b8940}._1r00l563{background-color:#fcf1e7;border-color:#e7760b}._1r00l564{background-color:#e6f2f8;border-color:#09638d}._1r00l565{background-color:#fbe6ea;border-color:#de002e}._1r00l566{height:1rem;border:none;background-color:transparent}._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}._1r00l568{color:#fc0}._1r00l569{color:#0b8940}._1r00l56a{color:#e7760b}._1r00l56b{color:#09638d}._1r00l56c{color:#de002e}._1r00l56d{font-size:.875rem;font-weight:400;line-height:1.125rem;vertical-align:middle}._1r00l56e{margin-right:.5rem;font-size:1.25rem;vertical-align:middle}._1r00l56f{color:#09638d}._1r00l56g{color:#4b5356;font-size:.75rem;font-weight:600;line-height:1.125rem;margin-left:.25rem}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@sps-woodland/feedback-block",
3
+ "description": "SPS Woodland Design System feedback block component",
4
+ "version": "7.0.0",
5
+ "author": "SPS Commerce",
6
+ "license": "UNLICENSED",
7
+ "repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/feedback-block",
8
+ "homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/feedback-block#readme",
9
+ "main": "./lib/index.es.js",
10
+ "module": "./lib/index.es.js",
11
+ "types": "./lib/index.d.ts",
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "peerDependencies": {
16
+ "@sps-woodland/core": "7.0.0",
17
+ "@sps-woodland/tabs": "7.0.0",
18
+ "@sps-woodland/tokens": "7.0.0",
19
+ "@spscommerce/utils": "^6.12.1",
20
+ "react": "^16.9.0",
21
+ "react-dom": "^16.9.0"
22
+ },
23
+ "devDependencies": {
24
+ "@sps-woodland/core": "7.0.0",
25
+ "@sps-woodland/tabs": "7.0.0",
26
+ "@sps-woodland/tokens": "7.0.0",
27
+ "@spscommerce/utils": "^6.12.1",
28
+ "@vanilla-extract/css": "^1.9.1",
29
+ "@vanilla-extract/recipes": "^0.2.5",
30
+ "react": "^16.9.0",
31
+ "react-dom": "^16.9.0"
32
+ },
33
+ "scripts": {
34
+ "build": "pnpm run build:js && pnpm run build:types",
35
+ "build:js": "vite build",
36
+ "build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
37
+ "watch": "vite build --watch",
38
+ "clean": "git clean -fdX",
39
+ "pub": "node ../../../scripts/publish-package.js"
40
+ }
41
+ }
package/vite.config.js ADDED
@@ -0,0 +1,21 @@
1
+ import path from "path";
2
+ import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
3
+ import { defineConfig } from "vite";
4
+
5
+ import pkg from "./package.json";
6
+
7
+ export default defineConfig({
8
+ plugins: [vanillaExtractPlugin()],
9
+ build: {
10
+ lib: {
11
+ entry: path.resolve(__dirname, "src/index.ts"),
12
+ formats: ["es", "cjs"],
13
+ fileName: (format) => `index.${format}.js`,
14
+ },
15
+ outDir: path.resolve(__dirname, "./lib"),
16
+ emptyOutDir: false,
17
+ rollupOptions: {
18
+ external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
19
+ },
20
+ },
21
+ });