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
@@ -1,31 +1,53 @@
1
1
  <script>
2
2
  import IconButton from "../IconButton/IconButton.svelte";
3
3
  import {Utils} from "../utils";
4
+ import Icon from "../../bases/Icon/Icon.svelte";
4
5
 
5
6
  const lang = Utils.getPageLanguage();
6
7
 
7
8
 
8
9
  let {
9
10
  value = $bindable(''),
10
- ariaLabel = lang === "fr" ? "Rechercher" : "Search_",
11
+ ariaLabel = lang === "fr" ? "Rechercher..." : "Search...",
11
12
  clearAriaLabel = lang === "fr" ? "Effacer le texte" : "Clear text",
13
+ leftIcon = false,
14
+ id = `qc-search-input-${Math.random().toString(36).slice(2, 11)}`,
12
15
  ...rest
13
16
  } = $props();
14
17
 
18
+ leftIcon = leftIcon === true || leftIcon === "true" || leftIcon === "";
19
+ const isDisabled = rest.disabled === true || rest.disabled === "true" || rest.disabled === "";
20
+
15
21
  let searchInput;
22
+
23
+ export function focus() {
24
+ searchInput?.focus();
25
+ }
16
26
  </script>
17
27
 
18
- <div class="qc-search-input">
28
+ <div class={[
29
+ "qc-search-input",
30
+ leftIcon && "qc-search-left-icon",
31
+ leftIcon && isDisabled && "qc-search-left-icon-disabled"
32
+ ]} >
33
+ {#if leftIcon}
34
+ <Icon type="search-thin"
35
+ iconColor="grey-regular"
36
+ class={`qc-icon${isDisabled ? ' is-disabled' : ''}`}
37
+ />
38
+ {/if}
19
39
  <input bind:this={searchInput}
20
- bind:value={value}
40
+ bind:value
21
41
  type="search"
22
42
  autocomplete="off"
23
43
  aria-label={ariaLabel}
44
+ class={isDisabled ? "qc-disabled" : ""}
45
+ id={id}
24
46
  {...rest}
25
47
  />
26
48
  {#if value}
27
49
  <IconButton type="button"
28
- icon="clear-input"
50
+ icon="xclose"
29
51
  iconColor="blue-piv"
30
52
  iconSize="sm"
31
53
  aria-label={clearAriaLabel}
@@ -2,8 +2,10 @@
2
2
  tag: 'qc-search-input',
3
3
  shadow: 'none',
4
4
  props: {
5
+ id: {attribute: 'id'},
5
6
  ariaLabel: {attribute:'aria-label'},
6
- clearAriaLabel: {attribute: 'clear-aria-label'}
7
+ clearAriaLabel: {attribute: 'clear-aria-label'},
8
+ leftIcon: {attribute: 'left-icon'}
7
9
  }
8
10
  }}" />
9
11
 
@@ -0,0 +1,85 @@
1
+ <h2 id="search-input">Champ de recherche</h2>
2
+ <h3>Exemples</h3>
3
+
4
+ <qc-doc-exemple caption="Exemples de champs de recherche">
5
+ <qc-search-input
6
+ placeholder="Rechercher un article"
7
+ aria-label="Rechercher un article"
8
+ clear-aria-label="Effacer le texte"
9
+ left-icon
10
+ ></qc-search-input>
11
+
12
+ <br>
13
+
14
+ <qc-search-input
15
+ value="Climat"
16
+ placeholder="Rechercher un sujet"
17
+ aria-label="Rechercher un sujet"
18
+ clear-aria-label="Effacer le texte"
19
+ left-icon
20
+ ></qc-search-input>
21
+
22
+ <br>
23
+
24
+ <qc-search-input
25
+ placeholder="Recherche désactivée"
26
+ aria-label="Recherche désactivée"
27
+ disabled
28
+ left-icon
29
+ clear-aria-label="Effacer le texte"
30
+ ></qc-search-input>
31
+ </qc-doc-exemple>
32
+
33
+ <h3>Documentation technique</h3>
34
+
35
+ <h4>Attributs</h4>
36
+ <div class="table-overflow">
37
+ <table class="qc-table qc-striped component-attributes-description">
38
+ <thead>
39
+ <tr>
40
+ <th>Nom</th>
41
+ <th>Valeur attendue</th>
42
+ <th>Valeur par défaut</th>
43
+ <th>Description</th>
44
+ </tr>
45
+ </thead>
46
+ <tbody>
47
+ <tr>
48
+ <td>value</td>
49
+ <td>Texte</td>
50
+ <td>""</td>
51
+ <td>Valeur inscrite par défaut dans le champ de recherche.</td>
52
+ </tr>
53
+ <tr>
54
+ <td>placeholder</td>
55
+ <td>Texte</td>
56
+ <td>""</td>
57
+ <td>Texte indicatif affiché lorsque le champ est vide.</td>
58
+ </tr>
59
+ <tr>
60
+ <td>aria-label</td>
61
+ <td>Texte</td>
62
+ <td>"Rechercher..." ou "Search..."</td>
63
+ <td>Libellé accessible pour les lecteurs d'écrans.</td>
64
+ </tr>
65
+ <tr>
66
+ <td>clear-aria-label</td>
67
+ <td>Texte</td>
68
+ <td>"Effacer le texte" ou "Clear text"</td>
69
+ <td>Libellé accessible du bouton pour effacer le champ.</td>
70
+ </tr>
71
+ <tr>
72
+ <td>disabled</td>
73
+ <td>na</td>
74
+ <td>na</td>
75
+ <td>Désactive le champ.</td>
76
+ </tr>
77
+ <tr>
78
+ <td>name</td>
79
+ <td>Texte</td>
80
+ <td>""</td>
81
+ <td>Nom du champ utilisé lors de la soumission du formulaire.</td>
82
+ </tr>
83
+ </tbody>
84
+ </table>
85
+ </div>
@@ -1,4 +1,4 @@
1
- @use "qc-sdg-lib" as *;
1
+ @use "../../scss/qc-sdg-lib" as *;
2
2
 
3
3
  qc-search-input {
4
4
  display: block;
@@ -10,7 +10,7 @@ qc-search-input {
10
10
  %qc-search-wrapper {
11
11
  @extend %qc-formcontrol-box;
12
12
  display: flex;
13
- align-items: stretch;
13
+ align-items: center;
14
14
  &::before {
15
15
  border: 1px solid token-value(color formfield border);
16
16
  }
@@ -24,6 +24,12 @@ qc-search-input {
24
24
  }
25
25
  }
26
26
 
27
+ %qc-search-disabled {
28
+ background-color: token-value(color grey pale);
29
+ border: 1px solid token-value(color, grey, regular);
30
+ cursor: not-allowed;
31
+ }
32
+
27
33
  .qc-search-input {
28
34
  @extend %qc-search-wrapper;
29
35
  input[type=search] {
@@ -44,14 +50,23 @@ qc-search-input {
44
50
  display: none;
45
51
  }
46
52
  &::placeholder {
53
+ width: 100%;
47
54
  color: token-value(color grey medium);
48
55
  font-weight: normal;
56
+ overflow: hidden;
57
+ }
58
+ &:placeholder-shown {
59
+ text-overflow: ellipsis;
49
60
  }
50
61
  &:focus,&:focus-visible {
51
62
  outline: none;
52
63
  }
53
64
  }
54
65
 
66
+ &.qc-search-left-icon {
67
+ padding-left: token-value(spacer, xs);
68
+ }
69
+
55
70
  button {
56
71
  @extend %qc-formcontrol-box;
57
72
  &::before {
@@ -59,6 +74,16 @@ qc-search-input {
59
74
  }
60
75
  cursor: pointer;
61
76
  }
77
+
78
+ &.qc-search-left-icon-disabled {
79
+ &::before {
80
+ @extend %qc-search-disabled;
81
+ }
82
+
83
+ qc-icon {
84
+ @extend %qc-search-disabled;
85
+ }
86
+ }
62
87
  }
63
88
 
64
89
 
@@ -0,0 +1,143 @@
1
+ <svelte:options customElement={{
2
+ tag: 'qc-textfield-demo',
3
+ props: {
4
+ label: { attribute: 'label', type: 'String' },
5
+ required: { attribute: 'required', type: 'Boolean' },
6
+ description: { attribute: 'description', type: 'String' },
7
+ size: { attribute: 'size', type: 'String' },
8
+ maxlength: { attribute: 'max-length', type: 'Number' },
9
+ invalid: { attribute: 'invalid', type: 'Boolean', reflect: true },
10
+ invalidText: { attribute: 'invalid-text', type: 'String' },
11
+ }
12
+ }} />
13
+ <script>
14
+
15
+ import TextField from "../TextField.svelte";
16
+ import {Utils} from "../../utils";
17
+ import Checkbox from "../../Checkbox/Checkbox.svelte";
18
+ import DropdownList from "../../DropdownList/DropdownList.svelte";
19
+ import ChoiceGroup from "../../ChoiceGroup/ChoiceGroup.svelte";
20
+ let {
21
+ invalid,
22
+ invalidText,
23
+ label = "Démo",
24
+ description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
25
+ required,
26
+ maxlength = 10,
27
+ value,
28
+ placeholder,
29
+ size,
30
+ maxlengthReached = $bindable(false),
31
+ invalidAtSubmit = $bindable(false),
32
+ } = $props();
33
+ let inputTag = $state("input"),
34
+ inputType = $state("text"),
35
+ multiligne = $state(false)
36
+ ;
37
+ $inspect(multiligne, inputTag, inputType)
38
+ $effect(() => {
39
+ console.log(multiligne, inputTag, inputType)
40
+ if (multiligne) {
41
+ inputTag = "textarea";
42
+ inputType = undefined;
43
+ } else {
44
+ inputTag = "input";
45
+ inputType = "text";
46
+ }
47
+ })
48
+ </script>
49
+ <TextField
50
+ {label}
51
+ {invalid}
52
+ {invalidText}
53
+ {size}
54
+ {required}
55
+ description={multiligne ? description : undefined}
56
+ maxlength={multiligne ? maxlength : undefined}
57
+ >
58
+ <svelte:element
59
+ this={inputTag}
60
+ {inputType}
61
+ {value}
62
+ name="textfield-demo"
63
+ {placeholder}
64
+ >
65
+
66
+ </svelte:element>
67
+ </TextField>
68
+ <div class="attributes">
69
+ <Checkbox compact>
70
+ <label>
71
+ <input type="checkbox"
72
+ bind:checked={multiligne}>
73
+ Multiligne
74
+ </label>
75
+ </Checkbox>
76
+ <ChoiceGroup legend="Size" selectionButton inline>
77
+ {#each ['xs','sm','md','lg','xl'] as _size}
78
+ <label>
79
+ <input type="radio"
80
+ name="size"
81
+ bind:group={size}
82
+ value="{_size}"
83
+ />
84
+ {_size}
85
+ </label>
86
+ {/each}
87
+ </ChoiceGroup>
88
+ <Checkbox compact>
89
+ <label>
90
+ <input type="checkbox"
91
+ bind:checked={required}>
92
+ Required
93
+ </label>
94
+ </Checkbox>
95
+ <Checkbox compact>
96
+ <label>
97
+ <input type="checkbox"
98
+ bind:checked={invalid}>
99
+ Invalid
100
+ </label>
101
+ </Checkbox>
102
+ <TextField label="placeholder">
103
+ <input type="text"
104
+ bind:value={placeholder} />
105
+ </TextField>
106
+ <TextField label="Libellé du champ">
107
+ <input type="text"
108
+ bind:value={label}
109
+ />
110
+ </TextField>
111
+ <TextField label="Message d'erreur">
112
+ <input type="text"
113
+ bind:value={invalidText}
114
+ />
115
+ </TextField>
116
+ {#if multiligne}
117
+ <TextField label="Description"
118
+ size="lg"
119
+ >
120
+ <input type="text"
121
+ bind:value={description}
122
+ />
123
+ </TextField>
124
+ <TextField label="Maxlength"
125
+ size="xs"
126
+ >
127
+ <input type="number"
128
+ bind:value={maxlength} />
129
+ </TextField>
130
+ {/if}
131
+ </div>
132
+ <style>
133
+ .attributes {
134
+ display: flex;
135
+ flex-direction: column;
136
+ flex-wrap: wrap;
137
+ gap: 0 24px;
138
+ max-height: 352px;
139
+ }
140
+ </style>
141
+
142
+ <link rel='stylesheet' href='{Utils.cssPath.replace("qc-doc","qc")}' >
143
+
@@ -0,0 +1,129 @@
1
+ <svelte:options customElement={{
2
+ tag: 'qc-textfield-embedded-test'
3
+ }}/>
4
+ <script>
5
+ import TextField from "../TextField.svelte";
6
+ import {Utils} from '../../utils.js';
7
+ </script>
8
+ <TextField label="Très petit"
9
+ size="xs">
10
+ <input type="text"
11
+ name="text-xs"
12
+ placeholder="25"
13
+ />
14
+ </TextField>
15
+
16
+ <TextField size="sm">
17
+ <label for="text-sm">Petit</label>
18
+ <input type="text"
19
+ id="text-sm"
20
+ name="text-sm"
21
+ placeholder="25"
22
+ />
23
+ </TextField>
24
+
25
+ <TextField label="Moyen"
26
+ size="md"
27
+ invalid
28
+ >
29
+ <input type="text"
30
+ name="text-md"
31
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
32
+ />
33
+ </TextField>
34
+
35
+ <TextField name="text-lg"
36
+ label="Large"
37
+ size="lg"
38
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
39
+ required>
40
+ <input type="text"
41
+ name="text-lg"
42
+ />
43
+ </TextField>
44
+
45
+ <TextField
46
+ label="Très large"
47
+ size="xl"
48
+
49
+ >
50
+ <input type="text"
51
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
52
+ name="text-xl"
53
+ disabled
54
+ />
55
+ </TextField>
56
+
57
+ <div class="qc-formfield-row">
58
+ <TextField
59
+ label="Combiné 1"
60
+ size="sm"
61
+ >
62
+ <input type="text"
63
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
64
+ name="combo-1"
65
+ />
66
+ </TextField>
67
+
68
+ <TextField
69
+ label="Combiné 2"
70
+ size="xs"
71
+ >
72
+ <input type="text"
73
+ name="combo-2"
74
+ />
75
+ </TextField>
76
+ </div>
77
+ <div class="qc-formfield-row">
78
+ <TextField
79
+ label="Combiné 1 invalide"
80
+ size="sm"
81
+ invalid
82
+ >
83
+ <input type="text"
84
+ name="invalid-combo-1"
85
+ />
86
+ </TextField>
87
+
88
+ <TextField
89
+ label="Combiné 2"
90
+ size="xs"
91
+ invalid
92
+ >
93
+ <input type="text"
94
+ name="invalid-combo-2"
95
+ />
96
+ </TextField>
97
+
98
+ </div>
99
+
100
+ <TextField
101
+ label="Commentaires"
102
+ size="lg"
103
+ description="Vous pouvez entrer des commentaires dans la zone de texte ci-dessous."
104
+ >
105
+ <textarea name="zone-lg" id="zone-lg"></textarea>
106
+ </TextField>
107
+
108
+ <TextField
109
+ label="Suggestions"
110
+ description="Vous pouvez entrer des suggestions dans la zone de texte ci-dessous."
111
+ size="xl"
112
+ maxlength="10"
113
+ required
114
+ >
115
+ <textarea name="zone-xl"></textarea>
116
+ </TextField>
117
+
118
+ <TextField label="Suggestions"
119
+ description="Vous pouvez entrer des suggestions dans la zone de texte ci-dessous."
120
+ size="xl"
121
+ maxlength="10"
122
+ required
123
+ invalid
124
+ >
125
+ <textarea name="zone-xl-invalid"
126
+ id="zone-xl-invalid"
127
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit</textarea>
128
+ </TextField>
129
+ <link rel='stylesheet' href='{Utils.cssPath}'>
@@ -0,0 +1 @@
1
+ <qc-textfield-embedded-test></qc-textfield-embedded-test>
@@ -0,0 +1,121 @@
1
+ <qc-textfield label="Très petit"
2
+ size="xs">
3
+ <input type="text"
4
+ name="text-xs"
5
+ placeholder="25"
6
+ />
7
+ </qc-textfield>
8
+
9
+ <qc-textfield size="sm"
10
+ >
11
+ <label for="text-sm">Petit</label>
12
+ <input type="text"
13
+ id="text-sm"
14
+ name="text-sm"
15
+ placeholder="25"
16
+ />
17
+ </qc-textfield>
18
+
19
+ <qc-textfield label="Moyen"
20
+ size="md"
21
+ invalid
22
+ >
23
+ <input type="text"
24
+ name="text-md"
25
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
26
+ />
27
+ </qc-textfield>
28
+
29
+ <qc-textfield name="text-lg"
30
+ label="Large"
31
+ size="lg"
32
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
33
+ required>
34
+ <input type="text"
35
+ name="text-lg"
36
+ />
37
+ </qc-textfield>
38
+
39
+ <qc-textfield
40
+ label="Très large"
41
+ size="xl"
42
+
43
+ >
44
+ <input type="text"
45
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
46
+ name="text-xl"
47
+ disabled
48
+ />
49
+ </qc-textfield>
50
+
51
+ <div class="qc-formfield-row">
52
+ <qc-textfield
53
+ label="Combiné 1"
54
+ size="sm"
55
+ >
56
+ <input type="text"
57
+ placeholder="Long placeholder lorem ipsum dolor sit amet"
58
+ name="combo-1"
59
+ />
60
+ </qc-textfield>
61
+
62
+ <qc-textfield
63
+ label="Combiné 2"
64
+ size="xs"
65
+ >
66
+ <input type="text"
67
+ name="combo-2"
68
+ />
69
+ </qc-textfield>
70
+ </div>
71
+ <div class="qc-formfield-row">
72
+ <qc-textfield
73
+ label="Combiné 1 invalide"
74
+ size="sm"
75
+ invalid
76
+ >
77
+ <input type="text"
78
+ name="invalid-combo-1"
79
+ />
80
+ </qc-textfield>
81
+
82
+ <qc-textfield
83
+ label="Combiné 2"
84
+ size="xs"
85
+ invalid
86
+ >
87
+ <input type="text"
88
+ name="invalid-combo-2"
89
+ />
90
+ </qc-textfield>
91
+
92
+ </div>
93
+
94
+ <qc-textfield label="Commentaires"
95
+ size="lg"
96
+ description="Vous pouvez entrer des commentaires dans la zone de texte ci-dessous."
97
+ >
98
+ <textarea name="zone-lg" id="zone-lg"></textarea>
99
+ </qc-textfield>
100
+
101
+ <qc-textfield
102
+ label="Suggestions"
103
+ description="Vous pouvez entrer des suggestions dans la zone de texte ci-dessous."
104
+ size="xl"
105
+ max-length="10"
106
+ required
107
+ >
108
+ <textarea name="zone-xl"></textarea>
109
+ </qc-textfield>
110
+
111
+ <qc-textfield label="Suggestions"
112
+ description="Vous pouvez entrer des suggestions dans la zone de texte ci-dessous."
113
+ size="xl"
114
+ max-length="10"
115
+ required
116
+ invalid
117
+ >
118
+ <textarea name="zone-xl-invalid"
119
+ id="zone-xl-invalid"
120
+ >Lorem ipsum dolor sit amet, consectetur adipiscing elit</textarea>
121
+ </qc-textfield>