Skip to content

Commit

Permalink
fix: Tracker mobile (#2)
Browse files Browse the repository at this point in the history
* update tracker onclick

* update order utils
  • Loading branch information
severinlandolt authored Mar 26, 2024
1 parent 4afeb42 commit 4e57bb9
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
12 changes: 9 additions & 3 deletions src/components/Tracker/Tracker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Tremor Raw Tracker [v0.0.0]
// Tremor Raw Tracker [v0.0.1]

import React from "react"
import * as HoverCardPrimitives from "@radix-ui/react-hover-card"
Expand All @@ -18,9 +18,15 @@ const Block = ({
}: TrackerBlockProps & {
defaultBackgroundColor?: string
}) => {
const [open, setOpen] = React.useState(false)
return (
<HoverCardPrimitives.Root openDelay={0} closeDelay={0}>
<HoverCardPrimitives.Trigger asChild>
<HoverCardPrimitives.Root
open={open}
onOpenChange={setOpen}
openDelay={0}
closeDelay={0}
>
<HoverCardPrimitives.Trigger onClick={() => setOpen(true)} asChild>
<div
className={cx(
"h-full w-full rounded-[1px] first:rounded-l-[4px] last:rounded-r-[4px]",
Expand Down
4 changes: 3 additions & 1 deletion src/components/Tracker/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tremor Raw Tracker Changelog

## 0.0.0
## 0.0.1

### Changes

* Added onClick event to HoverCard to make tracker appear on touch devices.
4 changes: 3 additions & 1 deletion src/utils/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tremor Raw utils Changelog

## 0.0.0
## 0.0.1

### Changes

* Updated sort order focusInput, focusRing, hasErrorInput
12 changes: 9 additions & 3 deletions src/utils/focusInput.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// Tremor Raw focusInput [v0.0.0]
// Tremor Raw focusInput [v0.0.1]

export const focusInput =
"focus:ring-2 focus:ring-blue-200 focus:border-blue-500 focus:dark:ring-blue-700/30 focus:dark:border-blue-700"
export const focusInput = [
// base
"focus:ring-2",
// ring color
"focus:ring-blue-200 focus:dark:ring-blue-700/30",
// border color
"focus:border-blue-500 focus:dark:border-blue-700",
]
10 changes: 4 additions & 6 deletions src/utils/focusRing.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Tremor Raw focusRing [v0.0.0]
// Tremor Raw focusRing [v0.0.1]

export const focusRing = [
// base
"outline outline-blue-500 outline-offset-2 outline-0",
// dark
"dark:outline-blue-500",
// focus-visible
"focus-visible:outline-2",
"outline outline-offset-2 outline-0 focus-visible:outline-2",
// outline color
"outline-blue-500 dark:outline-blue-500",
]
12 changes: 9 additions & 3 deletions src/utils/hasErrorInput.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// Tremor Raw hasErrorInput [v0.0.0]
// Tremor Raw hasErrorInput [v0.0.1]

export const hasErrorInput =
"border-red-500 ring-2 ring-red-200 dark:border-red-700 dark:ring-red-700/30"
export const hasErrorInput = [
// base
"ring-2",
// border color
"border-red-500 dark:border-red-700",
// ring color
"ring-red-200 dark:ring-red-700/30",
]

0 comments on commit 4e57bb9

Please sign in to comment.