@clickhouse/click-ui 0.0.39 → 0.0.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +1,42 @@
1
- import { HTMLAttributes, ReactElement, RefObject, ReactNode } from "react";
1
+ /// <reference types="sortablejs" />
2
+ import { HTMLAttributes, ReactElement, ReactNode } from "react";
2
3
  import { IconName } from "../Icon/types";
3
- export type StatusType = "default" | "success" | "neutral" | "danger" | "warning" | "info";
4
+ import { ItemInterface, ReactSortableProps, Sortable, Store } from "react-sortablejs";
5
+ export type FileTabStatusType = "default" | "success" | "neutral" | "danger" | "warning" | "info";
4
6
  interface ContextProps {
5
- selected?: string;
6
- list: Array<string>;
7
- updateOrder: (order: number) => void;
8
- dragElementContainer: RefObject<HTMLDivElement>;
9
- onSelect: (value: string) => void;
10
- onClose: (value: string) => void;
7
+ selectedIndex?: number;
8
+ onClose: (index: number) => void;
11
9
  }
12
10
  export declare const TabContext: import("react").Context<ContextProps>;
13
- interface TabProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
11
+ export interface FileTabProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
14
12
  onClose?: () => void;
15
- value: string;
16
- status?: StatusType;
13
+ index: number;
14
+ status?: FileTabStatusType;
17
15
  icon?: IconName | ReactNode;
18
16
  text: string;
19
17
  testId?: string;
18
+ preview?: boolean;
20
19
  }
21
- interface Props extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClose" | "onSelect"> {
22
- selected?: string;
23
- children: ReactElement<TabProps> | Array<ReactElement<TabProps>>;
24
- onReorderTab: (props: {
25
- sourcePosition: number;
26
- destinationPosition: number;
27
- sourceValue: string;
28
- }) => void;
29
- onClose: (value: string, index: number) => void;
30
- onSelect: (value: string, index: number) => void;
20
+ export interface FileTabsProps extends Omit<ReactSortableProps<ItemInterface>, "onSelect" | "list" | "setList"> {
21
+ selectedIndex?: number;
22
+ children: ReactElement<FileTabProps> | Array<ReactElement<FileTabProps>>;
23
+ onReorderTab: (sourcePosition: number, destinationPosition: number) => void;
24
+ onClose: (index: number) => void;
25
+ onSelect: (index: number) => void;
26
+ list?: Array<ItemInterface>;
27
+ setList?: (newState: Array<ItemInterface>, sortable: Sortable | null, store: Store) => void;
31
28
  }
32
29
  export declare const FileTabs: {
33
- ({ selected, children, onReorderTab, onMouseLeave: onMouseLeaveProp, onClose: onCloseProp, onSelect: onSelectProp, ...props }: Props): import("react/jsx-runtime").JSX.Element;
30
+ ({ selectedIndex, children, onReorderTab, onClose: onCloseProp, onSelect: onSelectProp, list: listProp, setList: setListProp, onEnd, direction, group, ...props }: FileTabsProps): import("react/jsx-runtime").JSX.Element;
34
31
  Tab: {
35
- ({ text, value, icon, onMouseDown: onMouseDownProp, status, testId, ...props }: TabProps): import("react/jsx-runtime").JSX.Element;
32
+ ({ text, index, icon, onMouseDown: onMouseDownProp, status, testId, preview, ...props }: FileTabProps): import("react/jsx-runtime").JSX.Element;
36
33
  displayName: string;
37
34
  };
38
35
  };
36
+ interface FileTabElementProps extends HTMLAttributes<HTMLDivElement> {
37
+ icon?: IconName | ReactNode;
38
+ active?: boolean;
39
+ preview?: boolean;
40
+ }
41
+ export declare const FileTabElement: ({ icon, children, active, preview, ...props }: FileTabElementProps) => import("react/jsx-runtime").JSX.Element;
39
42
  export {};
@@ -39,7 +39,7 @@ export { Spacer } from "./Spacer/Spacer";
39
39
  export { SplitButton } from "./SplitButton/SplitButton";
40
40
  export { Switch } from "./Switch/Switch";
41
41
  export { Tabs } from "./Tabs/Tabs";
42
- export { FileTabs } from "./FileTabs/FileTabs";
42
+ export { FileTabs, FileTabElement } from "./FileTabs/FileTabs";
43
43
  export { Table } from "./Table/Table";
44
44
  export { Text } from "./Typography/Text/Text";
45
45
  export { TextField } from "./Input/TextField";
@@ -34,6 +34,7 @@ export type { PanelProps } from "./Panel/Panel";
34
34
  export type { FlyoutProps, FlyoutFooterProps, FlyoutHeaderProps } from "./Flyout/Flyout";
35
35
  export type { DialogContentProps } from "./Dialog/Dialog";
36
36
  export type { DialogProps, DialogTriggerProps } from "@radix-ui/react-dialog";
37
+ export type { FileTabStatusType } from "./FileTabs/FileTabs";
37
38
  export type States = "default" | "active" | "disabled" | "error" | "hover";
38
39
  export type HorizontalDirection = "start" | "end";
39
40
  export type Orientation = "horizontal" | "vertical";
@@ -2222,6 +2222,7 @@ export interface Theme {
2222
2222
  "background": {
2223
2223
  "default": string;
2224
2224
  "muted": string;
2225
+ "sidebar": string;
2225
2226
  };
2226
2227
  "text": {
2227
2228
  "default": string;
@@ -566,7 +566,8 @@ declare const _default: {
566
566
  "color": {
567
567
  "background": {
568
568
  "default": "#ffffff",
569
- "muted": "#f6f7fa"
569
+ "muted": "#f6f7fa",
570
+ "sidebar": "#2f2c3a"
570
571
  },
571
572
  "text": {
572
573
  "default": "#161517",
@@ -1162,7 +1162,8 @@ declare const _default: {
1162
1162
  "color": {
1163
1163
  "background": {
1164
1164
  "default": "#1F1F1C",
1165
- "muted": "#282828"
1165
+ "muted": "#282828",
1166
+ "sidebar": "#1F1F1C"
1166
1167
  },
1167
1168
  "text": {
1168
1169
  "default": "#ffffff",
@@ -2221,7 +2221,8 @@ declare const _default: {
2221
2221
  "color": {
2222
2222
  "background": {
2223
2223
  "default": "#ffffff",
2224
- "muted": "#f6f7fa"
2224
+ "muted": "#f6f7fa",
2225
+ "sidebar": "#ffffff"
2225
2226
  },
2226
2227
  "text": {
2227
2228
  "default": "#161517",
@@ -1155,7 +1155,8 @@ declare const _default: {
1155
1155
  "color": {
1156
1156
  "background": {
1157
1157
  "default": "#ffffff",
1158
- "muted": "#f6f7fa"
1158
+ "muted": "#f6f7fa",
1159
+ "sidebar": "#ffffff"
1159
1160
  },
1160
1161
  "text": {
1161
1162
  "default": "#161517",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.39",
3
+ "version": "0.0.40",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",