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

Export Panel types #466

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 1 addition & 3 deletions src/components/Panel/Panel.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { Orientation } from "@/components";
import { HTMLAttributes } from "react";
import styled from "styled-components";
import { PanelColor, PanelPadding, PanelRadii } from "@/components/Panel/types.ts";

export type PanelPadding = "none" | "xs" | "sm" | "md" | "lg" | "xl";
export type PanelColor = "default" | "muted" | "transparent";
export type PanelRadii = "none" | "sm" | "md" | "lg";
type AlignItemsOption = "start" | "center" | "end";

export interface PanelProps extends HTMLAttributes<HTMLDivElement> {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Panel/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type PanelPadding = "none" | "xs" | "sm" | "md" | "lg" | "xl";
export type PanelColor = "default" | "muted" | "transparent";
export type PanelRadii = "none" | "sm" | "md" | "lg";
Copy link
Collaborator

@fneves fneves Aug 23, 2024

Choose a reason for hiding this comment

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

these come from the Theme and are centralised. These should not be specified here.
They should be common to all components that use sizing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Firefds Why are we exporting these?
Where are we using this?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@vineethasok I also had the need to use these types before, whenever we are trying to specify something on a variable and not inputting them directly in the component.
For one reason or another this seems to be required to be exported from ClickUI.

These should be centralised and exported.

@Firefds one way I was able to deal without the import of the specific type in my code was to specify something like PanelProps['color']

1 change: 1 addition & 0 deletions src/components/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export type {
export type { PaginationProps } from "./Pagination/Pagination";
export type { ContextMenuItemProps } from "./ContextMenu/ContextMenu";
export type { GenericLabelProps } from "./GenericLabel/GenericLabel";
export type { PanelPadding, PanelColor, PanelRadii } from "./Panel/types";

export type { IconButtonProps };
export type { AlertProps };
Expand Down
Loading