@ilo-org/twig 0.2.12 → 0.2.14

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.
Files changed (172) hide show
  1. package/.eslintrc.js +37 -49
  2. package/.stylelintrc +2 -6
  3. package/.turbo/turbo-build:lib.log +4 -3
  4. package/CHANGELOG.md +19 -0
  5. package/apps/storybook/assets.js +5 -0
  6. package/apps/storybook/config/prefix.yml +1 -0
  7. package/apps/storybook/main.js +18 -8
  8. package/apps/storybook/manager-head.html +63 -1
  9. package/apps/storybook/manager.js +2 -2
  10. package/apps/storybook/patterns/colors.stories.mdx +9 -4
  11. package/apps/storybook/patterns/intro.stories.mdx +47 -42
  12. package/apps/storybook/patterns/typeset.stories.mdx +10 -6
  13. package/apps/storybook/patterns/welcome.stories.mdx +21 -37
  14. package/apps/storybook/preview-body.html +1 -1
  15. package/apps/storybook/preview.js +16 -16
  16. package/apps/storybook/styles.scss +25 -1
  17. package/apps/storybook/theme.js +41 -6
  18. package/babel.config.js +3 -3
  19. package/images/hero.jpg +0 -0
  20. package/images/ilo-dg.jpg +0 -0
  21. package/images/ilo-headquarters.jpg +0 -0
  22. package/images/large.jpg +0 -0
  23. package/images/media-file-poster.jpg +0 -0
  24. package/images/medium.jpg +0 -0
  25. package/images/small.jpg +0 -0
  26. package/images/video-example.mp4 +0 -0
  27. package/images/youtube-video-poster.avif +0 -0
  28. package/importprefix.js +5 -5
  29. package/importsvgs.js +3 -3
  30. package/jest.config.js +8 -8
  31. package/outputtwigs.js +16 -13
  32. package/package.json +47 -56
  33. package/postcss.config.js +2 -2
  34. package/src/namespaces.js +5 -5
  35. package/src/patterns/components/accordion/accordion-item.wingsuit.yml +1 -1
  36. package/src/patterns/components/accordion/accordion.behavior.js +2 -2
  37. package/src/patterns/components/accordion/accordion.js +31 -21
  38. package/src/patterns/components/accordion/accordion.stories.jsx +4 -2
  39. package/src/patterns/components/accordion/accordion.wingsuit.yml +4 -3
  40. package/src/patterns/components/accordion/index.js +3 -3
  41. package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +2 -2
  42. package/src/patterns/components/breadcrumb/breadcrumb.js +14 -12
  43. package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +4 -2
  44. package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -1
  45. package/src/patterns/components/breadcrumb/index.js +3 -3
  46. package/src/patterns/components/button/button.stories.jsx +4 -2
  47. package/src/patterns/components/button/button.wingsuit.yml +12 -12
  48. package/src/patterns/components/button/index.js +2 -2
  49. package/src/patterns/components/callout/callout.behavior.js +2 -2
  50. package/src/patterns/components/callout/callout.js +18 -13
  51. package/src/patterns/components/callout/callout.stories.jsx +4 -2
  52. package/src/patterns/components/callout/callout.wingsuit.yml +2 -2
  53. package/src/patterns/components/callout/index.js +3 -3
  54. package/src/patterns/components/card/card.stories.jsx +4 -2
  55. package/src/patterns/components/card/card.wingsuit.yml +73 -65
  56. package/src/patterns/components/card/index.js +2 -2
  57. package/src/patterns/components/cardgroup/cardgroup.stories.jsx +4 -2
  58. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +61 -61
  59. package/src/patterns/components/cardgroup/index.js +2 -2
  60. package/src/patterns/components/contextmenu/contextmenu.stories.jsx +4 -2
  61. package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +7 -7
  62. package/src/patterns/components/contextmenu/index.js +2 -2
  63. package/src/patterns/components/dropdown/dropdown.stories.jsx +4 -2
  64. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +4 -4
  65. package/src/patterns/components/dropdown/index.js +2 -2
  66. package/src/patterns/components/footer/footer.stories.jsx +4 -2
  67. package/src/patterns/components/footer/footer.wingsuit.yml +1 -1
  68. package/src/patterns/components/footer/index.js +2 -2
  69. package/src/patterns/components/form/fileupload.behavior.js +2 -2
  70. package/src/patterns/components/form/fileupload.js +6 -5
  71. package/src/patterns/components/form/form.stories.jsx +4 -2
  72. package/src/patterns/components/form/form.wingsuit.yml +92 -92
  73. package/src/patterns/components/form/index.js +3 -3
  74. package/src/patterns/components/hero/hero.stories.jsx +4 -2
  75. package/src/patterns/components/hero/hero.wingsuit.yml +8 -8
  76. package/src/patterns/components/hero/index.js +2 -2
  77. package/src/patterns/components/herocard/herocard.stories.jsx +4 -2
  78. package/src/patterns/components/herocard/herocard.wingsuit.yml +5 -5
  79. package/src/patterns/components/herocard/index.js +2 -2
  80. package/src/patterns/components/icon/index.js +2 -2
  81. package/src/patterns/components/image/image.stories.jsx +4 -2
  82. package/src/patterns/components/image/image.wingsuit.yml +9 -9
  83. package/src/patterns/components/image/index.js +2 -2
  84. package/src/patterns/components/link/index.js +2 -2
  85. package/src/patterns/components/link/link.stories.jsx +4 -2
  86. package/src/patterns/components/link/link.wingsuit.yml +3 -3
  87. package/src/patterns/components/linklist/index.js +2 -2
  88. package/src/patterns/components/linklist/linklist.stories.jsx +4 -2
  89. package/src/patterns/components/linklist/linklist.wingsuit.yml +15 -15
  90. package/src/patterns/components/list/index.js +2 -2
  91. package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
  92. package/src/patterns/components/list/list.stories.jsx +4 -2
  93. package/src/patterns/components/list/list.wingsuit.yml +4 -4
  94. package/src/patterns/components/loading/index.js +3 -3
  95. package/src/patterns/components/loading/loading.behavior.js +2 -2
  96. package/src/patterns/components/loading/loading.js +2 -2
  97. package/src/patterns/components/loading/loading.stories.jsx +4 -2
  98. package/src/patterns/components/loading/loading.wingsuit.yml +5 -5
  99. package/src/patterns/components/localnav/index.js +3 -3
  100. package/src/patterns/components/localnav/localnav.stories.jsx +4 -2
  101. package/src/patterns/components/localnav/localnav.twig +3 -1
  102. package/src/patterns/components/localnav/localnav.wingsuit.yml +17 -19
  103. package/src/patterns/components/modal/index.js +3 -3
  104. package/src/patterns/components/modal/modal.behavior.js +2 -2
  105. package/src/patterns/components/modal/modal.js +9 -7
  106. package/src/patterns/components/modal/modal.stories.jsx +5 -2
  107. package/src/patterns/components/modal/modal.wingsuit.yml +20 -20
  108. package/src/patterns/components/navigation/index.js +3 -3
  109. package/src/patterns/components/navigation/navigation.behavior.js +2 -2
  110. package/src/patterns/components/navigation/navigation.js +110 -37
  111. package/src/patterns/components/navigation/navigation.stories.jsx +5 -2
  112. package/src/patterns/components/navigation/navigation.wingsuit.yml +21 -21
  113. package/src/patterns/components/notification/index.js +3 -3
  114. package/src/patterns/components/notification/notification.behavior.js +3 -3
  115. package/src/patterns/components/notification/notification.js +4 -2
  116. package/src/patterns/components/notification/notification.stories.jsx +5 -2
  117. package/src/patterns/components/notification/notification.wingsuit.yml +7 -7
  118. package/src/patterns/components/pagination/Pagination.stories.jsx +4 -2
  119. package/src/patterns/components/pagination/index.js +2 -2
  120. package/src/patterns/components/pagination/pagination.wingsuit.yml +12 -12
  121. package/src/patterns/components/polyfill/index.js +2 -2
  122. package/src/patterns/components/profile/index.js +2 -2
  123. package/src/patterns/components/profile/profile.stories.jsx +5 -2
  124. package/src/patterns/components/profile/profile.wingsuit.yml +7 -7
  125. package/src/patterns/components/readmore/index.js +3 -3
  126. package/src/patterns/components/readmore/readmore.behavior.js +2 -2
  127. package/src/patterns/components/readmore/readmore.js +4 -2
  128. package/src/patterns/components/readmore/readmore.stories.jsx +5 -2
  129. package/src/patterns/components/readmore/readmore.wingsuit.yml +4 -4
  130. package/src/patterns/components/richtext/index.js +2 -2
  131. package/src/patterns/components/richtext/richtext.stories.jsx +5 -2
  132. package/src/patterns/components/richtext/richtext.wingsuit.yml +2 -2
  133. package/src/patterns/components/searchfield/index.js +2 -2
  134. package/src/patterns/components/searchfield/searchfield.stories.jsx +5 -2
  135. package/src/patterns/components/searchfield/searchfield.wingsuit.yml +1 -1
  136. package/src/patterns/components/table/index.js +3 -3
  137. package/src/patterns/components/table/table.behavior.js +2 -2
  138. package/src/patterns/components/table/table.js +66 -44
  139. package/src/patterns/components/table/table.stories.jsx +5 -2
  140. package/src/patterns/components/table/table.wingsuit.yml +11 -21
  141. package/src/patterns/components/tableofcontents/index.js +3 -3
  142. package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +2 -2
  143. package/src/patterns/components/tableofcontents/tableofcontents.js +27 -19
  144. package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +5 -2
  145. package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +14 -14
  146. package/src/patterns/components/tabs/index.js +3 -3
  147. package/src/patterns/components/tabs/tabs.behavior.js +4 -4
  148. package/src/patterns/components/tabs/tabs.js +12 -8
  149. package/src/patterns/components/tabs/tabs.stories.jsx +5 -2
  150. package/src/patterns/components/tabs/tabs.wingsuit.yml +121 -121
  151. package/src/patterns/components/tags/index.js +3 -3
  152. package/src/patterns/components/tags/tag.behavior.js +2 -2
  153. package/src/patterns/components/tags/tag.js +12 -12
  154. package/src/patterns/components/tags/tag.stories.jsx +5 -2
  155. package/src/patterns/components/tags/tag.wingsuit.yml +3 -3
  156. package/src/patterns/components/tags/tags.wingsuit.yml +1 -1
  157. package/src/patterns/components/tooltip/index.js +3 -3
  158. package/src/patterns/components/tooltip/tooltip.behavior.js +2 -2
  159. package/src/patterns/components/tooltip/tooltip.js +35 -25
  160. package/src/patterns/components/tooltip/tooltip.stories.jsx +5 -2
  161. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +4 -4
  162. package/src/patterns/components/video/index.js +3 -3
  163. package/src/patterns/components/video/video.behavior.js +2 -2
  164. package/src/patterns/components/video/video.js +6 -5
  165. package/src/patterns/components/video/video.stories.jsx +5 -2
  166. package/src/patterns/components/video/video.wingsuit.yml +12 -12
  167. package/src/vendorjs/lib.vendor.js +1 -1
  168. package/wingsuit.config.js +14 -13
  169. package/.editorconfig +0 -12
  170. package/.eslintignore +0 -11
  171. package/.prettierignore +0 -16
  172. package/.prettierrc.js +0 -13
@@ -1,11 +1,46 @@
1
1
  // .storybook/YourTheme.js
2
2
 
3
- import { create } from '@storybook/theming';
3
+ import { create } from "@storybook/theming";
4
+ import ilo_logo from "@ilo-org/brand-assets/dist/assets/logo_en_horizontal_blue.svg";
5
+ import brandColors from "@ilo-org/themes/tokens/brand/base.json";
6
+
7
+ const { brand } = brandColors;
4
8
 
5
9
  export default create({
6
- base: 'light',
7
- brandTitle: 'ILO UI Kit',
8
- brandUrl: 'https://www.ilo.org/',
9
- brandImage:
10
- 'https://www.ilo.org/wcmsp5/ilo/global/images/templates/favicons/apple-touch-icon-precomposed.png',
10
+ base: "light",
11
+ brandTitle: "ILO Design System for Twig",
12
+ brandUrl: "https://www.ilo.org/",
13
+ brandImage: ilo_logo,
14
+ brandTarget: "_self",
15
+
16
+ colorPrimary: brand["ilo-dark-blue"].value,
17
+ colorSecondary: brand["ilo-blue"].value,
18
+
19
+ // UI
20
+ appBg: brand["ilo-lighter-blue"].value,
21
+ appContentBg: brand["ilo-white"].value,
22
+ appBorderColor: brand["ilo-grey-ui"].value,
23
+ appBorderRadius: 0,
24
+
25
+ fontBase: "'Noto Sans', sans-serif",
26
+ fontCode: "'Fira Code', monospace",
27
+
28
+ // Text colors
29
+ textColor: brand["ilo-dark-blue"].value,
30
+ textInverseColor: brand["ilo-white"].value,
31
+ textMutedColor: brand["ilo-grey-accessible"].value,
32
+
33
+ // Toolbar default and active colors
34
+ barTextColor: brand["ilo-white"].value,
35
+ barSelectedColor: brand["ilo-yellow"].value,
36
+ barBg: brand["ilo-dark-blue"].value,
37
+
38
+ buttonBg: brand["ilo-white"].value,
39
+ buttonBorder: brand["ilo-grey-ui"].value,
40
+ booleanBg: brand["ilo-lighter-blue"].value,
41
+ booleanSelectedBg: brand["ilo-white"].value,
42
+ inputBg: brand["ilo-lighter-blue"].value,
43
+ inputBorder: brand["ilo-grey-ui"].value,
44
+ inputTextColor: brand["ilo-dark-blue"].value,
45
+ inputBorderRadius: 3,
11
46
  });
package/babel.config.js CHANGED
@@ -1,16 +1,16 @@
1
1
  module.exports = {
2
2
  presets: [
3
3
  [
4
- '@babel/preset-env',
4
+ "@babel/preset-env",
5
5
  {
6
- useBuiltIns: 'entry',
6
+ useBuiltIns: "entry",
7
7
  corejs: 3,
8
8
  },
9
9
  ],
10
10
  ],
11
11
  env: {
12
12
  test: {
13
- presets: [['@babel/preset-env']],
13
+ presets: [["@babel/preset-env"]],
14
14
  },
15
15
  },
16
16
  };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/importprefix.js CHANGED
@@ -1,9 +1,9 @@
1
- const theme = require('@ilo-org/themes/tokens/theme/base.json');
2
- const fs = require('fs');
3
- const path = 'apps/storybook/config/prefix.yml';
1
+ const theme = require("@ilo-org/themes/tokens/theme/base.json");
2
+ const fs = require("fs");
3
+ const path = "apps/storybook/config/prefix.yml";
4
4
  let buffer = new Buffer.from(`prefix: ${theme.themeprefix.value}`);
5
5
 
6
- fs.open(path, 'w', function (err, fd) {
6
+ fs.open(path, "w", function (err, fd) {
7
7
  if (err) {
8
8
  console.log("Can't open file");
9
9
  } else {
@@ -11,7 +11,7 @@ fs.open(path, 'w', function (err, fd) {
11
11
  if (err) {
12
12
  console.log("Can't write to file");
13
13
  } else {
14
- console.log('theme prefix added');
14
+ console.log("theme prefix added");
15
15
  }
16
16
  });
17
17
  }
package/importsvgs.js CHANGED
@@ -1,5 +1,5 @@
1
- const fs = require('fs-extra');
2
- const source = 'node_modules/@ilo-org/icons/svg';
3
- const destination = 'images';
1
+ const fs = require("fs-extra");
2
+ const source = "node_modules/@ilo-org/icons/svg";
3
+ const destination = "images";
4
4
 
5
5
  fs.copy(source, destination);
package/jest.config.js CHANGED
@@ -1,18 +1,18 @@
1
1
  module.exports = {
2
- projects: ['<rootDir>/source/*/jest.config.js'],
2
+ projects: ["<rootDir>/source/*/jest.config.js"],
3
3
 
4
4
  // Everything below here is used by merging into per-design-system jest config
5
5
  verbose: true,
6
- testURL: 'http://localhost/',
7
- setupFiles: ['<rootDir>/tools/tests/unit/setupJest.js'],
8
- moduleFileExtensions: ['js', 'json', 'vue'],
6
+ testURL: "http://localhost/",
7
+ setupFiles: ["<rootDir>/tools/tests/unit/setupJest.js"],
8
+ moduleFileExtensions: ["js", "json", "vue"],
9
9
  moduleNameMapper: {
10
10
  // Jest doesn't care about styles, twig, images, fonts, etc
11
- '\\.(twig|md|yml|yaml|css|scss|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
12
- '<rootDir>/tools/tests/unit/__mocks__/fileMock.js',
11
+ "\\.(twig|md|yml|yaml|css|scss|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
12
+ "<rootDir>/tools/tests/unit/__mocks__/fileMock.js",
13
13
  },
14
14
  transform: {
15
- '^.+\\.js$': 'babel-jest',
16
- '^.+\\.vue$': 'vue-jest',
15
+ "^.+\\.js$": "babel-jest",
16
+ "^.+\\.vue$": "vue-jest",
17
17
  },
18
18
  };
package/outputtwigs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // The build file for Twig package - this copies the twigs from where Storybook needs them to a more convenient folder for use in a CMS
2
- const fs = require('fs');
3
- const path = require('path');
4
- const theme = require('@ilo-org/themes/tokens/theme/base.json');
2
+ const fs = require("fs");
3
+ const path = require("path");
4
+ const theme = require("@ilo-org/themes/tokens/theme/base.json");
5
5
  let buffer = new Buffer.from(`prefix: ${theme.themeprefix.value}`);
6
6
  const srcpath = `./src/patterns/components`;
7
7
 
@@ -13,7 +13,7 @@ const checkFolder = async (dir) => {
13
13
 
14
14
  const traverseDirectory = (directory) => {
15
15
  let files = fs.readdirSync(directory).filter((file) => {
16
- return file !== '.DS_Store';
16
+ return file !== ".DS_Store";
17
17
  });
18
18
  for (const f in files) {
19
19
  const file = files[f];
@@ -22,23 +22,26 @@ const traverseDirectory = (directory) => {
22
22
  if (fs.statSync(absolute).isDirectory()) {
23
23
  traverseDirectory(absolute);
24
24
  } else {
25
- if (ext === '.twig' || (ext === '.js' && file !== 'index.js')) {
26
- filepath = directory
25
+ if (ext === ".twig" || (ext === ".js" && file !== "index.js")) {
26
+ let filepath = directory
27
27
  .replace(`src/`, `dist/`)
28
- .replace('patterns/', '')
29
- .replace(`/${file}`, '');
28
+ .replace("patterns/", "")
29
+ .replace(`/${file}`, "");
30
30
  checkFolder(filepath);
31
- fs.readFile(absolute, 'utf8', function (err, filedata) {
31
+ fs.readFile(absolute, "utf8", function (err, filedata) {
32
32
  let formatted = filedata.replace(/{{prefix}}/g, buffer);
33
33
  fs.writeFile(
34
- `${path.dirname(absolute).replace(`src/`, `dist/`).replace('patterns/', '')}/${file}`,
34
+ `${path
35
+ .dirname(absolute)
36
+ .replace(`src/`, `dist/`)
37
+ .replace("patterns/", "")}/${file}`,
35
38
  formatted,
36
- 'utf8',
39
+ "utf8",
37
40
  function (err) {
38
- if (err) return console.log('.writeFile', err);
41
+ if (err) return console.log(".writeFile", err);
39
42
  }
40
43
  );
41
- if (err) return console.log('readFile', err);
44
+ if (err) return console.log("readFile", err);
42
45
  });
43
46
  }
44
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ilo-org/twig",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Twig components for the ILO's Design System",
6
6
  "main": "",
@@ -20,82 +20,73 @@
20
20
  "components"
21
21
  ],
22
22
  "dependencies": {
23
- "@wingsuit-designsystem/preset-scss": "^1.2.3",
24
- "video.js": "^7.19.2",
23
+ "video.js": "^7.21.2",
24
+ "@ilo-org/brand-assets": "0.1.0",
25
25
  "@ilo-org/fonts": "0.1.0",
26
26
  "@ilo-org/icons": "0.1.16",
27
- "@ilo-org/styles": "0.1.17",
27
+ "@ilo-org/styles": "0.1.19",
28
28
  "@ilo-org/themes": "0.1.15",
29
29
  "@ilo-org/utils": "0.0.11"
30
30
  },
31
31
  "devDependencies": {
32
- "@babel/core": "^7.8.4",
33
- "@babel/preset-env": "^7.8.4",
34
- "@storybook/addon-actions": "^6.4.9",
35
- "@storybook/addon-essentials": "^6.4.9",
36
- "@storybook/addon-links": "^6.4.9",
32
+ "@babel/core": "^7.20.12",
33
+ "@babel/preset-env": "^7.20.2",
34
+ "@storybook/addon-actions": "^6.5.16",
35
+ "@storybook/addon-essentials": "^6.5.16",
36
+ "@storybook/addon-links": "^6.5.16",
37
37
  "@storybook/addon-postcss": "^2.0.0",
38
- "@storybook/addons": "^6.4.9",
39
- "@storybook/linter-config": "^2.5.0",
40
- "@storybook/react": "^6.4.9",
41
- "@storybook/storybook-deployer": "^2.8.7",
42
- "@types/react": "^16.9.35",
43
- "@types/react-dom": "^16.9.8",
44
- "@wingsuit-designsystem/cli": "1.2.1",
45
- "@wingsuit-designsystem/core": "1.2.1",
46
- "@wingsuit-designsystem/pattern": "1.2.1",
47
- "@wingsuit-designsystem/preset-scss": "^1.2.3",
48
- "@wingsuit-designsystem/storybook": "1.2.1",
49
- "autoprefixer": "^10.4.0",
50
- "cross-env": "^6.0.3",
51
- "eslint": "^6.7.2",
52
- "eslint-config-airbnb-base": "^14.0.0",
53
- "eslint-config-prettier": "^6.10.0",
54
- "eslint-import-resolver-alias": "^1.1.2",
55
- "eslint-import-resolver-webpack": "^0.12.0",
56
- "eslint-loader": "^3.0.3",
57
- "eslint-plugin-import": "^2.20.1",
58
- "eslint-plugin-jest": "^23.7.0",
59
- "eslint-plugin-prettier": "^3.1.2",
60
- "eslint-plugin-vue": "^6.0.1",
38
+ "@storybook/addons": "^6.5.16",
39
+ "@storybook/linter-config": "^3.1.2",
40
+ "@storybook/react": "^6.5.16",
41
+ "@storybook/storybook-deployer": "^2.8.16",
42
+ "@types/react": "^16.14.35",
43
+ "@types/react-dom": "^16.9.17",
44
+ "@wingsuit-designsystem/cli": "1.2.7",
45
+ "@wingsuit-designsystem/core": "1.2.7",
46
+ "@wingsuit-designsystem/pattern": "1.2.7",
47
+ "@wingsuit-designsystem/preset-scss": "^1.2.7",
48
+ "@wingsuit-designsystem/storybook": "1.2.7",
49
+ "autoprefixer": "^10.4.13",
50
+ "cross-env": "^7.0.3",
61
51
  "file-loader": "^6.2.0",
62
52
  "fs": "0.0.1-security",
63
53
  "fs-extra": "^8.1.0",
64
- "glob": "^7.1.6",
54
+ "glob": "^7.2.3",
65
55
  "jquery-once": "^2.2.3",
66
56
  "lodash": "^4.17.20",
67
- "mini-css-extract-plugin": "^1.3.1",
68
- "optimize-css-assets-webpack-plugin": "^5.0.3",
69
- "postcss": "^8.4.12",
70
- "postcss-loader": "^4.2.0",
71
- "postcss-nested": "^4.2.1",
72
- "postcss-scss": "^3.0.4",
73
- "prettier": "^1.19.1",
57
+ "mini-css-extract-plugin": "^1.6.2",
58
+ "optimize-css-assets-webpack-plugin": "^5.0.8",
59
+ "postcss": "^8.4.21",
60
+ "postcss-loader": "^4.3.0",
61
+ "postcss-nested": "^4.2.3",
62
+ "postcss-scss": "^4.0.6",
74
63
  "raw-loader": "^4.0.2",
75
- "react": "^16.13.1",
76
- "react-dom": "^16.13.1",
64
+ "react": "^16.14.0",
65
+ "react-dom": "^16.14.0",
77
66
  "regenerator-runtime": "^0.13.3",
78
67
  "require-context": "^1.1.0",
79
- "resolve-url-loader": "^3.1.1",
80
- "sass-loader": "^10.1.0",
81
- "storybook": "^6.5.15",
82
- "style-loader": "^1.0.2",
83
- "stylelint-scss": "^3.17.2",
84
- "webpack": "^4.41.3",
85
- "yaml-loader": "^0.6.0",
86
- "yo": "^3.1.1"
68
+ "resolve-url-loader": "^3.1.5",
69
+ "sass-loader": "^10.4.1",
70
+ "storybook": "^6.5.16",
71
+ "style-loader": "^1.3.0",
72
+ "stylelint-scss": "^3.21.0",
73
+ "webpack": "^4.46.0",
74
+ "yaml-loader": "0.6.0",
75
+ "yo": "^3.1.1",
76
+ "@ilo-org/eslint-config": "0.0.3",
77
+ "@ilo-org/prettier-config": "0.0.2"
87
78
  },
88
79
  "scripts": {
89
80
  "storybook": "node importprefix.js; node importsvgs.js; start-storybook --config-dir apps/storybook",
90
81
  "build:docs": "node importprefix.js; node importsvgs.js; build-storybook --config-dir apps/storybook -o ./storybook-static",
91
- "build:lib": "pnpm output",
82
+ "build:lib": "node importprefix.js; node importsvgs.js; pnpm output",
92
83
  "build": "pnpm build:lib",
93
- "lint:js": "eslint --ext .js ./",
84
+ "lint:js": "eslint . --ext .js,.jsx",
94
85
  "lint:css": "stylelint '**/*.css'",
95
- "lint": "npm run lint:js; npm run lint:css;",
96
- "fmt:js": "eslint --fix --ext .js,.vue ./",
97
- "fmt:css": "npm run lint:css --fix && prettier --loglevel warn --write '**/*.{css}'",
98
- "fmt": "npm run fmt:js; npm run fmt:css",
86
+ "lint:fix": "pnpm lint:js -- --fix",
87
+ "lint": "pnpm lint:js && pnpm lint:css",
88
+ "format": "prettier --check . --ignore-path ../../.prettierignore",
89
+ "format:fix": "prettier --write . --ignore-path ../../.prettierignore",
99
90
  "ci": "npm run lint && npm run build:drupal",
100
91
  "import:prefix": "node importprefix.js",
101
92
  "import:svgs": "node importsvgs.js",
package/postcss.config.js CHANGED
@@ -1,6 +1,6 @@
1
- const autoprefixer = require('autoprefixer');
1
+ const autoprefixer = require("autoprefixer");
2
2
 
3
3
  module.exports = {
4
- syntax: 'postcss-scss',
4
+ syntax: "postcss-scss",
5
5
  plugins: [autoprefixer],
6
6
  };
package/src/namespaces.js CHANGED
@@ -2,13 +2,13 @@
2
2
  * Global namespaces
3
3
  */
4
4
 
5
- const path = require('path');
5
+ const path = require("path");
6
6
 
7
- const patterns = path.resolve(__dirname, 'patterns');
7
+ const patterns = path.resolve(__dirname, "patterns");
8
8
 
9
9
  module.exports = {
10
10
  patterns: patterns,
11
- components: path.resolve(patterns, 'components'),
12
- tokens: path.resolve(__dirname, 'tokens'),
13
- svgs: path.resolve(__dirname, 'svgs'),
11
+ components: path.resolve(patterns, "components"),
12
+ tokens: path.resolve(__dirname, "tokens"),
13
+ svgs: path.resolve(__dirname, "svgs"),
14
14
  };
@@ -1,5 +1,5 @@
1
1
  accordion:
2
- use: '@components/accordion/accordion-item.twig'
2
+ use: "@components/accordion/accordion-item.twig"
3
3
  label: Accordion Item
4
4
  description: A collapsible accordion item.
5
5
  fields:
@@ -1,4 +1,4 @@
1
- import Accordion from './accordion';
1
+ import Accordion from "./accordion";
2
2
 
3
3
  Drupal.behaviors.accordion = {
4
4
  attach() {
@@ -6,7 +6,7 @@ Drupal.behaviors.accordion = {
6
6
  document.querySelectorAll(`[data-loadcomponent="Accordion"]`),
7
7
  (element) => {
8
8
  // eslint-disable-next-line no-console
9
- console.log('loading Accordion component....');
9
+ console.log("loading Accordion component....");
10
10
  new Accordion(element);
11
11
  }
12
12
  );
@@ -1,4 +1,4 @@
1
- import { getUpdatedItems, EVENTS, ARIA, MISC } from '@ilo-org/utils';
1
+ import { EVENTS, ARIA } from "@ilo-org/utils";
2
2
 
3
3
  /**
4
4
  * The Accordion module which handles rendering field labels inline on a form.
@@ -33,7 +33,10 @@ export default class Accordion {
33
33
  * @chainable
34
34
  */
35
35
  init() {
36
- this.cacheDomReferences().setupHandlers().enable().evaluateAccordionHeights();
36
+ this.cacheDomReferences()
37
+ .setupHandlers()
38
+ .enable()
39
+ .evaluateAccordionHeights();
37
40
 
38
41
  return this;
39
42
  }
@@ -49,10 +52,17 @@ export default class Accordion {
49
52
  * The field that a user interacts with on a form
50
53
  * @type {Object}
51
54
  */
52
- this.accordionItems = this.element.querySelectorAll('.ilo--accordion--item');
53
- this.multipleExpanded = this.element.getAttribute('data-multipleexpanded') === 'true';
54
- this.accordionPanels = this.element.querySelectorAll('.ilo--accordion--panel');
55
- this.accordionButtons = this.element.querySelectorAll('.ilo--accordion--button');
55
+ this.accordionItems = this.element.querySelectorAll(
56
+ ".ilo--accordion--item"
57
+ );
58
+ this.multipleExpanded =
59
+ this.element.getAttribute("data-multipleexpanded") === "true";
60
+ this.accordionPanels = this.element.querySelectorAll(
61
+ ".ilo--accordion--panel"
62
+ );
63
+ this.accordionButtons = this.element.querySelectorAll(
64
+ ".ilo--accordion--button"
65
+ );
56
66
  console.log(this.multipleExpanded);
57
67
 
58
68
  return this;
@@ -81,7 +91,7 @@ export default class Accordion {
81
91
  */
82
92
  enable() {
83
93
  if (this.accordionButtons.length > 0) {
84
- this.accordionButtons.forEach((button, i) => {
94
+ this.accordionButtons.forEach((button) => {
85
95
  button.addEventListener(EVENTS.CLICK, (e) => this.onClick(e));
86
96
  });
87
97
  }
@@ -107,10 +117,10 @@ export default class Accordion {
107
117
  * @chainable
108
118
  */
109
119
  evaluateAccordionHeights() {
110
- this.accordionPanels.forEach((item, i) => {
120
+ this.accordionPanels.forEach((item) => {
111
121
  item.style.setProperty(
112
- '--height',
113
- item.querySelector('.ilo--accordion--innerpanel').scrollHeight + 'px'
122
+ "--height",
123
+ item.querySelector(".ilo--accordion--innerpanel").scrollHeight + "px"
114
124
  );
115
125
  });
116
126
 
@@ -124,9 +134,9 @@ export default class Accordion {
124
134
  */
125
135
  updateAccordionItems(panelbutton) {
126
136
  const panel = panelbutton
127
- .closest('.ilo--accordion--item')
128
- .querySelector('.ilo--accordion--panel');
129
- const isopen = panel.classList.contains('ilo--accordion--panel--open');
137
+ .closest(".ilo--accordion--item")
138
+ .querySelector(".ilo--accordion--panel");
139
+ const isopen = panel.classList.contains("ilo--accordion--panel--open");
130
140
 
131
141
  if (!this.multipleExpanded) {
132
142
  this.accordionPanels.forEach((item) => {
@@ -155,10 +165,10 @@ export default class Accordion {
155
165
  */
156
166
  collapseSection(element) {
157
167
  element.parentElement
158
- .querySelector('.ilo--accordion--button')
159
- .setAttribute(ARIA.EXPANDED, 'false');
160
- element.setAttribute(ARIA.HIDDEN, 'false');
161
- element.classList.remove('ilo--accordion--panel--open');
168
+ .querySelector(".ilo--accordion--button")
169
+ .setAttribute(ARIA.EXPANDED, "false");
170
+ element.setAttribute(ARIA.HIDDEN, "false");
171
+ element.classList.remove("ilo--accordion--panel--open");
162
172
  }
163
173
 
164
174
  /**
@@ -170,9 +180,9 @@ export default class Accordion {
170
180
  */
171
181
  expandSection(element) {
172
182
  element.parentElement
173
- .querySelector('.ilo--accordion--button')
174
- .setAttribute(ARIA.EXPANDED, 'true');
175
- element.setAttribute(ARIA.HIDDEN, 'true');
176
- element.classList.add('ilo--accordion--panel--open');
183
+ .querySelector(".ilo--accordion--button")
184
+ .setAttribute(ARIA.EXPANDED, "true");
185
+ element.setAttribute(ARIA.HIDDEN, "true");
186
+ element.classList.add("ilo--accordion--panel--open");
177
187
  }
178
188
  }
@@ -1,7 +1,9 @@
1
- import './index';
1
+ import "./index";
2
2
 
3
- const patternDefinition = require('./accordion.wingsuit.yml');
3
+ export default {};
4
+ const patternDefinition = require("./accordion.wingsuit.yml");
4
5
 
6
+ /* eslint-disable-next-line */
5
7
  export const wingsuit = {
6
8
  patternDefinition,
7
9
  };
@@ -1,7 +1,8 @@
1
1
  accordion:
2
- use: '@components/accordion/accordion.twig'
2
+ use: "@components/accordion/accordion.twig"
3
3
  label: Accordion
4
- description: The accordion component allows the user to show and hide sections of
4
+ description:
5
+ The accordion component allows the user to show and hide sections of
5
6
  related content on a page. Click the accordions below to
6
7
  expand/collapse the accordion content.
7
8
  fields:
@@ -36,6 +37,6 @@ accordion:
36
37
  options:
37
38
  true: True
38
39
  false: False
39
- preview: 'true'
40
+ preview: "true"
40
41
  required: false
41
42
  visibility: storybook
@@ -2,6 +2,6 @@
2
2
  * accordion
3
3
  */
4
4
  // Module template
5
- import './accordion.twig';
6
- import './accordion.wingsuit.yml';
7
- import './accordion.behavior';
5
+ import "./accordion.twig";
6
+ import "./accordion.wingsuit.yml";
7
+ import "./accordion.behavior";
@@ -1,4 +1,4 @@
1
- import Breadcrumb from './breadcrumb';
1
+ import Breadcrumb from "./breadcrumb";
2
2
 
3
3
  Drupal.behaviors.breadcrumb = {
4
4
  attach() {
@@ -6,7 +6,7 @@ Drupal.behaviors.breadcrumb = {
6
6
  document.querySelectorAll(`[data-loadcomponent="Breadcrumb"]`),
7
7
  (element) => {
8
8
  // eslint-disable-next-line no-console
9
- console.log('loading Breadcrumb component....');
9
+ console.log("loading Breadcrumb component....");
10
10
  new Breadcrumb(element);
11
11
  }
12
12
  );
@@ -1,4 +1,4 @@
1
- import { EVENTS } from '@ilo-org/utils';
1
+ import { EVENTS } from "@ilo-org/utils";
2
2
 
3
3
  /**
4
4
  * The Breadcrumb module which handles rendering field labels inline on a form.
@@ -45,9 +45,11 @@ export default class Breadcrumb {
45
45
  * @chainable
46
46
  */
47
47
  cacheDomReferences() {
48
- this.breadcrumbs = this.element.querySelector('.ilo--breadcrumb--items');
48
+ this.breadcrumbs = this.element.querySelector(".ilo--breadcrumb--items");
49
49
  this.breadcrumbwidth = this.breadcrumbs.offsetWidth;
50
- this.ContextButton = this.element.querySelector(`.${this.prefix}--breadcrumb--item--context`);
50
+ this.ContextButton = this.element.querySelector(
51
+ `.${this.prefix}--breadcrumb--item--context`
52
+ );
51
53
  this.ContextMenu = this.element.querySelector(`.context--menu`);
52
54
 
53
55
  return this;
@@ -85,13 +87,13 @@ export default class Breadcrumb {
85
87
  * @return {Object} Breadcrumb A reference to the instance of the class
86
88
  * @chainable
87
89
  */
88
- onResize(e) {
90
+ onResize() {
89
91
  if (this.breadcrumbwidth > this.element.offsetWidth / 2) {
90
- this.element.classList.add('contextmenu');
91
- this.ContextMenu.classList.remove('open');
92
+ this.element.classList.add("contextmenu");
93
+ this.ContextMenu.classList.remove("open");
92
94
  } else {
93
- this.element.classList.remove('contextmenu');
94
- this.ContextMenu.classList.remove('open');
95
+ this.element.classList.remove("contextmenu");
96
+ this.ContextMenu.classList.remove("open");
95
97
  }
96
98
 
97
99
  return this;
@@ -104,11 +106,11 @@ export default class Breadcrumb {
104
106
  * @chainable
105
107
  */
106
108
  onClick() {
107
- if (this.element.classList.contains('contextmenu')) {
108
- if (this.ContextMenu.classList.contains('open')) {
109
- this.ContextMenu.classList.remove('open');
109
+ if (this.element.classList.contains("contextmenu")) {
110
+ if (this.ContextMenu.classList.contains("open")) {
111
+ this.ContextMenu.classList.remove("open");
110
112
  } else {
111
- this.ContextMenu.classList.add('open');
113
+ this.ContextMenu.classList.add("open");
112
114
  }
113
115
  }
114
116
 
@@ -1,7 +1,9 @@
1
- import './index';
1
+ import "./index";
2
2
 
3
- const patternDefinition = require('./breadcrumb.wingsuit.yml');
3
+ export default {};
4
+ const patternDefinition = require("./breadcrumb.wingsuit.yml");
4
5
 
6
+ /* eslint-disable-next-line */
5
7
  export const wingsuit = {
6
8
  patternDefinition,
7
9
  };