qc-trousse-sdg 1.4.3 → 1.4.5

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 (60) hide show
  1. package/README.md +76 -51
  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/img/QUEBEC_blanc.svg +3 -12
  6. package/dist/img/QUEBEC_couleur.svg +3 -23
  7. package/dist/js/qc-sdg.min.js +1 -1
  8. package/index.html +1 -1
  9. package/package.json +1 -1
  10. package/public/css/qc-sdg-design-tokens.css +0 -2
  11. package/public/css/qc-sdg-no-grid.css +154 -110
  12. package/public/css/qc-sdg.css +154 -110
  13. package/public/img/QUEBEC_blanc.svg +3 -12
  14. package/public/img/QUEBEC_couleur.svg +3 -23
  15. package/public/img/favicon.ico +0 -0
  16. package/public/index.html +13 -0
  17. package/public/js/qc-doc-sdg.js +31 -34
  18. package/public/js/qc-sdg.js +2049 -1268
  19. package/src/doc/_index.html +3 -0
  20. package/src/sdg/_components.js +0 -1
  21. package/src/sdg/bases/form/_form.scss +0 -4
  22. package/src/sdg/components/Alert/Alert.svelte +1 -1
  23. package/src/sdg/components/Button/_button.scss +35 -12
  24. package/src/sdg/components/Checkbox/Checkbox.svelte +3 -3
  25. package/src/sdg/components/Checkbox/CheckboxWC.svelte +3 -3
  26. package/src/sdg/components/Checkbox/{updateInput.svelte.js → updateChoiceInput.svelte.js} +6 -1
  27. package/src/sdg/components/ChoiceGroup/ChoiceGroup.svelte +2 -2
  28. package/src/sdg/components/ChoiceGroup/Test/ChoiceGroupeEmbededTest.svelte +3 -0
  29. package/src/sdg/components/ChoiceGroup/Test/checkboxBaselineTest.html +3 -0
  30. package/src/sdg/components/DropdownList/DropdownList.svelte +4 -7
  31. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte +1 -6
  32. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/_dropdownListItemsMultiple.scss +3 -8
  33. package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/_dropdownListItemsSingle.scss +1 -2
  34. package/src/sdg/components/DropdownList/DropdownListItems/_dropdownListItems.scss +2 -4
  35. package/src/sdg/components/DropdownList/SelectWC.svelte +31 -50
  36. package/src/sdg/components/DropdownList/Test/DropdownListSvelteTest.svelte +37 -2
  37. package/src/sdg/components/DropdownList/Test/{dropdownListTest.html → dropdownListBaselineTest.html} +19 -1
  38. package/src/sdg/components/DropdownList/Test/dropdownListTestUtils.js +14 -0
  39. package/src/sdg/components/DropdownList/_dropdownList.scss +11 -16
  40. package/src/sdg/components/DropdownList/_select.html +9 -0
  41. package/src/sdg/components/Fieldset/_fieldset.scss +17 -4
  42. package/src/sdg/components/Label/_label.scss +1 -0
  43. package/src/sdg/components/PivFooter/PivFooter.svelte +2 -2
  44. package/src/sdg/components/PivHeader/PivHeader.svelte +79 -74
  45. package/src/sdg/components/PivHeader/Test/pivHeaderBaselineTest.html +12 -1
  46. package/src/sdg/components/PivHeader/Test/pivHeaderTest.js +9 -0
  47. package/src/sdg/components/PivHeader/_pivHeader.html +1 -0
  48. package/src/sdg/components/PivHeader/_pivHeader.scss +46 -19
  49. package/src/sdg/components/TextField/Test/textFieldBaselineTest.html +24 -5
  50. package/src/sdg/components/TextField/TextField.svelte +29 -25
  51. package/src/sdg/components/TextField/TextFieldWC.svelte +8 -0
  52. package/src/sdg/components/TextField/_textField.scss +6 -13
  53. package/src/sdg/qc-sdg-test.js +4 -0
  54. package/src/sdg/scss/settings/_tokens.scss +0 -4
  55. package/tests/buildSvelteTestsIgnore.json +2 -1
  56. package/tests/dropdown-list-baseline.spec.ts +51 -4
  57. package/tests/piv-header-baseline.spec.ts +3 -0
  58. package/src/sdg/components/Button/Button.svelte +0 -50
  59. package/src/sdg/components/Button/ButtonWC.svelte +0 -36
  60. package/tests/piv-header-svelte.spec.ts +0 -11
@@ -62,18 +62,10 @@ textarea {
62
62
  }
63
63
 
64
64
  $sizes: map.get($lg-tokens, size, max-width);
65
- input ,
66
- input + .qc-textfield-charcount {
67
- .qc-textfield &,
68
- qc-textfield & {
69
- max-width: token-value(size input max-width);
70
- }
71
- }
72
- textarea,
73
- textarea + .qc-textfield-charcount {
74
- .qc-textfield &,
75
- qc-textfield & {
76
- max-width: token-value(size textarea max-width);
65
+
66
+ @each $size, $width in $sizes {
67
+ [size="#{$size}"] {
68
+ max-width: 100%;
77
69
  }
78
70
  }
79
71
 
@@ -84,7 +76,8 @@ textarea,
84
76
  & + .qc-textfield-charcount {
85
77
  @each $size, $width in $sizes {
86
78
  [size="#{$size}"] & {
87
- max-width: $width;
79
+ max-width: 100%;
80
+ width: $width;
88
81
  }
89
82
  }
90
83
  }
@@ -1,3 +1,7 @@
1
+ import {setMcePivHeaderLogoSrc} from "./components/PivHeader/Test/pivHeaderTest";
2
+
3
+ setMcePivHeaderLogoSrc();
4
+
1
5
  export * from './bases/Icon/Test/IconEmbeddedTest.svelte';
2
6
  export * from './components/TextField/Test/TextFieldEmbededTest.svelte';
3
7
  export * from "./components/DropdownList/Test/DropdownListSvelteTest.svelte";
@@ -216,11 +216,7 @@ $lg-tokens: (
216
216
  lg: rem(528),
217
217
  xl: rem(825)
218
218
  ),
219
- input: (
220
- max-width: token-value(size max-width md),
221
- ),
222
219
  textarea: (
223
- max-width: token-value(size max-width lg),
224
220
  min-height: rem(108)
225
221
  ),
226
222
  search-bar: (
@@ -1,4 +1,5 @@
1
1
  [
2
2
  "**/button-baseline.spec.ts",
3
- "**/dropdown-list-baseline.spec.ts"
3
+ "**/dropdown-list-baseline.spec.ts",
4
+ "**/piv-header-baseline.spec.ts"
4
5
  ]
@@ -18,6 +18,14 @@ test.describe('Rendu visuel',
18
18
  await expect(page).toHaveScreenshot('dropdownList.png', {fullPage: true});
19
19
  });
20
20
 
21
+ test('Select text wrap', {
22
+ tag: ['@baseline', '@textwrap', '@dropdownlist']
23
+ }, async ({ page }) => {
24
+ await page.getByRole('combobox', { name: 'Débordement' }).click();
25
+
26
+ await expect(page).toHaveScreenshot('dropdownListTextWrap.png', {fullPage: true});
27
+ });
28
+
21
29
  test('Select svelte', {
22
30
  tag: ['@svelte', '@dropdownlist']
23
31
  }, async ({ page }) => {
@@ -494,10 +502,8 @@ test.describe('formulaire', () => {
494
502
 
495
503
  await expect(page.locator('#dropdown-list-restaurants-input')).toHaveAttribute('aria-invalid', 'true');
496
504
  await expect(page.locator('#dropdown-list-restaurants-error')).toMatchAriaSnapshot(`
497
- - alert:
498
- - img
499
- - text: Veuillez choisir un type de restaurant.
500
- `);
505
+ - alert: Veuillez choisir un type de restaurant.
506
+ `);
501
507
 
502
508
  await page.locator('#dropdown-list-restaurants-input').click();
503
509
  await page.locator('[id="dropdown-list-restaurants-Pâtisserie-Pâtisserie"]').click();
@@ -527,3 +533,44 @@ test.describe('formulaire', () => {
527
533
  });
528
534
  });
529
535
  });
536
+
537
+ test.describe('Manipulation du DOM', () => {
538
+ test('Réordonnancement des options', {
539
+ tag: ['@dom', '@dropdownlist'],
540
+ annotation: {
541
+ type: 'description',
542
+ description: 'En réordonnant les options dans le select, alors les changement sont reflétés dans la popup'
543
+ }
544
+ }, async ({ page }) => {
545
+ await page.locator('#select-single-choice').evaluate((select: HTMLSelectElement) => {
546
+ const options = Array.from(select.options);
547
+ options.reverse();
548
+
549
+ select.innerHTML = '';
550
+ select.append(...options);
551
+ });
552
+ await page.locator('#qc-select-single-choice-input').click();
553
+
554
+ await expect(page.locator('#qc-select-single-choice-items')).toMatchAriaSnapshot(`
555
+ - list:
556
+ - option "Option 16 (désactivée)"
557
+ - option "Option 15"
558
+ - option "Option 14"
559
+ - option "Option 13"
560
+ - option "Option 12"
561
+ - option "Option 11"
562
+ - option "Option 10"
563
+ - option "Option 9"
564
+ - option "Option 8"
565
+ - option "Option 7"
566
+ - option "Option 6"
567
+ - option "Option 5"
568
+ - option "Option 4"
569
+ - option "Option 3"
570
+ - option "Option 2"
571
+ - option "Option 1"
572
+ - status
573
+ `
574
+ );
575
+ });
576
+ });
@@ -7,5 +7,8 @@ test('pivHeader baseline', {
7
7
  }, async ({ page }) => {
8
8
  const htmlFilePath = path.resolve(__dirname, '../public/pivHeaderBaseline.test.html');
9
9
  await page.goto(`file://${htmlFilePath}`);
10
+
11
+ await page.getByRole('link', { name: 'Logo du gouvernement du Québec' }).first().focus();
12
+
10
13
  await expect(page).toHaveScreenshot('pivHeader.png', { fullPage: true });
11
14
  });
@@ -1,50 +0,0 @@
1
- <script>
2
- import Icon from "../../bases/Icon/Icon.svelte";
3
-
4
- let {
5
- variant = "primary",
6
- disabled = false,
7
- compact = false,
8
- rounded = false,
9
- label = "",
10
- icon = "",
11
- iconPosition = "left",
12
- iconSrc = "",
13
- ...rest
14
- } = $props();
15
-
16
- let className = $state();
17
-
18
- $effect(() => {
19
- className = [
20
- "qc-button",
21
- `qc-${variant}`,
22
- compact && "qc-compact",
23
- rounded && "qc-button-rounded"
24
- ].filter(Boolean).join(" ");
25
- });
26
- </script>
27
-
28
- <button
29
- class={className}
30
- disabled={disabled}
31
- {...rest}
32
- >
33
- {#if iconPosition === "left"}
34
- {#if iconSrc}
35
- <Icon src={iconSrc} />
36
- {:else if icon}
37
- <Icon type={icon} />
38
- {/if}
39
- {/if}
40
-
41
- {label}
42
-
43
- {#if icon && iconPosition === "right"}
44
- {#if iconSrc}
45
- <Icon src={iconSrc} />
46
- {:else if icon}
47
- <Icon type={icon} />
48
- {/if}
49
- {/if}
50
- </button>
@@ -1,36 +0,0 @@
1
- <svelte:options customElement={{
2
- tag: 'qc-button',
3
- shadow: 'none',
4
- props: {
5
- variant: { attribute: 'variant', type: 'String' },
6
- disabled: { attribute: 'disabled', type: 'Boolean' },
7
- compact: { attribute: 'compact', type: 'Boolean' },
8
- rounded: { attribute: 'rounded', type: 'Boolean' },
9
- label: { attribute: 'label', type: 'String' },
10
- icon: { attribute: 'icon', type: 'String' },
11
- iconPosition: { attribute: 'icon-position', type: 'String' },
12
- iconSrc: { attribute: 'icon-src', type: 'String' }
13
- }
14
- }} />
15
-
16
- <script>
17
- import Button from './Button.svelte';
18
-
19
- let {
20
- variant = "primary",
21
- disabled = false,
22
- compact = false,
23
- rounded = false,
24
- label = "",
25
- ...rest
26
- } = $props();
27
- </script>
28
-
29
- <Button
30
- {variant}
31
- {disabled}
32
- {compact}
33
- {rounded}
34
- {label}
35
- {...rest}
36
- />
@@ -1,11 +0,0 @@
1
- import { test, expect } from '@playwright/test';
2
- import path = require('path');
3
-
4
-
5
- test('pivHeader svelte', {
6
- tag: ['@svelte', '@piv-header']
7
- }, async ({ page }) => {
8
- const htmlFilePath = path.resolve(__dirname, '../public/pivHeaderSvelte.test.html');
9
- await page.goto(`file://${htmlFilePath}`);
10
- await expect(page).toHaveScreenshot('pivHeader.png', { fullPage: true });
11
- });