@tipp/ui 1.0.8 → 1.0.9
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/charts/horizontal-bar-chart.cjs +10 -1
- package/dist/charts/horizontal-bar-chart.cjs.map +1 -1
- package/dist/charts/horizontal-bar-chart.js +1 -1
- package/dist/charts/index.cjs +10 -1
- package/dist/charts/index.cjs.map +1 -1
- package/dist/charts/index.js +1 -1
- package/dist/chunk-SGMO4KBC.js +27 -0
- package/dist/chunk-SGMO4KBC.js.map +1 -0
- package/package.json +3 -3
- package/src/charts/horizontal-bar-chart.tsx +6 -1
|
@@ -31,7 +31,16 @@ function HorizontalBarChart(props) {
|
|
|
31
31
|
{
|
|
32
32
|
className: "tipp_horizontal-bar-chart bar-wrapper",
|
|
33
33
|
style: { height, backgroundColor },
|
|
34
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
style: {
|
|
38
|
+
width: `${Math.round(value / total * 100)}%`,
|
|
39
|
+
height: "100%"
|
|
40
|
+
},
|
|
41
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bar", style: { backgroundColor: barColor } })
|
|
42
|
+
}
|
|
43
|
+
)
|
|
35
44
|
}
|
|
36
45
|
);
|
|
37
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/charts/horizontal-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface HorizontalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function HorizontalBarChart(\n props: HorizontalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_horizontal-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div
|
|
1
|
+
{"version":3,"sources":["../../src/charts/horizontal-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface HorizontalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function HorizontalBarChart(\n props: HorizontalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_horizontal-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div\n style={{\n width: `${Math.round((value / total) * 100)}%`,\n height: '100%',\n }}\n >\n <div className=\"bar\" style={{ backgroundColor: barColor }} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA8BQ;AAfD,SAAS,mBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,OAAO,GAAG,KAAK,MAAO,QAAQ,QAAS,GAAG,CAAC;AAAA,YAC3C,QAAQ;AAAA,UACV;AAAA,UAEA,sDAAC,SAAI,WAAU,OAAM,OAAO,EAAE,iBAAiB,SAAS,GAAG;AAAA;AAAA,MAC7D;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/dist/charts/index.cjs
CHANGED
|
@@ -232,7 +232,16 @@ function HorizontalBarChart(props) {
|
|
|
232
232
|
{
|
|
233
233
|
className: "tipp_horizontal-bar-chart bar-wrapper",
|
|
234
234
|
style: { height, backgroundColor },
|
|
235
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
235
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
style: {
|
|
239
|
+
width: `${Math.round(value / total * 100)}%`,
|
|
240
|
+
height: "100%"
|
|
241
|
+
},
|
|
242
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "bar", style: { backgroundColor: barColor } })
|
|
243
|
+
}
|
|
244
|
+
)
|
|
236
245
|
}
|
|
237
246
|
);
|
|
238
247
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/charts/index.ts","../../src/charts/chart.tsx","../../src/charts/chart-theme.json","../../src/charts/horizontal-bar-chart.tsx"],"sourcesContent":["export * from './chart';\nexport * from './horizontal-bar-chart';\n","import React, { useMemo } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport ReactECharts from 'echarts-for-react';\nimport type { EChartOption } from 'echarts';\nimport { merge } from 'lodash-es';\nimport chartTheme from './chart-theme.json';\n\nexport { chartTheme };\n\nexport type ChartProps = Omit<\n React.ComponentProps<typeof ReactECharts>,\n 'option'\n> & {\n option: EChartOption;\n};\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 const option = useMemo(() => {\n const baseOption: EChartOption = {\n textStyle: { fontFamily: 'Noto Sans KR' },\n tooltip: { textStyle: { fontSize: 16 } },\n };\n return merge(baseOption, props.option);\n }, [props.option]);\n\n return (\n <div ref={ref} style={{ width: '100%', height: '100%' }}>\n <ReactECharts\n style={{ width, height }}\n theme={chartTheme}\n {...props}\n option={option}\n />\n </div>\n );\n}\n","{\n \"version\": 1,\n \"themeName\": \"customed\",\n \"theme\": {\n \"seriesCnt\": \"5\",\n \"backgroundColor\": \"rgba(0,0,0,0)\",\n \"titleColor\": \"#1c2024\",\n \"subtitleColor\": \"#8d8d8d\",\n \"textColorShow\": false,\n \"textColor\": \"#333\",\n \"markTextColor\": \"#ffffff\",\n \"color\": [\n \"#ffe629\",\n \"#3e63dd\",\n \"#ec9455\",\n \"#5bb98b\",\n \"#cb1d63\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\",\n \"#ea7ccc\"\n ],\n \"borderColor\": \"#8d8d8d\",\n \"borderWidth\": 0,\n \"visualMapColor\": [\"#bf444c\", \"#d88273\", \"#f6efa6\"],\n \"legendTextColor\": \"#1c2024\",\n \"kColor\": \"#eb5454\",\n \"kColor0\": \"#47b262\",\n \"kBorderColor\": \"#eb5454\",\n \"kBorderColor0\": \"#47b262\",\n \"kBorderWidth\": 1,\n \"lineWidth\": 2,\n \"symbolSize\": 4,\n \"symbol\": \"emptyCircle\",\n \"symbolBorderWidth\": 1,\n \"lineSmooth\": false,\n \"graphLineWidth\": 1,\n \"graphLineColor\": \"#aaa\",\n \"mapLabelColor\": \"#000\",\n \"mapLabelColorE\": \"rgb(100,0,0)\",\n \"mapBorderColor\": \"#444\",\n \"mapBorderColorE\": \"#444\",\n \"mapBorderWidth\": 0.5,\n \"mapBorderWidthE\": 1,\n \"mapAreaColor\": \"#eee\",\n \"mapAreaColorE\": \"rgba(255,215,0,0.8)\",\n \"axes\": [\n {\n \"type\": \"all\",\n \"name\": \"通用坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"category\",\n \"name\": \"类目坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"value\",\n \"name\": \"数值坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"log\",\n \"name\": \"对数坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"time\",\n \"name\": \"时间坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n }\n ],\n \"axisSeperateSetting\": true,\n \"toolboxColor\": \"#8d8d8d\",\n \"toolboxEmphasisColor\": \"#1c2024\",\n \"tooltipAxisColor\": \"#cccccc\",\n \"tooltipAxisWidth\": 1,\n \"timelineLineColor\": \"#dae1f5\",\n \"timelineLineWidth\": 2,\n \"timelineItemColor\": \"#a4b1d7\",\n \"timelineItemColorE\": \"#ffffff\",\n \"timelineCheckColor\": \"#316bf3\",\n \"timelineCheckBorderColor\": \"#ffffff\",\n \"timelineItemBorderWidth\": 1,\n \"timelineControlColor\": \"#a4b1d7\",\n \"timelineControlBorderColor\": \"#a4b1d7\",\n \"timelineControlBorderWidth\": 1,\n \"timelineLabelColor\": \"#a4b1d7\"\n }\n}\n","import React from 'react';\n\nexport interface HorizontalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function HorizontalBarChart(\n props: HorizontalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_horizontal-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div style={{ width: `${Math.round((value / total) * 100)}%`, height }}>\n <div className=\"bar\" style={{ backgroundColor: barColor }} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAA+B;AAC/B,mCAAkC;AAClC,+BAAyB;AAEzB,uBAAsB;;;ACJtB;AAAA,EACE,SAAW;AAAA,EACX,WAAa;AAAA,EACb,OAAS;AAAA,IACP,WAAa;AAAA,IACb,iBAAmB;AAAA,IACnB,YAAc;AAAA,IACd,eAAiB;AAAA,IACjB,eAAiB;AAAA,IACjB,WAAa;AAAA,IACb,eAAiB;AAAA,IACjB,OAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,aAAe;A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AQ,MAAM;AAC3B,UAAM,aAA2B;AAAA,MAC/B,WAAW,EAAE,YAAY,eAAe;AAAA,MACxC,SAAS,EAAE,WAAW,EAAE,UAAU,GAAG,EAAE;AAAA,IACzC;AACA,eAAO,wBAAM,YAAY,MAAM,MAAM;AAAA,EACvC,GAAG,CAAC,MAAM,MAAM,CAAC;AAEjB,SACE,4CAAC,SAAI,KAAU,OAAO,EAAE,OAAO,QAAQ,QAAQ,OAAO,GACpD;AAAA,IAAC,yBAAAA;AAAA,IAAA;AAAA,MACC,OAAO,EAAE,OAAO,OAAO;AAAA,MACvB,OAAO;AAAA,OACH,QAHL;AAAA,MAIC;AAAA;AAAA,EACF,GACF;AAEJ;;;AEhBQ,IAAAC,sBAAA;AAVD,SAAS,mBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC,uDAAC,SAAI,OAAO,EAAE,OAAO,GAAG,KAAK,MAAO,QAAQ,QAAS,GAAG,CAAC,KAAK,OAAO,GACnE,uDAAC,SAAI,WAAU,OAAM,OAAO,EAAE,iBAAiB,SAAS,GAAG,GAC7D;AAAA;AAAA,EACF;AAEJ;","names":["ReactECharts","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/charts/index.ts","../../src/charts/chart.tsx","../../src/charts/chart-theme.json","../../src/charts/horizontal-bar-chart.tsx"],"sourcesContent":["export * from './chart';\nexport * from './horizontal-bar-chart';\n","import React, { useMemo } from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\nimport ReactECharts from 'echarts-for-react';\nimport type { EChartOption } from 'echarts';\nimport { merge } from 'lodash-es';\nimport chartTheme from './chart-theme.json';\n\nexport { chartTheme };\n\nexport type ChartProps = Omit<\n React.ComponentProps<typeof ReactECharts>,\n 'option'\n> & {\n option: EChartOption;\n};\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 const option = useMemo(() => {\n const baseOption: EChartOption = {\n textStyle: { fontFamily: 'Noto Sans KR' },\n tooltip: { textStyle: { fontSize: 16 } },\n };\n return merge(baseOption, props.option);\n }, [props.option]);\n\n return (\n <div ref={ref} style={{ width: '100%', height: '100%' }}>\n <ReactECharts\n style={{ width, height }}\n theme={chartTheme}\n {...props}\n option={option}\n />\n </div>\n );\n}\n","{\n \"version\": 1,\n \"themeName\": \"customed\",\n \"theme\": {\n \"seriesCnt\": \"5\",\n \"backgroundColor\": \"rgba(0,0,0,0)\",\n \"titleColor\": \"#1c2024\",\n \"subtitleColor\": \"#8d8d8d\",\n \"textColorShow\": false,\n \"textColor\": \"#333\",\n \"markTextColor\": \"#ffffff\",\n \"color\": [\n \"#ffe629\",\n \"#3e63dd\",\n \"#ec9455\",\n \"#5bb98b\",\n \"#cb1d63\",\n \"#3ba272\",\n \"#fc8452\",\n \"#9a60b4\",\n \"#ea7ccc\"\n ],\n \"borderColor\": \"#8d8d8d\",\n \"borderWidth\": 0,\n \"visualMapColor\": [\"#bf444c\", \"#d88273\", \"#f6efa6\"],\n \"legendTextColor\": \"#1c2024\",\n \"kColor\": \"#eb5454\",\n \"kColor0\": \"#47b262\",\n \"kBorderColor\": \"#eb5454\",\n \"kBorderColor0\": \"#47b262\",\n \"kBorderWidth\": 1,\n \"lineWidth\": 2,\n \"symbolSize\": 4,\n \"symbol\": \"emptyCircle\",\n \"symbolBorderWidth\": 1,\n \"lineSmooth\": false,\n \"graphLineWidth\": 1,\n \"graphLineColor\": \"#aaa\",\n \"mapLabelColor\": \"#000\",\n \"mapLabelColorE\": \"rgb(100,0,0)\",\n \"mapBorderColor\": \"#444\",\n \"mapBorderColorE\": \"#444\",\n \"mapBorderWidth\": 0.5,\n \"mapBorderWidthE\": 1,\n \"mapAreaColor\": \"#eee\",\n \"mapAreaColorE\": \"rgba(255,215,0,0.8)\",\n \"axes\": [\n {\n \"type\": \"all\",\n \"name\": \"通用坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"category\",\n \"name\": \"类目坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"value\",\n \"name\": \"数值坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"log\",\n \"name\": \"对数坐标轴\",\n \"axisLineShow\": false,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": false,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": true,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n },\n {\n \"type\": \"time\",\n \"name\": \"时间坐标轴\",\n \"axisLineShow\": true,\n \"axisLineColor\": \"#6E7079\",\n \"axisTickShow\": true,\n \"axisTickColor\": \"#6E7079\",\n \"axisLabelShow\": true,\n \"axisLabelColor\": \"#6E7079\",\n \"splitLineShow\": false,\n \"splitLineColor\": [\"#E0E6F1\"],\n \"splitAreaShow\": false,\n \"splitAreaColor\": [\"rgba(250,250,250,0.2)\", \"rgba(210,219,238,0.2)\"]\n }\n ],\n \"axisSeperateSetting\": true,\n \"toolboxColor\": \"#8d8d8d\",\n \"toolboxEmphasisColor\": \"#1c2024\",\n \"tooltipAxisColor\": \"#cccccc\",\n \"tooltipAxisWidth\": 1,\n \"timelineLineColor\": \"#dae1f5\",\n \"timelineLineWidth\": 2,\n \"timelineItemColor\": \"#a4b1d7\",\n \"timelineItemColorE\": \"#ffffff\",\n \"timelineCheckColor\": \"#316bf3\",\n \"timelineCheckBorderColor\": \"#ffffff\",\n \"timelineItemBorderWidth\": 1,\n \"timelineControlColor\": \"#a4b1d7\",\n \"timelineControlBorderColor\": \"#a4b1d7\",\n \"timelineControlBorderWidth\": 1,\n \"timelineLabelColor\": \"#a4b1d7\"\n }\n}\n","import React from 'react';\n\nexport interface HorizontalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function HorizontalBarChart(\n props: HorizontalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_horizontal-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div\n style={{\n width: `${Math.round((value / total) * 100)}%`,\n height: '100%',\n }}\n >\n <div className=\"bar\" style={{ backgroundColor: barColor }} />\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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DAAC,SAAI,WAAU,OAAM,OAAO,EAAE,iBAAiB,SAAS,GAAG;AAAA;AAAA,MAC7D;AAAA;AAAA,EACF;AAEJ;","names":["ReactECharts","import_jsx_runtime"]}
|
package/dist/charts/index.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// src/charts/horizontal-bar-chart.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
function HorizontalBarChart(props) {
|
|
4
|
+
const { total, value, backgroundColor, barColor, height } = props;
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"div",
|
|
7
|
+
{
|
|
8
|
+
className: "tipp_horizontal-bar-chart bar-wrapper",
|
|
9
|
+
style: { height, backgroundColor },
|
|
10
|
+
children: /* @__PURE__ */ jsx(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
style: {
|
|
14
|
+
width: `${Math.round(value / total * 100)}%`,
|
|
15
|
+
height: "100%"
|
|
16
|
+
},
|
|
17
|
+
children: /* @__PURE__ */ jsx("div", { className: "bar", style: { backgroundColor: barColor } })
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {
|
|
25
|
+
HorizontalBarChart
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=chunk-SGMO4KBC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/horizontal-bar-chart.tsx"],"sourcesContent":["import React from 'react';\n\nexport interface HorizontalBarChartProps {\n /** 100% 바가 뜻하는 전체 값 */\n total: number;\n /** 화면에 채워져보이는 값 */\n value: number;\n /** 배경 색상 */\n backgroundColor?: string;\n /** 바의 색상 */\n barColor?: string;\n /** 바의 높이 */\n height?: number;\n}\n\nexport function HorizontalBarChart(\n props: HorizontalBarChartProps\n): React.ReactNode {\n const { total, value, backgroundColor, barColor, height } = props;\n return (\n <div\n className=\"tipp_horizontal-bar-chart bar-wrapper\"\n style={{ height, backgroundColor }}\n >\n <div\n style={{\n width: `${Math.round((value / total) * 100)}%`,\n height: '100%',\n }}\n >\n <div className=\"bar\" style={{ backgroundColor: barColor }} />\n </div>\n </div>\n );\n}\n"],"mappings":";AA8BQ;AAfD,SAAS,mBACd,OACiB;AACjB,QAAM,EAAE,OAAO,OAAO,iBAAiB,UAAU,OAAO,IAAI;AAC5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,OAAO,EAAE,QAAQ,gBAAgB;AAAA,MAEjC;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,YACL,OAAO,GAAG,KAAK,MAAO,QAAQ,QAAS,GAAG,CAAC;AAAA,YAC3C,QAAQ;AAAA,UACV;AAAA,UAEA,8BAAC,SAAI,WAAU,OAAM,OAAO,EAAE,iBAAiB,SAAS,GAAG;AAAA;AAAA,MAC7D;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tipp/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"postcss-nesting": "12.0.2",
|
|
84
84
|
"tsup": "^8.0.2",
|
|
85
85
|
"typescript": "^5.3.3",
|
|
86
|
-
"@tipp/
|
|
87
|
-
"@tipp/
|
|
86
|
+
"@tipp/typescript-config": "0.0.4",
|
|
87
|
+
"@tipp/eslint-config": "0.2.3"
|
|
88
88
|
},
|
|
89
89
|
"scripts": {
|
|
90
90
|
"build": "pnpm run build:js & pnpm run build:css",
|
|
@@ -22,7 +22,12 @@ export function HorizontalBarChart(
|
|
|
22
22
|
className="tipp_horizontal-bar-chart bar-wrapper"
|
|
23
23
|
style={{ height, backgroundColor }}
|
|
24
24
|
>
|
|
25
|
-
<div
|
|
25
|
+
<div
|
|
26
|
+
style={{
|
|
27
|
+
width: `${Math.round((value / total) * 100)}%`,
|
|
28
|
+
height: '100%',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
26
31
|
<div className="bar" style={{ backgroundColor: barColor }} />
|
|
27
32
|
</div>
|
|
28
33
|
</div>
|