@1024pix/pix-ui 60.13.1 → 60.15.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.
@@ -28,11 +28,15 @@ export default class PixAccordions extends Component {
28
28
  this.hasUnCollapsedOnce = true;
29
29
  }
30
30
 
31
+ get isV2Version() {
32
+ return this.args.isV2Version ? '-v2' : '';
33
+ }
34
+
31
35
  <template>
32
- <div class="pix-accordions">
36
+ <div class="pix-accordions{{this.isV2Version}}">
33
37
 
34
38
  <button
35
- class="pix-accordions__title"
39
+ class="pix-accordions{{this.isV2Version}}__title"
36
40
  type="button"
37
41
  {{on "click" this.toggleAccordions}}
38
42
  aria-controls={{this.contentId}}
@@ -40,10 +44,10 @@ export default class PixAccordions extends Component {
40
44
  ...attributes
41
45
  >
42
46
 
43
- <span class="pix-accordions-title__container">
47
+ <span class="pix-accordions{{this.isV2Version}}-title__container">
44
48
  {{#if @iconName}}
45
49
  <PixIcon
46
- class="pix-accordions-title__icon"
50
+ class="pix-accordions{{this.isV2Version}}-title__icon"
47
51
  @name={{@iconName}}
48
52
  @plainIcon={{@plainIcon}}
49
53
  @ariaHidden={{true}}
@@ -53,14 +57,14 @@ export default class PixAccordions extends Component {
53
57
  {{yield to="title"}}
54
58
  </span>
55
59
 
56
- <span class="pix-accordions-title__container">
60
+ <span class="pix-accordions{{this.isV2Version}}-title__container">
57
61
  {{#if @tagContent}}
58
62
  <PixTag @color={{@tagColor}}>
59
63
  {{@tagContent}}
60
64
  </PixTag>
61
65
  {{/if}}
62
66
  <PixIcon
63
- class="pix-accordions-title-container__toggle-icon"
67
+ class="pix-accordions{{this.isV2Version}}-title-container__toggle-icon"
64
68
  @ariaHidden={{true}}
65
69
  @name="{{if this.isCollapsed 'chevronBottom' 'chevronTop'}}"
66
70
  />
@@ -69,7 +73,7 @@ export default class PixAccordions extends Component {
69
73
 
70
74
  <div
71
75
  id={{this.contentId}}
72
- class="pix-accordions__content"
76
+ class="pix-accordions{{this.isV2Version}}__content"
73
77
  aria-hidden={{if this.isCollapsed "true" "false"}}
74
78
  >
75
79
  {{#if this.isContentRendered}}
@@ -5,6 +5,7 @@ import Component from '@glimmer/component';
5
5
  export default class PixBlockComponent extends Component {
6
6
  get variant() {
7
7
  const value = this.args.variant ?? 'primary';
8
+
8
9
  warn(
9
10
  `PixBlock: @variant "${value}" should be ${VARIANTS.join(', ')}`,
10
11
  VARIANTS.includes(value),
@@ -17,7 +18,7 @@ export default class PixBlockComponent extends Component {
17
18
  }
18
19
 
19
20
  get cssClass() {
20
- const cssClass = ['pix-block', `pix-block--${this.variant}`];
21
+ const cssClass = ['pix-block', `pix-block--variant-${this.variant}`];
21
22
 
22
23
  if (this.args.condensed) {
23
24
  cssClass.push('pix-block--condensed');
@@ -0,0 +1,98 @@
1
+ @use "pix-design-tokens/typography";
2
+ @use 'pix-design-tokens/shadows';
3
+ @use 'pix-design-tokens/breakpoints';
4
+
5
+ .pix-accordions-v2 {
6
+ background-color: var(--pix-neutral-0);
7
+ border-bottom: 1px solid var(--pix-neutral-100);
8
+
9
+ &:last-child {
10
+ border-bottom: none;
11
+ }
12
+
13
+ &:has(.pix-accordions-v2__title[aria-expanded='true']) {
14
+ @extend %pix-shadow-default;
15
+
16
+ margin: var(--pix-spacing-3x) 0;
17
+ border-bottom: none;
18
+ border-radius: 8px;
19
+ }
20
+
21
+ &:has(.pix-accordions-v2__title:hover) {
22
+ border-radius: 8px;
23
+ }
24
+
25
+ &:has(.pix-accordions-v2__title:not(:active)) {
26
+ &:focus-within {
27
+ background-color: var(--pix-primary-50);
28
+ border: 1px solid var(--pix-primary-500);
29
+ outline: 2px solid var(--pix-primary-300);
30
+ }
31
+ }
32
+
33
+ &__content {
34
+ @extend %pix-body-l;
35
+
36
+ padding: var(--pix-spacing-4x);
37
+ background-color: var(--pix-primary-10);
38
+ border-bottom-right-radius: 8px;
39
+ border-bottom-left-radius: 8px;
40
+
41
+ &[aria-hidden='true'] {
42
+ display: none;
43
+ }
44
+ }
45
+ }
46
+
47
+ .pix-accordions-v2__title {
48
+ @extend %pix-title-xs;
49
+
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: space-between;
53
+ width: 100%;
54
+ padding: var(--pix-spacing-4x) var(--pix-spacing-2x);
55
+
56
+ @include breakpoints.device-is('mobile') {
57
+ padding: var(--pix-spacing-3x) var(--pix-spacing-2x);
58
+ }
59
+
60
+ &:hover:not([aria-expanded='true']) {
61
+ border-radius: 8px;
62
+ }
63
+
64
+ &:active:not([aria-expanded='true']) {
65
+ @extend %pix-shadow-default;
66
+ }
67
+
68
+ &:hover,
69
+ &[aria-expanded='true'] {
70
+ background-color: var(--pix-primary-50);
71
+ }
72
+
73
+ &[aria-expanded='true'] {
74
+ background-color: var(--pix-primary-10);
75
+ border-bottom: 1px solid var(--pix-neutral-100);
76
+ border-top-left-radius: 8px;
77
+ border-top-right-radius: 8px;
78
+ }
79
+ }
80
+
81
+ .pix-accordions-v2-title {
82
+ &__container {
83
+ display: flex;
84
+ align-items: center;
85
+ }
86
+
87
+ &__icon {
88
+ margin-right: var(--pix-spacing-2x);
89
+ color: var(--pix-neutral-800);
90
+ }
91
+ }
92
+
93
+ .pix-accordions-v2-title-container {
94
+ &__toggle-icon {
95
+ margin-left: var(--pix-spacing-2x);
96
+ border-radius: 50%;
97
+ }
98
+ }
@@ -2,27 +2,26 @@
2
2
 
3
3
  .pix-block {
4
4
  position: relative;
5
+ padding: var(--pix-spacing-3x);
5
6
  background-color: var(--pix-neutral-0);
6
- border-radius: var(--pix-spacing-2x);
7
+ border-radius: var(--pix-spacing-5x);
8
+
9
+ &--variant-primary {
10
+ @extend %pix-shadow-default;
7
11
 
8
- &--primary {
9
12
  padding: var(--pix-spacing-6x);
10
- border: solid 1px var(--pix-primary-100);
11
13
  }
12
14
 
13
- &--orga {
14
- padding: var(--pix-spacing-3x);
15
- border: solid 1px rgb(var(--pix-orga-500-inline), 0.45);
15
+ &--variant-orga {
16
+ @extend %pix-shadow-orga;
16
17
  }
17
18
 
18
- &--certif {
19
- padding: var(--pix-spacing-3x);
20
- border: solid 1px rgb(var(--pix-certif-500-inline), 0.45);
19
+ &--variant-certif {
20
+ @extend %pix-shadow-certif;
21
21
  }
22
22
 
23
- &--admin {
24
- padding: var(--pix-spacing-3x);
25
- border: solid 1px var(--pix-primary-100);
23
+ &--variant-admin {
24
+ @extend %pix-shadow-default;
26
25
  }
27
26
 
28
27
  &--condensed {
@@ -53,6 +53,7 @@
53
53
  @use 'pix-gauge';
54
54
  @use 'pix-stepper';
55
55
  @use 'pix-card';
56
+ @use 'pix-accordions-v2';
56
57
 
57
58
  // at the end so it can override it's children scss
58
59
  @use 'pix-filterable-and-searchable-select';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "60.13.1",
3
+ "version": "60.15.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"