@clickhouse/click-ui 0.0.159 → 0.0.161

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.
@@ -32759,6 +32759,7 @@ const Pagination = ({
32759
32759
  onPageNumberFocus,
32760
32760
  onPageNumberBlur,
32761
32761
  disableNextButton,
32762
+ allowAllRows = true,
32762
32763
  ...props
32763
32764
  }) => {
32764
32765
  const hasRowCount = ["number", "string"].includes(typeof rowCount);
@@ -32811,6 +32812,9 @@ const Pagination = ({
32811
32812
  onNextPageClick(e);
32812
32813
  }
32813
32814
  }, [currentPage, onChangeProp, onNextPageClick, rightButtonDisabled]);
32815
+ if (pageSize === -1 && !allowAllRows && maxRowsPerPageList.length > 0) {
32816
+ pageSize = maxRowsPerPageList[0];
32817
+ }
32814
32818
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { gap, justifyContent: justifyContent ?? (rowCount || maxRowsPerPageList.length > 0 ? "space-between" : "center"), fillWidth, ...props, children: [
32815
32819
  hasRowCount && /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { component: "div", color: "muted", size: "sm", children: [
32816
32820
  typeof rowCount === "number" ? formatNumber(rowCount) : rowCount,
@@ -32826,7 +32830,7 @@ const Pagination = ({
32826
32830
  /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton$1, { icon: "chevron-right", type: "ghost", disabled: rightButtonDisabled, onClick: onNextClick, "data-testid": "next-btn" })
32827
32831
  ] }),
32828
32832
  maxRowsPerPageList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(CustomSelect, { as: Select, onSelect: onPageSizeChange, value: pageSize.toString(), children: [
32829
- /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
32833
+ allowAllRows && /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
32830
32834
  maxRowsPerPageList.map((option2) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Item, { value: option2.toString(), children: [
32831
32835
  option2,
32832
32836
  " rows"
@@ -33335,7 +33339,16 @@ const StyledSelectTrigger = styled($cb5cc270b50c6fcd$export$41fb9f06171c75f4).wi
33335
33339
  `);
33336
33340
  const SelectPopoverContent = styled($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2).withConfig({
33337
33341
  componentId: "sc-oudbwg-3"
33338
- })(["width:var(--radix-popover-trigger-width);max-height:var(--radix-popover-content-available-height);border-radius:0.25rem;pointer-events:auto;", " overflow:hidden;display:flex;padding:0.5rem 0rem;align-items:flex-start;gap:0.625rem;"], ({
33342
+ })(["width:var(--radix-popover-trigger-width);max-height:var(--radix-popover-content-available-height);border-radius:0.25rem;pointer-events:auto;", " ", " overflow:hidden;display:flex;padding:0.5rem 0rem;align-items:flex-start;gap:0.625rem;"], ({
33343
+ $useFullWidthItems,
33344
+ $itemCharacterLimit
33345
+ }) => `
33346
+ ${$useFullWidthItems ? `
33347
+ max-width: ${$itemCharacterLimit};
33348
+ min-width: var(--radix-popover-trigger-width);
33349
+ width: 100%;
33350
+ ` : "width: var(--radix-popover-trigger-width)"};
33351
+ `, ({
33339
33352
  theme: theme2
33340
33353
  }) => `
33341
33354
  border: 1px solid ${theme2.click.genericMenu.item.color.stroke.default};
@@ -36874,6 +36887,8 @@ const InternalSelect = ({
36874
36887
  selectLabel,
36875
36888
  showSearch = false,
36876
36889
  container,
36890
+ useFullWidthItems = false,
36891
+ itemCharacterLimit = "64ch",
36877
36892
  ...props
36878
36893
  }) => {
36879
36894
  const defaultId = useId();
@@ -37049,7 +37064,7 @@ const InternalSelect = ({
37049
37064
  onUpdateSearch("");
37050
37065
  }, onOpenAutoFocus: () => {
37051
37066
  setHighlighted(visibleList.current[0]);
37052
- }, align: "start", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectList, { children: [
37067
+ }, align: "start", $useFullWidthItems: useFullWidthItems, $itemCharacterLimit: itemCharacterLimit, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectList, { children: [
37053
37068
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SearchBarContainer, { $showSearch: showSearch, children: [
37054
37069
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchBar, { ref: inputRef, value: search, onChange: (e) => onUpdateSearch(e.target.value), "data-testid": "select-search-input", onKeyDown, $showSearch: showSearch }),
37055
37070
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchClose, { as: IconButton$1, icon: "cross", onClick: clearSearch, "data-testid": "select-search-close", $showClose: search.length > 0, size: "xs" })
@@ -32776,6 +32776,7 @@ var __publicField = (obj, key, value) => {
32776
32776
  onPageNumberFocus,
32777
32777
  onPageNumberBlur,
32778
32778
  disableNextButton,
32779
+ allowAllRows = true,
32779
32780
  ...props
32780
32781
  }) => {
32781
32782
  const hasRowCount = ["number", "string"].includes(typeof rowCount);
@@ -32828,6 +32829,9 @@ var __publicField = (obj, key, value) => {
32828
32829
  onNextPageClick(e);
32829
32830
  }
32830
32831
  }, [currentPage, onChangeProp, onNextPageClick, rightButtonDisabled]);
32832
+ if (pageSize === -1 && !allowAllRows && maxRowsPerPageList.length > 0) {
32833
+ pageSize = maxRowsPerPageList[0];
32834
+ }
32831
32835
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Container, { gap, justifyContent: justifyContent ?? (rowCount || maxRowsPerPageList.length > 0 ? "space-between" : "center"), fillWidth, ...props, children: [
32832
32836
  hasRowCount && /* @__PURE__ */ jsxRuntimeExports.jsxs(Text, { component: "div", color: "muted", size: "sm", children: [
32833
32837
  typeof rowCount === "number" ? formatNumber(rowCount) : rowCount,
@@ -32843,7 +32847,7 @@ var __publicField = (obj, key, value) => {
32843
32847
  /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton$1, { icon: "chevron-right", type: "ghost", disabled: rightButtonDisabled, onClick: onNextClick, "data-testid": "next-btn" })
32844
32848
  ] }),
32845
32849
  maxRowsPerPageList.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(CustomSelect, { as: Select, onSelect: onPageSizeChange, value: pageSize.toString(), children: [
32846
- /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
32850
+ allowAllRows && /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, { value: "-1", children: "All rows" }),
32847
32851
  maxRowsPerPageList.map((option) => /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Item, { value: option.toString(), children: [
32848
32852
  option,
32849
32853
  " rows"
@@ -33352,7 +33356,16 @@ var __publicField = (obj, key, value) => {
33352
33356
  `);
33353
33357
  const SelectPopoverContent = styled($cb5cc270b50c6fcd$export$7c6e2c02157bb7d2).withConfig({
33354
33358
  componentId: "sc-oudbwg-3"
33355
- })(["width:var(--radix-popover-trigger-width);max-height:var(--radix-popover-content-available-height);border-radius:0.25rem;pointer-events:auto;", " overflow:hidden;display:flex;padding:0.5rem 0rem;align-items:flex-start;gap:0.625rem;"], ({
33359
+ })(["width:var(--radix-popover-trigger-width);max-height:var(--radix-popover-content-available-height);border-radius:0.25rem;pointer-events:auto;", " ", " overflow:hidden;display:flex;padding:0.5rem 0rem;align-items:flex-start;gap:0.625rem;"], ({
33360
+ $useFullWidthItems,
33361
+ $itemCharacterLimit
33362
+ }) => `
33363
+ ${$useFullWidthItems ? `
33364
+ max-width: ${$itemCharacterLimit};
33365
+ min-width: var(--radix-popover-trigger-width);
33366
+ width: 100%;
33367
+ ` : "width: var(--radix-popover-trigger-width)"};
33368
+ `, ({
33356
33369
  theme: theme2
33357
33370
  }) => `
33358
33371
  border: 1px solid ${theme2.click.genericMenu.item.color.stroke.default};
@@ -36891,6 +36904,8 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
36891
36904
  selectLabel,
36892
36905
  showSearch = false,
36893
36906
  container,
36907
+ useFullWidthItems = false,
36908
+ itemCharacterLimit = "64ch",
36894
36909
  ...props
36895
36910
  }) => {
36896
36911
  const defaultId = React.useId();
@@ -37066,7 +37081,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
37066
37081
  onUpdateSearch("");
37067
37082
  }, onOpenAutoFocus: () => {
37068
37083
  setHighlighted(visibleList.current[0]);
37069
- }, align: "start", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectList, { children: [
37084
+ }, align: "start", $useFullWidthItems: useFullWidthItems, $itemCharacterLimit: itemCharacterLimit, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectList, { children: [
37070
37085
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SearchBarContainer, { $showSearch: showSearch, children: [
37071
37086
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchBar, { ref: inputRef, value: search, onChange: (e) => onUpdateSearch(e.target.value), "data-testid": "select-search-input", onKeyDown, $showSearch: showSearch }),
37072
37087
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchClose, { as: IconButton$1, icon: "cross", onClick: clearSearch, "data-testid": "select-search-close", $showClose: search.length > 0, size: "xs" })
@@ -14,5 +14,6 @@ export interface PaginationProps extends Omit<ContainerProps<"div">, "children"
14
14
  onPageNumberFocus?: FocusEventHandler<HTMLInputElement>;
15
15
  onPageNumberBlur?: FocusEventHandler<HTMLInputElement>;
16
16
  disableNextButton?: boolean;
17
+ allowAllRows?: boolean;
17
18
  }
18
- export declare const Pagination: ({ totalPages, currentPage, maxRowsPerPageList, rowCount, onChange: onChangeProp, onPageSizeChange: onPageSizeChangeProp, pageSize, fillWidth, gap, justifyContent, onNextPageClick, onPrevPageClick, onPageNumberFocus, onPageNumberBlur, disableNextButton, ...props }: PaginationProps) => ReactElement;
19
+ export declare const Pagination: ({ totalPages, currentPage, maxRowsPerPageList, rowCount, onChange: onChangeProp, onPageSizeChange: onPageSizeChangeProp, pageSize, fillWidth, gap, justifyContent, onNextPageClick, onPrevPageClick, onPageNumberFocus, onPageNumberBlur, disableNextButton, allowAllRows, ...props }: PaginationProps) => ReactElement;
@@ -6,6 +6,8 @@ export interface SelectProps extends Omit<SelectContainerProps, "onChange" | "va
6
6
  value?: string;
7
7
  placeholder?: string;
8
8
  onOpenChange?: (open: boolean) => void;
9
+ useFullWidthItems?: boolean;
10
+ itemCharacterLimit?: string;
9
11
  }
10
12
  export declare const Select: {
11
13
  ({ value: valueProp, defaultValue, onSelect: onSelectProp, options, children, onOpenChange: onOpenChangeProp, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { SelectContainerProps, SelectGroupProps, SelectItemProps } from './types';
2
2
 
3
- export declare const InternalSelect: ({ label, children, orientation, dir, disabled, id, error, value: selectedValues, onChange, onSelect, open, onOpenChange, name, form, allowCreateOption, customText, options, sortable, placeholder, multiple, checkbox, selectLabel, showSearch, container, ...props }: SelectContainerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const InternalSelect: ({ label, children, orientation, dir, disabled, id, error, value: selectedValues, onChange, onSelect, open, onOpenChange, name, form, allowCreateOption, customText, options, sortable, placeholder, multiple, checkbox, selectLabel, showSearch, container, useFullWidthItems, itemCharacterLimit, ...props }: SelectContainerProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export declare const SelectGroup: import('react').ForwardRefExoticComponent<SelectGroupProps & import('react').RefAttributes<HTMLDivElement>>;
5
5
  export declare const SelectItem: import('react').ForwardRefExoticComponent<SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
6
6
  export declare const MultiSelectCheckboxItem: import('react').ForwardRefExoticComponent<SelectItemProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -5,9 +5,12 @@ export declare const StyledSelectTrigger: import('styled-components/dist/types')
5
5
  }, {
6
6
  $error: boolean;
7
7
  }>> & string & Omit<import('react').ForwardRefExoticComponent<import('@radix-ui/react-popover').PopoverTriggerProps & import('react').RefAttributes<HTMLButtonElement>>, keyof import('react').Component<any, {}, any>>;
8
- export declare const SelectPopoverContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('@radix-ui/react-popover').PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
8
+ export declare const SelectPopoverContent: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<Omit<import('@radix-ui/react-popover').PopoverContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
9
9
  ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
10
- }, never>> & string & Omit<import('react').ForwardRefExoticComponent<import('@radix-ui/react-popover').PopoverContentProps & import('react').RefAttributes<HTMLDivElement>>, keyof import('react').Component<any, {}, any>>;
10
+ }, {
11
+ $useFullWidthItems: boolean;
12
+ $itemCharacterLimit?: string;
13
+ }>> & string & Omit<import('react').ForwardRefExoticComponent<import('@radix-ui/react-popover').PopoverContentProps & import('react').RefAttributes<HTMLDivElement>>, keyof import('react').Component<any, {}, any>>;
11
14
  export declare const SearchBarContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
12
15
  $showSearch: boolean;
13
16
  }>> & string;
@@ -67,6 +67,8 @@ interface InternalSelectProps extends PopoverProps, Omit<HTMLAttributes<HTMLDivE
67
67
  showSearch?: boolean;
68
68
  customText?: string;
69
69
  container?: HTMLElement;
70
+ useFullWidthItems?: boolean;
71
+ itemCharacterLimit?: string;
70
72
  }
71
73
  export type SelectOptionProp = SelectOptionType | SelectChildrenType;
72
74
  export type SelectContainerProps = SelectOptionProp & InternalSelectProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clickhouse/click-ui",
3
- "version": "0.0.159",
3
+ "version": "0.0.161",
4
4
  "description": "Official ClickHouse design system react library",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",