@sps-woodland/zero-state 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/zero-state](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/zero-state#readme)
2
+
3
+ SPS Woodland Design System zero state component
@@ -0,0 +1,43 @@
1
+ export declare const zeroStateContainer: string;
2
+ export declare const zeroStateWrapper: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
3
+ micro: {
4
+ true: {};
5
+ false: {
6
+ padding: string;
7
+ containerName: string;
8
+ containerType: "size";
9
+ };
10
+ };
11
+ }>;
12
+ export declare const zeroState: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
13
+ micro: {
14
+ true: {
15
+ alignItems: "center";
16
+ display: "flex";
17
+ flexDirection: "column";
18
+ height: "100%";
19
+ justifyContent: "center";
20
+ width: "auto";
21
+ };
22
+ false: {};
23
+ };
24
+ }>;
25
+ export declare const zeroStateImage: string;
26
+ export declare const zeroStateHeading: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
27
+ micro: {
28
+ true: {
29
+ color: string;
30
+ fontSize: string;
31
+ fontWeight: number;
32
+ lineHeight: string;
33
+ };
34
+ false: {
35
+ color: string;
36
+ fontSize: string;
37
+ lineHeight: string;
38
+ };
39
+ };
40
+ }>;
41
+ export declare const zeroStateSubheading: string;
42
+ export declare const zeroStateContent: string;
43
+ export declare const microZeroStateIcon: string;
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import type { ComponentProps } from "@sps-woodland/core";
3
+ import { IconName } from "@sps-woodland/tokens";
4
+ export declare function ZeroState({ artwork, heading, illustration, subHeading, micro, children, className, icon, ...rest }: ComponentProps<{
5
+ artwork?: string;
6
+ heading?: string;
7
+ illustration?: string;
8
+ subHeading?: string;
9
+ micro: boolean;
10
+ icon?: IconName;
11
+ }, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifestEntry } from "@sps-woodland/core";
2
+ export declare const ZeroStateExamples: ComponentManifestEntry;
@@ -0,0 +1,169 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("react"),m=require("@sps-woodland/core"),v=require("@sps-woodland/illustrations"),s=require("@spscommerce/utils"),S=require("@sps-woodland/tokens");function w(e){if(e&&e.__esModule)return e;const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const o=w(C);function I(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}function g(e,a){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);a&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}function b(e){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?arguments[a]:{};a%2?g(Object(t),!0).forEach(function(r){I(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):g(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var y=(e,a,t)=>{for(var r of Object.keys(e)){var n;if(e[r]!==((n=a[r])!==null&&n!==void 0?n:t[r]))return!1}return!0},p=e=>a=>{var t=e.defaultClassName,r=b(b({},e.defaultVariants),a);for(var n in r){var i,d=(i=r[n])!==null&&i!==void 0?i:e.defaultVariants[n];if(d!=null){var l=d;typeof l=="boolean"&&(l=l===!0?"true":"false");var c=e.variantClassNames[n][l];c&&(t+=" "+c)}}for(var[u,h]of e.compoundVariants)y(u,r,e.defaultVariants)&&(t+=" "+h);return t},E="jrytnld",Z=p({defaultClassName:"jrytnl4",variantClassNames:{micro:{true:"jrytnl5",false:"jrytnl6"}},defaultVariants:{micro:!1},compoundVariants:[]}),N="jrytnlc",H=p({defaultClassName:"jrytnl8",variantClassNames:{micro:{true:"jrytnl9",false:"jrytnla"}},defaultVariants:{micro:!1},compoundVariants:[]}),A="jrytnl7",O="jrytnlb",j=p({defaultClassName:"jrytnl1",variantClassNames:{micro:{true:"jrytnl2",false:"jrytnl3"}},defaultVariants:{},compoundVariants:[]});function f({artwork:e,heading:a,illustration:t,subHeading:r,micro:n=!1,children:i,className:d,icon:l,...c}){const u=t||e||v.Illustrations.Large.BUILDING;return o.createElement("div",{className:j({micro:n})},o.createElement("div",{className:m.cl(Z({micro:n}),d),...c},n?o.createElement(o.Fragment,null,l?o.createElement(m.Icon,{className:E,icon:l,"aria-hidden":"true"}):o.createElement("img",{style:{height:"3rem"},src:u})):o.createElement("img",{className:A,src:u,alt:""}),o.createElement("h1",{className:H({micro:n})},a),o.createElement("h2",{className:O},r),o.createElement("div",{className:N},i)))}m.Metadata.set(f,{name:"ZeroState",props:{artwork:{type:"string"},heading:{type:"string"},illustration:{type:"string"},subHeading:{type:"string"},micro:{type:"boolean",default:"false"}}});const B={description:()=>o.createElement("p",null,"Zero States are placeholders in content areas when there is no content to show. You can view all available illustrations on the Illustrations page."),components:[f],examples:{general:{label:"Sizes",description:()=>o.createElement(o.Fragment,null,o.createElement("h5",{className:S.sprinkles({mb:"md"})},"There are 2 sizes of Zero States: Large and Small. They differ in appearance and are used in different cases."),o.createElement("h4",null,"Large Zero States"),o.createElement("h5",{className:S.sprinkles({mb:"md"})},"Use Large Zero States in primary or large areas of a page."),o.createElement("h4",null,"Small Zero States"),o.createElement("h5",null,"Use Small Zero States in secondary or small areas of a page."))},regular:{label:"Usage: Large Zero States",description:({NavigateTo:e})=>o.createElement("p",null,"Large Zero States may be accompanied by other components such as Headings, Subtitles,"," ",o.createElement(e,{to:"Button"},"Buttons"),","," ",o.createElement(e,{to:"List Toolbar"},"Search Bars"),", or a combination of these"),examples:{illustrationAndHeading:{description:"Illustration + Heading",react:s.code`
2
+ import { ZeroState } from "@sps-woodland/zero-state";
3
+ import { Card } from "@sps-woodland/cards";
4
+ import { Illustrations } from "@sps-woodland/core";
5
+
6
+ function Component() {
7
+ return (
8
+ <Card>
9
+ <ZeroState
10
+ heading="Search for a record"
11
+ artwork={Illustrations.Large.GENERAL_SEARCH}
12
+ />
13
+ </Card>
14
+ );
15
+ }
16
+ `},illustrationHeadingAndSubtitle:{description:"Illustration + Heading + Subtitle",react:s.code`
17
+ import { ZeroState } from "@sps-woodland/zero-state";
18
+ import { Card } from "@sps-woodland/cards";
19
+ import { Illustrations } from "@sps-woodland/core";
20
+
21
+ function Component() {
22
+ return (
23
+ <Card>
24
+ <ZeroState
25
+ artwork={Illustrations.Large.GENERAL_SEARCH}
26
+ heading="Search for a record"
27
+ subHeading="Find a new record by using the search box above."
28
+ />
29
+ </Card>
30
+ );
31
+ }
32
+ `},illustrationHeadingAndButton:{description:"Illustration + Heading + Button",react:s.code`
33
+ import { ZeroState } from "@sps-woodland/zero-state";
34
+ import { Card } from "@sps-woodland/cards";
35
+ import { Illustrations } from "@sps-woodland/core";
36
+ import { SpsButton } from "@spscommerce/ds-react";
37
+ import { ButtonKind } from "@spscommerce/ds-shared";
38
+
39
+ function Component() {
40
+ return (
41
+ <Card>
42
+ <ZeroState
43
+ artwork={Illustrations.Large.GENERAL_SEARCH}
44
+ heading="Search for a record"
45
+ >
46
+ <SpsButton kind={ButtonKind.CONFIRM}>
47
+ Search
48
+ </SpsButton>
49
+ </ZeroState>
50
+ </Card>
51
+ );
52
+ }
53
+ `},illustrationHeadingSubtitleAndButton:{description:"Illustration + Heading + Subtitle + Button",react:s.code`
54
+ import { ZeroState } from "@sps-woodland/zero-state";
55
+ import { Card } from "@sps-woodland/cards";
56
+ import { Illustrations } from "@sps-woodland/core";
57
+ import { SpsButton } from "@spscommerce/ds-react";
58
+ import { ButtonKind } from "@spscommerce/ds-shared";
59
+
60
+ function Component() {
61
+ return (
62
+ <Card>
63
+ <ZeroState
64
+ artwork={Illustrations.Large.GENERAL_SEARCH}
65
+ heading="Search for a record"
66
+ subHeading="Find new companies by using the Search button below."
67
+ >
68
+ <SpsButton kind={ButtonKind.CONFIRM}>
69
+ Search
70
+ </SpsButton>
71
+ </ZeroState>
72
+ </Card>
73
+ );
74
+ }
75
+ `},illustrationHeadingSubtitleAndSearch:{description:"Illustration + Heading + Subtitle + Search",react:s.code`
76
+ import { ZeroState } from "@sps-woodland/zero-state";
77
+ import { Card } from "@sps-woodland/cards";
78
+ import { Illustrations } from "@sps-woodland/core";
79
+ import { SpsInputGroup, SpsTextInput, SpsButton } from "@spscommerce/ds-react";
80
+ import { ButtonKind, SpsIcon } from "@spscommerce/ds-shared";
81
+
82
+ function Component() {
83
+ const [searchText, setSearchText] = React.useState("");
84
+
85
+ function handleChange(e) {
86
+ setSearchText(e.target.value);
87
+ }
88
+
89
+ return (
90
+ <Card>
91
+ <ZeroState
92
+ artwork={Illustrations.Large.GENERAL_SEARCH}
93
+ heading="Search for a record"
94
+ >
95
+ <SpsInputGroup>
96
+ <SpsTextInput
97
+ name="search"
98
+ value={searchText}
99
+ placeholder="Search for a record"
100
+ onChange={handleChange}
101
+ />
102
+ <SpsButton kind={ButtonKind.ICON} icon={SpsIcon.SEARCH} aria-label="Search" />
103
+ </SpsInputGroup>
104
+ </ZeroState>
105
+ </Card>
106
+ );
107
+ }
108
+ `}}},micro:{label:"Usage: Small Zero State",description:"Small Zero States may be accompanied by Headings, Subtitles, or both.",examples:{illustrationAndHeading:{description:"Illustration + Heading",react:s.code`
109
+ import { ZeroState } from "@sps-woodland/zero-state";
110
+ import { Card } from "@sps-woodland/cards";
111
+ import { Illustrations } from "@sps-woodland/core";
112
+
113
+ function Component() {
114
+ return (
115
+ <div className={grid.root}>
116
+ <div className={grid[4]}>
117
+ <Card>
118
+ <ZeroState
119
+ heading="No Data Available"
120
+ artwork={Illustrations.Small.BAR_CHART}
121
+ micro
122
+ />
123
+ </Card>
124
+ </div>
125
+ </div>
126
+ );
127
+ }
128
+ `},illustrationAndSubtitle:{description:"Illustration + Subtitle",react:s.code`
129
+ import { ZeroState } from "@sps-woodland/zero-state";
130
+ import { Card } from "@sps-woodland/cards";
131
+ import { Illustrations } from "@sps-woodland/core";
132
+
133
+ function Component() {
134
+ return (
135
+ <div className={grid.root}>
136
+ <div className={grid[4]}>
137
+ <Card>
138
+ <ZeroState
139
+ subHeading="No data available. Create a report and try again."
140
+ artwork={Illustrations.Small.BAR_CHART}
141
+ micro
142
+ />
143
+ </Card>
144
+ </div>
145
+ </div>
146
+ );
147
+ }
148
+ `},illustrationHeadingAndSubtitle:{description:"Illustration + Heading + Subtitle",react:s.code`
149
+ import { ZeroState } from "@sps-woodland/zero-state";
150
+ import { Card } from "@sps-woodland/cards";
151
+ import { Illustrations } from "@sps-woodland/core";
152
+
153
+ function Component() {
154
+ return (
155
+ <div className={grid.root}>
156
+ <div className={grid[4]}>
157
+ <Card>
158
+ <ZeroState
159
+ heading="No Data Available"
160
+ subHeading="No data available. Create a report and try again."
161
+ artwork={Illustrations.Small.BAR_CHART}
162
+ micro
163
+ />
164
+ </Card>
165
+ </div>
166
+ </div>
167
+ );
168
+ }
169
+ `}}}}},R={"Zero States":B};exports.MANIFEST=R;exports.ZeroState=f;
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./ZeroState";
2
+ export * from "./manifest";
@@ -0,0 +1,338 @@
1
+ import * as t from "react";
2
+ import { Metadata as b, cl as C, Icon as v } from "@sps-woodland/core";
3
+ import { Illustrations as w } from "@sps-woodland/illustrations";
4
+ import { code as s } from "@spscommerce/utils";
5
+ import { sprinkles as p } from "@sps-woodland/tokens";
6
+ function I(e, o, r) {
7
+ return o in e ? Object.defineProperty(e, o, {
8
+ value: r,
9
+ enumerable: !0,
10
+ configurable: !0,
11
+ writable: !0
12
+ }) : e[o] = r, e;
13
+ }
14
+ function f(e, o) {
15
+ var r = Object.keys(e);
16
+ if (Object.getOwnPropertySymbols) {
17
+ var a = Object.getOwnPropertySymbols(e);
18
+ o && (a = a.filter(function(n) {
19
+ return Object.getOwnPropertyDescriptor(e, n).enumerable;
20
+ })), r.push.apply(r, a);
21
+ }
22
+ return r;
23
+ }
24
+ function S(e) {
25
+ for (var o = 1; o < arguments.length; o++) {
26
+ var r = arguments[o] != null ? arguments[o] : {};
27
+ o % 2 ? f(Object(r), !0).forEach(function(a) {
28
+ I(e, a, r[a]);
29
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : f(Object(r)).forEach(function(a) {
30
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(r, a));
31
+ });
32
+ }
33
+ return e;
34
+ }
35
+ var E = (e, o, r) => {
36
+ for (var a of Object.keys(e)) {
37
+ var n;
38
+ if (e[a] !== ((n = o[a]) !== null && n !== void 0 ? n : r[a]))
39
+ return !1;
40
+ }
41
+ return !0;
42
+ }, u = (e) => (o) => {
43
+ var r = e.defaultClassName, a = S(S({}, e.defaultVariants), o);
44
+ for (var n in a) {
45
+ var i, d = (i = a[n]) !== null && i !== void 0 ? i : e.defaultVariants[n];
46
+ if (d != null) {
47
+ var l = d;
48
+ typeof l == "boolean" && (l = l === !0 ? "true" : "false");
49
+ var m = e.variantClassNames[n][l];
50
+ m && (r += " " + m);
51
+ }
52
+ }
53
+ for (var [c, h] of e.compoundVariants)
54
+ E(c, a, e.defaultVariants) && (r += " " + h);
55
+ return r;
56
+ }, y = "jrytnld", Z = u({ defaultClassName: "jrytnl4", variantClassNames: { micro: { true: "jrytnl5", false: "jrytnl6" } }, defaultVariants: { micro: !1 }, compoundVariants: [] }), N = "jrytnlc", H = u({ defaultClassName: "jrytnl8", variantClassNames: { micro: { true: "jrytnl9", false: "jrytnla" } }, defaultVariants: { micro: !1 }, compoundVariants: [] }), A = "jrytnl7", B = "jrytnlb", j = u({ defaultClassName: "jrytnl1", variantClassNames: { micro: { true: "jrytnl2", false: "jrytnl3" } }, defaultVariants: {}, compoundVariants: [] });
57
+ function g({
58
+ artwork: e,
59
+ heading: o,
60
+ illustration: r,
61
+ subHeading: a,
62
+ micro: n = !1,
63
+ children: i,
64
+ className: d,
65
+ icon: l,
66
+ ...m
67
+ }) {
68
+ const c = r || e || w.Large.BUILDING;
69
+ return /* @__PURE__ */ t.createElement("div", {
70
+ className: j({ micro: n })
71
+ }, /* @__PURE__ */ t.createElement("div", {
72
+ className: C(Z({ micro: n }), d),
73
+ ...m
74
+ }, n ? /* @__PURE__ */ t.createElement(t.Fragment, null, l ? /* @__PURE__ */ t.createElement(v, {
75
+ className: y,
76
+ icon: l,
77
+ "aria-hidden": "true"
78
+ }) : /* @__PURE__ */ t.createElement("img", {
79
+ style: { height: "3rem" },
80
+ src: c
81
+ })) : /* @__PURE__ */ t.createElement("img", {
82
+ className: A,
83
+ src: c,
84
+ alt: ""
85
+ }), /* @__PURE__ */ t.createElement("h1", {
86
+ className: H({ micro: n })
87
+ }, o), /* @__PURE__ */ t.createElement("h2", {
88
+ className: B
89
+ }, a), /* @__PURE__ */ t.createElement("div", {
90
+ className: N
91
+ }, i)));
92
+ }
93
+ b.set(g, {
94
+ name: "ZeroState",
95
+ props: {
96
+ artwork: { type: "string" },
97
+ heading: { type: "string" },
98
+ illustration: { type: "string" },
99
+ subHeading: { type: "string" },
100
+ micro: { type: "boolean", default: "false" }
101
+ }
102
+ });
103
+ const O = {
104
+ description: () => /* @__PURE__ */ t.createElement("p", null, "Zero States are placeholders in content areas when there is no content to show. You can view all available illustrations on the Illustrations page."),
105
+ components: [g],
106
+ examples: {
107
+ general: {
108
+ label: "Sizes",
109
+ description: () => /* @__PURE__ */ t.createElement(t.Fragment, null, /* @__PURE__ */ t.createElement("h5", {
110
+ className: p({ mb: "md" })
111
+ }, "There are 2 sizes of Zero States: Large and Small. They differ in appearance and are used in different cases."), /* @__PURE__ */ t.createElement("h4", null, "Large Zero States"), /* @__PURE__ */ t.createElement("h5", {
112
+ className: p({ mb: "md" })
113
+ }, "Use Large Zero States in primary or large areas of a page."), /* @__PURE__ */ t.createElement("h4", null, "Small Zero States"), /* @__PURE__ */ t.createElement("h5", null, "Use Small Zero States in secondary or small areas of a page."))
114
+ },
115
+ regular: {
116
+ label: "Usage: Large Zero States",
117
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ t.createElement("p", null, "Large Zero States may be accompanied by other components such as Headings, Subtitles,", " ", /* @__PURE__ */ t.createElement(e, {
118
+ to: "Button"
119
+ }, "Buttons"), ",", " ", /* @__PURE__ */ t.createElement(e, {
120
+ to: "List Toolbar"
121
+ }, "Search Bars"), ", or a combination of these"),
122
+ examples: {
123
+ illustrationAndHeading: {
124
+ description: "Illustration + Heading",
125
+ react: s`
126
+ import { ZeroState } from "@sps-woodland/zero-state";
127
+ import { Card } from "@sps-woodland/cards";
128
+ import { Illustrations } from "@sps-woodland/core";
129
+
130
+ function Component() {
131
+ return (
132
+ <Card>
133
+ <ZeroState
134
+ heading="Search for a record"
135
+ artwork={Illustrations.Large.GENERAL_SEARCH}
136
+ />
137
+ </Card>
138
+ );
139
+ }
140
+ `
141
+ },
142
+ illustrationHeadingAndSubtitle: {
143
+ description: "Illustration + Heading + Subtitle",
144
+ react: s`
145
+ import { ZeroState } from "@sps-woodland/zero-state";
146
+ import { Card } from "@sps-woodland/cards";
147
+ import { Illustrations } from "@sps-woodland/core";
148
+
149
+ function Component() {
150
+ return (
151
+ <Card>
152
+ <ZeroState
153
+ artwork={Illustrations.Large.GENERAL_SEARCH}
154
+ heading="Search for a record"
155
+ subHeading="Find a new record by using the search box above."
156
+ />
157
+ </Card>
158
+ );
159
+ }
160
+ `
161
+ },
162
+ illustrationHeadingAndButton: {
163
+ description: "Illustration + Heading + Button",
164
+ react: s`
165
+ import { ZeroState } from "@sps-woodland/zero-state";
166
+ import { Card } from "@sps-woodland/cards";
167
+ import { Illustrations } from "@sps-woodland/core";
168
+ import { SpsButton } from "@spscommerce/ds-react";
169
+ import { ButtonKind } from "@spscommerce/ds-shared";
170
+
171
+ function Component() {
172
+ return (
173
+ <Card>
174
+ <ZeroState
175
+ artwork={Illustrations.Large.GENERAL_SEARCH}
176
+ heading="Search for a record"
177
+ >
178
+ <SpsButton kind={ButtonKind.CONFIRM}>
179
+ Search
180
+ </SpsButton>
181
+ </ZeroState>
182
+ </Card>
183
+ );
184
+ }
185
+ `
186
+ },
187
+ illustrationHeadingSubtitleAndButton: {
188
+ description: "Illustration + Heading + Subtitle + Button",
189
+ react: s`
190
+ import { ZeroState } from "@sps-woodland/zero-state";
191
+ import { Card } from "@sps-woodland/cards";
192
+ import { Illustrations } from "@sps-woodland/core";
193
+ import { SpsButton } from "@spscommerce/ds-react";
194
+ import { ButtonKind } from "@spscommerce/ds-shared";
195
+
196
+ function Component() {
197
+ return (
198
+ <Card>
199
+ <ZeroState
200
+ artwork={Illustrations.Large.GENERAL_SEARCH}
201
+ heading="Search for a record"
202
+ subHeading="Find new companies by using the Search button below."
203
+ >
204
+ <SpsButton kind={ButtonKind.CONFIRM}>
205
+ Search
206
+ </SpsButton>
207
+ </ZeroState>
208
+ </Card>
209
+ );
210
+ }
211
+ `
212
+ },
213
+ illustrationHeadingSubtitleAndSearch: {
214
+ description: "Illustration + Heading + Subtitle + Search",
215
+ react: s`
216
+ import { ZeroState } from "@sps-woodland/zero-state";
217
+ import { Card } from "@sps-woodland/cards";
218
+ import { Illustrations } from "@sps-woodland/core";
219
+ import { SpsInputGroup, SpsTextInput, SpsButton } from "@spscommerce/ds-react";
220
+ import { ButtonKind, SpsIcon } from "@spscommerce/ds-shared";
221
+
222
+ function Component() {
223
+ const [searchText, setSearchText] = React.useState("");
224
+
225
+ function handleChange(e) {
226
+ setSearchText(e.target.value);
227
+ }
228
+
229
+ return (
230
+ <Card>
231
+ <ZeroState
232
+ artwork={Illustrations.Large.GENERAL_SEARCH}
233
+ heading="Search for a record"
234
+ >
235
+ <SpsInputGroup>
236
+ <SpsTextInput
237
+ name="search"
238
+ value={searchText}
239
+ placeholder="Search for a record"
240
+ onChange={handleChange}
241
+ />
242
+ <SpsButton kind={ButtonKind.ICON} icon={SpsIcon.SEARCH} aria-label="Search" />
243
+ </SpsInputGroup>
244
+ </ZeroState>
245
+ </Card>
246
+ );
247
+ }
248
+ `
249
+ }
250
+ }
251
+ },
252
+ micro: {
253
+ label: "Usage: Small Zero State",
254
+ description: "Small Zero States may be accompanied by Headings, Subtitles, or both.",
255
+ examples: {
256
+ illustrationAndHeading: {
257
+ description: "Illustration + Heading",
258
+ react: s`
259
+ import { ZeroState } from "@sps-woodland/zero-state";
260
+ import { Card } from "@sps-woodland/cards";
261
+ import { Illustrations } from "@sps-woodland/core";
262
+
263
+ function Component() {
264
+ return (
265
+ <div className={grid.root}>
266
+ <div className={grid[4]}>
267
+ <Card>
268
+ <ZeroState
269
+ heading="No Data Available"
270
+ artwork={Illustrations.Small.BAR_CHART}
271
+ micro
272
+ />
273
+ </Card>
274
+ </div>
275
+ </div>
276
+ );
277
+ }
278
+ `
279
+ },
280
+ illustrationAndSubtitle: {
281
+ description: "Illustration + Subtitle",
282
+ react: s`
283
+ import { ZeroState } from "@sps-woodland/zero-state";
284
+ import { Card } from "@sps-woodland/cards";
285
+ import { Illustrations } from "@sps-woodland/core";
286
+
287
+ function Component() {
288
+ return (
289
+ <div className={grid.root}>
290
+ <div className={grid[4]}>
291
+ <Card>
292
+ <ZeroState
293
+ subHeading="No data available. Create a report and try again."
294
+ artwork={Illustrations.Small.BAR_CHART}
295
+ micro
296
+ />
297
+ </Card>
298
+ </div>
299
+ </div>
300
+ );
301
+ }
302
+ `
303
+ },
304
+ illustrationHeadingAndSubtitle: {
305
+ description: "Illustration + Heading + Subtitle",
306
+ react: s`
307
+ import { ZeroState } from "@sps-woodland/zero-state";
308
+ import { Card } from "@sps-woodland/cards";
309
+ import { Illustrations } from "@sps-woodland/core";
310
+
311
+ function Component() {
312
+ return (
313
+ <div className={grid.root}>
314
+ <div className={grid[4]}>
315
+ <Card>
316
+ <ZeroState
317
+ heading="No Data Available"
318
+ subHeading="No data available. Create a report and try again."
319
+ artwork={Illustrations.Small.BAR_CHART}
320
+ micro
321
+ />
322
+ </Card>
323
+ </div>
324
+ </div>
325
+ );
326
+ }
327
+ `
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }, T = {
333
+ "Zero States": O
334
+ };
335
+ export {
336
+ T as MANIFEST,
337
+ g as ZeroState
338
+ };
@@ -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
+ .jrytnl3{padding:1rem;container-name:jrytnl0;container-type:size}.jrytnl4{margin:auto;padding-top:2rem;padding-right:0;padding-bottom:2rem;padding-left:0;text-align:center}.jrytnl5{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:auto}.jrytnl7{height:6.25rem;margin-bottom:1rem;width:12.5rem}.jrytnl8{margin-bottom:0}.jrytnl9{color:#4b5356;font-size:1rem;font-weight:600;line-height:1.25rem}.jrytnla{color:#1f282c;font-size:1.5rem;line-height:1.5rem}.jrytnlb{color:#4b5356;font-size:.875rem;line-height:1.25rem;margin-top:.25rem;margin-bottom:0}.jrytnlc{margin-top:1rem}.jrytnld{color:#717779;font-size:3rem;line-height:3rem;padding-bottom:.25rem}@media screen and (min-width: 768px){.jrytnl4{width:75%}}@media screen and (min-width: 992px){.jrytnl4{width:50%}}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@sps-woodland/zero-state",
3
+ "description": "SPS Woodland Design System zero state 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/zero-state",
8
+ "homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/zero-state#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
+ "@spscommerce/utils": "^6.12.1",
17
+ "@sps-woodland/core": "7.0.0",
18
+ "@sps-woodland/tokens": "7.0.0",
19
+ "@sps-woodland/illustrations": "7.0.0",
20
+ "react": "^16.9.0",
21
+ "react-dom": "^16.9.0"
22
+ },
23
+ "devDependencies": {
24
+ "@vanilla-extract/css": "^1.9.1",
25
+ "@vanilla-extract/recipes": "^0.2.5",
26
+ "@spscommerce/utils": "^6.12.1",
27
+ "@sps-woodland/core": "7.0.0",
28
+ "@sps-woodland/tokens": "7.0.0",
29
+ "@sps-woodland/illustrations": "7.0.0",
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
+ });