@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 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 main Sass file.
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
- To import add the below to your Sass file:
19
+ e.g. import the Madgex DS to your Sass file & overload variables:
16
20
 
17
21
  ```scss
18
- @import 'node_modules/@madgex/design-system/public/css/index.css';
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 `NPM`.
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: [path.resolve(__dirname, 'src/components'), path.resolve(__dirname, 'src/')],
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/components'));
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgex/design-system",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "scripts": {
5
5
  "clean": "rimraf dist public tokens/build",
6
6
  "commit": "commit",
@@ -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 path = require('path');
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
- variants,
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,3 @@
1
+ {% macro SimilarJobsItem(params) %}
2
+ {%- include "./_template.njk" -%}
3
+ {% endmacro %}
@@ -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,9 @@
1
+ module.exports = {
2
+ title: 'SimilarJobsItem',
3
+ context: {
4
+ title: 'Science Teacher',
5
+ href: '/job/science-teacher',
6
+ classes: 'mds-similar-job--premium-job',
7
+ meta: ['London City', 'Science Recruiter'],
8
+ },
9
+ };
@@ -0,0 +1,8 @@
1
+ {% from "./similar-jobs-item/_macro.njk" import SimilarJobsItem %}
2
+
3
+ {{ SimilarJobsItem({
4
+ title: title,
5
+ href: href,
6
+ classes: classes,
7
+ meta: meta
8
+ }) }}
@@ -0,0 +1,5 @@
1
+ .mds-similar-job {
2
+ &--premium-job {
3
+ background-color: #eee;
4
+ }
5
+ }
@@ -0,0 +1,3 @@
1
+ {% macro SimilarJobs(params) %}
2
+ {%- include "./_template.njk" -%}
3
+ {% endmacro %}
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ {% from "./similar-jobs/_macro.njk" import SimilarJobs %}
2
+
3
+ {{ SimilarJobs({title: title, items: items}) }}
File without changes
@@ -1,2 +0,0 @@
1
- <p>forms</p>
2
- {% render '@example' %}