File tree Expand file tree Collapse file tree 9 files changed +95
-4
lines changed Expand file tree Collapse file tree 9 files changed +95
-4
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ module.exports = function({ config }) {
16
16
'sass-loader'
17
17
] ,
18
18
include : path . resolve ( __dirname , '../' )
19
+ } ,
20
+ {
21
+ test : / \\ .( p n g | j p ( e * ) g | s v g | g i f ) $ / ,
22
+ use : [ 'file-loader' ] ,
19
23
} ) ;
20
24
21
25
return config ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @user-interviews/ui-design-system" ,
3
- "version" : " 2.4.3 " ,
3
+ "version" : " 2.4.4 " ,
4
4
"dependencies" : {
5
5
"@tiptap/core" : " ^2.0.3" ,
6
6
"@tiptap/extension-bold" : " ^2.0.3" ,
135
135
"eslint-plugin-react" : " ^7.18.3" ,
136
136
"eslint-plugin-react-hooks" : " ^2.5.1" ,
137
137
"eslint-utils" : " ^1.4.3" ,
138
+ "file-loader" : " ^6.2.0" ,
138
139
"jest" : " ^27.4.6" ,
139
140
"jest-css-modules-transform" : " ^4.3.0" ,
140
141
"node-sass" : " ^8.0.0" ,
Original file line number Diff line number Diff line change @@ -6760,6 +6760,60 @@ exports[`Storyshots Components/EmptyState Full Width 1`] = `
6760
6760
</div>
6761
6761
`;
6762
6762
6763
+ exports[`Storyshots Components/EmptyState Image 1`] = `
6764
+ <div
6765
+ className="EmptyState EmptyState--margin-top--sm"
6766
+ >
6767
+ <div
6768
+ className="EmptyState__content"
6769
+ >
6770
+ <div
6771
+ className="EmptyState__image"
6772
+ >
6773
+ <img
6774
+ alt=""
6775
+ src={Object {}}
6776
+ />
6777
+ </div>
6778
+ <h4
6779
+ className="EmptyState__title Heading Heading--lg Heading--bold"
6780
+ style={
6781
+ Object {
6782
+ "textAlign": "center",
6783
+ }
6784
+ }
6785
+ >
6786
+ No participants to display
6787
+ </h4>
6788
+ <p
6789
+ className="EmptyState__subtitle Text Text--md Text--regular"
6790
+ style={
6791
+ Object {
6792
+ "textAlign": "center",
6793
+ }
6794
+ }
6795
+ >
6796
+ Start recruiting from User Interviews' panel of 6M+ users and kick off your research!
6797
+ </p>
6798
+ <div
6799
+ className="EmptyState__actions"
6800
+ >
6801
+ <div
6802
+ className="EmptyState__actions__primary-action"
6803
+ >
6804
+ <button
6805
+ className="Button btn btn-primary"
6806
+ disabled={false}
6807
+ type="button"
6808
+ >
6809
+ Start recruiting
6810
+ </button>
6811
+ </div>
6812
+ </div>
6813
+ </div>
6814
+ </div>
6815
+ `;
6816
+
6763
6817
exports[`Storyshots Components/EmptyState Margin Top 1`] = `
6764
6818
<div
6765
6819
className="EmptyState EmptyState--margin-top--sm"
Original file line number Diff line number Diff line change 1
1
@import ' ../../scss/theme' ;
2
2
3
3
$empty-state-max-width : 400px ;
4
- $empty-state-max-image-height : 160px ;
5
4
6
5
$empty-state-margin-top-sm : 64px ;
7
6
$empty-state-margin-top-md : 96px ;
@@ -10,6 +9,8 @@ $empty-state-margin-top-lg: 200px;
10
9
$empty-state-title-margin-bottom : $synth-spacing-4 ;
11
10
$empty-state-subtitle-margin-bottom : $synth-spacing-4 ;
12
11
12
+ $empty-state-image-max-height : 150px ;
13
+
13
14
.EmptyState {
14
15
display : flex ;
15
16
flex-direction : row ;
@@ -41,8 +42,12 @@ $empty-state-subtitle-margin-bottom: $synth-spacing-4;
41
42
display : flex ;
42
43
justify-content : center ;
43
44
44
- margin-bottom : $synth-spacing-4 ;
45
- max-height : $empty-state-max-image-height ;
45
+ margin-bottom : $synth-spacing-8 ;
46
+
47
+ img {
48
+ max-height : $empty-state-image-max-height ;
49
+ width : auto ;
50
+ }
46
51
}
47
52
48
53
& __title {
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import { faPlus } from '@fortawesome/pro-regular-svg-icons';
5
5
6
6
import Button from 'src/Button' ;
7
7
8
+ import ProfileSearchImage from './profile_search.png' ;
9
+
8
10
import EmptyState from './EmptyState' ;
9
11
10
12
const meta : Meta < typeof EmptyState > = {
@@ -30,6 +32,15 @@ export const PrimaryAction: Story = {
30
32
} ,
31
33
} ;
32
34
35
+ export const Image : Story = {
36
+ args : {
37
+ image : ProfileSearchImage ,
38
+ primaryAction : < Button variant = "primary" > Start recruiting</ Button > ,
39
+ subtitle : `Start recruiting from User Interviews' panel of 6M+ users and kick off your research!` ,
40
+ title : 'No participants to display' ,
41
+ } ,
42
+ } ;
43
+
33
44
export const FullWidth : Story = {
34
45
args : {
35
46
fullWidth : true ,
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import './EmptyState.scss';
10
10
export interface EmptyStateProps {
11
11
className ?: string ;
12
12
fullWidth ?: boolean ;
13
+ image ?: string ;
13
14
marginTop ?: 'sm' | 'md' | 'lg' | 'none' ;
14
15
primaryAction ?: ReactNode ;
15
16
subtitle ?: string | ReactNode ;
@@ -19,6 +20,7 @@ export interface EmptyStateProps {
19
20
const EmptyState = ( {
20
21
className,
21
22
fullWidth = false ,
23
+ image,
22
24
marginTop = 'sm' ,
23
25
primaryAction,
24
26
subtitle,
@@ -35,6 +37,11 @@ const EmptyState = ({
35
37
fullWidth && 'EmptyState--full-width' ,
36
38
) }
37
39
>
40
+ { image && (
41
+ < div className = "EmptyState__image" >
42
+ < img alt = "" src = { image } />
43
+ </ div >
44
+ ) }
38
45
{ title && (
39
46
< Heading
40
47
className = "EmptyState__title"
Original file line number Diff line number Diff line change 1
1
declare module '*.module.scss' ;
2
+ declare module '*.png' ;
Original file line number Diff line number Diff line change @@ -6791,6 +6791,14 @@ file-entry-cache@^6.0.1:
6791
6791
dependencies:
6792
6792
flat-cache "^3.0.4"
6793
6793
6794
+ file-loader@^6.2.0:
6795
+ version "6.2.0"
6796
+ resolved "https://registry.yarnpkg.com/file-loader/-/file-loader-6.2.0.tgz#baef7cf8e1840df325e4390b4484879480eebe4d"
6797
+ integrity sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==
6798
+ dependencies:
6799
+ loader-utils "^2.0.0"
6800
+ schema-utils "^3.0.0"
6801
+
6794
6802
6795
6803
version "2.3.0"
6796
6804
resolved "https://registry.yarnpkg.com/file-system-cache/-/file-system-cache-2.3.0.tgz#201feaf4c8cd97b9d0d608e96861bb6005f46fe6"
You can’t perform that action at this time.
0 commit comments