@yamada-ui/react 2.1.0-next-20260227095059 → 2.1.0-next-20260301103253
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/cjs/components/chart/cartesian-chart.cjs +25 -10
- package/dist/cjs/components/chart/cartesian-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/chart.cjs +10 -5
- package/dist/cjs/components/chart/chart.cjs.map +1 -1
- package/dist/cjs/components/chart/donut-chart.cjs +1 -3
- package/dist/cjs/components/chart/donut-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/index.cjs +13 -0
- package/dist/cjs/components/chart/pie-chart.cjs +1 -3
- package/dist/cjs/components/chart/pie-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.cjs +140 -9
- package/dist/cjs/components/chart/polar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/polar-chart.style.cjs +13 -1
- package/dist/cjs/components/chart/polar-chart.style.cjs.map +1 -1
- package/dist/cjs/components/chart/radar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/radial-chart.cjs +57 -0
- package/dist/cjs/components/chart/radial-chart.cjs.map +1 -0
- package/dist/cjs/components/chart/radial-chart.namespace.cjs +29 -0
- package/dist/cjs/components/chart/radial-chart.namespace.cjs.map +1 -0
- package/dist/cjs/components/chart/radial-chart.style.cjs +15 -0
- package/dist/cjs/components/chart/radial-chart.style.cjs.map +1 -0
- package/dist/cjs/components/chart/use-pie-chart.cjs +1 -9
- package/dist/cjs/components/chart/use-pie-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-polar-chart.cjs +97 -0
- package/dist/cjs/components/chart/use-polar-chart.cjs.map +1 -1
- package/dist/cjs/components/chart/use-radial-chart.cjs +63 -0
- package/dist/cjs/components/chart/use-radial-chart.cjs.map +1 -0
- package/dist/cjs/components/color-swatch/color-swatch-group.cjs +6 -3
- package/dist/cjs/components/color-swatch/color-swatch-group.cjs.map +1 -1
- package/dist/cjs/components/dropzone/use-dropzone.cjs +18 -13
- package/dist/cjs/components/dropzone/use-dropzone.cjs.map +1 -1
- package/dist/cjs/components/file-button/use-file-button.cjs +2 -5
- package/dist/cjs/components/file-button/use-file-button.cjs.map +1 -1
- package/dist/cjs/components/file-input/use-file-input.cjs +7 -2
- package/dist/cjs/components/file-input/use-file-input.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/git-merge-conflict-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/git-merge-conflict-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/globe-off-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/globe-off-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/index.cjs +57 -6
- package/dist/cjs/components/icon/icons/index.cjs.map +1 -1
- package/dist/cjs/components/icon/icons/lens-concave-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/lens-concave-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/lens-convex-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/lens-convex-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/line-dot-right-horizontal-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/line-dot-right-horizontal-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/message-circle-check-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/message-circle-check-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/message-square-check-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/message-square-check-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/metronome-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/metronome-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mirror-rectangular-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/mirror-rectangular-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mirror-round-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/mirror-round-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mouse-left-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/mouse-left-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/mouse-right-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/mouse-right-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/shelving-unit-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/shelving-unit-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/square-arrow-right-enter-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/square-arrow-right-enter-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/square-arrow-right-exit-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/square-arrow-right-exit-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/square-centerline-dashed-horizontal-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/square-centerline-dashed-horizontal-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/square-centerline-dashed-vertical-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/square-centerline-dashed-vertical-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/towel-rack-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/towel-rack-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/icons/x-line-top-icon.cjs +17 -0
- package/dist/cjs/components/icon/icons/x-line-top-icon.cjs.map +1 -0
- package/dist/cjs/components/icon/index.cjs +38 -4
- package/dist/cjs/components/saturation-slider/use-saturation-slider.cjs +1 -1
- package/dist/cjs/components/slider/use-slider.cjs +1 -1
- package/dist/cjs/core/css/styles.cjs +1 -0
- package/dist/cjs/core/css/styles.cjs.map +1 -1
- package/dist/cjs/index.cjs +78 -9
- package/dist/cjs/providers/i18n-provider/intl/ar-AE.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/ar-AE.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/bg-BG.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/bg-BG.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/cs-CZ.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/cs-CZ.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/da-DK.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/da-DK.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/de-DE.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/de-DE.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/el-GR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/el-GR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/en-GB.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/en-GB.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/en-US.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/en-US.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/es-ES.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/es-ES.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/et-EE.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/et-EE.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/fi-FI.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/fi-FI.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/fr-CA.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/fr-CA.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/fr-FR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/fr-FR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/he-IL.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/he-IL.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/hr-HR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/hr-HR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/hu-HU.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/hu-HU.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/it-IT.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/it-IT.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/ja-JP.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/ja-JP.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/ko-KR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/ko-KR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/lt-LT.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/lt-LT.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/lv-LV.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/lv-LV.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/nl-NL.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/nl-NL.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/no-NO.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/no-NO.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/pl-PL.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/pl-PL.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/pt-BR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/pt-BR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/ro-RO.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/ro-RO.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/ru-RU.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/ru-RU.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/sk-SK.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/sk-SK.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/sl-SI.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/sl-SI.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/sr-RS.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/sr-RS.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/sv-SE.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/sv-SE.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/tr-TR.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/tr-TR.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/uk-UA.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/uk-UA.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/zh-CN.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/zh-CN.cjs.map +1 -1
- package/dist/cjs/providers/i18n-provider/intl/zh-TW.cjs +1 -0
- package/dist/cjs/providers/i18n-provider/intl/zh-TW.cjs.map +1 -1
- package/dist/esm/components/chart/cartesian-chart.js +25 -10
- package/dist/esm/components/chart/cartesian-chart.js.map +1 -1
- package/dist/esm/components/chart/chart.js +11 -6
- package/dist/esm/components/chart/chart.js.map +1 -1
- package/dist/esm/components/chart/donut-chart.js +1 -3
- package/dist/esm/components/chart/donut-chart.js.map +1 -1
- package/dist/esm/components/chart/index.js +6 -3
- package/dist/esm/components/chart/pie-chart.js +1 -3
- package/dist/esm/components/chart/pie-chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.js +142 -12
- package/dist/esm/components/chart/polar-chart.js.map +1 -1
- package/dist/esm/components/chart/polar-chart.style.js +13 -1
- package/dist/esm/components/chart/polar-chart.style.js.map +1 -1
- package/dist/esm/components/chart/radar-chart.js.map +1 -1
- package/dist/esm/components/chart/radial-chart.js +54 -0
- package/dist/esm/components/chart/radial-chart.js.map +1 -0
- package/dist/esm/components/chart/radial-chart.namespace.js +24 -0
- package/dist/esm/components/chart/radial-chart.namespace.js.map +1 -0
- package/dist/esm/components/chart/radial-chart.style.js +15 -0
- package/dist/esm/components/chart/radial-chart.style.js.map +1 -0
- package/dist/esm/components/chart/use-pie-chart.js +1 -9
- package/dist/esm/components/chart/use-pie-chart.js.map +1 -1
- package/dist/esm/components/chart/use-polar-chart.js +97 -1
- package/dist/esm/components/chart/use-polar-chart.js.map +1 -1
- package/dist/esm/components/chart/use-radial-chart.js +62 -0
- package/dist/esm/components/chart/use-radial-chart.js.map +1 -0
- package/dist/esm/components/color-swatch/color-swatch-group.js +6 -3
- package/dist/esm/components/color-swatch/color-swatch-group.js.map +1 -1
- package/dist/esm/components/dropzone/use-dropzone.js +18 -13
- package/dist/esm/components/dropzone/use-dropzone.js.map +1 -1
- package/dist/esm/components/file-button/use-file-button.js +2 -5
- package/dist/esm/components/file-button/use-file-button.js.map +1 -1
- package/dist/esm/components/file-input/use-file-input.js +7 -2
- package/dist/esm/components/file-input/use-file-input.js.map +1 -1
- package/dist/esm/components/icon/icons/git-merge-conflict-icon.js +16 -0
- package/dist/esm/components/icon/icons/git-merge-conflict-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/globe-off-icon.js +16 -0
- package/dist/esm/components/icon/icons/globe-off-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/index.js +39 -5
- package/dist/esm/components/icon/icons/index.js.map +1 -1
- package/dist/esm/components/icon/icons/lens-concave-icon.js +16 -0
- package/dist/esm/components/icon/icons/lens-concave-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/lens-convex-icon.js +16 -0
- package/dist/esm/components/icon/icons/lens-convex-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/line-dot-right-horizontal-icon.js +16 -0
- package/dist/esm/components/icon/icons/line-dot-right-horizontal-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/message-circle-check-icon.js +16 -0
- package/dist/esm/components/icon/icons/message-circle-check-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/message-square-check-icon.js +16 -0
- package/dist/esm/components/icon/icons/message-square-check-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/metronome-icon.js +16 -0
- package/dist/esm/components/icon/icons/metronome-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mirror-rectangular-icon.js +16 -0
- package/dist/esm/components/icon/icons/mirror-rectangular-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mirror-round-icon.js +16 -0
- package/dist/esm/components/icon/icons/mirror-round-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mouse-left-icon.js +16 -0
- package/dist/esm/components/icon/icons/mouse-left-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/mouse-right-icon.js +16 -0
- package/dist/esm/components/icon/icons/mouse-right-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/shelving-unit-icon.js +16 -0
- package/dist/esm/components/icon/icons/shelving-unit-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/square-arrow-right-enter-icon.js +16 -0
- package/dist/esm/components/icon/icons/square-arrow-right-enter-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/square-arrow-right-exit-icon.js +16 -0
- package/dist/esm/components/icon/icons/square-arrow-right-exit-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/square-centerline-dashed-horizontal-icon.js +16 -0
- package/dist/esm/components/icon/icons/square-centerline-dashed-horizontal-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/square-centerline-dashed-vertical-icon.js +16 -0
- package/dist/esm/components/icon/icons/square-centerline-dashed-vertical-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/towel-rack-icon.js +16 -0
- package/dist/esm/components/icon/icons/towel-rack-icon.js.map +1 -0
- package/dist/esm/components/icon/icons/x-line-top-icon.js +16 -0
- package/dist/esm/components/icon/icons/x-line-top-icon.js.map +1 -0
- package/dist/esm/components/icon/index.js +20 -3
- package/dist/esm/components/saturation-slider/use-saturation-slider.js +1 -1
- package/dist/esm/components/slider/use-slider.js +1 -1
- package/dist/esm/core/css/styles.js +1 -0
- package/dist/esm/core/css/styles.js.map +1 -1
- package/dist/esm/index.js +52 -10
- package/dist/esm/providers/i18n-provider/intl/ar-AE.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/ar-AE.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/bg-BG.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/bg-BG.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/cs-CZ.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/cs-CZ.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/da-DK.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/da-DK.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/de-DE.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/de-DE.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/el-GR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/el-GR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/en-GB.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/en-GB.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/en-US.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/en-US.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/es-ES.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/es-ES.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/et-EE.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/et-EE.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/fi-FI.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/fi-FI.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/fr-CA.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/fr-CA.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/fr-FR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/fr-FR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/he-IL.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/he-IL.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/hr-HR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/hr-HR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/hu-HU.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/hu-HU.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/it-IT.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/it-IT.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/ja-JP.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/ja-JP.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/ko-KR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/ko-KR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/lt-LT.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/lt-LT.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/lv-LV.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/lv-LV.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/nl-NL.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/nl-NL.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/no-NO.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/no-NO.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/pl-PL.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/pl-PL.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/pt-BR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/pt-BR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/ro-RO.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/ro-RO.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/ru-RU.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/ru-RU.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/sk-SK.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/sk-SK.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/sl-SI.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/sl-SI.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/sr-RS.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/sr-RS.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/sv-SE.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/sv-SE.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/tr-TR.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/tr-TR.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/uk-UA.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/uk-UA.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/zh-CN.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/zh-CN.js.map +1 -1
- package/dist/esm/providers/i18n-provider/intl/zh-TW.js +1 -0
- package/dist/esm/providers/i18n-provider/intl/zh-TW.js.map +1 -1
- package/dist/types/components/accordion/accordion.d.ts +4 -2
- package/dist/types/components/accordion/use-accordion.d.ts +11 -11
- package/dist/types/components/airy/airy.d.ts +3 -2
- package/dist/types/components/alert/alert.d.ts +5 -2
- package/dist/types/components/alpha-slider/alpha-slider.d.ts +3 -2
- package/dist/types/components/aspect-ratio/aspect-ratio.d.ts +2 -2
- package/dist/types/components/autocomplete/autocomplete.d.ts +4 -2
- package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
- package/dist/types/components/autocomplete/use-autocomplete.d.ts +7 -5
- package/dist/types/components/avatar/avatar.d.ts +5 -5
- package/dist/types/components/avatar/avatar.style.d.ts +1 -1
- package/dist/types/components/avatar/use-avatar-group.d.ts +2 -2
- package/dist/types/components/badge/badge.d.ts +2 -2
- package/dist/types/components/bleed/bleed.d.ts +2 -2
- package/dist/types/components/blockquote/blockquote.d.ts +2 -2
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/types/components/breadcrumb/use-breadcrumb.d.ts +2 -2
- package/dist/types/components/button/button-group.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +3 -2
- package/dist/types/components/button/icon-button.d.ts +2 -2
- package/dist/types/components/calendar/calendar.d.ts +3 -2
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/calendar/use-calendar.d.ts +9 -8
- package/dist/types/components/card/card.d.ts +2 -2
- package/dist/types/components/carousel/carousel.d.ts +3 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/carousel/use-carousel.d.ts +3 -3
- package/dist/types/components/center/center.d.ts +2 -2
- package/dist/types/components/chart/area-chart.d.ts +2 -2
- package/dist/types/components/chart/bar-chart.d.ts +2 -2
- package/dist/types/components/chart/chart.d.ts +8 -7
- package/dist/types/components/chart/donut-chart.d.ts +3 -3
- package/dist/types/components/chart/index.d.ts +6 -3
- package/dist/types/components/chart/line-chart.d.ts +2 -2
- package/dist/types/components/chart/pie-chart.d.ts +3 -3
- package/dist/types/components/chart/polar-chart.d.ts +141 -3
- package/dist/types/components/chart/polar-chart.style.d.ts +1 -1
- package/dist/types/components/chart/radar-chart.d.ts +1 -1
- package/dist/types/components/chart/radial-chart.d.ts +34 -0
- package/dist/types/components/chart/radial-chart.namespace.d.ts +11 -0
- package/dist/types/components/chart/radial-chart.style.d.ts +10 -0
- package/dist/types/components/chart/use-chart.d.ts +2 -2
- package/dist/types/components/chart/use-pie-chart.d.ts +1 -5
- package/dist/types/components/chart/use-polar-chart.d.ts +49 -3
- package/dist/types/components/chart/use-radial-chart.d.ts +40 -0
- package/dist/types/components/checkbox/checkbox-group.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +5 -4
- package/dist/types/components/checkbox/use-checkbox-group.d.ts +3 -2
- package/dist/types/components/checkbox/use-checkbox.d.ts +1 -0
- package/dist/types/components/checkbox-card/checkbox-card-group.d.ts +3 -0
- package/dist/types/components/checkbox-card/checkbox-card.d.ts +7 -5
- package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
- package/dist/types/components/circle-progress/circle-progress.d.ts +3 -2
- package/dist/types/components/close-button/close-button.d.ts +3 -2
- package/dist/types/components/code/code.d.ts +2 -2
- package/dist/types/components/collapse/collapse.d.ts +3 -2
- package/dist/types/components/color-picker/color-picker.d.ts +6 -2
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/color-picker/use-color-picker.d.ts +5 -2
- package/dist/types/components/color-selector/color-selector.d.ts +6 -2
- package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
- package/dist/types/components/color-selector/use-color-selector.d.ts +5 -3
- package/dist/types/components/color-swatch/color-swatch.d.ts +2 -2
- package/dist/types/components/container/container.d.ts +2 -2
- package/dist/types/components/data-list/data-list.d.ts +2 -2
- package/dist/types/components/date-picker/date-picker.d.ts +5 -2
- package/dist/types/components/date-picker/use-date-picker.d.ts +7 -4
- package/dist/types/components/drawer/drawer.d.ts +5 -2
- package/dist/types/components/drawer/use-drawer.d.ts +2 -0
- package/dist/types/components/dropzone/dropzone.d.ts +7 -4
- package/dist/types/components/dropzone/use-dropzone.d.ts +1 -0
- package/dist/types/components/editable/editable.d.ts +5 -4
- package/dist/types/components/editable/use-editable.d.ts +3 -2
- package/dist/types/components/em/em.d.ts +2 -2
- package/dist/types/components/empty-state/empty-state.d.ts +2 -2
- package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
- package/dist/types/components/fade/fade.d.ts +3 -2
- package/dist/types/components/fade-scale/fade-scale.d.ts +1 -0
- package/dist/types/components/field/field.d.ts +3 -3
- package/dist/types/components/field/field.style.d.ts +2 -2
- package/dist/types/components/field/use-field-props.d.ts +3 -3
- package/dist/types/components/fieldset/fieldset.d.ts +4 -3
- package/dist/types/components/fieldset/fieldset.style.d.ts +1 -1
- package/dist/types/components/file-button/file-button.d.ts +4 -2
- package/dist/types/components/file-button/use-file-button.d.ts +20 -18
- package/dist/types/components/file-input/file-input.d.ts +4 -2
- package/dist/types/components/file-input/use-file-input.d.ts +16 -15
- package/dist/types/components/flex/flex.d.ts +2 -2
- package/dist/types/components/flip/flip.d.ts +5 -4
- package/dist/types/components/float/float.d.ts +2 -2
- package/dist/types/components/form/form.d.ts +4 -3
- package/dist/types/components/format/format-byte.d.ts +4 -4
- package/dist/types/components/format/format-date-time.d.ts +4 -4
- package/dist/types/components/format/format-number.d.ts +2 -2
- package/dist/types/components/format/use-format-byte.d.ts +1 -0
- package/dist/types/components/format/use-format-date-time.d.ts +1 -0
- package/dist/types/components/format/use-format-number.d.ts +1 -0
- package/dist/types/components/grid/grid-item.d.ts +2 -2
- package/dist/types/components/grid/grid.d.ts +2 -2
- package/dist/types/components/group/group.d.ts +3 -2
- package/dist/types/components/group/use-group.d.ts +2 -2
- package/dist/types/components/heading/heading.d.ts +2 -2
- package/dist/types/components/highlight/highlight.d.ts +2 -0
- package/dist/types/components/hue-slider/hue-slider.d.ts +4 -3
- package/dist/types/components/icon/icon.d.ts +5 -5
- package/dist/types/components/icon/icons/git-merge-conflict-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/globe-off-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/index.d.ts +21 -4
- package/dist/types/components/icon/icons/index.types.d.ts +1 -1
- package/dist/types/components/icon/icons/lens-concave-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/lens-convex-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/line-dot-right-horizontal-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/message-circle-check-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/message-square-check-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/metronome-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/mirror-rectangular-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/mirror-round-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/mouse-left-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/mouse-right-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/shelving-unit-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/square-arrow-right-enter-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/square-arrow-right-exit-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/square-centerline-dashed-horizontal-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/square-centerline-dashed-vertical-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/towel-rack-icon.d.ts +15 -0
- package/dist/types/components/icon/icons/x-line-top-icon.d.ts +15 -0
- package/dist/types/components/icon/index.d.ts +20 -3
- package/dist/types/components/image/image.d.ts +2 -2
- package/dist/types/components/indicator/indicator.d.ts +5 -4
- package/dist/types/components/infinite-scroll-area/infinite-scroll-area.d.ts +2 -2
- package/dist/types/components/input/input-addon.d.ts +2 -2
- package/dist/types/components/input/input-element.d.ts +2 -2
- package/dist/types/components/input/input-group.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +3 -2
- package/dist/types/components/kbd/kbd.d.ts +2 -2
- package/dist/types/components/link/link.d.ts +2 -2
- package/dist/types/components/link-box/link-box.d.ts +2 -2
- package/dist/types/components/list/list.d.ts +2 -2
- package/dist/types/components/loading/loading-provider.d.ts +2 -2
- package/dist/types/components/loading/loading.d.ts +4 -3
- package/dist/types/components/loading/use-loading-component.d.ts +1 -0
- package/dist/types/components/mark/mark.d.ts +2 -2
- package/dist/types/components/menu/menu.d.ts +3 -2
- package/dist/types/components/menu/menu.style.d.ts +2 -2
- package/dist/types/components/menu/use-menu.d.ts +11 -11
- package/dist/types/components/modal/modal.d.ts +6 -2
- package/dist/types/components/native-accordion/native-accordion.d.ts +2 -2
- package/dist/types/components/native-accordion/use-native-accordion.d.ts +2 -2
- package/dist/types/components/native-popover/native-popover.d.ts +2 -2
- package/dist/types/components/native-select/native-select.d.ts +4 -2
- package/dist/types/components/native-select/use-native-select.d.ts +1 -0
- package/dist/types/components/native-table/native-table.d.ts +4 -4
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/notice/use-notice.d.ts +3 -0
- package/dist/types/components/number-input/number-input.d.ts +3 -2
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/number-input/use-number-input.d.ts +1 -0
- package/dist/types/components/pagination/pagination.d.ts +3 -2
- package/dist/types/components/pagination/use-pagination.d.ts +2 -2
- package/dist/types/components/password-input/password-input.d.ts +3 -2
- package/dist/types/components/password-input/strength-meter.d.ts +2 -2
- package/dist/types/components/password-input/use-password-input.d.ts +3 -2
- package/dist/types/components/picture/picture.d.ts +1 -0
- package/dist/types/components/pin-input/pin-input.d.ts +4 -2
- package/dist/types/components/pin-input/use-pin-input.d.ts +8 -7
- package/dist/types/components/popover/popover.d.ts +3 -2
- package/dist/types/components/progress/progress.d.ts +4 -4
- package/dist/types/components/progress/use-progress.d.ts +706 -706
- package/dist/types/components/qr-code/qr-code.d.ts +2 -2
- package/dist/types/components/radio/radio-group.d.ts +2 -0
- package/dist/types/components/radio/radio.d.ts +5 -4
- package/dist/types/components/radio/use-radio-group.d.ts +3 -2
- package/dist/types/components/radio/use-radio.d.ts +1 -0
- package/dist/types/components/radio-card/radio-card-group.d.ts +3 -0
- package/dist/types/components/radio-card/radio-card.d.ts +7 -5
- package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
- package/dist/types/components/rating/use-rating.d.ts +8 -7
- package/dist/types/components/reorder/reorder.d.ts +3 -2
- package/dist/types/components/reorder/use-reorder.d.ts +3 -3
- package/dist/types/components/resizable/resizable.d.ts +2 -2
- package/dist/types/components/resizable/use-resizable.d.ts +2 -2
- package/dist/types/components/ripple/ripple.d.ts +3 -2
- package/dist/types/components/ripple/use-ripple.d.ts +2 -2
- package/dist/types/components/rotate/rotate.d.ts +3 -2
- package/dist/types/components/saturation-slider/saturation-slider.d.ts +2 -2
- package/dist/types/components/saturation-slider/use-saturation-slider.d.ts +3 -2
- package/dist/types/components/scroll-area/scroll-area.d.ts +2 -2
- package/dist/types/components/segmented-control/segmented-control.d.ts +3 -2
- package/dist/types/components/segmented-control/segmented-control.style.d.ts +2 -2
- package/dist/types/components/segmented-control/use-segmented-control.d.ts +10 -9
- package/dist/types/components/select/select.d.ts +4 -2
- package/dist/types/components/select/select.style.d.ts +1 -1
- package/dist/types/components/select/use-select.d.ts +6 -4
- package/dist/types/components/separator/separator.d.ts +2 -2
- package/dist/types/components/simple-grid/simple-grid.d.ts +3 -2
- package/dist/types/components/skeleton/skeleton.d.ts +2 -2
- package/dist/types/components/slide/slide.d.ts +3 -2
- package/dist/types/components/slide-fade/slide-fade.d.ts +3 -2
- package/dist/types/components/slider/slider.d.ts +2 -2
- package/dist/types/components/slider/use-slider.d.ts +3 -2
- package/dist/types/components/snacks/snacks.d.ts +2 -0
- package/dist/types/components/snacks/use-snacks.d.ts +1 -0
- package/dist/types/components/stack/h-stack.d.ts +2 -2
- package/dist/types/components/stack/stack.d.ts +2 -2
- package/dist/types/components/stack/v-stack.d.ts +2 -2
- package/dist/types/components/stack/z-stack.d.ts +2 -2
- package/dist/types/components/stat/stat.d.ts +2 -2
- package/dist/types/components/stat/stat.style.d.ts +2 -2
- package/dist/types/components/status/status.d.ts +2 -2
- package/dist/types/components/steps/steps.d.ts +2 -2
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/steps/use-steps.d.ts +10 -10
- package/dist/types/components/switch/switch.d.ts +2 -2
- package/dist/types/components/switch/use-switch.d.ts +1 -0
- package/dist/types/components/table/table.d.ts +4 -2
- package/dist/types/components/tabs/tabs.d.ts +2 -2
- package/dist/types/components/tabs/use-tabs.d.ts +16 -16
- package/dist/types/components/tag/tag.d.ts +2 -2
- package/dist/types/components/text/text.d.ts +2 -2
- package/dist/types/components/textarea/textarea.d.ts +4 -2
- package/dist/types/components/textarea/use-autosize.d.ts +2 -2
- package/dist/types/components/timeline/timeline.d.ts +5 -5
- package/dist/types/components/timeline/timeline.style.d.ts +2 -2
- package/dist/types/components/tip/tip.d.ts +2 -0
- package/dist/types/components/toggle/toggle-group.d.ts +1 -1
- package/dist/types/components/toggle/toggle.d.ts +7 -5
- package/dist/types/components/toggle/use-toggle-group.d.ts +2 -2
- package/dist/types/components/toggle/use-toggle.d.ts +3 -2
- package/dist/types/components/tooltip/tooltip.d.ts +4 -2
- package/dist/types/components/visually-hidden/visually-hidden.d.ts +2 -2
- package/dist/types/components/wrap/wrap.d.ts +3 -2
- package/dist/types/core/components/create-component.d.ts +7 -7
- package/dist/types/core/css/styles.d.ts +18 -5
- package/dist/types/core/system/color-mode-provider.d.ts +2 -2
- package/dist/types/core/system/styled.d.ts +2 -2
- package/dist/types/core/system/system-provider.d.ts +2 -2
- package/dist/types/core/system/use-system-color-mode.d.ts +1 -1
- package/dist/types/hooks/use-async-callback/index.d.ts +1 -0
- package/dist/types/hooks/use-breakpoint/use-breakpoint-state.d.ts +2 -2
- package/dist/types/hooks/use-clipboard/index.d.ts +2 -2
- package/dist/types/hooks/use-combobox/index.d.ts +13 -12
- package/dist/types/hooks/use-counter/index.d.ts +2 -2
- package/dist/types/hooks/use-descendants/index.d.ts +2 -2
- package/dist/types/hooks/use-field-sizing/index.d.ts +2 -2
- package/dist/types/hooks/use-hover/index.d.ts +2 -2
- package/dist/types/hooks/use-popper/index.d.ts +2 -2
- package/dist/types/hooks/use-resize-observer/index.d.ts +3 -3
- package/dist/types/index.d.ts +129 -6
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +6 -3
- package/dist/types/providers/i18n-provider/intl/en-US.d.ts +3 -0
- package/dist/types/providers/i18n-provider/intl/index.d.ts +105 -0
- package/dist/types/providers/ui-provider/ui-provider.d.ts +3 -2
- package/package.json +6 -6
- package/dist/cjs/components/icon/icons/flip-horizontal-icon.cjs +0 -17
- package/dist/cjs/components/icon/icons/flip-horizontal-icon.cjs.map +0 -1
- package/dist/cjs/components/icon/icons/flip-vertical-icon.cjs +0 -17
- package/dist/cjs/components/icon/icons/flip-vertical-icon.cjs.map +0 -1
- package/dist/esm/components/icon/icons/flip-horizontal-icon.js +0 -16
- package/dist/esm/components/icon/icons/flip-horizontal-icon.js.map +0 -1
- package/dist/esm/components/icon/icons/flip-vertical-icon.js +0 -16
- package/dist/esm/components/icon/icons/flip-vertical-icon.js.map +0 -1
- package/dist/types/components/icon/icons/flip-horizontal-icon.d.ts +0 -15
- package/dist/types/components/icon/icons/flip-vertical-icon.d.ts +0 -15
|
@@ -96,7 +96,7 @@ const CartesianChart = withProvider(({ components: componentsProp, withGrid = tr
|
|
|
96
96
|
}));
|
|
97
97
|
const ChartXAxis = withContext((props) => {
|
|
98
98
|
const { xAxisProps } = useComponentContext();
|
|
99
|
-
const { label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
|
|
99
|
+
const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
|
|
100
100
|
...xAxisProps,
|
|
101
101
|
...props
|
|
102
102
|
};
|
|
@@ -180,12 +180,15 @@ const ChartXAxis = withContext((props) => {
|
|
|
180
180
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.svg, {
|
|
181
181
|
asChild: true,
|
|
182
182
|
...getRootProps(),
|
|
183
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.XAxis, {
|
|
183
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.XAxis, {
|
|
184
|
+
...getXAxisProps(),
|
|
185
|
+
children
|
|
186
|
+
})
|
|
184
187
|
});
|
|
185
188
|
}, "xAxis")();
|
|
186
189
|
const ChartYAxis = withContext((props) => {
|
|
187
190
|
const { yAxisProps } = useComponentContext();
|
|
188
|
-
const { label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
|
|
191
|
+
const { children, label: labelProp = false, tick: tickProp = true, tickLine: tickLineProp = false, ...rest } = {
|
|
189
192
|
...yAxisProps,
|
|
190
193
|
...props
|
|
191
194
|
};
|
|
@@ -269,7 +272,10 @@ const ChartYAxis = withContext((props) => {
|
|
|
269
272
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.svg, {
|
|
270
273
|
asChild: true,
|
|
271
274
|
...getRootProps(),
|
|
272
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.YAxis, {
|
|
275
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.YAxis, {
|
|
276
|
+
...getYAxisProps(),
|
|
277
|
+
children
|
|
278
|
+
})
|
|
273
279
|
});
|
|
274
280
|
}, "yAxis")();
|
|
275
281
|
const ChartGrid = withContext((props) => {
|
|
@@ -286,7 +292,7 @@ const ChartGrid = withContext((props) => {
|
|
|
286
292
|
}, "grid")();
|
|
287
293
|
const ChartLine = withContext((props) => {
|
|
288
294
|
const { lineProps } = useComponentContext();
|
|
289
|
-
const { activeDot: activeDotProp = true, dataKey, dot: dotProp = false, label: labelProp = false, ...rest } = {
|
|
295
|
+
const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, label: labelProp = false, ...rest } = {
|
|
290
296
|
...lineProps,
|
|
291
297
|
...props
|
|
292
298
|
};
|
|
@@ -383,12 +389,15 @@ const ChartLine = withContext((props) => {
|
|
|
383
389
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.line, {
|
|
384
390
|
asChild: true,
|
|
385
391
|
...getRootProps(),
|
|
386
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Line, {
|
|
392
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Line, {
|
|
393
|
+
...getLineProps(),
|
|
394
|
+
children
|
|
395
|
+
})
|
|
387
396
|
});
|
|
388
397
|
}, "line")();
|
|
389
398
|
const ChartArea = withContext((props) => {
|
|
390
399
|
const { areaProps } = useComponentContext();
|
|
391
|
-
const { activeDot: activeDotProp = true, dataKey, dot: dotProp = false, label: labelProp = false, withGradient, ...rest } = {
|
|
400
|
+
const { activeDot: activeDotProp = true, children, dataKey, dot: dotProp = false, label: labelProp = false, withGradient, ...rest } = {
|
|
392
401
|
...areaProps,
|
|
393
402
|
...props
|
|
394
403
|
};
|
|
@@ -489,7 +498,10 @@ const ChartArea = withContext((props) => {
|
|
|
489
498
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.line, {
|
|
490
499
|
asChild: true,
|
|
491
500
|
...getRootProps(),
|
|
492
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Area, {
|
|
501
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Area, {
|
|
502
|
+
...getAreaProps(),
|
|
503
|
+
children
|
|
504
|
+
})
|
|
493
505
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("defs", { children: withGradient ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("linearGradient", {
|
|
494
506
|
id,
|
|
495
507
|
x1: "0",
|
|
@@ -519,7 +531,7 @@ const ChartArea = withContext((props) => {
|
|
|
519
531
|
}, "area")();
|
|
520
532
|
const ChartBar = withContext((props) => {
|
|
521
533
|
const { barProps } = useComponentContext();
|
|
522
|
-
const { dataKey, label: labelProp = false, ...rest } = {
|
|
534
|
+
const { children, dataKey, label: labelProp = false, ...rest } = {
|
|
523
535
|
...barProps,
|
|
524
536
|
...props
|
|
525
537
|
};
|
|
@@ -560,7 +572,10 @@ const ChartBar = withContext((props) => {
|
|
|
560
572
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.path, {
|
|
561
573
|
asChild: true,
|
|
562
574
|
...getRootProps(),
|
|
563
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Bar, {
|
|
575
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(recharts.Bar, {
|
|
576
|
+
...getBarProps(),
|
|
577
|
+
children
|
|
578
|
+
})
|
|
564
579
|
});
|
|
565
580
|
}, "bar")();
|
|
566
581
|
const ChartReferenceLine = withContext((props) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesian-chart.cjs","names":["createShouldForwardProp","createSlotComponent","cartesianChartStyle","Chart","varAttr","useSystem","useTheme","getCSS","props","useChartXAxis","styled","XAxis","useChartYAxis","YAxis","useChartGrid","CartesianGrid","useChartComponentContext","useChartLine","Line","useChartArea","Area","useChartBar","Bar","useChartReferenceLine","ReferenceLine"],"sources":["../../../../src/components/chart/cartesian-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n ActiveDotProps,\n DotProps,\n LabelListProps,\n LabelProps,\n} from \"recharts\"\nimport type {\n XAxisTickContentProps,\n YAxisTickContentProps,\n} from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { CartesianChartStyle } from \"./cartesian-chart.style\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelList,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type {\n UseChartAreaProps,\n UseChartBarProps,\n UseChartGridProps,\n UseChartLineProps,\n UseChartReferenceLineProps,\n UseChartXAxisProps,\n UseChartYAxisProps,\n} from \"./use-cartesian-chart\"\nimport { cloneElement, isValidElement, useId, useMemo } from \"react\"\nimport {\n Area,\n Bar,\n CartesianGrid,\n Line,\n ReferenceLine,\n XAxis,\n YAxis,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport { cx, isFunction, isObject, splitObject } from \"../../utils\"\nimport { cartesianChartStyle } from \"./cartesian-chart.style\"\nimport { Chart, useChartComponentContext } from \"./chart\"\nimport {\n useChartArea,\n useChartBar,\n useChartGrid,\n useChartLine,\n useChartReferenceLine,\n useChartXAxis,\n useChartYAxis,\n} from \"./use-cartesian-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n CartesianChartProps,\n | \"areaProps\"\n | \"barProps\"\n | \"gridProps\"\n | \"lineProps\"\n | \"referenceLineProps\"\n | \"xAxisProps\"\n | \"yAxisProps\"\n> {}\n\nexport interface CartesianChartProps<Y extends Dict = Dict>\n extends ChartProps<Y>, ThemeProps<CartesianChartStyle> {\n /**\n * The fill color of the active dots.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dots.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the active dots.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the active dots.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill opacity of the area.\n */\n areaFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill color of the dots.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dots.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the dots.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the dots.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke color of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive lines.\n */\n inactiveLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the lines.\n */\n lineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the lines.\n */\n lineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the lines.\n */\n lineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the reference lines.\n */\n referenceLineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the reference lines.\n */\n referenceLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the reference lines.\n */\n referenceLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the reference lines.\n */\n referenceLineTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the reference lines.\n */\n referenceLineTextFill?: CSSProps[\"fill\"]\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default false\n */\n withYAxis?: boolean\n /**\n * The stroke color of the x-axis lines.\n */\n xAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the x-axis lines.\n */\n xAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the x-axis.\n */\n xAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the x-axis.\n */\n xAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The stroke color of the y-axis lines.\n */\n yAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the y-axis lines.\n */\n yAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the y-axis.\n */\n yAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the y-axis.\n */\n yAxisTextFill?: CSSProps[\"fill\"]\n /**\n * Props for the area component.\n */\n areaProps?: Omit<ChartAreaProps, \"data\" | \"dataKey\">\n /**\n * Props for the bar component.\n */\n barProps?: Omit<ChartBarProps, \"dataKey\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartGridProps\n /**\n * Props for the line component.\n */\n lineProps?: Omit<ChartLineProps, \"data\" | \"dataKey\">\n /**\n * Props for the reference line component.\n */\n referenceLineProps?: ChartReferenceLineProps\n /**\n * Props for the x axis component.\n */\n xAxisProps?: ChartXAxisProps\n /**\n * Props for the y axis component.\n */\n yAxisProps?: ChartYAxisProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CartesianChartPropsContext,\n useComponentContext,\n usePropsContext: useCartesianChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<\n CartesianChartProps,\n CartesianChartStyle,\n ComponentContext\n>(\"cartesian-chart\", cartesianChartStyle)\n\nexport { CartesianChartPropsContext, useCartesianChartPropsContext }\n\nexport const CartesianChart = withProvider(\n <Y extends Dict>({\n components: componentsProp,\n withGrid = true,\n withXAxis = true,\n withYAxis = false,\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ...rest\n }: CartesianChartProps<Y>) => {\n const components = useMemo(\n () => [\n {\n component: ChartGrid,\n fallback: withGrid ? <ChartGrid /> : null,\n },\n {\n component: ChartXAxis,\n fallback: <ChartXAxis hide={!withXAxis} />,\n },\n {\n component: ChartYAxis,\n fallback: <ChartYAxis hide={!withYAxis} />,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withXAxis, withYAxis],\n )\n const componentContext = useMemo(\n () => ({\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n }),\n [\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart components={components} {...rest} />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n areaFillOpacity,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveLineOpacity,\n lineColor,\n lineStroke,\n lineStrokeWidth,\n referenceLineColor,\n referenceLineStroke,\n referenceLineStrokeWidth,\n referenceLineTextColor,\n referenceLineTextFill,\n xAxisLineStroke,\n xAxisLineStrokeWidth,\n xAxisTextColor,\n xAxisTextFill,\n yAxisLineStroke,\n yAxisLineStrokeWidth,\n yAxisTextColor,\n yAxisTextFill,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--area-fill-opacity\": areaFillOpacity,\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-line-opacity\": inactiveLineOpacity,\n \"--line-color\": varAttr(lineColor, \"colors\"),\n \"--line-stroke\": varAttr(lineStroke, \"colors\"),\n \"--line-stroke-width\": lineStrokeWidth,\n \"--reference-line-color\": varAttr(referenceLineColor, \"colors\"),\n \"--reference-line-stroke\": varAttr(referenceLineStroke, \"colors\"),\n \"--reference-line-stroke-width\": referenceLineStrokeWidth,\n \"--reference-line-text-color\": varAttr(referenceLineTextColor, \"colors\"),\n \"--reference-line-text-fill\": varAttr(referenceLineTextFill, \"colors\"),\n \"--x-axis-line-stroke\": varAttr(xAxisLineStroke, \"colors\"),\n \"--x-axis-line-stroke-width\": xAxisLineStrokeWidth,\n \"--x-axis-text-color\": varAttr(xAxisTextColor, \"colors\"),\n \"--x-axis-text-fill\": varAttr(xAxisTextFill, \"colors\"),\n \"--y-axis-line-stroke\": varAttr(yAxisLineStroke, \"colors\"),\n \"--y-axis-line-stroke-width\": yAxisLineStrokeWidth,\n \"--y-axis-text-color\": varAttr(yAxisTextColor, \"colors\"),\n \"--y-axis-text-fill\": varAttr(yAxisTextFill, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: CartesianChartProps<Y>): ReactElement\n}>\n\nexport type ChartXAxisTick =\n | ((props: XAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartXAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartXAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartXAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartXAxis = withContext<\"svg\", ChartXAxisProps>((props) => {\n const { xAxisProps } = useComponentContext()\n const {\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = { ...xAxisProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"xAxisTick\")\n const labelProps = useSlotComponentProps({}, \"xAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"xAxisTickLine\")\n const tick = useMemo<UseChartXAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const css = getCSS(system, theme)\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"text\">,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickProp, tickProps.className, tickProps.css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const css = getCSS(system, theme)\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickLineProp, tickLineProps.className, tickLineProps.css])\n const label = useMemo<UseChartXAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getRootProps, getXAxisProps } = useChartXAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <XAxis {...getXAxisProps()} />\n </styled.svg>\n )\n}, \"xAxis\")()\n\nexport type ChartYAxisTick =\n | ((props: YAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartYAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartYAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartYAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartYAxis = withContext<\"svg\", ChartYAxisProps>((props) => {\n const { yAxisProps } = useComponentContext()\n const {\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = { ...yAxisProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"yAxisTick\")\n const labelProps = useSlotComponentProps({}, \"yAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"yAxisTickLine\")\n const tick = useMemo<UseChartYAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const css = getCSS(system, theme)\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"text\">,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickProp, tickProps.className, tickProps.css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const css = getCSS(system, theme)\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickLineProp, tickLineProps.className, tickLineProps.css])\n const label = useMemo<UseChartYAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getRootProps, getYAxisProps } = useChartYAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <YAxis {...getYAxisProps()} />\n </styled.svg>\n )\n}, \"yAxis\")()\n\nexport interface ChartGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UseChartGridProps\n> {}\n\nexport const ChartGrid = withContext<\"line\", ChartGridProps>((props) => {\n const { gridProps } = useComponentContext()\n const { getGridProps, getRootProps } = useChartGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <CartesianGrid {...getGridProps()} />\n </styled.line>\n )\n}, \"grid\")()\n\nexport interface ChartLineProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<UseChartLineProps, \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the line.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartLine = withContext<\"line\", ChartLineProps>((props) => {\n const { lineProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n ...rest\n } = { ...lineProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()] ?? rest.stroke ?? rest.color\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, system, theme, dotProps.className, dotProps.css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [\n activeDotProp,\n system,\n theme,\n activeDotProps.className,\n activeDotProps.css,\n color,\n ])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getLineProps, getRootProps } = useChartLine({\n activeDot,\n dataKey,\n dot,\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <Line {...getLineProps()} />\n </styled.line>\n )\n}, \"line\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartLineProps<Y>): ReactElement\n}>\n\nexport interface ChartAreaProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<UseChartAreaProps, \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the area.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n /**\n * Determines whether the chart area should be represented with a gradient instead of the solid color.\n */\n withGradient?: boolean\n}\n\nexport const ChartArea = withContext<\"line\", ChartAreaProps>((props) => {\n const { areaProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n withGradient,\n ...rest\n } = { ...areaProps, ...props }\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()] ?? rest.stroke ?? rest.color\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, {\n className,\n })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, system, theme, dotProps.className, dotProps.css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [\n activeDotProp,\n system,\n theme,\n activeDotProps.className,\n activeDotProps.css,\n color,\n ])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getAreaProps, getRootProps } = useChartArea({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <>\n <styled.line asChild {...getRootProps()}>\n <Area {...getAreaProps()} />\n </styled.line>\n\n <defs>\n {withGradient ? (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop offset=\"5%\" stopColor={color} stopOpacity={0.8} />\n <styled.stop offset=\"95%\" stopColor={color} stopOpacity={0.1} />\n </linearGradient>\n ) : (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop stopColor={color} stopOpacity={0.4} />\n </linearGradient>\n )}\n </defs>\n </>\n )\n}, \"area\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartAreaProps<Y>): ReactElement\n}>\n\nexport interface ChartBarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartBarProps, \"dataKey\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The label list to use for the bar.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartBar = withContext<\"path\", ChartBarProps>((props) => {\n const { barProps } = useComponentContext()\n const {\n dataKey,\n label: labelProp = false,\n ...rest\n } = { ...barProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()]\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const label = useMemo<UseChartBarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getBarProps, getRootProps } = useChartBar({\n dataKey,\n fill: color,\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Bar {...getBarProps()} />\n </styled.path>\n )\n}, \"bar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartBarProps<Y>): ReactElement\n}>\n\nexport interface ChartReferenceLineProps extends Omit<\n Merge<HTMLStyledProps<\"line\">, UseChartReferenceLineProps>,\n \"label\"\n> {\n /**\n * The label to use for the reference line.\n *\n * @default false\n */\n label?: ChartLabel\n}\n\nexport const ChartReferenceLine = withContext<\"line\", ChartReferenceLineProps>(\n (props) => {\n const { referenceLineProps } = useComponentContext()\n const { label: labelProp = false, ...rest } = {\n ...referenceLineProps,\n ...props,\n }\n const system = useSystem()\n const { theme } = useTheme()\n const labelProps = useSlotComponentProps({}, \"referenceLineLabel\")\n const label = useMemo<UseChartReferenceLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getReferenceLineProps, getRootProps } = useChartReferenceLine({\n label,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <ReferenceLine {...getReferenceLineProps()} />\n </styled.line>\n )\n },\n \"referenceLine\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwEA,MAAM,oBAAoBA,uCAAyB;AA2KnD,MAAM,EACJ,kBACA,cAAc,4BACd,qBACA,iBAAiB,+BACjB,aACA,cACA,0BACEC,6CAIF,mBAAmBC,kDAAoB;AAIzC,MAAa,iBAAiB,cACX,EACf,YAAY,gBACZ,WAAW,MACX,YAAY,MACZ,YAAY,OACZ,WACA,UACA,WACA,WACA,oBACA,YACA,YACA,GAAG,WACyB;CAC5B,MAAM,sCACE;EACJ;GACE,WAAW;GACX,UAAU,WAAW,2CAAC,cAAY,GAAG;GACtC;EACD;GACE,WAAW;GACX,UAAU,2CAAC,cAAW,MAAM,CAAC,YAAa;GAC3C;EACD;GACE,WAAW;GACX,UAAU,2CAAC,cAAW,MAA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W,EAAE,WAAW,CAAC;4DAChC,UAAU,EAAE;IAC9B,MAAM,CAAC,cAAc,iEACnB,WACA,kBACD;AAED,WAAO;KACL,GAAG;KACH,qDAAc,WAAW,aAAa,WAAW,IAAI,WAAW,CAAC;KAClE;SAED,QAAO;IAAE;IAAW,UAAU;IAAW;KAE1C;GAAC;GAAQ;GAAO;GAAW,WAAW;GAAW,WAAW;GAAI,CAAC;EAGlE,GAAG;EACJ,CAAC;AAEF,QACE,2CAACE,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACc,0BAAc,GAAI,uBAAuB,GAAI;GAClC;GAGlB,gBACD,EAAE"}
|
|
1
|
+
{"version":3,"file":"cartesian-chart.cjs","names":["createShouldForwardProp","createSlotComponent","cartesianChartStyle","Chart","varAttr","useSystem","useTheme","getCSS","props","useChartXAxis","styled","XAxis","useChartYAxis","YAxis","useChartGrid","CartesianGrid","useChartComponentContext","useChartLine","Line","useChartArea","Area","useChartBar","Bar","useChartReferenceLine","ReferenceLine"],"sources":["../../../../src/components/chart/cartesian-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement, ReactNode } from \"react\"\nimport type {\n ActiveDotProps,\n DotProps,\n LabelListProps,\n LabelProps,\n} from \"recharts\"\nimport type {\n XAxisTickContentProps,\n YAxisTickContentProps,\n} from \"recharts/types/util/types\"\nimport type {\n CSSObject,\n CSSProps,\n GenericsComponent,\n HTMLProps,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type { CartesianChartStyle } from \"./cartesian-chart.style\"\nimport type {\n ChartActiveDot,\n ChartDot,\n ChartLabel,\n ChartLabelList,\n ChartProps,\n ChartTickLine,\n} from \"./chart\"\nimport type {\n UseChartAreaProps,\n UseChartBarProps,\n UseChartGridProps,\n UseChartLineProps,\n UseChartReferenceLineProps,\n UseChartXAxisProps,\n UseChartYAxisProps,\n} from \"./use-cartesian-chart\"\nimport { cloneElement, isValidElement, useId, useMemo } from \"react\"\nimport {\n Area,\n Bar,\n CartesianGrid,\n Line,\n ReferenceLine,\n XAxis,\n YAxis,\n} from \"recharts\"\nimport {\n createShouldForwardProp,\n createSlotComponent,\n getCSS,\n styled,\n useSystem,\n useTheme,\n varAttr,\n} from \"../../core\"\nimport { cx, isFunction, isObject, splitObject } from \"../../utils\"\nimport { cartesianChartStyle } from \"./cartesian-chart.style\"\nimport { Chart, useChartComponentContext } from \"./chart\"\nimport {\n useChartArea,\n useChartBar,\n useChartGrid,\n useChartLine,\n useChartReferenceLine,\n useChartXAxis,\n useChartYAxis,\n} from \"./use-cartesian-chart\"\n\nconst shouldForwardProp = createShouldForwardProp()\n\ninterface ComponentContext extends Pick<\n CartesianChartProps,\n | \"areaProps\"\n | \"barProps\"\n | \"gridProps\"\n | \"lineProps\"\n | \"referenceLineProps\"\n | \"xAxisProps\"\n | \"yAxisProps\"\n> {}\n\nexport interface CartesianChartProps<Y extends Dict = Dict>\n extends ChartProps<Y>, ThemeProps<CartesianChartStyle> {\n /**\n * The fill color of the active dots.\n */\n activeDotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the active dots.\n */\n activeDotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the active dots.\n */\n activeDotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the active dots.\n */\n activeDotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The fill opacity of the area.\n */\n areaFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The fill color of the dots.\n */\n dotFill?: CSSProps[\"fill\"]\n /**\n * The radius of the dots.\n */\n dotRadius?: CSSProps[\"r\"]\n /**\n * The stroke color of the dots.\n */\n dotStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the dots.\n */\n dotStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The stroke color of the grid.\n */\n gridStroke?: CSSProps[\"stroke\"]\n /**\n * The opacity of the inactive lines.\n */\n inactiveLineOpacity?: CSSProps[\"opacity\"]\n /**\n * The color of the lines.\n */\n lineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the lines.\n */\n lineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the lines.\n */\n lineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The color of the reference lines.\n */\n referenceLineColor?: CSSProps[\"color\"]\n /**\n * The stroke color of the reference lines.\n */\n referenceLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the reference lines.\n */\n referenceLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the reference lines.\n */\n referenceLineTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the reference lines.\n */\n referenceLineTextFill?: CSSProps[\"fill\"]\n /**\n * If `true`, grid is visible.\n *\n * @default true\n */\n withGrid?: boolean\n /**\n * If `true`, X axis is visible.\n *\n * @default true\n */\n withXAxis?: boolean\n /**\n * If `true`, Y axis is visible.\n *\n * @default false\n */\n withYAxis?: boolean\n /**\n * The stroke color of the x-axis lines.\n */\n xAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the x-axis lines.\n */\n xAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the x-axis.\n */\n xAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the x-axis.\n */\n xAxisTextFill?: CSSProps[\"fill\"]\n /**\n * The stroke color of the y-axis lines.\n */\n yAxisLineStroke?: CSSProps[\"stroke\"]\n /**\n * The stroke width of the y-axis lines.\n */\n yAxisLineStrokeWidth?: CSSProps[\"strokeWidth\"]\n /**\n * The text color of the y-axis.\n */\n yAxisTextColor?: CSSProps[\"color\"]\n /**\n * The text fill color of the y-axis.\n */\n yAxisTextFill?: CSSProps[\"fill\"]\n /**\n * Props for the area component.\n */\n areaProps?: Omit<ChartAreaProps, \"data\" | \"dataKey\">\n /**\n * Props for the bar component.\n */\n barProps?: Omit<ChartBarProps, \"dataKey\">\n /**\n * Props for the grid component.\n */\n gridProps?: ChartGridProps\n /**\n * Props for the line component.\n */\n lineProps?: Omit<ChartLineProps, \"data\" | \"dataKey\">\n /**\n * Props for the reference line component.\n */\n referenceLineProps?: ChartReferenceLineProps\n /**\n * Props for the x axis component.\n */\n xAxisProps?: ChartXAxisProps\n /**\n * Props for the y axis component.\n */\n yAxisProps?: ChartYAxisProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CartesianChartPropsContext,\n useComponentContext,\n usePropsContext: useCartesianChartPropsContext,\n withContext,\n withProvider,\n useSlotComponentProps,\n} = createSlotComponent<\n CartesianChartProps,\n CartesianChartStyle,\n ComponentContext\n>(\"cartesian-chart\", cartesianChartStyle)\n\nexport { CartesianChartPropsContext, useCartesianChartPropsContext }\n\nexport const CartesianChart = withProvider(\n <Y extends Dict>({\n components: componentsProp,\n withGrid = true,\n withXAxis = true,\n withYAxis = false,\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ...rest\n }: CartesianChartProps<Y>) => {\n const components = useMemo(\n () => [\n {\n component: ChartGrid,\n fallback: withGrid ? <ChartGrid /> : null,\n },\n {\n component: ChartXAxis,\n fallback: <ChartXAxis hide={!withXAxis} />,\n },\n {\n component: ChartYAxis,\n fallback: <ChartYAxis hide={!withYAxis} />,\n },\n ...componentsProp,\n ],\n [componentsProp, withGrid, withXAxis, withYAxis],\n )\n const componentContext = useMemo(\n () => ({\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n }),\n [\n areaProps,\n barProps,\n gridProps,\n lineProps,\n referenceLineProps,\n xAxisProps,\n yAxisProps,\n ],\n )\n\n return (\n <ComponentContext value={componentContext}>\n <Chart components={components} {...rest} />\n </ComponentContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n activeDotFill,\n activeDotRadius,\n activeDotStroke,\n activeDotStrokeWidth,\n areaFillOpacity,\n dotFill,\n dotRadius,\n dotStroke,\n dotStrokeWidth,\n gridStroke,\n inactiveLineOpacity,\n lineColor,\n lineStroke,\n lineStrokeWidth,\n referenceLineColor,\n referenceLineStroke,\n referenceLineStrokeWidth,\n referenceLineTextColor,\n referenceLineTextFill,\n xAxisLineStroke,\n xAxisLineStrokeWidth,\n xAxisTextColor,\n xAxisTextFill,\n yAxisLineStroke,\n yAxisLineStrokeWidth,\n yAxisTextColor,\n yAxisTextFill,\n ...rest\n }) => ({\n \"--active-dot-fill\": varAttr(activeDotFill, \"colors\"),\n \"--active-dot-r\": activeDotRadius,\n \"--active-dot-stroke\": varAttr(activeDotStroke, \"colors\"),\n \"--active-dot-stroke-width\": activeDotStrokeWidth,\n \"--area-fill-opacity\": areaFillOpacity,\n \"--dot-fill\": varAttr(dotFill, \"colors\"),\n \"--dot-r\": dotRadius,\n \"--dot-stroke\": varAttr(dotStroke, \"colors\"),\n \"--dot-stroke-width\": dotStrokeWidth,\n \"--grid-stroke\": varAttr(gridStroke, \"colors\"),\n \"--inactive-line-opacity\": inactiveLineOpacity,\n \"--line-color\": varAttr(lineColor, \"colors\"),\n \"--line-stroke\": varAttr(lineStroke, \"colors\"),\n \"--line-stroke-width\": lineStrokeWidth,\n \"--reference-line-color\": varAttr(referenceLineColor, \"colors\"),\n \"--reference-line-stroke\": varAttr(referenceLineStroke, \"colors\"),\n \"--reference-line-stroke-width\": referenceLineStrokeWidth,\n \"--reference-line-text-color\": varAttr(referenceLineTextColor, \"colors\"),\n \"--reference-line-text-fill\": varAttr(referenceLineTextFill, \"colors\"),\n \"--x-axis-line-stroke\": varAttr(xAxisLineStroke, \"colors\"),\n \"--x-axis-line-stroke-width\": xAxisLineStrokeWidth,\n \"--x-axis-text-color\": varAttr(xAxisTextColor, \"colors\"),\n \"--x-axis-text-fill\": varAttr(xAxisTextFill, \"colors\"),\n \"--y-axis-line-stroke\": varAttr(yAxisLineStroke, \"colors\"),\n \"--y-axis-line-stroke-width\": yAxisLineStrokeWidth,\n \"--y-axis-text-color\": varAttr(yAxisTextColor, \"colors\"),\n \"--y-axis-text-fill\": varAttr(yAxisTextFill, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: CartesianChartProps<Y>): ReactElement\n}>\n\nexport type ChartXAxisTick =\n | ((props: XAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartXAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartXAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartXAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartXAxis = withContext<\"svg\", ChartXAxisProps>((props) => {\n const { xAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = { ...xAxisProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"xAxisTick\")\n const labelProps = useSlotComponentProps({}, \"xAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"xAxisTickLine\")\n const tick = useMemo<UseChartXAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const css = getCSS(system, theme)\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"text\">,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickProp, tickProps.className, tickProps.css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const css = getCSS(system, theme)\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickLineProp, tickLineProps.className, tickLineProps.css])\n const label = useMemo<UseChartXAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getRootProps, getXAxisProps } = useChartXAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <XAxis {...getXAxisProps()}>{children}</XAxis>\n </styled.svg>\n )\n}, \"xAxis\")()\n\nexport type ChartYAxisTick =\n | ((props: YAxisTickContentProps) => ReactNode)\n | boolean\n | HTMLStyledProps<\"text\">\n | ReactElement\n\nexport interface ChartYAxisProps extends Merge<\n HTMLStyledProps<\"svg\">,\n Omit<UseChartYAxisProps, \"label\" | \"tick\" | \"tickLine\">\n> {\n /**\n * The label to use for the axis.\n *\n * @default false\n */\n label?: ChartLabel\n /**\n * The tick to use for the axis.\n *\n * @default true\n */\n tick?: ChartYAxisTick\n /**\n * The tick line to use for the axis.\n *\n * @default false\n */\n tickLine?: ChartTickLine\n}\n\nexport const ChartYAxis = withContext<\"svg\", ChartYAxisProps>((props) => {\n const { yAxisProps } = useComponentContext()\n const {\n children,\n label: labelProp = false,\n tick: tickProp = true,\n tickLine: tickLineProp = false,\n ...rest\n } = { ...yAxisProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const tickProps = useSlotComponentProps({}, \"yAxisTick\")\n const labelProps = useSlotComponentProps({}, \"yAxisLabel\")\n const tickLineProps = useSlotComponentProps({}, \"yAxisTickLine\")\n const tick = useMemo<UseChartYAxisProps[\"tick\"]>(() => {\n if (!tickProp) return tickProp\n\n const css = getCSS(system, theme)\n const className = cx(tickProps.className, css(tickProps.css))\n\n if (isFunction(tickProp)) {\n return (props) =>\n tickProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(tickProp)) {\n return cloneElement<any>(tickProp, { className })\n } else if (isObject(tickProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"text\">,\n CSSObject\n >(tickProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickProp, tickProps.className, tickProps.css])\n const tickLine = useMemo<UseChartXAxisProps[\"tickLine\"]>(() => {\n if (!tickLineProp) return tickLineProp\n\n const css = getCSS(system, theme)\n const className = cx(tickLineProps.className, css(tickLineProps.css))\n\n if (isObject(tickLineProp)) {\n const [omittedProps, styleProps] = splitObject<\n HTMLProps<\"line\">,\n CSSObject\n >(tickLineProp, shouldForwardProp)\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, tickLineProp, tickLineProps.className, tickLineProps.css])\n const label = useMemo<UseChartYAxisProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getRootProps, getYAxisProps } = useChartYAxis({\n label,\n tick,\n tickLine,\n ...rest,\n })\n\n return (\n <styled.svg asChild {...getRootProps()}>\n <YAxis {...getYAxisProps()}>{children}</YAxis>\n </styled.svg>\n )\n}, \"yAxis\")()\n\nexport interface ChartGridProps extends Merge<\n HTMLStyledProps<\"line\">,\n UseChartGridProps\n> {}\n\nexport const ChartGrid = withContext<\"line\", ChartGridProps>((props) => {\n const { gridProps } = useComponentContext()\n const { getGridProps, getRootProps } = useChartGrid({\n ...gridProps,\n ...props,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <CartesianGrid {...getGridProps()} />\n </styled.line>\n )\n}, \"grid\")()\n\nexport interface ChartLineProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<UseChartLineProps, \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the line.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartLine = withContext<\"line\", ChartLineProps>((props) => {\n const { lineProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n ...rest\n } = { ...lineProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()] ?? rest.stroke ?? rest.color\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, { className })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, system, theme, dotProps.className, dotProps.css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [\n activeDotProp,\n system,\n theme,\n activeDotProps.className,\n activeDotProps.css,\n color,\n ])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getLineProps, getRootProps } = useChartLine({\n activeDot,\n dataKey,\n dot,\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <Line {...getLineProps()}>{children}</Line>\n </styled.line>\n )\n}, \"line\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartLineProps<Y>): ReactElement\n}>\n\nexport interface ChartAreaProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"line\">,\n Omit<UseChartAreaProps, \"activeDot\" | \"data\" | \"dataKey\" | \"dot\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The active dot to use for the line.\n *\n * @default true\n */\n activeDot?: ChartActiveDot\n /**\n * The data to use for the area.\n */\n data?: Y[]\n /**\n * The dot to use for the line.\n *\n * @default false\n */\n dot?: ChartDot\n /**\n * The label list to use for the line.\n *\n * @default false\n */\n label?: ChartLabelList\n /**\n * Determines whether the chart area should be represented with a gradient instead of the solid color.\n */\n withGradient?: boolean\n}\n\nexport const ChartArea = withContext<\"line\", ChartAreaProps>((props) => {\n const { areaProps } = useComponentContext()\n const {\n activeDot: activeDotProp = true,\n children,\n dataKey,\n dot: dotProp = false,\n label: labelProp = false,\n withGradient,\n ...rest\n } = { ...areaProps, ...props }\n const id = useId()\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()] ?? rest.stroke ?? rest.color\n const dotProps = useSlotComponentProps({}, \"dot\")\n const activeDotProps = useSlotComponentProps({}, \"activeDot\")\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const dot = useMemo<UseChartLineProps[\"dot\"]>(() => {\n if (!dotProp) return dotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n dotProps.className,\n css(dotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(dotProp)) {\n return (props) =>\n dotProp({\n ...props,\n className: cx(className, props.className),\n })\n } else if (isValidElement(dotProp)) {\n return cloneElement<any>(dotProp, {\n className,\n })\n } else if (isObject(dotProp)) {\n const [omittedProps, styleProps] = splitObject<DotProps, CSSObject>(\n dotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [dotProp, system, theme, dotProps.className, dotProps.css, color])\n const activeDot = useMemo<UseChartLineProps[\"activeDot\"]>(() => {\n if (!activeDotProp) return activeDotProp\n\n const css = getCSS(system, theme)\n const className = cx(\n activeDotProps.className,\n css(activeDotProps.css),\n css({ fill: color, stroke: color }),\n )\n\n if (isFunction(activeDotProp)) {\n return (props) =>\n activeDotProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(activeDotProp)) {\n return cloneElement<any>(activeDotProp, { className })\n } else if (isObject(activeDotProp)) {\n const [omittedProps, styleProps] = splitObject<ActiveDotProps, CSSObject>(\n activeDotProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [\n activeDotProp,\n system,\n theme,\n activeDotProps.className,\n activeDotProps.css,\n color,\n ])\n const label = useMemo<UseChartLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getAreaProps, getRootProps } = useChartArea({\n activeDot,\n dataKey,\n dot,\n fill: color ? `url(#${id})` : \"\",\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <>\n <styled.line asChild {...getRootProps()}>\n <Area {...getAreaProps()}>{children}</Area>\n </styled.line>\n\n <defs>\n {withGradient ? (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop offset=\"5%\" stopColor={color} stopOpacity={0.8} />\n <styled.stop offset=\"95%\" stopColor={color} stopOpacity={0.1} />\n </linearGradient>\n ) : (\n <linearGradient id={id} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n <styled.stop stopColor={color} stopOpacity={0.4} />\n </linearGradient>\n )}\n </defs>\n </>\n )\n}, \"area\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartAreaProps<Y>): ReactElement\n}>\n\nexport interface ChartBarProps<Y extends Dict = Dict> extends Merge<\n HTMLStyledProps<\"path\">,\n Omit<UseChartBarProps, \"dataKey\" | \"label\">\n> {\n /**\n * The key of a group of data which should be unique in an chart.\n */\n dataKey: keyof Y\n /**\n * The label list to use for the bar.\n *\n * @default false\n */\n label?: ChartLabelList\n}\n\nexport const ChartBar = withContext<\"path\", ChartBarProps>((props) => {\n const { barProps } = useComponentContext()\n const {\n children,\n dataKey,\n label: labelProp = false,\n ...rest\n } = { ...barProps, ...props }\n const system = useSystem()\n const { theme } = useTheme()\n const { varMap } = useChartComponentContext()\n const color = varMap[dataKey.toString()]\n const labelProps = useSlotComponentProps({}, \"labelList\")\n const label = useMemo<UseChartBarProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelListProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getBarProps, getRootProps } = useChartBar({\n dataKey,\n fill: color,\n label,\n stroke: color,\n ...rest,\n })\n\n return (\n <styled.path asChild {...getRootProps()}>\n <Bar {...getBarProps()}>{children}</Bar>\n </styled.path>\n )\n}, \"bar\")() as GenericsComponent<{\n <Y extends Dict>(props: ChartBarProps<Y>): ReactElement\n}>\n\nexport interface ChartReferenceLineProps extends Omit<\n Merge<HTMLStyledProps<\"line\">, UseChartReferenceLineProps>,\n \"label\"\n> {\n /**\n * The label to use for the reference line.\n *\n * @default false\n */\n label?: ChartLabel\n}\n\nexport const ChartReferenceLine = withContext<\"line\", ChartReferenceLineProps>(\n (props) => {\n const { referenceLineProps } = useComponentContext()\n const { label: labelProp = false, ...rest } = {\n ...referenceLineProps,\n ...props,\n }\n const system = useSystem()\n const { theme } = useTheme()\n const labelProps = useSlotComponentProps({}, \"referenceLineLabel\")\n const label = useMemo<UseChartReferenceLineProps[\"label\"]>(() => {\n if (!labelProp) return labelProp\n\n const css = getCSS(system, theme)\n const className = cx(labelProps.className, css(labelProps.css))\n\n if (isFunction(labelProp)) {\n return (props) =>\n labelProp({ ...props, className: cx(className, props.className) })\n } else if (isValidElement(labelProp)) {\n return cloneElement<any>(labelProp, { className })\n } else if (isObject(labelProp)) {\n const [omittedProps, styleProps] = splitObject<LabelProps, CSSObject>(\n labelProp,\n shouldForwardProp,\n )\n\n return {\n ...omittedProps,\n className: cx(className, omittedProps.className, css(styleProps)),\n }\n } else {\n return { className, children: labelProp }\n }\n }, [system, theme, labelProp, labelProps.className, labelProps.css])\n const { getReferenceLineProps, getRootProps } = useChartReferenceLine({\n label,\n ...rest,\n })\n\n return (\n <styled.line asChild {...getRootProps()}>\n <ReferenceLine {...getReferenceLineProps()} />\n </styled.line>\n )\n },\n \"referenceLine\",\n)()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAwEA,MAAM,oBAAoBA,uCAAyB;AA2KnD,MAAM,EACJ,kBACA,cAAc,4BACd,qBACA,iBAAiB,+BACjB,aACA,cACA,0BACEC,6CAIF,mBAAmBC,kDAAoB;AAIzC,MAAa,iBAAiB,cACX,EACf,YAAY,gBACZ,WAAW,MACX,YAAY,MACZ,YAAY,OACZ,WACA,UACA,WACA,WACA,oBACA,YACA,YACA,GAAG,WACyB;CAC5B,MAAM,sCACE;EACJ;GACE,WAAW;GACX,UAAU,WAAW,2CAAC,cAAY,GAAG;GACtC;EACD;GACE,WAAW;GACX,UAAU,2CAAC,cAAW,MAAM,CAAC,YAAa;GAC3C;EACD;GACE,WAAW;GACX,UAAU,2CAAC,cAAW,MAAM,CAAC,YAAa;GAC3C;EACD,GAAG;EACJ,EACD;EAAC;EAAgB;EAAU;EAAW;EAAU,CACjD;AAsBD,QACE,2CAAC;EAAiB,iCArBX;GACL;GACA;GACA;GACA;GACA;GACA;GACA;GACD,GACD;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CACF;YAIG,2CAACC;GAAkB;GAAY,GAAI;IAAQ;GAC1B;GAGvB,OACD,CACC,SACC,EACC,eACA,iBACA,iBACA,sBACA,iBACA,SACA,WACA,WACA,gBACA,YACA,qBACA,WACA,YACA,iBACA,oBACA,qBACA,0BACA,wBACA,uBACA,iBACA,sBACA,gBACA,eACA,iBACA,sBACA,gBACA,eACA,GAAG,YACE;CACL,qBAAqBC,oBAAQ,eAAe,SAAS;CACrD,kBAAkB;CAClB,uBAAuBA,oBAAQ,iBAAiB,SAAS;CACzD,6BAA6B;CAC7B,uBAAuB;CACvB,cAAcA,oBAAQ,SAAS,SAAS;CACxC,WAAW;CACX,gBAAgBA,oBAAQ,WAAW,SAAS;CAC5C,sBAAsB;CACtB,iBAAiBA,oBAAQ,YAAY,SA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GAC5B;GAEf,MAAM,EAAE;AAgBX,MAAa,qBAAqB,aAC/B,UAAU;CACT,MAAM,EAAE,uBAAuB,qBAAqB;CACpD,MAAM,EAAE,OAAO,YAAY,OAAO,GAAG,SAAS;EAC5C,GAAG;EACH,GAAG;EACJ;CACD,MAAM,SAASjB,mCAAW;CAC1B,MAAM,EAAE,UAAUC,iCAAU;CAC5B,MAAM,aAAa,sBAAsB,EAAE,EAAE,qBAAqB;CA0BlE,MAAM,EAAE,uBAAuB,iBAAiBiB,kDAAsB;EACpE,gCA1B+D;AAC/D,OAAI,CAAC,UAAW,QAAO;GAEvB,MAAM,MAAMhB,uBAAO,QAAQ,MAAM;GACjC,MAAM,sDAAe,WAAW,WAAW,IAAI,WAAW,IAAI,CAAC;AAE/D,yDAAe,UAAU,CACvB,SAAQ,YACN,UAAU;IAAE,GAAGC;IAAO,qDAAc,WAAWA,QAAM,UAAU;IAAE,CAAC;sCAC5C,UAAU,CAClC,gCAAyB,WAAW,EAAE,WAAW,CAAC;4DAChC,UAAU,EAAE;IAC9B,MAAM,CAAC,cAAc,iEACnB,WACA,kBACD;AAED,WAAO;KACL,GAAG;KACH,qDAAc,WAAW,aAAa,WAAW,IAAI,WAAW,CAAC;KAClE;SAED,QAAO;IAAE;IAAW,UAAU;IAAW;KAE1C;GAAC;GAAQ;GAAO;GAAW,WAAW;GAAW,WAAW;GAAI,CAAC;EAGlE,GAAG;EACJ,CAAC;AAEF,QACE,2CAACE,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACc,0BAAc,GAAI,uBAAuB,GAAI;GAClC;GAGlB,gBACD,EAAE"}
|
|
@@ -39,6 +39,7 @@ function gradients(length, color = "mono", strategy = "invert") {
|
|
|
39
39
|
const { ComponentContext, PropsContext: ChartPropsContext, useComponentContext: useChartComponentContext, usePropsContext: useChartPropsContext, withContext, withProvider } = require_create_component.createSlotComponent("chart", require_chart_style.chartStyle);
|
|
40
40
|
const Chart = withProvider(({ children, components: componentsProp, render, series = [], withLegend = false, withTooltip = true, legendProps, responsiveContainerProps, tooltipProps, ...rest }) => {
|
|
41
41
|
const { highlightedDataKey, onHighlight } = require_use_chart.useChart();
|
|
42
|
+
const nameKeyRef = (0, react.useRef)(void 0);
|
|
42
43
|
const components = (0, react.useMemo)(() => [
|
|
43
44
|
...componentsProp,
|
|
44
45
|
{
|
|
@@ -72,6 +73,7 @@ const Chart = withProvider(({ children, components: componentsProp, render, seri
|
|
|
72
73
|
}), [highlightedDataKey, onHighlight]),
|
|
73
74
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComponentContext, {
|
|
74
75
|
value: (0, react.useMemo)(() => ({
|
|
76
|
+
nameKeyRef,
|
|
75
77
|
varMap,
|
|
76
78
|
legendProps,
|
|
77
79
|
tooltipProps
|
|
@@ -123,17 +125,19 @@ const ChartLegend = withContext((props) => {
|
|
|
123
125
|
});
|
|
124
126
|
}, "legend")();
|
|
125
127
|
const ChartLegendContent = withContext(({ formatter, payload, withSwatch = true, ...rest }) => {
|
|
126
|
-
const { varMap } = useChartComponentContext();
|
|
128
|
+
const { nameKeyRef, varMap } = useChartComponentContext();
|
|
127
129
|
const { getLegendItemProps } = useChartLegendContext();
|
|
128
130
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.div, {
|
|
129
131
|
...rest,
|
|
130
132
|
children: payload?.map((data, index) => {
|
|
131
|
-
|
|
133
|
+
let value = data.value;
|
|
134
|
+
if (nameKeyRef.current) value = data.payload?.[nameKeyRef.current];
|
|
135
|
+
const dataKey = (0, require_utils_index.utils_exports.isString)(data.dataKey) || (0, require_utils_index.utils_exports.isNumber)(data.dataKey) ? data.dataKey : value;
|
|
132
136
|
const color = data.color || (dataKey ? varMap[dataKey] : void 0);
|
|
133
|
-
const
|
|
137
|
+
const formattedValue = formatter?.(value, data, index) ?? value;
|
|
134
138
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ChartLegendItem, {
|
|
135
139
|
...getLegendItemProps({ dataKey }),
|
|
136
|
-
children: [withSwatch ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartLegendSwatch, { bg: color }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartLegendValue, { children:
|
|
140
|
+
children: [withSwatch ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartLegendSwatch, { bg: color }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartLegendValue, { children: formattedValue })]
|
|
137
141
|
}, index);
|
|
138
142
|
})
|
|
139
143
|
});
|
|
@@ -174,11 +178,12 @@ const ChartTooltipCursor = withContext("path", "tooltipCursor")(void 0, ({ botto
|
|
|
174
178
|
};
|
|
175
179
|
});
|
|
176
180
|
const ChartTooltipContent = withContext(({ formatter, label: labelProp, labelFormatter, payload, withSwatch = true, ...rest }) => {
|
|
177
|
-
const { varMap } = useChartComponentContext();
|
|
181
|
+
const { nameKeyRef, varMap } = useChartComponentContext();
|
|
178
182
|
const label = labelFormatter ? labelFormatter(labelProp, payload) : labelProp;
|
|
179
183
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_factory.styled.div, {
|
|
180
184
|
...rest,
|
|
181
185
|
children: [!(0, require_utils_index.utils_exports.isUndefined)(label) && !(0, require_utils_index.utils_exports.isNull)(label) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartTooltipLabel, { children: label }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChartTooltipList, { children: payload.map((data, index) => {
|
|
186
|
+
if (nameKeyRef.current) data.name = data.payload[nameKeyRef.current];
|
|
182
187
|
const color = data.payload.fill ?? varMap[data.dataKey.toString()];
|
|
183
188
|
const result = formatter?.(data.value, data.name, data, index, payload) ?? ((0, require_utils_index.utils_exports.isArray)(data.value) ? data.value.join(", ") : data.value);
|
|
184
189
|
const [value, name] = (0, require_utils_index.utils_exports.isArray)(result) ? result : [result, data.name];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.cjs","names":["createSlotComponent","chartStyle","useChart","useSplitChildren","varAttr","ChartContext","styled","ResponsiveContainer","Fragment","createContext","useChartLegend","Legend","useChartTooltip","Tooltip","useChartLabelList","LabelList","useChartLabel","Label"],"sources":["../../../../src/components/chart/chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { PropsWithChildren, ReactElement, ReactNode } from \"react\"\nimport type {\n ActiveDotProps,\n DataKey,\n DefaultLegendContentProps,\n DotItemDotProps,\n DotProps,\n LabelProps,\n RenderableText,\n ResponsiveContainerProps,\n TooltipContentProps,\n} from \"recharts\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type {\n ChartAreaProps,\n ChartBarProps,\n ChartLineProps,\n} from \"./cartesian-chart\"\nimport type { ChartStyle } from \"./chart.style\"\nimport type {\n ChartDonutProps,\n ChartPieProps,\n ChartRadarProps,\n} from \"./polar-chart\"\nimport type {\n UseChartLabelListProps,\n UseChartLabelProps,\n UseChartLegendProps,\n UseChartLegendReturn,\n UseChartTooltipProps,\n} from \"./use-chart\"\nimport { Fragment, isValidElement, useMemo } from \"react\"\nimport {\n Label,\n LabelList,\n Legend,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport {\n createContext,\n isArray,\n isNull,\n isNumber,\n isObject,\n isString,\n isUndefined,\n useSplitChildren,\n} from \"../../utils\"\nimport { chartStyle } from \"./chart.style\"\nimport {\n ChartContext,\n useChart,\n useChartLabel,\n useChartLabelList,\n useChartLegend,\n useChartTooltip,\n} from \"./use-chart\"\n\nexport type ChartDot =\n | ((props: DotItemDotProps) => ReactNode)\n | boolean\n | Merge<Partial<DotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartActiveDot =\n | ((props: ActiveDotProps) => ReactNode)\n | boolean\n | Merge<Partial<ActiveDotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartLabel =\n | ((props: any) => ReactElement | RenderableText)\n | boolean\n | (Merge<\n HTMLStyledProps<\"text\">,\n Pick<\n LabelProps,\n | \"angle\"\n | \"content\"\n | \"formatter\"\n | \"index\"\n | \"labelRef\"\n | \"offset\"\n | \"parentViewBox\"\n | \"position\"\n | \"textBreakAll\"\n | \"value\"\n | \"viewBox\"\n | \"zIndex\"\n >\n > & { dataKey?: DataKey<any> })\n | number\n | ReactElement\n | string\n\nexport type ChartLabelList =\n | ((props: LabelProps) => ReactElement | RenderableText)\n | boolean\n | ChartLabelListProps\n | ReactElement\n\nexport type ChartTickLine = boolean | HTMLStyledProps<\"line\">\n\ntype GradientStrategy = \"invert\" | \"shade\" | \"tint\"\n\nexport function mergeSeries<Y>(\n series: Y[],\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { color: CSSProps[\"fill\"] })[] {\n const colors = gradients(series.length, color, strategy)\n\n return series.map((item, index) => ({ ...item, color: colors[index] }))\n}\n\nexport function mergeData<Y>(\n data: Y[],\n color: CSSProps[\"fill\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { fill: CSSProps[\"fill\"] })[] {\n const colors = gradients(data.length, color, strategy)\n\n return data.map((item, index) => ({ ...item, fill: colors[index] }))\n}\n\nexport function gradients(\n length: number,\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): CSSProps[\"fill\"][] {\n return Array.from({ length }, (_, index) => {\n const value = Math.floor(100 - (100 / length) * index)\n const percent = `${value}%`\n\n if (strategy === \"invert\") {\n return [\n `tint(colors.${color}, ${percent})`,\n `shade(colors.${color}, ${percent})`,\n ]\n } else {\n return `${strategy}(colors.${color}, ${percent})`\n }\n })\n}\n\ninterface ComponentContext extends Pick<\n ChartProps,\n \"legendProps\" | \"tooltipProps\"\n> {\n varMap: Dict<string>\n}\n\nexport interface ChartProps<Y extends Dict = Dict>\n extends HTMLStyledProps, ThemeProps<ChartStyle> {\n components: {\n component: React.JSXElementConstructor<any>\n fallback: ReactNode\n }[]\n render: (props: PropsWithChildren) => ReactNode\n /**\n * The color of the label list.\n */\n labelListColor?: CSSProps[\"color\"]\n /**\n * The fill of the label list.\n */\n labelListFill?: CSSProps[\"fill\"]\n series?:\n | ChartAreaProps<Y>[]\n | ChartBarProps<Y>[]\n | ChartDonutProps<Y>[]\n | ChartLineProps<Y>[]\n | ChartPieProps<Y>[]\n | ChartRadarProps<Y>[]\n /**\n * The fill of the tooltip cursor.\n */\n tooltipCursorFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the tooltip cursor.\n */\n tooltipCursorFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the tooltip cursor.\n */\n tooltipCursorStroke?: CSSProps[\"stroke\"]\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * Props for the legend component.\n */\n legendProps?: ChartLegendProps\n /**\n * Props for the responsive container component.\n */\n responsiveContainerProps?: ResponsiveContainerProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: ChartTooltipProps\n}\n\nconst {\n ComponentContext,\n PropsContext: ChartPropsContext,\n useComponentContext: useChartComponentContext,\n usePropsContext: useChartPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ChartProps, ChartStyle, ComponentContext>(\n \"chart\",\n chartStyle,\n)\n\nexport { ChartPropsContext, useChartComponentContext, useChartPropsContext }\n\nexport const Chart = withProvider(\n <Y extends Dict>({\n children,\n components: componentsProp,\n render,\n series = [],\n withLegend = false,\n withTooltip = true,\n legendProps,\n responsiveContainerProps,\n tooltipProps,\n ...rest\n }: ChartProps<Y>) => {\n const { highlightedDataKey, onHighlight } = useChart()\n const components = useMemo(\n () => [\n ...componentsProp,\n {\n component: ChartLegend,\n fallback: withLegend ? <ChartLegend /> : null,\n },\n {\n component: ChartTooltip,\n fallback: withTooltip ? <ChartTooltip /> : null,\n },\n ],\n [componentsProp, withLegend, withTooltip],\n )\n const [omittedChildren, ...customComponents] = useSplitChildren(\n children,\n ...components.map(({ component }) => component),\n )\n const varProps = useMemo(\n () =>\n series.reduce<Dict>((acc, data) => {\n const key = `--${data.dataKey.toString()}`\n\n if (data.color) acc[key] = varAttr(data.color, \"colors\")\n\n return acc\n }, {}),\n [series],\n )\n const varMap = useMemo(\n () =>\n series.reduce<Dict>((acc, data) => {\n const key = data.dataKey.toString()\n\n if (data.color) acc[key] = `var(--${key})`\n\n return acc\n }, {}),\n [series],\n )\n const context = useMemo(\n () => ({\n highlightedDataKey,\n onHighlight,\n }),\n [highlightedDataKey, onHighlight],\n )\n const componentContext = useMemo(\n () => ({\n varMap,\n legendProps,\n tooltipProps,\n }),\n [varMap, legendProps, tooltipProps],\n )\n\n return (\n <ChartContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...varProps} {...rest}>\n <ResponsiveContainer {...responsiveContainerProps}>\n {render({\n children: (\n <>\n {components.map(({ fallback }, index) => (\n <Fragment key={index}>\n {customComponents[index] ?? fallback}\n </Fragment>\n ))}\n\n {omittedChildren}\n </>\n ),\n })}\n </ResponsiveContainer>\n </styled.div>\n </ComponentContext>\n </ChartContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n labelListColor,\n labelListFill,\n tooltipCursorFill,\n tooltipCursorFillOpacity,\n tooltipCursorStroke,\n ...rest\n }) => ({\n \"--label-list-color\": varAttr(labelListColor, \"colors\"),\n \"--label-list-fill\": varAttr(labelListFill, \"colors\"),\n \"--tooltip-cursor-fill\": varAttr(tooltipCursorFill, \"colors\"),\n \"--tooltip-cursor-fill-opacity\": tooltipCursorFillOpacity,\n \"--tooltip-cursor-stroke\": varAttr(tooltipCursorStroke, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: ChartProps<Y>): ReactElement\n}>\n\ninterface ChartLegendContext extends Pick<\n UseChartLegendReturn,\n \"getLegendItemProps\"\n> {}\n\nconst [ChartLegendContext, useChartLegendContext] =\n createContext<ChartLegendContext>({\n name: \"ChartLegendContext\",\n })\n\nexport interface ChartLegendProps extends Merge<\n HTMLStyledProps,\n UseChartLegendProps\n> {\n /**\n * Props for the content component.\n */\n contentProps?: Omit<ChartLegendContentProps, \"formatter\" | \"payload\">\n}\n\nexport const ChartLegend = withContext<\"div\", ChartLegendProps>((props) => {\n const { legendProps } = useChartComponentContext()\n const { contentProps, ...rest } = { ...legendProps, ...props }\n const {\n getLegendContentProps,\n getLegendItemProps,\n getLegendProps,\n getRootProps,\n } = useChartLegend({\n content: ({ formatter, payload }) => (\n <ChartLegendContent\n formatter={formatter}\n payload={payload}\n {...getLegendContentProps(contentProps)}\n />\n ),\n ...rest,\n })\n const context = useMemo(() => ({ getLegendItemProps }), [getLegendItemProps])\n\n return (\n <ChartLegendContext value={context}>\n <styled.div asChild {...getRootProps()}>\n <Legend {...getLegendProps()} />\n </styled.div>\n </ChartLegendContext>\n )\n}, \"legend\")()\n\ninterface ChartLegendContentProps\n extends\n HTMLStyledProps,\n Pick<DefaultLegendContentProps, \"formatter\" | \"payload\"> {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartLegendContent = withContext<\"div\", ChartLegendContentProps>(\n ({ formatter, payload, withSwatch = true, ...rest }) => {\n const { varMap } = useChartComponentContext()\n const { getLegendItemProps } = useChartLegendContext()\n\n return (\n <styled.div {...rest}>\n {payload?.map((data, index) => {\n const dataKey =\n isString(data.dataKey) || isNumber(data.dataKey)\n ? data.dataKey\n : data.value\n const color = data.color || (dataKey ? varMap[dataKey] : undefined)\n const value = formatter?.(data.value, data, index) ?? data.value\n\n return (\n <ChartLegendItem key={index} {...getLegendItemProps({ dataKey })}>\n {withSwatch ? <ChartLegendSwatch bg={color} /> : null}\n <ChartLegendValue>{value}</ChartLegendValue>\n </ChartLegendItem>\n )\n })}\n </styled.div>\n )\n },\n \"legendContent\",\n)()\n\ninterface ChartLegendItemProps extends HTMLStyledProps {}\n\nconst ChartLegendItem = withContext<\"div\", ChartLegendItemProps>(\n \"div\",\n \"legendItem\",\n)()\n\ninterface ChartLegendSwatchProps extends HTMLStyledProps {}\n\nconst ChartLegendSwatch = withContext<\"div\", ChartLegendSwatchProps>(\n \"div\",\n \"legendSwatch\",\n)()\n\ninterface ChartLegendValueProps extends HTMLStyledProps<\"span\"> {}\n\nconst ChartLegendValue = withContext<\"span\", ChartLegendValueProps>(\n \"span\",\n \"legendValue\",\n)()\n\nexport interface ChartTooltipProps<\n Y extends (number | string)[] | number | string = number,\n M extends number | string = string,\n> extends Omit<Merge<HTMLStyledProps, UseChartTooltipProps<Y, M>>, \"cursor\"> {\n /**\n * Props for the cursor component.\n */\n cursor?: boolean | ChartTooltipCursorProps | ReactElement\n /**\n * Props for the content component.\n */\n contentProps?: Omit<\n ChartTooltipContentProps,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n >\n}\n\nexport const ChartTooltip = <\n Y extends (number | string)[] | number | string,\n M extends number | string,\n>(\n props: ChartTooltipProps<Y, M>,\n) => {\n const { tooltipProps } = useChartComponentContext()\n const {\n cursor = false,\n contentProps,\n ...rest\n } = {\n ...tooltipProps,\n ...props,\n } as ChartTooltipProps<Y, M>\n const { getContentProps, getRootProps } = useChartTooltip({\n content: ({ formatter, label, labelFormatter, payload }) => (\n <ChartTooltipContent\n formatter={formatter}\n label={label}\n labelFormatter={labelFormatter}\n payload={payload}\n {...getContentProps(contentProps)}\n />\n ),\n cursor:\n isValidElement(cursor) || !cursor ? (\n cursor\n ) : (\n <ChartTooltipCursor {...(isObject(cursor) ? cursor : {})} />\n ),\n ...rest,\n })\n\n return <Tooltip {...getRootProps()} />\n}\n\ninterface ChartTooltipCursorProps extends Omit<\n HTMLStyledProps<\"path\">,\n \"height\" | \"points\" | \"width\"\n> {\n brushBottom?: number\n height?: number\n payload?: Dict[]\n payloadIndex?: number\n points?: { x: number; y: number }[]\n width?: number\n}\n\nconst ChartTooltipCursor = withContext<\"path\", ChartTooltipCursorProps>(\n \"path\",\n \"tooltipCursor\",\n)(\n undefined,\n ({\n bottom: _bottom,\n brushBottom: _brushBottom,\n fill,\n height,\n left: _left,\n payload: _payload,\n payloadIndex: _payloadIndex,\n points,\n right: _right,\n stroke,\n top: _top,\n width,\n x,\n y,\n ...rest\n }) => {\n const d = !!points\n ? `M${points[0]?.x},${points[0]?.y}L${points[1]?.x},${points[1]?.y}`\n : `M ${x},${y} h ${width} v ${height} h -${width} Z`\n return {\n asChild: true,\n children: <path d={d} height={height} width={width} />,\n fill: fill === \"#ccc\" ? undefined : fill,\n stroke: stroke === \"#ccc\" ? undefined : stroke,\n ...rest,\n }\n },\n)\n\ninterface ChartTooltipContentProps\n extends\n HTMLStyledProps,\n Pick<\n TooltipContentProps<any, any>,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n > {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartTooltipContent = withContext<\"div\", ChartTooltipContentProps>(\n ({\n formatter,\n label: labelProp,\n labelFormatter,\n payload,\n withSwatch = true,\n ...rest\n }) => {\n const { varMap } = useChartComponentContext()\n const label = labelFormatter\n ? labelFormatter(labelProp, payload)\n : labelProp\n\n return (\n <styled.div {...rest}>\n {!isUndefined(label) && !isNull(label) ? (\n <ChartTooltipLabel>{label}</ChartTooltipLabel>\n ) : null}\n\n <ChartTooltipList>\n {payload.map((data, index) => {\n const color = data.payload.fill ?? varMap[data.dataKey.toString()]\n const result =\n formatter?.(data.value, data.name, data, index, payload) ??\n (isArray(data.value) ? data.value.join(\", \") : data.value)\n const [value, name] = isArray(result) ? result : [result, data.name]\n\n return (\n <ChartTooltipItem key={index}>\n {withSwatch ? <ChartTooltipSwatch bg={color} /> : null}\n <ChartTooltipName>{name}</ChartTooltipName>\n <ChartTooltipValue>{value}</ChartTooltipValue>\n </ChartTooltipItem>\n )\n })}\n </ChartTooltipList>\n </styled.div>\n )\n },\n \"tooltipContent\",\n)()\n\ninterface ChartTooltipLabel extends HTMLStyledProps<\"p\"> {}\n\nconst ChartTooltipLabel = withContext<\"p\", ChartTooltipLabel>(\n \"p\",\n \"tooltipLabel\",\n)()\n\ninterface ChartTooltipList extends HTMLStyledProps {}\n\nconst ChartTooltipList = withContext<\"div\", ChartTooltipList>(\n \"div\",\n \"tooltipList\",\n)()\n\ninterface ChartTooltipItem extends HTMLStyledProps {}\n\nconst ChartTooltipItem = withContext<\"div\", ChartTooltipItem>(\n \"div\",\n \"tooltipItem\",\n)()\n\ninterface ChartTooltipSwatch extends HTMLStyledProps {}\n\nconst ChartTooltipSwatch = withContext<\"div\", ChartTooltipSwatch>(\n \"div\",\n \"tooltipSwatch\",\n)()\n\ninterface ChartTooltipName extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipName = withContext<\"span\", ChartTooltipName>(\n \"span\",\n \"tooltipName\",\n)()\n\ninterface ChartTooltipValue extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipValue = withContext<\"span\", ChartTooltipValue>(\n \"span\",\n \"tooltipValue\",\n)()\n\nexport interface ChartLabelListProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelListProps\n> {}\n\nexport const ChartLabelList = withContext<\"text\", ChartLabelListProps>(\n (props) => {\n const { getLabelListProps, getRootProps } = useChartLabelList(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <LabelList {...getLabelListProps()} />\n </styled.text>\n )\n },\n \"labelList\",\n)()\n\nexport interface ChartLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelProps\n> {}\n\nexport const ChartLabel = withContext<\"text\", ChartLabelProps>((props) => {\n const { getLabelProps, getRootProps } = useChartLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Label {...getLabelProps()} />\n </styled.text>\n )\n}, \"label\")()\n"],"mappings":";;;;;;;;;;;;;;;;;AAmHA,SAAgB,YACd,QACA,QAA2B,QAC3B,WAA6B,UACQ;CACrC,MA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AM,CAAC,OAAO,uDAAgB,OAAO,GAAG,SAAS,CAAC,QAAQ,KAAK,KAAK;AAEpE,UACE,4CAAC;IACE,aAAa,2CAAC,sBAAmB,IAAI,QAAS,GAAG;IAClD,2CAAC,8BAAkB,OAAwB;IAC3C,2CAAC,+BAAmB,QAA0B;QAHzB,MAIJ;IAErB,GACe;GACR;GAGjB,iBACD,EAAE;AAIH,MAAM,oBAAoB,YACxB,KACA,eACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,OACA,cACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,OACA,cACD,EAAE;AAIH,MAAM,qBAAqB,YACzB,OACA,gBACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,QACA,cACD,EAAE;AAIH,MAAM,oBAAoB,YACxB,QACA,eACD,EAAE;AAOH,MAAa,iBAAiB,aAC3B,UAAU;CACT,MAAM,EAAE,mBAAmB,iBAAiBQ,oCAAkB,MAAM;AAEpE,QACE,2CAACR,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACS,sBAAU,GAAI,mBAAmB,GAAI;GAC1B;GAGlB,YACD,EAAE;AAOH,MAAa,aAAa,aAAsC,UAAU;CACxE,MAAM,EAAE,eAAe,iBAAiBC,gCAAc,MAAM;AAE5D,QACE,2CAACV,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACW,kBAAM,GAAI,eAAe,GAAI;GAClB;GAEf,QAAQ,EAAE"}
|
|
1
|
+
{"version":3,"file":"chart.cjs","names":["createSlotComponent","chartStyle","useChart","useSplitChildren","varAttr","ChartContext","styled","ResponsiveContainer","Fragment","createContext","useChartLegend","Legend","useChartTooltip","Tooltip","useChartLabelList","LabelList","useChartLabel","Label"],"sources":["../../../../src/components/chart/chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type {\n PropsWithChildren,\n ReactElement,\n ReactNode,\n RefObject,\n} from \"react\"\nimport type {\n ActiveDotProps,\n DataKey,\n DefaultLegendContentProps,\n DotItemDotProps,\n DotProps,\n LabelProps,\n RenderableText,\n ResponsiveContainerProps,\n TooltipContentProps,\n} from \"recharts\"\nimport type {\n CSSProps,\n GenericsComponent,\n HTMLStyledProps,\n ThemeProps,\n} from \"../../core\"\nimport type { Dict, Merge } from \"../../utils\"\nimport type {\n ChartAreaProps,\n ChartBarProps,\n ChartLineProps,\n} from \"./cartesian-chart\"\nimport type { ChartStyle } from \"./chart.style\"\nimport type {\n ChartDonutProps,\n ChartPieProps,\n ChartRadarProps,\n ChartRadialProps,\n} from \"./polar-chart\"\nimport type {\n UseChartLabelListProps,\n UseChartLabelProps,\n UseChartLegendProps,\n UseChartLegendReturn,\n UseChartTooltipProps,\n} from \"./use-chart\"\nimport { Fragment, isValidElement, useMemo, useRef } from \"react\"\nimport {\n Label,\n LabelList,\n Legend,\n ResponsiveContainer,\n Tooltip,\n} from \"recharts\"\nimport { createSlotComponent, styled, varAttr } from \"../../core\"\nimport {\n createContext,\n isArray,\n isNull,\n isNumber,\n isObject,\n isString,\n isUndefined,\n useSplitChildren,\n} from \"../../utils\"\nimport { chartStyle } from \"./chart.style\"\nimport {\n ChartContext,\n useChart,\n useChartLabel,\n useChartLabelList,\n useChartLegend,\n useChartTooltip,\n} from \"./use-chart\"\n\nexport type ChartDot =\n | ((props: DotItemDotProps) => ReactNode)\n | boolean\n | Merge<Partial<DotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartActiveDot =\n | ((props: ActiveDotProps) => ReactNode)\n | boolean\n | Merge<Partial<ActiveDotProps>, HTMLStyledProps<\"circle\">>\n | ReactElement\n\nexport type ChartLabel =\n | ((props: any) => ReactElement | RenderableText)\n | boolean\n | (Merge<\n HTMLStyledProps<\"text\">,\n Pick<\n LabelProps,\n | \"angle\"\n | \"content\"\n | \"formatter\"\n | \"index\"\n | \"labelRef\"\n | \"offset\"\n | \"parentViewBox\"\n | \"position\"\n | \"textBreakAll\"\n | \"value\"\n | \"viewBox\"\n | \"zIndex\"\n >\n > & { dataKey?: DataKey<any> })\n | number\n | ReactElement\n | string\n\nexport type ChartLabelList =\n | ((props: LabelProps) => ReactElement | RenderableText)\n | boolean\n | ChartLabelListProps\n | ReactElement\n\nexport type ChartTickLine = boolean | HTMLStyledProps<\"line\">\n\ntype GradientStrategy = \"invert\" | \"shade\" | \"tint\"\n\nexport function mergeSeries<Y>(\n series: Y[],\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { color: CSSProps[\"fill\"] })[] {\n const colors = gradients(series.length, color, strategy)\n\n return series.map((item, index) => ({ ...item, color: colors[index] }))\n}\n\nexport function mergeData<Y>(\n data: Y[],\n color: CSSProps[\"fill\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): (Y & { fill: CSSProps[\"fill\"] })[] {\n const colors = gradients(data.length, color, strategy)\n\n return data.map((item, index) => ({ ...item, fill: colors[index] }))\n}\n\nexport function gradients(\n length: number,\n color: CSSProps[\"color\"] = \"mono\",\n strategy: GradientStrategy = \"invert\",\n): CSSProps[\"fill\"][] {\n return Array.from({ length }, (_, index) => {\n const value = Math.floor(100 - (100 / length) * index)\n const percent = `${value}%`\n\n if (strategy === \"invert\") {\n return [\n `tint(colors.${color}, ${percent})`,\n `shade(colors.${color}, ${percent})`,\n ]\n } else {\n return `${strategy}(colors.${color}, ${percent})`\n }\n })\n}\n\ninterface ComponentContext extends Pick<\n ChartProps,\n \"legendProps\" | \"tooltipProps\"\n> {\n nameKeyRef: RefObject<string | undefined>\n varMap: Dict<string>\n}\n\nexport interface ChartProps<Y extends Dict = Dict>\n extends HTMLStyledProps, ThemeProps<ChartStyle> {\n components: {\n component: React.JSXElementConstructor<any>\n fallback: ReactNode\n }[]\n render: (props: PropsWithChildren) => ReactNode\n /**\n * The color of the label list.\n */\n labelListColor?: CSSProps[\"color\"]\n /**\n * The fill of the label list.\n */\n labelListFill?: CSSProps[\"fill\"]\n series?:\n | ChartAreaProps<Y>[]\n | ChartBarProps<Y>[]\n | ChartDonutProps<Y>[]\n | ChartLineProps<Y>[]\n | ChartPieProps<Y>[]\n | ChartRadarProps<Y>[]\n | ChartRadialProps<Y>[]\n /**\n * The fill of the tooltip cursor.\n */\n tooltipCursorFill?: CSSProps[\"fill\"]\n /**\n * The fill opacity of the tooltip cursor.\n */\n tooltipCursorFillOpacity?: CSSProps[\"fillOpacity\"]\n /**\n * The stroke of the tooltip cursor.\n */\n tooltipCursorStroke?: CSSProps[\"stroke\"]\n /**\n * If `true`, legend is visible.\n *\n * @default false\n */\n withLegend?: boolean\n /**\n * If `true`, tooltip is visible.\n *\n * @default true\n */\n withTooltip?: boolean\n /**\n * Props for the legend component.\n */\n legendProps?: ChartLegendProps\n /**\n * Props for the responsive container component.\n */\n responsiveContainerProps?: ResponsiveContainerProps\n /**\n * Props for the tooltip component.\n */\n tooltipProps?: ChartTooltipProps\n}\n\nconst {\n ComponentContext,\n PropsContext: ChartPropsContext,\n useComponentContext: useChartComponentContext,\n usePropsContext: useChartPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<ChartProps, ChartStyle, ComponentContext>(\n \"chart\",\n chartStyle,\n)\n\nexport { ChartPropsContext, useChartComponentContext, useChartPropsContext }\n\nexport const Chart = withProvider(\n <Y extends Dict>({\n children,\n components: componentsProp,\n render,\n series = [],\n withLegend = false,\n withTooltip = true,\n legendProps,\n responsiveContainerProps,\n tooltipProps,\n ...rest\n }: ChartProps<Y>) => {\n const { highlightedDataKey, onHighlight } = useChart()\n const nameKeyRef = useRef<string | undefined>(undefined)\n const components = useMemo(\n () => [\n ...componentsProp,\n {\n component: ChartLegend,\n fallback: withLegend ? <ChartLegend /> : null,\n },\n {\n component: ChartTooltip,\n fallback: withTooltip ? <ChartTooltip /> : null,\n },\n ],\n [componentsProp, withLegend, withTooltip],\n )\n const [omittedChildren, ...customComponents] = useSplitChildren(\n children,\n ...components.map(({ component }) => component),\n )\n const varProps = useMemo(\n () =>\n series.reduce<Dict>((acc, data) => {\n const key = `--${data.dataKey.toString()}`\n\n if (data.color) acc[key] = varAttr(data.color, \"colors\")\n\n return acc\n }, {}),\n [series],\n )\n const varMap = useMemo(\n () =>\n series.reduce<Dict>((acc, data) => {\n const key = data.dataKey.toString()\n\n if (data.color) acc[key] = `var(--${key})`\n\n return acc\n }, {}),\n [series],\n )\n const context = useMemo(\n () => ({\n highlightedDataKey,\n onHighlight,\n }),\n [highlightedDataKey, onHighlight],\n )\n const componentContext = useMemo(\n () => ({\n nameKeyRef,\n varMap,\n legendProps,\n tooltipProps,\n }),\n [varMap, legendProps, tooltipProps],\n )\n\n return (\n <ChartContext value={context}>\n <ComponentContext value={componentContext}>\n <styled.div {...varProps} {...rest}>\n <ResponsiveContainer {...responsiveContainerProps}>\n {render({\n children: (\n <>\n {components.map(({ fallback }, index) => (\n <Fragment key={index}>\n {customComponents[index] ?? fallback}\n </Fragment>\n ))}\n\n {omittedChildren}\n </>\n ),\n })}\n </ResponsiveContainer>\n </styled.div>\n </ComponentContext>\n </ChartContext>\n )\n },\n \"root\",\n)(\n undefined,\n ({\n labelListColor,\n labelListFill,\n tooltipCursorFill,\n tooltipCursorFillOpacity,\n tooltipCursorStroke,\n ...rest\n }) => ({\n \"--label-list-color\": varAttr(labelListColor, \"colors\"),\n \"--label-list-fill\": varAttr(labelListFill, \"colors\"),\n \"--tooltip-cursor-fill\": varAttr(tooltipCursorFill, \"colors\"),\n \"--tooltip-cursor-fill-opacity\": tooltipCursorFillOpacity,\n \"--tooltip-cursor-stroke\": varAttr(tooltipCursorStroke, \"colors\"),\n ...rest,\n }),\n) as GenericsComponent<{\n <Y extends Dict>(props: ChartProps<Y>): ReactElement\n}>\n\ninterface ChartLegendContext extends Pick<\n UseChartLegendReturn,\n \"getLegendItemProps\"\n> {}\n\nconst [ChartLegendContext, useChartLegendContext] =\n createContext<ChartLegendContext>({\n name: \"ChartLegendContext\",\n })\n\nexport interface ChartLegendProps extends Merge<\n HTMLStyledProps,\n UseChartLegendProps\n> {\n /**\n * Props for the content component.\n */\n contentProps?: Omit<ChartLegendContentProps, \"formatter\" | \"payload\">\n}\n\nexport const ChartLegend = withContext<\"div\", ChartLegendProps>((props) => {\n const { legendProps } = useChartComponentContext()\n const { contentProps, ...rest } = { ...legendProps, ...props }\n const {\n getLegendContentProps,\n getLegendItemProps,\n getLegendProps,\n getRootProps,\n } = useChartLegend({\n content: ({ formatter, payload }) => (\n <ChartLegendContent\n formatter={formatter}\n payload={payload}\n {...getLegendContentProps(contentProps)}\n />\n ),\n ...rest,\n })\n const context = useMemo(() => ({ getLegendItemProps }), [getLegendItemProps])\n\n return (\n <ChartLegendContext value={context}>\n <styled.div asChild {...getRootProps()}>\n <Legend {...getLegendProps()} />\n </styled.div>\n </ChartLegendContext>\n )\n}, \"legend\")()\n\ninterface ChartLegendContentProps\n extends\n HTMLStyledProps,\n Pick<DefaultLegendContentProps, \"formatter\" | \"payload\"> {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartLegendContent = withContext<\"div\", ChartLegendContentProps>(\n ({ formatter, payload, withSwatch = true, ...rest }) => {\n const { nameKeyRef, varMap } = useChartComponentContext()\n const { getLegendItemProps } = useChartLegendContext()\n\n return (\n <styled.div {...rest}>\n {payload?.map((data, index) => {\n let value = data.value\n\n if (nameKeyRef.current)\n value = (data.payload as any)?.[nameKeyRef.current]\n\n const dataKey =\n isString(data.dataKey) || isNumber(data.dataKey)\n ? data.dataKey\n : value\n const color = data.color || (dataKey ? varMap[dataKey] : undefined)\n const formattedValue = formatter?.(value, data, index) ?? value\n\n return (\n <ChartLegendItem key={index} {...getLegendItemProps({ dataKey })}>\n {withSwatch ? <ChartLegendSwatch bg={color} /> : null}\n <ChartLegendValue>{formattedValue}</ChartLegendValue>\n </ChartLegendItem>\n )\n })}\n </styled.div>\n )\n },\n \"legendContent\",\n)()\n\ninterface ChartLegendItemProps extends HTMLStyledProps {}\n\nconst ChartLegendItem = withContext<\"div\", ChartLegendItemProps>(\n \"div\",\n \"legendItem\",\n)()\n\ninterface ChartLegendSwatchProps extends HTMLStyledProps {}\n\nconst ChartLegendSwatch = withContext<\"div\", ChartLegendSwatchProps>(\n \"div\",\n \"legendSwatch\",\n)()\n\ninterface ChartLegendValueProps extends HTMLStyledProps<\"span\"> {}\n\nconst ChartLegendValue = withContext<\"span\", ChartLegendValueProps>(\n \"span\",\n \"legendValue\",\n)()\n\nexport interface ChartTooltipProps<\n Y extends (number | string)[] | number | string = number,\n M extends number | string = string,\n> extends Omit<Merge<HTMLStyledProps, UseChartTooltipProps<Y, M>>, \"cursor\"> {\n /**\n * Props for the cursor component.\n */\n cursor?: boolean | ChartTooltipCursorProps | ReactElement\n /**\n * Props for the content component.\n */\n contentProps?: Omit<\n ChartTooltipContentProps,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n >\n}\n\nexport const ChartTooltip = <\n Y extends (number | string)[] | number | string,\n M extends number | string,\n>(\n props: ChartTooltipProps<Y, M>,\n) => {\n const { tooltipProps } = useChartComponentContext()\n const {\n cursor = false,\n contentProps,\n ...rest\n } = {\n ...tooltipProps,\n ...props,\n } as ChartTooltipProps<Y, M>\n const { getContentProps, getRootProps } = useChartTooltip({\n content: ({ formatter, label, labelFormatter, payload }) => (\n <ChartTooltipContent\n formatter={formatter}\n label={label}\n labelFormatter={labelFormatter}\n payload={payload}\n {...getContentProps(contentProps)}\n />\n ),\n cursor:\n isValidElement(cursor) || !cursor ? (\n cursor\n ) : (\n <ChartTooltipCursor {...(isObject(cursor) ? cursor : {})} />\n ),\n ...rest,\n })\n\n return <Tooltip {...getRootProps()} />\n}\n\ninterface ChartTooltipCursorProps extends Omit<\n HTMLStyledProps<\"path\">,\n \"height\" | \"points\" | \"width\"\n> {\n brushBottom?: number\n height?: number\n payload?: Dict[]\n payloadIndex?: number\n points?: { x: number; y: number }[]\n width?: number\n}\n\nconst ChartTooltipCursor = withContext<\"path\", ChartTooltipCursorProps>(\n \"path\",\n \"tooltipCursor\",\n)(\n undefined,\n ({\n bottom: _bottom,\n brushBottom: _brushBottom,\n fill,\n height,\n left: _left,\n payload: _payload,\n payloadIndex: _payloadIndex,\n points,\n right: _right,\n stroke,\n top: _top,\n width,\n x,\n y,\n ...rest\n }) => {\n const d = !!points\n ? `M${points[0]?.x},${points[0]?.y}L${points[1]?.x},${points[1]?.y}`\n : `M ${x},${y} h ${width} v ${height} h -${width} Z`\n return {\n asChild: true,\n children: <path d={d} height={height} width={width} />,\n fill: fill === \"#ccc\" ? undefined : fill,\n stroke: stroke === \"#ccc\" ? undefined : stroke,\n ...rest,\n }\n },\n)\n\ninterface ChartTooltipContentProps\n extends\n HTMLStyledProps,\n Pick<\n TooltipContentProps<any, any>,\n \"formatter\" | \"label\" | \"labelFormatter\" | \"payload\"\n > {\n /**\n * If `true`, swatch is visible.\n */\n withSwatch?: boolean\n}\n\nconst ChartTooltipContent = withContext<\"div\", ChartTooltipContentProps>(\n ({\n formatter,\n label: labelProp,\n labelFormatter,\n payload,\n withSwatch = true,\n ...rest\n }) => {\n const { nameKeyRef, varMap } = useChartComponentContext()\n const label = labelFormatter\n ? labelFormatter(labelProp, payload)\n : labelProp\n\n return (\n <styled.div {...rest}>\n {!isUndefined(label) && !isNull(label) ? (\n <ChartTooltipLabel>{label}</ChartTooltipLabel>\n ) : null}\n\n <ChartTooltipList>\n {payload.map((data, index) => {\n if (nameKeyRef.current) data.name = data.payload[nameKeyRef.current]\n\n const color = data.payload.fill ?? varMap[data.dataKey.toString()]\n const result =\n formatter?.(data.value, data.name, data, index, payload) ??\n (isArray(data.value) ? data.value.join(\", \") : data.value)\n const [value, name] = isArray(result) ? result : [result, data.name]\n\n return (\n <ChartTooltipItem key={index}>\n {withSwatch ? <ChartTooltipSwatch bg={color} /> : null}\n <ChartTooltipName>{name}</ChartTooltipName>\n <ChartTooltipValue>{value}</ChartTooltipValue>\n </ChartTooltipItem>\n )\n })}\n </ChartTooltipList>\n </styled.div>\n )\n },\n \"tooltipContent\",\n)()\n\ninterface ChartTooltipLabel extends HTMLStyledProps<\"p\"> {}\n\nconst ChartTooltipLabel = withContext<\"p\", ChartTooltipLabel>(\n \"p\",\n \"tooltipLabel\",\n)()\n\ninterface ChartTooltipList extends HTMLStyledProps {}\n\nconst ChartTooltipList = withContext<\"div\", ChartTooltipList>(\n \"div\",\n \"tooltipList\",\n)()\n\ninterface ChartTooltipItem extends HTMLStyledProps {}\n\nconst ChartTooltipItem = withContext<\"div\", ChartTooltipItem>(\n \"div\",\n \"tooltipItem\",\n)()\n\ninterface ChartTooltipSwatch extends HTMLStyledProps {}\n\nconst ChartTooltipSwatch = withContext<\"div\", ChartTooltipSwatch>(\n \"div\",\n \"tooltipSwatch\",\n)()\n\ninterface ChartTooltipName extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipName = withContext<\"span\", ChartTooltipName>(\n \"span\",\n \"tooltipName\",\n)()\n\ninterface ChartTooltipValue extends HTMLStyledProps<\"span\"> {}\n\nconst ChartTooltipValue = withContext<\"span\", ChartTooltipValue>(\n \"span\",\n \"tooltipValue\",\n)()\n\nexport interface ChartLabelListProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelListProps\n> {}\n\nexport const ChartLabelList = withContext<\"text\", ChartLabelListProps>(\n (props) => {\n const { getLabelListProps, getRootProps } = useChartLabelList(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <LabelList {...getLabelListProps()} />\n </styled.text>\n )\n },\n \"labelList\",\n)()\n\nexport interface ChartLabelProps extends Merge<\n HTMLStyledProps<\"text\">,\n UseChartLabelProps\n> {}\n\nexport const ChartLabel = withContext<\"text\", ChartLabelProps>((props) => {\n const { getLabelProps, getRootProps } = useChartLabel(props)\n\n return (\n <styled.text asChild {...getRootProps()}>\n <Label {...getLabelProps()} />\n </styled.text>\n )\n}, \"label\")()\n"],"mappings":";;;;;;;;;;;;;;;;;AAyHA,SAAgB,YACd,QACA,QAA2B,QAC3B,WAA6B,UACQ;CACrC,MAAM,SAAS,UAAU,OAAO,QAAQ,OAAO,SAAS;AAExD,QAAO,OAAO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AK,MAAM,MAAM,OAAO,QAAQ,oDAC/C,KAAK,MAAM,GAAG,KAAK,MAAM,KAAK,KAAK,GAAG,KAAK;GACtD,MAAM,CAAC,OAAO,uDAAgB,OAAO,GAAG,SAAS,CAAC,QAAQ,KAAK,KAAK;AAEpE,UACE,4CAAC;IACE,aAAa,2CAAC,sBAAmB,IAAI,QAAS,GAAG;IAClD,2CAAC,8BAAkB,OAAwB;IAC3C,2CAAC,+BAAmB,QAA0B;QAHzB,MAIJ;IAErB,GACe;GACR;GAGjB,iBACD,EAAE;AAIH,MAAM,oBAAoB,YACxB,KACA,eACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,OACA,cACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,OACA,cACD,EAAE;AAIH,MAAM,qBAAqB,YACzB,OACA,gBACD,EAAE;AAIH,MAAM,mBAAmB,YACvB,QACA,cACD,EAAE;AAIH,MAAM,oBAAoB,YACxB,QACA,eACD,EAAE;AAOH,MAAa,iBAAiB,aAC3B,UAAU;CACT,MAAM,EAAE,mBAAmB,iBAAiBQ,oCAAkB,MAAM;AAEpE,QACE,2CAACR,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACS,sBAAU,GAAI,mBAAmB,GAAI;GAC1B;GAGlB,YACD,EAAE;AAOH,MAAa,aAAa,aAAsC,UAAU;CACxE,MAAM,EAAE,eAAe,iBAAiBC,gCAAc,MAAM;AAE5D,QACE,2CAACV,uBAAO;EAAK;EAAQ,GAAI,cAAc;YACrC,2CAACW,kBAAM,GAAI,eAAe,GAAI;GAClB;GAEf,QAAQ,EAAE"}
|
|
@@ -30,9 +30,7 @@ const DonutChart = withContext(({ children, series = [], chartProps, tooltipProp
|
|
|
30
30
|
}) }),
|
|
31
31
|
series,
|
|
32
32
|
tooltipProps: {
|
|
33
|
-
labelFormatter: (0, react.useCallback)((
|
|
34
|
-
return label ?? payload[0]?.dataKey;
|
|
35
|
-
}, []),
|
|
33
|
+
labelFormatter: (0, react.useCallback)(() => null, []),
|
|
36
34
|
...tooltipProps
|
|
37
35
|
},
|
|
38
36
|
...getRootProps(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"donut-chart.cjs","names":["createComponent","donutChartStyle","usePieChart","PolarChart","ChartDonut","OriginalPieChart"],"sources":["../../../../src/components/chart/donut-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { PolarChartProps as OriginalPolarChartProps } from \"recharts/types/util/types\"\nimport type { GenericsComponent, ThemeProps } from \"../../core\"\nimport type { Dict } from \"../../utils\"\nimport type { ChartTooltipProps } from \"./chart\"\nimport type { DonutChartStyle } from \"./donut-chart.style\"\nimport type { ChartDonutProps, PolarChartProps } from \"./polar-chart\"\nimport type { UsePieChartProps } from \"./use-pie-chart\"\nimport { useCallback, useMemo } from \"react\"\nimport { PieChart as OriginalPieChart } from \"recharts\"\nimport { createComponent } from \"../../core\"\nimport { donutChartStyle } from \"./donut-chart.style\"\nimport { ChartDonut, PolarChart } from \"./polar-chart\"\nimport { usePieChart } from \"./use-pie-chart\"\n\nexport interface DonutChartProps<Y extends Dict = Dict>\n extends\n Omit<\n PolarChartProps<Y>,\n | \"angleAxisProps\"\n | \"components\"\n | \"gridProps\"\n | \"nameKey\"\n | \"pieProps\"\n | \"radarProps\"\n | \"radiusAxisProps\"\n | \"render\"\n | \"series\"\n | \"withAngleAxis\"\n | \"withGrid\"\n | \"withRadiusAxis\"\n >,\n UsePieChartProps<Y>,\n ThemeProps<DonutChartStyle> {\n /***\n * If provided, generate lines based on series.\n */\n series?: ChartDonutProps<Y>[]\n /**\n * Props for the polar chart component.\n */\n chartProps?: Omit<OriginalPolarChartProps, \"data\">\n}\n\nconst {\n PropsContext: DonutChartPropsContext,\n usePropsContext: useDonutChartPropsContext,\n withContext,\n} = createComponent<DonutChartProps, DonutChartStyle>(\n \"donut-chart\",\n donutChartStyle,\n)\n\nexport { DonutChartPropsContext, useDonutChartPropsContext }\n\n/**\n * `DonutChart` is a component for drawing donut charts to compare multiple sets of data.\n *\n * @see https://yamada-ui.com/docs/components/donut-chart\n */\nexport const DonutChart = withContext<\"div\", DonutChartProps>(\n <Y extends Dict>({\n children,\n series = [],\n chartProps,\n tooltipProps,\n ...rest\n }: DonutChartProps<Y>) => {\n const { getChartProps, getRootProps } = usePieChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartDonut,\n fallback: series.map((props, index) => (\n <ChartDonut key={index} {...props} />\n )),\n },\n ],\n [series],\n )\n const labelFormatter = useCallback<\n NonNullable<ChartTooltipProps[\"labelFormatter\"]>\n >((
|
|
1
|
+
{"version":3,"file":"donut-chart.cjs","names":["createComponent","donutChartStyle","usePieChart","PolarChart","ChartDonut","OriginalPieChart"],"sources":["../../../../src/components/chart/donut-chart.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { PolarChartProps as OriginalPolarChartProps } from \"recharts/types/util/types\"\nimport type { GenericsComponent, ThemeProps } from \"../../core\"\nimport type { Dict } from \"../../utils\"\nimport type { ChartTooltipProps } from \"./chart\"\nimport type { DonutChartStyle } from \"./donut-chart.style\"\nimport type { ChartDonutProps, PolarChartProps } from \"./polar-chart\"\nimport type { UsePieChartProps } from \"./use-pie-chart\"\nimport { useCallback, useMemo } from \"react\"\nimport { PieChart as OriginalPieChart } from \"recharts\"\nimport { createComponent } from \"../../core\"\nimport { donutChartStyle } from \"./donut-chart.style\"\nimport { ChartDonut, PolarChart } from \"./polar-chart\"\nimport { usePieChart } from \"./use-pie-chart\"\n\nexport interface DonutChartProps<Y extends Dict = Dict>\n extends\n Omit<\n PolarChartProps<Y>,\n | \"angleAxisProps\"\n | \"components\"\n | \"gridProps\"\n | \"nameKey\"\n | \"pieProps\"\n | \"radarProps\"\n | \"radialProps\"\n | \"radiusAxisProps\"\n | \"render\"\n | \"series\"\n | \"withAngleAxis\"\n | \"withGrid\"\n | \"withRadiusAxis\"\n >,\n UsePieChartProps<Y>,\n ThemeProps<DonutChartStyle> {\n /***\n * If provided, generate lines based on series.\n */\n series?: ChartDonutProps<Y>[]\n /**\n * Props for the polar chart component.\n */\n chartProps?: Omit<OriginalPolarChartProps, \"data\">\n}\n\nconst {\n PropsContext: DonutChartPropsContext,\n usePropsContext: useDonutChartPropsContext,\n withContext,\n} = createComponent<DonutChartProps, DonutChartStyle>(\n \"donut-chart\",\n donutChartStyle,\n)\n\nexport { DonutChartPropsContext, useDonutChartPropsContext }\n\n/**\n * `DonutChart` is a component for drawing donut charts to compare multiple sets of data.\n *\n * @see https://yamada-ui.com/docs/components/donut-chart\n */\nexport const DonutChart = withContext<\"div\", DonutChartProps>(\n <Y extends Dict>({\n children,\n series = [],\n chartProps,\n tooltipProps,\n ...rest\n }: DonutChartProps<Y>) => {\n const { getChartProps, getRootProps } = usePieChart(rest)\n const components = useMemo(\n () => [\n {\n component: ChartDonut,\n fallback: series.map((props, index) => (\n <ChartDonut key={index} {...props} />\n )),\n },\n ],\n [series],\n )\n const labelFormatter = useCallback<\n NonNullable<ChartTooltipProps[\"labelFormatter\"]>\n >(() => null, [])\n\n return (\n <PolarChart\n components={components}\n render={(props) => (\n <OriginalPieChart {...getChartProps({ ...props, ...chartProps })} />\n )}\n series={series}\n tooltipProps={{ labelFormatter, ...tooltipProps }}\n {...getRootProps()}\n >\n {children}\n </PolarChart>\n )\n },\n)() as GenericsComponent<{\n <Y extends Dict>(props: DonutChartProps<Y>): ReactElement\n}>\n"],"mappings":";;;;;;;;;;;;;AA+CA,MAAM,EACJ,cAAc,wBACd,iBAAiB,2BACjB,gBACEA,yCACF,eACAC,0CACD;;;;;;AASD,MAAa,aAAa,aACP,EACf,UACA,SAAS,EAAE,EACX,YACA,cACA,GAAG,WACqB;CACxB,MAAM,EAAE,eAAe,iBAAiBC,kCAAY,KAAK;AAgBzD,QACE,2CAACC;EACC,qCAhBI,CACJ;GACE,WAAWC;GACX,UAAU,OAAO,KAAK,OAAO,UAC3B,2CAACA,kCAAuB,GAAI,SAAX,MAAoB,CACrC;GACH,CACF,EACD,CAAC,OAAO,CACT;EAQG,SAAS,UACP,2CAACC,qBAAiB,GAAI,cAAc;GAAE,GAAG;GAAO,GAAG;GAAY,CAAC,GAAI;EAE9D;EACR,cAAc;GAAE,6CATZ,MAAM,EAAE,CAAC;GASmB,GAAG;GAAc;EACjD,GAAI,cAAc;EAEjB;GACU;EAGlB,EAAE"}
|
|
@@ -7,6 +7,7 @@ const require_donut_chart_style = require('./donut-chart.style.cjs');
|
|
|
7
7
|
const require_line_chart_style = require('./line-chart.style.cjs');
|
|
8
8
|
const require_polar_chart_style = require('./polar-chart.style.cjs');
|
|
9
9
|
const require_radar_chart_style = require('./radar-chart.style.cjs');
|
|
10
|
+
const require_radial_chart_style = require('./radial-chart.style.cjs');
|
|
10
11
|
const require_use_chart = require('./use-chart.cjs');
|
|
11
12
|
const require_chart = require('./chart.cjs');
|
|
12
13
|
const require_use_cartesian_chart = require('./use-cartesian-chart.cjs');
|
|
@@ -24,6 +25,8 @@ const require_line_chart_namespace = require('./line-chart.namespace.cjs');
|
|
|
24
25
|
const require_pie_chart_namespace = require('./pie-chart.namespace.cjs');
|
|
25
26
|
const require_use_radar_chart = require('./use-radar-chart.cjs');
|
|
26
27
|
const require_radar_chart_namespace = require('./radar-chart.namespace.cjs');
|
|
28
|
+
const require_use_radial_chart = require('./use-radial-chart.cjs');
|
|
29
|
+
const require_radial_chart_namespace = require('./radial-chart.namespace.cjs');
|
|
27
30
|
|
|
28
31
|
Object.defineProperty(exports, 'AreaChart', {
|
|
29
32
|
enumerable: true,
|
|
@@ -53,6 +56,7 @@ exports.ChartPie = require_polar_chart.ChartPie;
|
|
|
53
56
|
exports.ChartPolarGrid = require_polar_chart.ChartPolarGrid;
|
|
54
57
|
exports.ChartPropsContext = require_chart.ChartPropsContext;
|
|
55
58
|
exports.ChartRadar = require_polar_chart.ChartRadar;
|
|
59
|
+
exports.ChartRadial = require_polar_chart.ChartRadial;
|
|
56
60
|
exports.ChartRadiusAxis = require_polar_chart.ChartRadiusAxis;
|
|
57
61
|
exports.ChartReferenceLine = require_cartesian_chart.ChartReferenceLine;
|
|
58
62
|
exports.ChartTooltip = require_chart.ChartTooltip;
|
|
@@ -83,6 +87,12 @@ Object.defineProperty(exports, 'RadarChart', {
|
|
|
83
87
|
return require_radar_chart_namespace.radar_chart_namespace_exports;
|
|
84
88
|
}
|
|
85
89
|
});
|
|
90
|
+
Object.defineProperty(exports, 'RadialChart', {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return require_radial_chart_namespace.radial_chart_namespace_exports;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
86
96
|
exports.areaChartStyle = require_area_chart_style.areaChartStyle;
|
|
87
97
|
exports.barChartStyle = require_bar_chart_style.barChartStyle;
|
|
88
98
|
exports.cartesianChartStyle = require_cartesian_chart_style.cartesianChartStyle;
|
|
@@ -92,6 +102,7 @@ exports.lineChartStyle = require_line_chart_style.lineChartStyle;
|
|
|
92
102
|
exports.pieChartStyle = require_pie_chart_style.pieChartStyle;
|
|
93
103
|
exports.polarChartStyle = require_polar_chart_style.polarChartStyle;
|
|
94
104
|
exports.radarChartStyle = require_radar_chart_style.radarChartStyle;
|
|
105
|
+
exports.radialChartStyle = require_radial_chart_style.radialChartStyle;
|
|
95
106
|
exports.useAngleAxis = require_use_polar_chart.useAngleAxis;
|
|
96
107
|
exports.useAreaChart = require_use_area_chart.useAreaChart;
|
|
97
108
|
exports.useBarChart = require_use_bar_chart.useBarChart;
|
|
@@ -109,6 +120,7 @@ exports.useChartPieLabel = require_use_polar_chart.useChartPieLabel;
|
|
|
109
120
|
exports.useChartPieLabelLine = require_use_polar_chart.useChartPieLabelLine;
|
|
110
121
|
exports.useChartPropsContext = require_chart.useChartPropsContext;
|
|
111
122
|
exports.useChartRadar = require_use_polar_chart.useChartRadar;
|
|
123
|
+
exports.useChartRadial = require_use_polar_chart.useChartRadial;
|
|
112
124
|
exports.useChartReferenceLine = require_use_cartesian_chart.useChartReferenceLine;
|
|
113
125
|
exports.useChartSector = require_use_polar_chart.useChartSector;
|
|
114
126
|
exports.useChartTooltip = require_use_chart.useChartTooltip;
|
|
@@ -118,4 +130,5 @@ exports.useLineChart = require_use_line_chart.useLineChart;
|
|
|
118
130
|
exports.usePieChart = require_use_pie_chart.usePieChart;
|
|
119
131
|
exports.usePolarGrid = require_use_polar_chart.usePolarGrid;
|
|
120
132
|
exports.useRadarChart = require_use_radar_chart.useRadarChart;
|
|
133
|
+
exports.useRadialChart = require_use_radial_chart.useRadialChart;
|
|
121
134
|
exports.useRadiusAxis = require_use_polar_chart.useRadiusAxis;
|
|
@@ -30,9 +30,7 @@ const PieChart = withContext(({ children, series = [], chartProps, tooltipProps,
|
|
|
30
30
|
}) }),
|
|
31
31
|
series,
|
|
32
32
|
tooltipProps: {
|
|
33
|
-
labelFormatter: (0, react.useCallback)((
|
|
34
|
-
return label ?? payload[0]?.dataKey;
|
|
35
|
-
}, []),
|
|
33
|
+
labelFormatter: (0, react.useCallback)(() => null, []),
|
|
36
34
|
...tooltipProps
|
|
37
35
|
},
|
|
38
36
|
...getRootProps(),
|