@webority/ui-react 0.6.9 → 0.6.11
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/types/components/AppAutocomplete.d.ts +3 -1
- package/dist/types/components/AppMultiSelect.d.ts +8 -1
- package/dist/types/components/AppOtpInput.d.ts +12 -0
- package/dist/types/components/AppSearch.d.ts +8 -2
- package/dist/types/components/AppSelect.d.ts +2 -1
- package/dist/types/components/AppSelectMini.d.ts +4 -1
- package/dist/ui-react.js +388 -317
- package/package.json +3 -3
|
@@ -17,6 +17,7 @@ import '@webority/ui-elements';
|
|
|
17
17
|
* @param {number} [props.minChars] Min chars before a remote search fires (default 1 in remote mode).
|
|
18
18
|
* @param {number} [props.debounce] Debounce ms for remote search (default 250).
|
|
19
19
|
* @param {boolean} [props.disabled]
|
|
20
|
+
* @param {'sm'|'lg'} [props.size] Control size around the default.
|
|
20
21
|
* @param {string} [props.name]
|
|
21
22
|
* @param {import('react').ReactNode} [props.label]
|
|
22
23
|
* @param {string} [props.error]
|
|
@@ -24,7 +25,7 @@ import '@webority/ui-elements';
|
|
|
24
25
|
* @param {boolean} [props.required]
|
|
25
26
|
* @param {string} [props.fieldClassName]
|
|
26
27
|
*/
|
|
27
|
-
export default function AppAutocomplete({ value, onChange, options, loadOptions, placeholder, minChars, debounce, disabled, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
28
|
+
export default function AppAutocomplete({ value, onChange, options, loadOptions, placeholder, minChars, debounce, disabled, size, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
28
29
|
value?: string;
|
|
29
30
|
onChange?: (value: string) => void;
|
|
30
31
|
options?: {
|
|
@@ -39,6 +40,7 @@ export default function AppAutocomplete({ value, onChange, options, loadOptions,
|
|
|
39
40
|
minChars?: number;
|
|
40
41
|
debounce?: number;
|
|
41
42
|
disabled?: boolean;
|
|
43
|
+
size?: 'sm' | 'lg';
|
|
42
44
|
name?: string;
|
|
43
45
|
label?: import('react').ReactNode;
|
|
44
46
|
error?: string;
|
|
@@ -11,6 +11,10 @@ import '@webority/ui-elements';
|
|
|
11
11
|
* @param {string} [props.searchPlaceholder] Placeholder for the in-menu search box.
|
|
12
12
|
* @param {boolean} [props.searchable=true]
|
|
13
13
|
* @param {boolean} [props.disabled]
|
|
14
|
+
* @param {string} [props.icon] Leading glyph inside the control (a Bootstrap Icons name).
|
|
15
|
+
* @param {'sm'|'lg'} [props.size] Control size around the default.
|
|
16
|
+
* @param {boolean} [props.collapseChips=false] Keep the chosen chips on one row and fold the
|
|
17
|
+
* overflow into a "+N" counter, rather than letting the control grow.
|
|
14
18
|
* @param {string} [props.name]
|
|
15
19
|
* @param {import('react').ReactNode} [props.label]
|
|
16
20
|
* @param {string} [props.error]
|
|
@@ -18,7 +22,7 @@ import '@webority/ui-elements';
|
|
|
18
22
|
* @param {boolean} [props.required]
|
|
19
23
|
* @param {string} [props.fieldClassName]
|
|
20
24
|
*/
|
|
21
|
-
export default function AppMultiSelect({ values, onChange, options, placeholder, searchPlaceholder, searchable, disabled, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
25
|
+
export default function AppMultiSelect({ values, onChange, options, placeholder, searchPlaceholder, searchable, disabled, icon, size, collapseChips, name, label, error, hint, required, fieldClassName, ...rest }: {
|
|
22
26
|
values?: string[];
|
|
23
27
|
onChange?: (values: string[]) => void;
|
|
24
28
|
options?: {
|
|
@@ -29,6 +33,9 @@ export default function AppMultiSelect({ values, onChange, options, placeholder,
|
|
|
29
33
|
searchPlaceholder?: string;
|
|
30
34
|
searchable?: boolean;
|
|
31
35
|
disabled?: boolean;
|
|
36
|
+
icon?: string;
|
|
37
|
+
size?: 'sm' | 'lg';
|
|
38
|
+
collapseChips?: boolean;
|
|
32
39
|
name?: string;
|
|
33
40
|
label?: import('react').ReactNode;
|
|
34
41
|
error?: string;
|
|
@@ -18,6 +18,18 @@ import '@webority/ui-elements';
|
|
|
18
18
|
* @param {(value: string) => void} [props.onChange]
|
|
19
19
|
* @param {(value: string) => void} [props.onComplete] Fires once, when the last character
|
|
20
20
|
* lands — so a form can submit itself without polling the value.
|
|
21
|
+
*
|
|
22
|
+
* It receives the CODE, not a DOM event. With react-hook-form that matters:
|
|
23
|
+
* `onComplete={handleSubmit(onSubmit)}` hands a string to a handler that expects an event
|
|
24
|
+
* and calls `preventDefault` on it. RHF v7 guards against it so the short form happens to
|
|
25
|
+
* work — by accident, and not something to rely on. Wrap it instead:
|
|
26
|
+
*
|
|
27
|
+
* ```jsx
|
|
28
|
+
* <AppOtpInput onComplete={() => handleSubmit(onSubmit)()} />
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* The component is also CONTROLLED, so with RHF it wants `<Controller>` rather than
|
|
32
|
+
* `register`.
|
|
21
33
|
* @param {number} [props.length=6] Characters in the code. TOTP is 6; backup codes are often 8.
|
|
22
34
|
* @param {"numeric"|"alphanumeric"} [props.mode="numeric"] Drives the on-screen keyboard and
|
|
23
35
|
* what the field will accept.
|
|
@@ -4,17 +4,23 @@
|
|
|
4
4
|
* @param {object} props
|
|
5
5
|
* @param {string} props.value
|
|
6
6
|
* @param {(value: string) => void} props.onValueChange
|
|
7
|
-
* @param {string} [props.placeholder]
|
|
7
|
+
* @param {string} [props.placeholder='Search…']
|
|
8
8
|
* @param {string} [props.ariaLabel]
|
|
9
9
|
* @param {number} [props.iconSize=18]
|
|
10
|
+
* @param {'sm'|'lg'} [props.size] Control size around the default.
|
|
11
|
+
* @param {boolean} [props.loading=false] Swap the leading glyph for a spinner while a search is in flight.
|
|
12
|
+
* @param {boolean} [props.disabled=false]
|
|
10
13
|
* @param {string} [props.className]
|
|
11
14
|
*/
|
|
12
|
-
export default function AppSearch({ value, onValueChange, placeholder, ariaLabel, iconSize, className, // extra classes on the wrapper
|
|
15
|
+
export default function AppSearch({ value, onValueChange, placeholder, ariaLabel, iconSize, size, loading, disabled, className, // extra classes on the wrapper
|
|
13
16
|
...rest }: {
|
|
14
17
|
value: string;
|
|
15
18
|
onValueChange: (value: string) => void;
|
|
16
19
|
placeholder?: string;
|
|
17
20
|
ariaLabel?: string;
|
|
18
21
|
iconSize?: number;
|
|
22
|
+
size?: 'sm' | 'lg';
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
disabled?: boolean;
|
|
19
25
|
className?: string;
|
|
20
26
|
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@webority/ui-elements';
|
|
2
|
-
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, clearable, size, floatingLabel, disabled, label, required, error, hint, help, helpLabel, id, name, className, fieldClassName, ...rest }: {
|
|
2
|
+
export default function AppSelect({ value, onChange, options, placeholder, searchPlaceholder, searchable, clearable, size, icon, floatingLabel, disabled, label, required, error, hint, help, helpLabel, id, name, className, fieldClassName, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
className?: string;
|
|
5
5
|
clearable?: boolean;
|
|
@@ -10,6 +10,7 @@ export default function AppSelect({ value, onChange, options, placeholder, searc
|
|
|
10
10
|
help: any;
|
|
11
11
|
helpLabel?: string;
|
|
12
12
|
hint: any;
|
|
13
|
+
icon: any;
|
|
13
14
|
id: any;
|
|
14
15
|
label: any;
|
|
15
16
|
name: any;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import '@webority/ui-elements';
|
|
2
|
-
export default function AppSelectMini({ value, onChange, options, placeholder, name, ariaLabel, id, disabled, className, ...rest }: {
|
|
2
|
+
export default function AppSelectMini({ value, onChange, options, placeholder, name, ariaLabel, id, disabled, size, icon, prefix, className, ...rest }: {
|
|
3
3
|
[x: string]: any;
|
|
4
4
|
ariaLabel: any;
|
|
5
5
|
className: any;
|
|
6
6
|
disabled: any;
|
|
7
|
+
icon: any;
|
|
7
8
|
id: any;
|
|
8
9
|
name: any;
|
|
9
10
|
onChange: any;
|
|
10
11
|
options?: any[];
|
|
11
12
|
placeholder?: string;
|
|
13
|
+
prefix: any;
|
|
14
|
+
size: any;
|
|
12
15
|
value: any;
|
|
13
16
|
}): import("react").JSX.Element;
|