@1024pix/pix-ui 55.4.0 → 55.6.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.
@@ -1,3 +1,4 @@
1
+ import { VARIANTS } from '@1024pix/pix-ui/helpers/variants';
1
2
  import { warn } from '@ember/debug';
2
3
  import Component from '@glimmer/component';
3
4
 
@@ -5,8 +6,8 @@ export default class PixAppLayout extends Component {
5
6
  get variant() {
6
7
  const value = this.args.variant ?? 'primary';
7
8
  warn(
8
- `PixAppLayout: @variant "${value}" should be certif, orga or primary`,
9
- ['primary', 'orga', 'certif'].includes(value),
9
+ `PixAppLayout: @variant "${value}" should be ${VARIANTS.join(', ')}`,
10
+ VARIANTS.includes(value),
10
11
  {
11
12
  id: 'pix-ui.pix-app-layout.variant.not-valid',
12
13
  },
@@ -1,14 +1,13 @@
1
+ import { VARIANTS } from '@1024pix/pix-ui/helpers/variants';
1
2
  import { warn } from '@ember/debug';
2
3
  import Component from '@glimmer/component';
3
4
 
4
5
  export default class PixBlockComponent extends Component {
5
- text = 'pix-block';
6
-
7
6
  get variant() {
8
- const value = this.args.variant ?? 'default';
7
+ const value = this.args.variant ?? 'primary';
9
8
  warn(
10
- `PixBlock: @variant "${value}" should be default, certif, orga or admin`,
11
- ['default', 'orga', 'certif', 'admin'].includes(value),
9
+ `PixBlock: @variant "${value}" should be ${VARIANTS.join(', ')}`,
10
+ VARIANTS.includes(value),
12
11
  {
13
12
  id: 'pix-ui.pix-block.variant.not-valid',
14
13
  },
@@ -75,13 +75,16 @@ export default class PixTableColumn extends Component {
75
75
  }
76
76
 
77
77
  get typeClass() {
78
- const correctTypes = ['number', 'text'];
78
+ const correctTypes = ['number', 'text', 'checkbox'];
79
79
  warn('PixTableColumn: you need to provide a valid type', correctTypes.includes(this.type), {
80
80
  id: 'pix-ui.table-column.type.incorrect',
81
81
  });
82
82
  if (this.args.type === 'number') {
83
83
  return `pix-table-column--number`;
84
84
  }
85
+ if (this.args.type === 'checkbox') {
86
+ return `pix-table-column--checkbox`;
87
+ }
85
88
  return '';
86
89
  }
87
90
  }
@@ -1,4 +1,4 @@
1
- <div class={{this.tableClass}} ...attributes>
1
+ <PixBlock @variant={{@variant}} class={{this.tableClass}} ...attributes>
2
2
  <table>
3
3
  <caption class="screen-reader-only">{{this.caption}}</caption>
4
4
  <thead class={{this.headerClass}}>
@@ -17,4 +17,4 @@
17
17
  {{/each}}
18
18
  </tbody>
19
19
  </table>
20
- </div>
20
+ </PixBlock>
@@ -1,3 +1,4 @@
1
+ import { VARIANTS } from '@1024pix/pix-ui/helpers/variants';
1
2
  import { warn } from '@ember/debug';
2
3
  import { action } from '@ember/object';
3
4
  import Component from '@glimmer/component';
@@ -6,8 +7,8 @@ export default class PixTable extends Component {
6
7
  get variant() {
7
8
  const value = this.args.variant ?? 'primary';
8
9
  warn(
9
- `PixTable: @variant "${value}" should be certif, orga or primary`,
10
- ['primary', 'orga', 'certif'].includes(value),
10
+ `PixTable: @variant "${value}" should be ${VARIANTS.join(', ')}`,
11
+ VARIANTS.includes(value),
11
12
  {
12
13
  id: 'pix-ui.pix-table.variant.not-valid',
13
14
  },
@@ -0,0 +1 @@
1
+ export const VARIANTS = ['primary', 'orga', 'certif', 'admin'];
@@ -5,7 +5,7 @@
5
5
  background-color: var(--pix-neutral-0);
6
6
  border-radius: var(--pix-spacing-2x);
7
7
 
8
- &--default {
8
+ &--primary {
9
9
  padding: var(--pix-spacing-6x);
10
10
  border: solid 1px var(--pix-primary-100);
11
11
  }
@@ -1,5 +1,9 @@
1
1
  .pix-table-column {
2
- &--number{
2
+ &--number {
3
3
  text-align: left;
4
4
  }
5
+
6
+ &--checkbox {
7
+ width: 3.25rem;
8
+ }
5
9
  }
@@ -2,12 +2,8 @@
2
2
  @use "pix-design-tokens/typography";
3
3
 
4
4
  .pix-table {
5
- width: 100%;
6
- padding: var(--pix-spacing-4x);
5
+ min-width: 100%;
7
6
  overflow: auto;
8
- background-color: var(--pix-neutral-0);
9
- border: solid 1px var(--pix-neutral-100);
10
- border-radius: var(--pix-spacing-2x);
11
7
 
12
8
  @extend %pix-body-s;
13
9
 
@@ -32,7 +28,7 @@
32
28
  }
33
29
 
34
30
  table {
35
- min-width: 100%;
31
+ width: 100%;
36
32
  border-collapse: collapse;
37
33
 
38
34
  tbody > tr:nth-of-type(even):not(.pix-table__clickable-row:hover, .pix-table__clickable-row:focus, .pix-table__clickable-row:active) {
@@ -51,6 +47,10 @@
51
47
  &--certif {
52
48
  background: var(--pix-certif-50);
53
49
  }
50
+
51
+ &--admin {
52
+ background: var(--pix-primary-100);
53
+ }
54
54
  }
55
55
 
56
56
  .pix-table-header-container {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "55.4.0",
3
+ "version": "55.6.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"