@veritone-ce/design-system 2.4.4 → 2.4.6
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.
- package/README.md +16 -0
- package/dist/cjs/Checkbox/index.js +1 -0
- package/dist/cjs/IconButton/index.js +1 -0
- package/dist/cjs/Menu/controlled.js +3 -1
- package/dist/cjs/Select/controlled.js +2 -1
- package/dist/cjs/TablePagination/index.js +4 -1
- package/dist/esm/Checkbox/index.js +1 -0
- package/dist/esm/IconButton/index.js +1 -0
- package/dist/esm/Menu/controlled.js +3 -1
- package/dist/esm/Select/controlled.js +2 -1
- package/dist/esm/TablePagination/index.js +4 -1
- package/dist/types/Checkbox/index.d.ts +2 -0
- package/dist/types/Menu/controlled.d.ts +3 -0
- package/dist/types/Select/controlled.d.ts +1 -0
- package/dist/types/TablePagination/index.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -40,3 +40,19 @@ Builds the documentation for production to the `storybook-static` folder.
|
|
|
40
40
|
You can learn more in the [Storybook Design System for Developers](https://storybook.js.org/tutorials/design-systems-for-developers/). [Chromatic](https://www.chromatic.com/docs/)
|
|
41
41
|
|
|
42
42
|
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
43
|
+
|
|
44
|
+
## To Test in Another App
|
|
45
|
+
|
|
46
|
+
Are you adding new components or making changes in the Design System that you want to test out locally in another application? Here are some instructions to get you started.
|
|
47
|
+
|
|
48
|
+
1. In Design System run `yarn publish:local`
|
|
49
|
+
|
|
50
|
+
- If this is your first time, you may need be prompted to install `yalc`, proceed with `y` to install it.
|
|
51
|
+
|
|
52
|
+
2. In the other app running locally, run `npx yalc add @veritone-ce/design-system`
|
|
53
|
+
|
|
54
|
+
- This will replace the `@veritone-ce/design-system` in the package.json with the local version.
|
|
55
|
+
|
|
56
|
+
**Be sure to revert the package.json changes before pushing changes**
|
|
57
|
+
|
|
58
|
+
3. Repeat steps 1 & 2 after any design system changes to update them in the other app.
|
|
@@ -52,6 +52,7 @@ const Checkbox = React.forwardRef(
|
|
|
52
52
|
"data-testid": dataTestId,
|
|
53
53
|
style,
|
|
54
54
|
className: cx.cx(styles_module.default["checkbox"], className),
|
|
55
|
+
"data-pendo": props["data-pendo"],
|
|
55
56
|
children: [
|
|
56
57
|
/* @__PURE__ */ jsxRuntime.jsxs("label", { className: styles_module.default["passthrough-label-container"], children: [
|
|
57
58
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -129,6 +129,7 @@ function Menu({
|
|
|
129
129
|
{
|
|
130
130
|
role: "menuitem",
|
|
131
131
|
isActive: i === activeIndex,
|
|
132
|
+
disabled: option.disabled,
|
|
132
133
|
...getItemProps({
|
|
133
134
|
onClick(event) {
|
|
134
135
|
option.onSelect(event);
|
|
@@ -136,7 +137,8 @@ function Menu({
|
|
|
136
137
|
}),
|
|
137
138
|
render: option.render,
|
|
138
139
|
label: option.label,
|
|
139
|
-
icon: option.icon
|
|
140
|
+
icon: option.icon,
|
|
141
|
+
"data-pendo": option["data-pendo"]
|
|
140
142
|
},
|
|
141
143
|
i
|
|
142
144
|
))
|
|
@@ -76,7 +76,8 @@ function ControlledSelect({
|
|
|
76
76
|
setOpen(true);
|
|
77
77
|
props.onInputChange(e, e.target.value);
|
|
78
78
|
},
|
|
79
|
-
className: styles_module.default["inner-input"]
|
|
79
|
+
className: styles_module.default["inner-input"],
|
|
80
|
+
"data-pendo": props["data-pendo"]
|
|
80
81
|
}
|
|
81
82
|
) }),
|
|
82
83
|
selectedOption && clearable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -35,7 +35,8 @@ function TablePagination({
|
|
|
35
35
|
value: option
|
|
36
36
|
})),
|
|
37
37
|
onChange: (_, newRowsPerPage) => props.onRowsPerPageChange?.(newRowsPerPage),
|
|
38
|
-
className: styles_module.default["rows-per-page-select"]
|
|
38
|
+
className: styles_module.default["rows-per-page-select"],
|
|
39
|
+
"data-pendo": props["data-pendo-select"]
|
|
39
40
|
}
|
|
40
41
|
) }),
|
|
41
42
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles_module.default["page-counts"], children: [
|
|
@@ -53,6 +54,7 @@ function TablePagination({
|
|
|
53
54
|
type: "button",
|
|
54
55
|
disabled: !showPrev,
|
|
55
56
|
onClick: () => props.onChangePage(page - 1),
|
|
57
|
+
"data-pendo": props["data-pendo-prev"],
|
|
56
58
|
children: /* @__PURE__ */ jsxRuntime.jsx(internal.NavigateBeforeIcon, {})
|
|
57
59
|
}
|
|
58
60
|
) }),
|
|
@@ -62,6 +64,7 @@ function TablePagination({
|
|
|
62
64
|
type: "button",
|
|
63
65
|
disabled: !showNext,
|
|
64
66
|
onClick: () => props.onChangePage(page + 1),
|
|
67
|
+
"data-pendo": props["data-pendo-next"],
|
|
65
68
|
children: /* @__PURE__ */ jsxRuntime.jsx(internal.NavigateNextIcon, {})
|
|
66
69
|
}
|
|
67
70
|
) })
|
|
@@ -48,6 +48,7 @@ const Checkbox = forwardRef(
|
|
|
48
48
|
"data-testid": dataTestId,
|
|
49
49
|
style,
|
|
50
50
|
className: cx(css["checkbox"], className),
|
|
51
|
+
"data-pendo": props["data-pendo"],
|
|
51
52
|
children: [
|
|
52
53
|
/* @__PURE__ */ jsxs("label", { className: css["passthrough-label-container"], children: [
|
|
53
54
|
/* @__PURE__ */ jsx(
|
|
@@ -125,6 +125,7 @@ function Menu({
|
|
|
125
125
|
{
|
|
126
126
|
role: "menuitem",
|
|
127
127
|
isActive: i === activeIndex,
|
|
128
|
+
disabled: option.disabled,
|
|
128
129
|
...getItemProps({
|
|
129
130
|
onClick(event) {
|
|
130
131
|
option.onSelect(event);
|
|
@@ -132,7 +133,8 @@ function Menu({
|
|
|
132
133
|
}),
|
|
133
134
|
render: option.render,
|
|
134
135
|
label: option.label,
|
|
135
|
-
icon: option.icon
|
|
136
|
+
icon: option.icon,
|
|
137
|
+
"data-pendo": option["data-pendo"]
|
|
136
138
|
},
|
|
137
139
|
i
|
|
138
140
|
))
|
|
@@ -72,7 +72,8 @@ function ControlledSelect({
|
|
|
72
72
|
setOpen(true);
|
|
73
73
|
props.onInputChange(e, e.target.value);
|
|
74
74
|
},
|
|
75
|
-
className: css["inner-input"]
|
|
75
|
+
className: css["inner-input"],
|
|
76
|
+
"data-pendo": props["data-pendo"]
|
|
76
77
|
}
|
|
77
78
|
) }),
|
|
78
79
|
selectedOption && clearable && /* @__PURE__ */ jsx(
|
|
@@ -31,7 +31,8 @@ function TablePagination({
|
|
|
31
31
|
value: option
|
|
32
32
|
})),
|
|
33
33
|
onChange: (_, newRowsPerPage) => props.onRowsPerPageChange?.(newRowsPerPage),
|
|
34
|
-
className: css["rows-per-page-select"]
|
|
34
|
+
className: css["rows-per-page-select"],
|
|
35
|
+
"data-pendo": props["data-pendo-select"]
|
|
35
36
|
}
|
|
36
37
|
) }),
|
|
37
38
|
/* @__PURE__ */ jsxs("span", { className: css["page-counts"], children: [
|
|
@@ -49,6 +50,7 @@ function TablePagination({
|
|
|
49
50
|
type: "button",
|
|
50
51
|
disabled: !showPrev,
|
|
51
52
|
onClick: () => props.onChangePage(page - 1),
|
|
53
|
+
"data-pendo": props["data-pendo-prev"],
|
|
52
54
|
children: /* @__PURE__ */ jsx(NavigateBeforeIcon, {})
|
|
53
55
|
}
|
|
54
56
|
) }),
|
|
@@ -58,6 +60,7 @@ function TablePagination({
|
|
|
58
60
|
type: "button",
|
|
59
61
|
disabled: !showNext,
|
|
60
62
|
onClick: () => props.onChangePage(page + 1),
|
|
63
|
+
"data-pendo": props["data-pendo-next"],
|
|
61
64
|
children: /* @__PURE__ */ jsx(NavigateNextIcon, {})
|
|
62
65
|
}
|
|
63
66
|
) })
|
|
@@ -7,6 +7,7 @@ export type CheckboxProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'type'
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
onChange?(event: React.ChangeEvent<HTMLInputElement>, checked: boolean): void;
|
|
9
9
|
'data-testid'?: string;
|
|
10
|
+
'data-pendo'?: string;
|
|
10
11
|
style?: React.CSSProperties;
|
|
11
12
|
className?: string;
|
|
12
13
|
};
|
|
@@ -18,6 +19,7 @@ declare const Checkbox: React.ForwardRefExoticComponent<Omit<Omit<React.Detailed
|
|
|
18
19
|
disabled?: boolean | undefined;
|
|
19
20
|
onChange?(event: React.ChangeEvent<HTMLInputElement>, checked: boolean): void;
|
|
20
21
|
'data-testid'?: string | undefined;
|
|
22
|
+
'data-pendo'?: string | undefined;
|
|
21
23
|
style?: React.CSSProperties | undefined;
|
|
22
24
|
className?: string | undefined;
|
|
23
25
|
} & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -5,6 +5,8 @@ export type MenuOption = {
|
|
|
5
5
|
render?: React.ReactNode;
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
onSelect(e: React.MouseEvent<HTMLButtonElement>): void;
|
|
8
|
+
'data-pendo'?: string;
|
|
9
|
+
disabled?: boolean;
|
|
8
10
|
};
|
|
9
11
|
export type MenuRole = 'tooltip' | 'dialog' | 'alertdialog' | 'menu' | 'listbox' | 'grid' | 'tree' | 'select' | 'label' | 'combobox';
|
|
10
12
|
export type MenuProps = {
|
|
@@ -32,6 +34,7 @@ export type MenuItemProps = {
|
|
|
32
34
|
icon?: React.ReactNode;
|
|
33
35
|
isActive: boolean;
|
|
34
36
|
disabled?: boolean;
|
|
37
|
+
'data-pendo'?: string;
|
|
35
38
|
};
|
|
36
39
|
export declare const MenuItem: React.ForwardRefExoticComponent<MenuItemProps & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
|
|
37
40
|
export default Menu;
|
|
@@ -5,6 +5,7 @@ export type ControlledSelectProps<OptionValue> = CommonSelectProps<OptionValue>
|
|
|
5
5
|
inputValue: string;
|
|
6
6
|
onChange(event: React.SyntheticEvent<HTMLElement>, newValue: SelectValue<OptionValue>): void;
|
|
7
7
|
onInputChange(event: React.SyntheticEvent<HTMLElement>, newValue: string): void;
|
|
8
|
+
'data-pendo'?: string;
|
|
8
9
|
};
|
|
9
10
|
declare function ControlledSelect<OptionValue>({ ref, endIcon, placeholder, clearable, ...props }: ControlledSelectProps<OptionValue>): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default ControlledSelect;
|
|
@@ -7,6 +7,9 @@ export type TablePaginationProps = {
|
|
|
7
7
|
onRowsPerPageChange?(rowsPerPage: number): void;
|
|
8
8
|
rowsPerPageOptions?: number[];
|
|
9
9
|
rowsPerPageLabel?: React.ReactNode;
|
|
10
|
+
'data-pendo-select'?: string;
|
|
11
|
+
'data-pendo-prev'?: string;
|
|
12
|
+
'data-pendo-next'?: string;
|
|
10
13
|
className?: string;
|
|
11
14
|
};
|
|
12
15
|
export default function TablePagination({ page, count, rowsPerPage, rowsPerPageOptions, rowsPerPageLabel, ...props }: TablePaginationProps): import("react/jsx-runtime").JSX.Element;
|