qc-trousse-sdg 1.4.0-develop.1 → 1.4.0

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 (293) hide show
  1. package/README.md +22 -5
  2. package/dist/css/qc-sdg-design-tokens.min.css +1 -1
  3. package/dist/css/qc-sdg-no-grid.min.css +1 -1
  4. package/dist/css/qc-sdg.min.css +1 -1
  5. package/dist/fonts/open-sans-v43-latin-500.woff2 +0 -0
  6. package/dist/fonts/open-sans-v43-latin-500italic.woff2 +0 -0
  7. package/dist/fonts/open-sans-v43-latin-600.woff2 +0 -0
  8. package/dist/fonts/open-sans-v43-latin-600italic.woff2 +0 -0
  9. package/dist/fonts/open-sans-v43-latin-700.woff2 +0 -0
  10. package/dist/fonts/open-sans-v43-latin-700italic.woff2 +0 -0
  11. package/dist/fonts/open-sans-v43-latin-italic.woff2 +0 -0
  12. package/dist/fonts/open-sans-v43-latin-regular.woff2 +0 -0
  13. package/dist/fonts/roboto-mono-v30-latin-500.woff2 +0 -0
  14. package/dist/fonts/roboto-mono-v30-latin-500italic.woff2 +0 -0
  15. package/dist/fonts/roboto-mono-v30-latin-600.woff2 +0 -0
  16. package/dist/fonts/roboto-mono-v30-latin-600italic.woff2 +0 -0
  17. package/dist/fonts/roboto-mono-v30-latin-700.woff2 +0 -0
  18. package/dist/fonts/roboto-mono-v30-latin-700italic.woff2 +0 -0
  19. package/dist/fonts/roboto-mono-v30-latin-italic.woff2 +0 -0
  20. package/dist/fonts/roboto-mono-v30-latin-regular.woff2 +0 -0
  21. package/dist/fonts/roboto-v48-latin-500.woff2 +0 -0
  22. package/dist/fonts/roboto-v48-latin-500italic.woff2 +0 -0
  23. package/dist/fonts/roboto-v48-latin-600.woff2 +0 -0
  24. package/dist/fonts/roboto-v48-latin-600italic.woff2 +0 -0
  25. package/dist/fonts/roboto-v48-latin-700.woff2 +0 -0
  26. package/dist/fonts/roboto-v48-latin-700italic.woff2 +0 -0
  27. package/dist/fonts/roboto-v48-latin-italic.woff2 +0 -0
  28. package/dist/fonts/roboto-v48-latin-regular.woff2 +0 -0
  29. package/dist/img/icon/adresse.svg +4 -0
  30. package/dist/img/icon/arrow-up.svg +3 -0
  31. package/dist/img/icon/calendar.svg +1 -0
  32. package/dist/img/icon/checkmark.svg +3 -0
  33. package/dist/img/icon/chevron-up-thin.svg +5 -0
  34. package/dist/img/{chevron-white.svg → icon/chevron-up.svg} +1 -1
  35. package/{public/img → dist/img/icon}/clipboard.svg +3 -3
  36. package/dist/img/icon/clock.svg +1 -0
  37. package/dist/img/icon/email.svg +1 -0
  38. package/dist/img/icon/error.svg +1 -0
  39. package/{public/img/exclamation-white.svg → dist/img/icon/exclamation.svg} +2 -2
  40. package/{public/img → dist/img/icon}/external-link.svg +2 -2
  41. package/dist/img/icon/information.svg +1 -0
  42. package/dist/img/icon/ligth-bulb.svg +1 -0
  43. package/{public/img → dist/img/icon}/minus.svg +1 -1
  44. package/dist/img/icon/note.svg +1 -0
  45. package/dist/img/icon/phone.svg +1 -0
  46. package/dist/img/{plus.svg → icon/plus.svg} +1 -1
  47. package/{public/img → dist/img/icon}/question-mark.svg +2 -2
  48. package/dist/img/icon/search-thin.svg +10 -0
  49. package/dist/img/icon/search.svg +1 -0
  50. package/dist/img/icon/success.svg +1 -0
  51. package/dist/img/icon/user.svg +6 -0
  52. package/dist/img/icon/warning.svg +1 -0
  53. package/dist/img/icon/website.svg +1 -0
  54. package/dist/img/icon/xclose.svg +1 -0
  55. package/dist/js/qc-sdg.min.js +1 -1
  56. package/package.json +11 -3
  57. package/playwright.config.ts +79 -0
  58. package/plugins/buildDevDoc.js +36 -0
  59. package/plugins/buildHtmlDoc.js +43 -0
  60. package/plugins/buildTestFixtures.js +37 -0
  61. package/public/css/qc-doc-sdg.css +4 -67
  62. package/public/css/qc-sdg-design-tokens.css +17 -0
  63. package/public/css/qc-sdg-no-grid.css +2001 -1108
  64. package/public/css/qc-sdg.css +1999 -1106
  65. package/public/img/checkmark.svg +3 -0
  66. package/public/img/question.svg +10 -0
  67. package/public/index.html +3104 -1387
  68. package/public/js/qc-doc-sdg.js +5705 -285
  69. package/public/js/qc-sdg.js +5660 -1415
  70. package/rollup.config.js +67 -41
  71. package/scripts/buildImagesMap.js +85 -0
  72. package/scripts/check-release-note.sh +11 -0
  73. package/scripts/compile-doc.sh +4 -0
  74. package/src/doc/_index.html +100 -0
  75. package/src/doc/_nav.html +53 -0
  76. package/src/doc/_test.html +32 -0
  77. package/src/doc/components/Code.svelte +6 -2
  78. package/src/doc/components/TopNav.svelte +8 -9
  79. package/src/doc/components/color-doc.svelte +1 -1
  80. package/src/doc/ejs/layout/index.ejs +129 -0
  81. package/src/doc/qc-doc-sdg.js +1 -2
  82. package/src/doc/scss/components/_code.scss +1 -1
  83. package/src/doc/scss/jQueryUI/_jquery-ui.autocomplete.scss +1 -0
  84. package/src/doc/scss/qc-doc-sdg.scss +1 -1
  85. package/src/doc/scss/settings/_base.scss +4 -0
  86. package/src/sdg/_components.js +9 -2
  87. package/src/sdg/{components → bases}/Icon/Icon.svelte +13 -6
  88. package/src/sdg/bases/Icon/IconDoc.ejs +129 -0
  89. package/src/sdg/{components → bases}/Icon/IconWC.svelte +3 -1
  90. package/src/sdg/bases/Icon/Test/IconEmbeddedTest.html +1 -0
  91. package/src/sdg/bases/Icon/Test/IconEmbeddedTest.svelte +168 -0
  92. package/src/sdg/bases/Icon/Test/iconTest.html +156 -0
  93. package/src/sdg/bases/Icon/_icon.html +254 -0
  94. package/src/sdg/bases/Icon/_icons.scss +47 -0
  95. package/src/sdg/{scss/base → bases/accessibility}/_accessibility.scss +1 -1
  96. package/src/sdg/bases/colors/_colors.html +112 -0
  97. package/src/sdg/bases/figures/_figure.html +16 -0
  98. package/src/sdg/{scss/base → bases/form}/_form.scss +10 -3
  99. package/src/sdg/bases/grid/_grid.html +118 -0
  100. package/src/sdg/bases/headings/_headings.html +18 -0
  101. package/src/sdg/bases/headings/_headings.scss +25 -0
  102. package/src/sdg/{scss/base → bases/layout}/_layout.scss +1 -4
  103. package/src/sdg/bases/links/_links.html +104 -0
  104. package/src/sdg/bases/links/_links.scss +51 -0
  105. package/src/sdg/bases/lists/_lists.html +27 -0
  106. package/src/sdg/bases/separator/_separator.html +7 -0
  107. package/src/sdg/bases/separator/_separator.scss +5 -0
  108. package/src/sdg/bases/shadings/_shadings.html +14 -0
  109. package/src/sdg/{scss/base → bases/shadings}/_shadings.scss +1 -1
  110. package/src/sdg/bases/typography/_font.html +45 -0
  111. package/src/sdg/bases/typography/_fonts.scss +162 -0
  112. package/src/sdg/bases/typography/_paragraph.html +17 -0
  113. package/src/sdg/bases/typography/_paragraph.scss +33 -0
  114. package/src/sdg/components/Alert/Alert.svelte +2 -5
  115. package/src/sdg/components/Alert/AlertWC.svelte +3 -2
  116. package/src/sdg/components/Alert/_alert.html +110 -0
  117. package/src/sdg/{scss/components → components/Alert}/_alert.scss +1 -1
  118. package/src/sdg/components/Button/Button.svelte +50 -0
  119. package/src/sdg/components/Button/ButtonWC.svelte +36 -0
  120. package/src/sdg/components/Button/Test/buttonTest.html +349 -0
  121. package/src/sdg/components/Button/_button.html +186 -0
  122. package/src/sdg/components/Button/_button.scss +202 -0
  123. package/src/sdg/components/CharCount/_charCount.html +7 -0
  124. package/src/sdg/components/Checkbox/Checkbox.svelte +77 -0
  125. package/src/sdg/components/Checkbox/CheckboxWC.svelte +49 -0
  126. package/src/sdg/components/Checkbox/_checkbox.html +86 -0
  127. package/src/sdg/components/Checkbox/_checkbox.scss +70 -0
  128. package/src/sdg/components/Checkbox/updateInput.svelte.js +23 -0
  129. package/src/sdg/components/ChoiceGroup/ChoiceGroup.svelte +56 -0
  130. package/src/sdg/components/ChoiceGroup/ChoiceGroupWC.svelte +47 -0
  131. package/src/sdg/components/ChoiceGroup/Test/ChoiceGroupeEmbededTest.svelte +261 -0
  132. package/src/sdg/components/ChoiceGroup/Test/checkboxEmbeddedTest.html +1 -0
  133. package/src/sdg/components/ChoiceGroup/Test/checkboxTest.html +253 -0
  134. package/src/sdg/components/ChoiceGroup/Test/radiosEmbeddedTest.html +1 -0
  135. package/src/sdg/components/ChoiceGroup/Test/radiosTest.html +185 -0
  136. package/src/sdg/components/ChoiceGroup/ToggleSwitchGroupWC.svelte +56 -0
  137. package/src/sdg/components/ChoiceGroup/_choiceGroup.html +285 -0
  138. package/src/sdg/components/ChoiceGroup/_choiceGroup.scss +32 -0
  139. package/src/sdg/components/ChoiceGroup/_selectionButton.scss +53 -0
  140. package/src/sdg/components/ChoiceGroup/_selectionButtons.html +130 -0
  141. package/src/sdg/components/DropdownList/DropdownList.svelte +394 -0
  142. package/src/sdg/components/DropdownList/DropdownListButton/DropdownListButton.svelte +43 -0
  143. package/src/sdg/components/DropdownList/DropdownListButton/_dropdownListButton.scss +65 -0
  144. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte +110 -0
  145. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/DropdownListItemsMultiple.svelte +185 -0
  146. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/_dropdownListItemsMultiple.scss +19 -0
  147. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/DropdownListItemsSingle.svelte +136 -0
  148. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/_dropdownListItemsSingle.scss +11 -0
  149. package/src/sdg/components/DropdownList/DropdownListItems/_dropdownListItems.scss +67 -0
  150. package/src/sdg/components/DropdownList/SelectWC.svelte +158 -0
  151. package/src/sdg/components/DropdownList/Test/DropdownListEmbeddedTest.svelte +89 -0
  152. package/src/sdg/components/DropdownList/Test/dropdownListEmbeddedTest.html +1 -0
  153. package/src/sdg/components/DropdownList/Test/dropdownListTest.html +194 -0
  154. package/src/sdg/components/DropdownList/Test/dropdownListTestUtils.js +113 -0
  155. package/src/sdg/components/DropdownList/_dropdownList.scss +73 -0
  156. package/src/sdg/components/DropdownList/_select.html +212 -0
  157. package/src/sdg/components/ExternalLink/ExternalLink.svelte +1 -1
  158. package/src/sdg/components/Fieldset/Fieldset.svelte +73 -0
  159. package/src/sdg/components/Fieldset/_fieldset.scss +95 -0
  160. package/src/sdg/components/FormError/FormError.svelte +51 -0
  161. package/src/sdg/components/FormError/_formError.scss +21 -0
  162. package/src/sdg/components/FormfieldRow/_formfieldRow.html +108 -0
  163. package/src/sdg/components/IconButton/IconButton.svelte +1 -1
  164. package/src/sdg/components/IconButton/_iconButton.scss +14 -0
  165. package/src/sdg/components/Label/Label.svelte +28 -0
  166. package/src/sdg/components/Label/LabelText.svelte +4 -0
  167. package/src/sdg/components/Label/_label.scss +19 -0
  168. package/src/sdg/components/Notice/Notice.svelte +1 -2
  169. package/src/sdg/components/Notice/NoticeWC.svelte +3 -0
  170. package/src/sdg/components/Notice/_notice.html +141 -0
  171. package/src/sdg/{scss/components → components/Notice}/_notice.scss +1 -1
  172. package/src/sdg/components/PivFooter/PivFooter.svelte +8 -9
  173. package/src/sdg/components/PivFooter/PivFooterWC.svelte +6 -14
  174. package/src/sdg/components/PivFooter/_pivFooter.html +153 -0
  175. package/src/sdg/{scss/components → components/PivFooter}/_pivFooter.scss +1 -1
  176. package/src/sdg/components/PivHeader/PivHeader.svelte +47 -53
  177. package/src/sdg/components/PivHeader/PivHeaderWC.svelte +9 -20
  178. package/src/sdg/components/PivHeader/Test/pivHeaderEmbeddedTest.html +1 -0
  179. package/src/sdg/components/PivHeader/Test/pivHeaderEmbeddedTest.svelte +28 -0
  180. package/src/sdg/components/PivHeader/Test/pivHeaderTest.html +43 -0
  181. package/src/sdg/components/PivHeader/_pivHeader.html +221 -0
  182. package/src/sdg/{scss/components → components/PivHeader}/_pivHeader.scss +55 -77
  183. package/src/sdg/components/RadioButton/_radioButton.html +24 -0
  184. package/src/sdg/components/RadioButton/_radioButton.scss +29 -0
  185. package/src/sdg/components/SearchBar/SearchBar.svelte +12 -32
  186. package/src/sdg/components/SearchBar/_searchBar.html +125 -0
  187. package/src/sdg/{scss/components → components/SearchBar}/_searchBar.scss +3 -3
  188. package/src/sdg/components/SearchInput/SearchInput.svelte +26 -4
  189. package/src/sdg/components/SearchInput/SearchInputWC.svelte +3 -1
  190. package/src/sdg/components/SearchInput/_searchInput.html +85 -0
  191. package/src/sdg/{scss/components → components/SearchInput}/_searchInput.scss +27 -2
  192. package/src/sdg/components/TextField/Doc/TextFieldDemo.svelte +143 -0
  193. package/src/sdg/components/TextField/Test/TextFieldEmbededTest.svelte +129 -0
  194. package/src/sdg/components/TextField/Test/textFieldEmbeddedTest.html +1 -0
  195. package/src/sdg/components/TextField/Test/textFieldTest.html +121 -0
  196. package/src/sdg/components/TextField/TextField.svelte +171 -0
  197. package/src/sdg/components/TextField/TextFieldWC.svelte +90 -0
  198. package/src/sdg/components/TextField/_textField.html +218 -0
  199. package/src/sdg/components/TextField/_textField.scss +110 -0
  200. package/src/sdg/components/TextField/textFieldUtils.js +19 -0
  201. package/src/sdg/components/ToTop/ToTop.svelte +2 -4
  202. package/src/sdg/components/ToTop/_toTop.html +45 -0
  203. package/src/sdg/{scss/components → components/ToTop}/_toTop.scss +2 -2
  204. package/src/sdg/components/ToggleSwitch/Test/ToggleSwitchEmbeddedTest.svelte +46 -0
  205. package/src/sdg/components/ToggleSwitch/Test/toggleSwitchEmbeddedTest.html +1 -0
  206. package/src/sdg/components/ToggleSwitch/Test/toggleSwitchTest.html +34 -0
  207. package/src/sdg/components/ToggleSwitch/ToggleSwitch.svelte +34 -0
  208. package/src/sdg/components/ToggleSwitch/ToggleSwitchWC.svelte +66 -0
  209. package/src/sdg/components/ToggleSwitch/_toggleSwitch.html +160 -0
  210. package/src/sdg/components/ToggleSwitch/_toggleSwitch.scss +97 -0
  211. package/src/sdg/components/utils.js +81 -1
  212. package/src/sdg/qc-sdg-test.js +6 -0
  213. package/src/sdg/scss/lib/_functions.scss +10 -2
  214. package/src/sdg/scss/lib/_mixins.scss +63 -26
  215. package/src/sdg/scss/qc-sdg.scss +1 -1
  216. package/src/sdg/scss/qc-sgd-no-grid.scss +30 -18
  217. package/src/sdg/scss/settings/_base.scss +5 -33
  218. package/src/sdg/scss/settings/_images.scss +30 -0
  219. package/src/sdg/scss/settings/_tokens.scss +23 -0
  220. package/src/sdg/scss/utilities/_display.scss +1 -1
  221. package/src/sdg/scss/utilities/_states.scss +13 -0
  222. package/tests/button.spec.ts +11 -0
  223. package/tests/choice-group.spec.ts +36 -0
  224. package/tests/dropdown-list.spec.ts +529 -0
  225. package/tests/icon.spec.ts +19 -0
  226. package/tests/pivHeader.spec.ts +22 -0
  227. package/tests/textfield.spec.ts +21 -0
  228. package/tests/toggle-switch.spec.ts +20 -0
  229. package/dist/img/arrow-up-white.svg +0 -3
  230. package/dist/img/chevron-blue.svg +0 -3
  231. package/dist/img/clipboard.svg +0 -8
  232. package/dist/img/error-white.svg +0 -1
  233. package/dist/img/error.svg +0 -1
  234. package/dist/img/exclamation-white.svg +0 -37
  235. package/dist/img/external-link-white.svg +0 -18
  236. package/dist/img/external-link.svg +0 -10
  237. package/dist/img/facebook.svg +0 -6
  238. package/dist/img/information-white.svg +0 -1
  239. package/dist/img/information.svg +0 -1
  240. package/dist/img/linkedin.svg +0 -5
  241. package/dist/img/loupe-piv-fonce.svg +0 -1
  242. package/dist/img/minus.svg +0 -6
  243. package/dist/img/qc-sprite.svg +0 -1
  244. package/dist/img/question-mark.svg +0 -47
  245. package/dist/img/success-white.svg +0 -1
  246. package/dist/img/success.svg +0 -1
  247. package/dist/img/twitter.svg +0 -8
  248. package/dist/img/warning.svg +0 -1
  249. package/dist/img/xclose-blue.svg +0 -6
  250. package/dist/img/xclose-white.svg +0 -1
  251. package/dist/img/youtube.svg +0 -3
  252. package/public/img/ampoule.svg +0 -1
  253. package/public/img/arrow-up-white.svg +0 -3
  254. package/public/img/chevron-blue.svg +0 -3
  255. package/public/img/chevron-white.svg +0 -3
  256. package/public/img/error-white.svg +0 -1
  257. package/public/img/error.svg +0 -1
  258. package/public/img/external-link-white.svg +0 -18
  259. package/public/img/facebook.svg +0 -6
  260. package/public/img/information-white.svg +0 -1
  261. package/public/img/information.svg +0 -1
  262. package/public/img/linkedin.svg +0 -5
  263. package/public/img/logo-piv-footer-mess.png +0 -0
  264. package/public/img/loupe-piv-droite.svg +0 -1
  265. package/public/img/loupe-piv-fonce.svg +0 -1
  266. package/public/img/note.svg +0 -1
  267. package/public/img/piv-bas-MCE-theme-clair.png +0 -0
  268. package/public/img/piv-bas-MCE-theme-sombre.png +0 -0
  269. package/public/img/piv-logo-pied-de-page.svg +0 -37
  270. package/public/img/plus.svg +0 -6
  271. package/public/img/qc-sprite.svg +0 -1
  272. package/public/img/quebec-logo.svg +0 -13
  273. package/public/img/success-white.svg +0 -1
  274. package/public/img/success.svg +0 -1
  275. package/public/img/twitter.svg +0 -8
  276. package/public/img/warning.svg +0 -1
  277. package/public/img/xclose-blue.svg +0 -6
  278. package/public/img/xclose-white.svg +0 -1
  279. package/public/img/youtube.svg +0 -3
  280. package/src/doc/scss/components/_button.scss +0 -61
  281. package/src/sdg/components/PivFooter/_defaultCopyright.svelte +0 -11
  282. package/src/sdg/components/PivHeader/_defaultLinks.svelte +0 -24
  283. package/src/sdg/components/QcCustomElement.js +0 -10
  284. package/src/sdg/scss/base/_fonts.scss +0 -29
  285. package/src/sdg/scss/base/_typography.scss +0 -94
  286. package/src/sdg/scss/components/_icons.scss +0 -169
  287. package/src/sdg/scss/components/_separator.scss +0 -5
  288. /package/dist/img/{loupe-piv-droite.svg → piv-search.svg} +0 -0
  289. /package/src/sdg/{scss/base → bases/colors}/_colors.scss +0 -0
  290. /package/src/sdg/{scss/base → bases/figures}/_figure.scss +0 -0
  291. /package/src/sdg/{scss → bases}/grid/_grid-lib.scss +0 -0
  292. /package/src/sdg/{scss → bases}/grid/_grid.scss +0 -0
  293. /package/src/sdg/{scss/base → bases/lists}/_lists.scss +0 -0
package/rollup.config.js CHANGED
@@ -4,23 +4,28 @@ import css from 'rollup-plugin-css-only'
4
4
  import sveltePreprocess from 'svelte-preprocess';
5
5
  import commonjs from '@rollup/plugin-commonjs'
6
6
  import terser from '@rollup/plugin-terser';
7
- // import scss from 'rollup-plugin-sass'
8
7
  import scss from 'rollup-plugin-scss'
9
- import copy from 'rollup-plugin-copy'
10
8
  import replace from '@rollup/plugin-replace';
11
9
  import postcss from 'postcss'
12
- import autoprefixer from 'autoprefixer'
13
10
  import cssReplace from 'postcss-replace'
14
11
  import pkg from './package.json';
15
12
  import fs from "fs";
13
+ import buildHtmlDoc from './plugins/buildHtmlDoc.js';
14
+ import buildDevDoc from "./plugins/buildDevDoc"; // adapte le chemin si besoin
15
+ import buildTestFixtures from "./plugins/buildTestFixtures";
16
16
 
17
17
 
18
- const dev_process = (process.env.npm_lifecycle_event == 'dev');
18
+ const
19
+ dev_process = (process.env.npm_lifecycle_event == 'dev'),
20
+ version_process = (process.env.npm_lifecycle_event == 'version'),
21
+ build_process = (process.env.npm_lifecycle_event == 'build')
22
+ ;
19
23
  const verbose = false;
20
24
  const includePaths = [
25
+ dev_process && 'src/doc/scss',
21
26
  'src/sdg/scss',
22
- 'src/doc/scss'
23
- ];
27
+ "src",
28
+ ].filter(Boolean);
24
29
 
25
30
  // const path = require('path');
26
31
 
@@ -57,10 +62,10 @@ const scssOptions = {
57
62
  includePaths: includePaths,
58
63
  processor: css =>
59
64
  postcss([
60
- autoprefixer(),
61
65
  cssReplace({
62
66
  data: {
63
- 'pkg-version': pkg.version
67
+ 'pkg-version': pkg.version,
68
+ 'dev-env': dev_process ? 'true' : 'false',
64
69
  }
65
70
  })
66
71
  ])
@@ -73,8 +78,8 @@ const scssOptions = {
73
78
  prependData: `
74
79
  @use "qc-sdg-lib" as *;
75
80
  `,
76
- outputStyle: dev_process ? 'expanded' : 'compressed',
77
- watch: ['src/sdg/scss', 'src/doc/scss'],
81
+ outputStyle: build_process ? 'compressed' : 'expanded',
82
+ watch: ['src'],
78
83
  silenceDeprecations: ['legacy-js-api'],
79
84
  };
80
85
 
@@ -105,9 +110,9 @@ let
105
110
  // This `main.js` file we wrote
106
111
  input: 'src/sdg/qc-sdg.js',
107
112
  output: {
108
- file: dev_process
109
- ? 'public/js/qc-sdg.js'
110
- : 'dist/js/qc-sdg.min.js',
113
+ file: build_process
114
+ ? 'dist/js/qc-sdg.min.js'
115
+ : 'public/js/qc-sdg.js',
111
116
  format: 'iife',
112
117
  name: 'qcSdg',
113
118
  },
@@ -123,34 +128,27 @@ let
123
128
  }),
124
129
  commonjs(),
125
130
  // compress js only when build
126
- !dev_process && terser(),
131
+ build_process && terser(),
127
132
 
128
133
  // will output compiled styles to output.css
129
134
  scss(Object.assign({
130
135
  output: (styles, styleNodes) => {
131
- fs.writeFileSync( dev_process
132
- ? 'public/css/qc-sdg.css'
133
- : 'dist/css/qc-sdg.min.css'
136
+ fs.writeFileSync(
137
+ build_process
138
+ ? 'dist/css/qc-sdg.min.css'
139
+ : 'public/css/qc-sdg.css'
134
140
  , styles)
135
141
  }}
136
142
  , scssOptions
137
143
  )),
138
- !dev_process && copy({
139
- targets: [
140
- {
141
- src: 'dist/img/*',
142
- dest: [`public/img`],
143
- }
144
- ],
145
- verbose: verbose,
146
- }),
144
+
147
145
  ],
148
146
  },
149
147
  {
150
148
  // qc-sdg without grid system
151
149
  input: 'src/sdg/qc-sdg-no-grid.js',
152
150
  output: {
153
- file: (dev_process ? 'public': 'dist') + '/js/qc-sdg-no-grid.js',
151
+ file: (build_process ? 'dist' : 'public') + '/js/qc-sdg-no-grid.js',
154
152
  format: 'iife',
155
153
  },
156
154
  plugins: [
@@ -165,9 +163,10 @@ let
165
163
  // will output compiled styles to output.css
166
164
  scss(Object.assign({
167
165
  output: (styles, styleNodes) => {
168
- fs.writeFileSync( dev_process
169
- ? 'public/css/qc-sdg-no-grid.css'
170
- : 'dist/css/qc-sdg-no-grid.min.css'
166
+ fs.writeFileSync(
167
+ build_process
168
+ ? 'dist/css/qc-sdg-no-grid.min.css'
169
+ : 'public/css/qc-sdg-no-grid.css'
171
170
  , styles)
172
171
  }
173
172
  }
@@ -188,22 +187,22 @@ let
188
187
  }),
189
188
  scss(Object.assign({
190
189
  output: (styles, styleNodes) => {
191
- fs.writeFileSync( dev_process
192
- ? 'public/css/qc-sdg-design-tokens.css'
193
- : 'dist/css/qc-sdg-design-tokens.min.css'
190
+ fs.writeFileSync(
191
+ build_process
192
+ ? 'dist/css/qc-sdg-design-tokens.min.css'
193
+ : 'public/css/qc-sdg-design-tokens.css'
194
194
  , styles)
195
195
  }
196
196
  }
197
197
  , scssOptions
198
198
  )),
199
199
  ],
200
- },
201
-
200
+ }
202
201
  ]
203
202
  ;
204
203
 
205
204
 
206
- if (dev_process) {
205
+ if (!build_process) {
207
206
  rollupOptions.unshift({
208
207
  input: 'src/doc/qc-doc-sdg.js',
209
208
  output: {
@@ -212,6 +211,16 @@ if (dev_process) {
212
211
  },
213
212
  plugins: [
214
213
  replace(replacements),
214
+ buildHtmlDoc({
215
+ input: 'src/doc/_index.html',
216
+ output: 'public/index.html'
217
+ }),
218
+ buildDevDoc({
219
+ input: 'src/doc/_dev.html'
220
+ }),
221
+ buildTestFixtures({
222
+ input: 'src/doc/_test.html'
223
+ }),
215
224
  svelte(svelteOptions),
216
225
  resolve({
217
226
  browser: true,
@@ -221,20 +230,37 @@ if (dev_process) {
221
230
  scss(
222
231
  Object.assign({
223
232
  output: (styles, styleNodes) => {
224
- fs.writeFileSync( dev_process
225
- ? 'public/css/qc-doc-sdg.css'
226
- : 'dist/css/qc-doc-sdg.min.css'
233
+ fs.writeFileSync(
234
+ 'public/css/qc-doc-sdg.css'
227
235
  , styles)
228
236
  }},
229
237
  scssOptions
230
238
  )
231
239
  ),
232
240
  css(),
233
- serve(),
241
+ dev_process && serve(),
234
242
  //uncomment to enable the Hot Reload,
235
243
  // livereload('public'),
236
244
  ],
237
- },)
245
+ },
246
+ {
247
+ // token only css file
248
+ input: 'src/sdg/qc-sdg-test.js',
249
+ output: {
250
+ file: 'public/js/qc-sdg-test.js',
251
+ format: 'iife',
252
+ },
253
+ plugins: [
254
+ svelte(svelteOptions),
255
+ resolve({
256
+ browser: true,
257
+ // Force resolving for these modules to root's node_modules that helps
258
+ // to prevent bundling the same package multiple times if package is
259
+ // imported from dependencies.
260
+ dedupe: ['svelte']
261
+ }),
262
+ ],
263
+ },)
238
264
  }
239
265
 
240
266
  export default rollupOptions;
@@ -0,0 +1,85 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const ejs = require('ejs');
4
+
5
+
6
+
7
+ const settings = {
8
+ inputDir: path.resolve('dist/img/icon'),
9
+ output: path.resolve('src/sdg/scss/settings/_images.scss'),
10
+ exclude: ["QUEBEC_blanc","QUEBEC_couleur"]
11
+ }
12
+
13
+ try {
14
+
15
+ // Lit tous les fichiers SVG du dossier source
16
+ const files = fs.readdirSync(settings.inputDir);
17
+ const svgFiles = {};
18
+ let fileNames = [];
19
+
20
+ files.forEach(file => {
21
+ if (path.extname(file).toLowerCase() === '.svg') {
22
+ const filePath = path.join(settings.inputDir, file);
23
+ const name = path.basename(file, '.svg');
24
+ if (settings.exclude.includes(name)) return;
25
+ fileNames.push(name);
26
+ const content = fs.readFileSync(filePath, 'base64');
27
+ svgFiles[name] = content;
28
+ }
29
+ });
30
+
31
+ // Génère et écrit le fichier SCSS
32
+ const scssContent = generateScssContent(svgFiles);
33
+ fs.writeFileSync(settings.output, scssContent, 'utf8');
34
+
35
+
36
+ // Génération de la documentation HTML des icônes
37
+ const ejsFilePath = 'src/sdg/bases/Icon/IconDoc.ejs';
38
+ // chemin du partiel
39
+ const htmlFilePath = 'src/sdg/bases/Icon/_icon.html';
40
+
41
+ // Lecture du template EJS
42
+ fs.readFile(ejsFilePath, 'utf-8', (err, ejsTemplate) => {
43
+ if (err) {
44
+ console.error("Erreur lors de la lecture du fichier EJS :", err);
45
+ return;
46
+ }
47
+
48
+ // Rendu du template EJS avec les données
49
+ const renderedHtml = ejs.render(ejsTemplate, {icons: fileNames});
50
+
51
+ // Écriture du résultat dans un fichier HTML
52
+ fs.writeFile(htmlFilePath, renderedHtml, (err) => {
53
+ if (err) {
54
+ console.error("Erreur lors de l'écriture du fichier HTML :", err);
55
+ return;
56
+ }
57
+ console.log(`Le fichier ${htmlFilePath} a été généré avec succès.`);
58
+ });
59
+ });
60
+
61
+
62
+ console.log('\x1b[32m%s\x1b[0m', `✓ Fichier ${settings.output} généré avec succès !`);
63
+ console.log('\x1b[36m%s\x1b[0m', ` → ${Object.keys(svgFiles).length} images SVG traitées.`);
64
+
65
+ } catch (error) {
66
+ console.error('\x1b[31m%s\x1b[0m', '✗ Erreur lors de la génération du fichier :');
67
+ console.error('\x1b[31m%s\x1b[0m', ` → ${error.message}`);
68
+ process.exit(1);
69
+ }
70
+ /**
71
+ * Génère le contenu du fichier SCSS avec la map des images
72
+ * @param {Object} svgFiles - Objet contenant les paires nom/contenu base64 des SVG
73
+ * @returns {string} Contenu formaté du fichier SCSS
74
+ */
75
+ function generateScssContent(svgFiles) {
76
+ let content = '// Ce fichier est généré automatiquement. Ne pas modifier directement.\n\n';
77
+ content += '$images: (\n';
78
+
79
+ for (const [name, base64] of Object.entries(svgFiles)) {
80
+ content += ` ${name}: '${base64}',\n`;
81
+ }
82
+
83
+ content = content.slice(0, -2) + '\n);';
84
+ return content;
85
+ }
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+
3
+ echo "Avez-vous ajouté une note de version ? (o/n)"
4
+ read reponse
5
+
6
+ if [ "$reponse" != "o" ] && [ "$reponse" != "O" ]; then
7
+ echo "Versionnage annulé. Merci d'ajouter une note de version."
8
+ exit 1
9
+ fi
10
+
11
+ echo "Merci ! On continue le versionnage..."
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+
3
+ rollup -c --bundleConfigAsCjs \
4
+ && git add public/js/qc-doc-sdg.js
@@ -0,0 +1,100 @@
1
+ <!DOCTYPE html>
2
+ <!--suppress ALL -->
3
+ <html lang="fr">
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport"
7
+ content="width=device-width, initial-scale=1.0">
8
+ <link rel="stylesheet"
9
+ href="css/qc-sdg.css">
10
+ <link rel="stylesheet"
11
+ href="css/qc-doc-sdg.css">
12
+ <title>Documentation technique du Système de design gouvernemental</title>
13
+ <script defer
14
+ src='js/qc-sdg.js'
15
+ sdg-css-filename="qc-sdg.css">
16
+ </script>
17
+ <script defer
18
+ src='js/qc-doc-sdg.js'
19
+ sdg-css-filename="qc-doc-sdg.css">
20
+ </script>
21
+ </head>
22
+ <body>
23
+ <header>
24
+ <qc-piv-header id="pivEntete"
25
+ title-text="Trousse de développement du Système de design gouvernemental"
26
+ alt-logo="Signature du gouvernement du Québec. Accédez au Système de design gouvernemental.">
27
+ </qc-piv-header>
28
+ </header>
29
+ <qc-doc-top-nav></qc-doc-top-nav>
30
+ <div class="qc-container">
31
+ <!-- _nav.html -->
32
+ </div>
33
+ <main id="main">
34
+ <div class="qc-container">
35
+ <hr/>
36
+ <!-- _colors.html -->
37
+
38
+ <hr/>
39
+
40
+ <!-- grille horizontale -->
41
+ <!-- _grid.html -->
42
+ <hr/>
43
+ <!-- _figure.html -->
44
+ <hr/>
45
+ <!-- _icon.html -->
46
+ <hr/>
47
+ <!-- _links.html -->
48
+ <hr/>
49
+ <!-- _lists.html -->
50
+ <hr/>
51
+ <!-- _headings.html -->
52
+ <hr/>
53
+ <!-- _shadings.html -->
54
+ <hr/>
55
+ <!-- _paragraph.html -->
56
+ <hr/>
57
+ <!-- _font.html -->
58
+ <hr/>
59
+ <!-- _separator.html -->
60
+ <hr/>
61
+ <!-- _alert.html -->
62
+ <hr/>
63
+ <!-- _notice.html -->
64
+ <hr/>
65
+ <!-- _searchBar.html -->
66
+ <hr/>
67
+ <!-- _button.html -->
68
+ <hr/>
69
+ <h2 id="formulaires">Formulaires</h2>
70
+ <h3 id="radios-checkboxes">Boutons radios et cases à cocher</h3>
71
+ <!-- _choiceGroup.html -->
72
+ <hr/>
73
+ <!-- _checkbox.html -->
74
+ <hr/>
75
+ <!-- _selectionButtons.html -->
76
+ <hr/>
77
+ <!-- _textField.html -->
78
+ <hr/>
79
+ <!-- _searchInput.html -->
80
+ <hr/>
81
+ <!-- _toggleSwitch.html -->
82
+ <hr/>
83
+ <!-- _select.html -->
84
+ <hr/>
85
+ <!-- _formfieldRow.html -->
86
+ <hr/>
87
+ <!-- _toTop.html -->
88
+ <hr/>
89
+ <!-- _pivHeader.html -->
90
+ <hr/>
91
+ <!-- _pivFooter.html -->
92
+ <hr/>
93
+ </div>
94
+ </main>
95
+ <footer>
96
+ <qc-piv-footer></qc-piv-footer>
97
+ </footer>
98
+ <script src='js/qc-doc-exemple.js'></script>
99
+ </body>
100
+ </html>
@@ -0,0 +1,53 @@
1
+ <h1>
2
+ <span class="qc-subhead" id="version"></span>
3
+ Documentation technique
4
+ </h1>
5
+ <nav class="main-menu"
6
+ aria-label="Navigation principale">
7
+ <h2 class="qc-h4">Bases</h2>
8
+ <ul>
9
+ <li><a href='#couleurs'>Couleurs</a></li>
10
+ <li><a href='#grille'>Grille horizontale (grille de 8 px)</a></li>
11
+ <li><a href='#images'>Images</a></li>
12
+ <li><a href="#icons">Iconographie</a></li>
13
+ <li><a href='#liens'>Liens</a></li>
14
+ <li><a href='#liste'>Liste</a></li>
15
+ <li><a href='#titre'>Niveaux de titres</a></li>
16
+ <li><a href='#ombrages'>Ombrages</a></li>
17
+ <li><a href='#paragraphes'>Paragraphes</a></li>
18
+ <li><a href='#polices'>Polices de caractères</a></li>
19
+ <li><a href='#separator'>Séparateur</a></li>
20
+ </ul>
21
+ <h2 class="qc-h4">Composants</h2>
22
+ <ul>
23
+ <li><a href='#alert'>Alerte générale</a></li>
24
+ <li><a href='#notice'>Avis</a></li>
25
+ <li><a href='#search-bar'>Barre de recherche</a></li>
26
+ <li><a href='#buttons'>Boutons</a></li>
27
+ <li>
28
+ <a href='#formulaires'>Formulaires</a>
29
+ <ul>
30
+ <li><a href="#radios-checkboxes">Boutons radio, cases à cocher et boutons de sélection</a>
31
+ <ul>
32
+ <li><a href="#choice-group">Groupe de boutons radio et de cases à cocher</a></li>
33
+ <li><a href="#checkbox">Case à cocher unique</a></li>
34
+ <li><a href="#selection-button">Boutons de sélection</a></li>
35
+ </ul>
36
+ </li>
37
+ <li><a href="#textfield">Champ texte</a></li>
38
+ <li><a href="#search-input">Champ de recherche</a></li>
39
+ <li><a href="#toggle-switch">Commutateur</a></li>
40
+ <li><a href="#select">Liste déroulante</a></li>
41
+ <li><a href="#champs-alignes">Champs alignés horizontalement</a></li>
42
+ </ul>
43
+
44
+ </li>
45
+ <li><a href="#toTop">Haut de page</a></li>
46
+ </ul>
47
+ <h2 class="qc-h4">Modèles</h2>
48
+ <ul>
49
+ <li><a href='#piv-header'>Bandeau d’en-tête du PIV</a>
50
+ <li><a href='#piv-footer'>Pied de page du PIV</a>
51
+ </ul>
52
+
53
+ </nav>
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport"
6
+ content="width=device-width, initial-scale=1.0">
7
+ <link rel="stylesheet"
8
+ href="css/qc-sdg.css">
9
+ <link rel="stylesheet"
10
+ href="css/qc-doc-sdg.css">
11
+ <title>Documentation technique du Système de design gouvernemental</title>
12
+ <script defer
13
+ src='js/qc-sdg.js'
14
+ sdg-css-filename="qc-sdg.css">
15
+ </script>
16
+ <script defer
17
+ src='js/qc-doc-sdg.js'
18
+ sdg-css-filename="qc-doc-sdg.css">
19
+ </script>
20
+ </head>
21
+ <body>
22
+ <main id="main">
23
+ <div class="qc-container">
24
+ <!-- _partial.html -->
25
+ </div>
26
+ </main>
27
+ <script src='js/qc-doc-exemple.js'></script>
28
+ <script src='js/qc-sdg-test.js'
29
+ sdg-css-filename="qc-sdg.css"
30
+ ></script>
31
+ </body>
32
+ </html>
@@ -12,6 +12,7 @@
12
12
 
13
13
  import {HighlightJS} from "highlight.js"
14
14
  import pretty from "pretty";
15
+ import jsBeautify from "js-beautify";
15
16
 
16
17
  let {
17
18
  targetId = '',
@@ -39,7 +40,10 @@
39
40
  . replace('/qc-hash-.*/g', '')
40
41
  . replace('/is-external=""/g', 'is-external')
41
42
  ;
42
- prettyCode = pretty(rawCode, {wrap_attributes: 'force-aligned'});
43
+ // prettyCode = pretty(rawCode, prettyOptions);
44
+ prettyCode = language === 'javascript'
45
+ ? jsBeautify(rawCode)
46
+ : pretty(rawCode, {wrap_attributes: 'force-aligned'});
43
47
  hlCode = HighlightJS.highlight(prettyCode, {language:language}).value;
44
48
  }
45
49
 
@@ -49,7 +53,7 @@
49
53
 
50
54
  <pre
51
55
  ><code class="hljs"
52
- ><button class="btn btn-sm btn-primary"
56
+ ><button class="qc-button qc-compact qc-primary"
53
57
  onclick={copy}>
54
58
  <span class="copy">copier</span>
55
59
  <span class="copied">copié !</span>
@@ -1,12 +1,11 @@
1
1
  <svelte:options customElement="{{
2
2
  tag: 'qc-doc-top-nav',
3
3
  shadow: 'none',
4
- props: {
5
-
6
- }
4
+ props: {}
7
5
  }}" />
6
+
8
7
  <script>
9
- import Switch from "./Switch.svelte";
8
+ import ToggleSwitch from "../../sdg/components/ToggleSwitch/ToggleSwitch.svelte";
10
9
  let value = $state(localStorage.getItem('dark-theme') === "true");
11
10
 
12
11
  $effect(() => {
@@ -18,13 +17,15 @@
18
17
  <div role="complementary">
19
18
  <div class="qc-container top-nav">
20
19
  <div class="switch-control">
21
- <label for="switch">Activer le thème sombre</label>
22
- <Switch id="switch" bind:value />
20
+ <ToggleSwitch
21
+ label="Activer le thème sombre"
22
+ bind:checked={value}
23
+ />
23
24
  </div>
24
25
  </div>
25
26
  </div>
26
- <style lang="scss">
27
27
 
28
+ <style lang="scss">
28
29
  [role=complementary] {
29
30
  position: sticky;
30
31
  z-index: 100;
@@ -51,6 +52,4 @@
51
52
  }
52
53
  }
53
54
  }
54
-
55
-
56
55
  </style>
@@ -22,7 +22,7 @@
22
22
  </div>
23
23
  </div>
24
24
  <style lang="scss">
25
- @use "base/colors";
25
+ @use "sdg/bases/colors/colors" as *;
26
26
  .color-details {
27
27
  display: flex;
28
28
  justify-content: flex-start;