Skip to content

Commit

Permalink
Fix common issues (#178)
Browse files Browse the repository at this point in the history
* Fix TabProps

* Add htmlattributes for text based elements

* Add Table Import
  • Loading branch information
vineethasok authored Oct 18, 2023
1 parent eb264a2 commit 1d5e3db
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
13 changes: 2 additions & 11 deletions src/components/Tabs/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import * as RadixTabs from "@radix-ui/react-tabs";
import styled from "styled-components";

export type TabProps = {
label: React.ReactNode;
value: string;
children?: React.ReactNode;
};

export type TabsProps = {
defaultValue?: string;
export interface TabsProps extends RadixTabs.TabsProps {
ariaLabel?: string;
onValueChange?: (s: string) => unknown;
children: React.ReactElement<TabProps>[] | React.ReactElement<TabProps>;
};
}

const Trigger = styled(RadixTabs.Trigger)`
border: none;
Expand Down
4 changes: 2 additions & 2 deletions src/components/Typography/Text/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { HTMLAttributes } from "react";
import styled from "styled-components";

export type TextColor = "default" | "muted";
export type TextSize = "xs" | "sm" | "md" | "lg";
export type TextWeight = "normal" | "medium" | "semibold" | "bold" | "mono";

export interface TextProps {
export interface TextProps extends HTMLAttributes<HTMLParagraphElement> {
color?: TextColor;
size?: TextSize;
weight?: TextWeight;
className?: string;
children?: React.ReactNode;
}

/** Component for writing blocks of body copy */
Expand Down
5 changes: 2 additions & 3 deletions src/components/Typography/Title/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import React from "react";
import { HTMLAttributes } from "react";
import styled from "styled-components";
export type TitleColor = "default" | "muted";
export type TitleSize = "xs" | "sm" | "md" | "lg" | "xl";
export type TitleFamily = "product" | "brand";
export type TitleType = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";

export interface TitleProps {
export interface TitleProps extends HTMLAttributes<HTMLHeadingElement> {
color?: TitleColor;
size?: TitleSize;
family?: TitleFamily;
type: TitleType;
children?: React.ReactNode;
}

/** The `title` component allows you to easily add headings to your pages. They do not include built in margins. */
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export { SplitButton } from "./SplitButton/SplitButton";
export { Switch } from "./Switch/Switch";
export { Tabs } from "./Tabs/Tabs";
export { FileTabs } from "./FileTabs/FileTabs";
export { Table } from "./Table/Table";
export { Text } from "./Typography/Text/Text";
export { TextField } from "./Input/TextField";
export { Title } from "./Typography/Title/Title";
Expand Down

1 comment on commit 1d5e3db

@vercel
Copy link

@vercel vercel bot commented on 1d5e3db Oct 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

click-ui – ./

click-ui-git-main-clickhouse.vercel.app
click-ui.vercel.app
click-ui-clickhouse.vercel.app

Please sign in to comment.