@veritone-ce/design-system 2.6.1-alpha.1 → 2.6.1-alpha.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.
- package/dist/cjs/Select/controlled.js +1 -0
- package/dist/cjs/extras/markdown/index.js +1 -3
- package/dist/cjs/unstable/extras/forms/button.js +1 -0
- package/dist/cjs/unstable/extras/forms/checkbox.js +35 -0
- package/dist/cjs/unstable/extras/forms/index.js +4 -0
- package/dist/cjs/unstable/extras/forms/input.js +1 -0
- package/dist/cjs/unstable/extras/forms/select.js +46 -0
- package/dist/cjs/unstable/extras/forms/shared.js +1 -0
- package/dist/cjs/unstable/extras/forms/textarea.js +1 -0
- package/dist/esm/Select/controlled.js +1 -0
- package/dist/esm/extras/markdown/index.js +1 -1
- package/dist/esm/unstable/extras/forms/button.js +1 -0
- package/dist/esm/unstable/extras/forms/checkbox.js +33 -0
- package/dist/esm/unstable/extras/forms/index.js +2 -0
- package/dist/esm/unstable/extras/forms/input.js +1 -0
- package/dist/esm/unstable/extras/forms/select.js +44 -0
- package/dist/esm/unstable/extras/forms/shared.js +1 -0
- package/dist/esm/unstable/extras/forms/textarea.js +1 -0
- package/dist/types/Select/controlled.d.ts +1 -0
- package/dist/types/Select/uncontrolled.d.ts +1 -0
- package/dist/types/extras/markdown/index.d.ts +1 -1
- package/dist/types/unstable/extras/forms/checkbox.d.ts +5 -0
- package/dist/types/unstable/extras/forms/index.d.ts +2 -0
- package/dist/types/unstable/extras/forms/select.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
5
|
var ReactMarkdown = require('react-markdown');
|
|
8
6
|
var styles_module = require('./styles.module.scss.js');
|
|
@@ -245,4 +243,4 @@ function Markdown({
|
|
|
245
243
|
);
|
|
246
244
|
}
|
|
247
245
|
|
|
248
|
-
exports.
|
|
246
|
+
exports.Markdown = Markdown;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactHookForm = require('react-hook-form');
|
|
7
|
+
var shared = require('./shared.js');
|
|
8
|
+
var index$1 = require('../../../Checkbox/index.js');
|
|
9
|
+
var index = require('../../../FormControl/index.js');
|
|
10
|
+
|
|
11
|
+
function FormCheckbox(props) {
|
|
12
|
+
const { controllerProps, formControlProps, inputProps } = shared.extractControllerProps(props);
|
|
13
|
+
const { label, ...restFormControlProps } = formControlProps;
|
|
14
|
+
const { field, fieldState } = reactHookForm.useController(controllerProps);
|
|
15
|
+
const errorMessage = shared.useFormErrorMessage(fieldState.error);
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
+
index.default,
|
|
18
|
+
{
|
|
19
|
+
disabled: field.disabled,
|
|
20
|
+
...restFormControlProps,
|
|
21
|
+
error: errorMessage,
|
|
22
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
23
|
+
index$1.default,
|
|
24
|
+
{
|
|
25
|
+
...inputProps,
|
|
26
|
+
...field,
|
|
27
|
+
label,
|
|
28
|
+
checked: field.value ?? false
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
exports.FormCheckbox = FormCheckbox;
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var button = require('./button.js');
|
|
5
|
+
var checkbox = require('./checkbox.js');
|
|
5
6
|
var input = require('./input.js');
|
|
7
|
+
var select = require('./select.js');
|
|
6
8
|
var shared = require('./shared.js');
|
|
7
9
|
var textarea = require('./textarea.js');
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
exports.FormSubmitButton = button.FormSubmitButton;
|
|
14
|
+
exports.FormCheckbox = checkbox.FormCheckbox;
|
|
12
15
|
exports.FormInput = input.FormInput;
|
|
16
|
+
exports.FormSelect = select.FormSelect;
|
|
13
17
|
exports.extractControllerProps = shared.extractControllerProps;
|
|
14
18
|
exports.useFormErrorMessage = shared.useFormErrorMessage;
|
|
15
19
|
exports.FormTextarea = textarea.FormTextarea;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactHookForm = require('react-hook-form');
|
|
7
|
+
var shared = require('./shared.js');
|
|
8
|
+
require('../../../Select/controlled.js');
|
|
9
|
+
var uncontrolled = require('../../../Select/uncontrolled.js');
|
|
10
|
+
require('react');
|
|
11
|
+
var index = require('../../../FormControl/index.js');
|
|
12
|
+
|
|
13
|
+
function FormSelect(props) {
|
|
14
|
+
const { controllerProps, formControlProps, inputProps } = shared.extractControllerProps(props);
|
|
15
|
+
const { field, fieldState } = reactHookForm.useController(controllerProps);
|
|
16
|
+
const { onChange, ref: _ref, ...restFieldProps } = field;
|
|
17
|
+
const errorMessage = shared.useFormErrorMessage(fieldState.error);
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
19
|
+
index.default,
|
|
20
|
+
{
|
|
21
|
+
disabled: field.disabled,
|
|
22
|
+
...formControlProps,
|
|
23
|
+
error: errorMessage,
|
|
24
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
|
+
uncontrolled.default,
|
|
26
|
+
{
|
|
27
|
+
...inputProps,
|
|
28
|
+
...restFieldProps,
|
|
29
|
+
value: field.value,
|
|
30
|
+
onChange: (e, newValue) => {
|
|
31
|
+
console.log(newValue);
|
|
32
|
+
onChange({
|
|
33
|
+
...e,
|
|
34
|
+
target: {
|
|
35
|
+
...e.target,
|
|
36
|
+
value: newValue
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.FormSelect = FormSelect;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useController } from 'react-hook-form';
|
|
5
|
+
import { extractControllerProps, useFormErrorMessage } from './shared.js';
|
|
6
|
+
import Checkbox from '../../../Checkbox/index.js';
|
|
7
|
+
import FormControl from '../../../FormControl/index.js';
|
|
8
|
+
|
|
9
|
+
function FormCheckbox(props) {
|
|
10
|
+
const { controllerProps, formControlProps, inputProps } = extractControllerProps(props);
|
|
11
|
+
const { label, ...restFormControlProps } = formControlProps;
|
|
12
|
+
const { field, fieldState } = useController(controllerProps);
|
|
13
|
+
const errorMessage = useFormErrorMessage(fieldState.error);
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
FormControl,
|
|
16
|
+
{
|
|
17
|
+
disabled: field.disabled,
|
|
18
|
+
...restFormControlProps,
|
|
19
|
+
error: errorMessage,
|
|
20
|
+
children: /* @__PURE__ */ jsx(
|
|
21
|
+
Checkbox,
|
|
22
|
+
{
|
|
23
|
+
...inputProps,
|
|
24
|
+
...field,
|
|
25
|
+
label,
|
|
26
|
+
checked: field.value ?? false
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { FormCheckbox };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
export { FormSubmitButton } from './button.js';
|
|
3
|
+
export { FormCheckbox } from './checkbox.js';
|
|
3
4
|
export { FormInput } from './input.js';
|
|
5
|
+
export { FormSelect } from './select.js';
|
|
4
6
|
export { extractControllerProps, useFormErrorMessage } from './shared.js';
|
|
5
7
|
export { FormTextarea } from './textarea.js';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useController } from 'react-hook-form';
|
|
5
|
+
import { extractControllerProps, useFormErrorMessage } from './shared.js';
|
|
6
|
+
import '../../../Select/controlled.js';
|
|
7
|
+
import Select from '../../../Select/uncontrolled.js';
|
|
8
|
+
import 'react';
|
|
9
|
+
import FormControl from '../../../FormControl/index.js';
|
|
10
|
+
|
|
11
|
+
function FormSelect(props) {
|
|
12
|
+
const { controllerProps, formControlProps, inputProps } = extractControllerProps(props);
|
|
13
|
+
const { field, fieldState } = useController(controllerProps);
|
|
14
|
+
const { onChange, ref: _ref, ...restFieldProps } = field;
|
|
15
|
+
const errorMessage = useFormErrorMessage(fieldState.error);
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
FormControl,
|
|
18
|
+
{
|
|
19
|
+
disabled: field.disabled,
|
|
20
|
+
...formControlProps,
|
|
21
|
+
error: errorMessage,
|
|
22
|
+
children: /* @__PURE__ */ jsx(
|
|
23
|
+
Select,
|
|
24
|
+
{
|
|
25
|
+
...inputProps,
|
|
26
|
+
...restFieldProps,
|
|
27
|
+
value: field.value,
|
|
28
|
+
onChange: (e, newValue) => {
|
|
29
|
+
console.log(newValue);
|
|
30
|
+
onChange({
|
|
31
|
+
...e,
|
|
32
|
+
target: {
|
|
33
|
+
...e.target,
|
|
34
|
+
value: newValue
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { FormSelect };
|
|
@@ -9,6 +9,7 @@ export type ControlledSelectProps<OptionValue, Multiple extends boolean | undefi
|
|
|
9
9
|
*/
|
|
10
10
|
multiple: Multiple;
|
|
11
11
|
onChange(event: React.SyntheticEvent<HTMLElement>, newValue: Multiple extends true ? SelectMultiValue<OptionValue> : SelectSingleValue<OptionValue>): void;
|
|
12
|
+
onBlur?(): void;
|
|
12
13
|
onInputChange(event: React.SyntheticEvent<HTMLElement>, newValue: string): void;
|
|
13
14
|
'data-pendo'?: string;
|
|
14
15
|
tight?: boolean;
|
|
@@ -6,6 +6,7 @@ export type SelectProps<OptionValue, Multiple extends boolean | undefined> = Com
|
|
|
6
6
|
value?: Multiple extends true ? SelectMultiValue<OptionValue> : SelectSingleValue<OptionValue>;
|
|
7
7
|
inputValue?: string;
|
|
8
8
|
onChange?(event: React.SyntheticEvent<HTMLElement>, newValue: Multiple extends true ? SelectMultiValue<OptionValue> : SelectSingleValue<OptionValue>): void;
|
|
9
|
+
onBlur?(): void;
|
|
9
10
|
onInputChange?(event: React.SyntheticEvent<HTMLElement>, newValue: string, tight?: boolean): void;
|
|
10
11
|
tight?: boolean;
|
|
11
12
|
};
|
|
@@ -23,5 +23,5 @@ export type MarkdownProps = Options & {
|
|
|
23
23
|
[key in keyof DefaultComponentsType]?: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
-
export
|
|
26
|
+
export declare function Markdown({ components, headerIncrement, paragraphIncrement, style, className, styles: componentStyles, classNames: componentClassNames, ...props }: MarkdownProps): import("react/jsx-runtime").JSX.Element;
|
|
27
27
|
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import type { FormControlProps } from '../../../FormControl/index.js';
|
|
3
|
+
import { CheckboxProps } from '../../../Checkbox/index.js';
|
|
4
|
+
export type FormCheckboxProps<FormValues extends FieldValues> = UseControllerProps<FormValues> & FormControlProps & Omit<CheckboxProps, 'checked'>;
|
|
5
|
+
export declare function FormCheckbox<FormValues extends FieldValues>(props: FormCheckboxProps<FormValues>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FieldValues, UseControllerProps } from 'react-hook-form';
|
|
2
|
+
import type { FormControlProps } from '../../../FormControl/index.js';
|
|
3
|
+
import { SelectProps } from '../../../Select/index.js';
|
|
4
|
+
export type FormSelectProps<FormValues extends FieldValues, OptionValue, Multiple extends boolean | undefined> = UseControllerProps<FormValues> & FormControlProps & SelectProps<OptionValue, Multiple>;
|
|
5
|
+
export declare function FormSelect<FormValues extends FieldValues, OptionValue, Multiple extends boolean | undefined>(props: FormSelectProps<FormValues, OptionValue, Multiple>): import("react/jsx-runtime").JSX.Element;
|