@marigold/system 7.5.0 → 7.5.2

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.
package/dist/index.js CHANGED
@@ -282,10 +282,20 @@ var extendTheme = (newStyles, theme) => {
282
282
  mergedStyles[component] = mergeSlotStyles;
283
283
  } else {
284
284
  const variants = ["size", "variant"].reduce((acc, variantItem) => {
285
- var _a, _b;
285
+ var _a, _b, _c, _d;
286
+ const newStylesVariants = (_a = newStyles[component].variants) == null ? void 0 : _a[variantItem];
287
+ const mergedStylesVariants = (_b = mergedStyles[component].variants) == null ? void 0 : _b[variantItem];
288
+ if (newStylesVariants && mergedStylesVariants) {
289
+ const dupVariants = Object.keys(newStylesVariants).filter(
290
+ (variant) => Object.keys(mergedStylesVariants).includes(variant)
291
+ );
292
+ if (dupVariants.length) {
293
+ throw new Error(dupVariants.join() + " already exists!");
294
+ }
295
+ }
286
296
  acc[variantItem] = {
287
- ...(_a = newStyles[component].variants) == null ? void 0 : _a[variantItem],
288
- ...(_b = mergedStyles[component].variants) == null ? void 0 : _b[variantItem]
297
+ ...(_c = newStyles[component].variants) == null ? void 0 : _c[variantItem],
298
+ ...(_d = mergedStyles[component].variants) == null ? void 0 : _d[variantItem]
289
299
  };
290
300
  return acc;
291
301
  }, {});
package/dist/index.mjs CHANGED
@@ -209,10 +209,20 @@ var extendTheme = (newStyles, theme) => {
209
209
  mergedStyles[component] = mergeSlotStyles;
210
210
  } else {
211
211
  const variants = ["size", "variant"].reduce((acc, variantItem) => {
212
- var _a, _b;
212
+ var _a, _b, _c, _d;
213
+ const newStylesVariants = (_a = newStyles[component].variants) == null ? void 0 : _a[variantItem];
214
+ const mergedStylesVariants = (_b = mergedStyles[component].variants) == null ? void 0 : _b[variantItem];
215
+ if (newStylesVariants && mergedStylesVariants) {
216
+ const dupVariants = Object.keys(newStylesVariants).filter(
217
+ (variant) => Object.keys(mergedStylesVariants).includes(variant)
218
+ );
219
+ if (dupVariants.length) {
220
+ throw new Error(dupVariants.join() + " already exists!");
221
+ }
222
+ }
213
223
  acc[variantItem] = {
214
- ...(_a = newStyles[component].variants) == null ? void 0 : _a[variantItem],
215
- ...(_b = mergedStyles[component].variants) == null ? void 0 : _b[variantItem]
224
+ ...(_c = newStyles[component].variants) == null ? void 0 : _c[variantItem],
225
+ ...(_d = mergedStyles[component].variants) == null ? void 0 : _d[variantItem]
216
226
  };
217
227
  return acc;
218
228
  }, {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marigold/system",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
4
4
  "description": "Marigold System Library",
5
5
  "license": "MIT",
6
6
  "keywords": [