Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tracker, order utils, table types #3

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<br />

![Tremor Banner](public/images/tremor_raw_banner_11.png)
![Tremor Banner](public/images/tremor-raw-banner.png)

<br />

Expand Down
Binary file added public/images/tremor-raw-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/tremor_raw_banner_11.png
Binary file not shown.
6 changes: 3 additions & 3 deletions src/components/BarList/BarList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Tremor Raw BarList [v0.0.0]
// Tremor Raw BarList [v0.0.1]

import React from "react"

Expand Down Expand Up @@ -73,7 +73,7 @@ function BarListInner<T>(
focusRing,
onValueChange
? [
"!-m-px cursor-pointer",
"!-m-0 cursor-pointer",
// hover
"hover:bg-gray-50 hover:dark:bg-gray-900",
]
Expand All @@ -98,7 +98,7 @@ function BarListInner<T>(
)}
style={{ width: `${widths[index]}%` }}
>
<div className={cx("absolute left-2 flex max-w-full")}>
<div className={cx("absolute left-2 flex pr-2 max-w-full")}>
{item.href ? (
<a
href={item.href}
Expand Down
8 changes: 7 additions & 1 deletion src/components/BarList/barlist.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,15 @@ export const WithOnValueChangeAndHref: Story = {
},
}

export const DataSame: Story = {
export const DataSameWithOnValueChange: Story = {
args: {
onValueChange: () => {},
data: dataSame,
},
}

export const DataSame: Story = {
args: {
data: dataSame,
},
}
5 changes: 4 additions & 1 deletion src/components/BarList/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Tremor Raw BarList Changelog

## 0.0.0
## 0.0.1

### Changes

* Improve spacing when bar is a button.
* Improve padding for long labels.
8 changes: 4 additions & 4 deletions src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Tremor Raw Table [v0.0.0]
// Tremor Raw Table [v0.0.1]

import React from "react"

Expand Down Expand Up @@ -27,7 +27,7 @@ TableRoot.displayName = "TableRoot"

const Table = React.forwardRef<
HTMLTableElement,
React.HTMLAttributes<HTMLTableElement>
React.TableHTMLAttributes<HTMLTableElement>
>(({ className, ...props }, forwardedRef) => (
<table
ref={forwardedRef}
Expand Down Expand Up @@ -55,7 +55,7 @@ TableHead.displayName = "TableHead"

const TableHeaderCell = React.forwardRef<
HTMLTableCellElement,
React.TdHTMLAttributes<HTMLTableCellElement>
React.ThHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, forwardedRef) => (
<th
ref={forwardedRef}
Expand Down Expand Up @@ -112,7 +112,7 @@ TableRow.displayName = "TableRow"

const TableCell = React.forwardRef<
HTMLTableCellElement,
React.HTMLAttributes<HTMLTableCellElement>
React.TdHTMLAttributes<HTMLTableCellElement>
>(({ className, ...props }, forwardedRef) => (
<td
ref={forwardedRef}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Table/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tremor Raw Table Changelog

## 0.0.0
## 0.0.1

### Changes

* Improved types of table elements: Table, TableHeaderCell, TableCell
6 changes: 3 additions & 3 deletions src/components/Toast/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const Toast = React.forwardRef<
// background color
" bg-white dark:bg-[#090E1A]",
// border color
"border-gray-200 dark:border-gray-900",
"border-gray-200 dark:border-gray-800",
// swipe
"data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none",
// transition
Expand All @@ -132,7 +132,7 @@ const Toast = React.forwardRef<
"flex flex-1 items-start gap-3 p-4",
// border
!disableDismiss || action
? "border-r border-gray-200 dark:border-gray-900"
? "border-r border-gray-200 dark:border-gray-800"
: "",
)}
>
Expand Down Expand Up @@ -176,7 +176,7 @@ const Toast = React.forwardRef<
>
{action.label}
</ToastPrimitives.Action>
<div className="h-px w-full bg-gray-200 dark:bg-gray-900" />
<div className="h-px w-full bg-gray-200 dark:bg-gray-800" />
</>
)}
{!disableDismiss && (
Expand Down
4 changes: 3 additions & 1 deletion src/components/Toast/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tremor Raw Toast Changelog

## 0.0.0
## 0.0.1

### Changes

* Improved dark mode visbility
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",
]