@gouvfr/dsfr-roller 1.0.7 → 1.0.8

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 (89) hide show
  1. package/package.json +2 -2
  2. package/src/component/components/button.js +2 -2
  3. package/src/component/components/header.js +1 -1
  4. package/src/node/directive/{doc → components/accordion}/accordion-container-directive.js +4 -4
  5. package/src/node/directive/{doc → components/accordion}/accordions-group-container-directive.js +1 -1
  6. package/src/node/directive/{doc → components/button}/button-leaf-directive.js +3 -3
  7. package/src/node/directive/components/card/card-container-directive.js +114 -0
  8. package/src/node/directive/{doc → components/table}/table-container-directive.js +7 -7
  9. package/src/node/directive/{doc → components/tabs}/tab-container-directive.js +1 -1
  10. package/src/node/directive/{doc → components/tabs}/tabs-container-directive.js +1 -1
  11. package/src/node/directive/components/tile/tile-container-directive.js +135 -0
  12. package/src/node/directive/core/grid-container-directive.js +15 -0
  13. package/src/node/directive/doc/{anatomy-container-directive.js → guidance/anatomy-container-directive.js} +2 -2
  14. package/src/node/directive/doc/{guideline-container-directive.js → guidance/guideline-container-directive.js} +3 -3
  15. package/src/node/directive/doc/{guidelines-container-directive.js → guidance/guidelines-container-directive.js} +1 -1
  16. package/src/node/directive/doc/{pin-leaf-directive.js → guidance/pin-leaf-directive.js} +1 -1
  17. package/src/node/directive/doc/page-item-card-container-directive.js +53 -0
  18. package/src/node/directive/doc/page-item-list-leaf-directive.js +33 -0
  19. package/src/node/directive/doc/tab-navigation-container-directive.js +1 -1
  20. package/src/node/directive/doc/video-leaf-directive.js +44 -0
  21. package/src/node/directive/home/hp-analytics-container-directive.js +67 -0
  22. package/src/node/directive/home/hp-community-container-directive.js +78 -0
  23. package/src/node/directive/home/hp-community-tile-container-directive.js +57 -0
  24. package/src/node/directive/home/hp-discover-container-directive.js +41 -0
  25. package/src/node/directive/home/hp-discover-tile-container-directive.js +81 -0
  26. package/src/node/directive/home/hp-faq-container-directive.js +60 -0
  27. package/src/node/directive/home/hp-goals-container-directive.js +37 -0
  28. package/src/node/directive/home/hp-hero-container-directive.js +54 -0
  29. package/src/node/directive/home/hp-news-container-directive.js +53 -0
  30. package/src/node/directive/home/hp-showcase-card-container-directive.js +81 -0
  31. package/src/node/directive/home/hp-showcase-container-directive.js +55 -0
  32. package/src/node/directive/home/hp-slice-video-container-directive.js +246 -0
  33. package/src/node/generic/link-node.js +1 -1
  34. package/src/node/node-factory.js +45 -11
  35. package/src/page/head/head.js +3 -0
  36. package/src/page/head/resource.js +17 -0
  37. package/src/page/head/share.js +23 -5
  38. package/src/page/head/stylesheets.js +2 -1
  39. package/src/page/page.js +3 -1
  40. package/src/page/scripts/scripts.js +2 -1
  41. package/src/script/home/index.js +10 -0
  42. package/src/script/home/inject-svg.js +28 -0
  43. package/src/script/home/show-on-scroll.js +24 -0
  44. package/src/script/home/stop-video-on-close.js +20 -0
  45. package/src/script/main/cmp/index.js +72 -0
  46. package/src/script/main/cmp/tarteaucitron/config.js +34 -0
  47. package/src/script/main/cmp/tarteaucitron/lang.js +14 -0
  48. package/src/script/main/cmp/tarteaucitron/services.js +9142 -0
  49. package/src/script/main/cmp/tarteaucitron/tarteaucitron.js +3301 -0
  50. package/src/script/main/core/element.js +7 -3
  51. package/src/script/main/core/get-current-repo.js +6 -0
  52. package/src/script/main/core/get-query.js +12 -0
  53. package/src/script/main/core/replace-fragments.js +4 -0
  54. package/src/script/main/elements/pagination/index.js +23 -0
  55. package/src/script/main/elements/pagination/pagination-item.js +94 -0
  56. package/src/script/main/elements/pagination/pagination-list.js +131 -0
  57. package/src/script/main/elements/search-bar/index.js +64 -0
  58. package/src/script/main/elements/search-bar/results/result-item.js +13 -0
  59. package/src/script/main/elements/search-bar/results/results-button.js +20 -0
  60. package/src/script/main/elements/search-bar/results/results-dropdown.js +48 -0
  61. package/src/script/main/elements/search-bar/results/results-empty.js +21 -0
  62. package/src/script/main/elements/search-bar/results/results-list.js +19 -0
  63. package/src/script/main/index.js +11 -5
  64. package/src/script/main/minisearch/index.js +46 -0
  65. package/src/script/search/elements/result-card.js +46 -0
  66. package/src/script/search/elements/results-count.js +21 -0
  67. package/src/script/search/elements/results-empty.js +21 -0
  68. package/src/script/search/elements/results-list.js +25 -0
  69. package/src/script/search/elements/search-page.js +44 -0
  70. package/src/script/search/index.js +9 -0
  71. package/src/style/home/_analytics.scss +105 -0
  72. package/src/style/home/_community.scss +222 -0
  73. package/src/style/home/_discover.scss +208 -0
  74. package/src/style/home/_faq.scss +24 -0
  75. package/src/style/home/_goals.scss +53 -0
  76. package/src/style/home/_hero.scss +135 -0
  77. package/src/style/home/_news.scss +26 -0
  78. package/src/style/home/_showcase.scss +129 -0
  79. package/src/style/home/_slice-video.scss +168 -0
  80. package/src/style/home/index.scss +13 -0
  81. package/src/style/main/components/_dsfr-doc-pagination.scss +4 -0
  82. package/src/style/main/components/_dsfr-doc-searchbar.scss +54 -0
  83. package/src/style/main/components/_index.scss +3 -1
  84. package/src/style/search/_search-page.scss +0 -0
  85. package/src/style/search/index.scss +1 -0
  86. package/src/template/templates/home-template.js +4 -3
  87. package/src/template/templates/search-template.js +15 -8
  88. package/static/img/placeholder.16x9.png +0 -0
  89. package/src/script/main/elements/searchbar.js +0 -18
@@ -0,0 +1,44 @@
1
+ import { Element } from '../../main/core/element.js';
2
+ import { getQuery } from '../../main/core/get-query.js';
3
+ import { ResultsList } from './results-list.js';
4
+ import { ResultsCount } from './results-count.js';
5
+ import { Pagination } from '../../main/elements/pagination/index.js';
6
+
7
+ const RESULTS_PER_PAGES = 10;
8
+
9
+ class SearchPage extends Element {
10
+ constructor(element) {
11
+ super(element, 'searchPage');
12
+
13
+ this._query = getQuery();
14
+ this._searchBarInput = document.querySelector('#search-input');
15
+ this._resultsCount = document.querySelector('#results-count');
16
+ this._resultsList = document.querySelector('#results-cards');
17
+ this._container = element.querySelector('#results-page--container');
18
+ }
19
+
20
+ async init() {
21
+ await window.searchEngine.init('searchPage');
22
+
23
+ if (this._query) {
24
+ this._searchBarInput.value = this._query;
25
+ const results = window.searchEngine.search(this._query);
26
+
27
+ const count = new ResultsCount(results.length);
28
+ const resultsList = new ResultsList(results, RESULTS_PER_PAGES);
29
+
30
+ this._resultsCount.innerHTML = count.render();
31
+
32
+ this._container.appendChild(resultsList.element);
33
+ resultsList.init();
34
+
35
+ if (results.length > RESULTS_PER_PAGES) {
36
+ const pagination = new Pagination(results, RESULTS_PER_PAGES);
37
+ this._container.appendChild(pagination.element);
38
+ pagination.init();
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+ export { SearchPage };
@@ -0,0 +1,9 @@
1
+ import { instantiateElements } from '../main/core/element.js'
2
+ import { SearchBar } from '../main/elements/search-bar/index.js';
3
+ import { SearchPage } from './elements/search-page.js';
4
+
5
+
6
+ window.onload = async () => {
7
+ await instantiateElements('#search', SearchBar);
8
+ await instantiateElements('#results-page', SearchPage);
9
+ };
@@ -0,0 +1,105 @@
1
+ .dsfr-doc-hp-analytics {
2
+ padding: 3.25rem 0;
3
+ border-top: 2 solid var(--border-default-grey);
4
+
5
+ .fr-container {
6
+ display: flex;
7
+ flex-direction: column;
8
+ }
9
+
10
+ &__title {
11
+ font-size: 1.5rem;
12
+ line-height: 2rem;
13
+ margin-bottom: 1rem;
14
+ }
15
+
16
+ &__desc {
17
+ font-size: 1.125rem;
18
+ line-height: 1.75rem;
19
+ }
20
+
21
+ &__content {
22
+ display: flex;
23
+ flex-direction: column;
24
+ align-items: flex-start;
25
+ justify-content: center;
26
+ }
27
+
28
+ &__link.fr-btn {
29
+ width: 100%;
30
+ justify-content: center;
31
+ }
32
+
33
+ &__img {
34
+ display: flex;
35
+ align-items: flex-start;
36
+ margin-bottom: 2rem;
37
+ display: flex;
38
+ width: 100%;
39
+
40
+ img,
41
+ svg {
42
+ box-shadow: 0px 0px 54px 0px rgba(0, 0, 18, 0.16);
43
+ }
44
+
45
+ }
46
+
47
+ @media (min-width: 36em) {
48
+ &__img {
49
+ img,
50
+ svg {
51
+ max-width: 20rem;
52
+ }
53
+ }
54
+
55
+ &__link.fr-btn {
56
+ width: auto;
57
+ justify-content: flex-start;
58
+ }
59
+ }
60
+
61
+ @media (min-width: 48em) {
62
+ .fr-container {
63
+ flex-direction: row;
64
+ }
65
+
66
+ &__content {
67
+ width: 55%;
68
+ }
69
+
70
+ &__img {
71
+ width: 50%;
72
+ padding-right: 3.5rem;
73
+ margin-bottom: 0;
74
+
75
+
76
+ img,
77
+ svg {
78
+ max-width: none;
79
+ }
80
+ }
81
+
82
+ }
83
+
84
+ @media (min-width: 62em) {
85
+ padding: 5.75rem 0;
86
+
87
+ .fr-container {
88
+ max-width: 1020px;
89
+ }
90
+
91
+ &__title {
92
+ font-size: 2rem;
93
+ line-height: 2.5rem;
94
+ }
95
+
96
+ &__desc {
97
+ font-size: 1.25rem;
98
+ line-height: 2rem;
99
+ }
100
+
101
+ &__img {
102
+ padding-right: 4.5rem;
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,222 @@
1
+ .dsfr-doc-hp-community {
2
+ padding: 2rem 0 3.25rem;
3
+
4
+ &__container {
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: flex-start;
8
+ }
9
+
10
+ &__img {
11
+ margin-bottom: 2rem;
12
+ width: 100%;
13
+
14
+ img,
15
+ svg {
16
+ display: flex;
17
+ border: 1px solid var(--border-default-grey);
18
+
19
+ #cursor-1 {
20
+ animation: cursor1 3.2s ease-out infinite;
21
+ }
22
+
23
+ #cursor-2 {
24
+ animation: cursor2 3.2s ease-out infinite;
25
+ }
26
+
27
+ #cursor-3 {
28
+ animation: cursor3 3.2s ease-out infinite;
29
+ }
30
+
31
+ @media (prefers-reduced-motion: reduce) {
32
+ #cursor-1,
33
+ #cursor-2,
34
+ #cursor-3 {
35
+ animation: none;
36
+ }
37
+ }
38
+ }
39
+
40
+ &--dark {
41
+ display: none;
42
+ }
43
+ }
44
+
45
+ &-tile {
46
+ margin-bottom: 3rem;
47
+ display: flex;
48
+ flex-direction: column;
49
+ align-items: flex-start;
50
+ justify-content: flex-start;
51
+
52
+ &:last-child {
53
+ margin-bottom: 0;
54
+ }
55
+
56
+ &__img {
57
+ margin-bottom: 0.75rem;
58
+ border-radius: 2px;
59
+ border: 1px solid var(--border-default-grey);
60
+ width: 2rem;
61
+ height: 2rem;
62
+ display: flex;
63
+ align-items: center;
64
+ justify-content: center;
65
+ color: var(--text-action-high-blue-france);
66
+ overflow: hidden;
67
+ background-color: var(--background-contrast-info);
68
+
69
+ &::before {
70
+ width: 19px;
71
+ height: 19px;
72
+ }
73
+
74
+ img,
75
+ svg {
76
+ width: 19px;
77
+ height: 19px;
78
+ }
79
+ }
80
+
81
+ &__title {
82
+ margin-bottom: 0.25rem;
83
+ font-size: 1.125rem;
84
+ line-height: 1.625rem;
85
+ }
86
+
87
+ &__desc {
88
+ margin-bottom: 0.5rem;
89
+ font-size: 14px;
90
+ font-weight: 500;
91
+ }
92
+ }
93
+
94
+ @media (min-width: 36em) {
95
+ &__tiles {
96
+ display: flex;
97
+ gap: 16px;
98
+ }
99
+
100
+ &-tile {
101
+ flex: 1 0 33.33%;
102
+ margin-bottom: 0;
103
+ flex: 1;
104
+ }
105
+ }
106
+
107
+ @media (min-width: 48em) {
108
+ padding: 3rem 0;
109
+
110
+ &__tiles {
111
+ display: block;
112
+ width: 55%;
113
+ }
114
+
115
+ &__container {
116
+ flex-direction: row;
117
+ }
118
+
119
+ &__title {
120
+ margin-bottom: 3rem;
121
+ }
122
+
123
+ &__img {
124
+ width: 45%;
125
+ margin-bottom: 0;
126
+ margin-right: 2rem;
127
+ }
128
+
129
+ &-tile {
130
+ margin-bottom: 2rem;
131
+ flex-direction: row;
132
+
133
+ &__img {
134
+ margin-bottom: 0;
135
+ margin-right: 1.25rem;
136
+ width: 52px;
137
+ height: 52px;
138
+
139
+ &::before {
140
+ width: 29px;
141
+ height: 29px;
142
+ }
143
+
144
+ img,
145
+ svg {
146
+ width: 29px;
147
+ height: 29px;
148
+ }
149
+ }
150
+
151
+ &__title {
152
+ font-size: 1.25rem;
153
+ line-height: 1.75rem;
154
+ }
155
+
156
+ &__desc {
157
+ font-size: 16px;
158
+ }
159
+ }
160
+ }
161
+
162
+ @media (min-width: 62em) {
163
+ padding: 4rem 0 5rem;
164
+
165
+ &__img {
166
+ margin-right: 3rem;
167
+ width: 50%;
168
+ }
169
+
170
+ &__tile {
171
+ margin-bottom: 3rem;
172
+ }
173
+ }
174
+ }
175
+
176
+
177
+ @keyframes cursor3 {
178
+ 0% {
179
+ transform: translate(50, 106);
180
+ }
181
+ 25% {
182
+ transform: translate(0, 0);
183
+ }
184
+ 62% {
185
+ transform: translate(20, -78);
186
+ }
187
+ 100% {
188
+ transform: translate(50, 106);
189
+ }
190
+ }
191
+
192
+ @keyframes cursor2 {
193
+ 25% {
194
+ transform: translate(-87, -20);
195
+ }
196
+ 62% {
197
+ transform: translate(0, 0);
198
+ }
199
+ 100% {
200
+ transform: translate(-87, -20);
201
+ }
202
+ }
203
+
204
+ @keyframes cursor1 {
205
+ 25% {
206
+ transform: translate(0, 0);
207
+ }
208
+ 62% {
209
+ transform: translate(-31, 21);
210
+ }
211
+ }
212
+
213
+
214
+ [data-fr-theme='dark'] {
215
+ .dsfr-doc-hp-community .dsfr-doc-hp-community__img--dark {
216
+ display: block;
217
+ }
218
+
219
+ .dsfr-doc-hp-community .dsfr-doc-hp-community__img--light {
220
+ display: none;
221
+ }
222
+ }
@@ -0,0 +1,208 @@
1
+ .dsfr-doc-hp-discover {
2
+ position: relative;
3
+ padding-bottom: 1.25rem;
4
+
5
+ &__title {
6
+ margin-bottom: 3rem;
7
+ }
8
+
9
+ .dsfr-doc-discover-tile {
10
+ display: block;
11
+ height: 100%;
12
+ padding: 1.5rem 0.75rem;
13
+ transition: box-shadow .2s ease-out;
14
+ position: relative;
15
+
16
+ &:hover {
17
+ background-color: transparent;
18
+ box-shadow: 0 0 0 1px var(--border-default-grey);
19
+ }
20
+
21
+ &__container {
22
+ display: flex;
23
+ flex-direction: column;
24
+ height: 100%;
25
+ }
26
+
27
+ &__img {
28
+ display: flex;
29
+
30
+ &--dark {
31
+ display: none;
32
+ }
33
+
34
+ img,
35
+ svg {
36
+ width: 70px;
37
+ height: 70px;
38
+ }
39
+
40
+ svg {
41
+ rect,
42
+ circle,
43
+ path {
44
+ transition: ease-out 0.2s;
45
+ }
46
+ }
47
+ }
48
+
49
+ &__content {
50
+ height: 100%;
51
+ padding-top: 0.75rem;
52
+
53
+ p {
54
+ margin-bottom: 1rem;
55
+ }
56
+ }
57
+
58
+ .fr-link {
59
+ &::before {
60
+ content: '';
61
+ display: block;
62
+ height: 100%;
63
+ bottom: 0;
64
+ left: 0;
65
+ outline-color: inherit;
66
+ outline-offset: 2px;
67
+ outline-style: inherit;
68
+ outline-width: 2px;
69
+ position: absolute;
70
+ right: 0;
71
+ top: 0;
72
+ width: 100%;
73
+ z-index: 1;
74
+ mask-image: none;
75
+ background: none;
76
+ }
77
+ }
78
+
79
+ @media (min-width: 48em) {
80
+ padding: 1.5rem 1.25rem;
81
+ }
82
+ }
83
+
84
+ @media (min-width: 62em) {
85
+ padding-bottom: 5.75rem;
86
+ }
87
+ }
88
+
89
+ .dsfr-doc-hp-discover {
90
+ .fr-col-12:nth-child(1) .dsfr-doc-discover-tile:hover {
91
+ .dsfr-doc-discover-tile__img {
92
+ svg {
93
+ rect {
94
+ x: 34;
95
+ width: 36;
96
+ }
97
+
98
+ circle:nth-of-type(1) {
99
+ cx: 51;
100
+ cy: 57;
101
+ }
102
+
103
+ circle:nth-of-type(2) {
104
+ cx: 21;
105
+ cy: 9;
106
+ }
107
+
108
+ circle:nth-of-type(3) {
109
+ cx: 43.5;
110
+ cy: 33;
111
+ r: 16.5;
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ .fr-col-12:nth-child(2) .dsfr-doc-discover-tile:hover {
118
+ .dsfr-doc-discover-tile__img {
119
+ svg {
120
+ rect {
121
+ y: 28;
122
+ height: 42;
123
+ }
124
+
125
+ circle:nth-of-type(1) {
126
+ cx: 22.5;
127
+ cy: 22.5;
128
+ r: 22.5;
129
+ }
130
+
131
+ circle:nth-of-type(2) {
132
+ cx: 57;
133
+ cy: 17;
134
+ }
135
+
136
+ circle:nth-of-type(3) {
137
+ cx: 21;
138
+ cy: 62;
139
+ }
140
+
141
+ }
142
+ }
143
+ }
144
+
145
+ .fr-col-12:nth-child(3) .dsfr-doc-discover-tile:hover {
146
+ .dsfr-doc-discover-tile__img {
147
+ svg {
148
+ rect:nth-of-type(2) {
149
+ y: 52;
150
+ height: 18;
151
+ }
152
+
153
+ rect:nth-of-type(3) {
154
+ x: 25;
155
+ width: 45;
156
+ }
157
+
158
+ rect:nth-of-type(4) {
159
+ x: 24;
160
+ y: 12;
161
+ width: 26;
162
+ height: 34;
163
+ }
164
+
165
+ circle:nth-of-type(2) {
166
+ cx: 14;
167
+ }
168
+
169
+ circle:nth-of-type(3) {
170
+ cy: 42;
171
+ }
172
+ }
173
+ }
174
+ }
175
+
176
+ .fr-col-12:nth-child(4) .dsfr-doc-discover-tile:hover {
177
+ .dsfr-doc-discover-tile__img {
178
+ svg {
179
+ rect:nth-of-type(1) {
180
+ height: 31;
181
+ }
182
+
183
+ circle:nth-of-type(1) {
184
+ cy: 56;
185
+ }
186
+
187
+ circle:nth-of-type(2) {
188
+ cy: 56;
189
+ }
190
+
191
+ circle:nth-of-type(3) {
192
+ cx: 26;
193
+ r: 17;
194
+ }
195
+ }
196
+ }
197
+ }
198
+ }
199
+
200
+ [data-fr-theme='dark'] {
201
+ .dsfr-doc-hp-discover .dsfr-doc-discover-tile__img--dark {
202
+ display: block;
203
+ }
204
+
205
+ .dsfr-doc-hp-discover .dsfr-doc-discover-tile__img--light {
206
+ display: none;
207
+ }
208
+ }
@@ -0,0 +1,24 @@
1
+ .dsfr-doc-hp-faq {
2
+ padding: 3.25rem 0;
3
+
4
+ .dsfr-doc-hp-faq__content {
5
+ margin-bottom: 2rem;
6
+ }
7
+
8
+ .fr-accordion .fr-collapse p {
9
+ margin-bottom: 0.75rem;
10
+
11
+ &:last-child {
12
+ margin-bottom: 0;
13
+ }
14
+ }
15
+
16
+ @media (min-width: 62em) {
17
+ padding: 5.75rem 0;
18
+
19
+ .dsfr-doc-hp-faq__content {
20
+ padding-right: 2rem;
21
+ margin-bottom: 0;
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,53 @@
1
+ .dsfr-doc-hp-goals {
2
+ padding: 3rem 0;
3
+
4
+ &__title {
5
+ margin-bottom: 2rem;
6
+ }
7
+
8
+ &__tiles {
9
+ display: flex;
10
+ flex-direction: row;
11
+ justify-content: center;
12
+ gap: 1.5rem;
13
+ flex-wrap: wrap;
14
+
15
+ .fr-tile {
16
+ max-width: 223px;
17
+ flex: 1;
18
+ padding: 0.25rem;
19
+
20
+ &.fr-tile--no-border {
21
+ background-image: none;
22
+
23
+ .fr-tile__title:before {
24
+ background-image: none;
25
+ }
26
+ }
27
+ }
28
+ }
29
+
30
+ @media (min-width: 36em) {
31
+ padding: 3rem 0;
32
+ }
33
+
34
+ @media (min-width: 48em) {
35
+ padding: 5rem 0;
36
+
37
+ &__title {
38
+ margin-bottom: 2.5rem;
39
+ }
40
+ }
41
+
42
+ @media (min-width: 62em) {
43
+ padding: 7.5rem 0 6.25rem;
44
+
45
+ &__tiles {
46
+ flex-wrap: nowrap;
47
+ }
48
+
49
+ &__title {
50
+ margin-bottom: 4rem;
51
+ }
52
+ }
53
+ }