@1024pix/pix-ui 49.1.0 → 49.2.1

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.
@@ -1,7 +1,23 @@
1
- <aside ...attributes class="pix-navigation">
2
- <header class="pix-navigation__brand">{{yield to="brand"}}</header>
3
- <nav class="pix-navigation__nav" aria-label={{@navigationAriaLabel}}>{{yield
4
- to="navElements"
5
- }}</nav>
6
- <footer class="pix-navigation__footer">{{yield to="footer"}}</footer>
1
+ <aside
2
+ ...attributes
3
+ class="pix-navigation {{if this.navigationMenuOpened 'pix-navigation--opened'}}"
4
+ >
5
+ <header class="pix-navigation__brand">{{yield to="brand"}}
6
+ <div class="pix-navigation__burger-menu"><PixButton
7
+ aria-controls="{{this.navigationId}} {{this.footerId}}"
8
+ aria-expanded={{this.navigationMenuOpened}}
9
+ @iconBefore={{if this.navigationMenuOpened "close" "menu"}}
10
+ @triggerAction={{this.toggleNavigationMenu}}
11
+ >{{@menuLabel}}</PixButton>
12
+ </div>
13
+ </header>
14
+ <nav
15
+ class="pix-navigation__nav"
16
+ {{on "click" this.handleNavigationClick}}
17
+ aria-label={{@navigationAriaLabel}}
18
+ id={{this.navigationId}}
19
+ >
20
+ {{yield to="navElements"}}
21
+ </nav>
22
+ <footer class="pix-navigation__footer" id={{this.footerId}}>{{yield to="footer"}}</footer>
7
23
  </aside>
@@ -0,0 +1,33 @@
1
+ import Component from '@glimmer/component';
2
+ import { action } from '@ember/object';
3
+ import { tracked } from '@glimmer/tracking';
4
+ import { guidFor } from '@ember/object/internals';
5
+
6
+ export default class PixMNavigation extends Component {
7
+ constructor(...args) {
8
+ super(...args);
9
+ this._navigationId = 'navigation-' + guidFor(this);
10
+ }
11
+ @tracked
12
+ navigationMenuOpened = false;
13
+
14
+ @action
15
+ toggleNavigationMenu() {
16
+ this.navigationMenuOpened = !this.navigationMenuOpened;
17
+ }
18
+
19
+ @action
20
+ handleNavigationClick(event) {
21
+ if (event.target.nodeName === 'A') {
22
+ this.navigationMenuOpened = false;
23
+ }
24
+ }
25
+
26
+ get navigationId() {
27
+ return `${this._navigationId}-nav`;
28
+ }
29
+
30
+ get footerId() {
31
+ return `${this._navigationId}-footer`;
32
+ }
33
+ }
@@ -33,12 +33,16 @@ export default class PixStructureSwitcher extends Component {
33
33
 
34
34
  @action
35
35
  openMenu(event) {
36
+ if (this.isMenuOpen) return;
37
+
36
38
  event.preventDefault();
37
39
  this.isMenuOpen = true;
38
40
  }
39
41
 
40
42
  @action
41
43
  closeMenu(event) {
44
+ if (!this.isMenuOpen) return;
45
+
42
46
  event.preventDefault();
43
47
  this.isMenuOpen = false;
44
48
  }
@@ -1,9 +1,13 @@
1
1
  .pix-app-layout {
2
2
  display: grid;
3
- grid-template-columns: minmax(214px, auto) 1fr;
3
+ grid-template-columns: min-content 1fr;
4
4
  gap: var(--pix-spacing-6x);
5
5
  padding: var(--pix-spacing-6x);
6
6
 
7
+ @include device-is('mobile') {
8
+ display: block
9
+ }
10
+
7
11
  &--orga {
8
12
  background-color: var(--pix-orga-50);
9
13
 
@@ -1,12 +1,18 @@
1
1
  .pix-navigation {
2
+ --bg-color-focus: rgb(var(--pix-neutral-100-inline), 50%);
3
+ --bg-color-active: rgb(var(--pix-neutral-100-inline), 30%);
4
+ --pix-navigation-width: 15rem;
5
+
2
6
  position: sticky;
3
7
  bottom: var(--pix-spacing-6x);
8
+ z-index: 1;
4
9
  display: flex;
5
10
  flex-direction: column;
6
11
  gap:var(--pix-spacing-6x);
7
- align-items: center;
8
- min-width: 214px;
9
- height: fit-content;
12
+ align-items: stretch;
13
+ justify-content: space-between;
14
+ width: var(--pix-navigation-width);
15
+ height: auto;
10
16
  min-height: calc(100vh - var(--pix-spacing-6x) * 2);
11
17
 
12
18
  // using a margin top / bottom allow user to discover rapidly
@@ -17,14 +23,75 @@
17
23
  background-color: var(--pix-navigation-color);
18
24
  border-radius: var(--pix-spacing-6x);
19
25
 
20
- --pix-navigation-button-bgcolor-hover: rgb(205, 209, 217, .3);
21
- --pix-navigation-button-bgcolor-active: rgb(205, 209, 217, .5);
26
+
27
+ @include device-is('mobile') {
28
+ position: static;
29
+ flex-direction: column;
30
+ align-items: stretch;
31
+ width: 100%;
32
+ max-width: none;
33
+ min-height: auto;
34
+ padding: 0;
35
+
36
+ &--opened {
37
+ justify-content: flex-start;
38
+ }
39
+ }
40
+
22
41
 
23
42
  &__brand {
24
43
  margin-bottom: 0;
25
44
  padding:0;
26
45
  line-height: 0;
27
46
 
47
+ img {
48
+ display: block;
49
+ width: 132px;
50
+ height: 48px;
51
+ margin:0 auto;
52
+ }
53
+
54
+ @include device-is('mobile') {
55
+ display:flex;
56
+ flex-direction: row;
57
+ align-items: center;
58
+ padding: var(--pix-spacing-4x) var(--pix-spacing-2x) var(--pix-spacing-4x) var(--pix-spacing-9x);
59
+
60
+ img {
61
+ width: 85px;
62
+ height: 32px;
63
+ }
64
+
65
+ .pix-navigation--opened & {
66
+ padding-bottom: 0
67
+ }
68
+ }
69
+ }
70
+
71
+ &__burger-menu {
72
+ display: none;
73
+
74
+ @include device-is('mobile') {
75
+ display: block;
76
+ margin-left:auto;
77
+
78
+ .pix-button {
79
+ background-color: transparent;
80
+
81
+ &:focus, &:focus-visible {
82
+ background-color: rgb(var(--pix-neutral-800-inline), 20%);
83
+ outline: none;
84
+ }
85
+
86
+ &:hover {
87
+ background-color: rgb(var(--pix-neutral-800-inline), 20%);
88
+ }
89
+
90
+ &:active {
91
+ background-color: rgb(var(--pix-neutral-800-inline), 30%);
92
+ }
93
+ }
94
+ }
28
95
  }
29
96
 
30
97
  &__nav {
@@ -32,6 +99,17 @@
32
99
  flex-direction: column;
33
100
  gap: var(--pix-spacing-2x);
34
101
  align-self: stretch;
102
+
103
+ @include device-is('mobile') {
104
+ display: none;
105
+ padding: 0 var(--pix-spacing-6x);
106
+
107
+ .pix-navigation--opened & {
108
+ display: block;
109
+ }
110
+ }
111
+
112
+
35
113
  }
36
114
 
37
115
  &__footer {
@@ -39,30 +117,62 @@
39
117
  flex-direction: column;
40
118
  gap: var(--pix-spacing-2x);
41
119
  margin-top: auto;
120
+ padding: 0;
42
121
  text-align: center;
43
122
 
44
123
  @extend %pix-body-s;
45
124
 
125
+ p {
126
+ word-break: break-word;
127
+ }
128
+
129
+ @include device-is('mobile') {
130
+ display: none;
131
+
132
+ .pix-navigation--opened & {
133
+ display: flex;
134
+ justify-content: stretch;
135
+ padding: 0 var(--pix-spacing-6x) var(--pix-spacing-4x);
136
+
137
+ &::before {
138
+ width: 80px;
139
+ margin: var(--pix-spacing-6x) auto;
140
+ border-top: 1px solid var(--pix-neutral-100);
141
+ content: "";
142
+ }
143
+ }
144
+ }
145
+
146
+ .pix-button {
147
+ width: 100%;
148
+ padding: var(--pix-spacing-2x) var(--pix-spacing-4x);
149
+ white-space: unset;
150
+
151
+ @include device-is('mobile') {
152
+ width: auto;
153
+ }
154
+ }
155
+
46
156
  & .pix-button--primary {
47
157
  color: var(--pix-navigation-color);
48
158
  background-color:var(--pix-navigation-text-color);
49
159
 
50
160
  &:hover {
51
161
  color: currentcolor;
52
- background-color: var(--pix-navigation-button-bgcolor-hover);
162
+ background-color: var(--bg-color-focus);
53
163
  fill: currentcolor;
54
164
  }
55
165
 
56
166
  &:focus,
57
167
  &:focus-visible {
58
168
  color: currentcolor;
59
- background-color: var(--pix-navigation-button-bgcolor-hover);
169
+ background-color: var(--bg-color-focus);
60
170
  outline-color: currentcolor;
61
171
  }
62
172
 
63
173
  &:active {
64
174
  color: currentcolor;
65
- background-color: var(--pix-navigation-button-bgcolor-active);
175
+ background-color: var(--bg-color-active);
66
176
  }
67
177
  }
68
178
 
@@ -72,20 +182,20 @@
72
182
 
73
183
  &:hover {
74
184
  color: currentcolor;
75
- background-color: var(--pix-navigation-button-bgcolor-hover);
185
+ background-color: var(--bg-color-focus);
76
186
  fill: currentcolor;
77
187
  }
78
188
 
79
189
  &:focus,
80
190
  &:focus-visible {
81
191
  color: currentcolor;
82
- background-color: var(--pix-navigation-button-bgcolor-hover);
192
+ background-color: var(--bg-color-focus);
83
193
  outline-color: currentcolor;
84
194
  }
85
195
 
86
196
  &:active {
87
197
  color: currentcolor;
88
- background-color: var(--pix-navigation-button-bgcolor-active);
198
+ background-color: var(--bg-color-active);
89
199
  }
90
200
  }
91
201
 
@@ -101,6 +211,5 @@
101
211
  }
102
212
  }
103
213
  }
104
-
105
214
  }
106
215
 
@@ -22,15 +22,14 @@
22
22
  &__option {
23
23
  @extend %pix-body-s;
24
24
 
25
- &:nth-child(even) {
26
- background-color: var(--pix-neutral-20);
27
- }
28
-
29
25
  position: relative;
30
26
  padding: var(--pix-spacing-2x) var(--pix-spacing-8x) var(--pix-spacing-2x) var(--pix-spacing-4x);
31
27
  color: var(--pix-neutral-900);
32
28
  border-radius: 8px;
33
29
 
30
+ &:nth-child(even) {
31
+ background-color: var(--pix-neutral-20);
32
+ }
34
33
 
35
34
  &:hover,
36
35
  &:focus {
@@ -9,8 +9,17 @@
9
9
  --pix-structure-bg-hover: var(--pix-certif-50);
10
10
  }
11
11
 
12
+ @include device-is("mobile") {
13
+ width: 100%;
14
+ }
15
+
12
16
  .pix-button {
13
17
  width: 100%;
18
+
19
+ .pix-navigation--opened & {
20
+ width: auto;
21
+ margin:auto;
22
+ }
14
23
  }
15
24
 
16
25
  .pix-select__dropdown {
@@ -24,13 +33,32 @@
24
33
  margin-left: var(--pix-spacing-6x) !important; // we need to override popperjs inline styles
25
34
  overflow-y: auto;
26
35
  border-radius: 8px;
36
+
37
+ @include device-is('mobile') {
38
+ position: static !important;
39
+ display: none;
40
+ width: 0; // force dropdown to resize to its parent
41
+ max-width: none;
42
+ max-height: none;
43
+ margin-left:0 !important;
44
+ overflow-y: visible;
45
+ transform: none !important;
46
+ transition: none;
47
+
48
+ .pix-navigation--opened &:not(.pix-select__dropdown--closed) {
49
+ display: block;
50
+ margin-top: var(--pix-spacing-4x) !important;
51
+ }
52
+ }
27
53
  }
28
54
 
29
55
  .pix-select_list {
30
56
  display: flex;
31
57
  flex-direction: column;
32
58
  gap: var(--pix-spacing-2x);
59
+ min-width: 100%;
33
60
  padding: var(--pix-spacing-2x);
61
+ border-top: none;
34
62
  }
35
63
 
36
64
  .pix-select-list-category__option--hidden {
@@ -47,6 +75,10 @@
47
75
  text-overflow: ellipsis;
48
76
  border-radius: var(--border-radius-2x);
49
77
 
78
+ &:focus:not(.pix-select-list-category__option--selected ) {
79
+ background-color: var(--pix-structure-bg-hover);
80
+ }
81
+
50
82
  &:hover {
51
83
  background-color: var(--pix-structure-bg-hover);
52
84
  }
@@ -60,5 +92,9 @@
60
92
  &:hover {
61
93
  background-color: var(--pix-navigation-color);
62
94
  }
95
+
96
+ &:focus {
97
+ color: var(--pix-neutral-800)
98
+ }
63
99
  }
64
100
  }
@@ -16,6 +16,7 @@ $pix-spacing-xxl: 48px;
16
16
  --pix-spacing-4x: 16px;
17
17
  --pix-spacing-6x: 24px;
18
18
  --pix-spacing-8x: 32px;
19
+ --pix-spacing-9x: 36px;
19
20
  --pix-spacing-10x: 40px;
20
21
  --pix-spacing-12x: 48px;
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "49.1.0",
3
+ "version": "49.2.1",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"