@shoper/phoenix_design_system 0.2.0 → 0.2.2-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.
Files changed (86) hide show
  1. package/build/cjs/external/lit-html/async-directive.js +16 -0
  2. package/build/cjs/external/lit-html/async-directive.js.map +1 -0
  3. package/build/cjs/external/lit-html/directive-helpers.js +14 -0
  4. package/build/cjs/external/lit-html/directive-helpers.js.map +1 -0
  5. package/build/cjs/external/lit-html/directive.js +15 -0
  6. package/build/cjs/external/lit-html/directive.js.map +1 -0
  7. package/build/cjs/external/lit-html/directives/ref.js +17 -0
  8. package/build/cjs/external/lit-html/directives/ref.js.map +1 -0
  9. package/build/cjs/external/lit-html/lit-html.js +14 -0
  10. package/build/cjs/external/lit-html/lit-html.js.map +1 -0
  11. package/build/cjs/packages/phoenix/src/components/modal/modal.js +176 -0
  12. package/build/cjs/packages/phoenix/src/components/modal/modal.js.map +1 -0
  13. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js +65 -0
  14. package/build/cjs/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
  15. package/build/cjs/packages/phoenix/src/components/modal/modal_body.js +19 -0
  16. package/build/cjs/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
  17. package/build/cjs/packages/phoenix/src/components/modal/modal_close.js +41 -0
  18. package/build/cjs/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
  19. package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js +19 -0
  20. package/build/cjs/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
  21. package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js +19 -0
  22. package/build/cjs/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
  23. package/build/cjs/packages/phoenix/src/components/modal/modal_header.js +19 -0
  24. package/build/cjs/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
  25. package/build/cjs/packages/phoenix/src/components/portal/portal.js +19 -14
  26. package/build/cjs/packages/phoenix/src/components/portal/portal.js.map +1 -1
  27. package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js +3 -1
  28. package/build/cjs/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
  29. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js +9 -10
  30. package/build/cjs/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  31. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js +35 -1
  32. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
  33. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +8 -0
  34. package/build/cjs/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
  35. package/build/cjs/packages/phoenix/src/index.js +45 -3
  36. package/build/cjs/packages/phoenix/src/index.js.map +1 -1
  37. package/build/esm/external/lit-html/async-directive.js +12 -0
  38. package/build/esm/external/lit-html/async-directive.js.map +1 -0
  39. package/build/esm/external/lit-html/directive-helpers.js +10 -0
  40. package/build/esm/external/lit-html/directive-helpers.js.map +1 -0
  41. package/build/esm/external/lit-html/directive.js +9 -0
  42. package/build/esm/external/lit-html/directive.js.map +1 -0
  43. package/build/esm/external/lit-html/directives/ref.js +12 -0
  44. package/build/esm/external/lit-html/directives/ref.js.map +1 -0
  45. package/build/esm/external/lit-html/lit-html.js +9 -0
  46. package/build/esm/external/lit-html/lit-html.js.map +1 -0
  47. package/build/esm/packages/phoenix/src/components/modal/modal.d.ts +30 -0
  48. package/build/esm/packages/phoenix/src/components/modal/modal.js +174 -0
  49. package/build/esm/packages/phoenix/src/components/modal/modal.js.map +1 -0
  50. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.d.ts +12 -0
  51. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js +63 -0
  52. package/build/esm/packages/phoenix/src/components/modal/modal_backdrop.js.map +1 -0
  53. package/build/esm/packages/phoenix/src/components/modal/modal_body.d.ts +4 -0
  54. package/build/esm/packages/phoenix/src/components/modal/modal_body.js +17 -0
  55. package/build/esm/packages/phoenix/src/components/modal/modal_body.js.map +1 -0
  56. package/build/esm/packages/phoenix/src/components/modal/modal_close.d.ts +8 -0
  57. package/build/esm/packages/phoenix/src/components/modal/modal_close.js +39 -0
  58. package/build/esm/packages/phoenix/src/components/modal/modal_close.js.map +1 -0
  59. package/build/esm/packages/phoenix/src/components/modal/modal_constants.d.ts +9 -0
  60. package/build/esm/packages/phoenix/src/components/modal/modal_constants.js +12 -0
  61. package/build/esm/packages/phoenix/src/components/modal/modal_constants.js.map +1 -0
  62. package/build/esm/packages/phoenix/src/components/modal/modal_footer.d.ts +4 -0
  63. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js +17 -0
  64. package/build/esm/packages/phoenix/src/components/modal/modal_footer.js.map +1 -0
  65. package/build/esm/packages/phoenix/src/components/modal/modal_header.d.ts +4 -0
  66. package/build/esm/packages/phoenix/src/components/modal/modal_header.js +17 -0
  67. package/build/esm/packages/phoenix/src/components/modal/modal_header.js.map +1 -0
  68. package/build/esm/packages/phoenix/src/components/portal/portal.d.ts +3 -3
  69. package/build/esm/packages/phoenix/src/components/portal/portal.js +19 -14
  70. package/build/esm/packages/phoenix/src/components/portal/portal.js.map +1 -1
  71. package/build/esm/packages/phoenix/src/components/portal/portal_constants.d.ts +3 -0
  72. package/build/esm/packages/phoenix/src/components/portal/portal_constants.js +3 -2
  73. package/build/esm/packages/phoenix/src/components/portal/portal_constants.js.map +1 -1
  74. package/build/esm/packages/phoenix/src/components/portal/portal_target.d.ts +0 -1
  75. package/build/esm/packages/phoenix/src/components/portal/portal_target.js +9 -10
  76. package/build/esm/packages/phoenix/src/components/portal/portal_target.js.map +1 -1
  77. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.d.ts +6 -1
  78. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js +36 -2
  79. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_element.js.map +1 -1
  80. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.d.ts +1 -0
  81. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js +4 -0
  82. package/build/esm/packages/phoenix/src/core/phoenix_light_lit_elements_constants.js.map +1 -0
  83. package/build/esm/packages/phoenix/src/index.d.ts +6 -0
  84. package/build/esm/packages/phoenix/src/index.js +7 -1
  85. package/build/esm/packages/phoenix/src/index.js.map +1 -1
  86. package/package.json +1 -1
@@ -0,0 +1,39 @@
1
+ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
+ import { customElement } from 'lit/decorators';
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+ import { MODAL_EVENTS } from './modal_constants.js';
5
+
6
+ let HModalClose = class HModalClose extends PhoenixLightLitElement {
7
+ constructor() {
8
+ super();
9
+ this.tabIndex = 0;
10
+ this.setAttribute('role', 'button');
11
+ }
12
+ connectedCallback() {
13
+ super.connectedCallback();
14
+ this.addEventListener('click', this._dispatchModalCloseEvent);
15
+ this.addEventListener('keydown', this._dispatchModalCloseOnEnterEvent);
16
+ }
17
+ disconnectedCallback() {
18
+ this.removeEventListener('click', this._dispatchModalCloseEvent);
19
+ this.removeEventListener('keydown', this._dispatchModalCloseOnEnterEvent);
20
+ }
21
+ _dispatchModalCloseEvent() {
22
+ const closeModalEvent = new CustomEvent(MODAL_EVENTS.close, {
23
+ bubbles: true
24
+ });
25
+ this.dispatchEvent(closeModalEvent);
26
+ }
27
+ _dispatchModalCloseOnEnterEvent(ev) {
28
+ if (ev.code === 'Enter' || ev.code === 'Space') {
29
+ this._dispatchModalCloseEvent();
30
+ }
31
+ }
32
+ };
33
+ HModalClose = __decorate([
34
+ customElement('h-modal-close'),
35
+ __metadata("design:paramtypes", [])
36
+ ], HModalClose);
37
+
38
+ export { HModalClose };
39
+ //# sourceMappingURL=modal_close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,9 @@
1
+ export declare const MODALS_PORTAL_NAME = "modals";
2
+ export declare const MODAL_EVENTS: {
3
+ open: string;
4
+ close: string;
5
+ opened: string;
6
+ closed: string;
7
+ };
8
+ export declare const MODAL_OPENED_PROP = "opened";
9
+ export declare const FOCUSABLE_ELEMENTS_WITHIN_MODAL = "button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
@@ -0,0 +1,12 @@
1
+ const MODALS_PORTAL_NAME = 'modals';
2
+ const MODAL_EVENTS = {
3
+ open: 'modal.open',
4
+ close: 'modal.close',
5
+ opened: 'modal.opened',
6
+ closed: 'modal.closed'
7
+ };
8
+ const MODAL_OPENED_PROP = 'opened';
9
+ const FOCUSABLE_ELEMENTS_WITHIN_MODAL = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';
10
+
11
+ export { FOCUSABLE_ELEMENTS_WITHIN_MODAL, MODALS_PORTAL_NAME, MODAL_EVENTS, MODAL_OPENED_PROP };
12
+ //# sourceMappingURL=modal_constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,4 @@
1
+ import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element";
2
+ export declare class HModalFooter extends PhoenixLightLitElement {
3
+ constructor();
4
+ }
@@ -0,0 +1,17 @@
1
+ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
+ import { customElement } from 'lit/decorators';
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+
5
+ let HModalFooter = class HModalFooter extends PhoenixLightLitElement {
6
+ constructor() {
7
+ super();
8
+ this.slot = this.hasAttribute('slot') ? this.slot : 'footer';
9
+ }
10
+ };
11
+ HModalFooter = __decorate([
12
+ customElement('h-modal-footer'),
13
+ __metadata("design:paramtypes", [])
14
+ ], HModalFooter);
15
+
16
+ export { HModalFooter };
17
+ //# sourceMappingURL=modal_footer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1,4 @@
1
+ import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element";
2
+ export declare class HModalHeader extends PhoenixLightLitElement {
3
+ constructor();
4
+ }
@@ -0,0 +1,17 @@
1
+ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
+ import { customElement } from 'lit/decorators';
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
+
5
+ let HModalHeader = class HModalHeader extends PhoenixLightLitElement {
6
+ constructor() {
7
+ super();
8
+ this.slot = this.hasAttribute('slot') ? this.slot : 'header';
9
+ }
10
+ };
11
+ HModalHeader = __decorate([
12
+ customElement('h-modal-header'),
13
+ __metadata("design:paramtypes", [])
14
+ ], HModalHeader);
15
+
16
+ export { HModalHeader };
17
+ //# sourceMappingURL=modal_header.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,12 +1,12 @@
1
1
  import { PhoenixLightLitElement } from "../../core/phoenix_light_lit_element";
2
2
  export declare class HPortal extends PhoenixLightLitElement {
3
- id: string;
4
- initialChildren: Element[];
3
+ _id: string;
4
+ _initialChildren: Element[];
5
5
  to: string;
6
6
  disabled: boolean;
7
7
  constructor();
8
8
  firstUpdated(): void;
9
- updated(changedProps: Map<string, any>): void;
9
+ updated(): void;
10
10
  disconnectedCallback(): void;
11
11
  openPortal(): void;
12
12
  closePortal(): void;
@@ -1,30 +1,35 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
2
  import { state, property, customElement } from 'lit/decorators';
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
4
4
  import { PORTAL_EVENTS } from './portal_constants.js';
5
5
  import v4 from '../../../../../external/uuid/dist/esm-browser/v4.js';
6
6
 
7
7
  let HPortal = class HPortal extends PhoenixLightLitElement {
8
8
  constructor() {
9
9
  super();
10
- this.id = v4();
11
- this.initialChildren = [];
10
+ this._id = v4();
11
+ this._initialChildren = [];
12
12
  this.to = '';
13
13
  this.disabled = false;
14
- this.initialChildren = [...this.children];
14
+ this._initialChildren = [...this.children];
15
15
  }
16
16
  firstUpdated() {
17
- const shouldOpenPortal = this.initialChildren.length > 0 && !this.disabled;
17
+ const shouldOpenPortal = this._initialChildren.length > 0 && !this.disabled;
18
18
  if (shouldOpenPortal) {
19
19
  this.openPortal();
20
20
  }
21
21
  }
22
- updated(changedProps) {
23
- const disabledValue = changedProps.get('disabled');
24
- if (disabledValue === true) {
22
+ updated() {
23
+ if (this.children.length > 0) {
24
+ if (!this.disabled) {
25
+ this._initialChildren = [...this.children];
26
+ this.openPortal();
27
+ }
28
+ }
29
+ if (this.disabled === true) {
25
30
  this.closePortal();
26
31
  }
27
- else if (disabledValue === false) {
32
+ else if (this.disabled === false) {
28
33
  this.openPortal();
29
34
  }
30
35
  }
@@ -35,9 +40,9 @@ let HPortal = class HPortal extends PhoenixLightLitElement {
35
40
  const openPortalEvent = new CustomEvent(PORTAL_EVENTS.open, {
36
41
  composed: true,
37
42
  detail: {
38
- portalId: this.id,
43
+ portalId: this._id,
39
44
  to: this.to,
40
- content: [...this.initialChildren]
45
+ content: [...this._initialChildren]
41
46
  }
42
47
  });
43
48
  document.dispatchEvent(openPortalEvent);
@@ -46,7 +51,7 @@ let HPortal = class HPortal extends PhoenixLightLitElement {
46
51
  const closePortalEvent = new CustomEvent(PORTAL_EVENTS.close, {
47
52
  composed: true,
48
53
  detail: {
49
- portalId: this.id,
54
+ portalId: this._id,
50
55
  to: this.to
51
56
  }
52
57
  });
@@ -56,11 +61,11 @@ let HPortal = class HPortal extends PhoenixLightLitElement {
56
61
  __decorate([
57
62
  state(),
58
63
  __metadata("design:type", Object)
59
- ], HPortal.prototype, "id", void 0);
64
+ ], HPortal.prototype, "_id", void 0);
60
65
  __decorate([
61
66
  state(),
62
67
  __metadata("design:type", Array)
63
- ], HPortal.prototype, "initialChildren", void 0);
68
+ ], HPortal.prototype, "_initialChildren", void 0);
64
69
  __decorate([
65
70
  property({ type: String }),
66
71
  __metadata("design:type", Object)
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA,eAAe,qDAAyD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,10 +1,13 @@
1
1
  import { HPortal } from './portal';
2
+ import { HPortalTarget } from './portal_target';
2
3
  export declare const PORTAL_EVENTS: {
3
4
  open: string;
4
5
  close: string;
5
6
  };
7
+ export declare const PORTAL_TARGET_NAME_PROP = "name";
6
8
  declare global {
7
9
  interface HTMLElementTagNameMap {
8
10
  'h-portal': HPortal;
11
+ 'h-portal-target': HPortalTarget;
9
12
  }
10
13
  }
@@ -1,7 +1,8 @@
1
1
  const PORTAL_EVENTS = {
2
2
  open: `portal.open`,
3
3
  close: 'portal.close'
4
- };
4
+ };
5
+ const PORTAL_TARGET_NAME_PROP = 'name';
5
6
 
6
- export { PORTAL_EVENTS };
7
+ export { PORTAL_EVENTS, PORTAL_TARGET_NAME_PROP };
7
8
  //# sourceMappingURL=portal_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,7 +4,6 @@ export declare class HPortalTarget extends PhoenixLightLitElement {
4
4
  static portalTargetsNames: Set<string>;
5
5
  name: string;
6
6
  _portalElementsMap: Record<string, HTMLElement[]>;
7
- constructor();
8
7
  connectedCallback(): void;
9
8
  disconnectedCallback(): void;
10
9
  portalElements: ({ detail: { portalId, content, to } }: CustomEvent<TPortalEventData>) => void;
@@ -1,13 +1,13 @@
1
1
  import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
2
- import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
3
2
  import { property, state, customElement } from 'lit/decorators';
4
- import { PORTAL_EVENTS } from './portal_constants.js';
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element.js';
5
4
  import { PortalTargetError } from './portal_target_error.js';
5
+ import { PORTAL_EVENTS, PORTAL_TARGET_NAME_PROP } from './portal_constants.js';
6
6
 
7
7
  var HPortalTarget_1;
8
8
  let HPortalTarget = HPortalTarget_1 = class HPortalTarget extends PhoenixLightLitElement {
9
9
  constructor() {
10
- super();
10
+ super(...arguments);
11
11
  this.name = '';
12
12
  this._portalElementsMap = {};
13
13
  this.portalElements = ({ detail: { portalId, content, to } }) => {
@@ -44,17 +44,17 @@ let HPortalTarget = HPortalTarget_1 = class HPortalTarget extends PhoenixLightLi
44
44
  super.disconnectedCallback();
45
45
  document.removeEventListener(PORTAL_EVENTS.open, this.portalElements);
46
46
  document.removeEventListener(PORTAL_EVENTS.close, this.removeTeleportedItems);
47
- HPortalTarget_1.portalTargetsNames.delete(this.name);
47
+ HPortalTarget_1.portalTargetsNames.delete(this[PORTAL_TARGET_NAME_PROP]);
48
48
  }
49
49
  doesDestinationMatch(destination) {
50
- return destination === this.name;
50
+ return destination === this[PORTAL_TARGET_NAME_PROP];
51
51
  }
52
52
  allowOnlyOnePortalTargetWithName() {
53
- if (HPortalTarget_1.portalTargetsNames.has(this.name)) {
53
+ if (HPortalTarget_1.portalTargetsNames.has(this[PORTAL_TARGET_NAME_PROP])) {
54
54
  this.remove();
55
- throw new PortalTargetError(`Portal target with name "${this.name}" already exists.`);
55
+ throw new PortalTargetError(`Portal target with name "${this[PORTAL_TARGET_NAME_PROP]}" already exists.`);
56
56
  }
57
- HPortalTarget_1.portalTargetsNames.add(this.name);
57
+ HPortalTarget_1.portalTargetsNames.add(this[PORTAL_TARGET_NAME_PROP]);
58
58
  }
59
59
  };
60
60
  HPortalTarget.portalTargetsNames = new Set();
@@ -67,8 +67,7 @@ __decorate([
67
67
  __metadata("design:type", Object)
68
68
  ], HPortalTarget.prototype, "_portalElementsMap", void 0);
69
69
  HPortalTarget = HPortalTarget_1 = __decorate([
70
- customElement('h-portal-target'),
71
- __metadata("design:paramtypes", [])
70
+ customElement('h-portal-target')
72
71
  ], HPortalTarget);
73
72
 
74
73
  export { HPortalTarget };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,4CAAgD;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,4 +1,9 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, TemplateResult, nothing } from 'lit';
2
2
  export declare class PhoenixLightLitElement extends LitElement {
3
+ _slots: Record<string, TemplateResult[]>;
4
+ constructor();
5
+ connectedCallback(): void;
6
+ private _assignSlots;
7
+ getSlot(name: string): TemplateResult[] | typeof nothing;
3
8
  createRenderRoot(): PhoenixLightLitElement;
4
9
  }
@@ -1,10 +1,44 @@
1
- import { LitElement } from 'lit';
1
+ import { __decorate, __metadata } from '../../../../external/tslib/tslib.es6.js';
2
+ import { LitElement, html, nothing } from 'lit';
3
+ import { DEFAULT_SLOT_NAME } from './phoenix_light_lit_elements_constants.js';
4
+ import { state } from 'lit/decorators';
2
5
 
3
6
  class PhoenixLightLitElement extends LitElement {
7
+ constructor() {
8
+ super();
9
+ this._slots = {};
10
+ }
11
+ connectedCallback() {
12
+ super.connectedCallback();
13
+ this._slots = this._assignSlots();
14
+ }
15
+ _assignSlots() {
16
+ console.log(this, 2);
17
+ return [...this.querySelectorAll('[slot]')].reduce((acc, $el) => {
18
+ var _a;
19
+ const slotName = $el.slot || DEFAULT_SLOT_NAME;
20
+ acc[slotName] = acc[slotName] || [];
21
+ acc[slotName].push(html `${$el}`);
22
+ (_a = $el.parentElement) === null || _a === void 0 ? void 0 : _a.removeChild($el);
23
+ $el.removeAttribute('slot');
24
+ return acc;
25
+ }, this._slots);
26
+ }
27
+ getSlot(name) {
28
+ try {
29
+ return this._slots[name];
30
+ }
31
+ catch (_a) { }
32
+ return nothing;
33
+ }
4
34
  createRenderRoot() {
5
35
  return this;
6
36
  }
7
- }
37
+ }
38
+ __decorate([
39
+ state(),
40
+ __metadata("design:type", Object)
41
+ ], PhoenixLightLitElement.prototype, "_slots", void 0);
8
42
 
9
43
  export { PhoenixLightLitElement };
10
44
  //# sourceMappingURL=phoenix_light_lit_element.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA,uCAAuC,yCAA6C;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_SLOT_NAME = "default";
@@ -0,0 +1,4 @@
1
+ const DEFAULT_SLOT_NAME = 'default';
2
+
3
+ export { DEFAULT_SLOT_NAME };
4
+ //# sourceMappingURL=phoenix_light_lit_elements_constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;"}
@@ -4,3 +4,9 @@ export { PhoenixLightLitElement } from "./core/phoenix_light_lit_element";
4
4
  export { HelloButton } from './hello_button';
5
5
  export { HPortal } from './components/portal/portal';
6
6
  export { HPortalTarget } from './components/portal/portal_target';
7
+ export { HModal } from './components/modal/modal';
8
+ export { HModalBackdrop } from './components/modal/modal_backdrop';
9
+ export { HModalBody } from './components/modal/modal_body';
10
+ export { HModalFooter } from './components/modal/modal_footer';
11
+ export { HModalHeader } from './components/modal/modal_header';
12
+ export { HModalClose } from './components/modal/modal_close';
@@ -2,6 +2,12 @@ export { ContextProviderController } from './core/context/context_provider_contr
2
2
  export { ContextConsumerController } from './core/context/context_consumer_controller.js';
3
3
  export { PhoenixLightLitElement } from './core/phoenix_light_lit_element.js';
4
4
  export { HelloButton } from './hello_button.js';
5
- export { HPortal } from './components/portal/portal.js';
6
5
  export { HPortalTarget } from './components/portal/portal_target.js';
6
+ export { HPortal } from './components/portal/portal.js';
7
+ export { HModal } from './components/modal/modal.js';
8
+ export { HModalBackdrop } from './components/modal/modal_backdrop.js';
9
+ export { HModalBody } from './components/modal/modal_body.js';
10
+ export { HModalFooter } from './components/modal/modal_footer.js';
11
+ export { HModalHeader } from './components/modal/modal_header.js';
12
+ export { HModalClose } from './components/modal/modal_close.js';
7
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@shoper/phoenix_design_system",
3
3
  "packageManager": "yarn@3.2.0",
4
4
  "sideEffects": false,
5
- "version": "0.2.0",
5
+ "version": "0.2.2-1",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",