@faststore/ui 1.3.27 → 1.3.28

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/ui.esm.js CHANGED
@@ -235,37 +235,28 @@ const Slider = ({
235
235
  }));
236
236
  };
237
237
 
238
- const variantToType = variant => {
239
- switch (variant) {
240
- case 'description':
241
- return 'dl';
242
-
243
- case 'unordered':
244
- return 'ul';
245
-
246
- case 'ordered':
247
- return 'ol';
248
-
249
- default:
250
- return 'ul';
251
- }
238
+ const variantToElement = {
239
+ description: 'dl',
240
+ unordered: 'ul',
241
+ ordered: 'ol'
252
242
  };
253
-
254
243
  const List = /*#__PURE__*/forwardRef(function List({
255
244
  testId = 'store-list',
256
245
  variant = 'unordered',
257
- as,
258
- ...rawProps
246
+ as: MaybeComponent,
247
+ ...otherProps
259
248
  }, ref) {
249
+ var _ref;
250
+
260
251
  const dataAttributes = {
261
252
  'data-testid': testId,
262
253
  'data-store-list': true,
263
254
  [`data-${variant}`]: true
264
255
  };
265
- const Component = as != null ? as : variantToType(variant);
256
+ const Component = (_ref = MaybeComponent != null ? MaybeComponent : variantToElement[variant]) != null ? _ref : 'ul';
266
257
  return React.createElement(Component, Object.assign({
267
258
  ref: ref
268
- }, dataAttributes, rawProps));
259
+ }, dataAttributes, otherProps));
269
260
  });
270
261
 
271
262
  const Skeleton = /*#__PURE__*/forwardRef(function Skeleton({