@ilo-org/twig 0.2.12 → 0.2.13

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 (162) hide show
  1. package/.eslintrc.js +37 -49
  2. package/.stylelintrc +2 -6
  3. package/.turbo/turbo-build:lib.log +2 -2
  4. package/CHANGELOG.md +12 -0
  5. package/apps/storybook/assets.js +5 -0
  6. package/apps/storybook/main.js +17 -8
  7. package/apps/storybook/manager-head.html +1 -1
  8. package/apps/storybook/manager.js +2 -2
  9. package/apps/storybook/patterns/colors.stories.mdx +9 -4
  10. package/apps/storybook/patterns/intro.stories.mdx +47 -42
  11. package/apps/storybook/patterns/typeset.stories.mdx +10 -6
  12. package/apps/storybook/patterns/welcome.stories.mdx +21 -16
  13. package/apps/storybook/preview-body.html +1 -1
  14. package/apps/storybook/preview.js +16 -16
  15. package/apps/storybook/styles.scss +1 -1
  16. package/apps/storybook/theme.js +5 -5
  17. package/babel.config.js +3 -3
  18. package/importprefix.js +5 -5
  19. package/importsvgs.js +3 -3
  20. package/jest.config.js +8 -8
  21. package/outputtwigs.js +16 -13
  22. package/package.json +46 -55
  23. package/postcss.config.js +2 -2
  24. package/src/namespaces.js +5 -5
  25. package/src/patterns/components/accordion/accordion-item.wingsuit.yml +1 -1
  26. package/src/patterns/components/accordion/accordion.behavior.js +2 -2
  27. package/src/patterns/components/accordion/accordion.js +31 -21
  28. package/src/patterns/components/accordion/accordion.stories.jsx +4 -2
  29. package/src/patterns/components/accordion/accordion.wingsuit.yml +4 -3
  30. package/src/patterns/components/accordion/index.js +3 -3
  31. package/src/patterns/components/breadcrumb/breadcrumb.behavior.js +2 -2
  32. package/src/patterns/components/breadcrumb/breadcrumb.js +14 -12
  33. package/src/patterns/components/breadcrumb/breadcrumb.stories.jsx +4 -2
  34. package/src/patterns/components/breadcrumb/breadcrumb.wingsuit.yml +1 -1
  35. package/src/patterns/components/breadcrumb/index.js +3 -3
  36. package/src/patterns/components/button/button.stories.jsx +4 -2
  37. package/src/patterns/components/button/button.wingsuit.yml +12 -12
  38. package/src/patterns/components/button/index.js +2 -2
  39. package/src/patterns/components/callout/callout.behavior.js +2 -2
  40. package/src/patterns/components/callout/callout.js +18 -13
  41. package/src/patterns/components/callout/callout.stories.jsx +4 -2
  42. package/src/patterns/components/callout/callout.wingsuit.yml +2 -2
  43. package/src/patterns/components/callout/index.js +3 -3
  44. package/src/patterns/components/card/card.stories.jsx +4 -2
  45. package/src/patterns/components/card/card.wingsuit.yml +8 -8
  46. package/src/patterns/components/card/index.js +2 -2
  47. package/src/patterns/components/cardgroup/cardgroup.stories.jsx +4 -2
  48. package/src/patterns/components/cardgroup/cardgroup.wingsuit.yml +31 -31
  49. package/src/patterns/components/cardgroup/index.js +2 -2
  50. package/src/patterns/components/contextmenu/contextmenu.stories.jsx +4 -2
  51. package/src/patterns/components/contextmenu/contextmenu.wingsuit.yml +7 -7
  52. package/src/patterns/components/contextmenu/index.js +2 -2
  53. package/src/patterns/components/dropdown/dropdown.stories.jsx +4 -2
  54. package/src/patterns/components/dropdown/dropdown.wingsuit.yml +4 -4
  55. package/src/patterns/components/dropdown/index.js +2 -2
  56. package/src/patterns/components/footer/footer.stories.jsx +4 -2
  57. package/src/patterns/components/footer/footer.wingsuit.yml +1 -1
  58. package/src/patterns/components/footer/index.js +2 -2
  59. package/src/patterns/components/form/fileupload.behavior.js +2 -2
  60. package/src/patterns/components/form/fileupload.js +6 -5
  61. package/src/patterns/components/form/form.stories.jsx +4 -2
  62. package/src/patterns/components/form/form.wingsuit.yml +92 -92
  63. package/src/patterns/components/form/index.js +3 -3
  64. package/src/patterns/components/hero/hero.stories.jsx +4 -2
  65. package/src/patterns/components/hero/hero.wingsuit.yml +4 -4
  66. package/src/patterns/components/hero/index.js +2 -2
  67. package/src/patterns/components/herocard/herocard.stories.jsx +4 -2
  68. package/src/patterns/components/herocard/herocard.wingsuit.yml +5 -5
  69. package/src/patterns/components/herocard/index.js +2 -2
  70. package/src/patterns/components/icon/index.js +2 -2
  71. package/src/patterns/components/image/image.stories.jsx +4 -2
  72. package/src/patterns/components/image/image.wingsuit.yml +9 -9
  73. package/src/patterns/components/image/index.js +2 -2
  74. package/src/patterns/components/link/index.js +2 -2
  75. package/src/patterns/components/link/link.stories.jsx +4 -2
  76. package/src/patterns/components/link/link.wingsuit.yml +3 -3
  77. package/src/patterns/components/linklist/index.js +2 -2
  78. package/src/patterns/components/linklist/linklist.stories.jsx +4 -2
  79. package/src/patterns/components/linklist/linklist.wingsuit.yml +15 -15
  80. package/src/patterns/components/list/index.js +2 -2
  81. package/src/patterns/components/list/list-item.wingsuit.yml +1 -1
  82. package/src/patterns/components/list/list.stories.jsx +4 -2
  83. package/src/patterns/components/list/list.wingsuit.yml +4 -4
  84. package/src/patterns/components/loading/index.js +3 -3
  85. package/src/patterns/components/loading/loading.behavior.js +2 -2
  86. package/src/patterns/components/loading/loading.js +2 -2
  87. package/src/patterns/components/loading/loading.stories.jsx +4 -2
  88. package/src/patterns/components/loading/loading.wingsuit.yml +5 -5
  89. package/src/patterns/components/localnav/index.js +3 -3
  90. package/src/patterns/components/localnav/localnav.stories.jsx +4 -2
  91. package/src/patterns/components/localnav/localnav.twig +3 -1
  92. package/src/patterns/components/localnav/localnav.wingsuit.yml +17 -19
  93. package/src/patterns/components/modal/index.js +3 -3
  94. package/src/patterns/components/modal/modal.behavior.js +2 -2
  95. package/src/patterns/components/modal/modal.js +9 -7
  96. package/src/patterns/components/modal/modal.stories.jsx +5 -2
  97. package/src/patterns/components/modal/modal.wingsuit.yml +20 -20
  98. package/src/patterns/components/navigation/index.js +3 -3
  99. package/src/patterns/components/navigation/navigation.behavior.js +2 -2
  100. package/src/patterns/components/navigation/navigation.js +110 -37
  101. package/src/patterns/components/navigation/navigation.stories.jsx +5 -2
  102. package/src/patterns/components/navigation/navigation.wingsuit.yml +7 -7
  103. package/src/patterns/components/notification/index.js +3 -3
  104. package/src/patterns/components/notification/notification.behavior.js +3 -3
  105. package/src/patterns/components/notification/notification.js +4 -2
  106. package/src/patterns/components/notification/notification.stories.jsx +5 -2
  107. package/src/patterns/components/notification/notification.wingsuit.yml +7 -7
  108. package/src/patterns/components/pagination/Pagination.stories.jsx +4 -2
  109. package/src/patterns/components/pagination/index.js +2 -2
  110. package/src/patterns/components/pagination/pagination.wingsuit.yml +12 -12
  111. package/src/patterns/components/polyfill/index.js +2 -2
  112. package/src/patterns/components/profile/index.js +2 -2
  113. package/src/patterns/components/profile/profile.stories.jsx +5 -2
  114. package/src/patterns/components/profile/profile.wingsuit.yml +3 -3
  115. package/src/patterns/components/readmore/index.js +3 -3
  116. package/src/patterns/components/readmore/readmore.behavior.js +2 -2
  117. package/src/patterns/components/readmore/readmore.js +4 -2
  118. package/src/patterns/components/readmore/readmore.stories.jsx +5 -2
  119. package/src/patterns/components/readmore/readmore.wingsuit.yml +4 -4
  120. package/src/patterns/components/richtext/index.js +2 -2
  121. package/src/patterns/components/richtext/richtext.stories.jsx +5 -2
  122. package/src/patterns/components/richtext/richtext.wingsuit.yml +1 -1
  123. package/src/patterns/components/searchfield/index.js +2 -2
  124. package/src/patterns/components/searchfield/searchfield.stories.jsx +5 -2
  125. package/src/patterns/components/searchfield/searchfield.wingsuit.yml +1 -1
  126. package/src/patterns/components/table/index.js +3 -3
  127. package/src/patterns/components/table/table.behavior.js +2 -2
  128. package/src/patterns/components/table/table.js +66 -44
  129. package/src/patterns/components/table/table.stories.jsx +5 -2
  130. package/src/patterns/components/table/table.wingsuit.yml +11 -21
  131. package/src/patterns/components/tableofcontents/index.js +3 -3
  132. package/src/patterns/components/tableofcontents/tableofcontents.behavior.js +2 -2
  133. package/src/patterns/components/tableofcontents/tableofcontents.js +27 -19
  134. package/src/patterns/components/tableofcontents/tableofcontents.stories.jsx +5 -2
  135. package/src/patterns/components/tableofcontents/tableofcontents.wingsuit.yml +14 -14
  136. package/src/patterns/components/tabs/index.js +3 -3
  137. package/src/patterns/components/tabs/tabs.behavior.js +4 -4
  138. package/src/patterns/components/tabs/tabs.js +12 -8
  139. package/src/patterns/components/tabs/tabs.stories.jsx +5 -2
  140. package/src/patterns/components/tabs/tabs.wingsuit.yml +120 -120
  141. package/src/patterns/components/tags/index.js +3 -3
  142. package/src/patterns/components/tags/tag.behavior.js +2 -2
  143. package/src/patterns/components/tags/tag.js +12 -12
  144. package/src/patterns/components/tags/tag.stories.jsx +5 -2
  145. package/src/patterns/components/tags/tag.wingsuit.yml +3 -3
  146. package/src/patterns/components/tags/tags.wingsuit.yml +1 -1
  147. package/src/patterns/components/tooltip/index.js +3 -3
  148. package/src/patterns/components/tooltip/tooltip.behavior.js +2 -2
  149. package/src/patterns/components/tooltip/tooltip.js +35 -25
  150. package/src/patterns/components/tooltip/tooltip.stories.jsx +5 -2
  151. package/src/patterns/components/tooltip/tooltip.wingsuit.yml +4 -4
  152. package/src/patterns/components/video/index.js +3 -3
  153. package/src/patterns/components/video/video.behavior.js +2 -2
  154. package/src/patterns/components/video/video.js +6 -5
  155. package/src/patterns/components/video/video.stories.jsx +5 -2
  156. package/src/patterns/components/video/video.wingsuit.yml +11 -11
  157. package/src/vendorjs/lib.vendor.js +1 -1
  158. package/wingsuit.config.js +14 -13
  159. package/.editorconfig +0 -12
  160. package/.eslintignore +0 -11
  161. package/.prettierignore +0 -16
  162. package/.prettierrc.js +0 -13
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.13",
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.18",
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
82
  "build:lib": "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
  };
@@ -1,5 +1,5 @@
1
1
  breadcrumb:
2
- use: '@components/breadcrumb/breadcrumb.twig'
2
+ use: "@components/breadcrumb/breadcrumb.twig"
3
3
  label: Breadcrumb
4
4
  description: A component for displaying links in a "breadcrumb" ux
5
5
  fields:
@@ -2,6 +2,6 @@
2
2
  * breadcrumb
3
3
  */
4
4
  // Module template
5
- import './breadcrumb.twig';
6
- import './breadcrumb.wingsuit.yml';
7
- import './breadcrumb.behavior';
5
+ import "./breadcrumb.twig";
6
+ import "./breadcrumb.wingsuit.yml";
7
+ import "./breadcrumb.behavior";
@@ -1,7 +1,9 @@
1
- import './index';
1
+ import "./index";
2
2
 
3
- const patternDefinition = require('./button.wingsuit.yml');
3
+ export default {};
4
+ const patternDefinition = require("./button.wingsuit.yml");
4
5
 
6
+ /* eslint-disable-next-line */
5
7
  export const wingsuit = {
6
8
  patternDefinition,
7
9
  };
@@ -1,5 +1,5 @@
1
1
  button:
2
- use: '@components/button/button.twig'
2
+ use: "@components/button/button.twig"
3
3
  label: Button
4
4
  description: A button or a link styled like a button.
5
5
  fields:
@@ -7,19 +7,19 @@ button:
7
7
  type: string
8
8
  label: Label
9
9
  description: The label for the button
10
- preview: 'Button'
10
+ preview: "Button"
11
11
  required: true
12
12
  url:
13
13
  type: string
14
14
  label: url
15
15
  description: The url for the button if it's a link
16
- preview: ''
16
+ preview: ""
17
17
  required: false
18
18
  target:
19
19
  type: string
20
20
  label: target
21
21
  description: Should the button open in a new tab? If so, include the name of the tab. Only evaluated if the url field is populated.
22
- preview: 'true'
22
+ preview: "true"
23
23
  required: false
24
24
  icon:
25
25
  type: string
@@ -31,7 +31,7 @@ button:
31
31
  type: string
32
32
  label: Class name
33
33
  description: optional class name
34
- preview: 'optionalclass'
34
+ preview: "optionalclass"
35
35
  required: false
36
36
  settings:
37
37
  size:
@@ -43,7 +43,7 @@ button:
43
43
  small: Small
44
44
  medium: Medium
45
45
  large: Large
46
- preview: 'large'
46
+ preview: "large"
47
47
  type:
48
48
  type: select
49
49
  label: Type
@@ -55,16 +55,16 @@ button:
55
55
  tertiary: Tertiary
56
56
  alert: Alert
57
57
  icononly: Icon Only
58
- preview: 'primary'
58
+ preview: "primary"
59
59
  disabled:
60
60
  type: select
61
61
  label: Disabled
62
62
  description: The disabled state of the button.
63
63
  required: false
64
64
  options:
65
- true: 'true'
65
+ true: "true"
66
66
  false: false
67
- preview: 'false'
67
+ preview: "false"
68
68
  kind:
69
69
  type: select
70
70
  label: Kind
@@ -74,7 +74,7 @@ button:
74
74
  button: button
75
75
  reset: reset
76
76
  submit: submit
77
- preview: 'button'
77
+ preview: "button"
78
78
  iconPosition:
79
79
  type: select
80
80
  label: Icon Position
@@ -89,7 +89,7 @@ button:
89
89
  label: Icon Only
90
90
  description: Is this an icon-only button?
91
91
  options:
92
- true: 'true'
92
+ true: "true"
93
93
  false: false
94
94
  preview: false
95
95
  required: false
@@ -98,7 +98,7 @@ button:
98
98
  label: Opens Modal
99
99
  description: Does this button trigger open a modal?
100
100
  options:
101
- true: 'true'
101
+ true: "true"
102
102
  false: false
103
103
  preview: false
104
104
  required: false
@@ -2,5 +2,5 @@
2
2
  * button
3
3
  */
4
4
  // Module template
5
- import './button.twig';
6
- import './button.wingsuit.yml';
5
+ import "./button.twig";
6
+ import "./button.wingsuit.yml";