@1024pix/pix-ui 60.14.0 → 61.0.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.
@@ -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');
@@ -8,7 +8,7 @@ export default class PixModalHeader extends Component {
8
8
  get variant() {
9
9
  if (this.args.variant && !MODAL_VARIANTS.includes(this.args.variant)) {
10
10
  throw new Error(
11
- `ERROR in PixModal component: @variant should be one of ${MODAL_VARIANTS.join(', ')}`,
11
+ `ERROR in PixModalHeader component: @variant should be one of ${MODAL_VARIANTS.join(', ')}`,
12
12
  );
13
13
  }
14
14
 
@@ -18,7 +18,7 @@ export default class PixModalHeader extends Component {
18
18
  }
19
19
 
20
20
  <template>
21
- <div class="pix-modal-header pix-modal-header--{{this.variant}}">
21
+ <div class="pix-modal-header pix-modal-header--{{this.variant}}" ...attributes>
22
22
  <section class="pix-modal-header__title-section">
23
23
  {{#if @iconName}}
24
24
  <div
@@ -0,0 +1,68 @@
1
+ import { MODAL_VARIANTS } from '@1024pix/pix-ui/helpers/variants';
2
+ import { guidFor } from '@ember/object/internals';
3
+ import Component from '@glimmer/component';
4
+
5
+ import PixModalHeader from './pix-modal-header';
6
+ import PixOverlay from './pix-overlay';
7
+
8
+ export default class PixSidePanel extends Component {
9
+ constructor(...args) {
10
+ super(...args);
11
+
12
+ if (!this.args.title) {
13
+ throw new Error('ERROR in PixSidePanel component: @title argument is required.');
14
+ }
15
+ }
16
+
17
+ get variant() {
18
+ if (this.args.variant && !MODAL_VARIANTS.includes(this.args.variant)) {
19
+ throw new Error(
20
+ `ERROR in PixSidePanel component: @variant should be one of ${MODAL_VARIANTS.join(', ')}`,
21
+ );
22
+ }
23
+
24
+ const value = this.args.variant ?? 'default';
25
+
26
+ return value;
27
+ }
28
+
29
+ get id() {
30
+ return guidFor(this);
31
+ }
32
+
33
+ <template>
34
+ <PixOverlay
35
+ class="pix-side-panel__overlay"
36
+ @isVisible={{@showSidePanel}}
37
+ @onClose={{@onClose}}
38
+ @focusOnClose={{@focusOnClose}}
39
+ >
40
+ <div
41
+ class="pix-side-panel pix-side-panel--{{this.variant}}
42
+ {{unless @showSidePanel ' pix-side-panel--hidden'}}"
43
+ role="dialog"
44
+ aria-labelledby="side-panel-title--{{this.id}}"
45
+ aria-describedby="side-panel-content--{{this.id}}"
46
+ aria-modal="true"
47
+ ...attributes
48
+ >
49
+ <PixModalHeader
50
+ class="pix-side-panel__header"
51
+ @id="side-panel-title--{{this.id}}"
52
+ @title={{@title}}
53
+ @subtitle={{@subtitle}}
54
+ @iconName={{@iconName}}
55
+ @variant={{this.variant}}
56
+ @onCloseButtonClick={{@onClose}}
57
+ />
58
+
59
+ <div id="side-panel-content--{{this.id}}" class="pix-side-panel__content">
60
+ {{yield to="content"}}
61
+ </div>
62
+ <div class="pix-side-panel__footer pix-side-panel__footer--{{this.variant}}">
63
+ {{yield to="footer"}}
64
+ </div>
65
+ </div>
66
+ </PixOverlay>
67
+ </template>
68
+ }
@@ -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 {
@@ -6,7 +6,7 @@
6
6
  display: flex;
7
7
  align-items: flex-start;
8
8
  justify-content: space-between;
9
- padding: var(--pix-spacing-6x) var(--pix-spacing-4x) var(--pix-spacing-6x) var(--pix-spacing-6x);
9
+ padding: var(--pix-spacing-6x) var(--pix-spacing-4x) var(--pix-spacing-10x) var(--pix-spacing-6x);
10
10
  color: var(--pix-neutral-900);
11
11
  border-top-left-radius: var(--pix-spacing-4x) var(--pix-spacing-4x);
12
12
  border-top-right-radius: var(--pix-spacing-4x) var(--pix-spacing-4x);
@@ -27,6 +27,7 @@
27
27
  display: flex;
28
28
  gap: var(--pix-spacing-4x);
29
29
  align-items: center;
30
+ align-self: center;
30
31
  }
31
32
 
32
33
  &__icon-container {
@@ -70,6 +71,7 @@
70
71
  margin-bottom: 0;
71
72
  padding-right: var(--pix-spacing-8x) + var(--pix-spacing-2x);
72
73
  color: var(--pix-neutral-900);
74
+ text-wrap: balance;
73
75
 
74
76
  @include breakpoints.device-is('tablet') {
75
77
  padding-right: var(--pix-spacing-10x) + var(--pix-spacing-2x);
@@ -0,0 +1,86 @@
1
+ @use 'pix-design-tokens/breakpoints';
2
+ @use 'pix-design-tokens/typography';
3
+ @use 'pix-design-tokens/shadows';
4
+
5
+ .pix-side-panel__overlay {
6
+ overflow-x: hidden;
7
+ }
8
+
9
+ .pix-side-panel {
10
+ @extend %pix-shadow-default;
11
+
12
+ display: flex;
13
+ flex-direction: column;
14
+ width: 256px;
15
+ height: 100%;
16
+ margin-left: auto;
17
+ background: var(--pix-neutral-0);
18
+ border-radius: var(--pix-spacing-4x) 0 0 var(--pix-spacing-4x);
19
+ transform: translate(0);
20
+ transition: transform 0.3s ease-in-out;
21
+
22
+ @include breakpoints.device-is('tablet') {
23
+ width: 412px;
24
+ }
25
+
26
+ &--hidden {
27
+ transform: translate(100%);
28
+ }
29
+
30
+ &--default {
31
+ @extend %pix-shadow-default;
32
+ }
33
+
34
+ &--orga {
35
+ @extend %pix-shadow-orga;
36
+ }
37
+
38
+ &--certif {
39
+ @extend %pix-shadow-certif;
40
+ }
41
+
42
+ &__header {
43
+ border-top-right-radius: 0;
44
+ }
45
+
46
+ &__content {
47
+ display: flex;
48
+ flex-direction: column;
49
+ flex-grow: 1;
50
+ gap: var(--pix-spacing-2x);
51
+ padding: var(--pix-spacing-4x) var(--pix-spacing-6x);
52
+ overflow: auto;
53
+ }
54
+
55
+ &__footer {
56
+ display: flex;
57
+ flex-direction: column;
58
+ gap: var(--pix-spacing-2x);
59
+ align-items: center;
60
+ padding: var(--pix-spacing-6x);
61
+ border-bottom-right-radius: 0;
62
+ border-bottom-left-radius: var(--pix-spacing-4x);
63
+
64
+ @include breakpoints.device-is('tablet') {
65
+ flex-flow: row wrap;
66
+ gap: var(--pix-spacing-4x);
67
+ justify-content: flex-end;
68
+ }
69
+
70
+ &--default {
71
+ background-color: var(--pix-primary-10);
72
+ }
73
+
74
+ &--orga {
75
+ background-color: var(--pix-orga-50);
76
+ }
77
+
78
+ &--certif {
79
+ background-color: var(--pix-certif-50);
80
+ }
81
+
82
+ > ul {
83
+ display: contents;
84
+ }
85
+ }
86
+ }
@@ -30,7 +30,7 @@
30
30
  @use 'pix-radio-button';
31
31
  @use 'pix-modal';
32
32
  @use 'pix-modal-header';
33
- @use 'pix-sidebar';
33
+ @use 'pix-side-panel';
34
34
  @use 'pix-input-code';
35
35
  @use 'pix-selectable-tag';
36
36
  @use 'pix-pagination';
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-side-panel';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "60.14.0",
3
+ "version": "61.0.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"
@@ -1,49 +0,0 @@
1
- import { guidFor } from '@ember/object/internals';
2
- import Component from '@glimmer/component';
3
-
4
- import PixIconButton from './pix-icon-button';
5
- import PixOverlay from './pix-overlay';
6
- export default class PixSidebar extends Component {
7
- constructor(...args) {
8
- super(...args);
9
-
10
- if (!this.args.title) {
11
- throw new Error('ERROR in PixSidebar component: @title argument is required.');
12
- }
13
- }
14
-
15
- get id() {
16
- return guidFor(this);
17
- }
18
-
19
- <template>
20
- <PixOverlay @isVisible={{@showSidebar}} @onClose={{@onClose}} @focusOnClose={{@focusOnClose}}>
21
- <div
22
- class="pix-sidebar {{unless @showSidebar ' pix-sidebar--hidden'}}"
23
- role="dialog"
24
- aria-labelledby="sidebar-title--{{this.id}}"
25
- aria-describedby="sidebar-content--{{this.id}}"
26
- aria-modal="true"
27
- ...attributes
28
- >
29
- <div class="pix-sidebar__header">
30
- <h1 id="sidebar-title--{{this.id}}" class="pix-sidebar__title">{{@title}}</h1>
31
- <PixIconButton
32
- @iconName="close"
33
- @triggerAction={{@onClose}}
34
- @ariaLabel="Fermer"
35
- @size="small"
36
- @withBackground={{true}}
37
- class="pix-sidebar__close-button"
38
- />
39
- </div>
40
- <div id="sidebar-content--{{this.id}}" class="pix-sidebar__content">
41
- {{yield to="content"}}
42
- </div>
43
- <div class="pix-sidebar__footer">
44
- {{yield to="footer"}}
45
- </div>
46
- </div>
47
- </PixOverlay>
48
- </template>
49
- }
@@ -1,79 +0,0 @@
1
- @use "pix-design-tokens/breakpoints";
2
- @use "pix-design-tokens/typography";
3
-
4
- .pix-sidebar__overlay {
5
- position: fixed;
6
- top: 0;
7
- right: 0;
8
- bottom: 0;
9
- left: 0;
10
- z-index: 1000;
11
- overflow-y: scroll;
12
- background-color: rgba(52, 69, 99, 0.7);
13
- transition: all 0.3s ease-in-out;
14
-
15
- &--hidden {
16
- visibility: hidden;
17
- opacity: 0;
18
- }
19
- }
20
-
21
- .pix-sidebar {
22
- --sidebar-padding: var(--pix-spacing-4x);
23
- --mobile-close-button-size: var(--pix-spacing-8x);
24
- --tablet-close-button-size: var(--pix-spacing-10x);
25
- --space-between-title-and-close-button: var(--pix-spacing-2x);
26
- --button-margin: var(--pix-spacing-4x);
27
-
28
- display: flex;
29
- flex-direction: column;
30
- max-width: 320px;
31
- height: 100%;
32
- background: var(--pix-neutral-0);
33
- box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);
34
- transform: translate(0);
35
- transition: transform 0.3s ease-in-out;
36
-
37
- &--hidden {
38
- transform: translate(-100%);
39
- }
40
-
41
- &__header {
42
- display: flex;
43
- align-items: center;
44
- justify-content: space-between;
45
- padding: var(--sidebar-padding);
46
- border-bottom: 1px solid var(--pix-neutral-100);
47
- }
48
-
49
- &__close-button {
50
- flex-shrink: 0;
51
-
52
- @include breakpoints.device-is('tablet') {
53
- width: var(--tablet-close-button-size);
54
- height: var(--tablet-close-button-size);
55
- }
56
- }
57
-
58
- &__content {
59
- flex-grow: 1;
60
- overflow: auto;
61
- }
62
-
63
- &__title {
64
- @extend %pix-title-s;
65
-
66
- margin-bottom: 0;
67
- padding-right: var(--mobile-close-button-size) + var(--space-between-title-and-close-button);
68
- color: var(--pix-neutral-900);
69
-
70
- @include breakpoints.device-is('tablet') {
71
- padding-right: var(--tablet-close-button-size) + var(--space-between-title-and-close-button);
72
- }
73
- }
74
-
75
- &__footer {
76
- padding: var(--sidebar-padding);
77
- border-top: 1px solid var(--pix-neutral-100);
78
- }
79
- }
@@ -1 +0,0 @@
1
- export { default } from '@1024pix/pix-ui/components/pix-sidebar';