@janbox/storefront-ui 6.0.3 → 6.0.5

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.
@@ -1,41 +1,38 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { getIconProps } from "./helpers.js";
3
- import { SvgLoader } from "../../components/svg-loader.js";
3
+ import { Primitive } from "../primitive/primitive.js";
4
4
  const Icon = ({ children: _children, ref, ..._props }) => {
5
5
  var _a, _b, _c;
6
- const { size, md, sm, lg, ...props } = getIconProps(_props);
6
+ const { size, source, md, sm, lg, ...props } = getIconProps(_props);
7
7
  return /* @__PURE__ */ jsx(
8
- SvgLoader,
8
+ Primitive,
9
9
  {
10
+ as: "span",
10
11
  ...props,
11
- width: void 0,
12
- height: void 0,
12
+ ref,
13
+ dangerouslySetInnerHTML: { __html: source },
14
+ "aria-hidden": true,
13
15
  sx: {
16
+ display: "inline-flex",
17
+ alignItems: "center",
18
+ justifyContent: "center",
19
+ verticalAlign: "middle",
20
+ flexShrink: 0,
21
+ lineHeight: 0,
22
+ "& svg": { width: "100%", height: "100%" },
14
23
  ...createStyle({ size }),
15
24
  ...props.sx,
16
- sm: {
17
- ...createStyle(sm),
18
- ...(_a = props.sx) == null ? void 0 : _a.sm
19
- },
20
- md: {
21
- ...createStyle(md),
22
- ...(_b = props.sx) == null ? void 0 : _b.md
23
- },
24
- lg: {
25
- ...createStyle(lg),
26
- ...(_c = props.sx) == null ? void 0 : _c.lg
27
- }
28
- },
29
- ref
25
+ sm: { ...createStyle(sm), ...(_a = props.sx) == null ? void 0 : _a.sm },
26
+ md: { ...createStyle(md), ...(_b = props.sx) == null ? void 0 : _b.md },
27
+ lg: { ...createStyle(lg), ...(_c = props.sx) == null ? void 0 : _c.lg }
28
+ }
30
29
  }
31
30
  );
32
31
  };
33
- const createStyle = ({ size } = {}) => {
34
- return {
35
- width: size,
36
- height: size
37
- };
38
- };
32
+ const createStyle = ({ size } = {}) => ({
33
+ width: size,
34
+ height: size
35
+ });
39
36
  export {
40
37
  Icon
41
38
  };
@@ -1,11 +1,10 @@
1
1
  import { JSX } from 'react';
2
- import { PropsWithSx, ShallowMerge, ToResponsiveProps } from '../../types';
2
+ import { ShallowMerge, ToResponsiveProps } from '../../types';
3
+ import { PrimitiveProps } from '../primitive';
3
4
  export interface IconResponsiveProps {
4
5
  size?: number;
5
6
  }
6
- type IconHTMLProps = JSX.IntrinsicElements['svg'];
7
- export type IconExtendedProps = PropsWithSx<ToResponsiveProps<IconResponsiveProps> & {
7
+ export type IconExtendedProps = ToResponsiveProps<IconResponsiveProps> & {
8
8
  source: string;
9
- }>;
10
- export type IconProps = ShallowMerge<IconHTMLProps, IconExtendedProps>;
11
- export {};
9
+ };
10
+ export type IconProps = PrimitiveProps<ShallowMerge<JSX.IntrinsicElements['span'], IconExtendedProps>, 'span'>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-ui",
3
- "version": "6.0.3",
3
+ "version": "6.0.5",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [