qc-trousse-sdg 1.2.5 → 1.3.0-develop.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.
- package/README.md +18 -23
- 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_couleur.svg +24 -0
- package/dist/js/qc-sdg.min.js +1 -1
- package/package.json +23 -18
- package/public/css/qc-doc-sdg.css +247 -335
- package/public/css/qc-sdg-design-tokens.css +111 -64
- package/public/css/qc-sdg-no-grid.css +957 -453
- package/public/css/qc-sdg.css +966 -634
- package/public/img/QUEBEC_couleur.svg +24 -0
- package/public/img/ampoule.svg +1 -0
- package/public/img/arrow-up-white.svg +3 -0
- package/public/img/chevron-blue.svg +3 -0
- package/public/img/chevron-white.svg +3 -0
- package/public/img/clipboard.svg +8 -0
- package/public/img/error-white.svg +1 -0
- package/public/img/error.svg +1 -0
- package/public/img/exclamation-white.svg +37 -0
- package/public/img/external-link-white.svg +18 -0
- package/public/img/facebook.svg +6 -0
- package/public/img/information-white.svg +1 -0
- package/public/img/information.svg +1 -0
- package/public/img/linkedin.svg +5 -0
- package/public/img/loupe-piv-droite.svg +1 -0
- package/public/img/loupe-piv-fonce.svg +1 -0
- package/public/img/minus.svg +6 -0
- package/public/img/note.svg +1 -0
- package/public/img/piv-MCE-theme-clair.svg +79 -0
- package/public/img/piv-MCE-theme-sombre.svg +62 -0
- package/public/img/piv-bas-MCE-theme-clair.png +0 -0
- package/public/img/piv-bas-MCE-theme-sombre.png +0 -0
- package/public/img/piv-logo-pied-de-page.svg +37 -0
- package/public/img/plus.svg +6 -0
- package/public/img/question-mark.svg +47 -0
- package/public/img/success-white.svg +1 -0
- package/public/img/success.svg +1 -0
- package/public/img/twitter.svg +8 -0
- package/public/img/warning.svg +1 -0
- package/public/img/xclose-blue.svg +6 -0
- package/public/img/xclose-white.svg +1 -0
- package/public/img/youtube.svg +3 -0
- package/public/index.html +871 -715
- package/public/js/qc-doc-exemple.js +9 -0
- package/public/js/qc-doc-sdg.js +6893 -3724
- package/public/js/qc-sdg.js +2103 -962
- package/rollup.config.js +58 -32
- package/src/doc/components/Code.svelte +69 -0
- package/src/doc/components/Exemple.svelte +71 -0
- package/src/doc/components/Switch.svelte +108 -0
- package/src/doc/components/TopNav.svelte +53 -0
- package/src/doc/components/color-doc.svelte +44 -0
- package/src/doc/qc-doc-sdg.js +25 -14
- package/src/doc/scss/_tables.scss +1 -2
- package/src/doc/scss/components/_button.scss +14 -14
- package/src/doc/scss/components/_code.scss +106 -4
- package/src/doc/scss/jQueryUI/_jquery-ui.autocomplete.scss +48 -0
- package/src/doc/scss/qc-doc-sdg.scss +76 -75
- package/src/sdg/components/Button/IconButton.svelte +29 -0
- package/src/sdg/components/Icon.svelte +39 -0
- package/src/sdg/components/{pivHeader.svelte → PivHeader/pivHeader.svelte} +49 -69
- package/src/sdg/components/SearchBar/searchBar.svelte +87 -0
- package/src/sdg/components/SearchInput/SearchInput.svelte +48 -0
- package/src/sdg/components/alert.svelte +40 -23
- package/src/sdg/components/componentWrapper.js +0 -3
- package/src/sdg/components/externalLink.svelte +92 -0
- package/src/sdg/components/notice.svelte +61 -34
- package/src/sdg/components/pivFooter.svelte +37 -36
- package/src/sdg/components/toTop.svelte +17 -11
- package/src/sdg/components/utils.js +28 -4
- package/src/sdg/qc-sdg.js +11 -3
- package/src/sdg/scss/_qc-sdg-lib.scss +3 -0
- package/src/sdg/scss/base/_accessibility.scss +4 -0
- package/src/sdg/scss/base/_colors.scss +10 -10
- package/src/sdg/scss/base/_figure.scss +14 -9
- package/src/sdg/scss/base/_fonts.scss +4 -4
- package/src/sdg/scss/base/_form.scss +7 -0
- package/src/sdg/scss/base/_layout.scss +45 -0
- package/src/sdg/scss/base/_lists.scss +5 -5
- package/src/sdg/scss/base/_shadings.scss +3 -11
- package/src/sdg/scss/base/_typography.scss +42 -25
- package/src/sdg/scss/components/_alert.scss +11 -34
- package/src/sdg/scss/components/_icons.scss +80 -57
- package/src/sdg/scss/components/_notice.scss +51 -44
- package/src/sdg/scss/components/_pivFooter.scss +35 -23
- package/src/sdg/scss/components/_pivHeader.scss +131 -154
- package/src/sdg/scss/components/_searchBar.scss +75 -0
- package/src/sdg/scss/components/_searchInput.scss +64 -0
- package/src/sdg/scss/components/_separator.scss +2 -5
- package/src/sdg/scss/components/_toTop.scss +4 -6
- package/src/sdg/scss/grid/_grid-lib.scss +516 -0
- package/src/sdg/scss/grid/_grid.scss +78 -0
- package/src/sdg/scss/lib/_functions.scss +78 -0
- package/src/sdg/scss/lib/_gridless-lib.scss +4 -0
- package/src/sdg/scss/lib/_mixins.scss +221 -0
- package/src/sdg/scss/qc-design-tokens.scss +31 -8
- package/src/sdg/scss/qc-sdg-utilities.scss +1 -0
- package/src/sdg/scss/qc-sdg.scss +1 -1
- package/src/sdg/scss/qc-sgd-no-grid.scss +20 -15
- package/src/sdg/scss/settings/_base.scss +58 -0
- package/src/sdg/scss/settings/_tokens.scss +145 -77
- package/src/sdg/scss/utilities/_display.scss +43 -3
- package/src/sdg/scss/utilities/_themes.scss +17 -0
- package/src/sdg/scss/vendor/modern-css-reset/src/reset.css +9 -8
- package/src/doc/components/code.svelte +0 -54
- package/src/sdg/scss/base/_grid.scss +0 -9
- package/src/sdg/scss/functions/_tokens.scss +0 -12
- package/src/sdg/scss/functions/_utils.scss +0 -44
- package/src/sdg/scss/modules/_grid.scss +0 -19
- package/src/sdg/scss/modules/_map.scss +0 -14
- package/src/sdg/scss/modules/_tokens.scss +0 -3
- package/src/sdg/scss/modules/_utils.scss +0 -55
- package/src/sdg/scss/settings/_grid.scss +0 -24
- package/src/sdg/scss/settings/_settings.scss +0 -12
- package/src/sdg/sprites/dist/view/svg/sprite.view.svg +0 -1
- package/src/sdg/sprites/gulpfile.js +0 -41
- package/src/sdg/sprites/package-lock.json +0 -5949
- package/src/sdg/sprites/package.json +0 -16
- package/src/sdg/sprites/svg/QUEBEC_blanc.svg +0 -13
- package/src/sdg/sprites/svg/external-link.svg +0 -10
- package/src/sdg/sprites/svg/logo-quebec-piv-footer.svg +0 -1
- /package/dist/img/{quebec-logo.svg → QUEBEC_blanc.svg} +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/arrow-up-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/chevron-blue.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/chevron-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/clipboard.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/error-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/error.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/exclamation-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/external-link-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/facebook.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/information-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/information.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/linkedin.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/loupe-piv-droite.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/loupe-piv-fonce.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/minus.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/plus.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/question-mark.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/success-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/success.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/twitter.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/warning.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/xclose-blue.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/xclose-white.svg +0 -0
- /package/{src/sdg/sprites/svg → dist/img}/youtube.svg +0 -0
- /package/{src/sdg/sprites/svg/quebec-logo.svg → public/img/QUEBEC_blanc.svg} +0 -0
package/rollup.config.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import svelte from 'rollup-plugin-svelte';
|
|
2
2
|
import resolve from '@rollup/plugin-node-resolve';
|
|
3
3
|
import css from 'rollup-plugin-css-only'
|
|
4
|
-
import
|
|
4
|
+
import sveltePreprocess from 'svelte-preprocess';
|
|
5
5
|
import commonjs from '@rollup/plugin-commonjs'
|
|
6
|
-
import
|
|
6
|
+
import terser from '@rollup/plugin-terser';
|
|
7
|
+
// import scss from 'rollup-plugin-sass'
|
|
7
8
|
import scss from 'rollup-plugin-scss'
|
|
8
9
|
import copy from 'rollup-plugin-copy'
|
|
9
10
|
import replace from '@rollup/plugin-replace';
|
|
@@ -11,11 +12,17 @@ import postcss from 'postcss'
|
|
|
11
12
|
import autoprefixer from 'autoprefixer'
|
|
12
13
|
import cssReplace from 'postcss-replace'
|
|
13
14
|
import pkg from './package.json';
|
|
15
|
+
import fs from "fs";
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
const dev_process = (process.env.npm_lifecycle_event == 'dev');
|
|
17
19
|
const verbose = false;
|
|
18
|
-
const
|
|
20
|
+
const includePaths = [
|
|
21
|
+
'src/sdg/scss',
|
|
22
|
+
'src/doc/scss'
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
// const path = require('path');
|
|
19
26
|
|
|
20
27
|
function serve() {
|
|
21
28
|
// Keep a reference to a spawned server process
|
|
@@ -47,6 +54,7 @@ function serve() {
|
|
|
47
54
|
}
|
|
48
55
|
|
|
49
56
|
const scssOptions = {
|
|
57
|
+
includePaths: includePaths,
|
|
50
58
|
processor: css =>
|
|
51
59
|
postcss([
|
|
52
60
|
autoprefixer(),
|
|
@@ -55,13 +63,19 @@ const scssOptions = {
|
|
|
55
63
|
'pkg-version': pkg.version
|
|
56
64
|
}
|
|
57
65
|
})
|
|
58
|
-
])
|
|
66
|
+
])
|
|
67
|
+
.process(css, {
|
|
68
|
+
from: undefined
|
|
69
|
+
})
|
|
70
|
+
.then((result) => result.css),
|
|
59
71
|
sourceMap: false,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
|
|
73
|
+
prependData: `
|
|
74
|
+
@use "qc-sdg-lib" as *;
|
|
75
|
+
`,
|
|
63
76
|
outputStyle: dev_process ? 'expanded' : 'compressed',
|
|
64
|
-
watch: ['src/sdg/scss', 'src/doc/scss']
|
|
77
|
+
watch: ['src/sdg/scss', 'src/doc/scss'],
|
|
78
|
+
silenceDeprecations: ['legacy-js-api'],
|
|
65
79
|
};
|
|
66
80
|
|
|
67
81
|
let
|
|
@@ -74,8 +88,16 @@ let
|
|
|
74
88
|
, svelteOptions = {
|
|
75
89
|
compilerOptions: {
|
|
76
90
|
// enable run-time checks
|
|
77
|
-
customElement: true
|
|
78
|
-
|
|
91
|
+
customElement: true,
|
|
92
|
+
cssHash: ({ hash, name, filename, css }) => {
|
|
93
|
+
// replacement of default `svelte-${hash(css)}`
|
|
94
|
+
return `qc-hash-${hash(css)}`;
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
emitCss: false,
|
|
98
|
+
preprocess: sveltePreprocess({
|
|
99
|
+
scss: scssOptions
|
|
100
|
+
})
|
|
79
101
|
}
|
|
80
102
|
, rollupOptions = [
|
|
81
103
|
{
|
|
@@ -86,7 +108,7 @@ let
|
|
|
86
108
|
? 'public/js/qc-sdg.js'
|
|
87
109
|
: 'dist/js/qc-sdg.min.js',
|
|
88
110
|
format: 'iife',
|
|
89
|
-
name: 'qcSdg'
|
|
111
|
+
name: 'qcSdg',
|
|
90
112
|
},
|
|
91
113
|
plugins: [
|
|
92
114
|
replace(replacements),
|
|
@@ -104,23 +126,16 @@ let
|
|
|
104
126
|
|
|
105
127
|
// will output compiled styles to output.css
|
|
106
128
|
scss(Object.assign({
|
|
107
|
-
output:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
output: (styles, styleNodes) => {
|
|
130
|
+
fs.writeFileSync( dev_process
|
|
131
|
+
? 'public/css/qc-sdg.css'
|
|
132
|
+
: 'dist/css/qc-sdg.min.css'
|
|
133
|
+
, styles)
|
|
134
|
+
}}
|
|
111
135
|
, scssOptions
|
|
112
136
|
)),
|
|
113
137
|
!dev_process && copy({
|
|
114
138
|
targets: [
|
|
115
|
-
{
|
|
116
|
-
src: `src/sdg/sprites/dist/view/svg/sprite.view.svg`,
|
|
117
|
-
dest: [`dist/img`,`public/img`],
|
|
118
|
-
rename: () => 'qc-sprite.svg'
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
src: 'src/sdg/sprites/svg/external-link.svg',
|
|
122
|
-
dest: [`dist/img`,`public/img`],
|
|
123
|
-
},
|
|
124
139
|
{
|
|
125
140
|
src: 'dist/img/*',
|
|
126
141
|
dest: [`public/img`],
|
|
@@ -148,9 +163,12 @@ let
|
|
|
148
163
|
}),
|
|
149
164
|
// will output compiled styles to output.css
|
|
150
165
|
scss(Object.assign({
|
|
151
|
-
output:
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
output: (styles, styleNodes) => {
|
|
167
|
+
fs.writeFileSync( dev_process
|
|
168
|
+
? 'public/css/qc-sdg-no-grid.css'
|
|
169
|
+
: 'dist/css/qc-sdg-no-grid.min.css'
|
|
170
|
+
, styles)
|
|
171
|
+
}
|
|
154
172
|
}
|
|
155
173
|
, scssOptions
|
|
156
174
|
))
|
|
@@ -168,9 +186,12 @@ let
|
|
|
168
186
|
browser: true
|
|
169
187
|
}),
|
|
170
188
|
scss(Object.assign({
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
189
|
+
output: (styles, styleNodes) => {
|
|
190
|
+
fs.writeFileSync( dev_process
|
|
191
|
+
? 'public/css/qc-sdg-design-tokens.css'
|
|
192
|
+
: 'dist/css/qc-sdg-design-tokens.min.css'
|
|
193
|
+
, styles)
|
|
194
|
+
}
|
|
174
195
|
}
|
|
175
196
|
, scssOptions
|
|
176
197
|
)),
|
|
@@ -197,8 +218,13 @@ if (dev_process) {
|
|
|
197
218
|
}),
|
|
198
219
|
commonjs(),
|
|
199
220
|
scss(
|
|
200
|
-
Object.assign(
|
|
201
|
-
|
|
221
|
+
Object.assign({
|
|
222
|
+
output: (styles, styleNodes) => {
|
|
223
|
+
fs.writeFileSync( dev_process
|
|
224
|
+
? 'public/css/qc-doc-sdg.css'
|
|
225
|
+
: 'dist/css/qc-doc-sdg.min.css'
|
|
226
|
+
, styles)
|
|
227
|
+
}},
|
|
202
228
|
scssOptions
|
|
203
229
|
)
|
|
204
230
|
),
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<svelte:options customElement="{{
|
|
2
|
+
tag: 'qc-code'
|
|
3
|
+
, shadow: 'none'
|
|
4
|
+
, props: {
|
|
5
|
+
targetId : {attribute: 'target-id'},
|
|
6
|
+
rawCode : {attribute: 'raw-code'},
|
|
7
|
+
outerHTML: {attribute: 'outer-html', type: 'Boolean'},
|
|
8
|
+
}
|
|
9
|
+
}}" />
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
|
|
13
|
+
import {HighlightJS} from "highlight.js"
|
|
14
|
+
// import 'highlight.js/styles/default.css';
|
|
15
|
+
import pretty from "pretty";
|
|
16
|
+
import { onMount } from "svelte";
|
|
17
|
+
import { Utils } from "../../sdg/components/utils"
|
|
18
|
+
|
|
19
|
+
export let
|
|
20
|
+
targetId = ''
|
|
21
|
+
, rawCode = ''
|
|
22
|
+
, language = 'html'
|
|
23
|
+
, outerHTML = false
|
|
24
|
+
;
|
|
25
|
+
|
|
26
|
+
let
|
|
27
|
+
hlCode
|
|
28
|
+
, prettyCode
|
|
29
|
+
;
|
|
30
|
+
|
|
31
|
+
function copy() {
|
|
32
|
+
navigator.clipboard.writeText(prettyCode);
|
|
33
|
+
this.classList.add('copied')
|
|
34
|
+
setTimeout(() => {this.classList.remove('copied')}, 500)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function updateHLCode(rawCode, targetId) {
|
|
38
|
+
if (!rawCode) {
|
|
39
|
+
rawCode = document.getElementById(targetId)?.[outerHTML ? 'outerHTML' : 'innerHTML' ]
|
|
40
|
+
?? ''
|
|
41
|
+
}
|
|
42
|
+
rawCode
|
|
43
|
+
. replace('class="mounted"', '')
|
|
44
|
+
. replace('/qc-hash-.*/g', '')
|
|
45
|
+
. replace('/is-external=""/g', 'is-external')
|
|
46
|
+
;
|
|
47
|
+
prettyCode = pretty(rawCode, {wrap_attributes: 'force-aligned'});
|
|
48
|
+
hlCode = HighlightJS.highlight(prettyCode, {language:language}).value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
$: updateHLCode(rawCode, targetId)
|
|
52
|
+
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<pre
|
|
56
|
+
><code class="hljs"
|
|
57
|
+
><button class="btn btn-sm btn-primary"
|
|
58
|
+
on:click={copy}>
|
|
59
|
+
<span class="copy">copier</span>
|
|
60
|
+
<span class="copied">copié !</span>
|
|
61
|
+
</button
|
|
62
|
+
>{@html hlCode}</code
|
|
63
|
+
></pre>
|
|
64
|
+
<style lang="scss">
|
|
65
|
+
pre {
|
|
66
|
+
max-inline-size: token-value(max-content-width);
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
69
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<svelte:options customElement={{
|
|
2
|
+
tag: 'qc-doc-exemple',
|
|
3
|
+
shadow: 'none',
|
|
4
|
+
props: {
|
|
5
|
+
caption : {attribute: 'caption'},
|
|
6
|
+
codeTargetId: {attribute: 'code-target-id'},
|
|
7
|
+
hideCode: {attribute: 'hide-code', type: 'Boolean'},
|
|
8
|
+
rawCode: {attribute: 'raw-code'}
|
|
9
|
+
}
|
|
10
|
+
}} />
|
|
11
|
+
<script>
|
|
12
|
+
import Code from "./Code.svelte";
|
|
13
|
+
import {onMount} from "svelte";
|
|
14
|
+
export let
|
|
15
|
+
caption = "SVP fournir une description"
|
|
16
|
+
, codeTargetId
|
|
17
|
+
, hideCode = false
|
|
18
|
+
, rawCode
|
|
19
|
+
;
|
|
20
|
+
let exempleCode,
|
|
21
|
+
figure,
|
|
22
|
+
rootElement,
|
|
23
|
+
exempleArea,
|
|
24
|
+
figCaption;
|
|
25
|
+
onMount(() => {
|
|
26
|
+
rootElement.parentElement.childNodes.forEach(node => {
|
|
27
|
+
if (node.nodeType == 3) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (node != rootElement) {
|
|
31
|
+
// let detach = rootElement.removeChild(node)
|
|
32
|
+
exempleArea.appendChild(node)
|
|
33
|
+
}
|
|
34
|
+
exempleCode = rawCode
|
|
35
|
+
? rawCode
|
|
36
|
+
: (codeTargetId ? document.getElementById(codeTargetId): exempleArea).innerHTML;
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div bind:this={rootElement}
|
|
43
|
+
class="exemple-area"
|
|
44
|
+
>
|
|
45
|
+
<figure {...$$restProps}
|
|
46
|
+
bind:this={figure}
|
|
47
|
+
>
|
|
48
|
+
<div bind:this={exempleArea}
|
|
49
|
+
class="exemple"
|
|
50
|
+
></div>
|
|
51
|
+
<figcaption bind:this={figCaption}>
|
|
52
|
+
{@html caption}
|
|
53
|
+
</figcaption>
|
|
54
|
+
</figure>
|
|
55
|
+
{#if !hideCode}
|
|
56
|
+
<Code rawCode={exempleCode}></Code>
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
<style lang="scss">
|
|
60
|
+
figure {
|
|
61
|
+
//display: block;
|
|
62
|
+
max-width: token-value(max-content-width);
|
|
63
|
+
width: 100%;
|
|
64
|
+
@include qc-shading(0);
|
|
65
|
+
margin-bottom: token-value(spacer content-block mb);
|
|
66
|
+
.exemple {
|
|
67
|
+
padding: token-value(spacer sm) token-value(spacer sm) 0 token-value(spacer sm);
|
|
68
|
+
margin-bottom: token-value(spacer sm);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
<svelte:options customElement="{{
|
|
2
|
+
tag: 'qc-switch',
|
|
3
|
+
shadow:'none'
|
|
4
|
+
}}" />
|
|
5
|
+
<script>
|
|
6
|
+
export let
|
|
7
|
+
value=false,
|
|
8
|
+
name='switch',
|
|
9
|
+
color = {
|
|
10
|
+
unchecked: 'grey-light',
|
|
11
|
+
checked: 'blue-regular',
|
|
12
|
+
slider: 'background'
|
|
13
|
+
}
|
|
14
|
+
;
|
|
15
|
+
|
|
16
|
+
</script>
|
|
17
|
+
<div class="switch"
|
|
18
|
+
style="--unchecked-bg-color: var(--qc-color-{color.unchecked});
|
|
19
|
+
--checked-bg-color: var(--qc-color-{color.checked});
|
|
20
|
+
--slider-color: var(--qc-color-{color.slider});
|
|
21
|
+
"
|
|
22
|
+
>
|
|
23
|
+
<input type="checkbox"
|
|
24
|
+
role="switch"
|
|
25
|
+
{name}
|
|
26
|
+
bind:checked={value}
|
|
27
|
+
aria-checked={value}
|
|
28
|
+
{...$$restProps}
|
|
29
|
+
/>
|
|
30
|
+
<span class="slider round" ></span>
|
|
31
|
+
</div>
|
|
32
|
+
<style lang="scss">
|
|
33
|
+
|
|
34
|
+
$switch-height: 32;
|
|
35
|
+
$switch-width: 56;
|
|
36
|
+
$switch-gap: 2;
|
|
37
|
+
$slider-height: $switch-height - 2 * $switch-gap;
|
|
38
|
+
|
|
39
|
+
/* The switch - the box around the slider */
|
|
40
|
+
.switch {
|
|
41
|
+
position: relative;
|
|
42
|
+
display: inline-block;
|
|
43
|
+
width: rem($switch-width);
|
|
44
|
+
height: rem($switch-height);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Hide default HTML checkbox */
|
|
48
|
+
input {
|
|
49
|
+
z-index: 10;
|
|
50
|
+
opacity: 0;
|
|
51
|
+
position: absolute;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
margin:0;
|
|
54
|
+
padding:0;
|
|
55
|
+
inset: 0;
|
|
56
|
+
height: auto;
|
|
57
|
+
width: auto;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* The slider */
|
|
61
|
+
.slider {
|
|
62
|
+
z-index: 5;
|
|
63
|
+
//opacity: 0;
|
|
64
|
+
position: absolute;
|
|
65
|
+
|
|
66
|
+
top: 0;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: 0;
|
|
69
|
+
bottom: 0;
|
|
70
|
+
background-color: var(--unchecked-bg-color);
|
|
71
|
+
-webkit-transition: .4s;
|
|
72
|
+
transition: .4s;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.slider::before {
|
|
76
|
+
position: absolute;
|
|
77
|
+
content: "";
|
|
78
|
+
height: rem($slider-height);
|
|
79
|
+
width: rem($slider-height);
|
|
80
|
+
left: rem($switch-gap);
|
|
81
|
+
bottom: rem($switch-gap);
|
|
82
|
+
background-color: var(--slider-color);
|
|
83
|
+
-webkit-transition: .4s;
|
|
84
|
+
transition: .4s;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
input:checked + .slider {
|
|
88
|
+
background-color: var(--checked-bg-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
input:focus + .slider {
|
|
92
|
+
box-shadow: 0 0 1px token-value(bok-shadow color);
|
|
93
|
+
}
|
|
94
|
+
$slider-translateX: translateX(rem($switch-width - $slider-height - 2 * $switch-gap));
|
|
95
|
+
input:checked + .slider::before {
|
|
96
|
+
transform: $slider-translateX;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.slider.round, input {
|
|
100
|
+
border-radius: rem($switch-height);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.slider.round::before {
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<svelte:options customElement="{{
|
|
2
|
+
tag: 'qc-doc-top-nav',
|
|
3
|
+
shadow: 'none',
|
|
4
|
+
props: {
|
|
5
|
+
|
|
6
|
+
}
|
|
7
|
+
}}" />
|
|
8
|
+
<script>
|
|
9
|
+
import Switch from "./Switch.svelte";
|
|
10
|
+
let value = localStorage.getItem('dark-theme') === "true";
|
|
11
|
+
|
|
12
|
+
$: document.documentElement.classList.toggle('qc-dark-theme', value)
|
|
13
|
+
$: localStorage.setItem('dark-theme', value)
|
|
14
|
+
</script>
|
|
15
|
+
<div role="complementary">
|
|
16
|
+
<div class="qc-container top-nav">
|
|
17
|
+
<div class="switch-control">
|
|
18
|
+
<label for="switch">Activer le thème sombre</label>
|
|
19
|
+
<Switch id="switch" bind:value />
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<style lang="scss">
|
|
24
|
+
|
|
25
|
+
[role=complementary] {
|
|
26
|
+
position: sticky;
|
|
27
|
+
z-index: 100;
|
|
28
|
+
top: 0;
|
|
29
|
+
background-color: token-value(color blue medium);
|
|
30
|
+
color: token-value(color grey pale);
|
|
31
|
+
min-height: rem(72);
|
|
32
|
+
height: rem(72);
|
|
33
|
+
}
|
|
34
|
+
.top-nav {
|
|
35
|
+
position: absolute;
|
|
36
|
+
inset: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
|
|
39
|
+
align-items: end;
|
|
40
|
+
padding-bottom: token-value(spacer sm);
|
|
41
|
+
.switch-control {
|
|
42
|
+
margin-left: auto;
|
|
43
|
+
margin-right: 0;
|
|
44
|
+
display: flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
label:first-child {
|
|
47
|
+
margin-right: rem(16);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<svelte:options customElement="{{
|
|
2
|
+
tag: 'qc-color-doc'
|
|
3
|
+
, props: {
|
|
4
|
+
color : {attribute: 'target-id'},
|
|
5
|
+
rawCode : {attribute: 'raw-code'},
|
|
6
|
+
}
|
|
7
|
+
}}" />
|
|
8
|
+
<script>
|
|
9
|
+
export let
|
|
10
|
+
title,
|
|
11
|
+
token,
|
|
12
|
+
border = null
|
|
13
|
+
;
|
|
14
|
+
|
|
15
|
+
</script>
|
|
16
|
+
<div class="color-details">
|
|
17
|
+
<div class="color-sample qc-bg-color-{token.split(',')[0]}"
|
|
18
|
+
class:border={border}></div>
|
|
19
|
+
<div class="color-description">
|
|
20
|
+
<strong>{title}</strong><br/>
|
|
21
|
+
<code>{token.split(',').map(part => '--qc-color-' + part.trim()).join(', ')}</code>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
<style lang="scss">
|
|
25
|
+
@use "base/colors";
|
|
26
|
+
.color-details {
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: flex-start;
|
|
29
|
+
align-items: center;
|
|
30
|
+
> div + div {
|
|
31
|
+
margin-left: token-value(spacer,md);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.color-sample {
|
|
36
|
+
width: rem(6 * $base-spacer);
|
|
37
|
+
height: rem(6 * $base-spacer);
|
|
38
|
+
border-radius: 50%;
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
}
|
|
41
|
+
.border {
|
|
42
|
+
border: 1px solid token-value(color grey light);
|
|
43
|
+
}
|
|
44
|
+
</style>
|
package/src/doc/qc-doc-sdg.js
CHANGED
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
export * from './components/
|
|
1
|
+
export * from './components/Code.svelte';
|
|
2
|
+
export * from './components/color-doc.svelte'
|
|
3
|
+
export * from './components/TopNav.svelte'
|
|
4
|
+
export * from './components/Switch.svelte'
|
|
5
|
+
export * from './components/Exemple.svelte'
|
|
2
6
|
import './scss/qc-doc-sdg.scss';
|
|
3
7
|
|
|
8
|
+
if (document.getElementById("version")) {
|
|
9
|
+
document.getElementById("version").textContent = `_vSDG_`
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
// Show maskable "general alert" component
|
|
5
13
|
const displayAlertLink = document.getElementById("show-qc-alert");
|
|
6
|
-
const maskableAlert = document.getElementById("
|
|
7
|
-
displayAlertLink
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
14
|
+
const maskableAlert = document.getElementById("alerte-masquable");
|
|
15
|
+
if (displayAlertLink) {
|
|
16
|
+
displayAlertLink.addEventListener(
|
|
17
|
+
'click',
|
|
18
|
+
() => {
|
|
19
|
+
maskableAlert.setAttribute('hide', 'false');
|
|
20
|
+
displayAlertLink.hidden = true;
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
document.addEventListener(
|
|
24
|
+
'qc.alert.hide',
|
|
25
|
+
() => displayAlertLink.hidden = false
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
18
29
|
|
|
19
30
|
// add version
|
|
20
|
-
|
|
31
|
+
|
|
21
32
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
@use "
|
|
2
|
-
@use "functions/utils" as *;
|
|
3
|
-
@use "modules/tokens" as *;
|
|
4
|
-
@use "modules/utils" as *;
|
|
1
|
+
@use "qc-sdg-lib" as *;
|
|
5
2
|
@use "base/shadings" as *;
|
|
6
3
|
|
|
7
4
|
@mixin button-border-and-padding($border-size, $padding-y, $padding-x) {
|
|
@@ -12,7 +9,7 @@
|
|
|
12
9
|
|
|
13
10
|
.btn {
|
|
14
11
|
/* si Compact font-weight: 600; */
|
|
15
|
-
@include content-font();
|
|
12
|
+
@include content-font($include-family: 1);
|
|
16
13
|
display: inline-block;
|
|
17
14
|
box-sizing: border-box;
|
|
18
15
|
min-width: rem(112);
|
|
@@ -31,29 +28,32 @@
|
|
|
31
28
|
@include button-border-and-padding(1px, xs, sm);
|
|
32
29
|
}
|
|
33
30
|
|
|
31
|
+
@mixin state-color($color) {
|
|
32
|
+
border-color : $color;
|
|
33
|
+
background-color: $color;
|
|
34
|
+
}
|
|
35
|
+
|
|
34
36
|
&.btn-primary {
|
|
35
37
|
|
|
36
|
-
color:
|
|
38
|
+
color: token-value(color background);
|
|
37
39
|
border-color: token-value(color blue piv);
|
|
38
40
|
background-color: token-value(color blue piv);
|
|
39
|
-
@
|
|
41
|
+
@include qc-shading(1);
|
|
40
42
|
|
|
41
43
|
&:hover {
|
|
42
|
-
|
|
43
|
-
background-color: #156bb2;
|
|
44
|
+
@include state-color(token-value(color blue regular));
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
&:focus {
|
|
47
|
-
|
|
48
|
-
background-color: #156bb2;
|
|
47
|
+
&:focus,&:focus-visible {
|
|
48
|
+
@include state-color(token-value(color blue regular));
|
|
49
49
|
box-shadow:
|
|
50
50
|
0 2px 8px rgba(34, 54, 84, 0.24),
|
|
51
51
|
0 0 0 2px token-value(color blue light);
|
|
52
|
+
outline: none;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
&:active {
|
|
55
|
-
|
|
56
|
-
background-color: #3783c9;
|
|
56
|
+
@include state-color(token-value(color blue regular_light));
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|