diff --git a/README.md b/README.md index b611764bd..af7e3f2ae 100644 --- a/README.md +++ b/README.md @@ -110,4 +110,4 @@ We are always looking for new ideas or other ways to improve Tremor. If you have [Apache License 2.0](https://github.com/tremorlabs/tremor/blob/main/License) -Copyright © 2024 Tremor. All rights reserved. +Copyright © 2024 Tremor Labs, Inc. All rights reserved. diff --git a/src/components/chart-elements/BarChart/BarChart.tsx b/src/components/chart-elements/BarChart/BarChart.tsx index 661ad2f13..186a1c1d9 100644 --- a/src/components/chart-elements/BarChart/BarChart.tsx +++ b/src/components/chart-elements/BarChart/BarChart.tsx @@ -60,6 +60,7 @@ export interface BarChartProps extends BaseChartProps { layout?: "vertical" | "horizontal"; stack?: boolean; relative?: boolean; + barCategoryGap?: string | number; } const BarChart = React.forwardRef((props, ref) => { @@ -91,6 +92,7 @@ const BarChart = React.forwardRef((props, ref) => enableLegendSlider = false, customTooltip, rotateLabelX, + barCategoryGap, tickGap = 5, className, ...other @@ -145,6 +147,7 @@ const BarChart = React.forwardRef((props, ref) => {data?.length ? ( { defaultValue?: string | number; @@ -10,6 +11,7 @@ export interface TextareaProps extends React.TextareaHTMLAttributes void; } @@ -26,6 +28,7 @@ const Textarea = React.forwardRef((props, re className, onChange, onValueChange, + autoHeight = false, ...other } = props; const [val, setVal] = useInternalState(defaultValue, value); @@ -34,6 +37,16 @@ const Textarea = React.forwardRef((props, re const hasSelection = hasValue(val); + useEffect(() => { + const textAreaHTMLRef = inputRef.current; + if (autoHeight && textAreaHTMLRef) { + textAreaHTMLRef.style.height = "60px"; + // Calculates the height dynamically + const scrollHeight = textAreaHTMLRef.scrollHeight; + textAreaHTMLRef.style.height = scrollHeight + "px"; + } + }, [autoHeight, inputRef, val]); + return ( <>