@1024pix/pix-ui 48.2.0 → 48.3.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.
@@ -0,0 +1,3 @@
1
+ <div class="pix-app-layout">
2
+ {{yield}}
3
+ </div>
@@ -0,0 +1,39 @@
1
+ {{#if @route}}
2
+ <LinkTo
3
+ @route={{@route}}
4
+ @models={{if @model (array @model) this.defaultModel}}
5
+ @query={{if @query @query this.defaultParams}}
6
+ class="pix-navigation-button"
7
+ target={{if this.isLinkOpenInANewWindow "_blank"}}
8
+ ...attributes
9
+ >
10
+ {{#if @icon}}
11
+ <PixIcon
12
+ class="pix-navigation-button__icon"
13
+ @ariaHidden={{true}}
14
+ @name={{@icon}}
15
+ @plainIcon={{@iconPlain}}
16
+ />
17
+ {{/if}}
18
+ {{yield}}
19
+ {{#if this.isLinkOpenInANewWindow}}
20
+ <PixIcon class="pix-navigation-button__external-icon" @ariaHidden={{true}} @name="openNew" />
21
+ {{/if}}
22
+ </LinkTo>
23
+ {{else}}
24
+ {{! template-lint-disable link-href-attributes }}
25
+ <a class="pix-navigation-button" target={{if this.isLinkOpenInANewWindow "_blank"}} ...attributes>
26
+ {{#if @icon}}
27
+ <PixIcon
28
+ class="pix-navigation-button__icon"
29
+ @ariaHidden={{true}}
30
+ @name={{@icon}}
31
+ @plainIcon={{@iconPlain}}
32
+ />
33
+ {{/if}}
34
+ {{yield}}
35
+ {{#if this.isLinkOpenInANewWindow}}
36
+ <PixIcon class="pix-navigation-button__external-icon" @ariaHidden={{true}} @name="openNew" />
37
+ {{/if}}
38
+ </a>
39
+ {{/if}}
@@ -0,0 +1,10 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class PixNavigationButton extends Component {
4
+ defaultParams = {};
5
+ defaultModel = [];
6
+
7
+ get isLinkOpenInANewWindow() {
8
+ return this.args?.target === '_blank';
9
+ }
10
+ }
@@ -0,0 +1 @@
1
+ <hr class="pix-navigation-separator" />
@@ -0,0 +1,7 @@
1
+ <aside ...attributes class={{this.classNames}}>
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>
7
+ </aside>
@@ -0,0 +1,20 @@
1
+ import Component from '@glimmer/component';
2
+ import { warn } from '@ember/debug';
3
+
4
+ export default class PixNavigation extends Component {
5
+ get variant() {
6
+ const value = this.args.variant ?? 'primary';
7
+ warn(
8
+ `PixNavigation: @variant "${value}" should be certif, orga or primary`,
9
+ ['primary', 'orga', 'certif'].includes(value),
10
+ {
11
+ id: 'pix-ui.pix-navigation.variant.not-valid',
12
+ },
13
+ );
14
+
15
+ return value;
16
+ }
17
+ get classNames() {
18
+ return ['pix-navigation', `pix-navigation--${this.variant}`].join(' ');
19
+ }
20
+ }
@@ -0,0 +1,6 @@
1
+ .pix-app-layout{
2
+ display: grid;
3
+ grid-template-columns: minmax(214px, auto) 1fr;
4
+ gap: var(--pix-spacing-6x);
5
+ padding: var(--pix-spacing-6x);
6
+ }
@@ -0,0 +1,59 @@
1
+ .pix-navigation-button {
2
+ @extend %pix-body-s;
3
+
4
+ position: relative;
5
+ display: flex;
6
+ gap: var(--pix-spacing-2x);
7
+ align-items: center;
8
+ width: max-content;
9
+ width: 100%;
10
+ padding: var(--pix-spacing-2x) var(--pix-spacing-3x);
11
+ font-weight: 400;
12
+ // stylelint-disable-next-line custom-property-pattern
13
+ font-family: var(--_pix-font-family-title);
14
+
15
+ &:focus::before,
16
+ &:focus-visible::before,
17
+ &.active::before,
18
+ &:hover::before {
19
+ position: absolute;
20
+ top:0;
21
+ left: 0;
22
+ z-index: -1;
23
+ width: 100%;
24
+ height: 100%;
25
+ background-color: currentcolor;
26
+ border-radius: var(--pix-spacing-2x);
27
+ content: '';
28
+ }
29
+
30
+ &:hover::before {
31
+ opacity: .3;
32
+ }
33
+
34
+ &:focus, &:focus-visible {
35
+ border-radius: var(--pix-spacing-2x);
36
+ outline: 1px solid currentcolor ;
37
+
38
+ &::before{
39
+ opacity: .3;
40
+ }
41
+ }
42
+
43
+ &:active::before {
44
+ opacity: .5;
45
+ }
46
+
47
+ &.active::before {
48
+ opacity: .2;
49
+ }
50
+
51
+ &.active {
52
+ font-weight: var(--pix-font-bold);
53
+ }
54
+
55
+ }
56
+
57
+ .pix-navigation-button__external-icon {
58
+ width: 1rem;
59
+ }
@@ -0,0 +1,14 @@
1
+ .pix-navigation-separator {
2
+ @extend %pix-body-l;
3
+
4
+ height: 1.25rem;
5
+ margin: 0;
6
+ color: inherit;
7
+ line-height: 1.25rem;
8
+ border: none;
9
+
10
+ &::after {
11
+ font-weight: var(--pix-font-medium);
12
+ content: '–';
13
+ }
14
+ }
@@ -0,0 +1,122 @@
1
+ .pix-navigation {
2
+ position: sticky;
3
+ bottom: var(--pix-spacing-6x);
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap:var(--pix-spacing-6x);
7
+ align-items: center;
8
+ min-width: 214px;
9
+ height: fit-content;
10
+ min-height: calc(100vh - var(--pix-spacing-6x) * 2);
11
+
12
+ // using a margin top / bottom allow user to discover rapidly
13
+ // the part of sidebar that is above the fold
14
+ margin-top: auto;
15
+ padding: var(--pix-spacing-6x) var(--pix-spacing-4x);
16
+ color: var(--pix-navigation-text-color);
17
+ background-color: var(--pix-navigation-color);
18
+ border-radius: var(--pix-spacing-6x);
19
+
20
+ --pix-navigation-button-bgcolor-hover: rgb(205, 209, 217, .3);
21
+ --pix-navigation-button-bgcolor-active: rgb(205, 209, 217, .5);
22
+
23
+ &--orga {
24
+ --pix-navigation-color: var(--pix-orga-500);
25
+ --pix-navigation-text-color: var(--pix-neutral-0);
26
+
27
+ }
28
+
29
+ &--certif {
30
+ --pix-navigation-color: var(--pix-certif-500);
31
+ --pix-navigation-text-color: var(--pix-neutral-0);
32
+ }
33
+
34
+ &--primary {
35
+ --pix-navigation-color: var(--pix-primary-700);
36
+ --pix-navigation-text-color: var(--pix-neutral-0);
37
+ }
38
+
39
+ &__brand {
40
+ margin-bottom: 0;
41
+ padding:0;
42
+ line-height: 0;
43
+
44
+ }
45
+
46
+ &__nav {
47
+ display: flex;
48
+ flex-direction: column;
49
+ gap: var(--pix-spacing-2x);
50
+ align-self: stretch;
51
+ }
52
+
53
+ &__footer {
54
+ display: flex;
55
+ flex-direction: column;
56
+ gap: var(--pix-spacing-2x);
57
+ margin-top: auto;
58
+ text-align: center;
59
+
60
+ @extend %pix-body-s;
61
+
62
+ & .pix-button--primary {
63
+ color: var(--pix-navigation-color);
64
+ background-color:var(--pix-navigation-text-color);
65
+
66
+ &:hover {
67
+ color: currentcolor;
68
+ background-color: var(--pix-navigation-button-bgcolor-hover);
69
+ fill: currentcolor;
70
+ }
71
+
72
+ &:focus,
73
+ &:focus-visible {
74
+ color: currentcolor;
75
+ background-color: var(--pix-navigation-button-bgcolor-hover);
76
+ outline-color: currentcolor;
77
+ }
78
+
79
+ &:active {
80
+ color: currentcolor;
81
+ background-color: var(--pix-navigation-button-bgcolor-active);
82
+ }
83
+ }
84
+
85
+ & .pix-button--secondary {
86
+ color: currentcolor;
87
+ border-color: currentcolor;
88
+
89
+ &:hover {
90
+ color: currentcolor;
91
+ background-color: var(--pix-navigation-button-bgcolor-hover);
92
+ fill: currentcolor;
93
+ }
94
+
95
+ &:focus,
96
+ &:focus-visible {
97
+ color: currentcolor;
98
+ background-color: var(--pix-navigation-button-bgcolor-hover);
99
+ outline-color: currentcolor;
100
+ }
101
+
102
+ &:active {
103
+ color: currentcolor;
104
+ background-color: var(--pix-navigation-button-bgcolor-active);
105
+ }
106
+ }
107
+
108
+ & .pix-button--tertiary {
109
+ padding: 0;
110
+ color: currentcolor;
111
+
112
+ &:hover,
113
+ &:focus,
114
+ &:active,
115
+ &:focus-visible {
116
+ color: currentcolor;
117
+ }
118
+ }
119
+ }
120
+
121
+ }
122
+
@@ -37,7 +37,10 @@
37
37
  @import 'pix-search-input';
38
38
  @import 'pix-toast';
39
39
  @import 'toast-example';
40
-
40
+ @import 'pix-navigation';
41
+ @import 'pix-navigation-button';
42
+ @import 'pix-navigation-separator';
43
+ @import 'pix-app-layout';
41
44
 
42
45
 
43
46
  // at the end so it can override it's children scss
@@ -5,6 +5,14 @@
5
5
  src: url('../@1024pix/pix-ui/fonts/Nunito/Nunito-Bold.woff2');
6
6
  }
7
7
 
8
+ @font-face {
9
+ font-weight: 400;
10
+ font-family: 'Nunito';
11
+ font-style: normal;
12
+ src: url('../@1024pix/pix-ui/fonts/Nunito/Nunito-Regular.woff2');
13
+ }
14
+
15
+
8
16
  /* @deprecated - use Nunito */
9
17
  @font-face {
10
18
  font-weight: 500;
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-app-layout';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-navigation-button';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-navigation-separator';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-navigation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "48.2.0",
3
+ "version": "48.3.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"