Skip to content

Commit 9200396

Browse files
Merge release/1.29.0 into main branch (#569)
* add CardList to DS (#567) Adds a CardList layout component to wrap around existing design system Cards. * update Pill color and border (#568) Updates Pills colors, removes Pill border, and introduces a Pills layout component to wrap around a collection of Pill components. * Prepare release 1.29.0 Co-authored-by: Jason Basuil <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent ec827b1 commit 9200396

File tree

16 files changed

+507
-16
lines changed

16 files changed

+507
-16
lines changed

cypress/integration/pill_spec.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ const pills = [
33
name: 'Default',
44
path: 'components-pill--default',
55
},
6+
{
7+
name: 'With Container',
8+
path: 'components-pill--with-container',
9+
},
610
{
711
name: 'With Leading Icon',
812
path: 'components-pill--with-leading-icon',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@user-interviews/ui-design-system",
3-
"version": "1.28.0",
3+
"version": "1.29.0",
44
"dependencies": {
55
"react-bootstrap": "^2.0.2",
66
"react-router-dom": "^5.2.0",

spec/__snapshots__/Storyshots.test.js.snap

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2739,6 +2739,108 @@ exports[`Storyshots Components/Card Default 1`] = `
27392739
</div>
27402740
`;
27412741

2742+
exports[`Storyshots Components/CardList Default 1`] = `
2743+
<div
2744+
style={
2745+
Object {
2746+
"padding": "1rem",
2747+
}
2748+
}
2749+
>
2750+
<div
2751+
className="CardList CardList__alignItems--center"
2752+
>
2753+
<section
2754+
className="Card Card--sm"
2755+
>
2756+
<div
2757+
className="Card__header"
2758+
>
2759+
<h2
2760+
className="Card__title"
2761+
>
2762+
Card 1
2763+
</h2>
2764+
</div>
2765+
<h3
2766+
className="Card__subtitle"
2767+
>
2768+
The fastest way to recruit research participants. Source from a pool of more than 850,000 participants to reach nearly any target audience.
2769+
</h3>
2770+
<ul>
2771+
<li>
2772+
500,000+ sessions completed
2773+
</li>
2774+
<li>
2775+
$19 million+ incentives distributed
2776+
</li>
2777+
<li>
2778+
3 hours median time to 1st matched participant
2779+
</li>
2780+
</ul>
2781+
</section>
2782+
<section
2783+
className="Card Card--sm"
2784+
>
2785+
<div
2786+
className="Card__header"
2787+
>
2788+
<h2
2789+
className="Card__title"
2790+
>
2791+
Card 2
2792+
</h2>
2793+
</div>
2794+
<h3
2795+
className="Card__subtitle"
2796+
>
2797+
The fastest way to recruit research participants. Source from a pool of more than 850,000 participants to reach nearly any target audience.
2798+
</h3>
2799+
<ul>
2800+
<li>
2801+
500,000+ sessions completed
2802+
</li>
2803+
<li>
2804+
$19 million+ incentives distributed
2805+
</li>
2806+
<li>
2807+
3 hours median time to 1st matched participant
2808+
</li>
2809+
</ul>
2810+
</section>
2811+
<section
2812+
className="Card Card--sm"
2813+
>
2814+
<div
2815+
className="Card__header"
2816+
>
2817+
<h2
2818+
className="Card__title"
2819+
>
2820+
Card 3
2821+
</h2>
2822+
</div>
2823+
<h3
2824+
className="Card__subtitle"
2825+
>
2826+
The fastest way to recruit research participants. Source from a pool of more than 850,000 participants to reach nearly any target audience.
2827+
</h3>
2828+
<ul>
2829+
<li>
2830+
500,000+ sessions completed
2831+
</li>
2832+
<li>
2833+
$19 million+ incentives distributed
2834+
</li>
2835+
<li>
2836+
3 hours median time to 1st matched participant
2837+
</li>
2838+
</ul>
2839+
</section>
2840+
</div>
2841+
</div>
2842+
`;
2843+
27422844
exports[`Storyshots Components/CheckboxButton Default 1`] = `
27432845
<div
27442846
style={
@@ -6101,7 +6203,7 @@ exports[`Storyshots Components/Pill With Close 1`] = `
61016203
}
61026204
>
61036205
<span
6104-
className="Pill Pill--blue"
6206+
className="Pill Pill--blue Pill--closeable"
61056207
>
61066208
Text
61076209
<button
@@ -6131,6 +6233,109 @@ exports[`Storyshots Components/Pill With Close 1`] = `
61316233
</div>
61326234
`;
61336235

6236+
exports[`Storyshots Components/Pill With Container 1`] = `
6237+
<div
6238+
style={
6239+
Object {
6240+
"padding": "1rem",
6241+
}
6242+
}
6243+
>
6244+
<div
6245+
className="Pills"
6246+
>
6247+
<span
6248+
className="Pill Pill--gray"
6249+
>
6250+
<svg
6251+
aria-hidden="true"
6252+
className="svg-inline--fa fa-microphone fa-w-11 Pill__icon--lead"
6253+
data-icon="microphone"
6254+
data-prefix="fas"
6255+
focusable="false"
6256+
role="img"
6257+
style={Object {}}
6258+
viewBox="0 0 352 512"
6259+
xmlns="http://www.w3.org/2000/svg"
6260+
>
6261+
<path
6262+
d="M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"
6263+
fill="currentColor"
6264+
style={Object {}}
6265+
/>
6266+
</svg>
6267+
1-on-1 Interview
6268+
</span>
6269+
<span
6270+
className="Pill Pill--gray"
6271+
>
6272+
<svg
6273+
aria-hidden="true"
6274+
className="svg-inline--fa fa-globe fa-w-16 Pill__icon--lead"
6275+
data-icon="globe"
6276+
data-prefix="fas"
6277+
focusable="false"
6278+
role="img"
6279+
style={Object {}}
6280+
viewBox="0 0 496 512"
6281+
xmlns="http://www.w3.org/2000/svg"
6282+
>
6283+
<path
6284+
d="M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z"
6285+
fill="currentColor"
6286+
style={Object {}}
6287+
/>
6288+
</svg>
6289+
Online
6290+
</span>
6291+
<span
6292+
className="Pill Pill--gray"
6293+
>
6294+
<svg
6295+
aria-hidden="true"
6296+
className="svg-inline--fa fa-gift-card fa-w-18 Pill__icon--lead"
6297+
data-icon="gift-card"
6298+
data-prefix="fas"
6299+
focusable="false"
6300+
role="img"
6301+
style={Object {}}
6302+
viewBox="0 0 576 512"
6303+
xmlns="http://www.w3.org/2000/svg"
6304+
>
6305+
<path
6306+
d="M528 128h-58.07c6.22-12.06 10.07-25.52 10.07-40 0-48.52-39.48-88-88-88-41.6 0-68.51 21.34-103.04 68.33C254.44 21.33 227.53 0 185.93 0c-48.52 0-88 39.48-88 88 0 14.48 3.85 27.94 10.07 40H48c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h480c26.51 0 48-21.49 48-48V176c0-26.51-21.49-48-48-48zM392 48c22.06 0 40 17.94 40 40 0 22.05-17.94 40-40 40h-86.07c51.36-76.47 65.72-80 86.07-80zM145.93 88c0-22.06 17.94-40 40-40 19.94 0 34.58 3.27 86.07 80h-86.07c-22.06 0-40-17.95-40-40zm60.13 104l-35.72 35.72c-6.25 6.25-6.25 16.38 0 22.63l11.31 11.31c6.25 6.25 16.38 6.25 22.63 0L273.94 192h28.13l69.65 69.65c6.25 6.25 16.38 6.25 22.63 0l11.31-11.31c6.25-6.25 6.25-16.38 0-22.63L369.94 192H512v128H64V192h142.06zM64 448v-64h448v64H64z"
6307+
fill="currentColor"
6308+
style={Object {}}
6309+
/>
6310+
</svg>
6311+
$120 choice of dozens of digital gift cards
6312+
</span>
6313+
<span
6314+
className="Pill Pill--gray"
6315+
>
6316+
<svg
6317+
aria-hidden="true"
6318+
className="svg-inline--fa fa-clock fa-w-16 Pill__icon--lead"
6319+
data-icon="clock"
6320+
data-prefix="fas"
6321+
focusable="false"
6322+
role="img"
6323+
style={Object {}}
6324+
viewBox="0 0 512 512"
6325+
xmlns="http://www.w3.org/2000/svg"
6326+
>
6327+
<path
6328+
d="M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"
6329+
fill="currentColor"
6330+
style={Object {}}
6331+
/>
6332+
</svg>
6333+
1 hour
6334+
</span>
6335+
</div>
6336+
</div>
6337+
`;
6338+
61346339
exports[`Storyshots Components/Pill With Leading Icon 1`] = `
61356340
<div
61366341
style={

src/CardList/CardList.jsx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from 'react';
2+
import classNames from 'classnames';
3+
import PropTypes from 'prop-types';
4+
5+
import './CardList.scss';
6+
7+
export const CardListAlignItemsOptions = ['center', 'flex-start', 'flex-end'];
8+
9+
const CardList = ({
10+
alignItems,
11+
className,
12+
children,
13+
...props
14+
}) => (
15+
<div
16+
className={classNames(
17+
'CardList',
18+
className,
19+
{
20+
[`CardList__alignItems--${alignItems}`]: !!alignItems,
21+
},
22+
)}
23+
{...props}
24+
>
25+
{children}
26+
</div>
27+
);
28+
29+
CardList.propTypes = {
30+
alignItems: PropTypes.oneOf(CardListAlignItemsOptions),
31+
className: PropTypes.string,
32+
};
33+
34+
CardList.defaultProps = {
35+
alignItems: 'center',
36+
className: undefined,
37+
};
38+
39+
export default CardList;

src/CardList/CardList.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { ArgsTable, Story, Canvas } from '@storybook/addon-docs/blocks';
2+
import CardList from './CardList';
3+
4+
# CardList
5+
6+
##
7+
8+
<h4>
9+
A simple layout container for positioning Cards.
10+
</h4>
11+
12+
<Canvas>
13+
<Story id="components-cardlist--default" />
14+
</Canvas>
15+
16+
### When to use
17+
- Use `CardList` to wrap one or more `Card` components.
18+
- `CardList` centers `Card` components by default and should handle the most common page layouts that use `Card`.
19+
20+
## Props
21+
22+
<ArgsTable of={CardList} />
23+
24+
## Stories
25+
26+
### Default
27+
28+
<Canvas>
29+
<Story id="components-cardlist--default" />
30+
</Canvas>
31+
32+
## Formatting
33+
34+
### Alignment
35+
- `Card`s within `CardList` are centered by default

src/CardList/CardList.scss

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@import '../../scss/theme';
2+
3+
$card-list-spacing: 1.5rem;
4+
$card-list-child-card-spacing: 0.75rem;
5+
6+
.CardList {
7+
display: flex;
8+
flex-direction: column;
9+
10+
margin: $card-list-spacing 0;
11+
12+
.Card {
13+
margin: $card-list-child-card-spacing;
14+
}
15+
16+
&__alignItems {
17+
&--center {
18+
align-items: center;
19+
}
20+
21+
&--flex-start {
22+
align-items: flex-start;
23+
}
24+
25+
&--flex-end {
26+
align-items: flex-end;
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)