From 5f58d23026fb2a6b1b926352907bfee364063f40 Mon Sep 17 00:00:00 2001 From: zernonia Date: Tue, 16 Apr 2024 12:13:31 +0800 Subject: [PATCH] chore: build registry --- apps/www/src/public/registry/index.json | 3 ++- apps/www/src/public/registry/styles/default/chart-area.json | 2 +- apps/www/src/public/registry/styles/default/chart-bar.json | 2 +- .../www/src/public/registry/styles/default/chart-donut.json | 4 ++-- apps/www/src/public/registry/styles/default/chart-line.json | 2 +- apps/www/src/public/registry/styles/default/chart.json | 6 +++++- .../www/src/public/registry/styles/new-york/chart-area.json | 2 +- apps/www/src/public/registry/styles/new-york/chart-bar.json | 2 +- .../src/public/registry/styles/new-york/chart-donut.json | 2 +- .../www/src/public/registry/styles/new-york/chart-line.json | 2 +- apps/www/src/public/registry/styles/new-york/chart.json | 6 +++++- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/apps/www/src/public/registry/index.json b/apps/www/src/public/registry/index.json index 11ae47b5..39d6a69e 100644 --- a/apps/www/src/public/registry/index.json +++ b/apps/www/src/public/registry/index.json @@ -195,7 +195,8 @@ "ui/chart/ChartLegend.vue", "ui/chart/ChartSingleTooltip.vue", "ui/chart/ChartTooltip.vue", - "ui/chart/index.ts" + "ui/chart/index.ts", + "ui/chart/interface.ts" ], "type": "components:ui" }, diff --git a/apps/www/src/public/registry/styles/default/chart-area.json b/apps/www/src/public/registry/styles/default/chart-area.json index 6ecb0121..de2e19fa 100644 --- a/apps/www/src/public/registry/styles/default/chart-area.json +++ b/apps/www/src/public/registry/styles/default/chart-area.json @@ -12,7 +12,7 @@ "files": [ { "name": "AreaChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/default/chart-bar.json b/apps/www/src/public/registry/styles/default/chart-bar.json index 66789a94..64a8406b 100644 --- a/apps/www/src/public/registry/styles/default/chart-bar.json +++ b/apps/www/src/public/registry/styles/default/chart-bar.json @@ -12,7 +12,7 @@ "files": [ { "name": "BarChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/default/chart-donut.json b/apps/www/src/public/registry/styles/default/chart-donut.json index da7339c3..1c8cdbce 100644 --- a/apps/www/src/public/registry/styles/default/chart-donut.json +++ b/apps/www/src/public/registry/styles/default/chart-donut.json @@ -12,7 +12,7 @@ "files": [ { "name": "DonutChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", @@ -20,4 +20,4 @@ } ], "type": "components:ui" -} \ No newline at end of file +} diff --git a/apps/www/src/public/registry/styles/default/chart-line.json b/apps/www/src/public/registry/styles/default/chart-line.json index 6a9aa146..0db8dff8 100644 --- a/apps/www/src/public/registry/styles/default/chart-line.json +++ b/apps/www/src/public/registry/styles/default/chart-line.json @@ -12,7 +12,7 @@ "files": [ { "name": "LineChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/default/chart.json b/apps/www/src/public/registry/styles/default/chart.json index 5f9e2190..081e0c4a 100644 --- a/apps/www/src/public/registry/styles/default/chart.json +++ b/apps/www/src/public/registry/styles/default/chart.json @@ -28,7 +28,11 @@ }, { "name": "index.ts", - "content": "export { default as ChartTooltip } from './ChartTooltip.vue'\nexport { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'\nexport { default as ChartLegend } from './ChartLegend.vue'\nexport { default as ChartCrosshair } from './ChartCrosshair.vue'\n\nexport function defaultColors(count: number = 3) {\n const quotient = Math.floor(count / 2)\n const remainder = count % 2\n\n const primaryCount = quotient + remainder\n const secondaryCount = quotient\n return [\n ...Array.from(Array(primaryCount).keys()).map(i => `hsl(var(--primary) / ${1 - (1 / primaryCount) * i})`),\n ...Array.from(Array(secondaryCount).keys()).map(i => `hsl(var(--vis-secondary-color) / ${1 - (1 / secondaryCount) * i})`),\n ]\n}\n" + "content": "export { default as ChartTooltip } from './ChartTooltip.vue'\nexport { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'\nexport { default as ChartLegend } from './ChartLegend.vue'\nexport { default as ChartCrosshair } from './ChartCrosshair.vue'\n\nexport function defaultColors(count: number = 3) {\n const quotient = Math.floor(count / 2)\n const remainder = count % 2\n\n const primaryCount = quotient + remainder\n const secondaryCount = quotient\n return [\n ...Array.from(Array(primaryCount).keys()).map(i => `hsl(var(--primary) / ${1 - (1 / primaryCount) * i})`),\n ...Array.from(Array(secondaryCount).keys()).map(i => `hsl(var(--vis-secondary-color) / ${1 - (1 / secondaryCount) * i})`),\n ]\n}\n\nexport * from './interface'\n" + }, + { + "name": "interface.ts", + "content": "import type { Spacing } from '@unovis/ts'\n\ntype KeyOf> = Extract\n\nexport interface BaseChartProps> {\n /**\n * The source data, in which each entry is a dictionary.\n */\n data: T[]\n /**\n * Select the categories from your data. Used to populate the legend and toolip.\n */\n categories: KeyOf[]\n /**\n * Sets the key to map the data to the axis.\n */\n index: KeyOf\n /**\n * Change the default colors.\n */\n colors?: string[]\n /**\n * Margin of each the container\n */\n margin?: Spacing\n /**\n * Change the opacity of the non-selected field\n * @default 0.2\n */\n filterOpacity?: number\n /**\n * Function to format X label\n */\n xFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string\n /**\n * Function to format Y label\n */\n yFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string\n /**\n * Controls the visibility of the X axis.\n * @default true\n */\n showXAxis?: boolean\n /**\n * Controls the visibility of the Y axis.\n * @default true\n */\n showYAxis?: boolean\n /**\n * Controls the visibility of tooltip.\n * @default true\n */\n showTooltip?: boolean\n /**\n * Controls the visibility of legend.\n * @default true\n */\n showLegend?: boolean\n /**\n * Controls the visibility of gridline.\n * @default true\n */\n showGridLine?: boolean\n}\n" } ], "type": "components:ui" diff --git a/apps/www/src/public/registry/styles/new-york/chart-area.json b/apps/www/src/public/registry/styles/new-york/chart-area.json index 9088bc8d..f2191b07 100644 --- a/apps/www/src/public/registry/styles/new-york/chart-area.json +++ b/apps/www/src/public/registry/styles/new-york/chart-area.json @@ -12,7 +12,7 @@ "files": [ { "name": "AreaChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/new-york/chart-bar.json b/apps/www/src/public/registry/styles/new-york/chart-bar.json index 5187fcc7..bcfdac88 100644 --- a/apps/www/src/public/registry/styles/new-york/chart-bar.json +++ b/apps/www/src/public/registry/styles/new-york/chart-bar.json @@ -12,7 +12,7 @@ "files": [ { "name": "BarChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/new-york/chart-donut.json b/apps/www/src/public/registry/styles/new-york/chart-donut.json index dfd814d8..09ec7db9 100644 --- a/apps/www/src/public/registry/styles/new-york/chart-donut.json +++ b/apps/www/src/public/registry/styles/new-york/chart-donut.json @@ -12,7 +12,7 @@ "files": [ { "name": "DonutChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/new-york/chart-line.json b/apps/www/src/public/registry/styles/new-york/chart-line.json index f12153fb..508fd920 100644 --- a/apps/www/src/public/registry/styles/new-york/chart-line.json +++ b/apps/www/src/public/registry/styles/new-york/chart-line.json @@ -12,7 +12,7 @@ "files": [ { "name": "LineChart.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/new-york/chart.json b/apps/www/src/public/registry/styles/new-york/chart.json index 6bb3216c..7ca50ffd 100644 --- a/apps/www/src/public/registry/styles/new-york/chart.json +++ b/apps/www/src/public/registry/styles/new-york/chart.json @@ -28,7 +28,11 @@ }, { "name": "index.ts", - "content": "export { default as ChartTooltip } from './ChartTooltip.vue'\nexport { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'\nexport { default as ChartLegend } from './ChartLegend.vue'\nexport { default as ChartCrosshair } from './ChartCrosshair.vue'\n\nexport function defaultColors(count: number = 3) {\n const quotient = Math.floor(count / 2)\n const remainder = count % 2\n\n const primaryCount = quotient + remainder\n const secondaryCount = quotient\n return [\n ...Array.from(Array(primaryCount).keys()).map(i => `hsl(var(--primary) / ${1 - (1 / primaryCount) * i})`),\n ...Array.from(Array(secondaryCount).keys()).map(i => `hsl(var(--vis-secondary-color) / ${1 - (1 / secondaryCount) * i})`),\n ]\n}\n" + "content": "export { default as ChartTooltip } from './ChartTooltip.vue'\nexport { default as ChartSingleTooltip } from './ChartSingleTooltip.vue'\nexport { default as ChartLegend } from './ChartLegend.vue'\nexport { default as ChartCrosshair } from './ChartCrosshair.vue'\n\nexport function defaultColors(count: number = 3) {\n const quotient = Math.floor(count / 2)\n const remainder = count % 2\n\n const primaryCount = quotient + remainder\n const secondaryCount = quotient\n return [\n ...Array.from(Array(primaryCount).keys()).map(i => `hsl(var(--primary) / ${1 - (1 / primaryCount) * i})`),\n ...Array.from(Array(secondaryCount).keys()).map(i => `hsl(var(--vis-secondary-color) / ${1 - (1 / secondaryCount) * i})`),\n ]\n}\n\nexport * from './interface'\n" + }, + { + "name": "interface.ts", + "content": "import type { Spacing } from '@unovis/ts'\n\ntype KeyOf> = Extract\n\nexport interface BaseChartProps> {\n /**\n * The source data, in which each entry is a dictionary.\n */\n data: T[]\n /**\n * Select the categories from your data. Used to populate the legend and toolip.\n */\n categories: KeyOf[]\n /**\n * Sets the key to map the data to the axis.\n */\n index: KeyOf\n /**\n * Change the default colors.\n */\n colors?: string[]\n /**\n * Margin of each the container\n */\n margin?: Spacing\n /**\n * Change the opacity of the non-selected field\n * @default 0.2\n */\n filterOpacity?: number\n /**\n * Function to format X label\n */\n xFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string\n /**\n * Function to format Y label\n */\n yFormatter?: (tick: number | Date, i: number, ticks: number[] | Date[]) => string\n /**\n * Controls the visibility of the X axis.\n * @default true\n */\n showXAxis?: boolean\n /**\n * Controls the visibility of the Y axis.\n * @default true\n */\n showYAxis?: boolean\n /**\n * Controls the visibility of tooltip.\n * @default true\n */\n showTooltip?: boolean\n /**\n * Controls the visibility of legend.\n * @default true\n */\n showLegend?: boolean\n /**\n * Controls the visibility of gridline.\n * @default true\n */\n showGridLine?: boolean\n}\n" } ], "type": "components:ui"