@madgex/design-system 1.1.0 → 1.2.1
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 +11 -4
- package/fractal.js +6 -2
- package/package.json +1 -1
- package/src/components/icon/icon.config.js +10 -33
- package/src/components/similar-jobs-item/_macro.njk +3 -0
- package/src/components/similar-jobs-item/_template.njk +18 -0
- package/src/components/similar-jobs-item/similar-jobs-item.config.js +9 -0
- package/src/components/similar-jobs-item/similar-jobs-item.njk +8 -0
- package/src/components/similar-jobs-item/similar-jobs-item.scss +5 -0
- package/src/patterns/similar-jobs/_macro.njk +3 -0
- package/src/patterns/similar-jobs/_template.njk +19 -0
- package/src/patterns/similar-jobs/similar-jobs.config.js +30 -0
- package/src/patterns/similar-jobs/similar-jobs.njk +3 -0
- package/src/patterns/similar-jobs/similar-jobs.scss +0 -0
- package/src/patterns/form/form.njk +0 -2
package/README.md
CHANGED
|
@@ -4,20 +4,27 @@ A work-in progress Design System for building a UI for Madgex products.
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
NOTE: Right now you'll need to be authenticated on npm under the Madgex account.
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
npm install @madgex/design-system --save
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
## Importing styles
|
|
12
14
|
|
|
13
|
-
You'll need to import the Madgex DS styles into your
|
|
15
|
+
You'll need to import the Madgex DS styles into your project scss file.
|
|
16
|
+
|
|
17
|
+
Use the DS tokens to change DS variables.
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
e.g. import the Madgex DS to your Sass file & overload variables:
|
|
16
20
|
|
|
17
21
|
```scss
|
|
18
|
-
|
|
22
|
+
$mds-color-primary: #ff0000; // my primary brand colour is RED
|
|
23
|
+
$mds-size-font-md: 20px; // my base font-size is 20px
|
|
24
|
+
|
|
25
|
+
@import 'node_modules/@madgex/design-system/src/scss/index.scss';
|
|
19
26
|
```
|
|
20
27
|
|
|
21
28
|
## Releases
|
|
22
29
|
|
|
23
|
-
With every commit to `master` the build server attempts to create a new version using [semantic-release](https://semantic-release.gitbook.io/semantic-release/) and deploys to
|
|
30
|
+
With every commit to `master` the build server attempts to create a new version using [semantic-release](https://semantic-release.gitbook.io/semantic-release/) and deploys to [npm](https://npmjs.org) as [@madgex/design-system](https://www.npmjs.com/package/@madgex/design-system).
|
package/fractal.js
CHANGED
|
@@ -3,7 +3,11 @@ const path = require('path');
|
|
|
3
3
|
|
|
4
4
|
const mandelbrot = require('@frctl/mandelbrot');
|
|
5
5
|
const nunjucks = require('@frctl/nunjucks')({
|
|
6
|
-
paths: [
|
|
6
|
+
paths: [
|
|
7
|
+
path.resolve(__dirname, 'src/components'),
|
|
8
|
+
path.resolve(__dirname, 'src/patterns'),
|
|
9
|
+
path.resolve(__dirname, 'src/'),
|
|
10
|
+
],
|
|
7
11
|
// pristine: true,
|
|
8
12
|
filters: {
|
|
9
13
|
// filter-name: function filterFunc(){}
|
|
@@ -35,7 +39,7 @@ fractal.components.set('ext', '.njk');
|
|
|
35
39
|
/**
|
|
36
40
|
* Files location
|
|
37
41
|
*/
|
|
38
|
-
fractal.components.set('path', path.join(__dirname, 'src
|
|
42
|
+
fractal.components.set('path', path.join(__dirname, 'src'));
|
|
39
43
|
fractal.components.set('default.collated', 'true');
|
|
40
44
|
fractal.components.set('default.preview', '@preview');
|
|
41
45
|
|
package/package.json
CHANGED
|
@@ -1,43 +1,20 @@
|
|
|
1
|
-
// module.exports = {
|
|
2
|
-
// title: 'Icons',
|
|
3
|
-
// context: {
|
|
4
|
-
// id: 'bike',
|
|
5
|
-
// },
|
|
6
|
-
// variants: [
|
|
7
|
-
// {
|
|
8
|
-
// name: 'camera',
|
|
9
|
-
// context: {
|
|
10
|
-
// id: 'camera',
|
|
11
|
-
// },
|
|
12
|
-
// },
|
|
13
|
-
// ],
|
|
14
|
-
// };
|
|
15
|
-
|
|
16
1
|
/**
|
|
17
2
|
* Icon Pattern Config
|
|
18
3
|
* Loads icons from `assets` and creates the variants
|
|
19
4
|
*/
|
|
20
5
|
|
|
21
|
-
const
|
|
22
|
-
const glob = require('glob');
|
|
23
|
-
|
|
24
|
-
const iconsGlob = './src/icons/**/*.svg'; // TODO: Load from global config
|
|
25
|
-
const variants = [];
|
|
26
|
-
|
|
27
|
-
// Collect Icon Names
|
|
28
|
-
const files = glob.sync(iconsGlob) || [];
|
|
29
|
-
files.forEach((file) => {
|
|
30
|
-
const name = path.basename(file, '.svg');
|
|
31
|
-
variants.push({
|
|
32
|
-
name,
|
|
33
|
-
context: {
|
|
34
|
-
icon: name,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
});
|
|
6
|
+
const iconList = require('../../../dist/assets/icons.json');
|
|
38
7
|
|
|
39
8
|
module.exports = {
|
|
40
9
|
title: 'Icon',
|
|
41
10
|
status: 'ready',
|
|
42
|
-
|
|
11
|
+
default: iconList[0].name,
|
|
12
|
+
variants: iconList.map((item) => {
|
|
13
|
+
return {
|
|
14
|
+
name: item.name,
|
|
15
|
+
context: {
|
|
16
|
+
icon: item.name,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}),
|
|
43
20
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="mds-similar-job{% if params.classes %} {{ params.classes }}{% endif %}">
|
|
2
|
+
<h3 class="mds-similar-job__header">
|
|
3
|
+
{%- if params.href %}
|
|
4
|
+
<a href="{{ params.href }}" class="mds-similar-job__link">
|
|
5
|
+
{{- params.title | safe -}}
|
|
6
|
+
</a>
|
|
7
|
+
{% else -%}
|
|
8
|
+
{{ params.title | safe }}
|
|
9
|
+
{%- endif -%}
|
|
10
|
+
</h3>
|
|
11
|
+
{%- if params.meta -%}
|
|
12
|
+
<ul class="mds-similar-job__meta">
|
|
13
|
+
{%- for item in params.meta -%}
|
|
14
|
+
<li class="mds-similar-job-meta__item">{{ item | safe }}</li>
|
|
15
|
+
{%- endfor -%}
|
|
16
|
+
</ul>
|
|
17
|
+
{%- endif -%}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{% from "../../components/similar-jobs-item/_macro.njk" import SimilarJobsItem %}
|
|
2
|
+
{%- if params.items -%}
|
|
3
|
+
<div class="mds-similar-jobs">
|
|
4
|
+
{%- if params.title -%}
|
|
5
|
+
<h2 class="mds-similar-jobs__header">{{params.title}}</h2>
|
|
6
|
+
{%- endif -%}
|
|
7
|
+
{%- if params.items -%}
|
|
8
|
+
<ul class="mds-similar-jobs__content">
|
|
9
|
+
{%- for item in params.items -%}
|
|
10
|
+
{%- if item.title -%}
|
|
11
|
+
<li class="mds-similar-jobs-content__item">
|
|
12
|
+
{{ SimilarJobsItem({title: item.title, href: item.href, classes: item.classes, meta: item.meta}) }}
|
|
13
|
+
</li>
|
|
14
|
+
{%- endif -%}
|
|
15
|
+
{%- endfor -%}
|
|
16
|
+
</ul>
|
|
17
|
+
{%- endif -%}
|
|
18
|
+
</div>
|
|
19
|
+
{%- endif -%}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: 'SimilarJobs',
|
|
3
|
+
context: {
|
|
4
|
+
title: 'Similar Jobs',
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
title: 'Marketing Manager',
|
|
8
|
+
href: '/job/marketing-manager',
|
|
9
|
+
classes: 'mds-similar-job--premium-job',
|
|
10
|
+
meta: ['London City', 'Market Rate', 'Apple Inc'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
title: 'Head of Marketing',
|
|
14
|
+
href: '/job/head-of-marketing',
|
|
15
|
+
classes: 'mds-similar-job--promoted-job',
|
|
16
|
+
meta: ['London (Hackney)', 'Marketers Ltd'],
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
title: 'Marketing Advisor',
|
|
20
|
+
href: '/job/marketing-advisor',
|
|
21
|
+
classes: 'mds-similar-job--premium-job',
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
title: 'Marketing Researcher',
|
|
25
|
+
classes: '',
|
|
26
|
+
meta: ['London (Central)', '100K+'],
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
File without changes
|