@react-foundry/simple-table 0.1.9 → 0.2.0

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,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleTable = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const component_helpers_1 = require("@react-foundry/component-helpers");
6
- require("../assets/SimpleTable.scss");
7
- const SimpleTable = ({ caption: _caption, classBlock, classModifiers, className, data, headings, keys, ...attrs }) => {
8
- const classes = (0, component_helpers_1.classBuilder)('penultimate-simple-table', classBlock, classModifiers, className);
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { classBuilder } from '@react-foundry/component-helpers';
3
+ import '../assets/SimpleTable.scss';
4
+ export const SimpleTable = ({ caption: _caption, classBlock, classModifiers, className, data, headings, keys, ...attrs }) => {
5
+ const classes = classBuilder('penultimate-simple-table', classBlock, classModifiers, className);
9
6
  const caption = (typeof _caption !== 'string'
10
7
  ? _caption
11
- : _caption && ((0, jsx_runtime_1.jsx)("caption", { className: classes('caption'), children: _caption })));
12
- return ((0, jsx_runtime_1.jsxs)("table", { ...attrs, className: classes(), children: [caption, (0, jsx_runtime_1.jsx)("thead", { className: classes('head'), children: (0, jsx_runtime_1.jsx)("tr", { className: classes('row'), children: keys.map((k, i) => ((0, jsx_runtime_1.jsx)("th", { scope: "col", className: classes('header'), children: headings[k] }, i))) }) }), (0, jsx_runtime_1.jsx)("tbody", { className: classes('body'), children: data.map((e, io) => ((0, jsx_runtime_1.jsx)("tr", { className: classes('row'), children: keys.map((k, i) => (i === 0
13
- ? ((0, jsx_runtime_1.jsx)("th", { scope: "row", className: classes('header'), children: e[k] }, i))
14
- : ((0, jsx_runtime_1.jsx)("td", { className: classes('cell'), children: e[k] }, i)))) }, io))) })] }));
8
+ : _caption && (_jsx("caption", { className: classes('caption'), children: _caption })));
9
+ return (_jsxs("table", { ...attrs, className: classes(), children: [caption, _jsx("thead", { className: classes('head'), children: _jsx("tr", { className: classes('row'), children: keys.map((k, i) => (_jsx("th", { scope: "col", className: classes('header'), children: headings[k] }, i))) }) }), _jsx("tbody", { className: classes('body'), children: data.map((e, io) => (_jsx("tr", { className: classes('row'), children: keys.map((k, i) => (i === 0
10
+ ? (_jsx("th", { scope: "row", className: classes('header'), children: e[k] }, i))
11
+ : (_jsx("td", { className: classes('cell'), children: e[k] }, i)))) }, io))) })] }));
15
12
  };
16
- exports.SimpleTable = SimpleTable;
17
- exports.default = exports.SimpleTable;
13
+ export default SimpleTable;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@react-foundry/simple-table",
3
- "version": "0.1.9",
3
+ "version": "0.2.0",
4
4
  "description": "A simple table for displaying data.",
5
+ "type": "module",
5
6
  "main": "dist/SimpleTable.js",
6
7
  "sass": "assets/SimpleTable.scss",
7
8
  "exports": {
8
9
  ".": {
9
10
  "sass": "./assets/SimpleTable.scss",
10
11
  "types": "./dist/SimpleTable.d.ts",
11
- "import": "./dist/SimpleTable.mjs",
12
- "require": "./dist/SimpleTable.js",
13
- "default": "./dist/SimpleTable.mjs"
12
+ "import": "./dist/SimpleTable.js",
13
+ "default": "./dist/SimpleTable.js"
14
14
  }
15
15
  },
16
16
  "files": [
@@ -23,10 +23,10 @@
23
23
  "react-components"
24
24
  ],
25
25
  "dependencies": {
26
- "@react-foundry/component-helpers": "^0.1.9"
26
+ "@react-foundry/component-helpers": "^0.2.0"
27
27
  },
28
28
  "peerDependencies": {
29
- "@react-foundry/docs-components": "^0.1.9",
29
+ "@react-foundry/docs-components": "^0.2.0",
30
30
  "@storybook/addon-docs": "^9.1.20",
31
31
  "react": "^19.2.4"
32
32
  },
@@ -44,15 +44,13 @@
44
44
  "jest-environment-jsdom": "30.3.0",
45
45
  "ts-jest": "29.4.9",
46
46
  "typescript": "5.9.3",
47
- "@react-foundry/component-test-helpers": "0.1.9"
47
+ "@react-foundry/component-test-helpers": "0.2.0"
48
48
  },
49
49
  "scripts": {
50
50
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
51
- "build": "npm run build:esm && npm run build:cjs",
52
- "build:esm": "tsc -m es2022 && find dist -name '*.js' -exec sh -c 'mv \"$0\" \"${0%.js}.mjs\"' {} \\;",
53
- "build:cjs": "tsc",
51
+ "build": "tsc",
54
52
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
55
53
  },
56
- "module": "dist/SimpleTable.mjs",
54
+ "module": "dist/SimpleTable.js",
57
55
  "typings": "dist/SimpleTable.d.ts"
58
56
  }
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { classBuilder } from '@react-foundry/component-helpers';
3
- import '../assets/SimpleTable.scss';
4
- export const SimpleTable = ({ caption: _caption, classBlock, classModifiers, className, data, headings, keys, ...attrs }) => {
5
- const classes = classBuilder('penultimate-simple-table', classBlock, classModifiers, className);
6
- const caption = (typeof _caption !== 'string'
7
- ? _caption
8
- : _caption && (_jsx("caption", { className: classes('caption'), children: _caption })));
9
- return (_jsxs("table", { ...attrs, className: classes(), children: [caption, _jsx("thead", { className: classes('head'), children: _jsx("tr", { className: classes('row'), children: keys.map((k, i) => (_jsx("th", { scope: "col", className: classes('header'), children: headings[k] }, i))) }) }), _jsx("tbody", { className: classes('body'), children: data.map((e, io) => (_jsx("tr", { className: classes('row'), children: keys.map((k, i) => (i === 0
10
- ? (_jsx("th", { scope: "row", className: classes('header'), children: e[k] }, i))
11
- : (_jsx("td", { className: classes('cell'), children: e[k] }, i)))) }, io))) })] }));
12
- };
13
- export default SimpleTable;