lecom-ui 5.3.13 → 5.3.14

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.
@@ -6,9 +6,19 @@ const CustomButton = React.forwardRef(
6
6
  ({ customStyles, isActive, children, ...props }, ref) => {
7
7
  const { normal, hover, focus } = customStyles;
8
8
  const [backgroundColor, setBackgroundColor] = React.useState(
9
- opacity(normal.bgColor, normal.opacity)
9
+ () => opacity(normal.bgColor, normal.opacity)
10
10
  );
11
11
  const [color, setColor] = React.useState(normal.textColor);
12
+ React.useEffect(() => {
13
+ setBackgroundColor(
14
+ opacity(customStyles.normal.bgColor, customStyles.normal.opacity)
15
+ );
16
+ setColor(customStyles.normal.textColor);
17
+ }, [
18
+ customStyles.normal.bgColor,
19
+ customStyles.normal.opacity,
20
+ customStyles.normal.textColor
21
+ ]);
12
22
  const handleOver = () => {
13
23
  setBackgroundColor(opacity(hover.bgColor, hover.opacity));
14
24
  setColor(hover.textColor);
@@ -35,6 +35,32 @@ function buildColumns({
35
35
  columns,
36
36
  size = "middle"
37
37
  }) {
38
+ function renderSortArrow({
39
+ hasSort,
40
+ column,
41
+ externalColumn,
42
+ table
43
+ }) {
44
+ if (!hasSort) {
45
+ return null;
46
+ }
47
+ return /* @__PURE__ */ React.createElement(
48
+ ArrowUpDown,
49
+ {
50
+ size: 16,
51
+ className: "ml-1 text-grey-400 group-hover:text-grey-950 hover:cursor-pointer",
52
+ onClick: (event) => {
53
+ event.stopPropagation();
54
+ const sortingHandler = column.getToggleSortingHandler?.();
55
+ if (externalColumn.onSort) {
56
+ externalColumn.onSort({ table, column });
57
+ } else if (sortingHandler) {
58
+ sortingHandler(event);
59
+ }
60
+ }
61
+ }
62
+ );
63
+ }
38
64
  const mappedColumns = columns.map((externalColumn) => ({
39
65
  accessorKey: externalColumn.key,
40
66
  header: ({ table, column }) => {
@@ -54,27 +80,6 @@ function buildColumns({
54
80
  }
55
81
  const hasSort = !!externalColumn.onSort || !!externalColumn.onSortClient;
56
82
  const title = typeof externalColumn.title === "function" ? externalColumn.title({ table, column }) : externalColumn.title;
57
- function renderSortArrow() {
58
- if (!hasSort) {
59
- return null;
60
- }
61
- return /* @__PURE__ */ React.createElement(
62
- ArrowUpDown,
63
- {
64
- size: 16,
65
- className: "ml-1 text-grey-400 group-hover:text-grey-950 hover:cursor-pointer",
66
- onClick: (event) => {
67
- event.stopPropagation();
68
- const sortingHandler = column.getToggleSortingHandler?.();
69
- if (externalColumn.onSort) {
70
- externalColumn.onSort({ table, column });
71
- } else if (sortingHandler) {
72
- sortingHandler(event);
73
- }
74
- }
75
- }
76
- );
77
- }
78
83
  return /* @__PURE__ */ React.createElement(
79
84
  "div",
80
85
  {
@@ -93,7 +98,12 @@ function buildColumns({
93
98
  },
94
99
  externalColumn.title
95
100
  ) : title,
96
- renderSortArrow()
101
+ renderSortArrow({
102
+ hasSort,
103
+ column,
104
+ externalColumn,
105
+ table
106
+ })
97
107
  );
98
108
  },
99
109
  cell: ({ row }) => {
@@ -15,6 +15,19 @@ const SelectTrigger = React.forwardRef(({ className, children, customStyles, ...
15
15
  normal ? opacity(normal.bgColor, normal.opacity) : void 0
16
16
  );
17
17
  const [color, setColor] = React.useState(normal?.textColor ?? void 0);
18
+ React.useEffect(() => {
19
+ if (customStyles?.normal) {
20
+ setBackgroundColor(
21
+ opacity(customStyles.normal.bgColor, customStyles.normal.opacity)
22
+ );
23
+ setColor(customStyles.normal.textColor);
24
+ }
25
+ }, [
26
+ customStyles?.normal,
27
+ customStyles?.normal?.bgColor,
28
+ customStyles?.normal?.opacity,
29
+ customStyles?.normal?.textColor
30
+ ]);
18
31
  const [isActive, setIsActive] = React.useState(false);
19
32
  const handleOver = React.useCallback(() => {
20
33
  if (hover) {
package/dist/index.d.ts CHANGED
@@ -69,7 +69,7 @@ declare const AccordionContent: React$1.ForwardRefExoticComponent<Omit<Accordion
69
69
  } & React$1.RefAttributes<HTMLDivElement>>;
70
70
 
71
71
  declare const buttonVariants: (props?: ({
72
- variant?: "filled" | "outlined" | "tonal" | "ghost" | null | undefined;
72
+ variant?: "ghost" | "filled" | "outlined" | "tonal" | null | undefined;
73
73
  size?: "small" | "medium" | "large" | "extraLarge" | null | undefined;
74
74
  color?: "blue" | "grey" | "destructive" | null | undefined;
75
75
  iconButton?: boolean | null | undefined;
@@ -898,7 +898,7 @@ declare const RadioGroup: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimi
898
898
  declare const RadioGroupItem: React$1.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
899
899
 
900
900
  declare const ResizablePanelGroup: ({ className, ...props }: React$1.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => React$1.JSX.Element;
901
- declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLDivElement | HTMLHeadingElement | HTMLParagraphElement | HTMLInputElement | 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"> & {
901
+ declare const ResizablePanel: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLSpanElement | HTMLButtonElement | HTMLHeadingElement | HTMLParagraphElement | HTMLLabelElement | 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"> & {
902
902
  className?: string;
903
903
  collapsedSize?: number | undefined;
904
904
  collapsible?: boolean | undefined;
@@ -983,7 +983,7 @@ declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive
983
983
  declare const TooltipArrow: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipArrowProps & React$1.RefAttributes<SVGSVGElement>>;
984
984
  declare const TooltipPortal: React$1.FC<TooltipPrimitive.TooltipPortalProps>;
985
985
  declare const tooltipContentVariants: (props?: ({
986
- color?: "black" | "white" | null | undefined;
986
+ color?: "white" | "black" | null | undefined;
987
987
  arrow?: boolean | null | undefined;
988
988
  } & class_variance_authority_types.ClassProp) | undefined) => string;
989
989
  interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>, VariantProps<typeof tooltipContentVariants> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lecom-ui",
3
- "version": "5.3.13",
3
+ "version": "5.3.14",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",