@internetstiftelsen/styleguide 2.23.9 → 2.24.0-beta.0.2

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
@@ -33,14 +33,6 @@ $namespace: 'mysite-';
33
33
  @import '~@internetstiftelsen/styleguide/src/organisms/header/header';
34
34
  ```
35
35
 
36
- ### SCSS Mixins explained:
37
- ```scss
38
- @include e(nested-element) {} // Element (.parent-element__nested-element)
39
- @include m(modifier-name) {} // Modifier (.parent-element--modifier-name)
40
- @include b(block-name) {} // Block (.block-name)
41
-
42
- ```
43
-
44
36
  Peek into the [app.scss](https://github.com/sewebb/iis-styleguide/blob/master/src/app.scss) to see the full set of components.
45
37
 
46
38
  For javascript it's basically the same thing. In a javascript file:
@@ -51,6 +43,26 @@ import Button from '@internetstiftelsen/styleguide/dist/atoms/button/button';
51
43
 
52
44
  // Standard ES6 version
53
45
  import Button from '@internetstiftelsen/styleguide/src/atoms/button/button';
46
+
47
+ // Globals and Configuration/Base components are imported by default from the Styleguide Core
48
+
49
+ // Atoms
50
+ import '@internetstiftelsen/styleguide/src/atoms/button/button';
51
+ import '@internetstiftelsen/styleguide/src/atoms/input/input';
52
+
53
+ // Molecules
54
+ import '@internetstiftelsen/styleguide/src/molecules/card/card';
55
+
56
+ // Organisms
57
+ import '~@internetstiftelsen/styleguide/src/organisms/header/header';
58
+ ```
59
+
60
+ ### SCSS Mixins explained:
61
+ ```scss
62
+ @include e(nested-element) {} // Element (.parent-element__nested-element)
63
+ @include m(modifier-name) {} // Modifier (.parent-element--modifier-name)
64
+ @include b(block-name) {} // Block (.block-name)
65
+
54
66
  ```
55
67
 
56
68
  Depending on your browser requirements you may use the src version which is not transpiled to ES5.
@@ -1,13 +1,15 @@
1
1
  'use strict';
2
2
 
3
+ require('./molecules/form');
4
+
5
+ require('./atoms/textarea/rich-text');
6
+
3
7
  require('./atoms/password-toggle/password-toggle');
4
8
 
5
9
  require('./utilities/tab-highlighting/tab-highlighting');
6
10
 
7
11
  require('./molecules/system-error/system-error');
8
12
 
9
- require('a11y-toggle');
10
-
11
13
  require('./molecules/cookie-disclaimer/cookie-disclaimer');
12
14
 
13
15
  require('./organisms/accordion/accordion');
@@ -26,12 +28,8 @@ require('./atoms/tooltip/tooltip');
26
28
 
27
29
  require('./atoms/toggle-high-contrast/toggle-high-contrast');
28
30
 
29
- require('./focusTrap');
30
-
31
31
  require('./atoms/height-limiter/height-limiter');
32
32
 
33
- require('./assets/js/conditional');
34
-
35
33
  require('./atoms/file/file');
36
34
 
37
35
  require('./atoms/file/filePreview');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.23.9",
3
+ "version": "2.24.0-beta.0.2",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -19,6 +19,7 @@
19
19
  "imagemin": "imagemin --out-dir=public/assets/img src/**/*.{png,jpg,gif}",
20
20
  "build:css": "npm run stylelint && npm run scss && npm run cssmin",
21
21
  "build:js": "npm run eslint && npm run babel && npm run browserify",
22
+ "build:js:replace:string": "replace \"require('./components');\" \"//require('./components');\" src/ -r --include=\"app.js\"",
22
23
  "build:img": "npm run imagemin",
23
24
  "watch:css": "onchange 'src/**/*.scss' -- npm run build:css",
24
25
  "watch:js": "onchange 'src/**/*.js' -- npm run build:js",
@@ -34,7 +35,7 @@
34
35
  "copy:zip:build": "copyfiles -f src/assets/zip/* build/assets/zip",
35
36
  "copy:fonts:build": "copyfiles -f src/base/fonts/* build/assets/fonts",
36
37
  "copy:build": "npm run copy:images:build && npm run copy:zip:build && npm run copy:fonts:build && npm run copy:videos:build",
37
- "build": "npm run build:css && npm run build:js && npm run uglify && npm run build:fractal && npm run copy:build",
38
+ "build": "npm run build:css && npm run build:js:replace:string && npm run build:js && npm run uglify && npm run package-js && npm run build:fractal && npm run copy:build && npm run create-icons-config",
38
39
  "dev": "concurrently \"npm:start:fractal\" \"npm:watch\" \"npm:copy:local-assets\"",
39
40
  "package-js": "NODE_ENV=production babel src --out-dir dist --ignore src/**/*.config.js,src/app.js",
40
41
  "create-icons-config": "node ./createIconsJson"
@@ -63,6 +64,7 @@
63
64
  "onchange": "^6.1.0",
64
65
  "postcss-class-prefix": "^0.3.0",
65
66
  "postcss-cli": "^8.3.1",
67
+ "replace": "^1.2.1",
66
68
  "sass": "^1.35.1",
67
69
  "stylelint": "^13.13.1",
68
70
  "uglify-es": "^3.3.9"
package/src/app.js CHANGED
@@ -1,5 +1,6 @@
1
- import './molecules/form';
2
- import './atoms/textarea/rich-text';
1
+ import 'a11y-toggle';
2
+ import './focusTrap';
3
+ import './assets/js/conditional';
3
4
 
4
5
  require('./atoms/grid-toggle/grid-toggle');
5
6
  require('./components');
@@ -6,7 +6,8 @@
6
6
 
7
7
  @extend %tag;
8
8
 
9
- display: inline-block;
9
+ display: inline-flex;
10
+ align-items: center;
10
11
  position: relative;
11
12
  z-index: z_index(middleground);
12
13
  margin-right: rhythm(1);
@@ -22,7 +23,42 @@
22
23
  @include color_values($colors, 'border-color', $separator: '-');
23
24
  }
24
25
 
26
+ @include e(text) {
27
+ color: $color-cyberspace;
28
+ }
29
+
25
30
  @include m(light) {
26
31
  @extend %tag-light;
32
+
33
+ @include e(text) {
34
+ color: $color-snow;
35
+ }
36
+ }
37
+
38
+ > svg {
39
+ width: $icon-size-small;
40
+ height: $icon-size-small;
41
+ }
42
+
43
+ @include m(hover-light) {
44
+ &:hover,
45
+ &:focus {
46
+ background-color: currentColor !important;
47
+
48
+ [class*=text] {
49
+ color: $color-snow;
50
+ }
51
+ }
52
+ }
53
+
54
+ @include m(hover-dark) {
55
+ &:hover,
56
+ &:focus {
57
+ background-color: currentColor !important;
58
+
59
+ [class*=text] {
60
+ color: $color-cyberspace;
61
+ }
62
+ }
27
63
  }
28
64
  }
@@ -15,22 +15,60 @@ module.exports = {
15
15
  }
16
16
  },
17
17
  {
18
- name: 'Background',
18
+ name: 'Background variation',
19
19
  context: {
20
20
  text: 'background',
21
21
  href: '#',
22
22
  is_light: false,
23
- background_color: 'jade'
23
+ border: true,
24
+ border_color: 'ocean',
25
+ background_color: 'ocean',
26
+ hover_color: 'light',
27
+ color: 'ocean'
24
28
  }
25
29
  },
26
30
  {
27
- name: 'Combined',
31
+ name: 'Border variation',
28
32
  context: {
29
- text: 'combined',
33
+ text: 'border',
30
34
  href: '#',
31
- is_light: true,
32
- background_color: 'ruby'
35
+ is_light: false,
36
+ border: true,
37
+ border_color: 'sandstone',
38
+ background_color: 'sandstone-light',
39
+ hover_color: 'light',
40
+ color: 'sandstone'
41
+ }
42
+ },
43
+ {
44
+ name: 'With right icon',
45
+ context: {
46
+ text: 'with right icon',
47
+ href: '#',
48
+ icon: 'pin',
49
+ icon_align_right: true,
50
+ is_light: false,
51
+ border: true,
52
+ border_color: 'lemon',
53
+ background_color: 'lemon-light',
54
+ hover_color: 'dark',
55
+ color: 'lemon'
56
+ }
57
+ },
58
+ {
59
+ name: 'With left icon',
60
+ context: {
61
+ text: 'with left icon',
62
+ href: '#',
63
+ icon: 'pin',
64
+ icon_align_left: true,
65
+ is_light: false,
66
+ border: true,
67
+ border_color: 'jade',
68
+ background_color: 'jade-light',
69
+ hover_color: 'dark',
70
+ color: 'jade'
33
71
  }
34
72
  }
35
73
  ]
36
- }
74
+ }
package/src/components.js CHANGED
@@ -1,7 +1,8 @@
1
+ import './molecules/form';
2
+ import './atoms/textarea/rich-text';
1
3
  import './atoms/password-toggle/password-toggle';
2
4
  import './utilities/tab-highlighting/tab-highlighting';
3
5
  import './molecules/system-error/system-error';
4
- import 'a11y-toggle';
5
6
  import './molecules/cookie-disclaimer/cookie-disclaimer';
6
7
  import './organisms/accordion/accordion';
7
8
  import './organisms/tabs/tabs';
@@ -11,9 +12,7 @@ import './molecules/share/share';
11
12
  import './molecules/natural-language-form/natural-language-form';
12
13
  import './atoms/tooltip/tooltip';
13
14
  import './atoms/toggle-high-contrast/toggle-high-contrast';
14
- import './focusTrap';
15
15
  import './atoms/height-limiter/height-limiter';
16
- import './assets/js/conditional';
17
16
  import './atoms/file/file';
18
17
  import './atoms/file/filePreview';
19
18
  import './organisms/podcast/podcast';
@@ -75,6 +75,10 @@
75
75
  border-radius: rem(17.5px);
76
76
  background-color: $color-granit;
77
77
  color: $color-snow;
78
+
79
+ [class*=text] {
80
+ color: $color-snow;
81
+ }
78
82
  }
79
83
  }
80
84
 
@@ -86,5 +90,9 @@
86
90
  &:focus {
87
91
  border: 1px solid transparent;
88
92
  background-color: rgba($color-snow, 0.5);
93
+
94
+ [class*=text] {
95
+ color: $color-cyberspace;
96
+ }
89
97
  }
90
98
  }