@1024pix/pix-ui 49.3.0 → 49.4.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.
@@ -19,12 +19,12 @@
19
19
  {{yield to="inputElement"}}
20
20
 
21
21
  <span class="{{if @screenReaderOnly 'screen-reader-only'}}">
22
+ {{yield}}
23
+
22
24
  {{#if @requiredLabel}}
23
25
  <abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
24
26
  {{/if}}
25
27
 
26
- {{yield}}
27
-
28
28
  {{#if @subLabel}}
29
29
  <span class="pix-label__sub-label">{{@subLabel}}</span>
30
30
  {{/if}}
@@ -0,0 +1,9 @@
1
+ {{#if this.displayHeader}}
2
+ <th scope="col" ...attributes>
3
+ {{yield to="header"}}
4
+ </th>
5
+ {{else}}
6
+ <td ...attributes>
7
+ {{yield to="cell"}}
8
+ </td>
9
+ {{/if}}
@@ -0,0 +1,7 @@
1
+ import Component from '@glimmer/component';
2
+
3
+ export default class PixTableColumn extends Component {
4
+ get displayHeader() {
5
+ return this.args.context === 'header';
6
+ }
7
+ }
@@ -0,0 +1,17 @@
1
+ <div class="pix-table">
2
+ <table>
3
+ <caption class="screen-reader-only">{{this.caption}}</caption>
4
+ <thead class={{this.headerClass}}>
5
+ <tr>
6
+ {{yield null "header" to="columns"}}
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ {{#each @data as |row|}}
11
+ <tr>
12
+ {{yield row "cell" to="columns"}}
13
+ </tr>
14
+ {{/each}}
15
+ </tbody>
16
+ </table>
17
+ </div>
@@ -0,0 +1,28 @@
1
+ import Component from '@glimmer/component';
2
+ import { warn } from '@ember/debug';
3
+
4
+ export default class PixTable extends Component {
5
+ get variant() {
6
+ const value = this.args.variant ?? 'primary';
7
+ warn(
8
+ `PixTable: @variant "${value}" should be certif, orga or primary`,
9
+ ['primary', 'orga', 'certif'].includes(value),
10
+ {
11
+ id: 'pix-ui.pix-table.variant.not-valid',
12
+ },
13
+ );
14
+
15
+ return value;
16
+ }
17
+
18
+ get caption() {
19
+ warn(`PixTable: @caption is required`, Boolean(this.args.caption), {
20
+ id: 'pix-ui.pix-table.caption.required',
21
+ });
22
+ return this.args.caption;
23
+ }
24
+
25
+ get headerClass() {
26
+ return `pix-table-header--${this.variant}`;
27
+ }
28
+ }
@@ -0,0 +1,49 @@
1
+ .pix-table {
2
+ width: 100%;
3
+ padding: var(--pix-spacing-4x);
4
+ overflow: auto;
5
+ border: solid 1px var(--pix-neutral-100);
6
+ border-radius: var(--pix-spacing-2x);
7
+
8
+ @extend %pix-body-s;
9
+
10
+ table {
11
+ min-width: 100%;
12
+ border-collapse: collapse;
13
+
14
+ tbody > tr:nth-of-type(even) {
15
+ background-color: var(--pix-neutral-20);
16
+ }
17
+
18
+ thead.pix-table-header {
19
+ &--primary {
20
+ background: var(--pix-primary-10);
21
+ }
22
+
23
+ &--orga {
24
+ background: var(--pix-orga-50);
25
+ }
26
+
27
+ &--certif {
28
+ background: var(--pix-certif-50);
29
+ }
30
+ }
31
+
32
+ th {
33
+ text-align: start;
34
+ }
35
+
36
+ td, th {
37
+ padding: var(--pix-spacing-6x) var(--pix-spacing-4x);
38
+
39
+ &:first-child {
40
+ border-radius: var(--pix-spacing-2x) 0 0 var(--pix-spacing-2x);
41
+ }
42
+
43
+ &:last-child {
44
+ border-radius: 0 var(--pix-spacing-2x) var(--pix-spacing-2x) 0;
45
+ }
46
+ }
47
+ }
48
+ }
49
+
@@ -18,6 +18,7 @@
18
18
  @import 'pix-select-list';
19
19
  @import 'pix-stars';
20
20
  @import 'pix-tag';
21
+ @import 'pix-table';
21
22
  @import 'pix-textarea';
22
23
  @import 'pix-tooltip';
23
24
  @import 'pix-button-upload';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-table-column';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-table';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "49.3.0",
3
+ "version": "49.4.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"