@otfdashkit/ui 0.1.5 → 0.1.7
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.
- package/README.md +47 -6
- package/dist/index.js +8 -7
- package/dist/index.mjs +8 -7
- package/package.json +2 -4
- package/src/charts/area-chart.tsx +2 -2
- package/src/charts/bar-chart.tsx +4 -4
- package/src/charts/line-chart.tsx +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<h1 align="center">@otfdashkit/ui</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
|
|
4
|
+
150+ web components for builders shipping production apps, 90 of them documented one by one. Tailwind CSS v3 or v4 on top, AI-agent-readable by design.
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</a>
|
|
14
14
|
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square" alt="MIT License">
|
|
15
15
|
<img src="https://img.shields.io/badge/React-19-000?style=flat-square" alt="React 19">
|
|
16
|
-
<img src="https://img.shields.io/badge/Tailwind-
|
|
16
|
+
<img src="https://img.shields.io/badge/Tailwind-v3%20%7C%20v4-000?style=flat-square" alt="Tailwind v3 or v4">
|
|
17
17
|
</p>
|
|
18
18
|
|
|
19
19
|
---
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
- **Advanced** — Tiptap editor, ImageCrop, file uploaders, marquees, shiki-powered code blocks, video player
|
|
28
28
|
- **17 themes** out of the box from [`@otfdashkit/tokens`](https://www.npmjs.com/package/@otfdashkit/tokens) — swap palette by changing one attribute on `<html>`
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
150+ web components in [`src/`](src/), 90 documented one by one. Full catalog at the Storybook below.
|
|
31
31
|
|
|
32
32
|
## Live demos
|
|
33
33
|
|
|
@@ -43,6 +43,47 @@ pnpm add @otfdashkit/ui @otfdashkit/tokens
|
|
|
43
43
|
# or: bun add @otfdashkit/ui @otfdashkit/tokens
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
## Tailwind setup
|
|
47
|
+
|
|
48
|
+
Tailwind needs two things: scan the package source, and map the theme tokens (HSL channels) to colours.
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
/* Tailwind v4: in your global CSS */
|
|
52
|
+
@source "../node_modules/@otfdashkit/ui/src/**/*.{ts,tsx}";
|
|
53
|
+
|
|
54
|
+
@theme inline {
|
|
55
|
+
--color-background: hsl(var(--background));
|
|
56
|
+
--color-foreground: hsl(var(--foreground));
|
|
57
|
+
--color-card: hsl(var(--card));
|
|
58
|
+
--color-card-foreground: hsl(var(--card-foreground));
|
|
59
|
+
--color-popover: hsl(var(--popover));
|
|
60
|
+
--color-popover-foreground: hsl(var(--popover-foreground));
|
|
61
|
+
--color-primary: hsl(var(--primary));
|
|
62
|
+
--color-primary-foreground: hsl(var(--primary-foreground));
|
|
63
|
+
--color-secondary: hsl(var(--secondary));
|
|
64
|
+
--color-secondary-foreground: hsl(var(--secondary-foreground));
|
|
65
|
+
--color-muted: hsl(var(--muted));
|
|
66
|
+
--color-muted-foreground: hsl(var(--muted-foreground));
|
|
67
|
+
--color-accent: hsl(var(--accent));
|
|
68
|
+
--color-accent-foreground: hsl(var(--accent-foreground));
|
|
69
|
+
--color-destructive: hsl(var(--destructive));
|
|
70
|
+
--color-destructive-foreground: hsl(var(--destructive-foreground));
|
|
71
|
+
--color-border: hsl(var(--border));
|
|
72
|
+
--color-input: hsl(var(--input));
|
|
73
|
+
--color-ring: hsl(var(--ring));
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```js
|
|
78
|
+
// Tailwind v3: tailwind.config.js
|
|
79
|
+
import { otfPreset } from '@otfdashkit/tokens/tailwind-preset'
|
|
80
|
+
|
|
81
|
+
export default {
|
|
82
|
+
presets: [otfPreset],
|
|
83
|
+
content: ['./src/**/*.{ts,tsx}', './node_modules/@otfdashkit/ui/src/**/*.{ts,tsx}'],
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
46
87
|
## Quick start
|
|
47
88
|
|
|
48
89
|
```tsx
|
|
@@ -58,7 +99,7 @@ export default function SignInCard() {
|
|
|
58
99
|
return (
|
|
59
100
|
<Card>
|
|
60
101
|
<Input placeholder="Email" />
|
|
61
|
-
<Button
|
|
102
|
+
<Button size="lg">Continue</Button>
|
|
62
103
|
</Card>
|
|
63
104
|
)
|
|
64
105
|
}
|
|
@@ -82,7 +123,7 @@ Pair with [`@otfdashkit/eslint-plugin-otf-design`](https://www.npmjs.com/package
|
|
|
82
123
|
|
|
83
124
|
## Related packages
|
|
84
125
|
|
|
85
|
-
- [`@otfdashkit/ui-native`](https://www.npmjs.com/package/@otfdashkit/ui-native) — mobile counterpart, same component
|
|
126
|
+
- [`@otfdashkit/ui-native`](https://www.npmjs.com/package/@otfdashkit/ui-native) — mobile counterpart, same component names for the shared set (props differ per platform)
|
|
86
127
|
- [`@otfdashkit/tokens`](https://www.npmjs.com/package/@otfdashkit/tokens) — design tokens (CSS vars + Tamagui config)
|
|
87
128
|
- [`@otfdashkit/cli`](https://www.npmjs.com/package/@otfdashkit/cli) — heavy-peer component installer (Skia, Reanimated, MMKV)
|
|
88
129
|
|
|
@@ -92,7 +133,7 @@ Questions, bugs, feature requests: **[discord.gg/gpXyu7SqNZ](https://discord.gg/
|
|
|
92
133
|
|
|
93
134
|
## Status
|
|
94
135
|
|
|
95
|
-
`
|
|
136
|
+
Live on npm and in production: the OTF SaaS Dashboard kit is built on it. Versions follow semver; while on `0.x`, a minor release can change an API, so pin exact versions in production.
|
|
96
137
|
|
|
97
138
|
## License
|
|
98
139
|
|
package/dist/index.js
CHANGED
|
@@ -7098,10 +7098,10 @@ function AreaChart({
|
|
|
7098
7098
|
}) {
|
|
7099
7099
|
const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
|
|
7100
7100
|
const curve = curved ? "monotone" : "linear";
|
|
7101
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.AreaChart, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left:
|
|
7101
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.AreaChart, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left: 0, bottom: 0 }, children: [
|
|
7102
7102
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7103
7103
|
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7104
|
-
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7104
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { width: "auto", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7105
7105
|
showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7106
7106
|
RechartsPrimitive.Tooltip,
|
|
7107
7107
|
{
|
|
@@ -7164,7 +7164,7 @@ function BarChart({
|
|
|
7164
7164
|
{
|
|
7165
7165
|
data: data.map((d) => ({ ...d })),
|
|
7166
7166
|
layout,
|
|
7167
|
-
margin: { top: 4, right: lineDataKey ? 8 : 4, left:
|
|
7167
|
+
margin: { top: 4, right: lineDataKey ? 8 : 4, left: 0, bottom: 0 },
|
|
7168
7168
|
barSize,
|
|
7169
7169
|
maxBarSize,
|
|
7170
7170
|
barCategoryGap,
|
|
@@ -7172,13 +7172,14 @@ function BarChart({
|
|
|
7172
7172
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7173
7173
|
isVertical ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7174
7174
|
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.XAxis, { type: "number", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7175
|
-
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { type: "category", dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
|
|
7175
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { width: "auto", type: "category", dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
|
|
7176
7176
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
7177
7177
|
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7178
|
-
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { yAxisId: "left", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7178
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { width: "auto", yAxisId: "left", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7179
7179
|
lineDataKey && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7180
7180
|
RechartsPrimitive.YAxis,
|
|
7181
7181
|
{
|
|
7182
|
+
width: "auto",
|
|
7182
7183
|
yAxisId: "right",
|
|
7183
7184
|
orientation: "right",
|
|
7184
7185
|
tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" },
|
|
@@ -7253,10 +7254,10 @@ function LineChart({
|
|
|
7253
7254
|
const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
|
|
7254
7255
|
const curve = curved ? "monotone" : "linear";
|
|
7255
7256
|
const dash = dotted ? "4 4" : void 0;
|
|
7256
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.LineChart, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left:
|
|
7257
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive.LineChart, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left: 0, bottom: 0 }, children: [
|
|
7257
7258
|
showGrid && /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7258
7259
|
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7259
|
-
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7260
|
+
/* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive.YAxis, { width: "auto", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7260
7261
|
showTooltip && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7261
7262
|
RechartsPrimitive.Tooltip,
|
|
7262
7263
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -7045,10 +7045,10 @@ function AreaChart({
|
|
|
7045
7045
|
}) {
|
|
7046
7046
|
const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
|
|
7047
7047
|
const curve = curved ? "monotone" : "linear";
|
|
7048
|
-
return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(AreaChart$1, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left:
|
|
7048
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(AreaChart$1, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left: 0, bottom: 0 }, children: [
|
|
7049
7049
|
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7050
7050
|
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7051
|
-
/* @__PURE__ */ jsx(YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7051
|
+
/* @__PURE__ */ jsx(YAxis, { width: "auto", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7052
7052
|
showTooltip && /* @__PURE__ */ jsx(
|
|
7053
7053
|
Tooltip,
|
|
7054
7054
|
{
|
|
@@ -7111,7 +7111,7 @@ function BarChart({
|
|
|
7111
7111
|
{
|
|
7112
7112
|
data: data.map((d) => ({ ...d })),
|
|
7113
7113
|
layout,
|
|
7114
|
-
margin: { top: 4, right: lineDataKey ? 8 : 4, left:
|
|
7114
|
+
margin: { top: 4, right: lineDataKey ? 8 : 4, left: 0, bottom: 0 },
|
|
7115
7115
|
barSize,
|
|
7116
7116
|
maxBarSize,
|
|
7117
7117
|
barCategoryGap,
|
|
@@ -7119,13 +7119,14 @@ function BarChart({
|
|
|
7119
7119
|
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7120
7120
|
isVertical ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7121
7121
|
/* @__PURE__ */ jsx(XAxis, { type: "number", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7122
|
-
/* @__PURE__ */ jsx(YAxis, { type: "category", dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
|
|
7122
|
+
/* @__PURE__ */ jsx(YAxis, { width: "auto", type: "category", dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false })
|
|
7123
7123
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
7124
7124
|
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7125
|
-
/* @__PURE__ */ jsx(YAxis, { yAxisId: "left", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7125
|
+
/* @__PURE__ */ jsx(YAxis, { width: "auto", yAxisId: "left", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7126
7126
|
lineDataKey && /* @__PURE__ */ jsx(
|
|
7127
7127
|
YAxis,
|
|
7128
7128
|
{
|
|
7129
|
+
width: "auto",
|
|
7129
7130
|
yAxisId: "right",
|
|
7130
7131
|
orientation: "right",
|
|
7131
7132
|
tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" },
|
|
@@ -7200,10 +7201,10 @@ function LineChart({
|
|
|
7200
7201
|
const keys = Array.isArray(dataKey) ? dataKey : [dataKey];
|
|
7201
7202
|
const curve = curved ? "monotone" : "linear";
|
|
7202
7203
|
const dash = dotted ? "4 4" : void 0;
|
|
7203
|
-
return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(LineChart$1, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left:
|
|
7204
|
+
return /* @__PURE__ */ jsx("div", { className: cn("w-full overflow-hidden", className), style: { minWidth: 0 }, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(LineChart$1, { data: data.map((d) => ({ ...d })), margin: { top: 4, right: 4, left: 0, bottom: 0 }, children: [
|
|
7204
7205
|
showGrid && /* @__PURE__ */ jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "hsl(var(--border))" }),
|
|
7205
7206
|
/* @__PURE__ */ jsx(XAxis, { dataKey: xAxisKey, tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7206
|
-
/* @__PURE__ */ jsx(YAxis, { tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7207
|
+
/* @__PURE__ */ jsx(YAxis, { width: "auto", tick: { fontSize: 12, fill: "hsl(var(--muted-foreground))" }, axisLine: false, tickLine: false }),
|
|
7207
7208
|
showTooltip && /* @__PURE__ */ jsx(
|
|
7208
7209
|
Tooltip,
|
|
7209
7210
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otfdashkit/ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "OTF UI
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "OTF UI: 150+ React components for web apps (primitives, blocks, layouts and charts), themed by @otfdashkit/tokens. Works with Tailwind CSS v3 and v4. Shares component names and tokens with @otfdashkit/ui-native.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"otfdashkit",
|
|
7
7
|
"ui",
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
"design-system",
|
|
12
12
|
"radix",
|
|
13
13
|
"tailwind",
|
|
14
|
-
"tailwind-v4",
|
|
15
|
-
"shadcn",
|
|
16
14
|
"headless",
|
|
17
15
|
"accessible"
|
|
18
16
|
],
|
|
@@ -50,10 +50,10 @@ export function AreaChart({
|
|
|
50
50
|
return (
|
|
51
51
|
<div className={cn('w-full overflow-hidden', className)} style={{ minWidth: 0 }}>
|
|
52
52
|
<ResponsiveContainer width="100%" height={height}>
|
|
53
|
-
<RechartsAreaChart data={data.map((d) => ({ ...d }))} margin={{ top: 4, right: 4, left:
|
|
53
|
+
<RechartsAreaChart data={data.map((d) => ({ ...d }))} margin={{ top: 4, right: 4, left: 0, bottom: 0 }}>
|
|
54
54
|
{showGrid && <CartesianGrid strokeDasharray="3 3" stroke="hsl(var(--border))" />}
|
|
55
55
|
<XAxis dataKey={xAxisKey} tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
56
|
-
<YAxis tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
56
|
+
<YAxis width="auto" tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
57
57
|
{showTooltip && (
|
|
58
58
|
<Tooltip
|
|
59
59
|
contentStyle={{
|
package/src/charts/bar-chart.tsx
CHANGED
|
@@ -78,7 +78,7 @@ export function BarChart({
|
|
|
78
78
|
<Chart
|
|
79
79
|
data={data.map((d) => ({ ...d }))}
|
|
80
80
|
layout={layout}
|
|
81
|
-
margin={{ top: 4, right: lineDataKey ? 8 : 4, left:
|
|
81
|
+
margin={{ top: 4, right: lineDataKey ? 8 : 4, left: 0, bottom: 0 }}
|
|
82
82
|
barSize={barSize}
|
|
83
83
|
maxBarSize={maxBarSize}
|
|
84
84
|
barCategoryGap={barCategoryGap}
|
|
@@ -87,14 +87,14 @@ export function BarChart({
|
|
|
87
87
|
{isVertical ? (
|
|
88
88
|
<>
|
|
89
89
|
<XAxis type="number" tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
90
|
-
<YAxis type="category" dataKey={xAxisKey} tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
90
|
+
<YAxis width="auto" type="category" dataKey={xAxisKey} tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
91
91
|
</>
|
|
92
92
|
) : (
|
|
93
93
|
<>
|
|
94
94
|
<XAxis dataKey={xAxisKey} tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
95
|
-
<YAxis yAxisId="left" tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
95
|
+
<YAxis width="auto" yAxisId="left" tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
96
96
|
{lineDataKey && (
|
|
97
|
-
<YAxis
|
|
97
|
+
<YAxis width="auto"
|
|
98
98
|
yAxisId="right"
|
|
99
99
|
orientation="right"
|
|
100
100
|
tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }}
|
|
@@ -55,10 +55,10 @@ export function LineChart({
|
|
|
55
55
|
return (
|
|
56
56
|
<div className={cn('w-full overflow-hidden', className)} style={{ minWidth: 0 }}>
|
|
57
57
|
<ResponsiveContainer width="100%" height={height}>
|
|
58
|
-
<RechartsLineChart data={data.map((d) => ({ ...d }))} margin={{ top: 4, right: 4, left:
|
|
58
|
+
<RechartsLineChart data={data.map((d) => ({ ...d }))} margin={{ top: 4, right: 4, left: 0, bottom: 0 }}>
|
|
59
59
|
{showGrid && <CartesianGrid strokeDasharray="3 3" stroke="hsl(var(--border))" />}
|
|
60
60
|
<XAxis dataKey={xAxisKey} tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
61
|
-
<YAxis tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
61
|
+
<YAxis width="auto" tick={{ fontSize: 12, fill: 'hsl(var(--muted-foreground))' }} axisLine={false} tickLine={false} />
|
|
62
62
|
{showTooltip && (
|
|
63
63
|
<Tooltip
|
|
64
64
|
contentStyle={{
|