@shoper/phoenix_design_system 0.22.5-0 → 0.22.5-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 (22) hide show
  1. package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js +69 -0
  2. package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -0
  3. package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +12 -0
  4. package/build/cjs/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -0
  5. package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js +85 -0
  6. package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -0
  7. package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +17 -0
  8. package/build/cjs/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -0
  9. package/build/cjs/packages/phoenix/src/index.js +14 -0
  10. package/build/cjs/packages/phoenix/src/index.js.map +1 -1
  11. package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js +64 -62
  12. package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item.js.map +1 -1
  13. package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js +7 -5
  14. package/build/esm/packages/phoenix/src/components/color_swatches/color_item/color_item_constants.js.map +1 -1
  15. package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js +80 -80
  16. package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches.js.map +1 -1
  17. package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js +11 -9
  18. package/build/esm/packages/phoenix/src/components/color_swatches/color_swatches_constants.js.map +1 -1
  19. package/build/esm/packages/phoenix/src/index.d.ts +2 -0
  20. package/build/esm/packages/phoenix/src/index.js +2 -0
  21. package/build/esm/packages/phoenix/src/index.js.map +1 -1
  22. package/package.json +1 -1
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
8
+ var phoenix_custom_element = require('../../../core/decorators/phoenix_custom_element.js');
9
+ var btn_controller = require('../../../controllers/btn_controller.js');
10
+ var color_item_constants = require('./color_item_constants.js');
11
+ var color_swatches_constants = require('../color_swatches_constants.js');
12
+
13
+ exports.HColorItem = class HColorItem extends phoenix_light_lit_element.PhoenixLightLitElement {
14
+ constructor() {
15
+ super();
16
+ this.disabled = false;
17
+ this.selected = false;
18
+ this._dispatchClickedEvent = () => {
19
+ this.dispatchEvent(new Event(color_item_constants.COLOR_ITEM_EVENT_NAMES.selected, {
20
+ bubbles: true
21
+ }));
22
+ };
23
+ this._btnController = new btn_controller.BtnController(this, this._dispatchClickedEvent);
24
+ }
25
+ connectedCallback() {
26
+ super.connectedCallback();
27
+ this.setupEvents();
28
+ this.innerHTML = this.color;
29
+ this._syncAriaPressed();
30
+ this.setAttribute('aria-label', this.label ? this.label : this.color);
31
+ this.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorItem);
32
+ }
33
+ attributeChangedCallback(name, value, newValue) {
34
+ super.attributeChangedCallback(name, value, newValue);
35
+ switch (name) {
36
+ case color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE: {
37
+ this._syncAriaPressed();
38
+ break;
39
+ }
40
+ }
41
+ }
42
+ _syncAriaPressed() {
43
+ this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
44
+ }
45
+ setupEvents() {
46
+ this.addEventListener('click', this._dispatchClickedEvent);
47
+ }
48
+ };
49
+ tslib_es6.__decorate([
50
+ decorators.property({ type: String }),
51
+ tslib_es6.__metadata("design:type", String)
52
+ ], exports.HColorItem.prototype, "color", void 0);
53
+ tslib_es6.__decorate([
54
+ decorators.property({ type: String }),
55
+ tslib_es6.__metadata("design:type", String)
56
+ ], exports.HColorItem.prototype, "label", void 0);
57
+ tslib_es6.__decorate([
58
+ decorators.property({ type: Boolean, attribute: true }),
59
+ tslib_es6.__metadata("design:type", Boolean)
60
+ ], exports.HColorItem.prototype, "disabled", void 0);
61
+ tslib_es6.__decorate([
62
+ decorators.property({ type: Boolean, attribute: true }),
63
+ tslib_es6.__metadata("design:type", Boolean)
64
+ ], exports.HColorItem.prototype, "selected", void 0);
65
+ exports.HColorItem = tslib_es6.__decorate([
66
+ phoenix_custom_element.phoenixCustomElement('h-color-item'),
67
+ tslib_es6.__metadata("design:paramtypes", [])
68
+ ], exports.HColorItem);
69
+ //# sourceMappingURL=color_item.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,+CAAmD;AAC3E;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;"}
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const COLOR_ITEM_EVENT_NAMES = {
6
+ selected: 'colorItemSelected'
7
+ };
8
+ const COLOR_ITEM_SELECTED_ATTRIBUTE = 'selected';
9
+
10
+ exports.COLOR_ITEM_EVENT_NAMES = COLOR_ITEM_EVENT_NAMES;
11
+ exports.COLOR_ITEM_SELECTED_ATTRIBUTE = COLOR_ITEM_SELECTED_ATTRIBUTE;
12
+ //# sourceMappingURL=color_item_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,85 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var tslib_es6 = require('../../../../../external/tslib/tslib.es6.js');
6
+ var decorators = require('lit/decorators');
7
+ var phoenix_light_lit_element = require('../../core/phoenix_light_lit_element/phoenix_light_lit_element.js');
8
+ var phoenix_custom_element = require('../../core/decorators/phoenix_custom_element.js');
9
+ var color_item_constants = require('./color_item/color_item_constants.js');
10
+ var color_swatches_constants = require('./color_swatches_constants.js');
11
+
12
+ exports.HColorSwatches = class HColorSwatches extends phoenix_light_lit_element.PhoenixLightLitElement {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.inline = true;
16
+ this.multiple = false;
17
+ this.selectedColors = [];
18
+ this._handleColorClicked = ({ target }) => {
19
+ const $colorItem = target;
20
+ this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorClickedForSingleMode($colorItem);
21
+ };
22
+ this._dispatchColorSelectEvent = () => {
23
+ const detail = {
24
+ colors: this.selectedColors.length > 1 ? this._getColorValuesOnly(this.selectedColors) : this.selectedColors[0].color
25
+ };
26
+ this.dispatchEvent(new CustomEvent(color_swatches_constants.COLOR_SWATCHES_EVENT_NAMES.selected, {
27
+ bubbles: true,
28
+ detail
29
+ }));
30
+ };
31
+ }
32
+ connectedCallback() {
33
+ super.connectedCallback();
34
+ this._setupEvents();
35
+ this._addCssClasses();
36
+ }
37
+ _addCssClasses() {
38
+ this.querySelectorAll('h-color-item').forEach(($colorItem) => $colorItem.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
39
+ this.classList.add(color_swatches_constants.COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
40
+ }
41
+ _setupEvents() {
42
+ this.addEventListener(color_item_constants.COLOR_ITEM_EVENT_NAMES.selected, this._handleColorClicked);
43
+ }
44
+ _handleColorClickedForMultipleMode($colorItem) {
45
+ if (!this._isColorAlreadyAdded($colorItem)) {
46
+ this.selectedColors = [...this.selectedColors, $colorItem];
47
+ }
48
+ $colorItem.hasAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
49
+ ? $colorItem.removeAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
50
+ : $colorItem.setAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE, '');
51
+ this._dispatchColorSelectEvent();
52
+ }
53
+ _handleColorClickedForSingleMode($colorItem) {
54
+ const $previouslySelected = this.selectedColors[0];
55
+ $colorItem.hasAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
56
+ ? $colorItem.removeAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE)
57
+ : $colorItem.setAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE, '');
58
+ if ($previouslySelected && $previouslySelected !== $colorItem)
59
+ $previouslySelected.removeAttribute(color_item_constants.COLOR_ITEM_SELECTED_ATTRIBUTE);
60
+ this.selectedColors = [$colorItem];
61
+ this._dispatchColorSelectEvent();
62
+ }
63
+ _isColorAlreadyAdded($colorItem) {
64
+ return this.selectedColors.filter((selectedColor) => selectedColor.color === $colorItem.color).length > 0;
65
+ }
66
+ _getColorValuesOnly(selectedColors) {
67
+ return selectedColors.map((selectedColor) => selectedColor.color);
68
+ }
69
+ };
70
+ tslib_es6.__decorate([
71
+ decorators.property({ type: Boolean }),
72
+ tslib_es6.__metadata("design:type", Object)
73
+ ], exports.HColorSwatches.prototype, "inline", void 0);
74
+ tslib_es6.__decorate([
75
+ decorators.property({ type: Boolean }),
76
+ tslib_es6.__metadata("design:type", Object)
77
+ ], exports.HColorSwatches.prototype, "multiple", void 0);
78
+ tslib_es6.__decorate([
79
+ decorators.state(),
80
+ tslib_es6.__metadata("design:type", Array)
81
+ ], exports.HColorSwatches.prototype, "selectedColors", void 0);
82
+ exports.HColorSwatches = tslib_es6.__decorate([
83
+ phoenix_custom_element.phoenixCustomElement('h-color-swatches')
84
+ ], exports.HColorSwatches);
85
+ //# sourceMappingURL=color_swatches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA,wBAAwB,4CAAgD;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;AACA;AACA;"}
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const baseCssClass = 'color-swatches';
6
+ const COLOR_SWATCHES_CSS_CLASSES = {
7
+ colorItem: 'color-item',
8
+ colorSwatches: baseCssClass,
9
+ colorSwatchesItem: `${baseCssClass}__color-item`
10
+ };
11
+ const COLOR_SWATCHES_EVENT_NAMES = {
12
+ selected: 'colorSwatchesSelected'
13
+ };
14
+
15
+ exports.COLOR_SWATCHES_CSS_CLASSES = COLOR_SWATCHES_CSS_CLASSES;
16
+ exports.COLOR_SWATCHES_EVENT_NAMES = COLOR_SWATCHES_EVENT_NAMES;
17
+ //# sourceMappingURL=color_swatches_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;AACA;AACA;AACA;AACA;AACA;"}
@@ -60,6 +60,8 @@ var toggle_button_group = require('./components/groups/toggle_button_group/toggl
60
60
  var toggle_button = require('./components/groups/toggle_button_group/toggle_button.js');
61
61
  var click_outside_controller_messages = require('./controllers/click_outside_controller/click_outside_controller_messages.js');
62
62
  var backdrop = require('./components/backdrop/backdrop.js');
63
+ var color_item = require('./components/color_swatches/color_item/color_item.js');
64
+ var color_swatches = require('./components/color_swatches/color_swatches.js');
63
65
  var visibility_controller = require('./controllers/visibility_controller/visibility_controller.js');
64
66
  var slider = require('./components/slider/slider.js');
65
67
  var tab = require('./components/tabs/tab/tab.js');
@@ -342,6 +344,18 @@ Object.defineProperty(exports, 'HBackdrop', {
342
344
  return backdrop.HBackdrop;
343
345
  }
344
346
  });
347
+ Object.defineProperty(exports, 'HColorItem', {
348
+ enumerable: true,
349
+ get: function () {
350
+ return color_item.HColorItem;
351
+ }
352
+ });
353
+ Object.defineProperty(exports, 'HColorSwatches', {
354
+ enumerable: true,
355
+ get: function () {
356
+ return color_swatches.HColorSwatches;
357
+ }
358
+ });
345
359
  exports.VisibilityController = visibility_controller.VisibilityController;
346
360
  Object.defineProperty(exports, 'HSlider', {
347
361
  enumerable: true,
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;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;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;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;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;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;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;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;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;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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,65 +1,67 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
3
- import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
1
+ import { __decorate, __metadata } from '../../../../../../external/tslib/tslib.es6.js';
4
2
  import { property } from 'lit/decorators';
5
- import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from '@phoenixRoot/components/color_swatches/color_item/color_item_constants';
6
- import { BtnController } from '@phoenixRoot/controllers/btn_controller';
7
- import { COLOR_SWATCHES_CSS_CLASSES } from '@phoenixRoot/components/color_swatches/color_swatches_constants';
8
- let HColorItem = class HColorItem extends PhoenixLightLitElement {
9
- constructor() {
10
- super();
11
- this.disabled = false;
12
- this.selected = false;
13
- this._dispatchClickedEvent = () => {
14
- this.dispatchEvent(new Event(COLOR_ITEM_EVENT_NAMES.selected, {
15
- bubbles: true
16
- }));
17
- };
18
- this._btnController = new BtnController(this, this._dispatchClickedEvent);
19
- }
20
- connectedCallback() {
21
- super.connectedCallback();
22
- this.setupEvents();
23
- this.innerHTML = this.color;
24
- this._syncAriaPressed();
25
- this.setAttribute('aria-label', this.label ? this.label : this.color);
26
- this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorItem);
27
- }
28
- attributeChangedCallback(name, value, newValue) {
29
- super.attributeChangedCallback(name, value, newValue);
30
- switch (name) {
31
- case COLOR_ITEM_SELECTED_ATTRIBUTE: {
32
- this._syncAriaPressed();
33
- break;
34
- }
35
- }
36
- }
37
- _syncAriaPressed() {
38
- this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
39
- }
40
- setupEvents() {
41
- this.addEventListener('click', this._dispatchClickedEvent);
42
- }
43
- };
44
- __decorate([
45
- property({ type: String }),
46
- __metadata("design:type", String)
47
- ], HColorItem.prototype, "color", void 0);
48
- __decorate([
49
- property({ type: String }),
50
- __metadata("design:type", String)
51
- ], HColorItem.prototype, "label", void 0);
52
- __decorate([
53
- property({ type: Boolean, attribute: true }),
54
- __metadata("design:type", Boolean)
55
- ], HColorItem.prototype, "disabled", void 0);
56
- __decorate([
57
- property({ type: Boolean, attribute: true }),
58
- __metadata("design:type", Boolean)
59
- ], HColorItem.prototype, "selected", void 0);
60
- HColorItem = __decorate([
61
- phoenixCustomElement('h-color-item'),
62
- __metadata("design:paramtypes", [])
3
+ import { PhoenixLightLitElement } from '../../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
4
+ import { phoenixCustomElement } from '../../../core/decorators/phoenix_custom_element.js';
5
+ import { BtnController } from '../../../controllers/btn_controller.js';
6
+ import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item_constants.js';
7
+ import { COLOR_SWATCHES_CSS_CLASSES } from '../color_swatches_constants.js';
8
+
9
+ let HColorItem = class HColorItem extends PhoenixLightLitElement {
10
+ constructor() {
11
+ super();
12
+ this.disabled = false;
13
+ this.selected = false;
14
+ this._dispatchClickedEvent = () => {
15
+ this.dispatchEvent(new Event(COLOR_ITEM_EVENT_NAMES.selected, {
16
+ bubbles: true
17
+ }));
18
+ };
19
+ this._btnController = new BtnController(this, this._dispatchClickedEvent);
20
+ }
21
+ connectedCallback() {
22
+ super.connectedCallback();
23
+ this.setupEvents();
24
+ this.innerHTML = this.color;
25
+ this._syncAriaPressed();
26
+ this.setAttribute('aria-label', this.label ? this.label : this.color);
27
+ this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorItem);
28
+ }
29
+ attributeChangedCallback(name, value, newValue) {
30
+ super.attributeChangedCallback(name, value, newValue);
31
+ switch (name) {
32
+ case COLOR_ITEM_SELECTED_ATTRIBUTE: {
33
+ this._syncAriaPressed();
34
+ break;
35
+ }
36
+ }
37
+ }
38
+ _syncAriaPressed() {
39
+ this.selected ? this.setAttribute('aria-pressed', '') : this.removeAttribute('aria-pressed');
40
+ }
41
+ setupEvents() {
42
+ this.addEventListener('click', this._dispatchClickedEvent);
43
+ }
44
+ };
45
+ __decorate([
46
+ property({ type: String }),
47
+ __metadata("design:type", String)
48
+ ], HColorItem.prototype, "color", void 0);
49
+ __decorate([
50
+ property({ type: String }),
51
+ __metadata("design:type", String)
52
+ ], HColorItem.prototype, "label", void 0);
53
+ __decorate([
54
+ property({ type: Boolean, attribute: true }),
55
+ __metadata("design:type", Boolean)
56
+ ], HColorItem.prototype, "disabled", void 0);
57
+ __decorate([
58
+ property({ type: Boolean, attribute: true }),
59
+ __metadata("design:type", Boolean)
60
+ ], HColorItem.prototype, "selected", void 0);
61
+ HColorItem = __decorate([
62
+ phoenixCustomElement('h-color-item'),
63
+ __metadata("design:paramtypes", [])
63
64
  ], HColorItem);
65
+
64
66
  export { HColorItem };
65
- //# sourceMappingURL=color_item.js.map
67
+ //# sourceMappingURL=color_item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color_item.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_swatches/color_item/color_item.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAC3F,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,wEAAwE,CAAC;AAC/I,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iEAAiE,CAAC;AAG7G,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,sBAAsB;IAelD;QACI,KAAK,EAAE,CAAC;QARL,aAAQ,GAAY,KAAK,CAAC;QAG1B,aAAQ,GAAY,KAAK,CAAC;QA2CzB,0BAAqB,GAAG,GAAS,EAAE;YACvC,IAAI,CAAC,aAAa,CACd,IAAI,KAAK,CAAC,sBAAsB,CAAC,QAAQ,EAAE;gBACvC,OAAO,EAAE,IAAI;aAChB,CAAC,CACL,CAAC;QACN,CAAC,CAAC;QA1CE,IAAI,CAAC,cAAc,GAAG,IAAI,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAC9E,CAAC;IAEM,iBAAiB;QACpB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAE1B,IAAI,CAAC,WAAW,EAAE,CAAC;QAEnB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC;QAE5B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAEx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":[],"mappings":"AAAA,uCAAuC,+CAAmD;AAC1F;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,5 +1,7 @@
1
- export const COLOR_ITEM_EVENT_NAMES = {
2
- selected: 'colorItemSelected'
3
- };
4
- export const COLOR_ITEM_SELECTED_ATTRIBUTE = 'selected';
5
- //# sourceMappingURL=color_item_constants.js.map
1
+ const COLOR_ITEM_EVENT_NAMES = {
2
+ selected: 'colorItemSelected'
3
+ };
4
+ const COLOR_ITEM_SELECTED_ATTRIBUTE = 'selected';
5
+
6
+ export { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE };
7
+ //# sourceMappingURL=color_item_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color_item_constants.js","sourceRoot":"","sources":["../../../../../../../../src/components/color_swatches/color_item/color_item_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IAClC,QAAQ,EAAE,mBAAmB;CACvB,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG,UAAU,CAAC"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,83 +1,83 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from '@phoenixRoot/components/color_swatches/color_item/color_item_constants';
3
- import { COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_EVENT_NAMES } from '@phoenixRoot/components/color_swatches/color_swatches_constants';
1
+ import { __decorate, __metadata } from '../../../../../external/tslib/tslib.es6.js';
4
2
  import { property, state } from 'lit/decorators';
5
- import '@phoenixRoot/components/color_swatches/color_item/color_item';
6
- import './color_swatches_types';
7
- import { PhoenixLightLitElement } from '@phoenixRoot/core/phoenix_light_lit_element/phoenix_light_lit_element';
8
- import { phoenixCustomElement } from '@phoenixRoot/core/decorators/phoenix_custom_element';
9
- let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
10
- constructor() {
11
- super(...arguments);
12
- this.inline = true;
13
- this.multiple = false;
14
- this.selectedColors = [];
15
- this._handleColorClicked = ({ target }) => {
16
- const $colorItem = target;
17
- this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorClickedForSingleMode($colorItem);
18
- };
19
- this._dispatchColorSelectEvent = () => {
20
- const detail = {
21
- colors: this.selectedColors.length > 1 ? this._getColorValuesOnly(this.selectedColors) : this.selectedColors[0].color
22
- };
23
- this.dispatchEvent(new CustomEvent(COLOR_SWATCHES_EVENT_NAMES.selected, {
24
- bubbles: true,
25
- detail
26
- }));
27
- };
28
- }
29
- connectedCallback() {
30
- super.connectedCallback();
31
- this._setupEvents();
32
- this._addCssClasses();
33
- }
34
- _addCssClasses() {
35
- this.querySelectorAll('h-color-item').forEach(($colorItem) => $colorItem.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
36
- this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
37
- }
38
- _setupEvents() {
39
- this.addEventListener(COLOR_ITEM_EVENT_NAMES.selected, this._handleColorClicked);
40
- }
41
- _handleColorClickedForMultipleMode($colorItem) {
42
- if (!this._isColorAlreadyAdded($colorItem)) {
43
- this.selectedColors = [...this.selectedColors, $colorItem];
44
- }
45
- $colorItem.hasAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
46
- ? $colorItem.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
47
- : $colorItem.setAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE, '');
48
- this._dispatchColorSelectEvent();
49
- }
50
- _handleColorClickedForSingleMode($colorItem) {
51
- const $previouslySelected = this.selectedColors[0];
52
- $colorItem.hasAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
53
- ? $colorItem.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
54
- : $colorItem.setAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE, '');
55
- if ($previouslySelected && $previouslySelected !== $colorItem)
56
- $previouslySelected.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE);
57
- this.selectedColors = [$colorItem];
58
- this._dispatchColorSelectEvent();
59
- }
60
- _isColorAlreadyAdded($colorItem) {
61
- return this.selectedColors.filter((selectedColor) => selectedColor.color === $colorItem.color).length > 0;
62
- }
63
- _getColorValuesOnly(selectedColors) {
64
- return selectedColors.map((selectedColor) => selectedColor.color);
65
- }
66
- };
67
- __decorate([
68
- property({ type: Boolean }),
69
- __metadata("design:type", Object)
70
- ], HColorSwatches.prototype, "inline", void 0);
71
- __decorate([
72
- property({ type: Boolean }),
73
- __metadata("design:type", Object)
74
- ], HColorSwatches.prototype, "multiple", void 0);
75
- __decorate([
76
- state(),
77
- __metadata("design:type", Array)
78
- ], HColorSwatches.prototype, "selectedColors", void 0);
79
- HColorSwatches = __decorate([
80
- phoenixCustomElement('h-color-swatches')
3
+ import { PhoenixLightLitElement } from '../../core/phoenix_light_lit_element/phoenix_light_lit_element.js';
4
+ import { phoenixCustomElement } from '../../core/decorators/phoenix_custom_element.js';
5
+ import { COLOR_ITEM_EVENT_NAMES, COLOR_ITEM_SELECTED_ATTRIBUTE } from './color_item/color_item_constants.js';
6
+ import { COLOR_SWATCHES_EVENT_NAMES, COLOR_SWATCHES_CSS_CLASSES } from './color_swatches_constants.js';
7
+
8
+ let HColorSwatches = class HColorSwatches extends PhoenixLightLitElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.inline = true;
12
+ this.multiple = false;
13
+ this.selectedColors = [];
14
+ this._handleColorClicked = ({ target }) => {
15
+ const $colorItem = target;
16
+ this.multiple ? this._handleColorClickedForMultipleMode($colorItem) : this._handleColorClickedForSingleMode($colorItem);
17
+ };
18
+ this._dispatchColorSelectEvent = () => {
19
+ const detail = {
20
+ colors: this.selectedColors.length > 1 ? this._getColorValuesOnly(this.selectedColors) : this.selectedColors[0].color
21
+ };
22
+ this.dispatchEvent(new CustomEvent(COLOR_SWATCHES_EVENT_NAMES.selected, {
23
+ bubbles: true,
24
+ detail
25
+ }));
26
+ };
27
+ }
28
+ connectedCallback() {
29
+ super.connectedCallback();
30
+ this._setupEvents();
31
+ this._addCssClasses();
32
+ }
33
+ _addCssClasses() {
34
+ this.querySelectorAll('h-color-item').forEach(($colorItem) => $colorItem.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatchesItem));
35
+ this.classList.add(COLOR_SWATCHES_CSS_CLASSES.colorSwatches);
36
+ }
37
+ _setupEvents() {
38
+ this.addEventListener(COLOR_ITEM_EVENT_NAMES.selected, this._handleColorClicked);
39
+ }
40
+ _handleColorClickedForMultipleMode($colorItem) {
41
+ if (!this._isColorAlreadyAdded($colorItem)) {
42
+ this.selectedColors = [...this.selectedColors, $colorItem];
43
+ }
44
+ $colorItem.hasAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
45
+ ? $colorItem.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
46
+ : $colorItem.setAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE, '');
47
+ this._dispatchColorSelectEvent();
48
+ }
49
+ _handleColorClickedForSingleMode($colorItem) {
50
+ const $previouslySelected = this.selectedColors[0];
51
+ $colorItem.hasAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
52
+ ? $colorItem.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE)
53
+ : $colorItem.setAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE, '');
54
+ if ($previouslySelected && $previouslySelected !== $colorItem)
55
+ $previouslySelected.removeAttribute(COLOR_ITEM_SELECTED_ATTRIBUTE);
56
+ this.selectedColors = [$colorItem];
57
+ this._dispatchColorSelectEvent();
58
+ }
59
+ _isColorAlreadyAdded($colorItem) {
60
+ return this.selectedColors.filter((selectedColor) => selectedColor.color === $colorItem.color).length > 0;
61
+ }
62
+ _getColorValuesOnly(selectedColors) {
63
+ return selectedColors.map((selectedColor) => selectedColor.color);
64
+ }
65
+ };
66
+ __decorate([
67
+ property({ type: Boolean }),
68
+ __metadata("design:type", Object)
69
+ ], HColorSwatches.prototype, "inline", void 0);
70
+ __decorate([
71
+ property({ type: Boolean }),
72
+ __metadata("design:type", Object)
73
+ ], HColorSwatches.prototype, "multiple", void 0);
74
+ __decorate([
75
+ state(),
76
+ __metadata("design:type", Array)
77
+ ], HColorSwatches.prototype, "selectedColors", void 0);
78
+ HColorSwatches = __decorate([
79
+ phoenixCustomElement('h-color-swatches')
81
80
  ], HColorSwatches);
81
+
82
82
  export { HColorSwatches };
83
- //# sourceMappingURL=color_swatches.js.map
83
+ //# sourceMappingURL=color_swatches.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color_swatches.js","sourceRoot":"","sources":["../../../../../../../src/components/color_swatches/color_swatches.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,MAAM,wEAAwE,CAAC;AAC/I,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iEAAiE,CAAC;AACzI,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAA2B,8DAA8D,CAAC;AAC1F,OAAkC,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uEAAuE,CAAC;AAC/G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qDAAqD,CAAC;AAG3F,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,sBAAsB;IAA1D;;QAEW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AC,aAAa,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC;CACJ,CAAA;AA3EG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;8CACP;AAGrB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;gDACJ;AAGxB;IADC,KAAK,EAAE;;sDACiC;AARhC,cAAc;IAD1B,oBAAoB,CAAC,kBAAkB,CAAC;GAC5B,cAAc,CA6E1B;SA7EY,cAAc"}
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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,10 +1,12 @@
1
- const baseCssClass = 'color-swatches';
2
- export const COLOR_SWATCHES_CSS_CLASSES = {
3
- colorItem: 'color-item',
4
- colorSwatches: baseCssClass,
5
- colorSwatchesItem: `${baseCssClass}__color-item`
1
+ const baseCssClass = 'color-swatches';
2
+ const COLOR_SWATCHES_CSS_CLASSES = {
3
+ colorItem: 'color-item',
4
+ colorSwatches: baseCssClass,
5
+ colorSwatchesItem: `${baseCssClass}__color-item`
6
+ };
7
+ const COLOR_SWATCHES_EVENT_NAMES = {
8
+ selected: 'colorSwatchesSelected'
6
9
  };
7
- export const COLOR_SWATCHES_EVENT_NAMES = {
8
- selected: 'colorSwatchesSelected'
9
- };
10
- //# sourceMappingURL=color_swatches_constants.js.map
10
+
11
+ export { COLOR_SWATCHES_CSS_CLASSES, COLOR_SWATCHES_EVENT_NAMES };
12
+ //# sourceMappingURL=color_swatches_constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"color_swatches_constants.js","sourceRoot":"","sources":["../../../../../../../src/components/color_swatches/color_swatches_constants.ts"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,gBAAgB,CAAC;AAEtC,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,SAAS,EAAE,YAAY;IACvB,aAAa,EAAE,YAAY;IAC3B,iBAAiB,EAAE,GAAG,YAAY,cAAc;CAC1C,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACtC,QAAQ,EAAE,uBAAuB;CAC3B,CAAC"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -65,6 +65,8 @@ export { RelativePositionController } from './controllers/relative_position_cont
65
65
  export { ToggleElementAriaController } from './controllers/toggle_element_aria_controller/toggle_element_aria_controller';
66
66
  export { HBackdrop } from './components/backdrop/backdrop';
67
67
  export { BackdropController } from "./components/backdrop/controller/backdrop_controller";
68
+ export { HColorSwatches } from './components/color_swatches/color_swatches';
69
+ export { HColorItem } from './components/color_swatches/color_item/color_item';
68
70
  export { VisibilityController } from './controllers/visibility_controller/visibility_controller';
69
71
  export * from './controllers/visibility_controller/visibility_controller_types';
70
72
  export { HSlider } from './components/slider/slider';
@@ -56,6 +56,8 @@ export { HToggleButtonGroup } from './components/groups/toggle_button_group/togg
56
56
  export { HToggleButton } from './components/groups/toggle_button_group/toggle_button.js';
57
57
  export { CLICK_OUTSIDE_CONTROLLER_MESSAGES } from './controllers/click_outside_controller/click_outside_controller_messages.js';
58
58
  export { HBackdrop } from './components/backdrop/backdrop.js';
59
+ export { HColorItem } from './components/color_swatches/color_item/color_item.js';
60
+ export { HColorSwatches } from './components/color_swatches/color_swatches.js';
59
61
  export { VisibilityController } from './controllers/visibility_controller/visibility_controller.js';
60
62
  export { HSlider } from './components/slider/slider.js';
61
63
  export { HTab } from './components/tabs/tab/tab.js';
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;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;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;"}
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.22.5-0",
5
+ "version": "0.22.5-1",
6
6
  "description": "phoenix design system",
7
7
  "author": "zefirek",
8
8
  "license": "MIT",