@vectara/vectara-ui 13.0.0 → 13.1.1

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.
@@ -47,9 +47,13 @@ export type Theme = {
47
47
  colorFullShade?: string;
48
48
  colorFullShadeRgb?: string;
49
49
  colorText?: string;
50
+ colorTextRgb?: string;
50
51
  colorLabel?: string;
52
+ colorLabelRgb?: string;
51
53
  colorBorderMedium?: string;
54
+ colorBorderMediumRgb?: string;
52
55
  colorBorderLight?: string;
56
+ colorBorderLightRgb?: string;
53
57
  };
54
58
  export declare const toRgba: (hex: string, alpha: number) => string;
55
59
  export declare const toRgb: (hex: string) => string;
@@ -95,10 +95,14 @@ export const LIGHT_THEME = {
95
95
  colorFullShadeRgb: toRgb(colorFullShade),
96
96
  // Text color
97
97
  colorText: colorDarkerShade,
98
+ colorTextRgb: toRgb(colorDarkerShade),
98
99
  colorLabel: colorDarkerShade,
100
+ colorLabelRgb: toRgb(colorDarkerShade),
99
101
  // Border color
100
102
  colorBorderMedium: colorMediumShade,
101
- colorBorderLight: colorBorderLightShade
103
+ colorBorderMediumRgb: toRgb(colorMediumShade),
104
+ colorBorderLight: colorBorderLightShade,
105
+ colorBorderLightRgb: toRgb(colorBorderLightShade)
102
106
  };
103
107
  export const DARK_THEME = {
104
108
  // Special colors
@@ -180,10 +184,14 @@ export const toStyle = (theme) => {
180
184
  "--vui-color-full-shade-rgb": theme.colorFullShadeRgb,
181
185
  // Text colors
182
186
  "--vui-color-text": theme.colorText,
187
+ "--vui-color-text-rgb": theme.colorTextRgb,
183
188
  "--vui-color-label": theme.colorLabel,
189
+ "--vui-color-label-rgb": theme.colorLabelRgb,
184
190
  // Border colors
185
191
  "--vui-color-border-medium": theme.colorBorderMedium,
186
- "--vui-color-border-light": theme.colorBorderLight
192
+ "--vui-color-border-medium-rgb": theme.colorBorderMediumRgb,
193
+ "--vui-color-border-light": theme.colorBorderLight,
194
+ "--vui-color-border-light-rgb": theme.colorBorderLightRgb
187
195
  };
188
196
  // Remove undefined values.
189
197
  return Object.fromEntries(Object.entries(vars).filter(([_, v]) => v !== undefined));
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from "react";
2
2
  declare const COLOR: readonly ["primary", "danger"];
3
3
  type Props = {
4
+ canClickOutsideToClose?: boolean;
4
5
  className?: string;
5
6
  title: ReactNode;
6
7
  icon?: ReactNode;
@@ -11,5 +12,5 @@ type Props = {
11
12
  key?: string;
12
13
  size?: "s" | "m" | "l";
13
14
  };
14
- export declare const VuiModal: ({ className, color, title, icon, children, isOpen, onClose, key, size, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export declare const VuiModal: ({ className, color, title, icon, children, isOpen, onClose, key, canClickOutsideToClose, size, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
15
16
  export {};
@@ -23,7 +23,7 @@ import { VuiScreenBlock } from "../screenBlock/ScreenBlock";
23
23
  import { useVuiContext } from "../context/Context";
24
24
  const COLOR = ["primary", "danger"];
25
25
  export const VuiModal = (_a) => {
26
- var { className, color = "primary", title, icon, children, isOpen, onClose, key, size = "s" } = _a, rest = __rest(_a, ["className", "color", "title", "icon", "children", "isOpen", "onClose", "key", "size"]);
26
+ var { className, color = "primary", title, icon, children, isOpen, onClose, key, canClickOutsideToClose = true, size = "s" } = _a, rest = __rest(_a, ["className", "color", "title", "icon", "children", "isOpen", "onClose", "key", "canClickOutsideToClose", "size"]);
27
27
  const { DrawerTitle } = useVuiContext();
28
28
  const returnFocusElRef = useRef(null);
29
29
  // Return focus on unmount.
@@ -44,7 +44,7 @@ export const VuiModal = (_a) => {
44
44
  }, 0);
45
45
  };
46
46
  const classes = classNames("vuiModal", `vuiModal--${color}`, `vuiModal--${size}`, className);
47
- return (_jsx(VuiPortal, { children: isOpen && (_jsx(VuiScreenBlock, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: onCloseDelayed,
47
+ return (_jsx(VuiPortal, { children: isOpen && (_jsx(VuiScreenBlock, { children: _jsx(FocusOn, Object.assign({ onEscapeKey: onCloseDelayed, onClickOutside: canClickOutsideToClose ? onCloseDelayed : undefined,
48
48
  // Enable manual focus return to work.
49
49
  returnFocus: false,
50
50
  // Enable focus on contents when it's open,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vectara/vectara-ui",
3
- "version": "13.0.0",
3
+ "version": "13.1.1",
4
4
  "homepage": "./",
5
5
  "description": "Vectara's design system, codified as a React and Sass component library",
6
6
  "author": "Vectara",