lecom-ui 5.3.59 → 5.3.61

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.
@@ -40,7 +40,19 @@ function renderSortArrow({
40
40
  event.stopPropagation();
41
41
  const sortingHandler = column.getToggleSortingHandler?.();
42
42
  if (externalColumn.onSort) {
43
- externalColumn.onSort({ table, column });
43
+ const newSortState = externalColumn.onSort({ table, column });
44
+ if (newSortState !== void 0) {
45
+ if (newSortState === null) {
46
+ table.setSorting([]);
47
+ } else {
48
+ table.setSorting([
49
+ {
50
+ id: column.id,
51
+ desc: newSortState === "desc"
52
+ }
53
+ ]);
54
+ }
55
+ }
44
56
  } else if (sortingHandler) {
45
57
  sortingHandler(event);
46
58
  }
@@ -4,6 +4,7 @@ import { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, Command
4
4
  import { Popover, PopoverTrigger, PopoverContent } from '../Popover/Popover.js';
5
5
  import { Separator } from '../Separator/Separator.js';
6
6
  import { Tag } from '../Tag/Tag.js';
7
+ import { Typography } from '../Typography/Typography.js';
7
8
  import { cn } from '../../lib/utils.js';
8
9
  import { X, ChevronUp, ChevronDown, Check, Minus } from 'lucide-react';
9
10
  import { initializeI18n } from '../../i18n/index.js';
@@ -310,51 +311,49 @@ const MultiSelect = React.forwardRef(
310
311
  },
311
312
  [highlightMatches, norm]
312
313
  );
313
- const renderTree = (nodes, depth = 0) => {
314
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, nodes.map((n) => {
315
- const hasChildren = !!(n.children && n.children.length);
316
- const fully = isNodeFullySelected(n);
317
- const partial = !fully && isNodePartiallySelected(n);
318
- const isSelectedLeaf = !hasChildren && selectedValues.includes(n.value);
319
- return /* @__PURE__ */ React.createElement("div", { key: n.value, className: "select-none" }, /* @__PURE__ */ React.createElement(
314
+ const renderTree = (nodes, depth = 0) => /* @__PURE__ */ React.createElement("div", { className: "flex flex-col" }, nodes.map((n) => {
315
+ const hasChildren = !!(n.children && n.children.length);
316
+ const fully = isNodeFullySelected(n);
317
+ const partial = !fully && isNodePartiallySelected(n);
318
+ const isSelectedLeaf = !hasChildren && selectedValues.includes(n.value);
319
+ return /* @__PURE__ */ React.createElement("div", { key: n.value, className: "select-none" }, /* @__PURE__ */ React.createElement(
320
+ "div",
321
+ {
322
+ className: cn(
323
+ "flex items-center gap-2 px-2 py-1 cursor-pointer rounded-sm text-grey-800 hover:bg-grey-100 text-sm",
324
+ (fully || isSelectedLeaf) && "bg-blue-50"
325
+ ),
326
+ style: { paddingLeft: depth * 14 + 8 }
327
+ },
328
+ /* @__PURE__ */ React.createElement(
320
329
  "div",
321
330
  {
322
331
  className: cn(
323
- "flex items-center gap-2 px-2 py-1 cursor-pointer rounded-sm text-grey-800 hover:bg-grey-100 text-sm",
324
- (fully || isSelectedLeaf) && "bg-blue-50"
332
+ "flex h-4 w-4 items-center justify-center rounded-sm border transition-colors flex-shrink-0",
333
+ fully ? "bg-blue-600 border-blue-600 text-primary-foreground" : "border-grey-400 bg-white"
325
334
  ),
326
- style: { paddingLeft: depth * 14 + 8 }
335
+ onClick: (e) => {
336
+ e.stopPropagation();
337
+ toggleTreeNode(n);
338
+ }
327
339
  },
328
- /* @__PURE__ */ React.createElement(
329
- "div",
330
- {
331
- className: cn(
332
- "flex h-4 w-4 items-center justify-center rounded-sm border transition-colors flex-shrink-0",
333
- fully ? "bg-blue-600 border-blue-600 text-primary-foreground" : "border-grey-400 bg-white"
334
- ),
335
- onClick: (e) => {
336
- e.stopPropagation();
337
- toggleTreeNode(n);
338
- }
339
- },
340
- fully && /* @__PURE__ */ React.createElement(Check, { className: "h-3 w-3" }),
341
- partial && !fully && /* @__PURE__ */ React.createElement(Minus, { className: "h-3 w-3 text-blue-600" })
342
- ),
343
- /* @__PURE__ */ React.createElement(
344
- "span",
345
- {
346
- className: "text-sm flex-1 truncate cursor-pointer overflow-hidden",
347
- onClick: (e) => {
348
- e.stopPropagation();
349
- toggleTreeNode(n);
350
- },
351
- title: n.label
340
+ fully && /* @__PURE__ */ React.createElement(Check, { className: "h-3 w-3" }),
341
+ partial && !fully && /* @__PURE__ */ React.createElement(Minus, { className: "h-3 w-3 text-blue-600" })
342
+ ),
343
+ /* @__PURE__ */ React.createElement(
344
+ "span",
345
+ {
346
+ className: "text-sm flex-1 truncate cursor-pointer overflow-hidden",
347
+ onClick: (e) => {
348
+ e.stopPropagation();
349
+ toggleTreeNode(n);
352
350
  },
353
- highlightMatches ? highlight(n.label, treeQuery) : n.label
354
- )
355
- ), hasChildren && /* @__PURE__ */ React.createElement("div", null, renderTree(n.children, depth + 1)));
356
- }));
357
- };
351
+ title: n.label
352
+ },
353
+ highlightMatches ? highlight(n.label, treeQuery) : n.label
354
+ )
355
+ ), hasChildren && /* @__PURE__ */ React.createElement("div", null, renderTree(n.children, depth + 1)));
356
+ }));
358
357
  return /* @__PURE__ */ React.createElement(
359
358
  Popover,
360
359
  {
@@ -379,20 +378,27 @@ const MultiSelect = React.forwardRef(
379
378
  },
380
379
  selectedValues.length > 0 ? /* @__PURE__ */ React.createElement("div", { className: "flex justify-between items-center w-full" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap items-center gap-1" }, selectedValues.slice(0, maxCount).map((value2) => {
381
380
  const label = findTreeLabel(value2) || options.find((o) => o.value === value2)?.label || value2;
382
- return /* @__PURE__ */ React.createElement(Tag, { key: value2, color: "blue", className: "focus:ring-0" }, label, /* @__PURE__ */ React.createElement(
381
+ return /* @__PURE__ */ React.createElement(Tag, { key: value2, color: "blue", className: "focus:ring-0" }, /* @__PURE__ */ React.createElement(
382
+ Typography,
383
+ {
384
+ variant: "body-small-400",
385
+ textColor: "text-blue-600"
386
+ },
387
+ label
388
+ ), /* @__PURE__ */ React.createElement(
383
389
  X,
384
390
  {
385
- className: "h-4 w-4 cursor-pointer",
391
+ className: "h-4 w-4 cursor-pointer flex-shrink-0",
386
392
  onClick: (event) => {
387
393
  event.stopPropagation();
388
394
  toggleOption(value2);
389
395
  }
390
396
  }
391
397
  ));
392
- }), selectedValues.length > maxCount && /* @__PURE__ */ React.createElement(Tag, { color: "blue", className: "focus:ring-0" }, `+ ${selectedValues.length - maxCount}`, /* @__PURE__ */ React.createElement(
398
+ }), selectedValues.length > maxCount && /* @__PURE__ */ React.createElement(Tag, { color: "blue", className: "focus:ring-0" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body-small-400", className: "text-blue-600" }, `+ ${selectedValues.length - maxCount}`), /* @__PURE__ */ React.createElement(
393
399
  X,
394
400
  {
395
- className: "h-4 w-4 cursor-pointer",
401
+ className: "h-4 w-4 cursor-pointer flex-shrink-0",
396
402
  onClick: (event) => {
397
403
  event.stopPropagation();
398
404
  clearExtraOptions();
package/dist/index.d.ts CHANGED
@@ -500,7 +500,7 @@ interface Column<TData, TValue> {
500
500
  cellClassName?: string;
501
501
  customHeaderRender?: ({ table, column, }: ColumnSort<TData, TValue>) => React.ReactNode;
502
502
  render?: (({ value, row }: ColumnRender<TData, TValue>) => React.ReactNode) | React.ReactNode;
503
- onSort?: ({ table, column }: ColumnSort<TData, TValue>) => void;
503
+ onSort?: ({ table, column }: ColumnSort<TData, TValue>) => 'asc' | 'desc' | null | void;
504
504
  onSortClient?: ({ rowA, rowB, columnId }: ColumnSortClient<TData>) => number;
505
505
  checkedHeader?: ({ table, column }: CheckedHeader<TData, TValue>) => boolean;
506
506
  checkedCell?: ({ row }: CheckedCell<TData>) => boolean;
@@ -756,9 +756,9 @@ interface HeaderProps extends React$1.HTMLAttributes<HTMLElement>, VariantProps<
756
756
  }
757
757
 
758
758
  declare const inputVariants: (props?: ({
759
- variant?: "default" | "filled" | "borderless" | null | undefined;
760
- size?: "default" | "small" | "large" | null | undefined;
761
- radius?: "default" | "small" | "large" | "full" | null | undefined;
759
+ variant?: "filled" | "default" | "borderless" | null | undefined;
760
+ size?: "small" | "large" | "default" | null | undefined;
761
+ radius?: "small" | "large" | "default" | "full" | null | undefined;
762
762
  } & class_variance_authority_types.ClassProp) | undefined) => string;
763
763
  interface InputProps extends Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'size' | 'sufix' | 'prefix'>, VariantProps<typeof inputVariants> {
764
764
  sufix?: React$1.ReactNode;
@@ -959,7 +959,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
959
959
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
960
960
 
961
961
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
962
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLButtonElement | HTMLSpanElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLInputElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
962
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLDivElement | HTMLButtonElement | HTMLLabelElement | HTMLParagraphElement | HTMLHeadingElement | HTMLInputElement | HTMLUListElement | HTMLObjectElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSlotElement | HTMLSourceElement | HTMLStyleElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
963
963
  className?: string;
964
964
  collapsedSize?: number | undefined;
965
965
  collapsible?: boolean | undefined;
@@ -1054,7 +1054,7 @@ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive
1054
1054
  declare const TooltipArrow: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React$1.RefAttributes<SVGSVGElement>>;
1055
1055
  declare const TooltipPortal: React$1.FC<TooltipPrimitive.TooltipPortalProps>;
1056
1056
  declare const tooltipContentVariants: (props?: ({
1057
- color?: "white" | "black" | null | undefined;
1057
+ color?: "black" | "white" | null | undefined;
1058
1058
  arrow?: boolean | null | undefined;
1059
1059
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1060
1060
  interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, VariantProps<typeof tooltipContentVariants> {
@@ -1124,10 +1124,10 @@ declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.
1124
1124
  declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1125
1125
 
1126
1126
  declare const textareaVariants: (props?: ({
1127
- variant?: "default" | "filled" | "borderless" | null | undefined;
1128
- size?: "default" | "small" | "large" | null | undefined;
1129
- radius?: "default" | "small" | "large" | "full" | null | undefined;
1130
- resize?: "default" | "both" | "horizontal" | "vertical" | "vertical-limited" | null | undefined;
1127
+ variant?: "filled" | "default" | "borderless" | null | undefined;
1128
+ size?: "small" | "large" | "default" | null | undefined;
1129
+ radius?: "small" | "large" | "default" | "full" | null | undefined;
1130
+ resize?: "both" | "horizontal" | "vertical" | "default" | "vertical-limited" | null | undefined;
1131
1131
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1132
1132
  interface TextareaProps extends React$1.ComponentProps<'textarea'>, VariantProps<typeof textareaVariants> {
1133
1133
  }
@@ -1255,7 +1255,7 @@ declare const SheetClose: React$1.ForwardRefExoticComponent<DialogPrimitive.Dial
1255
1255
  declare const SheetPortal: React$1.FC<DialogPrimitive.DialogPortalProps>;
1256
1256
  declare const SheetOverlay: React$1.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
1257
1257
  declare const sheetVariants: (props?: ({
1258
- side?: "left" | "right" | "top" | "bottom" | null | undefined;
1258
+ side?: "top" | "right" | "bottom" | "left" | null | undefined;
1259
1259
  } & class_variance_authority_types.ClassProp) | undefined) => string;
1260
1260
  interface SheetContentProps extends React$1.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof sheetVariants> {
1261
1261
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.3.59",
3
+ "version": "5.3.61",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
@@ -128,4 +128,4 @@
128
128
  "overrides": {
129
129
  "react-is": "^19.0.0-rc-69d4b800-20241021"
130
130
  }
131
- }
131
+ }
@@ -1,27 +0,0 @@
1
- import { Prism } from 'react-syntax-highlighter';
2
- import * as themes from 'react-syntax-highlighter/dist/esm/styles/prism';
3
- export { themes };
4
-
5
- const SyntaxHighlighter = ({
6
- style = "vscDarkPlus",
7
- language = "javascript",
8
- showLineNumbers = false,
9
- wrapLines = false,
10
- children,
11
- ...props
12
- }) => {
13
- const themeStyle = typeof style === "string" ? themes[style] || themes.vscDarkPlus : style;
14
- return /* @__PURE__ */ React.createElement(
15
- Prism,
16
- {
17
- language,
18
- style: themeStyle,
19
- showLineNumbers,
20
- wrapLines,
21
- ...props
22
- },
23
- children
24
- );
25
- };
26
-
27
- export { SyntaxHighlighter };