@sps-woodland/cards 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 +3 -0
- package/lib/card/Card.examples.d.ts +2 -0
- package/lib/card/card/Card.css.d.ts +1 -0
- package/lib/card/card/Card.d.ts +3 -0
- package/lib/card/card-footer/CardFooter.css.d.ts +1 -0
- package/lib/card/card-footer/CardFooter.d.ts +3 -0
- package/lib/card/card-header/CardHeader.css.d.ts +1 -0
- package/lib/card/card-header/CardHeader.d.ts +3 -0
- package/lib/card/card-title/CardTitle.css.d.ts +1 -0
- package/lib/card/card-title/CardTitle.d.ts +3 -0
- package/lib/index.cjs.js +539 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.es.js +862 -0
- package/lib/insight-card/InsightCard.d.ts +14 -0
- package/lib/insight-card/InsightCard.examples.d.ts +2 -0
- package/lib/insight-card/InsightCardSet.d.ts +2 -0
- package/lib/manifest.d.ts +2 -0
- package/lib/scrollable-container/ScrollableContainer.css.d.ts +1 -0
- package/lib/scrollable-container/ScrollableContainer.d.ts +5 -0
- package/lib/scrollable-container/ScrollableContainer.examples.d.ts +2 -0
- package/lib/style.css +1 -0
- package/package.json +40 -0
- package/vite.config.js +21 -0
package/lib/index.es.js
ADDED
|
@@ -0,0 +1,862 @@
|
|
|
1
|
+
import { Metadata as s, CapContent as I, cl as c, selectChildren as E, useChildTestIdAttrBuilder as f, addProps as q, Content as N, CapContentTitle as _, I18nContext as F } from "@sps-woodland/core";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { code as i } from "@spscommerce/utils";
|
|
4
|
+
var P = "_1gxcp3j0";
|
|
5
|
+
function g({
|
|
6
|
+
children: t,
|
|
7
|
+
className: a = "",
|
|
8
|
+
...n
|
|
9
|
+
}) {
|
|
10
|
+
return /* @__PURE__ */ e.createElement(I, {
|
|
11
|
+
className: c(P, a),
|
|
12
|
+
...n
|
|
13
|
+
}, t);
|
|
14
|
+
}
|
|
15
|
+
s.set(g, { name: "CardFooter" });
|
|
16
|
+
var H = "mxozo50";
|
|
17
|
+
function C({
|
|
18
|
+
children: t,
|
|
19
|
+
className: a = "",
|
|
20
|
+
...n
|
|
21
|
+
}) {
|
|
22
|
+
return /* @__PURE__ */ e.createElement(I, {
|
|
23
|
+
className: c(H, a),
|
|
24
|
+
...n
|
|
25
|
+
}, t);
|
|
26
|
+
}
|
|
27
|
+
s.set(C, { name: "CardHeader" });
|
|
28
|
+
var D = "jyyttb0";
|
|
29
|
+
function x({
|
|
30
|
+
children: t,
|
|
31
|
+
className: a,
|
|
32
|
+
...n
|
|
33
|
+
}) {
|
|
34
|
+
const [
|
|
35
|
+
l,
|
|
36
|
+
[o],
|
|
37
|
+
u,
|
|
38
|
+
p
|
|
39
|
+
] = E(t, [
|
|
40
|
+
{ type: C },
|
|
41
|
+
{
|
|
42
|
+
custom: (m) => s.isWoodlandComponent(m) && s.get(m).name === "Tabs"
|
|
43
|
+
},
|
|
44
|
+
{ type: g }
|
|
45
|
+
]), d = f(n);
|
|
46
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
47
|
+
className: c(D, a),
|
|
48
|
+
...n
|
|
49
|
+
}, l, o ? q(o, { context: "container" }) : /* @__PURE__ */ e.createElement(N, {
|
|
50
|
+
...d("body")
|
|
51
|
+
}, p), u);
|
|
52
|
+
}
|
|
53
|
+
s.set(x, { name: "Card" });
|
|
54
|
+
var z = "_1f11ubh0";
|
|
55
|
+
function y({
|
|
56
|
+
children: t,
|
|
57
|
+
className: a = "",
|
|
58
|
+
...n
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ e.createElement(_, {
|
|
61
|
+
className: c(z, a),
|
|
62
|
+
...n
|
|
63
|
+
}, t);
|
|
64
|
+
}
|
|
65
|
+
s.set(y, { name: "CardTitle" });
|
|
66
|
+
const W = Object.freeze({
|
|
67
|
+
general: "status-new",
|
|
68
|
+
success: "status-ok",
|
|
69
|
+
error: "status-error",
|
|
70
|
+
warning: "status-warning",
|
|
71
|
+
processing: "status-in-process"
|
|
72
|
+
});
|
|
73
|
+
function v({
|
|
74
|
+
children: t,
|
|
75
|
+
className: a,
|
|
76
|
+
horizontal: n = !1,
|
|
77
|
+
icon: l,
|
|
78
|
+
kind: o = "general",
|
|
79
|
+
title: u,
|
|
80
|
+
metric: p,
|
|
81
|
+
partnerCount: d,
|
|
82
|
+
totalPartners: m,
|
|
83
|
+
...b
|
|
84
|
+
}) {
|
|
85
|
+
const { t: h } = e.useContext(F), r = f(b), [
|
|
86
|
+
w,
|
|
87
|
+
S,
|
|
88
|
+
B
|
|
89
|
+
] = (d ? h("design-system:insightTile.partnerCount", {
|
|
90
|
+
count: d,
|
|
91
|
+
total: m
|
|
92
|
+
}) : "").split("|");
|
|
93
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", {
|
|
94
|
+
className: c(
|
|
95
|
+
"sps-insight-tile",
|
|
96
|
+
`sps-insight-tile--${o}`,
|
|
97
|
+
n && "sps-insight-tile--horizontal",
|
|
98
|
+
t && "sps-insight-tile--has-detail",
|
|
99
|
+
a
|
|
100
|
+
),
|
|
101
|
+
...b
|
|
102
|
+
}, /* @__PURE__ */ e.createElement("div", {
|
|
103
|
+
className: "sps-insight-tile__body",
|
|
104
|
+
...r("body")
|
|
105
|
+
}, l ? /* @__PURE__ */ e.createElement("i", {
|
|
106
|
+
className: `sps-icon sps-icon-${l}`,
|
|
107
|
+
...r("icon")
|
|
108
|
+
}) : /* @__PURE__ */ e.createElement("i", {
|
|
109
|
+
className: `sps-icon sps-icon-${W[o]}`,
|
|
110
|
+
...r("icon")
|
|
111
|
+
}), p && /* @__PURE__ */ e.createElement("div", {
|
|
112
|
+
className: "sps-insight-tile__metric-count",
|
|
113
|
+
...r("metric")
|
|
114
|
+
}, p), u && /* @__PURE__ */ e.createElement("div", {
|
|
115
|
+
className: "sps-insight-tile__description",
|
|
116
|
+
...r("description")
|
|
117
|
+
}, /* @__PURE__ */ e.createElement("div", {
|
|
118
|
+
className: "sps-insight-tile__title",
|
|
119
|
+
style: { "-webkit-box-orient": "vertical" },
|
|
120
|
+
...r("title")
|
|
121
|
+
}, u), /* @__PURE__ */ e.createElement("div", {
|
|
122
|
+
className: "sps-insight-tile__detail",
|
|
123
|
+
...r("detail")
|
|
124
|
+
}, t))), d && /* @__PURE__ */ e.createElement("div", {
|
|
125
|
+
className: "sps-insight-tile__partner-count",
|
|
126
|
+
...r("partner-count")
|
|
127
|
+
}, d === m ? /* @__PURE__ */ e.createElement("div", null, h("design-system:insightTile.all")) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", null, w), /* @__PURE__ */ e.createElement("div", null, S), /* @__PURE__ */ e.createElement("div", null, B)), /* @__PURE__ */ e.createElement("div", {
|
|
128
|
+
className: "sps-insight-tile__partners-text"
|
|
129
|
+
}, h("design-system:insightTile.partners")))));
|
|
130
|
+
}
|
|
131
|
+
s.set(v, {
|
|
132
|
+
name: "InsightCard",
|
|
133
|
+
props: {
|
|
134
|
+
horizontal: { type: "boolean", default: "false" },
|
|
135
|
+
icon: "IconName",
|
|
136
|
+
kind: { type: "InsightCardKind", default: '"general"' },
|
|
137
|
+
title: "string",
|
|
138
|
+
metric: "number | string",
|
|
139
|
+
partnerCount: "number",
|
|
140
|
+
totalPartners: "number"
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
function T({
|
|
144
|
+
children: t,
|
|
145
|
+
...a
|
|
146
|
+
}) {
|
|
147
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
148
|
+
className: "insight-tile-wrapper",
|
|
149
|
+
...a
|
|
150
|
+
}, t);
|
|
151
|
+
}
|
|
152
|
+
s.set(T, { name: "InsightCardSet" });
|
|
153
|
+
var A = "_7b9vus0";
|
|
154
|
+
function k({
|
|
155
|
+
children: t,
|
|
156
|
+
className: a,
|
|
157
|
+
maxHeight: n,
|
|
158
|
+
style: l,
|
|
159
|
+
...o
|
|
160
|
+
}) {
|
|
161
|
+
return /* @__PURE__ */ e.createElement("div", {
|
|
162
|
+
className: c(A, a),
|
|
163
|
+
style: { ...l, maxHeight: n },
|
|
164
|
+
...o
|
|
165
|
+
}, t);
|
|
166
|
+
}
|
|
167
|
+
s.set(k, {
|
|
168
|
+
name: "ScrollableContainer",
|
|
169
|
+
props: {
|
|
170
|
+
maxHeight: "string"
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
const R = {
|
|
174
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "Cards are used to group similar or related content together in a single container. They can be combined with additional elements such as Headers, Footers, or Tabs."),
|
|
175
|
+
components: [
|
|
176
|
+
x,
|
|
177
|
+
g,
|
|
178
|
+
C,
|
|
179
|
+
y
|
|
180
|
+
],
|
|
181
|
+
examples: {
|
|
182
|
+
general: {
|
|
183
|
+
label: "General Usage",
|
|
184
|
+
description: ({ Link: t, NavigateTo: a }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Sizing and Layout"), /* @__PURE__ */ e.createElement("p", null, "All varieties of Cards should be placed on the Woodland Grid (i.e. the width of a Card should span a specific number of grid columns). They should never be set to a custom width. See the ", /* @__PURE__ */ e.createElement(t, {
|
|
185
|
+
to: "/style-and-layout/grid"
|
|
186
|
+
}, "Woodland Grid"), " and", " ", /* @__PURE__ */ e.createElement(t, {
|
|
187
|
+
to: "/style-and-layout/page-types"
|
|
188
|
+
}, "Page Layouts"), " sections for more guidance on appropriate usage."), /* @__PURE__ */ e.createElement("p", null, "The height of a Card should typically be based on the content inside of it, but in specific cases a fixed height can be set. For these cases, content will scroll vertically inside of the container."), /* @__PURE__ */ e.createElement("h5", null, "Text Content"), /* @__PURE__ */ e.createElement("p", null, "The only text content that can exist outside of a Card is the", " ", /* @__PURE__ */ e.createElement(a, {
|
|
189
|
+
to: "page-title"
|
|
190
|
+
}, "Page Title"), " component."), /* @__PURE__ */ e.createElement("p", null, "All other content should exist inside of a Card and should adhere to the Woodland Design System ", /* @__PURE__ */ e.createElement(t, {
|
|
191
|
+
to: "/style-and-layout/typography"
|
|
192
|
+
}, "Typography"), " rules."), /* @__PURE__ */ e.createElement("h5", null, "Nesting"), /* @__PURE__ */ e.createElement("p", null, "Avoid nesting Cards inside of other Cards when possible. If nesting is necessary, avoid nesting more than one level deep (i.e. limit nesting to a Card inside of a Card)."))
|
|
193
|
+
},
|
|
194
|
+
basic: {
|
|
195
|
+
label: "Basic card",
|
|
196
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "Basic Cards can include any type of general content, such as body copy, description lists, or more complex content such as forms."),
|
|
197
|
+
examples: {
|
|
198
|
+
basic: {
|
|
199
|
+
react: i`
|
|
200
|
+
import { Card } from "@sps-woodland/cards";
|
|
201
|
+
function Component() {
|
|
202
|
+
return (
|
|
203
|
+
<Card>
|
|
204
|
+
<p>Business is changing... changing at the speed of information.</p>
|
|
205
|
+
</Card>
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
`
|
|
209
|
+
},
|
|
210
|
+
sections: {
|
|
211
|
+
react: i`
|
|
212
|
+
import { Card } from "@sps-woodland/cards";
|
|
213
|
+
function Component() {
|
|
214
|
+
return (
|
|
215
|
+
<Card>
|
|
216
|
+
<section>
|
|
217
|
+
<h3>Description</h3>
|
|
218
|
+
<p>
|
|
219
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
|
220
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
221
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
222
|
+
aliquip ex ea commodo consequat. Duis aute irure dolor in
|
|
223
|
+
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
|
|
224
|
+
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
225
|
+
culpa qui officia deserunt mollit anim id est laborum.
|
|
226
|
+
</p>
|
|
227
|
+
</section>
|
|
228
|
+
<section>
|
|
229
|
+
<h3>Usage Guidelines</h3>
|
|
230
|
+
<p>
|
|
231
|
+
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
|
|
232
|
+
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa
|
|
233
|
+
quae ab illo inventore veritatis et quasi architecto beatae vitae
|
|
234
|
+
dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
|
|
235
|
+
aspernatur aut odit aut fugit, sed quia consequuntur magni dolores
|
|
236
|
+
eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est,
|
|
237
|
+
qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit,
|
|
238
|
+
sed quia non numquam eius modi tempora incidunt ut labore et dolore
|
|
239
|
+
magnam aliquam quaerat voluptatem.
|
|
240
|
+
</p>
|
|
241
|
+
</section>
|
|
242
|
+
</Card>
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
`
|
|
246
|
+
},
|
|
247
|
+
nestedSections: {
|
|
248
|
+
react: i`
|
|
249
|
+
import { Card } from "@sps-woodland/cards";
|
|
250
|
+
function Component() {
|
|
251
|
+
return (
|
|
252
|
+
<Card>
|
|
253
|
+
<section>
|
|
254
|
+
<p>Section 1</p>
|
|
255
|
+
</section>
|
|
256
|
+
<section>
|
|
257
|
+
<section>
|
|
258
|
+
<p>Section 2</p>
|
|
259
|
+
</section>
|
|
260
|
+
<section>
|
|
261
|
+
<p>Section 3</p>
|
|
262
|
+
</section>
|
|
263
|
+
<section>
|
|
264
|
+
<p>Section 4</p>
|
|
265
|
+
</section>
|
|
266
|
+
</section>
|
|
267
|
+
</Card>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
`
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
headers: {
|
|
275
|
+
label: "Card + Header",
|
|
276
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "Headers can be attached to a Card to display a title (that describes the content inside the card) or add actions (buttons or links) that relate directly to the content inside of the card. Content is restricted to the left side (for titles) and right side (for actions) of the Header."),
|
|
277
|
+
examples: {
|
|
278
|
+
title: {
|
|
279
|
+
react: i`
|
|
280
|
+
import { SpsButton } from "@spscommerce/ds-react";
|
|
281
|
+
import { Card, CardHeader, CardTitle } from "@sps-woodland/cards";
|
|
282
|
+
import { Icon } from "@sps-woodland/core";
|
|
283
|
+
import { sprinkles } from "@sps-woodland/tokens";
|
|
284
|
+
function Component() {
|
|
285
|
+
return (
|
|
286
|
+
<Card>
|
|
287
|
+
<CardHeader>
|
|
288
|
+
<CardTitle>
|
|
289
|
+
<Icon icon="lightbulb" className={sprinkles({ mr: "xs" })} />
|
|
290
|
+
Jabberwocky
|
|
291
|
+
</CardTitle>
|
|
292
|
+
<div>
|
|
293
|
+
<SpsButton kind="link" className={sprinkles({ mr: "sm" })}>
|
|
294
|
+
Redefine
|
|
295
|
+
</SpsButton>
|
|
296
|
+
<SpsButton kind="icon" icon="printer" />
|
|
297
|
+
<SpsButton kind="icon" icon="download-cloud" />
|
|
298
|
+
<SpsButton className={sprinkles({ ml: "sm" })}>Innovate</SpsButton>
|
|
299
|
+
</div>
|
|
300
|
+
</CardHeader>
|
|
301
|
+
<p>
|
|
302
|
+
Whoever adapts first wins. In order to compete, we innovate; in order
|
|
303
|
+
to innovate, we redefine; and how do we redefine? With a new
|
|
304
|
+
definition!
|
|
305
|
+
</p>
|
|
306
|
+
</Card>
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
`
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
footers: {
|
|
314
|
+
label: "Card + Footer",
|
|
315
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "Footers can be attached to a Card to add secondary actions (buttons or links) that relate directly to the content inside of it, or other types of general content that may be applicable. Content can be placed in the middle or either side of the Footer."),
|
|
316
|
+
examples: {
|
|
317
|
+
basicFooter: {
|
|
318
|
+
react: i`
|
|
319
|
+
import { SpsButton } from "@spscommerce/ds-react";
|
|
320
|
+
import { Card, CardFooter } from "@sps-woodland/cards";
|
|
321
|
+
import { Box } from "@sps-woodland/core";
|
|
322
|
+
function Component() {
|
|
323
|
+
return (
|
|
324
|
+
<Card>
|
|
325
|
+
<p>
|
|
326
|
+
Imagine a new way to do business that's faster than a cheetah. More
|
|
327
|
+
powerful than... another cheetah! A way of doing business more
|
|
328
|
+
magnificent than... a fish! Or a whale!
|
|
329
|
+
</p>
|
|
330
|
+
<CardFooter>
|
|
331
|
+
<Box marginLeft="sm">
|
|
332
|
+
<SpsButton kind="link">Manage Settings</SpsButton>
|
|
333
|
+
</Box>
|
|
334
|
+
<Box marginX="auto">
|
|
335
|
+
Whales are not fish, but mammals like a cheetah.
|
|
336
|
+
</Box>
|
|
337
|
+
<SpsButton>Buy This</SpsButton>
|
|
338
|
+
</CardFooter>
|
|
339
|
+
</Card>
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
`
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
tabbed: {
|
|
347
|
+
label: "Card + Tabs",
|
|
348
|
+
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "Use Tabs to combine multiple cards with unique but related content. Tabs can include optional details such as icons or tags."), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("code", null, "<Item>"), " comes from the ", /* @__PURE__ */ e.createElement("code", null, "@react-stately/collections"), "package, which is a peer dependency of our React components.")),
|
|
349
|
+
examples: {
|
|
350
|
+
tabsOnly: {
|
|
351
|
+
react: i`
|
|
352
|
+
import { Card } from "@sps-woodland/cards";
|
|
353
|
+
import { Box, Icon } from "@sps-woodland/core";
|
|
354
|
+
import { Tabs } from "@sps-woodland/tabs";
|
|
355
|
+
import { SpsTag } from "@spscommerce/ds-react";
|
|
356
|
+
import { Item } from "@react-stately/collections";
|
|
357
|
+
function Component() {
|
|
358
|
+
return (
|
|
359
|
+
<Card>
|
|
360
|
+
<Tabs>
|
|
361
|
+
<Item key="tab1" title="Trust">
|
|
362
|
+
<p>
|
|
363
|
+
So, what is it? What is it exactly that's going to revolutionize
|
|
364
|
+
the way we do business?
|
|
365
|
+
</p>
|
|
366
|
+
</Item>
|
|
367
|
+
<Item
|
|
368
|
+
key="tab2"
|
|
369
|
+
title={
|
|
370
|
+
<>
|
|
371
|
+
<Box mr="xs">Reliability</Box>
|
|
372
|
+
<SpsTag kind="key">00</SpsTag>
|
|
373
|
+
</>
|
|
374
|
+
}
|
|
375
|
+
>
|
|
376
|
+
<p>Card with tabs, pane 2.</p>
|
|
377
|
+
</Item>
|
|
378
|
+
<Item
|
|
379
|
+
key="tab3"
|
|
380
|
+
title={
|
|
381
|
+
<>
|
|
382
|
+
<Icon icon="heart"/>
|
|
383
|
+
<Box ml="xs">The Future</Box>
|
|
384
|
+
</>
|
|
385
|
+
}
|
|
386
|
+
>
|
|
387
|
+
<p>Card with tabs, pane 3.</p>
|
|
388
|
+
</Item>
|
|
389
|
+
<Item
|
|
390
|
+
key="tab4"
|
|
391
|
+
title={
|
|
392
|
+
<>
|
|
393
|
+
<Icon icon="heart"/>
|
|
394
|
+
<Box mx="xs">Bold</Box>
|
|
395
|
+
<SpsTag kind="key">00</SpsTag>
|
|
396
|
+
</>
|
|
397
|
+
}
|
|
398
|
+
>
|
|
399
|
+
<p>Card with tabs, pane 4.</p>
|
|
400
|
+
</Item>
|
|
401
|
+
</Tabs>
|
|
402
|
+
</Card>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
`
|
|
406
|
+
},
|
|
407
|
+
activeTabInput: {
|
|
408
|
+
react: i`
|
|
409
|
+
import { Card } from "@sps-woodland/cards";
|
|
410
|
+
import { Tabs } from "@sps-woodland/tabs";
|
|
411
|
+
import { Item } from "@react-stately/collections";
|
|
412
|
+
function Component() {
|
|
413
|
+
return (
|
|
414
|
+
<Card>
|
|
415
|
+
<Tabs disabledKeys={["tab2", "tab3"]}>
|
|
416
|
+
<Item key="tab1" title="Tab 1">
|
|
417
|
+
<p>Card with disabled tabs, pane 1.</p>
|
|
418
|
+
</Item>
|
|
419
|
+
<Item key="tab2" title="Tab 2">
|
|
420
|
+
<p>Card with disabled tabs, pane 2.</p>
|
|
421
|
+
</Item>
|
|
422
|
+
<Item key="tab3" title="Tab 3">
|
|
423
|
+
<p>Card with disabled tabs, pane 3.</p>
|
|
424
|
+
</Item>
|
|
425
|
+
</Tabs>
|
|
426
|
+
</Card>
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
`
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
},
|
|
433
|
+
everything: {
|
|
434
|
+
label: "Card + Header + Footer + Tabs",
|
|
435
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "Headers, Footers, and Tabs can be attached to Cards in any combination."),
|
|
436
|
+
examples: {
|
|
437
|
+
everything: {
|
|
438
|
+
react: i`
|
|
439
|
+
import { SpsButton, SpsTag } from "@spscommerce/ds-react";
|
|
440
|
+
import { Card, CardHeader, CardTitle, CardFooter } from "@sps-woodland/cards";
|
|
441
|
+
import { Box, Icon } from "@sps-woodland/core";
|
|
442
|
+
import { Tabs } from "@sps-woodland/tabs";
|
|
443
|
+
import { sp } from "@sps-woodland/tokens";
|
|
444
|
+
import { Item } from "@react-stately/collections";
|
|
445
|
+
function Component() {
|
|
446
|
+
return (
|
|
447
|
+
<Card>
|
|
448
|
+
<CardHeader>
|
|
449
|
+
<CardTitle>
|
|
450
|
+
<Icon icon="status-ok" />
|
|
451
|
+
<Box ml="xs">Panel With Header</Box>
|
|
452
|
+
</CardTitle>
|
|
453
|
+
<div>
|
|
454
|
+
<SpsButton className={sp({ mr: "sm" })} kind="link">
|
|
455
|
+
Redefine
|
|
456
|
+
</SpsButton>
|
|
457
|
+
<SpsButton kind="icon" icon="printer" />
|
|
458
|
+
<SpsButton kind="icon" icon="download-cloud" />
|
|
459
|
+
<SpsButton className={sp({ ml: "sm" })}>Innovate</SpsButton>
|
|
460
|
+
</div>
|
|
461
|
+
</CardHeader>
|
|
462
|
+
<Tabs>
|
|
463
|
+
<Item key="tab1" title="Trust">
|
|
464
|
+
<p>Simple... it's Jabberwocky.</p>
|
|
465
|
+
<p>The game is changing right now.</p>
|
|
466
|
+
<p>Coming in 2012.</p>
|
|
467
|
+
</Item>
|
|
468
|
+
<Item
|
|
469
|
+
key="tab2"
|
|
470
|
+
title={
|
|
471
|
+
<>
|
|
472
|
+
<Box mr="xs">Reliability</Box>
|
|
473
|
+
<SpsTag kind="key">00</SpsTag>
|
|
474
|
+
</>
|
|
475
|
+
}
|
|
476
|
+
>
|
|
477
|
+
<p>Card with tabs, pane 2.</p>
|
|
478
|
+
</Item>
|
|
479
|
+
<Item
|
|
480
|
+
key="tab3"
|
|
481
|
+
title={
|
|
482
|
+
<>
|
|
483
|
+
<Icon icon="heart"/>
|
|
484
|
+
<Box ml="xs">The Future</Box>
|
|
485
|
+
</>
|
|
486
|
+
}
|
|
487
|
+
>
|
|
488
|
+
<p>Card with tabs, pane 3.</p>
|
|
489
|
+
</Item>
|
|
490
|
+
<Item
|
|
491
|
+
key="tab4"
|
|
492
|
+
title={
|
|
493
|
+
<>
|
|
494
|
+
<Icon icon="heart"/>
|
|
495
|
+
<Box mx="xs">Bold</Box>
|
|
496
|
+
<SpsTag kind="key">00</SpsTag>
|
|
497
|
+
</>
|
|
498
|
+
}
|
|
499
|
+
>
|
|
500
|
+
<p>Card with tabs, pane 4.</p>
|
|
501
|
+
</Item>
|
|
502
|
+
</Tabs>
|
|
503
|
+
<CardFooter>
|
|
504
|
+
<Box ml="auto">
|
|
505
|
+
<SpsButton className={sp({ mr: "sm" })} kind="link">
|
|
506
|
+
Redefine
|
|
507
|
+
</SpsButton>
|
|
508
|
+
<SpsButton kind="icon" icon="printer" />
|
|
509
|
+
<SpsButton kind="icon" icon="download-cloud" />
|
|
510
|
+
<SpsButton className={sp({ ml: "sm" })}>Innovate</SpsButton>
|
|
511
|
+
</Box>
|
|
512
|
+
</CardFooter>
|
|
513
|
+
</Card>
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
`
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}, U = {
|
|
522
|
+
components: [v, T],
|
|
523
|
+
examples: {
|
|
524
|
+
basic: {
|
|
525
|
+
label: "Basic Insight Cards",
|
|
526
|
+
examples: {
|
|
527
|
+
basic: {
|
|
528
|
+
react: i`
|
|
529
|
+
import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
|
|
530
|
+
function Component() {
|
|
531
|
+
return (
|
|
532
|
+
<InsightCardSet>
|
|
533
|
+
<InsightCard
|
|
534
|
+
kind="general"
|
|
535
|
+
metric="1234"
|
|
536
|
+
title="Insight Card Title"
|
|
537
|
+
/>
|
|
538
|
+
<InsightCard
|
|
539
|
+
kind="processing"
|
|
540
|
+
metric="1234"
|
|
541
|
+
title="Insight Card Title"
|
|
542
|
+
/>
|
|
543
|
+
<InsightCard
|
|
544
|
+
kind="success"
|
|
545
|
+
metric="1234"
|
|
546
|
+
title="Insight Card Title"
|
|
547
|
+
/>
|
|
548
|
+
<InsightCard
|
|
549
|
+
kind="warning"
|
|
550
|
+
metric="1234"
|
|
551
|
+
title="Insight Card Title"
|
|
552
|
+
/>
|
|
553
|
+
<InsightCard
|
|
554
|
+
kind="error"
|
|
555
|
+
metric="1234"
|
|
556
|
+
title="Insight Card Title"
|
|
557
|
+
/>
|
|
558
|
+
</InsightCardSet>
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
`
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
details: {
|
|
566
|
+
label: "With Details",
|
|
567
|
+
examples: {
|
|
568
|
+
details: {
|
|
569
|
+
react: i`
|
|
570
|
+
import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
|
|
571
|
+
import { Box } from "@sps-woodland/core";
|
|
572
|
+
function Component() {
|
|
573
|
+
return (
|
|
574
|
+
<InsightCardSet>
|
|
575
|
+
<InsightCard kind="general" metric="1234" title="Insight Card Title">
|
|
576
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
577
|
+
</InsightCard>
|
|
578
|
+
<InsightCard
|
|
579
|
+
kind="processing"
|
|
580
|
+
metric="1234"
|
|
581
|
+
title="Insight Card Title"
|
|
582
|
+
>
|
|
583
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
584
|
+
</InsightCard>
|
|
585
|
+
<InsightCard kind="success" metric="1234" title="Insight Card Title">
|
|
586
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
587
|
+
</InsightCard>
|
|
588
|
+
<InsightCard kind="warning" metric="1234" title="Insight Card Title">
|
|
589
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
590
|
+
</InsightCard>
|
|
591
|
+
<InsightCard kind="error" metric="1234" title="Insight Card Title">
|
|
592
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
593
|
+
</InsightCard>
|
|
594
|
+
<InsightCard kind="success" metric="1234" title="Insight Card Title">
|
|
595
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
596
|
+
</InsightCard>
|
|
597
|
+
<InsightCard kind="error" metric="1234" title="Insight Card Title">
|
|
598
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
599
|
+
</InsightCard>
|
|
600
|
+
</InsightCardSet>
|
|
601
|
+
);
|
|
602
|
+
}
|
|
603
|
+
`
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
},
|
|
607
|
+
partnerCount: {
|
|
608
|
+
label: "Partner Count",
|
|
609
|
+
examples: {
|
|
610
|
+
partnerCount: {
|
|
611
|
+
react: i`
|
|
612
|
+
import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
|
|
613
|
+
function Component() {
|
|
614
|
+
return (
|
|
615
|
+
<InsightCardSet>
|
|
616
|
+
<InsightCard
|
|
617
|
+
kind="general"
|
|
618
|
+
metric="1234"
|
|
619
|
+
title="Insight Card Title"
|
|
620
|
+
partnerCount={250}
|
|
621
|
+
totalPartners={250}
|
|
622
|
+
/>
|
|
623
|
+
<InsightCard
|
|
624
|
+
kind="processing"
|
|
625
|
+
metric="1234"
|
|
626
|
+
title="Insight Card Title"
|
|
627
|
+
partnerCount={122}
|
|
628
|
+
totalPartners={250}
|
|
629
|
+
/>
|
|
630
|
+
<InsightCard
|
|
631
|
+
kind="success"
|
|
632
|
+
metric="1234"
|
|
633
|
+
title="Insight Card Title"
|
|
634
|
+
partnerCount={207}
|
|
635
|
+
totalPartners={250}
|
|
636
|
+
/>
|
|
637
|
+
<InsightCard
|
|
638
|
+
kind="warning"
|
|
639
|
+
metric="1234"
|
|
640
|
+
title="Insight Card Title"
|
|
641
|
+
partnerCount={12}
|
|
642
|
+
totalPartners={250}
|
|
643
|
+
/>
|
|
644
|
+
<InsightCard
|
|
645
|
+
kind="error"
|
|
646
|
+
metric="1234"
|
|
647
|
+
title="Insight Card Title"
|
|
648
|
+
partnerCount={94}
|
|
649
|
+
totalPartners={250}
|
|
650
|
+
/>
|
|
651
|
+
</InsightCardSet>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
`
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
},
|
|
658
|
+
alternateIcons: {
|
|
659
|
+
label: "Using alternate icons",
|
|
660
|
+
examples: {
|
|
661
|
+
alternateIcons: {
|
|
662
|
+
react: i`
|
|
663
|
+
import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
|
|
664
|
+
function Component() {
|
|
665
|
+
return (
|
|
666
|
+
<InsightCardSet>
|
|
667
|
+
<InsightCard
|
|
668
|
+
kind="general"
|
|
669
|
+
metric="1234"
|
|
670
|
+
title="Insight Card Title"
|
|
671
|
+
icon="user"
|
|
672
|
+
/>
|
|
673
|
+
<InsightCard
|
|
674
|
+
kind="processing"
|
|
675
|
+
metric="1234"
|
|
676
|
+
title="Insight Card Title"
|
|
677
|
+
icon="asterisk"
|
|
678
|
+
/>
|
|
679
|
+
<InsightCard
|
|
680
|
+
kind="success"
|
|
681
|
+
metric="1234"
|
|
682
|
+
title="Insight Card Title"
|
|
683
|
+
icon="dollar-sign"
|
|
684
|
+
/>
|
|
685
|
+
<InsightCard
|
|
686
|
+
kind="warning"
|
|
687
|
+
metric="1234"
|
|
688
|
+
title="Insight Card Title"
|
|
689
|
+
icon="folder-open"
|
|
690
|
+
/>
|
|
691
|
+
<InsightCard
|
|
692
|
+
kind="error"
|
|
693
|
+
metric="1234"
|
|
694
|
+
title="Insight Card Title"
|
|
695
|
+
icon="ban"
|
|
696
|
+
/>
|
|
697
|
+
</InsightCardSet>
|
|
698
|
+
);
|
|
699
|
+
}
|
|
700
|
+
`
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
horizontal: {
|
|
705
|
+
label: "Horizontal",
|
|
706
|
+
examples: {
|
|
707
|
+
horizontal: {
|
|
708
|
+
react: i`
|
|
709
|
+
import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
|
|
710
|
+
function Component() {
|
|
711
|
+
return (
|
|
712
|
+
<InsightCardSet>
|
|
713
|
+
<InsightCard
|
|
714
|
+
kind="general"
|
|
715
|
+
metric="1234"
|
|
716
|
+
title="Insight Card Title"
|
|
717
|
+
partnerCount={100}
|
|
718
|
+
totalPartners={200}
|
|
719
|
+
horizontal
|
|
720
|
+
>
|
|
721
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
722
|
+
</InsightCard>
|
|
723
|
+
<InsightCard
|
|
724
|
+
kind="processing"
|
|
725
|
+
metric="1234"
|
|
726
|
+
title="Insight Card Title"
|
|
727
|
+
partnerCount={100}
|
|
728
|
+
totalPartners={200}
|
|
729
|
+
horizontal
|
|
730
|
+
/>
|
|
731
|
+
<InsightCard
|
|
732
|
+
kind="success"
|
|
733
|
+
metric="1234"
|
|
734
|
+
title="Insight Card Title"
|
|
735
|
+
partnerCount={100}
|
|
736
|
+
totalPartners={200}
|
|
737
|
+
horizontal
|
|
738
|
+
>
|
|
739
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
740
|
+
</InsightCard>
|
|
741
|
+
<InsightCard
|
|
742
|
+
kind="warning"
|
|
743
|
+
metric="1234"
|
|
744
|
+
title="Insight Card Title"
|
|
745
|
+
partnerCount={100}
|
|
746
|
+
totalPartners={200}
|
|
747
|
+
horizontal
|
|
748
|
+
/>
|
|
749
|
+
<InsightCard
|
|
750
|
+
kind="error"
|
|
751
|
+
metric="1234"
|
|
752
|
+
title="Insight Card Title"
|
|
753
|
+
partnerCount={100}
|
|
754
|
+
totalPartners={200}
|
|
755
|
+
horizontal
|
|
756
|
+
>
|
|
757
|
+
<Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
|
|
758
|
+
</InsightCard>
|
|
759
|
+
</InsightCardSet>
|
|
760
|
+
);
|
|
761
|
+
}
|
|
762
|
+
`
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
}, M = {
|
|
768
|
+
components: [k],
|
|
769
|
+
examples: {
|
|
770
|
+
basic: {
|
|
771
|
+
label: "Basic",
|
|
772
|
+
description: "Basic scrollable container",
|
|
773
|
+
examples: {
|
|
774
|
+
text: {
|
|
775
|
+
react: i`
|
|
776
|
+
import { Card, ScrollableContainer } from "@sps-woodland/cards";
|
|
777
|
+
function Component() {
|
|
778
|
+
return (
|
|
779
|
+
<Card>
|
|
780
|
+
<ScrollableContainer maxHeight="6.25rem">
|
|
781
|
+
<p>
|
|
782
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit
|
|
783
|
+
amet molestie metus. Phasellus dignissim interdum arcu. Sed in nunc id
|
|
784
|
+
sapien porta mollis eleifend nec mauris. Nulla molestie pulvinar velit
|
|
785
|
+
eget fringilla. Pellentesque habitant morbi tristique senectus et
|
|
786
|
+
netus et malesuada fames ac turpis egestas. Nam eu sem ut neque
|
|
787
|
+
condimentum tempor. Integer bibendum in velit at consectetur. Nunc ut
|
|
788
|
+
velit ac magna sodales tempor. Ut tempor rhoncus mi, eget feugiat nisi
|
|
789
|
+
finibus at. Pellentesque habitant morbi tristique senectus et netus et
|
|
790
|
+
malesuada fames ac turpis egestas. Vestibulum nunc ipsum, elementum
|
|
791
|
+
consectetur urna a, sodales pellentesque nibh. Nullam in dui dolor.
|
|
792
|
+
Vivamus sapien enim, tristique accumsan finibus nec, fringilla eget
|
|
793
|
+
tellus. Duis sed pulvinar ipsum. Donec convallis aliquet dui, nec
|
|
794
|
+
ullamcorper nulla tincidunt ac. Fusce tempus neque sit amet libero
|
|
795
|
+
vestibulum maximus. Praesent id dui sed diam scelerisque pretium id
|
|
796
|
+
vitae ante. Sed ullamcorper ligula quis mi vehicula, in interdum purus
|
|
797
|
+
suscipit. Pellentesque venenatis velit nunc, quis tincidunt ligula
|
|
798
|
+
egestas id. Praesent sollicitudin et mauris et auctor. Nullam diam
|
|
799
|
+
erat, tincidunt at odio non, tincidunt laoreet quam. In consequat
|
|
800
|
+
pulvinar sapien vel varius. Suspendisse potenti. Aenean pharetra felis
|
|
801
|
+
sit amet tempus consequat. Donec eu molestie mauris. Nunc scelerisque
|
|
802
|
+
ex id vehicula semper. Nunc eu interdum ante. Etiam in metus ante.
|
|
803
|
+
Nulla ac turpis vel sem fermentum mattis. Nam elit mi, pretium a
|
|
804
|
+
tristique vitae, vestibulum id tellus. In vitae nisl lectus. Sed
|
|
805
|
+
fringilla eget velit quis aliquet. Vestibulum euismod, leo ut egestas
|
|
806
|
+
dictum, mi quam euismod velit, nec iaculis elit mi a orci. Duis
|
|
807
|
+
volutpat purus lacus. Ut sit amet semper ipsum. Sed aliquam, quam ac
|
|
808
|
+
placerat facilisis, nulla odio vulputate erat, id condimentum sem arcu
|
|
809
|
+
vel turpis. Fusce finibus tortor ac viverra semper. Pellentesque
|
|
810
|
+
convallis mi sed metus finibus molestie. Duis vehicula dolor consequat
|
|
811
|
+
placerat sollicitudin. Phasellus sed sagittis ligula, in molestie
|
|
812
|
+
velit. In scelerisque maximus metus, ac convallis nisi dignissim non.
|
|
813
|
+
</p>
|
|
814
|
+
</ScrollableContainer>
|
|
815
|
+
</Card>
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
`
|
|
819
|
+
},
|
|
820
|
+
components: {
|
|
821
|
+
react: i`
|
|
822
|
+
import { Card, ScrollableContainer } from "@sps-woodland/cards";
|
|
823
|
+
import { SpsClickableTag } from "@spscommerce/ds-react";
|
|
824
|
+
function Component() {
|
|
825
|
+
// generate a long list we can map over to create a ton of tags
|
|
826
|
+
// in order to show a scrollable container with tags in it
|
|
827
|
+
const tagNames = (new Array(150)).fill(0).map((_, index) => \`tagName \${index}\`);
|
|
828
|
+
return (
|
|
829
|
+
<Card>
|
|
830
|
+
<ScrollableContainer maxHeight="8.5rem">
|
|
831
|
+
{tagNames.map((name) => {
|
|
832
|
+
return (
|
|
833
|
+
<SpsClickableTag key={name} className="mt-xs ml-xs">
|
|
834
|
+
{name}
|
|
835
|
+
</SpsClickableTag>
|
|
836
|
+
);
|
|
837
|
+
})}
|
|
838
|
+
</ScrollableContainer>
|
|
839
|
+
</Card>
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
`
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}, j = {
|
|
848
|
+
Cards: R,
|
|
849
|
+
"Insight Cards": U,
|
|
850
|
+
"Scrollable Container": M
|
|
851
|
+
};
|
|
852
|
+
export {
|
|
853
|
+
x as Card,
|
|
854
|
+
g as CardFooter,
|
|
855
|
+
C as CardHeader,
|
|
856
|
+
y as CardTitle,
|
|
857
|
+
v as InsightCard,
|
|
858
|
+
W as InsightCardIcons,
|
|
859
|
+
T as InsightCardSet,
|
|
860
|
+
j as MANIFEST,
|
|
861
|
+
k as ScrollableContainer
|
|
862
|
+
};
|