@1024pix/pix-ui 62.0.0 → 62.0.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.
@@ -10,6 +10,7 @@ import PixBlock from './pix-block';
10
10
  export default class PixTable extends Component {
11
11
  get variant() {
12
12
  const value = this.args.variant ?? 'primary';
13
+
13
14
  warn(
14
15
  `PixTable: @variant "${value}" should be ${VARIANTS.join(', ')}`,
15
16
  VARIANTS.includes(value),
@@ -25,11 +26,11 @@ export default class PixTable extends Component {
25
26
  warn(`PixTable: @caption is required`, Boolean(this.args.caption), {
26
27
  id: 'pix-ui.pix-table.caption.required',
27
28
  });
29
+
28
30
  return this.args.caption;
29
31
  }
30
32
 
31
33
  get tableClass() {
32
- const tableClass = ['pix-table'];
33
34
  warn(
34
35
  'PixTable: @condensed must be a boolean, default undefined',
35
36
  [true, false, undefined].includes(this.args.condensed),
@@ -37,15 +38,14 @@ export default class PixTable extends Component {
37
38
  id: 'pix-ui.pix-table.condensed.not-boolean',
38
39
  },
39
40
  );
40
- if (this.args.condensed) {
41
- tableClass.push('pix-table--condensed');
42
- }
43
41
 
42
+ const tableClass = ['pix-table'];
43
+ if (this.args.condensed) tableClass.push('pix-table--condensed');
44
44
  return tableClass.join(' ');
45
45
  }
46
46
 
47
47
  get headerClass() {
48
- return `pix-table-header--${this.variant}`;
48
+ return `pix-table-header pix-table-header--${this.variant}`;
49
49
  }
50
50
 
51
51
  get captionClass() {
@@ -59,6 +59,7 @@ export default class PixTable extends Component {
59
59
  @action
60
60
  onClick(row, event) {
61
61
  event.stopPropagation();
62
+
62
63
  if (this.hasOnRowClick) {
63
64
  this.args.onRowClick(row);
64
65
  }
@@ -2,6 +2,8 @@
2
2
  @use "pix-design-tokens/typography";
3
3
 
4
4
  .pix-table {
5
+ @extend %pix-body-s;
6
+
5
7
  min-width: 100%;
6
8
  overflow: auto;
7
9
 
@@ -9,106 +11,100 @@
9
11
  overflow: unset;
10
12
  }
11
13
 
12
- @extend %pix-body-s;
13
-
14
- &__caption {
15
- margin-bottom: var(--pix-spacing-3x);
16
- text-align: left;
17
- caption-side: top;
14
+ table {
15
+ width: 100%;
16
+ border-collapse: collapse;
17
+ }
18
18
 
19
- @extend %pix-title-xxs;
19
+ tbody > tr:nth-of-type(even) > :is(td, th) {
20
+ background-color: rgba(var(--pix-neutral-20-inline), 0.80);
20
21
  }
21
22
 
22
- &__clickable-row {
23
+ tbody > tr.pix-table__clickable-row {
23
24
  cursor: pointer;
24
25
 
25
- &:hover, &:focus, &:active {
26
- transition: 0.25s ease;
26
+ & > :is(td, th) {
27
+ transition: background-color 0.25s ease;
27
28
  }
28
29
 
29
- &:hover {
30
+ &:hover > :is(td, th) {
30
31
  background-color: rgba(var(--pix-neutral-100-inline), 0.50);
31
32
  }
32
33
 
33
- &:focus {
34
+ &:focus > :is(td, th) {
34
35
  background-color: rgba(var(--pix-neutral-100-inline), 0.40);
35
36
  }
36
37
 
37
- &:active {
38
+ &:active > :is(td, th) {
38
39
  background-color: rgba(var(--pix-neutral-100-inline), 0.75);
39
40
  }
40
41
  }
41
42
 
42
- table {
43
- width: 100%;
44
- border-collapse: collapse;
45
- }
46
-
47
- tbody > tr:nth-of-type(even):not(.pix-table__clickable-row:hover, .pix-table__clickable-row:focus, .pix-table__clickable-row:active) {
48
- background-color: rgba(var(--pix-neutral-20-inline), 0.80);
49
- }
50
-
51
- thead.pix-table-header {
52
- &--primary {
53
- background: var(--pix-primary-10);
54
- }
55
-
56
- &--orga {
57
- background: var(--pix-orga-50);
58
- }
59
-
60
- &--certif {
61
- background: var(--pix-certif-50);
62
- }
63
-
64
- &--admin {
65
- background: var(--pix-primary-100);
66
- }
67
- }
43
+ td, th {
44
+ padding: var(--pix-spacing-4x);
68
45
 
69
- .pix-table-header-container {
70
- display: flex;
71
- gap: var(--pix-spacing-1x);
72
- align-items: center;
46
+ &:first-child {
47
+ border-top-left-radius: var(--pix-spacing-2x);
48
+ border-bottom-left-radius: var(--pix-spacing-2x);
73
49
  }
74
50
 
75
- th[scope='col'] {
76
- font-weight: var(--pix-font-bold);
77
- text-align: start;
78
- vertical-align: middle;
51
+ &:last-child {
52
+ border-top-right-radius: var(--pix-spacing-2x);
53
+ border-bottom-right-radius: var(--pix-spacing-2x);
79
54
  }
55
+ }
56
+ }
80
57
 
81
- th[scope='row'] {
82
- font-weight: var(--pix-font-normal);
83
- }
58
+ .pix-table--condensed {
59
+ th, td {
60
+ padding: var(--pix-spacing-2x) var(--pix-spacing-4x);
61
+ }
84
62
 
63
+ td.pix-table-column--tag,
64
+ td.pix-table-column--link {
65
+ padding-top: 0.375rem;
66
+ padding-bottom: 0.375rem;
67
+ }
68
+ }
85
69
 
86
- td, th {
87
- padding: var(--pix-spacing-4x) var(--pix-spacing-4x);
70
+ .pix-table-header {
71
+ &--primary th {
72
+ background: var(--pix-primary-10);
73
+ }
88
74
 
89
- &:first-child {
90
- border-radius: var(--pix-spacing-2x) 0 0 var(--pix-spacing-2x);
91
- }
75
+ &--orga th {
76
+ background: var(--pix-orga-50);
77
+ }
92
78
 
93
- &:last-child {
94
- border-radius: 0 var(--pix-spacing-2x) var(--pix-spacing-2x) 0;
95
- }
96
- }
79
+ &--certif th {
80
+ background: var(--pix-certif-50);
81
+ }
97
82
 
98
- &--condensed {
99
- th, td {
100
- padding: .5rem var(--pix-spacing-4x);
101
- }
83
+ &--admin th {
84
+ background: var(--pix-primary-100);
85
+ }
102
86
 
103
- td.pix-table-column--tag {
104
- padding-top: 0.375rem;
105
- padding-bottom: 0.375rem;
106
- }
87
+ th[scope='col'] {
88
+ font-weight: var(--pix-font-bold);
89
+ text-align: start;
90
+ vertical-align: middle;
91
+ }
107
92
 
108
- td.pix-table-column--link {
109
- padding-top: 0.375rem;
110
- padding-bottom: 0.375rem;
111
- }
93
+ th[scope='row'] {
94
+ font-weight: var(--pix-font-normal);
112
95
  }
113
96
  }
114
97
 
98
+ .pix-table-header-container {
99
+ display: flex;
100
+ gap: var(--pix-spacing-1x);
101
+ align-items: center;
102
+ }
103
+
104
+ .pix-table__caption {
105
+ margin-bottom: var(--pix-spacing-3x);
106
+ text-align: left;
107
+ caption-side: top;
108
+
109
+ @extend %pix-title-xxs;
110
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "62.0.0",
3
+ "version": "62.0.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"