qc-trousse-sdg 1.4.4 → 1.4.6
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.
- package/README.md +81 -53
- package/dist/css/qc-sdg-design-tokens.min.css +1 -1
- package/dist/css/qc-sdg-no-grid.min.css +1 -1
- package/dist/css/qc-sdg.min.css +1 -1
- package/dist/img/QUEBEC_blanc.svg +3 -12
- package/dist/img/QUEBEC_couleur.svg +3 -23
- package/dist/js/qc-sdg.min.js +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/plugins/buildHtmlDoc.js +5 -1
- package/public/css/qc-doc-sdg.css +31 -28
- package/public/css/qc-sdg-design-tokens.css +0 -2
- package/public/css/qc-sdg-no-grid.css +158 -112
- package/public/css/qc-sdg.css +158 -112
- package/public/img/QUEBEC_blanc.svg +3 -12
- package/public/img/QUEBEC_couleur.svg +3 -23
- package/public/img/favicon.ico +0 -0
- package/public/index.html +37 -31
- package/public/js/qc-doc-sdg.js +7550 -4468
- package/public/js/qc-sdg.js +10295 -7247
- package/rollup.config.js +3 -4
- package/src/doc/_index.html +3 -0
- package/src/doc/components/Code.svelte +13 -5
- package/src/doc/components/Exemple.svelte +0 -13
- package/src/doc/scss/components/_code.scss +4 -21
- package/src/doc/scss/components/_exemple.scss +21 -0
- package/src/doc/scss/qc-doc-sdg.scss +1 -0
- package/src/sdg/_components.js +0 -1
- package/src/sdg/bases/form/_form.scss +0 -4
- package/src/sdg/bases/links/_links.html +10 -10
- package/src/sdg/components/Alert/Alert.svelte +1 -1
- package/src/sdg/components/Alert/_alert.html +2 -2
- package/src/sdg/components/Checkbox/Checkbox.svelte +3 -3
- package/src/sdg/components/Checkbox/CheckboxWC.svelte +3 -3
- package/src/sdg/components/Checkbox/{updateInput.svelte.js → updateChoiceInput.svelte.js} +6 -1
- package/src/sdg/components/ChoiceGroup/ChoiceGroup.svelte +2 -2
- package/src/sdg/components/ChoiceGroup/Test/ChoiceGroupeEmbededTest.svelte +3 -0
- package/src/sdg/components/ChoiceGroup/Test/checkboxBaselineTest.html +3 -0
- package/src/sdg/components/ChoiceGroup/_choiceGroup.html +0 -2
- package/src/sdg/components/DropdownList/DropdownList.svelte +4 -7
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItems.svelte +1 -6
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsMultiple/_dropdownListItemsMultiple.scss +3 -8
- package/src/sdg/components/DropdownList/DropdownListItems/DropdownListItemsSingle/_dropdownListItemsSingle.scss +1 -2
- package/src/sdg/components/DropdownList/DropdownListItems/_dropdownListItems.scss +2 -4
- package/src/sdg/components/DropdownList/SelectWC.svelte +31 -50
- package/src/sdg/components/DropdownList/Test/DropdownListSvelteTest.svelte +37 -2
- package/src/sdg/components/DropdownList/Test/{dropdownListTest.html → dropdownListBaselineTest.html} +19 -1
- package/src/sdg/components/DropdownList/Test/dropdownListTestUtils.js +14 -0
- package/src/sdg/components/DropdownList/_dropdownList.scss +11 -16
- package/src/sdg/components/DropdownList/_select.html +9 -0
- package/src/sdg/components/Fieldset/_fieldset.scss +17 -4
- package/src/sdg/components/FormfieldRow/_formfieldRow.html +7 -7
- package/src/sdg/components/Label/_label.scss +1 -0
- package/src/sdg/components/Notice/_notice.html +3 -3
- package/src/sdg/components/PivFooter/PivFooter.svelte +2 -2
- package/src/sdg/components/PivHeader/PivHeader.svelte +79 -74
- package/src/sdg/components/PivHeader/Test/pivHeaderBaselineTest.html +14 -3
- package/src/sdg/components/PivHeader/Test/pivHeaderEmbeddedTest.svelte +2 -1
- package/src/sdg/components/PivHeader/Test/pivHeaderTest.js +9 -0
- package/src/sdg/components/PivHeader/_pivHeader.html +3 -2
- package/src/sdg/components/PivHeader/_pivHeader.scss +52 -23
- package/src/sdg/components/TextField/Test/textFieldBaselineTest.html +24 -5
- package/src/sdg/components/TextField/TextField.svelte +29 -25
- package/src/sdg/components/TextField/TextFieldWC.svelte +18 -8
- package/src/sdg/components/TextField/_textField.html +0 -5
- package/src/sdg/components/TextField/_textField.scss +6 -13
- package/src/sdg/components/utils.js +55 -14
- package/src/sdg/qc-sdg-test.js +4 -0
- package/src/sdg/scss/settings/_tokens.scss +0 -4
- package/tests/buildSvelteTestsIgnore.json +2 -1
- package/tests/dropdown-list-baseline.spec.ts +51 -4
- package/tests/piv-header-baseline.spec.ts +3 -0
- package/src/sdg/components/Button/Button.svelte +0 -50
- package/src/sdg/components/Button/ButtonWC.svelte +0 -36
- package/src/sdg/components/CharCount/_charCount.html +0 -7
- package/src/sdg/components/RadioButton/_radioButton.html +0 -24
- package/tests/piv-header-svelte.spec.ts +0 -11
|
@@ -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
|
-
|
|
498
|
-
|
|
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,24 +0,0 @@
|
|
|
1
|
-
<h2 id="radio-button">Boutons radio</h2>
|
|
2
|
-
<p>Les boutons radio sont aussi disponibles au format de <a href="#selection-button">boutons de sélection</a>.</p>
|
|
3
|
-
<h3>Exemples</h3>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<qc-radio-group id="exemple-radio-md"
|
|
7
|
-
legend="Choisissez une option :"
|
|
8
|
-
name="ex-md"
|
|
9
|
-
selection-button
|
|
10
|
-
>
|
|
11
|
-
<label>
|
|
12
|
-
<input type="radio"
|
|
13
|
-
name="ma-radio"
|
|
14
|
-
value="option1">
|
|
15
|
-
<span>Option 1</span>
|
|
16
|
-
</label>
|
|
17
|
-
<label>
|
|
18
|
-
<input type="radio"
|
|
19
|
-
name="ma-radio"
|
|
20
|
-
value="option2">
|
|
21
|
-
<span>Option 2</span>
|
|
22
|
-
</label>
|
|
23
|
-
</qc-radio-group>
|
|
24
|
-
|
|
@@ -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
|
-
});
|