@ppg_pl/tinting 0.0.1 → 0.0.3

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.
@@ -6503,7 +6503,7 @@ const Modal = class {
6503
6503
  }
6504
6504
  };
6505
6505
  this.chunks = (xs, y = []) => {
6506
- return xs.length === 0 ? y : this.chunks(xs.slice(this.chunksNum), y.concat([xs.slice(0, this.chunksNum)]));
6506
+ return (xs === null || xs === void 0 ? void 0 : xs.length) === 0 ? y : this.chunks(xs === null || xs === void 0 ? void 0 : xs.slice(this.chunksNum), y.concat([xs === null || xs === void 0 ? void 0 : xs.slice(0, this.chunksNum)]));
6507
6507
  };
6508
6508
  this.calculateBoxCount = () => {
6509
6509
  var _a;
@@ -6593,15 +6593,15 @@ const Modal = class {
6593
6593
  this.displayForMobile();
6594
6594
  }
6595
6595
  sortColorsBySimilarity(colors) {
6596
- if (colors.length <= 1)
6596
+ if ((colors === null || colors === void 0 ? void 0 : colors.length) <= 1)
6597
6597
  return colors;
6598
6598
  const sortedColors = [];
6599
6599
  const remainingColors = [...colors];
6600
6600
  // Start with the first color
6601
6601
  sortedColors.push(remainingColors.shift());
6602
- while (remainingColors.length > 0) {
6602
+ while ((remainingColors === null || remainingColors === void 0 ? void 0 : remainingColors.length) > 0) {
6603
6603
  // Find the most similar color to the last color in sortedColors
6604
- const lastColor = sortedColors[sortedColors.length - 1];
6604
+ const lastColor = sortedColors[(sortedColors === null || sortedColors === void 0 ? void 0 : sortedColors.length) - 1];
6605
6605
  let mostSimilarIndex = 0;
6606
6606
  let minDistance = Infinity;
6607
6607
  remainingColors.forEach((color, index) => {
@@ -6645,9 +6645,9 @@ const Modal = class {
6645
6645
  return 'other';
6646
6646
  }
6647
6647
  sortColorsByHueAndSimilarity(colors) {
6648
- if (colors.length <= 1)
6648
+ if ((colors === null || colors === void 0 ? void 0 : colors.length) <= 1)
6649
6649
  return colors;
6650
- // Group colors by their hue family
6650
+ // Group valid colors by their hue family
6651
6651
  const colorGroups = {
6652
6652
  red: [],
6653
6653
  yellow: [],
@@ -6660,7 +6660,6 @@ const Modal = class {
6660
6660
  white: [],
6661
6661
  other: [],
6662
6662
  };
6663
- // Sort colors into groups
6664
6663
  colors.forEach(color => {
6665
6664
  const group = this.getColorHueGroup(color.hex);
6666
6665
  colorGroups[group].push(color);
@@ -6673,7 +6672,7 @@ const Modal = class {
6673
6672
  sortedGroups.push(this.sortColorsBySimilarity(colorGroups[groupName]));
6674
6673
  }
6675
6674
  });
6676
- // Combine all sorted groups
6675
+ // Combine all sorted groups, then append invalid colors at the end
6677
6676
  return sortedGroups.flat();
6678
6677
  }
6679
6678
  async fetchColorsData({ reset = false } = {}) {
@@ -6926,7 +6925,7 @@ const MySearch = class {
6926
6925
  };
6927
6926
  MySearch.style = indexCss$2;
6928
6927
 
6929
- const indexCss$1 = "@import url(\"https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1.sc-my-select,300..900&family=Poppins.sc-my-select:ital,wght@0.sc-my-select,100.sc-my-select;0.sc-my-select,200.sc-my-select;0.sc-my-select,300.sc-my-select;0.sc-my-select,400.sc-my-select;0.sc-my-select,500.sc-my-select;0.sc-my-select,600.sc-my-select;0.sc-my-select,700.sc-my-select;0.sc-my-select,800.sc-my-select;0.sc-my-select,900.sc-my-select;1.sc-my-select,100.sc-my-select;1.sc-my-select,200.sc-my-select;1.sc-my-select,300.sc-my-select;1.sc-my-select,400.sc-my-select;1.sc-my-select,500.sc-my-select;1.sc-my-select,600.sc-my-select;1.sc-my-select,700.sc-my-select;1.sc-my-select,800.sc-my-select;1.sc-my-select,900&display=swap\").sc-my-select; .tinting-wrapper.sc-my-select *.sc-my-select{font-family:\"Poppins\", sans-serif}.select.sc-my-select{position:relative;width:300px}@media (max-width: 768px){.select.sc-my-select{width:100%}}.select.sc-my-select .input-wrapper.sc-my-select{position:relative;display:flex;align-items:flex-start}.select.sc-my-select input.sc-my-select{font-size:16px;padding:16px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c;box-sizing:border-box;padding-right:50px}.select.sc-my-select button.sc-my-select{position:absolute;right:10px;background:transparent;border:none;cursor:pointer;width:40px;height:100%;display:flex;align-items:center;justify-content:center}.select.sc-my-select button.sc-my-select img.sc-my-select{transition:transform 0.3s ease}.select.sc-my-select button.sc-my-select img.rotated.sc-my-select{transform:rotate(180deg)}.select.sc-my-select .dropdown.sc-my-select{position:absolute;top:100%;left:0;width:100%;background:white;border:1px solid #dfdfdf;border-radius:5px;max-height:200px;overflow-y:auto;z-index:1000;padding:0;margin:0}.select.sc-my-select .dropdown.sc-my-select li.sc-my-select{padding:0;margin:0;padding:10px;cursor:pointer;list-style:none;text-align:left}.select.sc-my-select .dropdown.sc-my-select li.sc-my-select:hover{background:#f5f5f5}.select.sc-my-select .dropdown.sc-my-select .no-results.sc-my-select{padding:10px;text-align:center;color:#999}";
6928
+ const indexCss$1 = "@import url(\"https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1.sc-my-select,300..900&family=Poppins.sc-my-select:ital,wght@0.sc-my-select,100.sc-my-select;0.sc-my-select,200.sc-my-select;0.sc-my-select,300.sc-my-select;0.sc-my-select,400.sc-my-select;0.sc-my-select,500.sc-my-select;0.sc-my-select,600.sc-my-select;0.sc-my-select,700.sc-my-select;0.sc-my-select,800.sc-my-select;0.sc-my-select,900.sc-my-select;1.sc-my-select,100.sc-my-select;1.sc-my-select,200.sc-my-select;1.sc-my-select,300.sc-my-select;1.sc-my-select,400.sc-my-select;1.sc-my-select,500.sc-my-select;1.sc-my-select,600.sc-my-select;1.sc-my-select,700.sc-my-select;1.sc-my-select,800.sc-my-select;1.sc-my-select,900&display=swap\").sc-my-select; .tinting-wrapper.sc-my-select *.sc-my-select{font-family:\"Poppins\", sans-serif}.select.sc-my-select{position:relative;width:300px}@media (max-width: 768px){.select.sc-my-select{width:100%}}.select.sc-my-select .input-wrapper.sc-my-select{position:relative;display:flex;align-items:flex-start}.select.sc-my-select input.sc-my-select{font-size:16px;padding:16px;border-radius:27.35px;border:1px solid #dfdfdf;width:100%;color:#4c4c4c;box-sizing:border-box;padding-right:50px}.select.sc-my-select button.sc-my-select{position:absolute;right:10px;background:transparent;border:none;cursor:pointer;width:40px;height:100%;display:flex;align-items:center;justify-content:center}.select.sc-my-select button.sc-my-select img.sc-my-select{transition:transform 0.3s ease}.select.sc-my-select button.sc-my-select img.rotated.sc-my-select{transform:rotate(180deg)}.select.sc-my-select .dropdown.sc-my-select{position:absolute;top:100%;left:0;width:100%;background:white;border:1px solid #dfdfdf;border-radius:5px;max-height:200px;overflow-y:auto;z-index:1000;padding:0;margin:0}.select.sc-my-select .dropdown.sc-my-select li.sc-my-select{padding:0;margin:0;padding:10px;cursor:pointer;list-style:none;text-align:left}.select.sc-my-select .dropdown.sc-my-select li.sc-my-select:hover{background:#f5f5f5}.select.sc-my-select .dropdown.sc-my-select .no-results.sc-my-select{padding:10px;text-align:center;color:#999}@media (max-width: 768px){.select.sc-my-select .dropdown.sc-my-select{position:relative}}";
6930
6929
 
6931
6930
  const MySelect = class {
6932
6931
  constructor(hostRef) {