@janbox/storefront-ui 2.0.28 → 2.0.29

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.
@@ -10,32 +10,16 @@ const Box = ({ children, ref, ..._props }) => {
10
10
  ...rest,
11
11
  sx: {
12
12
  ...container ? containerStyle : {},
13
- ...createStyle(sx),
14
- sm: createStyle(sx.sm),
15
- md: createStyle(sx.md),
16
- lg: createStyle(sx.lg)
13
+ ...sx,
14
+ sm: { ...sx.sm },
15
+ md: { ...sx.md },
16
+ lg: { ...sx.lg }
17
17
  },
18
18
  ref,
19
- children: /* @__PURE__ */ jsx(
20
- Primitive,
21
- {
22
- sx: {
23
- width: "100%",
24
- height: "100%"
25
- },
26
- children
27
- }
28
- )
19
+ children
29
20
  }
30
21
  );
31
22
  };
32
- const createStyle = ({ width, height, ...css } = {}) => {
33
- return {
34
- width,
35
- height,
36
- "& > *": css
37
- };
38
- };
39
23
  export {
40
24
  Box
41
25
  };
@@ -1,2 +1,2 @@
1
1
  import { FlexboxProps } from './types';
2
- export declare const Flexbox: ({ children, container, ref, ..._props }: FlexboxProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const Flexbox: ({ children, container, ref, ..._props }: FlexboxProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +1,25 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { getFlexboxProps } from "./helpers.js";
3
- import { mediaQuery } from "../../../theme/screens.js";
4
- import "../../../theme/palette.js";
5
3
  import { containerStyle } from "../../../constants/emotion.js";
4
+ import { Primitive } from "../../primitive/primitive.js";
6
5
  const Flexbox = ({ children, container, ref, ..._props }) => {
7
6
  const { sx = {}, ...rest } = getFlexboxProps(_props);
8
- const { sm, md, lg, ...restSx } = sx;
9
- const css = [
10
- container && containerStyle,
11
- createStyle(restSx),
7
+ return /* @__PURE__ */ jsx(
8
+ Primitive,
12
9
  {
13
- [mediaQuery("sm")]: createStyle(sm),
14
- [mediaQuery("md")]: createStyle(md),
15
- [mediaQuery("lg")]: createStyle(lg)
10
+ ...rest,
11
+ sx: {
12
+ display: "flex",
13
+ ...container ? containerStyle : {},
14
+ ...sx,
15
+ sm: { ...sx.sm },
16
+ md: { ...sx.md },
17
+ lg: { ...sx.lg }
18
+ },
19
+ ref,
20
+ children
16
21
  }
17
- ];
18
- return /* @__PURE__ */ jsx("div", { css, ...rest, ref, children: /* @__PURE__ */ jsx("div", { css: { display: "flex", width: "100%", height: "100%" }, children }) });
19
- };
20
- const createStyle = (sx = {}) => {
21
- const { width, height, ...css } = sx;
22
- return {
23
- width,
24
- height,
25
- "& > *": css
26
- };
22
+ );
27
23
  };
28
24
  export {
29
25
  Flexbox
@@ -1,4 +1,4 @@
1
1
  import { GridProps } from './types';
2
2
  export declare const GRID_MINIMUM_COLS = 1;
3
3
  export declare const GRID_MAXIMUM_COLS = 24;
4
- export declare const Grid: ({ children, ref, ..._props }: GridProps) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export declare const Grid: ({ children, ref, ..._props }: GridProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,38 +1,33 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { isNil } from "lodash-es";
3
3
  import { getGridProps } from "./helpers.js";
4
- import { mediaQuery } from "../../../theme/screens.js";
5
- import "../../../theme/palette.js";
6
4
  import { containerStyle } from "../../../constants/emotion.js";
5
+ import { Primitive } from "../../primitive/primitive.js";
7
6
  const GRID_MINIMUM_COLS = 1;
8
7
  const GRID_MAXIMUM_COLS = 24;
9
8
  const Grid = ({ children, ref, ..._props }) => {
10
9
  const { cols, sm, md, lg, container, sx = {}, ...rest } = getGridProps(_props);
11
- const { sm: sxSm, md: sxMd, lg: sxLg, ...sxXs } = sx;
12
- const css = [
13
- container && containerStyle,
14
- createStyle({ cols }, sxXs),
10
+ return /* @__PURE__ */ jsx(
11
+ Primitive,
15
12
  {
16
- [mediaQuery("sm")]: createStyle(sm, sxSm),
17
- [mediaQuery("md")]: createStyle(md, sxMd),
18
- [mediaQuery("lg")]: createStyle(lg, sxLg)
13
+ sx: {
14
+ display: "grid",
15
+ ...container ? containerStyle : {},
16
+ ...createStyle({ cols }),
17
+ ...sx,
18
+ sm: { ...createStyle(sm), ...sx.sm },
19
+ md: { ...createStyle(md), ...sx.md },
20
+ lg: { ...createStyle(lg), ...sx.lg }
21
+ },
22
+ ...rest,
23
+ ref,
24
+ children
19
25
  }
20
- ];
21
- return /* @__PURE__ */ jsx("div", { css, ...rest, ref, children: /* @__PURE__ */ jsx("div", { css: { display: "grid", width: "100%", height: "100%" }, children }) });
22
- };
23
- const createStyle = ({ cols } = {}, sx = {}) => {
24
- const { width, height, ...css } = sx;
25
- return [
26
- {
27
- width,
28
- height,
29
- "& > *": {
30
- gridTemplateColumns: isNil(cols) ? void 0 : `repeat(${cols}, minmax(0, 1fr))`,
31
- ...css
32
- }
33
- }
34
- ];
26
+ );
35
27
  };
28
+ const createStyle = ({ cols } = {}) => ({
29
+ gridTemplateColumns: isNil(cols) ? void 0 : `repeat(${cols}, minmax(0, 1fr))`
30
+ });
36
31
  export {
37
32
  GRID_MAXIMUM_COLS,
38
33
  GRID_MINIMUM_COLS,
@@ -1,2 +1,2 @@
1
1
  import { TableRowProps } from './types';
2
- export declare const TableRow: ({ sx, children, ...props }: TableRowProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const TableRow: (props: TableRowProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
2
- import { createSxInterpolation } from "../../../utils/stylesheet.js";
3
- const TableRow = ({ sx, children, ...props }) => {
4
- return /* @__PURE__ */ jsx("tr", { css: createSxInterpolation(sx), ...props, children });
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Primitive } from "../../primitive/primitive.js";
3
+ const TableRow = (props) => {
4
+ return /* @__PURE__ */ jsx(Primitive, { ...props, as: "tr" });
5
5
  };
6
6
  export {
7
7
  TableRow
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
- import { PropsWithSx } from '../../../types';
3
- export type TableRowProps = PropsWithSx<JSX.IntrinsicElements['tr']>;
2
+ import { PrimitiveProps } from '../../primitive';
3
+ export type TableRowProps = PrimitiveProps<JSX.IntrinsicElements['tr']>;
@@ -1,2 +1,2 @@
1
1
  import { ListItemProps } from './types';
2
- export declare const ListItem: ({ ref, ..._props }: ListItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const ListItem: ({ ref, ..._props }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,21 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { isNil } from "lodash-es";
3
3
  import { getListItemProps } from "./helpers.js";
4
- import { createSxInterpolation } from "../../../utils/stylesheet.js";
4
+ import { Primitive } from "../../primitive/primitive.js";
5
5
  const ListItem = ({ ref, ..._props }) => {
6
6
  const { sx, children, dangerouslySetInnerHTML, ...rest } = getListItemProps(_props);
7
- const css = [
8
- {
9
- display: "inline-flex"
10
- },
11
- createSxInterpolation(sx)
12
- ];
13
7
  return /* @__PURE__ */ jsx(
14
- "li",
8
+ Primitive,
15
9
  {
16
- css,
17
10
  suppressContentEditableWarning: true,
18
11
  dangerouslySetInnerHTML: isNil(children) ? dangerouslySetInnerHTML : void 0,
19
12
  ...rest,
20
13
  ref,
14
+ sx: {
15
+ display: "inline-flex",
16
+ ...sx
17
+ },
18
+ as: "li",
21
19
  children: isNil(dangerouslySetInnerHTML) ? children : null
22
20
  }
23
21
  );
@@ -1,3 +1,3 @@
1
1
  import { JSX } from 'react';
2
- import { PropsWithSx } from '../../../types';
3
- export type ListItemProps = PropsWithSx<JSX.IntrinsicElements['li']>;
2
+ import { PrimitiveProps } from '../../primitive';
3
+ export type ListItemProps = PrimitiveProps<JSX.IntrinsicElements['li']>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-ui",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [