@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,135 @@
1
+ .dsfr-doc-hp-hero {
2
+ padding-bottom: 4rem;
3
+ position: relative;
4
+
5
+ &::before {
6
+ content: '';
7
+ position: absolute;
8
+ opacity: 0.7;
9
+ top: -20px;
10
+ left: 0;
11
+ width: 100%;
12
+ height: 160%;
13
+ background: linear-gradient(49deg, transparent 57%, var(--background-contrast-blue-france) 78%);
14
+ }
15
+
16
+ h1 {
17
+ font-size: 2rem;
18
+ line-height: 2.5rem;
19
+ }
20
+
21
+ .fr-btn {
22
+ width: 100%;
23
+ justify-content: center;
24
+ margin-top: 0.5rem;
25
+ }
26
+
27
+ p {
28
+ font-weight: 500;
29
+ font-size: 14px;
30
+ line-height: 24px;
31
+ }
32
+
33
+ &__img {
34
+ margin-top: 0.5rem;
35
+ margin-left: -0.5rem;
36
+ margin-right: -0.5rem;
37
+ margin-bottom: -10%;
38
+
39
+ &--dark {
40
+ display: none;
41
+ }
42
+
43
+ img,
44
+ svg {
45
+ width: 100%;
46
+ height: auto;
47
+ }
48
+ }
49
+
50
+ @media (min-width: 36em) {
51
+ padding-bottom: 5rem;
52
+
53
+ .fr-btn {
54
+ width: auto;
55
+ justify-content: flex-start;
56
+ }
57
+ }
58
+
59
+ @media (min-width: 48em) {
60
+ padding-top: 3rem;
61
+ padding-bottom: 8rem;
62
+ min-height: 669px;
63
+
64
+ .fr-container {
65
+ min-height: 800px;
66
+ }
67
+
68
+ &__content {
69
+ width: 50%;
70
+ max-width: 40rem;
71
+ min-width: 21rem;
72
+ position: sticky;
73
+ top: 2rem;
74
+ }
75
+
76
+ &__img {
77
+ position: absolute;
78
+ overflow: hidden;
79
+ margin: 0;
80
+ left: 50%;
81
+ width: 50%;
82
+ height: 1400px;
83
+ top: 2rem;
84
+
85
+ img,
86
+ svg {
87
+ position: absolute;
88
+ top: 0;
89
+ left: 20%;
90
+ z-index: 1;
91
+ width: 34rem;
92
+ }
93
+ }
94
+ }
95
+
96
+ @media (min-width: 62em) {
97
+ padding-top: 5rem;
98
+ padding-bottom: 12rem;
99
+ min-height: 680px;
100
+
101
+ h1 {
102
+ font-size: 4rem;
103
+ line-height: 5rem;
104
+ }
105
+
106
+ p {
107
+ font-weight: 400;
108
+ font-size: 1.25rem;
109
+ line-height: 2rem;
110
+ }
111
+
112
+ &__content {
113
+ top: 5rem;
114
+ }
115
+
116
+ &__img {
117
+ top: 3.5rem;
118
+
119
+ img,
120
+ svg {
121
+ width: 45rem;
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ [data-fr-theme='dark'] {
128
+ .dsfr-doc-hp-hero__img {
129
+ display: none;
130
+ }
131
+
132
+ .dsfr-doc-hp-hero__img--dark {
133
+ display: block;
134
+ }
135
+ }
@@ -0,0 +1,26 @@
1
+ .dsfr-doc-hp-news {
2
+ padding: 5rem 0;
3
+
4
+ &__link {
5
+ margin-top: 2rem;
6
+ }
7
+
8
+ @media (min-width: 36em) {
9
+ .fr-col-sm-12 .fr-card__header .fr-card__img {
10
+ img,
11
+ svg {
12
+ aspect-ratio: 32 / 9;;
13
+ }
14
+
15
+ }
16
+ }
17
+
18
+ @media (min-width: 48em) {
19
+ .fr-col-sm-12 .fr-card__header .fr-card__img {
20
+ img,
21
+ svg {
22
+ aspect-ratio: 16 / 9;;
23
+ }
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,129 @@
1
+ .dsfr-doc-hp-showcase {
2
+ padding: 2rem 0;
3
+
4
+ &__title {
5
+ font-size: 1.5rem;
6
+ line-height: 2rem;
7
+ }
8
+
9
+ &__container {
10
+ display: flex;
11
+ flex-direction: row;
12
+ gap: 2.5rem;
13
+ flex-wrap: wrap;
14
+ margin: 4rem 0;
15
+ }
16
+
17
+ &__link {
18
+ .fr-btn {
19
+ width: 100%;
20
+ justify-content: center;
21
+ }
22
+ }
23
+
24
+ &-card {
25
+ width: 100%;
26
+
27
+ &__img {
28
+ display: flex;
29
+ margin-bottom: 0.75rem;
30
+ overflow: hidden;
31
+ box-shadow: 0 0 0 1px var(--border-default-grey);
32
+ background-image: none;
33
+
34
+ &::after {
35
+ content: none;
36
+ }
37
+
38
+ &--dark {
39
+ display: none;
40
+ }
41
+
42
+ img,
43
+ svg {
44
+ transition: transform 0.3s ease-out;
45
+ transform-origin: bottom;
46
+ width: 100%;
47
+ height: auto;
48
+ }
49
+
50
+ &:hover {
51
+ img,
52
+ svg {
53
+ transform: scale(1.05);
54
+ }
55
+ }
56
+ }
57
+
58
+ &__links-group {
59
+ margin: 0;
60
+ padding: 0;
61
+ list-style: none;
62
+
63
+ li {
64
+ padding: 0;
65
+
66
+ &:not(:last-child) {
67
+ margin-bottom: 1rem;
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ @media (min-width: 36em) {
74
+ &-card {
75
+ flex-basis: calc(50% - 1.25rem);
76
+ }
77
+ }
78
+
79
+ @media (min-width: 48em) {
80
+ &__container {
81
+ gap: 3rem;
82
+ }
83
+
84
+ &__link {
85
+ .fr-btn {
86
+ width: auto;
87
+ justify-content: flex-start;
88
+ }
89
+ }
90
+
91
+ &-card {
92
+ flex-basis: calc(50% - 1.5rem);
93
+
94
+ &__img {
95
+ margin-bottom: 1rem;
96
+ }
97
+
98
+ &__links-group {
99
+ li {
100
+ display: inline;
101
+
102
+ &:not(:last-child) {
103
+ margin-bottom: 0;
104
+ margin-right: 1rem;
105
+ }
106
+ }
107
+ }
108
+ }
109
+
110
+ &__title {
111
+ font-size: 2rem;
112
+ line-height: 2.5rem;
113
+ }
114
+ }
115
+
116
+ @media (min-width: 62em) {
117
+ padding: 5rem 0;
118
+ }
119
+ }
120
+
121
+ [data-fr-theme='dark'] {
122
+ .dsfr-doc-hp-showcase-card__img--dark {
123
+ display: flex;
124
+ }
125
+
126
+ .dsfr-doc-hp-showcase-card__img--light {
127
+ display: none;
128
+ }
129
+ }
@@ -0,0 +1,168 @@
1
+ .dsfr-doc-hp-slice-video {
2
+ overflow: hidden;
3
+ padding-top: 2.5rem;
4
+
5
+ &__category {
6
+ margin-bottom: 1rem;
7
+ }
8
+
9
+ &__content {
10
+ transition: transform 0.5s ease-out;
11
+ }
12
+
13
+ &__title {
14
+ color: var(--text-label-blue-france);
15
+ font-size: 1.75rem;
16
+ line-height: 2.25rem;
17
+ margin-bottom: 1.5rem;
18
+ }
19
+
20
+ &__btn {
21
+ margin-bottom: 1.5rem;
22
+ width: 100%;
23
+ justify-content: center;
24
+ }
25
+
26
+ &__img {
27
+ display: flex;
28
+ justify-content: flex-end;
29
+ flex-direction: column;
30
+ align-items: center;
31
+ transition: transform 0.5s ease-out;
32
+ filter: drop-shadow(0px 0px 50.256px rgba(174, 191, 255, 0.85));
33
+ cursor: pointer;
34
+
35
+ &--dark {
36
+ display: none;
37
+ }
38
+
39
+ img,
40
+ svg {
41
+ width: 100%;
42
+ height: auto;
43
+ }
44
+ }
45
+
46
+ @media (min-width: 36em) {
47
+ &__content {
48
+ max-width: 30rem;
49
+ }
50
+
51
+ &__btn {
52
+ width: auto;
53
+ }
54
+ }
55
+
56
+ @media (min-width: 48em) {
57
+ padding-top: 3.5rem;
58
+
59
+ &__btn {
60
+ margin-bottom: 3rem;
61
+ }
62
+
63
+ & > .fr-container {
64
+ position: relative;
65
+
66
+ &::before {
67
+ content: '';
68
+ position: absolute;
69
+ width: 244px;
70
+ height: 388px;
71
+ top: 0;
72
+ right: 0;
73
+ transform: translate(40%, -25%);
74
+ background-image: url('/v0.0/asset/home/slice-video/bg-video-light.svg');
75
+ background-size: cover;
76
+ background-repeat: no-repeat;
77
+ }
78
+ }
79
+
80
+ &__img {
81
+ filter: drop-shadow(0px 0px 62.373px rgba(174, 191, 255, 0.85));
82
+
83
+ &.fr-col-offset-md-1 {
84
+ margin-left: 7%;
85
+ }
86
+
87
+ img,
88
+ svg {
89
+ margin-left: -2rem;
90
+ }
91
+ }
92
+
93
+ &[dsfr-doc-in-view='true'] {
94
+ .dsfr-doc-hp-slice-video__img,
95
+ .dsfr-doc-hp-slice-video__content {
96
+ transform: translateY(0);
97
+ }
98
+ }
99
+
100
+ &[dsfr-doc-in-view='false'] {
101
+ .dsfr-doc-hp-slice-video__img,
102
+ .dsfr-doc-hp-slice-video__content {
103
+ transform: translateY(30%);
104
+
105
+ @media (prefers-reduced-motion: reduce) {
106
+ transform: none;
107
+ }
108
+ }
109
+ }
110
+ }
111
+
112
+ @media (min-width: 62em) {
113
+ padding-top: 6.25rem;
114
+
115
+ & > .fr-container {
116
+ &::before {
117
+ width: 363px;
118
+ height: 419px;
119
+ top: 0;
120
+ right: 0;
121
+ transform: translate(90px, -88px);
122
+ }
123
+ }
124
+
125
+ &__btn {
126
+ margin-bottom: 5.5rem;
127
+ }
128
+
129
+ &__title {
130
+ margin-bottom: 2.5rem;
131
+ font-size: 2.5rem;
132
+ line-height: 3rem;
133
+ }
134
+
135
+ &__img {
136
+ &.fr-col-offset-md-1 {
137
+ margin-left: 3%;
138
+ }
139
+
140
+ img,
141
+ svg {
142
+ margin-left: 0;
143
+ }
144
+ }
145
+ }
146
+ }
147
+
148
+ [data-fr-theme='dark'] {
149
+ .dsfr-doc-hp-slice-video {
150
+ &__img {
151
+ filter: drop-shadow(0px 0px 103px rgba(0, 7, 53, 0.90));
152
+
153
+ &--light {
154
+ display: none;
155
+ }
156
+
157
+ &--dark {
158
+ display: block;
159
+ }
160
+ }
161
+
162
+ @media (min-width: 48em) {
163
+ & > .fr-container::before {
164
+ background-image: url('/v0.0/asset/home/slice-video/bg-video-dark.svg');
165
+ }
166
+ }
167
+ }
168
+ }
@@ -0,0 +1,13 @@
1
+ @use 'hero';
2
+ @use 'discover';
3
+ @use 'slice-video';
4
+ @use 'goals';
5
+ @use 'showcase';
6
+ @use 'community';
7
+ @use 'news';
8
+ @use 'faq';
9
+ @use 'analytics';
10
+
11
+ main {
12
+ position: relative;
13
+ }
@@ -0,0 +1,4 @@
1
+ .dsfr-doc--pagination {
2
+ display: flex;
3
+ justify-content: center;
4
+ }
@@ -0,0 +1,54 @@
1
+ .fr-header {
2
+ .fr-search-bar {
3
+ --underline-img: linear-gradient(0deg, currentColor, currentColor);
4
+
5
+ position: relative;
6
+ justify-content: end;
7
+
8
+ .fr-input {
9
+ width: 100%;
10
+
11
+ @media (min-width: 62em) {
12
+ width: 30rem;
13
+ }
14
+ }
15
+
16
+ .dsfr-doc-search-results {
17
+ &--dropdown {
18
+ position: absolute;
19
+ text-align: left;
20
+ top: 100%;
21
+ right: 0;
22
+ width: 100%;
23
+
24
+ @media (min-width: 62em) {
25
+ background-color: var(--background-raised-grey);
26
+ filter: drop-shadow(var(--raised-shadow));
27
+ z-index: calc(var(--ground) + 750);
28
+ }
29
+
30
+ .fr-btn {
31
+ border-radius: 0;
32
+ max-width: inherit;
33
+ width: 100%;
34
+ justify-content: center;
35
+ padding: 0.5rem 1rem;
36
+
37
+ &::before {
38
+ content: none;
39
+ }
40
+ }
41
+ }
42
+
43
+ &--list {
44
+ --li-bottom: 1.5rem;
45
+
46
+ &--no-results {
47
+ --ul-type: disc;
48
+ --ul-start: 1rem;
49
+ --li-bottom: 0.25rem;
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
@@ -3,4 +3,6 @@
3
3
  @use 'dsfr-doc-version';
4
4
  @use 'dsfr-doc-code-snippet';
5
5
  @use 'dsfr-doc-guideline';
6
- @use 'dsfr-doc-anatomy';
6
+ @use 'dsfr-doc-anatomy';
7
+ @use 'dsfr-doc-searchbar';
8
+ @use 'dsfr-doc-pagination';
File without changes
@@ -0,0 +1 @@
1
+ @use 'search-page';
@@ -7,9 +7,10 @@ class HomeTemplate extends Template {
7
7
 
8
8
  async render () {
9
9
  return `
10
- <div class="fr-container">
11
- ${await super.render()}
12
- </div>`;
10
+ <div id="home">
11
+ ${await super.render()}
12
+ </div>
13
+ `;
13
14
  }
14
15
  }
15
16
 
@@ -1,18 +1,25 @@
1
1
  import { Template } from '../template.js';
2
2
 
3
3
  class SearchTemplate extends Template {
4
- constructor (data) {
5
- super(data);
6
- }
4
+ constructor(data) {
5
+ super(data);
6
+ }
7
7
 
8
- async render () {
9
- return `
8
+ async render() {
9
+ return `
10
10
  <div class="fr-container">
11
- <div id="results" class="dsfr-doc-results">
12
-
11
+ <div id="results-page" class="dsfr-doc-search-page">
12
+ <div class="fr-grid-row fr-grid-row--gutters fr-grid-row--center">
13
+ <div id="results-page--container" class="fr-col-12 fr-col-md-8">
14
+ <section class="dsfr-doc-search-page--head fr-mt-17v">
15
+ <h1>${this.data.title}</h1>
16
+ <p id="results-count" class="fr-h5" role="status"></p>
17
+ </section>
18
+ </div>
19
+ </div>
13
20
  </div>
14
21
  </div>`;
15
- }
22
+ }
16
23
  }
17
24
 
18
25
  SearchTemplate.NAME = 'search';
Binary file
@@ -1,18 +0,0 @@
1
- import { Element } from '../core/element.js'
2
-
3
- class Searchbar extends Element {
4
- init () {
5
- this._input = this.element.querySelector('#search-input');
6
- this._button = this.element.querySelector('#search-button');
7
- this.listenClick(this._button);
8
- }
9
-
10
- handleClick () {
11
- const query = this._input.value;
12
- const href = this._button.getAttribute('data-href');
13
- document.location.href = `${href}?query=${query}`;
14
- }
15
-
16
- }
17
-
18
- export { Searchbar };