@deepnoid/ui 0.1.118 → 0.1.119

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/dist/index.js CHANGED
@@ -12078,7 +12078,7 @@ CircularProgress.displayName = "CircularProgress";
12078
12078
  var circularProgress_default = CircularProgress;
12079
12079
  var circularProgressStyle = tv({
12080
12080
  slots: {
12081
- base: ["flex", "flex-col", "items-center", "gap-[20px]"],
12081
+ base: ["flex", "flex-col", "items-center", "gap-[20px]", "select-none"],
12082
12082
  background: ["fill-body-background", "border-neutral-light"],
12083
12083
  progress: ["transition-all", "duration-1000 ease-out"],
12084
12084
  percentage: ["text-xl", "font-bold", "text-body-foreground"],
@@ -12159,67 +12159,75 @@ var AreaChartComponent = (0, import_react39.forwardRef)((originalProps, ref) =>
12159
12159
  };
12160
12160
  return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12161
12161
  label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label }),
12162
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_recharts2.AreaChart, { data, margin: { left: -30 }, children: [
12163
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
12164
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
12165
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
12166
- ] }) }),
12167
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12168
- import_recharts2.CartesianGrid,
12169
- {
12170
- vertical: true,
12171
- horizontal: false,
12172
- strokeDasharray: "3 3",
12173
- className: "stroke-neutral-light",
12174
- verticalPoints: tickPositions
12175
- }
12176
- ),
12177
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12178
- import_recharts2.XAxis,
12179
- {
12180
- dataKey: "name",
12181
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12182
- tickLine: false,
12183
- tick: CustomTick,
12184
- padding: { left: 35.5, right: 35.5 }
12185
- }
12186
- ),
12187
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12188
- import_recharts2.YAxis,
12189
- {
12190
- axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12191
- tickLine: false,
12192
- tick: {
12193
- fontSize: 12,
12194
- fontWeight: 700,
12195
- fill: "text-body-foreground",
12196
- textAnchor: "middle",
12197
- dx: -10
12198
- },
12199
- ticks: [0, 20, 40, 60, 80, 100],
12200
- domain: [-6, 110]
12201
- }
12202
- ),
12203
- /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12204
- import_recharts2.Area,
12205
- {
12206
- type: "monotone",
12207
- dataKey: "value",
12208
- stroke: colorHex,
12209
- strokeWidth: 2,
12210
- fill: `url(#colorGradient-${uniqueId})`,
12211
- dot: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
12212
- activeDot: { r: 7, fill: colorHex }
12213
- }
12214
- )
12215
- ] }) })
12162
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_recharts2.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
12163
+ import_recharts2.AreaChart,
12164
+ {
12165
+ data,
12166
+ margin: { left: -30 },
12167
+ className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
12168
+ children: [
12169
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("linearGradient", { id: `colorGradient-${uniqueId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
12170
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "5%", stopColor: colorHex, stopOpacity: 0.3 }),
12171
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("stop", { offset: "95%", stopColor: colorHex, stopOpacity: 0 })
12172
+ ] }) }),
12173
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12174
+ import_recharts2.CartesianGrid,
12175
+ {
12176
+ vertical: true,
12177
+ horizontal: false,
12178
+ strokeDasharray: "3 3",
12179
+ className: "stroke-neutral-light",
12180
+ verticalPoints: tickPositions
12181
+ }
12182
+ ),
12183
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12184
+ import_recharts2.XAxis,
12185
+ {
12186
+ dataKey: "name",
12187
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12188
+ tickLine: false,
12189
+ tick: CustomTick,
12190
+ padding: { left: 35.5, right: 35.5 }
12191
+ }
12192
+ ),
12193
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12194
+ import_recharts2.YAxis,
12195
+ {
12196
+ axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12197
+ tickLine: false,
12198
+ tick: {
12199
+ fontSize: 12,
12200
+ fontWeight: 700,
12201
+ fill: "text-body-foreground",
12202
+ textAnchor: "middle",
12203
+ dx: -10
12204
+ },
12205
+ ticks: [0, 20, 40, 60, 80, 100],
12206
+ domain: [-6, 110]
12207
+ }
12208
+ ),
12209
+ /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
12210
+ import_recharts2.Area,
12211
+ {
12212
+ type: "monotone",
12213
+ dataKey: "value",
12214
+ stroke: colorHex,
12215
+ strokeWidth: 2,
12216
+ fill: `url(#colorGradient-${uniqueId})`,
12217
+ dot: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(CustomDotWithShadow, { stroke: colorHex, fill: colorHex }),
12218
+ activeDot: { r: 7, fill: colorHex }
12219
+ }
12220
+ )
12221
+ ]
12222
+ }
12223
+ ) })
12216
12224
  ] });
12217
12225
  });
12218
12226
  AreaChartComponent.displayName = "AreaChart";
12219
12227
  var areaChart_default = AreaChartComponent;
12220
12228
  var areaChartStyle = tv({
12221
12229
  slots: {
12222
- base: ["flex", "flex-col", "gap-[10px]"],
12230
+ base: ["flex", "flex-col", "gap-[10px]", "select-none"],
12223
12231
  color: [],
12224
12232
  axis: ["text-sm", "font-bold", "text-center", "text-body-foreground"],
12225
12233
  label: ["text-md", "font-bold", "text-body-foreground"]
@@ -12245,13 +12253,16 @@ var import_recharts3 = require("recharts");
12245
12253
  var import_jsx_runtime43 = require("react/jsx-runtime");
12246
12254
  var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12247
12255
  const [props, variantProps] = mapPropsVariants(originalProps, barChartStyle.variantKeys);
12248
- const { data, label, classNames } = { ...props, ...variantProps };
12256
+ const {
12257
+ data,
12258
+ label,
12259
+ classNames,
12260
+ yAxisTicks = [0, 20, 40, 60, 80, 100],
12261
+ yAxisTickFormatter = (value) => `${value}%`,
12262
+ yAxisDomain = [-6, 110],
12263
+ customTooltip
12264
+ } = { ...props, ...variantProps };
12249
12265
  const slots = (0, import_react40.useMemo)(() => barChartStyle({ ...variantProps }), [variantProps]);
12250
- const COLOR_MAP = {
12251
- primary: "#C7E5FA",
12252
- secondary: "#92DCB2",
12253
- warning: "#DEC1FA"
12254
- };
12255
12266
  const [tickPositions, setTickPositions] = (0, import_react40.useState)([]);
12256
12267
  const tickRef = (0, import_react40.useRef)([]);
12257
12268
  const CustomBarShape = (barProps) => {
@@ -12287,6 +12298,28 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12287
12298
  }
12288
12299
  );
12289
12300
  };
12301
+ const CustomYAxisTick = ({ x, y, payload }) => {
12302
+ return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12303
+ "text",
12304
+ {
12305
+ x: x - 10,
12306
+ y,
12307
+ textAnchor: "middle",
12308
+ fontSize: 12,
12309
+ fontWeight: 700,
12310
+ fill: "currentColor",
12311
+ className: "text-body-foreground",
12312
+ dy: 4,
12313
+ children: yAxisTickFormatter(payload.value)
12314
+ }
12315
+ );
12316
+ };
12317
+ const CustomTooltip = ({ active, payload, label: label2 }) => {
12318
+ if (customTooltip && active && payload && payload.length) {
12319
+ return customTooltip({ active, payload, label: label2 });
12320
+ }
12321
+ return null;
12322
+ };
12290
12323
  (0, import_react40.useEffect)(() => {
12291
12324
  const raf = requestAnimationFrame(() => {
12292
12325
  const unique = [...new Set(tickRef.current)].sort((a, b) => a - b);
@@ -12305,11 +12338,25 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12305
12338
  import_recharts3.BarChart,
12306
12339
  {
12307
12340
  data,
12308
- margin: { left: -30 },
12341
+ margin: { left: -20 },
12309
12342
  barSize: 20,
12310
- barGap: 10,
12343
+ barGap: 20,
12311
12344
  className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
12312
12345
  children: [
12346
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("defs", { children: [
12347
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("linearGradient", { id: "blueGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
12348
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "0%", stopColor: "#DEC1FA" }),
12349
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "100%", stopColor: "#3F9CF2" })
12350
+ ] }),
12351
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("linearGradient", { id: "greenGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
12352
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "0%", stopColor: "#C2E59C" }),
12353
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "100%", stopColor: "#64B3F4" })
12354
+ ] }),
12355
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("linearGradient", { id: "pinkGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [
12356
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "0%", stopColor: "#DDD6F3" }),
12357
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("stop", { offset: "100%", stopColor: "#FAACA8" })
12358
+ ] })
12359
+ ] }),
12313
12360
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12314
12361
  import_recharts3.CartesianGrid,
12315
12362
  {
@@ -12323,7 +12370,7 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12323
12370
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
12324
12371
  import_recharts3.XAxis,
12325
12372
  {
12326
- dataKey: "name",
12373
+ dataKey: "title",
12327
12374
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12328
12375
  tickLine: false,
12329
12376
  tick: CustomTick,
@@ -12335,20 +12382,15 @@ var BarChartComponent = (0, import_react40.forwardRef)((originalProps, ref) => {
12335
12382
  {
12336
12383
  axisLine: { stroke: "#DFE2E7", strokeWidth: 1 },
12337
12384
  tickLine: false,
12338
- tick: {
12339
- fontSize: 12,
12340
- fontWeight: 700,
12341
- fill: "text-body-foreground",
12342
- textAnchor: "middle",
12343
- dx: -10
12344
- },
12345
- ticks: [0, 20, 40, 60, 80, 100],
12346
- domain: [-6, 110]
12385
+ tick: CustomYAxisTick,
12386
+ ticks: yAxisTicks,
12387
+ domain: yAxisDomain
12347
12388
  }
12348
12389
  ),
12349
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "avg", fill: COLOR_MAP.primary, width: 20, shape: CustomBarShape }),
12350
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "high", fill: COLOR_MAP.secondary, width: 20, shape: CustomBarShape }),
12351
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "low", fill: COLOR_MAP.warning, width: 20, shape: CustomBarShape })
12390
+ customTooltip && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Tooltip, { content: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(CustomTooltip, {}), cursor: { fill: "transparent" } }),
12391
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "blue", fill: "url(#blueGradient)", width: 20, shape: CustomBarShape }),
12392
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "green", fill: "url(#greenGradient)", width: 20, shape: CustomBarShape }),
12393
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_recharts3.Bar, { dataKey: "pink", fill: "url(#pinkGradient)", width: 20, shape: CustomBarShape })
12352
12394
  ]
12353
12395
  }
12354
12396
  ) })
@@ -12380,31 +12422,39 @@ var RadarChart = (0, import_react41.forwardRef)((originalProps, ref) => {
12380
12422
  return Math.max(...data.map((item) => item.fullMark || 100));
12381
12423
  }, [data]);
12382
12424
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { ref, className: slots.base({ class: classNames == null ? void 0 : classNames.base }), children: [
12383
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.ResponsiveContainer, { width: 580, height: 330, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_recharts4.RadarChart, { data, outerRadius: "80%", children: [
12384
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.PolarGrid, { stroke: "#DFE2E7", strokeWidth: 1.75 }),
12385
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12386
- import_recharts4.PolarAngleAxis,
12387
- {
12388
- dataKey: "name",
12389
- tick: { fill: "#333", fontSize: 12, fontWeight: "bold" },
12390
- tickFormatter: (value) => value,
12391
- tickSize: 15
12392
- }
12393
- ),
12394
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.PolarRadiusAxis, { domain: [0, maxFullMark], tick: false, tickCount: 6, axisLine: false }),
12395
- /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12396
- import_recharts4.Radar,
12397
- {
12398
- name: label,
12399
- dataKey: "value",
12400
- stroke: "#3F9CF2",
12401
- fill: "#C7E5FA",
12402
- strokeWidth: 1.75,
12403
- dot: false,
12404
- activeDot: false
12405
- }
12406
- )
12407
- ] }) }),
12425
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.ResponsiveContainer, { width: 580, height: 330, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
12426
+ import_recharts4.RadarChart,
12427
+ {
12428
+ data,
12429
+ outerRadius: "80%",
12430
+ className: "[&_.recharts-surface]:outline-none [&_.recharts-surface]:focus:outline-none",
12431
+ children: [
12432
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.PolarGrid, { stroke: "#DFE2E7", strokeWidth: 1.75 }),
12433
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12434
+ import_recharts4.PolarAngleAxis,
12435
+ {
12436
+ dataKey: "name",
12437
+ tick: { fill: "#333", fontSize: 12, fontWeight: "bold" },
12438
+ tickFormatter: (value) => value,
12439
+ tickSize: 15
12440
+ }
12441
+ ),
12442
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_recharts4.PolarRadiusAxis, { domain: [0, maxFullMark], tick: false, tickCount: 6, axisLine: false }),
12443
+ /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
12444
+ import_recharts4.Radar,
12445
+ {
12446
+ name: label,
12447
+ dataKey: "value",
12448
+ stroke: "#3F9CF2",
12449
+ fill: "#EFF8FF",
12450
+ strokeWidth: 1.75,
12451
+ dot: false,
12452
+ activeDot: false
12453
+ }
12454
+ )
12455
+ ]
12456
+ }
12457
+ ) }),
12408
12458
  label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: slots.label({ class: classNames == null ? void 0 : classNames.label }), children: label })
12409
12459
  ] });
12410
12460
  });
@@ -12412,7 +12462,7 @@ RadarChart.displayName = "RadarChart";
12412
12462
  var radarChart_default = RadarChart;
12413
12463
  var radarChartStyle = tv({
12414
12464
  slots: {
12415
- base: ["flex", "flex-col", "items-center", "gap-[10px]"],
12465
+ base: ["flex", "flex-col", "items-center", "gap-[10px]", "select-none"],
12416
12466
  label: ["text-sm", "font-bold", "text-left", "text-body-foreground"]
12417
12467
  },
12418
12468
  variants: {},
package/dist/index.mjs CHANGED
@@ -103,16 +103,16 @@ import {
103
103
  import "./chunk-VYNBJBXD.mjs";
104
104
  import {
105
105
  areaChart_default
106
- } from "./chunk-WIZDHK4O.mjs";
106
+ } from "./chunk-QKRCC26D.mjs";
107
107
  import {
108
108
  barChart_default
109
- } from "./chunk-CF7LIQF6.mjs";
109
+ } from "./chunk-U33MTXQX.mjs";
110
110
  import {
111
111
  circularProgress_default
112
- } from "./chunk-KIN2UK2C.mjs";
112
+ } from "./chunk-VB5NKWJG.mjs";
113
113
  import {
114
114
  radarChart_default
115
- } from "./chunk-63KZGR73.mjs";
115
+ } from "./chunk-UA24L44Z.mjs";
116
116
  import "./chunk-QZ3LVYJW.mjs";
117
117
  import {
118
118
  checkbox_default
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/ui",
3
- "version": "0.1.118",
3
+ "version": "0.1.119",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "exports": {