Skip to content

Commit

Permalink
Merge branch 'beta' into feat/legend-scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
severinlandolt authored Oct 23, 2023
2 parents a804e2c + 2a0df8f commit 25b7fb5
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 55 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"@storybook/theming": "^7.4.6",
"@testing-library/react": "^13.1.1",
"@types/jest": "^27.4.1",
"@types/node": "^20.8.7",
"@types/react": "^18.0.5",
"@types/react-transition-group": "^4.4.5",
"@typescript-eslint/eslint-plugin": "^6.7.5",
Expand Down
73 changes: 41 additions & 32 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/components/chart-elements/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
/>
) : null}
<XAxis
padding={{ left: 20, right: 20 }}
hide={!showXAxis}
dataKey={index}
tick={{ transform: "translate(0, 6)" }}
Expand All @@ -176,7 +177,7 @@ const AreaChart = React.forwardRef<HTMLDivElement, AreaChartProps>((props, ref)
// dark
"dark:fill-dark-tremor-content",
)}
interval={intervalType}
interval={startEndOnly ? "preserveStartEnd" : intervalType}
tickLine={false}
axisLine={false}
minTickGap={5}
Expand Down
3 changes: 2 additions & 1 deletion src/components/chart-elements/BarChart/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>((props, ref) =>

{layout !== "vertical" ? (
<XAxis
padding={{ left: 20, right: 20 }}
hide={!showXAxis}
dataKey={index}
interval={intervalType}
interval={startEndOnly ? "preserveStartEnd" : intervalType}
tick={{ transform: "translate(0, 6)" }}
ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined}
fill=""
Expand Down
3 changes: 2 additions & 1 deletion src/components/chart-elements/LineChart/LineChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>((props, ref)
/>
) : null}
<XAxis
padding={{ left: 20, right: 20 }}
hide={!showXAxis}
dataKey={index}
interval={intervalType}
interval={startEndOnly ? "preserveStartEnd" : intervalType}
tick={{ transform: "translate(0, 6)" }}
ticks={startEndOnly ? [data[0][index], data[data.length - 1][index]] : undefined}
fill=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const ScatterChart = React.forwardRef<HTMLDivElement, ScatterChartProps>((props,
<XAxis
hide={!showXAxis}
dataKey={x}
interval={intervalType}
interval={startEndOnly ? "preserveStartEnd" : intervalType}
tick={{ transform: "translate(0, 6)" }}
ticks={startEndOnly ? [data[0][x], data[data.length - 1][x]] : undefined}
type="number"
Expand Down
14 changes: 3 additions & 11 deletions src/components/input-elements/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,14 @@ const Switch = React.forwardRef<HTMLDivElement, SwitchProps>((props, ref) => {
<span className={tremorTwMerge(makeSwitchClassName("sr-only"), "sr-only")}>
Switch {isChecked ? "on" : "off"}
</span>
{/* <span
aria-hidden="true"
className={tremorTwMerge(
makeSwitchClassName("background"),
"pointer-events-none absolute h-full w-full rounded-md bg-white",
)}
/> */}
<span
aria-hidden="true"
className={tremorTwMerge(
makeSwitchClassName("background"),
isChecked
? getColorClassNames(color, colorPalette.background).bgColor
: "bg-tremor-content-subtle dark:bg-dark-tremor-content-subtle",
"pointer-events-none absolute mx-auto h-3.5 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out",
: "bg-tremor-border dark:bg-dark-tremor-border",
"pointer-events-none absolute mx-auto h-3 w-9 rounded-tremor-full transition-colors duration-100 ease-in-out",
)}
/>
<span
Expand All @@ -103,8 +96,7 @@ const Switch = React.forwardRef<HTMLDivElement, SwitchProps>((props, ref) => {
getColorClassNames(color, colorPalette.background).bgColor,
"translate-x-5 border-white",
)
: "translate-x-0 bg-tremor-content-subtle dark:bg-dark-tremor-content-subtle border-white",

: "translate-x-0 bg-tremor-border dark:bg-dark-tremor-border border-white",
"pointer-events-none absolute left-0 inline-block h-5 w-5 transform rounded-tremor-full border-2 shadow-tremor-input duration-100 ease-in-out transition",
isFocused ? tremorTwMerge("ring-2 ring-blue-200") : "",
)}
Expand Down
Loading

0 comments on commit 25b7fb5

Please sign in to comment.