@cronocode/react-box 1.5.5 → 1.5.6

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 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("../box.cjs");require("react");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(r){if(!(r!=null&&r.length))return{rows:[],columns:[]};const t=Object.keys(r[0]);return{rows:r.map(e=>({dataRow:e,cells:t.map(n=>({key:n,value:e[n]}))})),columns:t.map(e=>({key:e}))}}function c(r){const{data:t}=r,e=o(t);return e.columns.length===0?i.jsx(u.default,{display:"grid",children:"empty grid"}):i.jsxs(u.default,{display:"grid",children:[e.columns.map((n,s)=>i.jsx(u.default,{style:{gridColumn:s+1},children:n.key.toString()},n.key.toString())),e.rows.map((n,s)=>n.cells.map(l=>i.jsx(u.default,{children:l.value},l.key.toString()+s)))]})}exports.default=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),u=require("../box.cjs");require("react");require("../box.module.css.cjs");require("../utils/utils.cjs");require("../theme.cjs");function o(r){if(!(r!=null&&r.length))return{rows:[],columns:[]};const i=Object.keys(r[0]);return{rows:r.map(e=>({dataRow:e,cells:i.map(n=>({key:n,value:e[n]}))})),columns:i.map(e=>({key:e}))}}function c(r){const{data:i}=r,e=o(i);return t.jsx(u.default,{display:"grid",b:1,borderRadius:1,children:e.columns.length===0?t.jsx(t.Fragment,{children:"empty grid"}):t.jsxs(t.Fragment,{children:[e.columns.map((n,s)=>t.jsx(u.default,{style:{gridColumn:s+1},children:n.key.toString()},n.key.toString())),e.rows.map((n,s)=>n.cells.map(l=>t.jsx(u.default,{children:l.value},l.key.toString()+s)))]})})}exports.default=c;
@@ -1,36 +1,36 @@
1
- import { jsx as s, jsxs as l } from "react/jsx-runtime";
2
- import t from "../box.mjs";
1
+ import { jsx as o, Fragment as l, jsxs as u } from "react/jsx-runtime";
2
+ import s from "../box.mjs";
3
3
  import "react";
4
4
  import "../box.module.css.mjs";
5
5
  import "../utils/utils.mjs";
6
6
  import "../theme.mjs";
7
- function p(i) {
8
- if (!(i != null && i.length))
7
+ function c(e) {
8
+ if (!(e != null && e.length))
9
9
  return {
10
10
  rows: [],
11
11
  columns: []
12
12
  };
13
- const e = Object.keys(i[0]);
13
+ const i = Object.keys(e[0]);
14
14
  return {
15
- rows: i.map((r) => ({
15
+ rows: e.map((r) => ({
16
16
  dataRow: r,
17
- cells: e.map((n) => ({
17
+ cells: i.map((n) => ({
18
18
  key: n,
19
19
  value: r[n]
20
20
  }))
21
21
  })),
22
- columns: e.map((r) => ({
22
+ columns: i.map((r) => ({
23
23
  key: r
24
24
  }))
25
25
  };
26
26
  }
27
- function h(i) {
28
- const { data: e } = i, r = p(e);
29
- return r.columns.length === 0 ? /* @__PURE__ */ s(t, { display: "grid", children: "empty grid" }) : /* @__PURE__ */ l(t, { display: "grid", children: [
30
- r.columns.map((n, o) => /* @__PURE__ */ s(t, { style: { gridColumn: o + 1 }, children: n.key.toString() }, n.key.toString())),
31
- r.rows.map((n, o) => n.cells.map((m) => /* @__PURE__ */ s(t, { children: m.value }, m.key.toString() + o)))
32
- ] });
27
+ function k(e) {
28
+ const { data: i } = e, r = c(i);
29
+ return /* @__PURE__ */ o(s, { display: "grid", b: 1, borderRadius: 1, children: r.columns.length === 0 ? /* @__PURE__ */ o(l, { children: "empty grid" }) : /* @__PURE__ */ u(l, { children: [
30
+ r.columns.map((n, t) => /* @__PURE__ */ o(s, { style: { gridColumn: t + 1 }, children: n.key.toString() }, n.key.toString())),
31
+ r.rows.map((n, t) => n.cells.map((m) => /* @__PURE__ */ o(s, { children: m.value }, m.key.toString() + t)))
32
+ ] }) });
33
33
  }
34
34
  export {
35
- h as default
35
+ k as default
36
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronocode/react-box",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "main": "./box.cjs",
5
5
  "module": "./box.mjs",
6
6
  "types": "./box.d.ts",
@@ -36,7 +36,7 @@
36
36
  "preview": "vite preview",
37
37
  "build": "vite build",
38
38
  "build:dev": "vite build --mode dev",
39
- "postbuild": "cp package.json dist & cp LICENSE dist & rm ./dist/index.d.ts & rm ./dist/index.js",
39
+ "postbuild": "cp package.json dist & cp LICENSE dist & cp README.md dist & cp docs -r dist & rm ./dist/index.d.ts & rm ./dist/index.js",
40
40
  "compile": "tsc --noEmit --skipLibCheck",
41
41
  "test": "echo \"Error: no test specified\" && exit 1"
42
42
  },
@@ -60,6 +60,7 @@
60
60
  "@rollup/pluginutils": "^5.0.2",
61
61
  "@types/node": "^18.15.7",
62
62
  "@types/postcss-mixins": "^9.0.0",
63
+ "@types/prismjs": "^1.26.3",
63
64
  "@types/react": "^18.0.27",
64
65
  "@types/react-dom": "^18.0.10",
65
66
  "@vitejs/plugin-react": "^3.1.0",
@@ -70,6 +71,7 @@
70
71
  "postcss-nested": "^6.0.1",
71
72
  "postcss-simple-vars": "^7.0.1",
72
73
  "prettier": "^2.8.7",
74
+ "prismjs": "^1.29.0",
73
75
  "react": "^18.1.0",
74
76
  "react-dom": "^18.2.0",
75
77
  "react-router-dom": "^6.16.0",
package/src/index.d.ts ADDED
File without changes