@veritone-ce/design-system 2.0.0 → 2.0.2

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.
@@ -23,8 +23,7 @@ const defaultMessageText = {
23
23
  warning: `Your action is required. `,
24
24
  error: `An error has occurred. `
25
25
  };
26
- const Alert = (props) => {
27
- const severity = props.severity ?? "success";
26
+ const Alert = ({ severity = "success", ...props }) => {
28
27
  const label = props.label ?? defaultMessageLabel[severity];
29
28
  const text = props.text ?? defaultMessageText[severity];
30
29
  const icon = iconVariants[severity];
@@ -9,31 +9,38 @@ import '../styles/defaultTheme.js';
9
9
  import '@mui/system';
10
10
  import '../styles/styled.js';
11
11
 
12
- const Button = forwardRef((props, ref) => {
13
- const variant = props.variant ?? "primary";
14
- const variantCn = modules_efc4e723[variant];
15
- const size = props.size ?? "large";
16
- return /* @__PURE__ */ jsxs(
17
- "button",
18
- {
19
- ref,
20
- "data-size": size,
21
- "data-loading": props.loading ?? false,
22
- disabled: props.loading || props.disabled,
23
- "data-destructive": props.destructive ?? false,
24
- onClick: props.onClick,
25
- style: props.style,
26
- className: cx(modules_efc4e723["button"], variantCn, props.className),
27
- children: [
28
- props.loading && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["loading-container"], children: /* @__PURE__ */ jsx(CircularProgress, { size: "1.4em", color: "inherit" }) }),
29
- /* @__PURE__ */ jsxs("span", { className: modules_efc4e723["inner-container"], children: [
30
- props.startIcon && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["button-icon"], children: props.startIcon }),
31
- /* @__PURE__ */ jsx("span", { children: props.children }),
32
- props.endIcon && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["button-icon"], children: props.endIcon })
33
- ] })
34
- ]
35
- }
36
- );
37
- });
12
+ const Button = forwardRef(
13
+ ({
14
+ variant = "primary",
15
+ size = "large",
16
+ disabled = false,
17
+ loading = false,
18
+ destructive = false,
19
+ ...props
20
+ }, ref) => {
21
+ const variantCn = modules_efc4e723[variant];
22
+ return /* @__PURE__ */ jsxs(
23
+ "button",
24
+ {
25
+ ref,
26
+ "data-size": size,
27
+ "data-loading": loading,
28
+ disabled: loading || disabled,
29
+ "data-destructive": destructive,
30
+ onClick: props.onClick,
31
+ style: props.style,
32
+ className: cx(modules_efc4e723["button"], variantCn, props.className),
33
+ children: [
34
+ loading && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["loading-container"], children: /* @__PURE__ */ jsx(CircularProgress, { size: "1.4em", color: "inherit" }) }),
35
+ /* @__PURE__ */ jsxs("span", { className: modules_efc4e723["inner-container"], children: [
36
+ props.startIcon && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["button-icon"], children: props.startIcon }),
37
+ /* @__PURE__ */ jsx("span", { children: props.children }),
38
+ props.endIcon && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["button-icon"], children: props.endIcon })
39
+ ] })
40
+ ]
41
+ }
42
+ );
43
+ }
44
+ );
38
45
 
39
46
  export { Button as default };
@@ -10,7 +10,10 @@ function createIconComponent({
10
10
  fallback = DefaultIconFallback
11
11
  }) {
12
12
  return forwardRef(function Icon({ name, ...genericProps }, ref) {
13
- const ResolvedIcon = React__default.useMemo(() => iconMap[name] ?? fallback, [name]);
13
+ const ResolvedIcon = React__default.useMemo(
14
+ () => iconMap[name] ?? fallback,
15
+ [name]
16
+ );
14
17
  return /* @__PURE__ */ jsx(ResolvedIcon, { ref, name, ...genericProps });
15
18
  });
16
19
  }
@@ -89,6 +89,7 @@ function Menu({
89
89
  children: /* @__PURE__ */ jsx(
90
90
  "div",
91
91
  {
92
+ "data-testid": "menu",
92
93
  ref: refs.setFloating,
93
94
  tabIndex: 0,
94
95
  "aria-labelledby": anchor?.id || props.anchorId,
@@ -30,6 +30,7 @@ const Textarea = forwardRef(
30
30
  placeholder: props.placeholder,
31
31
  value: props.value,
32
32
  rows: props.rows,
33
+ onChange: props.onChange,
33
34
  disabled: props.disabled,
34
35
  className: modules_efc4e723["inner-textarea"]
35
36
  }
@@ -1,27 +1,31 @@
1
1
  'use strict';
2
2
  'use client';
3
3
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
4
- import { useFloating, shift, flip, arrow, useRole, useHover, safePolygon, useFocus, useDismiss, useInteractions, FloatingArrow } from '@floating-ui/react';
4
+ import { useFloating, offset, inline, flip, shift, arrow, autoUpdate, useRole, useHover, safePolygon, useFocus, useDismiss, useInteractions, FloatingArrow } from '@floating-ui/react';
5
5
  import React__default from 'react';
6
6
  import modules_efc4e723 from './styles.module.scss.js';
7
7
  import { defaultThemeCssVariableUsages } from '../styles/defaultTheme.js';
8
8
  import '@mui/system';
9
9
  import '../styles/styled.js';
10
10
 
11
- function Tooltip(props) {
11
+ function Tooltip({ placement = "bottom", ...props }) {
12
12
  const [_isOpen, setIsOpen] = React__default.useState(false);
13
13
  const isOpen = props.isOpen ?? _isOpen;
14
14
  const arrowRef = React__default.useRef(null);
15
15
  const { refs, floatingStyles, context } = useFloating({
16
16
  open: isOpen,
17
17
  onOpenChange: setIsOpen,
18
+ placement,
18
19
  middleware: [
19
- shift(),
20
+ offset(10),
21
+ inline(),
20
22
  flip(),
23
+ shift(),
21
24
  arrow({
22
25
  element: arrowRef
23
26
  })
24
- ]
27
+ ],
28
+ whileElementsMounted: autoUpdate
25
29
  });
26
30
  const role = useRole(context, { role: "tooltip" });
27
31
  const hover = useHover(context, {
@@ -38,7 +42,16 @@ function Tooltip(props) {
38
42
  dismiss
39
43
  ]);
40
44
  return /* @__PURE__ */ jsxs(Fragment, { children: [
41
- /* @__PURE__ */ jsx("span", { role: "tooltip", ref: refs.setReference, ...getReferenceProps(), children: props.children }),
45
+ /* @__PURE__ */ jsx(
46
+ "span",
47
+ {
48
+ role: "tooltip",
49
+ ref: refs.setReference,
50
+ ...getReferenceProps(),
51
+ className: modules_efc4e723["tooltip-anchor"],
52
+ children: props.children
53
+ }
54
+ ),
42
55
  isOpen && /* @__PURE__ */ jsxs(
43
56
  "div",
44
57
  {
@@ -1,3 +1,3 @@
1
- var modules_efc4e723 = {"tooltip-body":"vt_ce_Tooltip_tooltipBody__0dd82f81"};
1
+ var modules_efc4e723 = {"tooltip-anchor":"vt_ce_Tooltip_tooltipAnchor__3658bd43","tooltip-body":"vt_ce_Tooltip_tooltipBody__3658bd43"};
2
2
 
3
3
  export { modules_efc4e723 as default };
@@ -7,7 +7,7 @@
7
7
  .vt_ce_CircularProgress_container__ea033e1c{--circular-progress-color:var(--vt-ce-theme-palette-action-primary,#1871e8);align-items:baseline;color:var(--circular-progress-color);display:inline-flex;justify-content:center}.vt_ce_CircularProgress_container__ea033e1c[data-fill-parent-height=true],.vt_ce_CircularProgress_container__ea033e1c[data-fill-parent-height=true] svg{height:100%}
8
8
  .vt_ce_Button_button__259ca507{align-items:center;border:1px solid transparent;border-radius:4px;cursor:pointer;display:inline-flex;gap:5px;justify-content:center;position:relative}.vt_ce_Button_button__259ca507[data-size=large]{font-family:var(--vt-ce-theme-typography-button-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-button-font-size,14px);font-style:var(--vt-ce-theme-typography-button-font-style,normal);font-weight:var(--vt-ce-theme-typography-button-font-weight,600);line-height:var(--vt-ce-theme-typography-button-line-height,20px);min-height:36px;padding:7px 15px}.vt_ce_Button_button__259ca507[data-size=small]{font-family:var(--vt-ce-theme-typography-buttonSmall-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-buttonSmall-font-size,12px);font-style:var(--vt-ce-theme-typography-buttonSmall-font-style,normal);font-weight:var(--vt-ce-theme-typography-buttonSmall-font-weight,600);line-height:var(--vt-ce-theme-typography-buttonSmall-line-height,18px);min-height:26px;padding:3px 15px}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507{background-color:var(--vt-ce-theme-palette-action-primary,#1871e8);color:var(--vt-ce-theme-palette-action-on,#fff)}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507:hover{background-color:var(--vt-ce-theme-palette-action-hover,#335b89)}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507:disabled{background-color:var(--vt-ce-theme-palette-disabledBackground,#fafafa);border-color:var(--vt-ce-theme-palette-backgroundAlt,#e0e8f0);color:var(--vt-ce-theme-palette-disabled,#7c848d)}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507[data-destructive=true]{background-color:var(--vt-ce-theme-palette-action-destructive,#eb0000)}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507[data-destructive=true]:hover{background-color:var(--vt-ce-theme-palette-action-destructiveHover,#a63737)}.vt_ce_Button_button__259ca507.vt_ce_Button_primary__259ca507[data-loading=true]:disabled{color:var(--vt-ce-theme-palette-action-primary,#1871e8)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-text-secondary,#5c6269);color:var(--vt-ce-theme-palette-text-secondary,#5c6269)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507:hover{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-action-hover,#335b89);color:var(--vt-ce-theme-palette-action-hover,#335b89)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507:disabled{background-color:var(--vt-ce-theme-palette-disabledBackground,#fafafa);border-color:var(--vt-ce-theme-palette-backgroundAlt,#e0e8f0);color:var(--vt-ce-theme-palette-disabled,#7c848d)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507[data-destructive=true]{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-action-destructive,#eb0000);color:var(--vt-ce-theme-palette-action-destructive,#eb0000)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507[data-destructive=true]:hover{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-action-destructiveHover,#a63737);color:var(--vt-ce-theme-palette-action-destructiveHover,#a63737)}.vt_ce_Button_button__259ca507.vt_ce_Button_secondary__259ca507[data-loading=true]:disabled{color:var(--vt-ce-theme-palette-action-primary,#1871e8)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507{background-color:transparent;color:var(--vt-ce-theme-palette-text-tertiary,#465364)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507:hover{color:var(--vt-ce-theme-palette-action-hover,#335b89)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507:disabled{color:var(--vt-ce-theme-palette-disabled,#7c848d)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507[data-destructive=true]{color:var(--vt-ce-theme-palette-action-destructive,#eb0000)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507[data-destructive=true]:hover{color:var(--vt-ce-theme-palette-action-destructiveHover,#a63737)}.vt_ce_Button_button__259ca507.vt_ce_Button_tertiary__259ca507[data-loading=true]:disabled{color:var(--vt-ce-theme-palette-action-primary,#1871e8)}.vt_ce_Button_button__259ca507[data-loading=true] .vt_ce_Button_innerContainer__259ca507{visibility:hidden}.vt_ce_Button_loadingContainer__259ca507{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.vt_ce_Button_innerContainer__259ca507{align-items:center;display:inline-flex;gap:5px;justify-content:center;visibility:visible}.vt_ce_Button_buttonIcon__259ca507{align-items:center;display:inline-flex;justify-content:center;--vt-ce-icon-size:18px}
9
9
  .vt_ce_IconButton_button__cb009384{background-color:transparent;border-style:none;color:var(--vt-ce-theme-palette-text-tertiary,#465364);cursor:pointer;display:inline-block;font-size:0;padding:7px;position:relative}.vt_ce_IconButton_button__cb009384:hover{color:var(--vt-ce-theme-palette-action-hover,#335b89)}.vt_ce_IconButton_button__cb009384:disabled{color:var(--vt-ce-theme-palette-disabled,#7c848d)}.vt_ce_IconButton_button__cb009384[data-destructive=true]{color:var(--vt-ce-theme-palette-action-destructive,#eb0000)}.vt_ce_IconButton_button__cb009384[data-destructive=true]:hover{color:var(--vt-ce-theme-palette-action-destructiveHover,#a63737)}.vt_ce_IconButton_button__cb009384[data-loading=true]:disabled{color:var(--vt-ce-theme-palette-action-primary,#1871e8)}.vt_ce_IconButton_button__cb009384[data-loading=true] .vt_ce_IconButton_innerIcon__cb009384{visibility:hidden}.vt_ce_IconButton_loadingContainer__cb009384{bottom:7px;left:7px;position:absolute;right:7px;top:7px}
10
- .vt_ce_Tooltip_tooltipBody__0dd82f81{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-backgroundAlt,#e0e8f0);border-radius:4px;border-style:solid;border-width:1px;color:var(--vt-ce-theme-palette-text-primary,#2a323c);font-family:var(--vt-ce-theme-typography-label-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-label-font-size,14px);font-style:var(--vt-ce-theme-typography-label-font-style,normal);font-weight:var(--vt-ce-theme-typography-label-font-weight,600);line-height:var(--vt-ce-theme-typography-label-line-height,17px);margin:10px;padding:4px 10px}
10
+ .vt_ce_Tooltip_tooltipAnchor__3658bd43{display:inline}.vt_ce_Tooltip_tooltipBody__3658bd43{background-color:var(--vt-ce-theme-palette-background,#fff);border-color:var(--vt-ce-theme-palette-backgroundAlt,#e0e8f0);border-radius:4px;border-style:solid;border-width:1px;color:var(--vt-ce-theme-palette-text-primary,#2a323c);font-family:var(--vt-ce-theme-typography-label-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-label-font-size,14px);font-style:var(--vt-ce-theme-typography-label-font-style,normal);font-weight:var(--vt-ce-theme-typography-label-font-weight,600);line-height:var(--vt-ce-theme-typography-label-line-height,17px);padding:4px 10px}
11
11
  .vt_ce_Typography_tH4__b98e9794{font-family:var(--vt-ce-theme-typography-h4-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-h4-font-size,18px);font-style:var(--vt-ce-theme-typography-h4-font-style,normal);font-weight:var(--vt-ce-theme-typography-h4-font-weight,600);line-height:var(--vt-ce-theme-typography-h4-line-height,24px)}.vt_ce_Typography_tLabel__b98e9794{font-family:var(--vt-ce-theme-typography-label-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-label-font-size,14px);font-style:var(--vt-ce-theme-typography-label-font-style,normal);font-weight:var(--vt-ce-theme-typography-label-font-weight,600);line-height:var(--vt-ce-theme-typography-label-line-height,17px)}.vt_ce_Typography_tParagraph1__b98e9794{font-family:var(--vt-ce-theme-typography-paragraph1-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-paragraph1-font-size,16px);font-style:var(--vt-ce-theme-typography-paragraph1-font-style,normal);font-weight:var(--vt-ce-theme-typography-paragraph1-font-weight,400);line-height:var(--vt-ce-theme-typography-paragraph1-line-height,24px)}.vt_ce_Typography_tParagraph2__b98e9794{font-family:var(--vt-ce-theme-typography-paragraph2-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-paragraph2-font-size,14px);font-style:var(--vt-ce-theme-typography-paragraph2-font-style,normal);font-weight:var(--vt-ce-theme-typography-paragraph2-font-weight,400);line-height:var(--vt-ce-theme-typography-paragraph2-line-height,20px)}.vt_ce_Typography_tParagraph3__b98e9794{font-family:var(--vt-ce-theme-typography-paragraph3-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-paragraph3-font-size,12px);font-style:var(--vt-ce-theme-typography-paragraph3-font-style,normal);font-weight:var(--vt-ce-theme-typography-paragraph3-font-weight,400);line-height:var(--vt-ce-theme-typography-paragraph3-line-height,18px)}.vt_ce_Typography_tButton__b98e9794{font-family:var(--vt-ce-theme-typography-button-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-button-font-size,14px);font-style:var(--vt-ce-theme-typography-button-font-style,normal);font-weight:var(--vt-ce-theme-typography-button-font-weight,600);line-height:var(--vt-ce-theme-typography-button-line-height,20px)}.vt_ce_Typography_tButtonSmall__b98e9794{font-family:var(--vt-ce-theme-typography-buttonSmall-font-family,Nunito Sans,Helvetica,sans-serif);font-size:var(--vt-ce-theme-typography-buttonSmall-font-size,12px);font-style:var(--vt-ce-theme-typography-buttonSmall-font-style,normal);font-weight:var(--vt-ce-theme-typography-buttonSmall-font-weight,600);line-height:var(--vt-ce-theme-typography-buttonSmall-line-height,18px)}.vt_ce_Typography_cPrimary__b98e9794{color:var(--vt-ce-theme-palette-text-primary,#2a323c)}.vt_ce_Typography_cSecondary__b98e9794{color:var(--vt-ce-theme-palette-text-secondary,#5c6269)}.vt_ce_Typography_cTertiary__b98e9794{color:var(--vt-ce-theme-palette-text-tertiary,#465364)}.vt_ce_Typography_cDisabled__b98e9794{color:var(--vt-ce-theme-palette-disabled,#7c848d)}
12
12
  .vt_ce_Dialog_dialogOverlay__4b764cfb{background:rgba(0,0,0,.54);display:grid;place-items:center}.vt_ce_Dialog_dialog__4b764cfb{background-color:var(--vt-ce-theme-palette-background,#fff);border-radius:4px;color:var(--vt-ce-theme-palette-text-primary,#2a323c);display:flex;flex-direction:column;margin:15px;max-height:calc(100% - 64px);max-width:calc(100% - 64px);padding:15px 0}.vt_ce_Dialog_dialogHeading__4b764cfb{flex:0 0 auto;font-size:18px;line-height:24px;margin:15px 0 0;padding:0 30px}.vt_ce_Dialog_dialogContent__4b764cfb{flex:1 1 auto;--webkit-overflow-scrolling:touch;overflow-y:auto;padding:0 30px}.vt_ce_Dialog_dialogTypography__4b764cfb{margin:15px 0}.vt_ce_Dialog_dialogActions__4b764cfb{align-items:center;display:flex;flex:0 0 auto;gap:10px;justify-content:flex-end;margin:15px 0;padding:0 30px}
13
13
  .vt_ce_Icon_icon__5881e2e1{display:inline-block;height:var(--vt-ce-icon-size,18px);width:var(--vt-ce-icon-size,18px)}.vt_ce_Icon_icon__5881e2e1 svg{height:var(--vt-ce-icon-size,18px);vertical-align:baseline;width:var(--vt-ce-icon-size,18px)}.vt_ce_Icon_icon__5881e2e1[data-size=large],.vt_ce_Icon_icon__5881e2e1[data-size=large] svg{height:24px;width:24px}.vt_ce_Icon_icon__5881e2e1[data-size=medium],.vt_ce_Icon_icon__5881e2e1[data-size=medium] svg{height:18px;width:18px}.vt_ce_Icon_icon__5881e2e1[data-size=small],.vt_ce_Icon_icon__5881e2e1[data-size=small] svg{height:14px;width:14px}.vt_ce_Icon_icon__5881e2e1[data-size=inherit],.vt_ce_Icon_icon__5881e2e1[data-size=inherit] svg{font-size:1em;height:1em;width:1em}
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ /// <reference types="react" resolution-mode="require"/>
2
2
  export type IconListItemProps = {
3
3
  'data-testid'?: string;
4
4
  children?: React.ReactNode;
@@ -12,5 +12,5 @@ export type AlertProps = {
12
12
  style?: React.CSSProperties;
13
13
  className?: string;
14
14
  };
15
- declare const Alert: (props: AlertProps) => import("react/jsx-runtime").JSX.Element;
15
+ declare const Alert: ({ severity, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export default Alert;
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ /// <reference types="react" resolution-mode="require"/>
2
2
  export type CircularProgressProps = {
3
3
  size?: number | string;
4
4
  color?: string;
@@ -1,16 +1,14 @@
1
1
  import React from 'react';
2
2
  import type { CommonIconProps, GenericIconComponent } from './shared.js';
3
- export type IconMap = {
4
- [key: string]: GenericIconComponent;
3
+ export type IconMap<ExtraProps extends object = {}> = {
4
+ [key: string]: GenericIconComponent<ExtraProps>;
5
5
  };
6
6
  export declare const DefaultIconFallback: GenericIconComponent;
7
- export type IconProps = CommonIconProps & {
7
+ export type IconProps<ExtraProps extends object = {}> = CommonIconProps<ExtraProps> & {
8
8
  name: string;
9
9
  };
10
- export type IconFactoryOptions = {
11
- iconMap?: IconMap;
12
- fallback?: GenericIconComponent;
10
+ export type IconFactoryOptions<ExtraProps extends object = {}> = {
11
+ iconMap?: IconMap<ExtraProps>;
12
+ fallback?: GenericIconComponent<ExtraProps>;
13
13
  };
14
- export declare function createIconComponent({ iconMap, fallback }: IconFactoryOptions): React.ForwardRefExoticComponent<CommonIconProps & {
15
- name: string;
16
- } & React.RefAttributes<HTMLSpanElement>>;
14
+ export declare function createIconComponent<ExtraProps extends object = {}>({ iconMap, fallback }: IconFactoryOptions<ExtraProps>): React.ForwardRefExoticComponent<React.PropsWithoutRef<IconProps<ExtraProps>> & React.RefAttributes<HTMLSpanElement>>;
@@ -1,4 +1,9 @@
1
1
  import React from 'react';
2
- export declare const DSIcon: React.ForwardRefExoticComponent<import("./shared.js").CommonIconProps & {
2
+ export declare const DSIcon: React.ForwardRefExoticComponent<{
3
+ name?: string | undefined;
4
+ size?: import("./wrappers.js").IconSize | undefined;
5
+ style?: React.CSSProperties | undefined;
6
+ className?: string | undefined;
7
+ } & {
3
8
  name: string;
4
9
  } & React.RefAttributes<HTMLSpanElement>>;
@@ -1,9 +1,9 @@
1
1
  import React, { type ForwardRefExoticComponent } from 'react';
2
2
  import type { IconSize } from './wrappers.js';
3
- export type CommonIconProps = {
3
+ export type CommonIconProps<ExtraProps extends object = {}> = {
4
4
  name?: string;
5
5
  size?: IconSize;
6
6
  style?: React.CSSProperties;
7
7
  className?: string;
8
- };
9
- export type GenericIconComponent = ForwardRefExoticComponent<CommonIconProps & React.RefAttributes<HTMLSpanElement>>;
8
+ } & ExtraProps;
9
+ export type GenericIconComponent<ExtraProps extends object = {}> = ForwardRefExoticComponent<CommonIconProps<ExtraProps> & React.RefAttributes<HTMLSpanElement>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import SVGIcon from '@mui/material/SvgIcon';
3
2
  import type { GenericIconComponent } from './shared.js';
3
+ import type { SvgIconProps } from '@mui/material';
4
4
  export type IconSize = 'large' | 'medium' | 'small' | 'inherit';
5
- export declare function adaptMuiSvgIcon(MuiIcon: typeof SVGIcon): GenericIconComponent;
5
+ export declare function adaptMuiSvgIcon(MuiIcon: React.ComponentType<SvgIconProps>): GenericIconComponent;
6
6
  export declare function adaptSvgIcon(svg: React.JSX.Element): GenericIconComponent;
@@ -7,6 +7,7 @@ export type TextareaProps = {
7
7
  helpLabel?: React.ReactNode;
8
8
  error?: React.ReactNode;
9
9
  rows?: number;
10
+ onChange?: React.InputHTMLAttributes<HTMLTextAreaElement>['onChange'];
10
11
  style?: React.CSSProperties;
11
12
  className?: string;
12
13
  };
@@ -1,10 +1,12 @@
1
1
  import React from 'react';
2
+ import type { PopoverPlacement } from '../popover/index.js';
2
3
  export type TooltipProps = {
3
4
  isOpen?: boolean;
4
5
  children?: React.ReactNode;
5
6
  tooltip?: React.ReactNode;
7
+ placement?: PopoverPlacement;
6
8
  style?: React.CSSProperties;
7
9
  className?: string;
8
10
  };
9
- declare function Tooltip(props: TooltipProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function Tooltip({ placement, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
10
12
  export default Tooltip;
@@ -1,6 +1,7 @@
1
1
  import { VirtualElement as PopoverVirtualElement } from '@floating-ui/react';
2
2
  import React from 'react';
3
3
  export type { PopoverVirtualElement };
4
+ export declare const PopoverPlacementValues: readonly PopoverPlacement[];
4
5
  export type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
5
6
  export type PopoverAnchor = PopoverVirtualElement | (() => PopoverVirtualElement | null) | HTMLElement | (() => HTMLElement | null) | null | undefined;
6
7
  export type PopoverStrategy = 'absolute' | 'fixed';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "private": false,
5
5
  "description": "Design System for Veritone CE",
6
6
  "keywords": [
@@ -19,6 +19,7 @@
19
19
  "author": {
20
20
  "name": "Veritone"
21
21
  },
22
+ "type": "module",
22
23
  "main": "dist/cjs/index.js",
23
24
  "module": "dist/esm/index.js",
24
25
  "types": "dist/types/src/index.d.ts",
@@ -122,7 +123,7 @@
122
123
  "@storybook/testing-library": "^0.2.0",
123
124
  "@testing-library/jest-dom": "^5.14.1",
124
125
  "@testing-library/react": "^13.4.0",
125
- "@testing-library/user-event": "^13.2.1",
126
+ "@testing-library/user-event": "^14.5.2",
126
127
  "@types/jest": "^27.0.1",
127
128
  "@types/node": "^16.7.13",
128
129
  "@types/react": "^18.0.0",
@@ -138,6 +139,7 @@
138
139
  "cssnano": "^6.0.3",
139
140
  "cz-conventional-changelog": "^3.3.0",
140
141
  "esbuild": "^0.19.11",
142
+ "esbuild-jest": "^0.5.0",
141
143
  "esbuild-runner": "^2.2.2",
142
144
  "eslint": "^8.49.0",
143
145
  "eslint-config-prettier": "^9.0.0",
@@ -147,6 +149,7 @@
147
149
  "eslint-plugin-react-hooks": "^4.6.0",
148
150
  "eslint-plugin-storybook": "^0.6.13",
149
151
  "husky": "8.0.2",
152
+ "identity-obj-proxy": "^3.0.0",
150
153
  "jest": "^29.3.1",
151
154
  "jest-environment-jsdom": "^29.3.1",
152
155
  "lint-staged": "^14.0.1",
@@ -159,6 +162,7 @@
159
162
  "rollup-plugin-copy": "^3.5.0",
160
163
  "rollup-plugin-delete": "^2.0.0",
161
164
  "rollup-plugin-esbuild": "^6.1.0",
165
+ "rollup-plugin-jsx-remove-attributes": "^1.0.1",
162
166
  "rollup-plugin-preserve-directives": "^0.3.0",
163
167
  "rollup-plugin-styles": "^4.0.0",
164
168
  "sass": "^1.70.0",