@clickhouse/click-ui 0.0.83 → 0.0.84

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.
@@ -0,0 +1,73 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import { PopoverProps } from "@radix-ui/react-popover";
3
+ import { HorizontalDirection, IconName } from '../../components';
4
+ type DivProps = HTMLAttributes<HTMLDivElement>;
5
+ interface SelectItemComponentProps extends Omit<DivProps, "disabled" | "onSelect" | "value" | "children"> {
6
+ separator?: boolean;
7
+ disabled?: boolean;
8
+ onSelect?: (value: string) => void;
9
+ value: string;
10
+ icon?: IconName;
11
+ iconDir?: HorizontalDirection;
12
+ }
13
+ type SelectItemChildren = {
14
+ children: ReactNode;
15
+ label?: never;
16
+ };
17
+ type SelectItemLabel = {
18
+ children?: never;
19
+ label: ReactNode;
20
+ };
21
+ export interface SelectGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "heading"> {
22
+ heading: ReactNode;
23
+ value?: never;
24
+ onSelect?: never;
25
+ }
26
+ export interface SelectOptionItem extends Omit<SelectItemProps, "children" | "label"> {
27
+ heading?: never;
28
+ label: ReactNode;
29
+ [key: `data-${string}`]: string;
30
+ }
31
+ interface SelectGroupOptionItem extends Omit<SelectGroupProps, "children" | "label"> {
32
+ options: Array<SelectOptionItem>;
33
+ label?: never;
34
+ [key: `data-${string}`]: string;
35
+ }
36
+ export type SelectOptionListItem = SelectGroupOptionItem | SelectOptionItem;
37
+ export type SelectItemProps = SelectItemComponentProps & (SelectItemChildren | SelectItemLabel);
38
+ type SelectOptionType = {
39
+ options: Array<SelectOptionListItem>;
40
+ children?: never;
41
+ };
42
+ type SelectChildrenType = {
43
+ children: ReactNode;
44
+ options?: never;
45
+ };
46
+ interface Props extends PopoverProps, Omit<DivProps, "onChange" | "dir" | "onSelect" | "children"> {
47
+ onSelect?: (value: string) => void;
48
+ value?: string;
49
+ placeholder?: string;
50
+ onOpenChange?: (open: boolean) => void;
51
+ label?: ReactNode;
52
+ error?: ReactNode;
53
+ disabled?: boolean;
54
+ dir?: "start" | "end";
55
+ orientation?: "horizontal" | "vertical";
56
+ allowCreateOption?: boolean;
57
+ }
58
+ export type AutoCompleteProps = (SelectOptionType & Props) | (SelectChildrenType & Props);
59
+ export declare const SelectPopoverRoot: import("styled-components").IStyledComponent<"web", {
60
+ children?: ReactNode;
61
+ open?: boolean | undefined;
62
+ defaultOpen?: boolean | undefined;
63
+ onOpenChange?: ((open: boolean) => void) | undefined;
64
+ modal?: boolean | undefined;
65
+ }>;
66
+ export declare const AutoComplete: {
67
+ ({ onSelect: onSelectProp, options, children, onOpenChange: onOpenChangeProp, disabled, value, placeholder, ...props }: AutoCompleteProps): import("react/jsx-runtime").JSX.Element;
68
+ Group: import("react").ForwardRefExoticComponent<SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
69
+ Item: import("react").ForwardRefExoticComponent<SelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
70
+ };
71
+ export declare const Group: import("react").ForwardRefExoticComponent<SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
72
+ export declare const Item: import("react").ForwardRefExoticComponent<SelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
73
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from "react";
2
+ import { SelectOptionListItem } from "./AutoComplete";
3
+ interface Props {
4
+ options: Array<SelectOptionListItem>;
5
+ id: string;
6
+ }
7
+ declare const AutoCompleteOptionList: ({ options, id }: Props) => ReactNode;
8
+ export default AutoCompleteOptionList;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ type OptionContextProps = {
3
+ search: string;
4
+ highlighted?: string;
5
+ updateHighlighted: (value: string) => void;
6
+ isHidden: (value?: string) => boolean;
7
+ selectedValue: string;
8
+ onSelect: (value: string) => void;
9
+ };
10
+ export declare const OptionContext: import("react").Context<OptionContextProps>;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const useOption: () => {
2
+ search: string;
3
+ highlighted?: string | undefined;
4
+ updateHighlighted: (value: string) => void;
5
+ isHidden: (value?: string | undefined) => boolean;
6
+ selectedValue: string;
7
+ onSelect: (value: string) => void;
8
+ };
9
+ export declare const useSearch: () => string;
@@ -1,15 +1,14 @@
1
- import { HorizontalDirection, IconName } from '../../components';
1
+ import { HorizontalDirection } from '../../components';
2
2
  import { HTMLAttributes, ReactNode } from "react";
3
3
  type SortDir = "asc" | "desc";
4
4
  type SortFn = (sortDir: SortDir, header: TableHeaderType, index: number) => void;
5
5
  type TableSize = "sm" | "md";
6
6
  export interface TableHeaderType extends HTMLAttributes<HTMLTableCellElement> {
7
- icon?: IconName;
8
- iconDir?: HorizontalDirection;
9
7
  label: ReactNode;
10
8
  isSortable?: boolean;
11
9
  sortDir?: SortDir;
12
10
  sortPosition?: HorizontalDirection;
11
+ width?: string;
13
12
  }
14
13
  interface TableCellType extends HTMLAttributes<HTMLTableCellElement> {
15
14
  label: ReactNode;
@@ -29,6 +28,8 @@ interface CommonTableProps extends Omit<HTMLAttributes<HTMLTableElement>, "child
29
28
  loading?: boolean;
30
29
  noDataMessage?: ReactNode;
31
30
  size?: TableSize;
31
+ showHeader?: boolean;
32
+ rowHeight?: string;
32
33
  }
33
34
  type SelectReturnValue = {
34
35
  index: number;
@@ -0,0 +1,2 @@
1
+ import { ReactNode } from "react";
2
+ export declare const getTextFromNodes: (node: ReactNode) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.83",
3
+ "version": "0.0.84",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",