@tipp/ui 0.1.3 → 0.1.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.
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
10
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11
+ var __spreadValues = (a, b) => {
12
+ for (var prop in b || (b = {}))
13
+ if (__hasOwnProp.call(b, prop))
14
+ __defNormalProp(a, prop, b[prop]);
15
+ if (__getOwnPropSymbols)
16
+ for (var prop of __getOwnPropSymbols(b)) {
17
+ if (__propIsEnum.call(b, prop))
18
+ __defNormalProp(a, prop, b[prop]);
19
+ }
20
+ return a;
21
+ };
22
+ var __export = (target, all) => {
23
+ for (var name in all)
24
+ __defProp(target, name, { get: all[name], enumerable: true });
25
+ };
26
+ var __copyProps = (to, from, except, desc) => {
27
+ if (from && typeof from === "object" || typeof from === "function") {
28
+ for (let key of __getOwnPropNames(from))
29
+ if (!__hasOwnProp.call(to, key) && key !== except)
30
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
31
+ }
32
+ return to;
33
+ };
34
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
35
+ // If the importer is in node compatibility mode or this is not an ESM
36
+ // file that has been converted to a CommonJS file using a Babel-
37
+ // compatible transform (i.e. "__esModule" has not been set), then set
38
+ // "default" to the CommonJS "module.exports" for node compatibility.
39
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
40
+ mod
41
+ ));
42
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
43
+
44
+ // src/chart/chart.tsx
45
+ var chart_exports = {};
46
+ __export(chart_exports, {
47
+ Chart: () => Chart
48
+ });
49
+ module.exports = __toCommonJS(chart_exports);
50
+ var import_react_resize_detector = require("react-resize-detector");
51
+ var import_echarts_for_react = __toESM(require("echarts-for-react"), 1);
52
+ var import_jsx_runtime = require("react/jsx-runtime");
53
+ function Chart(props) {
54
+ const { width, height, ref } = (0, import_react_resize_detector.useResizeDetector)({
55
+ handleHeight: false,
56
+ refreshMode: "debounce",
57
+ refreshRate: 100
58
+ });
59
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_echarts_for_react.default, __spreadValues({ style: { width, height } }, props)) });
60
+ }
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ Chart
64
+ });
65
+ //# sourceMappingURL=chart.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/chart/chart.tsx"],"sourcesContent":["import React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport ReactECharts from 'echarts-for-react';\n\nexport type ChartProps = React.ComponentProps<typeof ReactECharts>;\n\nexport function Chart(props: ChartProps): JSX.Element {\n const { width, height, ref } = useResizeDetector({\n handleHeight: false,\n refreshMode: 'debounce',\n refreshRate: 100,\n });\n\n return (\n <div ref={ref} style={{ width: '100%', height: '100%' }}>\n <ReactECharts style={{ width, height }} {...props} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mCAAkC;AAClC,+BAAyB;AAanB;AATC,SAAS,MAAM,OAAgC;AACpD,QAAM,EAAE,OAAO,QAAQ,IAAI,QAAI,gDAAkB;AAAA,IAC/C,cAAc;AAAA,IACd,aAAa;AAAA,IACb,aAAa;AAAA,EACf,CAAC;AAED,SACE,4CAAC,SAAI,KAAU,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GACpD,sDAAC,yBAAAA,SAAA,iBAAa,OAAO,EAAE,OAAO,OAAO,KAAO,MAAO,GACrD;AAEJ;","names":["ReactECharts"]}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import ReactECharts from 'echarts-for-react';
3
+
4
+ type ChartProps = React.ComponentProps<typeof ReactECharts>;
5
+ declare function Chart(props: ChartProps): JSX.Element;
6
+
7
+ export { Chart, type ChartProps };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import ReactECharts from 'echarts-for-react';
3
+
4
+ type ChartProps = React.ComponentProps<typeof ReactECharts>;
5
+ declare function Chart(props: ChartProps): JSX.Element;
6
+
7
+ export { Chart, type ChartProps };
@@ -0,0 +1,20 @@
1
+ import {
2
+ __spreadValues
3
+ } from "../chunk-LGTAQGUA.js";
4
+
5
+ // src/chart/chart.tsx
6
+ import { useResizeDetector } from "react-resize-detector";
7
+ import ReactECharts from "echarts-for-react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ function Chart(props) {
10
+ const { width, height, ref } = useResizeDetector({
11
+ handleHeight: false,
12
+ refreshMode: "debounce",
13
+ refreshRate: 100
14
+ });
15
+ return /* @__PURE__ */ jsx("div", { ref, style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ jsx(ReactECharts, __spreadValues({ style: { width, height } }, props)) });
16
+ }
17
+ export {
18
+ Chart
19
+ };
20
+ //# sourceMappingURL=chart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/chart/chart.tsx"],"sourcesContent":["import React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport ReactECharts from 'echarts-for-react';\n\nexport type ChartProps = React.ComponentProps<typeof ReactECharts>;\n\nexport function Chart(props: ChartProps): JSX.Element {\n const { width, height, ref } = useResizeDetector({\n handleHeight: false,\n refreshMode: 'debounce',\n refreshRate: 100,\n });\n\n return (\n <div ref={ref} style={{ width: '100%', height: '100%' }}>\n <ReactECharts style={{ width, height }} {...props} />\n </div>\n );\n}\n"],"mappings":";;;;;AACA,SAAS,yBAAyB;AAClC,OAAO,kBAAkB;AAanB;AATC,SAAS,MAAM,OAAgC;AACpD,QAAM,EAAE,OAAO,QAAQ,IAAI,IAAI,kBAAkB;AAAA,IAC/C,cAAc;AAAA,IACd,aAAa;AAAA,IACb,aAAa;AAAA,EACf,CAAC;AAED,SACE,oBAAC,SAAI,KAAU,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GACpD,8BAAC,+BAAa,OAAO,EAAE,OAAO,OAAO,KAAO,MAAO,GACrD;AAEJ;","names":[]}
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ import {
2
+ Tooltip
3
+ } from "./chunk-ACVANQJ4.js";
1
4
  import {
2
5
  ThemeProvider
3
6
  } from "./chunk-LREYUDKD.js";
@@ -10,6 +13,9 @@ import {
10
13
  import {
11
14
  DatePicker
12
15
  } from "./chunk-D5QWAVBB.js";
16
+ import {
17
+ Skeleton
18
+ } from "./chunk-5H3YPCZK.js";
13
19
  import {
14
20
  Strong
15
21
  } from "./chunk-74DX4CU7.js";
@@ -32,8 +38,8 @@ import {
32
38
  Text
33
39
  } from "./chunk-DYUKDKUS.js";
34
40
  import {
35
- Tooltip
36
- } from "./chunk-ACVANQJ4.js";
41
+ RadioCards
42
+ } from "./chunk-6IVCARWS.js";
37
43
  import {
38
44
  RadioGroup
39
45
  } from "./chunk-6DJOIRMF.js";
@@ -56,8 +62,8 @@ import {
56
62
  Separator
57
63
  } from "./chunk-HYITAA4J.js";
58
64
  import {
59
- Skeleton
60
- } from "./chunk-5H3YPCZK.js";
65
+ HoverCard
66
+ } from "./chunk-O3T3TM3V.js";
61
67
  import {
62
68
  IconButton
63
69
  } from "./chunk-O3DNDMV3.js";
@@ -80,8 +86,8 @@ import {
80
86
  Quote
81
87
  } from "./chunk-YO3BQW6S.js";
82
88
  import {
83
- RadioCards
84
- } from "./chunk-6IVCARWS.js";
89
+ Container
90
+ } from "./chunk-Q37G2GS6.js";
85
91
  import {
86
92
  DataList
87
93
  } from "./chunk-VTJZMOSP.js";
@@ -104,8 +110,8 @@ import {
104
110
  Heading
105
111
  } from "./chunk-MYTJIEMB.js";
106
112
  import {
107
- HoverCard
108
- } from "./chunk-O3T3TM3V.js";
113
+ Box
114
+ } from "./chunk-4Y5BEXVN.js";
109
115
  import {
110
116
  Button
111
117
  } from "./chunk-LFJCZVNE.js";
@@ -127,9 +133,6 @@ import {
127
133
  import {
128
134
  Code
129
135
  } from "./chunk-OHMOP5PV.js";
130
- import {
131
- Container
132
- } from "./chunk-Q37G2GS6.js";
133
136
  import {
134
137
  BookmarkIcon,
135
138
  ChatBubbleIcon,
@@ -155,9 +158,6 @@ import {
155
158
  import {
156
159
  Blockquote
157
160
  } from "./chunk-YGL6SWKN.js";
158
- import {
159
- Box
160
- } from "./chunk-4Y5BEXVN.js";
161
161
  import "./chunk-LGTAQGUA.js";
162
162
  export {
163
163
  AlertDialog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tipp/ui",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -34,6 +34,16 @@
34
34
  "default": "./dist/theme/theme-provider.js"
35
35
  }
36
36
  },
37
+ "./chart": {
38
+ "require": {
39
+ "types": "./dist/chart/chart.d.ts",
40
+ "default": "./dist/chart/chart.cjs"
41
+ },
42
+ "import": {
43
+ "types": "./dist/chart/chart.d.ts",
44
+ "default": "./dist/chart/chart.js"
45
+ }
46
+ },
37
47
  "./*": "./*"
38
48
  },
39
49
  "main": "dist/index.js",
@@ -46,6 +56,9 @@
46
56
  "dependencies": {
47
57
  "@radix-ui/react-icons": "^1.3.0",
48
58
  "@radix-ui/themes": "^3.1.1",
59
+ "echarts-for-react": "^3.0.2",
60
+ "i": "^0.3.7",
61
+ "npm": "^10.8.2",
49
62
  "react": "^18.3.1",
50
63
  "react-datepicker": "^7.3.0",
51
64
  "react-dom": "^18.3.1",
@@ -65,8 +78,8 @@
65
78
  "postcss-nesting": "12.0.2",
66
79
  "tsup": "^8.0.2",
67
80
  "typescript": "^5.3.3",
68
- "@tipp/eslint-config": "0.2.1",
69
- "@tipp/typescript-config": "0.0.2"
81
+ "@tipp/eslint-config": "0.2.2",
82
+ "@tipp/typescript-config": "0.0.3"
70
83
  },
71
84
  "scripts": {
72
85
  "build": "pnpm run build:js && pnpm run build:css",
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { useResizeDetector } from 'react-resize-detector';
3
+ import ReactECharts from 'echarts-for-react';
4
+
5
+ export type ChartProps = React.ComponentProps<typeof ReactECharts>;
6
+
7
+ export function Chart(props: ChartProps): JSX.Element {
8
+ const { width, height, ref } = useResizeDetector({
9
+ handleHeight: false,
10
+ refreshMode: 'debounce',
11
+ refreshRate: 100,
12
+ });
13
+
14
+ return (
15
+ <div ref={ref} style={{ width: '100%', height: '100%' }}>
16
+ <ReactECharts style={{ width, height }} {...props} />
17
+ </div>
18
+ );
19
+ }