@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 ADDED
@@ -0,0 +1,3 @@
1
+ ## [@sps-woodland/cards](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/cards#readme)
2
+
3
+ SPS Woodland Design System card, insight card, and scrollable container components
@@ -0,0 +1,2 @@
1
+ import type { ComponentManifestEntry } from "@sps-woodland/core";
2
+ export declare const CardExamples: ComponentManifestEntry;
@@ -0,0 +1 @@
1
+ export declare const card: string;
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from "@sps-woodland/core";
2
+ import * as React from "react";
3
+ export declare function Card({ children, className, ...rest }: ComponentProps<unknown, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1 @@
1
+ export declare const cardFooter: string;
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from "@sps-woodland/core";
2
+ import * as React from "react";
3
+ export declare function CardFooter({ children, className, ...rest }: ComponentProps<unknown, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1 @@
1
+ export declare const cardHeader: string;
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from "@sps-woodland/core";
2
+ import * as React from "react";
3
+ export declare function CardHeader({ children, className, ...rest }: ComponentProps<unknown, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1 @@
1
+ export declare const cardTitle: string;
@@ -0,0 +1,3 @@
1
+ import type { ComponentProps } from "@sps-woodland/core";
2
+ import * as React from "react";
3
+ export declare function CardTitle({ children, className, ...rest }: ComponentProps<unknown, HTMLDivElement>): React.ReactElement;
@@ -0,0 +1,539 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("@sps-woodland/core"),w=require("react"),s=require("@spscommerce/utils");function B(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return n.default=t,Object.freeze(n)}const e=B(w);var q="_1gxcp3j0";function p({children:t,className:n="",...i}){return e.createElement(a.CapContent,{className:a.cl(q,n),...i},t)}a.Metadata.set(p,{name:"CardFooter"});var E="mxozo50";function g({children:t,className:n="",...i}){return e.createElement(a.CapContent,{className:a.cl(E,n),...i},t)}a.Metadata.set(g,{name:"CardHeader"});var N="jyyttb0";function C({children:t,className:n,...i}){const[r,[l],m,u]=a.selectChildren(t,[{type:g},{custom:c=>a.Metadata.isWoodlandComponent(c)&&a.Metadata.get(c).name==="Tabs"},{type:p}]),d=a.useChildTestIdAttrBuilder(i);return e.createElement("div",{className:a.cl(N,n),...i},r,l?a.addProps(l,{context:"container"}):e.createElement(a.Content,{...d("body")},u),m)}a.Metadata.set(C,{name:"Card"});var _="_1f11ubh0";function b({children:t,className:n="",...i}){return e.createElement(a.CapContentTitle,{className:a.cl(_,n),...i},t)}a.Metadata.set(b,{name:"CardTitle"});const T=Object.freeze({general:"status-new",success:"status-ok",error:"status-error",warning:"status-warning",processing:"status-in-process"});function I({children:t,className:n,horizontal:i=!1,icon:r,kind:l="general",title:m,metric:u,partnerCount:d,totalPartners:c,...y}){const{t:h}=e.useContext(a.I18nContext),o=a.useChildTestIdAttrBuilder(y),[v,S,k]=(d?h("design-system:insightTile.partnerCount",{count:d,total:c}):"").split("|");return e.createElement(e.Fragment,null,e.createElement("div",{className:a.cl("sps-insight-tile",`sps-insight-tile--${l}`,i&&"sps-insight-tile--horizontal",t&&"sps-insight-tile--has-detail",n),...y},e.createElement("div",{className:"sps-insight-tile__body",...o("body")},r?e.createElement("i",{className:`sps-icon sps-icon-${r}`,...o("icon")}):e.createElement("i",{className:`sps-icon sps-icon-${T[l]}`,...o("icon")}),u&&e.createElement("div",{className:"sps-insight-tile__metric-count",...o("metric")},u),m&&e.createElement("div",{className:"sps-insight-tile__description",...o("description")},e.createElement("div",{className:"sps-insight-tile__title",style:{"-webkit-box-orient":"vertical"},...o("title")},m),e.createElement("div",{className:"sps-insight-tile__detail",...o("detail")},t))),d&&e.createElement("div",{className:"sps-insight-tile__partner-count",...o("partner-count")},d===c?e.createElement("div",null,h("design-system:insightTile.all")):e.createElement(e.Fragment,null,e.createElement("div",null,v),e.createElement("div",null,S),e.createElement("div",null,k)),e.createElement("div",{className:"sps-insight-tile__partners-text"},h("design-system:insightTile.partners")))))}a.Metadata.set(I,{name:"InsightCard",props:{horizontal:{type:"boolean",default:"false"},icon:"IconName",kind:{type:"InsightCardKind",default:'"general"'},title:"string",metric:"number | string",partnerCount:"number",totalPartners:"number"}});function f({children:t,...n}){return e.createElement("div",{className:"insight-tile-wrapper",...n},t)}a.Metadata.set(f,{name:"InsightCardSet"});var F="_7b9vus0";function x({children:t,className:n,maxHeight:i,style:r,...l}){return e.createElement("div",{className:a.cl(F,n),style:{...r,maxHeight:i},...l},t)}a.Metadata.set(x,{name:"ScrollableContainer",props:{maxHeight:"string"}});const P={description:()=>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."),components:[C,p,g,b],examples:{general:{label:"General Usage",description:({Link:t,NavigateTo:n})=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Sizing and Layout"),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 ",e.createElement(t,{to:"/style-and-layout/grid"},"Woodland Grid")," and"," ",e.createElement(t,{to:"/style-and-layout/page-types"},"Page Layouts")," sections for more guidance on appropriate usage."),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."),e.createElement("h5",null,"Text Content"),e.createElement("p",null,"The only text content that can exist outside of a Card is the"," ",e.createElement(n,{to:"page-title"},"Page Title")," component."),e.createElement("p",null,"All other content should exist inside of a Card and should adhere to the Woodland Design System ",e.createElement(t,{to:"/style-and-layout/typography"},"Typography")," rules."),e.createElement("h5",null,"Nesting"),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)."))},basic:{label:"Basic card",description:()=>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."),examples:{basic:{react:s.code`
2
+ import { Card } from "@sps-woodland/cards";
3
+ function Component() {
4
+ return (
5
+ <Card>
6
+ <p>Business is changing... changing at the speed of information.</p>
7
+ </Card>
8
+ );
9
+ }
10
+ `},sections:{react:s.code`
11
+ import { Card } from "@sps-woodland/cards";
12
+ function Component() {
13
+ return (
14
+ <Card>
15
+ <section>
16
+ <h3>Description</h3>
17
+ <p>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
19
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
20
+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
21
+ aliquip ex ea commodo consequat. Duis aute irure dolor in
22
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
23
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
24
+ culpa qui officia deserunt mollit anim id est laborum.
25
+ </p>
26
+ </section>
27
+ <section>
28
+ <h3>Usage Guidelines</h3>
29
+ <p>
30
+ Sed ut perspiciatis unde omnis iste natus error sit voluptatem
31
+ accusantium doloremque laudantium, totam rem aperiam, eaque ipsa
32
+ quae ab illo inventore veritatis et quasi architecto beatae vitae
33
+ dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
34
+ aspernatur aut odit aut fugit, sed quia consequuntur magni dolores
35
+ eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est,
36
+ qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit,
37
+ sed quia non numquam eius modi tempora incidunt ut labore et dolore
38
+ magnam aliquam quaerat voluptatem.
39
+ </p>
40
+ </section>
41
+ </Card>
42
+ );
43
+ }
44
+ `},nestedSections:{react:s.code`
45
+ import { Card } from "@sps-woodland/cards";
46
+ function Component() {
47
+ return (
48
+ <Card>
49
+ <section>
50
+ <p>Section 1</p>
51
+ </section>
52
+ <section>
53
+ <section>
54
+ <p>Section 2</p>
55
+ </section>
56
+ <section>
57
+ <p>Section 3</p>
58
+ </section>
59
+ <section>
60
+ <p>Section 4</p>
61
+ </section>
62
+ </section>
63
+ </Card>
64
+ );
65
+ }
66
+ `}}},headers:{label:"Card + Header",description:()=>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."),examples:{title:{react:s.code`
67
+ import { SpsButton } from "@spscommerce/ds-react";
68
+ import { Card, CardHeader, CardTitle } from "@sps-woodland/cards";
69
+ import { Icon } from "@sps-woodland/core";
70
+ import { sprinkles } from "@sps-woodland/tokens";
71
+ function Component() {
72
+ return (
73
+ <Card>
74
+ <CardHeader>
75
+ <CardTitle>
76
+ <Icon icon="lightbulb" className={sprinkles({ mr: "xs" })} />
77
+ Jabberwocky
78
+ </CardTitle>
79
+ <div>
80
+ <SpsButton kind="link" className={sprinkles({ mr: "sm" })}>
81
+ Redefine
82
+ </SpsButton>
83
+ <SpsButton kind="icon" icon="printer" />
84
+ <SpsButton kind="icon" icon="download-cloud" />
85
+ <SpsButton className={sprinkles({ ml: "sm" })}>Innovate</SpsButton>
86
+ </div>
87
+ </CardHeader>
88
+ <p>
89
+ Whoever adapts first wins. In order to compete, we innovate; in order
90
+ to innovate, we redefine; and how do we redefine? With a new
91
+ definition!
92
+ </p>
93
+ </Card>
94
+ );
95
+ }
96
+ `}}},footers:{label:"Card + Footer",description:()=>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."),examples:{basicFooter:{react:s.code`
97
+ import { SpsButton } from "@spscommerce/ds-react";
98
+ import { Card, CardFooter } from "@sps-woodland/cards";
99
+ import { Box } from "@sps-woodland/core";
100
+ function Component() {
101
+ return (
102
+ <Card>
103
+ <p>
104
+ Imagine a new way to do business that's faster than a cheetah. More
105
+ powerful than... another cheetah! A way of doing business more
106
+ magnificent than... a fish! Or a whale!
107
+ </p>
108
+ <CardFooter>
109
+ <Box marginLeft="sm">
110
+ <SpsButton kind="link">Manage Settings</SpsButton>
111
+ </Box>
112
+ <Box marginX="auto">
113
+ Whales are not fish, but mammals like a cheetah.
114
+ </Box>
115
+ <SpsButton>Buy This</SpsButton>
116
+ </CardFooter>
117
+ </Card>
118
+ );
119
+ }
120
+ `}}},tabbed:{label:"Card + Tabs",description:()=>e.createElement(e.Fragment,null,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."),e.createElement("p",null,e.createElement("code",null,"<Item>")," comes from the ",e.createElement("code",null,"@react-stately/collections"),"package, which is a peer dependency of our React components.")),examples:{tabsOnly:{react:s.code`
121
+ import { Card } from "@sps-woodland/cards";
122
+ import { Box, Icon } from "@sps-woodland/core";
123
+ import { Tabs } from "@sps-woodland/tabs";
124
+ import { SpsTag } from "@spscommerce/ds-react";
125
+ import { Item } from "@react-stately/collections";
126
+ function Component() {
127
+ return (
128
+ <Card>
129
+ <Tabs>
130
+ <Item key="tab1" title="Trust">
131
+ <p>
132
+ So, what is it? What is it exactly that's going to revolutionize
133
+ the way we do business?
134
+ </p>
135
+ </Item>
136
+ <Item
137
+ key="tab2"
138
+ title={
139
+ <>
140
+ <Box mr="xs">Reliability</Box>
141
+ <SpsTag kind="key">00</SpsTag>
142
+ </>
143
+ }
144
+ >
145
+ <p>Card with tabs, pane 2.</p>
146
+ </Item>
147
+ <Item
148
+ key="tab3"
149
+ title={
150
+ <>
151
+ <Icon icon="heart"/>
152
+ <Box ml="xs">The Future</Box>
153
+ </>
154
+ }
155
+ >
156
+ <p>Card with tabs, pane 3.</p>
157
+ </Item>
158
+ <Item
159
+ key="tab4"
160
+ title={
161
+ <>
162
+ <Icon icon="heart"/>
163
+ <Box mx="xs">Bold</Box>
164
+ <SpsTag kind="key">00</SpsTag>
165
+ </>
166
+ }
167
+ >
168
+ <p>Card with tabs, pane 4.</p>
169
+ </Item>
170
+ </Tabs>
171
+ </Card>
172
+ );
173
+ }
174
+ `},activeTabInput:{react:s.code`
175
+ import { Card } from "@sps-woodland/cards";
176
+ import { Tabs } from "@sps-woodland/tabs";
177
+ import { Item } from "@react-stately/collections";
178
+ function Component() {
179
+ return (
180
+ <Card>
181
+ <Tabs disabledKeys={["tab2", "tab3"]}>
182
+ <Item key="tab1" title="Tab 1">
183
+ <p>Card with disabled tabs, pane 1.</p>
184
+ </Item>
185
+ <Item key="tab2" title="Tab 2">
186
+ <p>Card with disabled tabs, pane 2.</p>
187
+ </Item>
188
+ <Item key="tab3" title="Tab 3">
189
+ <p>Card with disabled tabs, pane 3.</p>
190
+ </Item>
191
+ </Tabs>
192
+ </Card>
193
+ );
194
+ }
195
+ `}}},everything:{label:"Card + Header + Footer + Tabs",description:()=>e.createElement("p",null,"Headers, Footers, and Tabs can be attached to Cards in any combination."),examples:{everything:{react:s.code`
196
+ import { SpsButton, SpsTag } from "@spscommerce/ds-react";
197
+ import { Card, CardHeader, CardTitle, CardFooter } from "@sps-woodland/cards";
198
+ import { Box, Icon } from "@sps-woodland/core";
199
+ import { Tabs } from "@sps-woodland/tabs";
200
+ import { sp } from "@sps-woodland/tokens";
201
+ import { Item } from "@react-stately/collections";
202
+ function Component() {
203
+ return (
204
+ <Card>
205
+ <CardHeader>
206
+ <CardTitle>
207
+ <Icon icon="status-ok" />
208
+ <Box ml="xs">Panel With Header</Box>
209
+ </CardTitle>
210
+ <div>
211
+ <SpsButton className={sp({ mr: "sm" })} kind="link">
212
+ Redefine
213
+ </SpsButton>
214
+ <SpsButton kind="icon" icon="printer" />
215
+ <SpsButton kind="icon" icon="download-cloud" />
216
+ <SpsButton className={sp({ ml: "sm" })}>Innovate</SpsButton>
217
+ </div>
218
+ </CardHeader>
219
+ <Tabs>
220
+ <Item key="tab1" title="Trust">
221
+ <p>Simple... it's Jabberwocky.</p>
222
+ <p>The game is changing right now.</p>
223
+ <p>Coming in 2012.</p>
224
+ </Item>
225
+ <Item
226
+ key="tab2"
227
+ title={
228
+ <>
229
+ <Box mr="xs">Reliability</Box>
230
+ <SpsTag kind="key">00</SpsTag>
231
+ </>
232
+ }
233
+ >
234
+ <p>Card with tabs, pane 2.</p>
235
+ </Item>
236
+ <Item
237
+ key="tab3"
238
+ title={
239
+ <>
240
+ <Icon icon="heart"/>
241
+ <Box ml="xs">The Future</Box>
242
+ </>
243
+ }
244
+ >
245
+ <p>Card with tabs, pane 3.</p>
246
+ </Item>
247
+ <Item
248
+ key="tab4"
249
+ title={
250
+ <>
251
+ <Icon icon="heart"/>
252
+ <Box mx="xs">Bold</Box>
253
+ <SpsTag kind="key">00</SpsTag>
254
+ </>
255
+ }
256
+ >
257
+ <p>Card with tabs, pane 4.</p>
258
+ </Item>
259
+ </Tabs>
260
+ <CardFooter>
261
+ <Box ml="auto">
262
+ <SpsButton className={sp({ mr: "sm" })} kind="link">
263
+ Redefine
264
+ </SpsButton>
265
+ <SpsButton kind="icon" icon="printer" />
266
+ <SpsButton kind="icon" icon="download-cloud" />
267
+ <SpsButton className={sp({ ml: "sm" })}>Innovate</SpsButton>
268
+ </Box>
269
+ </CardFooter>
270
+ </Card>
271
+ );
272
+ }
273
+ `}}}}},H={components:[I,f],examples:{basic:{label:"Basic Insight Cards",examples:{basic:{react:s.code`
274
+ import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
275
+ function Component() {
276
+ return (
277
+ <InsightCardSet>
278
+ <InsightCard
279
+ kind="general"
280
+ metric="1234"
281
+ title="Insight Card Title"
282
+ />
283
+ <InsightCard
284
+ kind="processing"
285
+ metric="1234"
286
+ title="Insight Card Title"
287
+ />
288
+ <InsightCard
289
+ kind="success"
290
+ metric="1234"
291
+ title="Insight Card Title"
292
+ />
293
+ <InsightCard
294
+ kind="warning"
295
+ metric="1234"
296
+ title="Insight Card Title"
297
+ />
298
+ <InsightCard
299
+ kind="error"
300
+ metric="1234"
301
+ title="Insight Card Title"
302
+ />
303
+ </InsightCardSet>
304
+ );
305
+ }
306
+ `}}},details:{label:"With Details",examples:{details:{react:s.code`
307
+ import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
308
+ import { Box } from "@sps-woodland/core";
309
+ function Component() {
310
+ return (
311
+ <InsightCardSet>
312
+ <InsightCard kind="general" metric="1234" title="Insight Card Title">
313
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
314
+ </InsightCard>
315
+ <InsightCard
316
+ kind="processing"
317
+ metric="1234"
318
+ title="Insight Card Title"
319
+ >
320
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
321
+ </InsightCard>
322
+ <InsightCard kind="success" metric="1234" title="Insight Card Title">
323
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
324
+ </InsightCard>
325
+ <InsightCard kind="warning" metric="1234" title="Insight Card Title">
326
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
327
+ </InsightCard>
328
+ <InsightCard kind="error" metric="1234" title="Insight Card Title">
329
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
330
+ </InsightCard>
331
+ <InsightCard kind="success" metric="1234" title="Insight Card Title">
332
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
333
+ </InsightCard>
334
+ <InsightCard kind="error" metric="1234" title="Insight Card Title">
335
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
336
+ </InsightCard>
337
+ </InsightCardSet>
338
+ );
339
+ }
340
+ `}}},partnerCount:{label:"Partner Count",examples:{partnerCount:{react:s.code`
341
+ import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
342
+ function Component() {
343
+ return (
344
+ <InsightCardSet>
345
+ <InsightCard
346
+ kind="general"
347
+ metric="1234"
348
+ title="Insight Card Title"
349
+ partnerCount={250}
350
+ totalPartners={250}
351
+ />
352
+ <InsightCard
353
+ kind="processing"
354
+ metric="1234"
355
+ title="Insight Card Title"
356
+ partnerCount={122}
357
+ totalPartners={250}
358
+ />
359
+ <InsightCard
360
+ kind="success"
361
+ metric="1234"
362
+ title="Insight Card Title"
363
+ partnerCount={207}
364
+ totalPartners={250}
365
+ />
366
+ <InsightCard
367
+ kind="warning"
368
+ metric="1234"
369
+ title="Insight Card Title"
370
+ partnerCount={12}
371
+ totalPartners={250}
372
+ />
373
+ <InsightCard
374
+ kind="error"
375
+ metric="1234"
376
+ title="Insight Card Title"
377
+ partnerCount={94}
378
+ totalPartners={250}
379
+ />
380
+ </InsightCardSet>
381
+ );
382
+ }
383
+ `}}},alternateIcons:{label:"Using alternate icons",examples:{alternateIcons:{react:s.code`
384
+ import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
385
+ function Component() {
386
+ return (
387
+ <InsightCardSet>
388
+ <InsightCard
389
+ kind="general"
390
+ metric="1234"
391
+ title="Insight Card Title"
392
+ icon="user"
393
+ />
394
+ <InsightCard
395
+ kind="processing"
396
+ metric="1234"
397
+ title="Insight Card Title"
398
+ icon="asterisk"
399
+ />
400
+ <InsightCard
401
+ kind="success"
402
+ metric="1234"
403
+ title="Insight Card Title"
404
+ icon="dollar-sign"
405
+ />
406
+ <InsightCard
407
+ kind="warning"
408
+ metric="1234"
409
+ title="Insight Card Title"
410
+ icon="folder-open"
411
+ />
412
+ <InsightCard
413
+ kind="error"
414
+ metric="1234"
415
+ title="Insight Card Title"
416
+ icon="ban"
417
+ />
418
+ </InsightCardSet>
419
+ );
420
+ }
421
+ `}}},horizontal:{label:"Horizontal",examples:{horizontal:{react:s.code`
422
+ import { InsightCard, InsightCardSet } from "@sps-woodland/cards";
423
+ function Component() {
424
+ return (
425
+ <InsightCardSet>
426
+ <InsightCard
427
+ kind="general"
428
+ metric="1234"
429
+ title="Insight Card Title"
430
+ partnerCount={100}
431
+ totalPartners={200}
432
+ horizontal
433
+ >
434
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
435
+ </InsightCard>
436
+ <InsightCard
437
+ kind="processing"
438
+ metric="1234"
439
+ title="Insight Card Title"
440
+ partnerCount={100}
441
+ totalPartners={200}
442
+ horizontal
443
+ />
444
+ <InsightCard
445
+ kind="success"
446
+ metric="1234"
447
+ title="Insight Card Title"
448
+ partnerCount={100}
449
+ totalPartners={200}
450
+ horizontal
451
+ >
452
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
453
+ </InsightCard>
454
+ <InsightCard
455
+ kind="warning"
456
+ metric="1234"
457
+ title="Insight Card Title"
458
+ partnerCount={100}
459
+ totalPartners={200}
460
+ horizontal
461
+ />
462
+ <InsightCard
463
+ kind="error"
464
+ metric="1234"
465
+ title="Insight Card Title"
466
+ partnerCount={100}
467
+ totalPartners={200}
468
+ horizontal
469
+ >
470
+ <Box inline color="grey-dark" fw="bold">Detail:</Box> 792 units
471
+ </InsightCard>
472
+ </InsightCardSet>
473
+ );
474
+ }
475
+ `}}}}},D={components:[x],examples:{basic:{label:"Basic",description:"Basic scrollable container",examples:{text:{react:s.code`
476
+ import { Card, ScrollableContainer } from "@sps-woodland/cards";
477
+ function Component() {
478
+ return (
479
+ <Card>
480
+ <ScrollableContainer maxHeight="6.25rem">
481
+ <p>
482
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris sit
483
+ amet molestie metus. Phasellus dignissim interdum arcu. Sed in nunc id
484
+ sapien porta mollis eleifend nec mauris. Nulla molestie pulvinar velit
485
+ eget fringilla. Pellentesque habitant morbi tristique senectus et
486
+ netus et malesuada fames ac turpis egestas. Nam eu sem ut neque
487
+ condimentum tempor. Integer bibendum in velit at consectetur. Nunc ut
488
+ velit ac magna sodales tempor. Ut tempor rhoncus mi, eget feugiat nisi
489
+ finibus at. Pellentesque habitant morbi tristique senectus et netus et
490
+ malesuada fames ac turpis egestas. Vestibulum nunc ipsum, elementum
491
+ consectetur urna a, sodales pellentesque nibh. Nullam in dui dolor.
492
+ Vivamus sapien enim, tristique accumsan finibus nec, fringilla eget
493
+ tellus. Duis sed pulvinar ipsum. Donec convallis aliquet dui, nec
494
+ ullamcorper nulla tincidunt ac. Fusce tempus neque sit amet libero
495
+ vestibulum maximus. Praesent id dui sed diam scelerisque pretium id
496
+ vitae ante. Sed ullamcorper ligula quis mi vehicula, in interdum purus
497
+ suscipit. Pellentesque venenatis velit nunc, quis tincidunt ligula
498
+ egestas id. Praesent sollicitudin et mauris et auctor. Nullam diam
499
+ erat, tincidunt at odio non, tincidunt laoreet quam. In consequat
500
+ pulvinar sapien vel varius. Suspendisse potenti. Aenean pharetra felis
501
+ sit amet tempus consequat. Donec eu molestie mauris. Nunc scelerisque
502
+ ex id vehicula semper. Nunc eu interdum ante. Etiam in metus ante.
503
+ Nulla ac turpis vel sem fermentum mattis. Nam elit mi, pretium a
504
+ tristique vitae, vestibulum id tellus. In vitae nisl lectus. Sed
505
+ fringilla eget velit quis aliquet. Vestibulum euismod, leo ut egestas
506
+ dictum, mi quam euismod velit, nec iaculis elit mi a orci. Duis
507
+ volutpat purus lacus. Ut sit amet semper ipsum. Sed aliquam, quam ac
508
+ placerat facilisis, nulla odio vulputate erat, id condimentum sem arcu
509
+ vel turpis. Fusce finibus tortor ac viverra semper. Pellentesque
510
+ convallis mi sed metus finibus molestie. Duis vehicula dolor consequat
511
+ placerat sollicitudin. Phasellus sed sagittis ligula, in molestie
512
+ velit. In scelerisque maximus metus, ac convallis nisi dignissim non.
513
+ </p>
514
+ </ScrollableContainer>
515
+ </Card>
516
+ );
517
+ }
518
+ `},components:{react:s.code`
519
+ import { Card, ScrollableContainer } from "@sps-woodland/cards";
520
+ import { SpsClickableTag } from "@spscommerce/ds-react";
521
+ function Component() {
522
+ // generate a long list we can map over to create a ton of tags
523
+ // in order to show a scrollable container with tags in it
524
+ const tagNames = (new Array(150)).fill(0).map((_, index) => \`tagName \${index}\`);
525
+ return (
526
+ <Card>
527
+ <ScrollableContainer maxHeight="8.5rem">
528
+ {tagNames.map((name) => {
529
+ return (
530
+ <SpsClickableTag key={name} className="mt-xs ml-xs">
531
+ {name}
532
+ </SpsClickableTag>
533
+ );
534
+ })}
535
+ </ScrollableContainer>
536
+ </Card>
537
+ );
538
+ }
539
+ `}}}}},M={Cards:P,"Insight Cards":H,"Scrollable Container":D};exports.Card=C;exports.CardFooter=p;exports.CardHeader=g;exports.CardTitle=b;exports.InsightCard=I;exports.InsightCardIcons=T;exports.InsightCardSet=f;exports.MANIFEST=M;exports.ScrollableContainer=x;
package/lib/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export * from "./card/card/Card";
2
+ export * from "./card/card-footer/CardFooter";
3
+ export * from "./card/card-header/CardHeader";
4
+ export * from "./card/card-title/CardTitle";
5
+ export * from "./insight-card/InsightCard";
6
+ export * from "./insight-card/InsightCardSet";
7
+ export * from "./scrollable-container/ScrollableContainer";
8
+ export * from "./manifest";