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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +26 -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 +1991 -1108
  64. package/public/css/qc-sdg.css +1992 -1109
  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 +40847 -33699
  69. package/public/js/qc-sdg.js +6037 -757
  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 +42 -0
  143. package/src/sdg/components/DropdownList/DropdownListButton/_dropdownListButton.scss +55 -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 +173 -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-svelte.spec.ts +28 -0
  228. package/tests/textfield.spec.ts +37 -0
  229. package/tests/toggle-switch.spec.ts +20 -0
  230. package/dist/img/arrow-up-white.svg +0 -3
  231. package/dist/img/chevron-blue.svg +0 -3
  232. package/dist/img/clipboard.svg +0 -8
  233. package/dist/img/error-white.svg +0 -1
  234. package/dist/img/error.svg +0 -1
  235. package/dist/img/exclamation-white.svg +0 -37
  236. package/dist/img/external-link-white.svg +0 -18
  237. package/dist/img/external-link.svg +0 -10
  238. package/dist/img/facebook.svg +0 -6
  239. package/dist/img/information-white.svg +0 -1
  240. package/dist/img/information.svg +0 -1
  241. package/dist/img/linkedin.svg +0 -5
  242. package/dist/img/loupe-piv-fonce.svg +0 -1
  243. package/dist/img/minus.svg +0 -6
  244. package/dist/img/qc-sprite.svg +0 -1
  245. package/dist/img/question-mark.svg +0 -47
  246. package/dist/img/success-white.svg +0 -1
  247. package/dist/img/success.svg +0 -1
  248. package/dist/img/twitter.svg +0 -8
  249. package/dist/img/warning.svg +0 -1
  250. package/dist/img/xclose-blue.svg +0 -6
  251. package/dist/img/xclose-white.svg +0 -1
  252. package/dist/img/youtube.svg +0 -3
  253. package/public/img/ampoule.svg +0 -1
  254. package/public/img/arrow-up-white.svg +0 -3
  255. package/public/img/chevron-blue.svg +0 -3
  256. package/public/img/chevron-white.svg +0 -3
  257. package/public/img/error-white.svg +0 -1
  258. package/public/img/error.svg +0 -1
  259. package/public/img/external-link-white.svg +0 -18
  260. package/public/img/facebook.svg +0 -6
  261. package/public/img/information-white.svg +0 -1
  262. package/public/img/information.svg +0 -1
  263. package/public/img/linkedin.svg +0 -5
  264. package/public/img/logo-piv-footer-mess.png +0 -0
  265. package/public/img/loupe-piv-droite.svg +0 -1
  266. package/public/img/loupe-piv-fonce.svg +0 -1
  267. package/public/img/note.svg +0 -1
  268. package/public/img/piv-bas-MCE-theme-clair.png +0 -0
  269. package/public/img/piv-bas-MCE-theme-sombre.png +0 -0
  270. package/public/img/piv-logo-pied-de-page.svg +0 -37
  271. package/public/img/plus.svg +0 -6
  272. package/public/img/qc-sprite.svg +0 -1
  273. package/public/img/quebec-logo.svg +0 -13
  274. package/public/img/success-white.svg +0 -1
  275. package/public/img/success.svg +0 -1
  276. package/public/img/twitter.svg +0 -8
  277. package/public/img/warning.svg +0 -1
  278. package/public/img/xclose-blue.svg +0 -6
  279. package/public/img/xclose-white.svg +0 -1
  280. package/public/img/youtube.svg +0 -3
  281. package/src/doc/scss/components/_button.scss +0 -61
  282. package/src/sdg/components/PivFooter/_defaultCopyright.svelte +0 -11
  283. package/src/sdg/components/PivHeader/_defaultLinks.svelte +0 -24
  284. package/src/sdg/components/QcCustomElement.js +0 -10
  285. package/src/sdg/scss/base/_fonts.scss +0 -29
  286. package/src/sdg/scss/base/_typography.scss +0 -94
  287. package/src/sdg/scss/components/_icons.scss +0 -169
  288. package/src/sdg/scss/components/_separator.scss +0 -5
  289. /package/dist/img/{loupe-piv-droite.svg → piv-search.svg} +0 -0
  290. /package/src/sdg/{scss/base → bases/colors}/_colors.scss +0 -0
  291. /package/src/sdg/{scss/base → bases/figures}/_figure.scss +0 -0
  292. /package/src/sdg/{scss → bases}/grid/_grid-lib.scss +0 -0
  293. /package/src/sdg/{scss → bases}/grid/_grid.scss +0 -0
  294. /package/src/sdg/{scss/base → bases/lists}/_lists.scss +0 -0
@@ -67,7 +67,7 @@ onMount(() => {
67
67
  }
68
68
 
69
69
  const prefix = match[1] || "";
70
- const lastWord = match[2];
70
+ const lastWord = match[2].replace(/([\/\-\u2013\u2014])/g, "$1<wbr>");
71
71
 
72
72
  // Crée un span avec white-space: nowrap pour empêcher le saut de ligne de l'image de lien externe
73
73
  const span = document.createElement('span');
@@ -0,0 +1,73 @@
1
+ <script>
2
+ import FormError from '../FormError/FormError.svelte';
3
+ import { onMount } from 'svelte';
4
+ import {Utils} from "../utils";
5
+ import LabelText from "../Label/LabelText.svelte";
6
+
7
+ let {
8
+ legend,
9
+ name,
10
+ selectionButton = false,
11
+ inline = false,
12
+ columnCount = 1,
13
+ compact,
14
+ required = false,
15
+ disabled,
16
+ invalid = $bindable(false),
17
+ invalidText,
18
+ onchange = () => {},
19
+ elementsGap = "sm",
20
+ maxWidth = "fit-content",
21
+ children,
22
+ rootElement = $bindable(),
23
+ } = $props();
24
+
25
+ let groupSelection = $state(),
26
+ legendId = name
27
+ ? "id_" + name
28
+ : Utils.generateId("legend");
29
+ </script>
30
+ {#snippet fieldset()}
31
+ <fieldset bind:this={rootElement}
32
+ class={[
33
+ "qc-choice-group",
34
+ "qc-fieldset",
35
+ compact && "qc-compact",
36
+ disabled && "qc-disabled"]}
37
+ aria-describedby={legendId}
38
+ {onchange}
39
+ selection-button={selectionButton ? selectionButton : undefined}
40
+ inline={inline ? inline : undefined}
41
+ >
42
+ {#if legend}
43
+ <legend id={legendId}>
44
+ <LabelText text={legend} {required} />
45
+ </legend>
46
+ {/if}
47
+ <div
48
+ class={[
49
+ selectionButton && !inline && "qc-field-elements-selection-button",
50
+ selectionButton && inline && "qc-field-elements-selection-button-flex-row",
51
+ !selectionButton && "qc-field-elements-flex",
52
+ !selectionButton && `qc-field-elements-flex-${elementsGap}`,
53
+ ]}
54
+ style="
55
+ --column-count: {columnCount};
56
+ --fieldset-width: {maxWidth};
57
+ "
58
+ bind:this={groupSelection}
59
+ >
60
+ {@render children?.()}
61
+ </div>
62
+ <FormError {invalid} {invalidText} label={legend} />
63
+
64
+ </fieldset>
65
+ {/snippet}
66
+
67
+ {#if !invalid}
68
+ {@render fieldset()}
69
+ {:else}
70
+ <div class="qc-fieldset-invalid">
71
+ {@render fieldset()}
72
+ </div>
73
+ {/if}
@@ -0,0 +1,95 @@
1
+ @use "qc-sdg-lib" as *;
2
+
3
+ .qc-fieldset {
4
+ border: none;
5
+ padding: 0;
6
+ margin: 0 0 rem(32);
7
+ justify-items: start;
8
+ legend {
9
+ font-weight: token-value(font weight content bold);
10
+ display: inline-block;
11
+ margin-bottom: token-value(spacer, md);
12
+ }
13
+ &.qc-compact {
14
+ margin-bottom: token-value(spacer, sm);
15
+ legend {
16
+ margin-bottom: token-value(spacer, sm);
17
+ }
18
+ }
19
+ }
20
+
21
+ $invalid-offset: token-value(spacer, xs);
22
+ $invalid-border-width: 2px;
23
+ .qc-fieldset-invalid {
24
+ border-left: $invalid-border-width solid token-value(color, red, regular);
25
+ padding-left: $invalid-offset;
26
+ }
27
+
28
+ %selection-button-gap {
29
+ gap: token-value(spacer, xs);
30
+ }
31
+
32
+ .qc-field-elements-selection-button-flex-row {
33
+ @extend %selection-button-gap;
34
+ display: inline-flex;
35
+ flex-wrap: wrap;
36
+
37
+ .qc-check-row-parent {
38
+ flex-grow: 0;
39
+ }
40
+ }
41
+
42
+ .qc-field-elements-selection-button {
43
+ @extend %selection-button-gap;
44
+ display: inline-grid;
45
+ grid-template-columns: repeat(var(--column-count), 1fr);
46
+
47
+ @include media-mobile() {
48
+ grid-template-columns: 1fr;
49
+ }
50
+
51
+ & > .qc-selection-button {
52
+ width: 100%
53
+ }
54
+ }
55
+
56
+ .qc-field-elements-flex {
57
+ display: flex;
58
+ flex-direction: column;
59
+ max-width: var(--fieldset-width);
60
+
61
+ .qc-switch-label {
62
+ flex-grow: 1;
63
+ }
64
+ }
65
+
66
+ .qc-field-elements-flex-sm {
67
+ gap: token-value(spacer, sm);
68
+ }
69
+
70
+ .qc-field-elements-flex-md {
71
+ gap: token-value(spacer, md);
72
+ }
73
+
74
+ .qc-formfield-row {
75
+ display: flex;
76
+ gap: 0 rem(32);
77
+ flex-wrap: wrap;
78
+ margin-bottom: rem(32);
79
+ margin-top: rem(-8);
80
+
81
+ > .qc-form-error {
82
+ width: 100%;
83
+ }
84
+ qc-textfield,
85
+ .qc-textfield {
86
+ margin-top: token-value(spacer, xs);
87
+ display: block;
88
+ width: auto;
89
+ margin-bottom: 0;
90
+ }
91
+ .qc-dropdown-list-root {
92
+ margin-top: token-value(spacer, xs);
93
+ margin-bottom: 0;
94
+ }
95
+ }
@@ -0,0 +1,51 @@
1
+ <script>
2
+ import Icon from "../../bases/Icon/Icon.svelte";
3
+ import {onMount, tick} from "svelte";
4
+ import {Utils} from "../utils";
5
+
6
+ const lang = Utils.getPageLanguage();
7
+
8
+ let {invalid ,
9
+ label = '',
10
+ invalidText,
11
+ id = $bindable(),
12
+ extraClasses = [],
13
+ rootElement = $bindable(),
14
+ } = $props();
15
+
16
+ let cleanLabel = $derived(label.replace(/:\s*$/, '')),
17
+ defaultInvalidText = $derived(
18
+ label
19
+ ? lang === 'fr'
20
+ ? `Le champ ${cleanLabel} est obligatoire.`
21
+ : `${cleanLabel} field is required.`
22
+ : lang === 'fr'
23
+ ? `Ce champ est obligatoire.`
24
+ : `This field is required.`
25
+ )
26
+ ;
27
+
28
+ onMount(() => {
29
+ if (id) return;
30
+ id = Utils.generateId('qc-form-error')
31
+ })
32
+
33
+ </script>
34
+ {#if invalid}
35
+ <div {id}
36
+ bind:this={rootElement}
37
+ class={['qc-form-error', ...extraClasses]}
38
+ role="alert">
39
+ {#await tick()}
40
+ <!-- svelte-ignore block_empty -->
41
+ {:then _}
42
+ <Icon
43
+ type="warning"
44
+ color="red-regular"
45
+ width="var(--error-icon-width)"
46
+ height="var(--error-icon-height)"
47
+ />
48
+ <span>{@html invalidText ? invalidText : defaultInvalidText}</span>
49
+ {/await}
50
+ </div>
51
+ {/if}
@@ -0,0 +1,21 @@
1
+ @use "../../scss/qc-sdg-lib" as *;
2
+
3
+ .qc-form-error {
4
+ display: flex;
5
+ color: token-value(color, red, regular);
6
+ align-items: start;
7
+ font-weight: token-value(font weight content medium);
8
+ margin-top: token-value(spacer, sm);
9
+ .qc-icon {
10
+ display: flex;
11
+ align-items: center;
12
+ margin-right: token-value(spacer, xs);
13
+ --error-icon-width: #{rem(24)}!important;
14
+ --error-icon-height: #{rem(21)}!important;
15
+ }
16
+ &.qc-xs-mt {
17
+ margin-top: token-value(spacer, xs);
18
+ }
19
+ }
20
+
21
+
@@ -0,0 +1,108 @@
1
+ <h3 id="champs-alignes">Champs alignés horizontalement (classe <code>qc‑textfield‑row</code>)</h3>
2
+
3
+ <p>Les champs regroupés sur une ligne doivent être placés dans un div avec la classe <code>qc-textfield-row</code> pour correctement afficher les messages d’erreur en cas de soumission invalide.</p>
4
+
5
+ <h4>Exemple</h4>
6
+ <qc-doc-exemple caption="Exemple de champs sur une seule ligne">
7
+ <form id="formulaire-champ-alignes">
8
+ <div class="qc-formfield-row">
9
+ <qc-textfield
10
+ label="Téléphone"
11
+ size="sm"
12
+ required
13
+ ><input type="text"
14
+ name="telephone"
15
+ placeholder="(123) 456-7890"
16
+ /></qc-textfield>
17
+
18
+ <qc-textfield
19
+ label="Poste"
20
+ size="xs"
21
+ required
22
+ >
23
+ <input type="text"
24
+ name="poste"
25
+ />
26
+ </qc-textfield>
27
+ </div>
28
+ <div class="qc-formfield-row">
29
+ <qc-select
30
+ id="dropdown-list-restaurants"
31
+ placeholder="Type de restaurant"
32
+ enable-search
33
+ search-placeholder="Rechercher un type de restaurant"
34
+ required
35
+ invalid-text="Veuillez choisir un type de restaurant."
36
+ >
37
+ <label for="dropdown-list-restaurants-select">Type de restaurant</label>
38
+ <select id="dropdown-list-restaurants-select"
39
+ name="restaurants">
40
+ <option value="">Veuillez faire un choix</option>
41
+ <option value="Pizzeria">Pizzeria</option>
42
+ <option value="Pâtisserie">Pâtisserie</option>
43
+ <option value="Steakhouse">Steakhouse</option>
44
+ <option value="Bar">Bar</option>
45
+ <option value="Casse-croûte">Casse-croûte</option>
46
+ <option value="Boîte à pâtes">Boîte à pâtes</option>
47
+ <option value="Restaurant à burgers">Restaurant à burgers</option>
48
+ </select>
49
+ </qc-select>
50
+
51
+ <qc-select
52
+ id="dropdown-list-regions"
53
+ placeholder="Sélectionner une région"
54
+ enable-search
55
+ required
56
+ search-placeholder="Rechercher les régions"
57
+ >
58
+ <label for="dropdown-list-regions-select">Régions desservies</label>
59
+ <select id="dropdown-list-regions-select" multiple name="regions">
60
+ <option value="Capitale-nationale">Capitale-nationale</option>
61
+ <option value="Centre-du-Québec" >Centre-du-Québec</option>
62
+ <option value="Montérégie" >Montérégie</option>
63
+ <option value="Outaouais">Outaouais</option>
64
+ <option value="Saguenay-Lac-Saint-Jean">Saguenay-Lac-Saint-Jean</option>
65
+ <option value="Gaspésie-Îles-de-la-Madeleine">Gaspésie-Îles-de-la-Madeleine</option>
66
+ <option value="Nord-du-Québec">Nord-du-Québec</option>
67
+ <option value="Bas-Saint-Laurent">Bas-Saint-Laurent</option>
68
+ </select>
69
+ </qc-select>
70
+ </div>
71
+ <button type="submit" class="qc-button qc-primary qc-compact">Envoyer</button>
72
+ </form>
73
+
74
+
75
+ </qc-doc-exemple>
76
+ <script>
77
+ const formfieldRowForm = document.getElementById("formulaire-champ-alignes");
78
+ formfieldRowForm.addEventListener("submit", (event) => {
79
+ event.preventDefault();
80
+ let isValid = true;
81
+ formfieldRowForm
82
+ .querySelectorAll("qc-textfield[required], [required] select")
83
+ .forEach(formfield => {
84
+ console.log(formfield, formfield.value ?? "no value")
85
+ if ((formfield.invalidAtSubmit ?? false)) { // textfield
86
+ formfield.invalid = true;
87
+ isValid = false;
88
+ }
89
+ if ((formfield.value === "")) { // select
90
+ formfield.closest("qc-select").invalid = true;
91
+ isValid = false;
92
+ }
93
+ })
94
+ if (isValid) {
95
+ const formData = new FormData(formfieldRowForm);
96
+ let alertParts = ["Formulaire soumis avec les données suivantes :"];
97
+ for (const [key, val] of formData.entries()) {
98
+ alertParts.push(`${key} : ${val}`);
99
+ }
100
+ alert(alertParts.join("\n"));
101
+ }
102
+ });
103
+ </script>
104
+
105
+ <h4>Documentation technique</h4>
106
+ <p>Placer les champs à regrouper sur une seule ligne dans un div avec la classe <code>qc-formfield-row</code></p>
107
+
108
+
@@ -1,5 +1,5 @@
1
1
  <script>
2
- import Icon from "../Icon/Icon.svelte";
2
+ import Icon from "../../bases/Icon/Icon.svelte";
3
3
 
4
4
  const {
5
5
  size = 'xl',
@@ -0,0 +1,14 @@
1
+ @use "qc-sdg-lib" as *;
2
+
3
+ .qc-icon-button {
4
+ display: flex;
5
+ align-items: center;
6
+ justify-content: center;
7
+ flex-shrink: 0;
8
+ @each $size-type, $size in ( sm: 16, md: 20, nm: 24, lg: 32, xl: 40) {
9
+ &[data-button-size=#{$size-type}] {
10
+ height: rem($size);
11
+ width: rem($size);
12
+ }
13
+ }
14
+ }
@@ -0,0 +1,28 @@
1
+ <script>
2
+ import LabelText from "./LabelText.svelte";
3
+
4
+ let {
5
+ forId,
6
+ text,
7
+ required = false,
8
+ compact = false,
9
+ bold = false,
10
+ disabled = false,
11
+ rootElement = $bindable(),
12
+ ...rest
13
+ } = $props();
14
+ </script>
15
+
16
+ <label
17
+ bind:this={rootElement}
18
+ for={forId}
19
+ class={[
20
+ "qc-label",
21
+ compact && "qc-compact",
22
+ bold && "qc-bold",
23
+ disabled && "qc-disabled"
24
+ ]}
25
+ {...rest}
26
+ >
27
+ <LabelText {text} {required} />
28
+ </label>
@@ -0,0 +1,4 @@
1
+ <script>
2
+ let {text, required} = $props()
3
+ </script>
4
+ {@html text}{#if required}<span class="qc-required" aria-hidden="true">*</span>{/if}
@@ -0,0 +1,19 @@
1
+ @use "qc-sdg-lib" as *;
2
+
3
+ .qc-label {
4
+ font-weight: token-value(font weight content medium);
5
+ display: block;
6
+
7
+ &.qc-compact {
8
+ font-size: token-value(font size sm);
9
+ }
10
+
11
+ &.qc-bold {
12
+ font-weight: token-value(font weight content bold);
13
+ }
14
+
15
+ &:has(~ :disabled) {
16
+ color: token-value(color, grey, regular);
17
+ cursor: not-allowed;
18
+ }
19
+ }
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { Utils } from "../utils"
3
- import Icon from "../Icon/Icon.svelte";
3
+ import Icon from "../../bases/Icon/Icon.svelte";
4
4
 
5
5
  const isFr = Utils.getPageLanguage() === 'fr';
6
6
  const defaultHeader = 'h2';
@@ -80,4 +80,3 @@ le denaturaliser.-->
80
80
  </div>
81
81
  </div>
82
82
  </div>
83
- <link rel='stylesheet' href='{Utils.cssPath}'>
@@ -11,6 +11,7 @@
11
11
 
12
12
  <script>
13
13
  import Notice from './Notice.svelte';
14
+ import { Utils } from "../utils"
14
15
 
15
16
  const props = $props();
16
17
  </script>
@@ -23,3 +24,5 @@
23
24
  <slot />
24
25
  {/snippet}
25
26
  </Notice>
27
+ <link rel='stylesheet' href='{Utils.cssPath}'>
28
+
@@ -0,0 +1,141 @@
1
+ <h2 id="notice">Avis (qc-notice)</h2>
2
+ <h3>Exemples</h3>
3
+
4
+ <qc-doc-exemple id="exemple-avis-neutre"
5
+ caption="Exemple d’avis complémentaires"
6
+ >
7
+ <qc-notice type="advice"
8
+ icon="ligth-bulb"
9
+ title="Nouvelle règlementation"
10
+ content="Les nouveaux règlements de pêche seront en vigeur à partir du 12 mai.">
11
+ </qc-notice>
12
+ <qc-notice type="note"
13
+ icon="note"
14
+ title="Nouvelle règlementation"
15
+ content="Les nouveaux règlements de pêche seront en vigeur à partir du 12 mai.">
16
+ </qc-notice>
17
+ </qc-doc-exemple>
18
+
19
+ <qc-doc-exemple caption="Exemple d’information">
20
+ <qc-notice type="information"
21
+ title="Nouvelle règlementation"
22
+ content="Les nouveaux règlements de pêche seront en vigeur à partir du 12 mai.">
23
+ </qc-notice>
24
+ </qc-doc-exemple>
25
+ <!-- <qc-code target-id="exemple-avis-neutre" ></qc-code>-->
26
+
27
+
28
+ <qc-doc-exemple id="exemple-avis-avertissement"
29
+ caption="Exemple d’avertissement (avec et sans <i><code>slot</code></i>)"
30
+ >
31
+ <qc-notice type="warning"
32
+ title="Migration des contenus"
33
+ content="Les contenus seront transférés dans Québec.ca à partir du 16 février et le site sera fermé le 20 avril.">
34
+ </qc-notice>
35
+
36
+ <qc-notice type="warning">
37
+ <h2>Migration des contenus</h2>
38
+ <p>Les contenus seront transférés dans Québec.ca à partir du 16 février et le site sera fermé le 20
39
+ avril.</p>
40
+ </qc-notice>
41
+ </qc-doc-exemple>
42
+
43
+ <!-- <qc-code target-id="exemple-avis-avertissement" ></qc-code>-->
44
+
45
+
46
+ <qc-doc-exemple id="exemple-avis-succes"
47
+ caption="Exemple d’avis de succès"
48
+ >
49
+ <qc-notice type="success"
50
+ title="Votre demande d’inscription a été reçue"
51
+ content="Votre code de confirmation sera envoyé par courriel.">
52
+ </qc-notice>
53
+ </qc-doc-exemple>
54
+ <!-- <qc-code target-id="exemple-avis-succes" ></qc-code>-->
55
+
56
+
57
+ <qc-doc-exemple id="exemple-avis-erreur"
58
+ caption="Exemple d’avis d’erreur"
59
+ >
60
+ <qc-notice type="error"
61
+ title="Des erreurs sont présentes dans le formulaire :">
62
+ <ul>
63
+ <li>
64
+ <a href="javascript:;">Le champ « Nom de famille » est obligatoire ;</a>
65
+ </li>
66
+ <li>
67
+ <a href="javascript:;">Le champ « Prénom » est obligatoire ;</a>
68
+ </li>
69
+ <li>
70
+ <a href="javascript:;">Le champ « Numéro de dossier » est obligatoire.</a>
71
+ </li>
72
+ </ul>
73
+ </qc-notice>
74
+ </qc-doc-exemple>
75
+
76
+ <!-- <qc-code target-id="exemple-avis-erreur" ></qc-code>-->
77
+
78
+ <h3>Documentation technique</h3>
79
+
80
+ <h4>Attributs</h4>
81
+ <div class="table-overflow">
82
+ <table class="qc-table qc-striped component-attributes-description">
83
+ <thead>
84
+ <tr>
85
+ <th>Nom</th>
86
+ <th>Valeur attendue</th>
87
+ <th>Valeur par défaut</th>
88
+ <th>Description</th>
89
+ </tr>
90
+ </thead>
91
+ <tbody>
92
+ <tr>
93
+ <td>title</td>
94
+ <td>Texte</td>
95
+ <td>Chaine vide</td>
96
+ <td>Titre de l’avis</td>
97
+ </tr>
98
+ <tr>
99
+ <td>type</td>
100
+ <td>information, warning, success, error, advice, note</td>
101
+ <td>information (si absence de type)</td>
102
+ <td>Le type d’avis</td>
103
+ </tr>
104
+ <tr>
105
+ <td>content</td>
106
+ <td>Texte</td>
107
+ <td>Chaîne vide</td>
108
+ <td>Le contenu de l’avis, il doit contenir du texte structuré avec des balises sémantiques.</td>
109
+ </tr>
110
+ <tr>
111
+ <td>header</td>
112
+ <td>h1,h3,h2,h3,h4,h5,h6</td>
113
+ <td>h2</td>
114
+ <td>La balise du niveau de titre de l’avis</td>
115
+ </tr>
116
+ <tr>
117
+ <td>icon</td>
118
+ <td>Toute clé de la map $images dans settings/_base.scss</td>
119
+ <td>information
120
+ <qc-icon icon="information" aria-hidden="true" size="nm"></qc-icon>
121
+ (si absence de type)
122
+ </td>
123
+ <td>Défini l’icône pour les avis neutres</td>
124
+ </tr>
125
+ </tbody>
126
+ </table>
127
+ </div>
128
+ <h4>Zone d’ajout de contenu HTML</h4>
129
+
130
+ <p>Ci-dessous, la zone d’ajout de contenu HTML (balise &lt;slot&gt;) délimitée en pointillé.</p>
131
+
132
+ <qc-doc-exemple id="presentation-slots-avis"
133
+ caption="Présentation des emplacements disponibles dans les avis."
134
+ hide-code
135
+ >
136
+ <qc-notice id="qc-notice-slots">
137
+ <div style="border:2px dashed; padding: var(--qc-spacer-xs);">
138
+ Contenu par défaut
139
+ </div>
140
+ </qc-notice>
141
+ </qc-doc-exemple>
@@ -1,4 +1,4 @@
1
- @use "qc-sdg-lib" as *;
1
+ @use "../../scss/qc-sdg-lib" as *;
2
2
  @use "sass:list" as *;
3
3
 
4
4
  @mixin qc-notice-title() {
@@ -1,6 +1,5 @@
1
1
  <script>
2
2
  import { Utils } from "../utils"
3
- import DefaultCopyright from "./_defaultCopyright.svelte";
4
3
  const lang = Utils.getPageLanguage();
5
4
 
6
5
  let {
@@ -8,12 +7,13 @@
8
7
  logoSrc = Utils.imagesRelativePath + '/QUEBEC_couleur.svg',
9
8
  logoSrcDarkTheme = Utils.imagesRelativePath + '/QUEBEC_blanc.svg',
10
9
  logoAlt = lang === 'fr' ? 'Logo du gouvernement du Québec' : 'Logo of the Quebec government',
11
- copyrightText,
12
10
  logoWidth = 139,
13
11
  logoHeight = 50,
14
- copyrightUrl,
12
+ copyrightUrl = lang === 'fr' ? 'https://www.quebec.ca/droit-auteur' : 'https://www.quebec.ca/en/copyright',
13
+ copyrightText = '© Gouvernement du Québec, ' + (new Date()).getFullYear(),
15
14
  mainSlot,
16
- copyrightSlot
15
+ copyrightSlot,
16
+ slots = {}
17
17
  } = $props();
18
18
  </script>
19
19
 
@@ -39,13 +39,12 @@
39
39
  </a>
40
40
 
41
41
  <span class="copyright">
42
- {#if copyrightSlot}
42
+ {#if (!slots && copyrightSlot) || slots.copyright}
43
43
  {@render copyrightSlot()}
44
44
  {:else}
45
- <DefaultCopyright {copyrightText} {copyrightUrl} />
45
+ <a href="{copyrightUrl}">
46
+ {copyrightText}
47
+ </a>
46
48
  {/if}
47
49
  </span>
48
50
  </div>
49
-
50
- <link rel='stylesheet' href='{Utils.cssPath}'>
51
-