vue-chrts 0.0.110 → 0.0.112

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.
Files changed (70) hide show
  1. package/.vscode/extensions.json +3 -0
  2. package/auto-imports.d.ts +58 -0
  3. package/components.d.ts +46 -0
  4. package/image.png +0 -0
  5. package/index.html +14 -0
  6. package/index.js +2 -0
  7. package/package.json +10 -15
  8. package/src/components/Area/AreaChart.vue +141 -0
  9. package/src/components/Area/index.ts +1 -0
  10. package/src/components/AreaStacked/AreaStackedChart.vue +51 -0
  11. package/src/components/AreaStacked/index.ts +1 -0
  12. package/src/components/Bar/BarChart.vue +130 -0
  13. package/src/components/Bar/index.ts +1 -0
  14. package/src/components/Crosshair/Crosshair.vue +46 -0
  15. package/src/components/Crosshair/index.ts +1 -0
  16. package/src/components/Donut/DonutChart.vue +71 -0
  17. package/src/components/Donut/index.ts +1 -0
  18. package/src/components/Line/LineChart.vue +94 -0
  19. package/src/components/Line/index.ts +1 -0
  20. package/src/components/Tooltip.vue +17 -0
  21. package/src/components.ts +6 -0
  22. package/src/index.ts +6 -0
  23. package/src/shims-vue.d.ts +1 -0
  24. package/src-demo/AdminTemplate.vue +5 -0
  25. package/src-demo/App.vue +37 -0
  26. package/src-demo/AreaChartPage.vue +125 -0
  27. package/src-demo/BarChartPage.vue +166 -0
  28. package/src-demo/DashboardTemplate.vue +687 -0
  29. package/src-demo/Homepage.vue +325 -0
  30. package/src-demo/LineChartPage.vue +140 -0
  31. package/src-demo/assets/main.css +34 -0
  32. package/src-demo/components/Progress/Progress.vue +42 -0
  33. package/src-demo/components/Progress/index.ts +1 -0
  34. package/src-demo/components/Status/Status.vue +95 -0
  35. package/src-demo/components/Status/index.ts +1 -0
  36. package/src-demo/components/charts.ts +37 -0
  37. package/src-demo/components/index.ts +49 -0
  38. package/src-demo/data/AreaChartData.ts +294 -0
  39. package/src-demo/data/BarChartData.ts +79 -0
  40. package/src-demo/data/IncomeExpenseData.ts +189 -0
  41. package/src-demo/data/InvestmentData.ts +352 -0
  42. package/src-demo/data/RevenueData.ts +58 -0
  43. package/src-demo/data/VisitorsData.ts +260 -0
  44. package/src-demo/elements/Button.vue +13 -0
  45. package/src-demo/elements/Card.vue +17 -0
  46. package/src-demo/elements/Dropdown.vue +112 -0
  47. package/src-demo/elements/Logo.vue +8 -0
  48. package/src-demo/elements/Table.vue +363 -0
  49. package/src-demo/elements/TopBar.vue +40 -0
  50. package/src-demo/index.ts +58 -0
  51. package/tsconfig.json +11 -0
  52. package/vite.config.ts +59 -0
  53. package/dist/Area/AreaChart.vue.d.ts +0 -11
  54. package/dist/Area/index.d.ts +0 -23
  55. package/dist/AreaStacked/AreaStackedChart.vue.d.ts +0 -8
  56. package/dist/AreaStacked/index.d.ts +0 -7
  57. package/dist/Bar/BarChart.vue.d.ts +0 -11
  58. package/dist/Bar/index.d.ts +0 -23
  59. package/dist/Donut/DonutChart.vue.d.ts +0 -11
  60. package/dist/Donut/index.d.ts +0 -12
  61. package/dist/Line/LineChart.vue.d.ts +0 -8
  62. package/dist/Line/index.d.ts +0 -20
  63. package/dist/Progress/Progress.vue.d.ts +0 -2
  64. package/dist/Status/Status.vue.d.ts +0 -2
  65. package/dist/Tooltip/Tooltip.vue.d.ts +0 -10
  66. package/dist/charts-CO6Yq10P.js +0 -16172
  67. package/dist/charts.d.ts +0 -18
  68. package/dist/index.d.ts +0 -8
  69. package/dist/index.js +0 -193
  70. /package/{dist → public}/vite.svg +0 -0
package/dist/charts.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import { AreaChart } from './Area/index';
2
- import { AreaStackedChart } from './AreaStacked/index';
3
- import { BarChart } from './Bar/index';
4
- import { DonutChart, DonutChartProps } from './Donut/index';
5
- import { LineChart, PaginationPosition, LineChartProps } from './Line/index';
6
-
7
- export { AreaChart, AreaStackedChart, BarChart, DonutChart, LineChart };
8
- type ChartModule = {
9
- AreaChart: typeof AreaChart;
10
- AreaStackedChart: typeof AreaStackedChart;
11
- BarChart: typeof BarChart;
12
- DonutChart: typeof DonutChart;
13
- LineChart: typeof LineChart;
14
- DonutChartProps: DonutChartProps;
15
- LineChartProps: LineChartProps<any>;
16
- PaginationPosition: typeof PaginationPosition;
17
- };
18
- export { type ChartModule, type DonutChartProps, type LineChartProps, PaginationPosition };
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { ChartModule } from './charts.ts';
2
- import { default as Progress } from './Progress/Progress.vue';
3
- import { default as Status } from './Status/Status.vue';
4
- import { default as Tooltip } from './Tooltip/Tooltip.vue';
5
-
6
- export { Progress, Status, Tooltip };
7
- export declare const loadCharts: () => Promise<ChartModule | {}>;
8
- export type LoadCharts = typeof loadCharts;
package/dist/index.js DELETED
@@ -1,193 +0,0 @@
1
- import { defineComponent, computed, createElementBlock, openBlock, createElementVNode, toDisplayString, normalizeStyle, ref, Fragment, renderList, normalizeClass, createCommentVNode } from 'vue';
2
-
3
- const _hoisted_1$2 = { class: "space-y-2" };
4
- const _hoisted_2$2 = { class: "space-y-2" };
5
- const _hoisted_3$2 = { class: "text-gray-500 mb-1" };
6
- const _hoisted_4$2 = { class: "text-xl dark:text-white font-bold" };
7
- const _hoisted_5$2 = { class: "flex items-center justify-between text-sm font-medium dark:text-gray-500 mt-2" };
8
- const _hoisted_6$1 = { class: "dark:bg-white/5 bg-gray-100 rounded-full h-3" };
9
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
10
- __name: "Progress",
11
- props: {
12
- label: {},
13
- value: {},
14
- unit: {},
15
- progress: {},
16
- total: {},
17
- color: {}
18
- },
19
- setup(__props) {
20
- const props = __props;
21
- const percentage = computed(() => {
22
- return (props.progress / props.total * 100).toFixed(1);
23
- });
24
- const width = computed(() => {
25
- return `${props.progress / props.total * 100}%`;
26
- });
27
- return (_ctx, _cache) => {
28
- return openBlock(), createElementBlock("div", _hoisted_1$2, [
29
- createElementVNode("div", _hoisted_2$2, [
30
- createElementVNode("p", _hoisted_3$2, toDisplayString(_ctx.label), 1),
31
- createElementVNode("h2", _hoisted_4$2, toDisplayString(_ctx.value), 1)
32
- ]),
33
- createElementVNode("div", _hoisted_5$2, [
34
- createElementVNode("div", null, toDisplayString(percentage.value) + "%", 1),
35
- createElementVNode("div", null, toDisplayString(_ctx.progress) + " of " + toDisplayString(_ctx.total) + toDisplayString(_ctx.unit), 1)
36
- ]),
37
- createElementVNode("div", _hoisted_6$1, [
38
- createElementVNode("div", {
39
- class: "rounded-full h-full",
40
- style: normalizeStyle({ width: width.value, backgroundColor: _ctx.color })
41
- }, null, 4)
42
- ])
43
- ]);
44
- };
45
- }
46
- });
47
-
48
- const _hoisted_1$1 = { class: "ring ring-border divide-y divide-border rounded-xl shadow-sm" };
49
- const _hoisted_2$1 = { class: "flex items-center justify-between p-4" };
50
- const _hoisted_3$1 = { class: "flex items-center gap-2" };
51
- const _hoisted_4$1 = { class: "font-medium" };
52
- const _hoisted_5$1 = { class: "text-sm dark:text-gray-400" };
53
- const _hoisted_6 = { class: "p-4" };
54
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
55
- __name: "Status",
56
- setup(__props) {
57
- const domain = ref("example.com");
58
- const uptime = ref("99.9% uptime");
59
- const outages = ref([
60
- { hour: 0, status: "online" },
61
- { hour: 1, status: "online" },
62
- { hour: 2, status: "online" },
63
- { hour: 3, status: "online" },
64
- { hour: 4, status: "online" },
65
- { hour: 5, status: "online" },
66
- { hour: 6, status: "online" },
67
- { hour: 7, status: "online" },
68
- { hour: 8, status: "online" },
69
- { hour: 9, status: "online" },
70
- { hour: 10, status: "online" },
71
- { hour: 11, status: "offline" },
72
- { hour: 12, status: "online" },
73
- { hour: 13, status: "online" },
74
- { hour: 14, status: "online" },
75
- { hour: 15, status: "online" },
76
- { hour: 16, status: "online" },
77
- { hour: 17, status: "online" },
78
- { hour: 18, status: "online" },
79
- { hour: 19, status: "online" },
80
- { hour: 20, status: "online" },
81
- { hour: 21, status: "online" },
82
- { hour: 22, status: "online" },
83
- { hour: 23, status: "online" },
84
- { hour: 0, status: "online" },
85
- { hour: 1, status: "online" },
86
- { hour: 2, status: "online" },
87
- { hour: 3, status: "online" },
88
- { hour: 4, status: "online" },
89
- { hour: 5, status: "online" },
90
- { hour: 6, status: "online" },
91
- { hour: 7, status: "online" },
92
- { hour: 8, status: "online" },
93
- { hour: 9, status: "online" },
94
- { hour: 10, status: "online" },
95
- { hour: 11, status: "online" },
96
- { hour: 12, status: "online" },
97
- { hour: 13, status: "online" },
98
- { hour: 14, status: "online" },
99
- { hour: 15, status: "online" },
100
- { hour: 16, status: "online" },
101
- { hour: 17, status: "online" },
102
- { hour: 18, status: "online" },
103
- { hour: 19, status: "online" },
104
- { hour: 20, status: "online" },
105
- { hour: 21, status: "online" },
106
- { hour: 22, status: "online" },
107
- { hour: 23, status: "online" },
108
- { hour: 0, status: "online" },
109
- { hour: 1, status: "online" }
110
- ]);
111
- return (_ctx, _cache) => {
112
- return openBlock(), createElementBlock("div", _hoisted_1$1, [
113
- createElementVNode("div", _hoisted_2$1, [
114
- createElementVNode("div", _hoisted_3$1, [
115
- _cache[0] || (_cache[0] = createElementVNode("svg", {
116
- xmlns: "http://www.w3.org/2000/svg",
117
- fill: "none",
118
- viewBox: "0 0 24 24",
119
- "stroke-width": "1.5",
120
- stroke: "currentColor",
121
- class: "size-6 text-primary"
122
- }, [
123
- createElementVNode("path", {
124
- "stroke-linecap": "round",
125
- "stroke-linejoin": "round",
126
- d: "M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"
127
- })
128
- ], -1)),
129
- createElementVNode("span", _hoisted_4$1, toDisplayString(domain.value), 1)
130
- ]),
131
- createElementVNode("span", _hoisted_5$1, toDisplayString(uptime.value), 1)
132
- ]),
133
- createElementVNode("div", _hoisted_6, [
134
- (openBlock(true), createElementBlock(Fragment, null, renderList(outages.value, (outage, index) => {
135
- return openBlock(), createElementBlock("div", {
136
- key: index,
137
- class: normalizeClass(["w-2.5 h-8 first:rounded-tl first:rounded-bl last:rounded-tr last:rounded-br ml-[3px] inline-block", outage.status === "online" ? "bg-primary" : "bg-white"])
138
- }, null, 2);
139
- }), 128))
140
- ])
141
- ]);
142
- };
143
- }
144
- });
145
-
146
- const _hoisted_1 = { class: "flex flex-col" };
147
- const _hoisted_2 = { class: "flex items-center mr-2 mt-2" };
148
- const _hoisted_3 = { class: "font-semibold capitalize text-white/75" };
149
- const _hoisted_4 = { class: "flex items-center gap-2" };
150
- const _hoisted_5 = { class: "font-normal" };
151
- const _sfc_main = /* @__PURE__ */ defineComponent({
152
- __name: "Tooltip",
153
- props: {
154
- data: {},
155
- categories: {}
156
- },
157
- setup(__props) {
158
- function getColor(key) {
159
- return props.categories[key]?.color ?? "#f00";
160
- }
161
- const props = __props;
162
- return (_ctx, _cache) => {
163
- return openBlock(), createElementBlock("div", _hoisted_1, [
164
- (openBlock(true), createElementBlock(Fragment, null, renderList(Object.entries(_ctx.data), ([key, value]) => {
165
- return openBlock(), createElementBlock(Fragment, { key }, [
166
- createElementVNode("div", _hoisted_2, [
167
- createElementVNode("span", _hoisted_3, toDisplayString(key) + ":", 1)
168
- ]),
169
- createElementVNode("div", _hoisted_4, [
170
- props.categories[key]?.color ? (openBlock(), createElementBlock("span", {
171
- key: 0,
172
- style: normalizeStyle({ backgroundColor: getColor(key) }),
173
- class: "w-2 h-2"
174
- }, null, 4)) : createCommentVNode("", true),
175
- createElementVNode("span", _hoisted_5, toDisplayString(value), 1)
176
- ])
177
- ], 64);
178
- }), 128))
179
- ]);
180
- };
181
- }
182
- });
183
-
184
- const loadCharts = () => {
185
- if (import.meta.client || typeof window !== "undefined") {
186
- return import('./charts-CO6Yq10P.js').then((module) => {
187
- return module;
188
- });
189
- }
190
- return Promise.resolve({});
191
- };
192
-
193
- export { _sfc_main$2 as Progress, _sfc_main$1 as Status, _sfc_main as Tooltip, loadCharts };
File without changes