@payfit/unity-components 2.46.39 → 2.47.0
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/esm/components/definition-list/DefinitionList.context.js +17 -0
- package/dist/esm/components/definition-list/DefinitionList.js +23 -0
- package/dist/esm/components/definition-list/parts/DefinitionItem.js +51 -0
- package/dist/esm/components/multi-select/MultiSelect.d.ts +6 -1
- package/dist/esm/components/multi-select/MultiSelect.js +286 -238
- package/dist/esm/components/multi-select/Multiselect.context.d.ts +1 -1
- package/dist/esm/components/multi-select/MultiselectTypes.d.ts +5 -4
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.d.ts +20 -13
- package/dist/esm/components/multi-select/parts/MultiSelectOptGroup.js +33 -22
- package/dist/esm/components/multi-select/parts/MultiSelectOption.d.ts +6 -3
- package/dist/esm/components/multi-select/parts/MultiSelectOption.js +51 -59
- package/dist/esm/components/multi-select/utils/selection-adapter.d.ts +5 -0
- package/dist/esm/components/multi-select/utils/selection-adapter.js +18 -0
- package/dist/esm/components/phone-number/PhoneNumberInput.js +38 -36
- package/dist/esm/components/select/Select.js +47 -44
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +444 -440
- package/package.json +7 -7
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.d.ts +0 -12
- package/dist/esm/components/multi-select/hooks/use-combobox-filter.js +0 -22
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.d.ts +0 -14
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +0 -47
- package/dist/esm/components/multi-select/parts/MultiSelectButton.d.ts +0 -18
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +0 -174
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.d.ts +0 -7
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +0 -65
- package/dist/esm/components/select/parts/SearchInput.d.ts +0 -5
- package/dist/esm/components/select/parts/SearchInput.js +0 -59
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { UseComboboxFilterProps } from './hooks/use-combobox-filter.js';
|
|
2
1
|
type Key = string | number;
|
|
3
2
|
/**
|
|
4
3
|
* Common props shared by all MultiSelect variants.
|
|
@@ -26,6 +25,8 @@ export interface MultiSelectBaseProps {
|
|
|
26
25
|
onFocus?: () => void;
|
|
27
26
|
/** Callback when the select is blurred */
|
|
28
27
|
onBlur?: () => void;
|
|
28
|
+
/** Callback triggered when the select popover changes its open state */
|
|
29
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
29
30
|
/** The ID of the element that labels this select when no visible label is provided */
|
|
30
31
|
'aria-labelledby'?: string;
|
|
31
32
|
/** The ID of the element that labels this select when no visible label is provided */
|
|
@@ -49,7 +50,7 @@ export interface FlatSelectProps<TItems extends Set<unknown>> extends MultiSelec
|
|
|
49
50
|
renderValue?: (value: Set<TItems extends Set<infer U> ? U : never>) => string;
|
|
50
51
|
/** Children must be a render function that returns Option components */ children: (item: TItems extends Set<infer U> ? U : never) => React.JSX.Element;
|
|
51
52
|
/** Options for filtering the items */
|
|
52
|
-
searchOptions?:
|
|
53
|
+
searchOptions?: Intl.CollatorOptions;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
56
|
* Props for grouped dynamic items MultiSelect.
|
|
@@ -71,7 +72,7 @@ export interface GroupedSelectProps<TItems extends Map<string, unknown[]>> exten
|
|
|
71
72
|
/** Children must be a render function that returns OptGroup components */
|
|
72
73
|
children: (groupKey: string, items: TItems extends Map<string, Array<infer U>> ? U[] : never) => React.JSX.Element;
|
|
73
74
|
/** Options for filtering the items */
|
|
74
|
-
searchOptions?:
|
|
75
|
+
searchOptions?: Intl.CollatorOptions;
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
77
78
|
* Props for static MultiSelect API (all items are defined via React children).
|
|
@@ -92,7 +93,7 @@ export interface StaticItemsProps<TItem = Key> extends MultiSelectBaseProps {
|
|
|
92
93
|
/** Children must be Option components */
|
|
93
94
|
children: React.ReactNode;
|
|
94
95
|
/** Options for filtering the items */
|
|
95
|
-
searchOptions?:
|
|
96
|
+
searchOptions?: Intl.CollatorOptions;
|
|
96
97
|
}
|
|
97
98
|
/**
|
|
98
99
|
* Helper type to simplify usage for dynamic MultiSelect props.
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ListBoxSectionProps } from 'react-aria-components/ListBox';
|
|
2
3
|
/**
|
|
3
|
-
* Base props for both static and dynamic MultiSelectOptGroup variants
|
|
4
|
+
* Base props for both static and dynamic MultiSelectOptGroup variants.
|
|
4
5
|
*/
|
|
5
|
-
type BaseOptGroupProps =
|
|
6
|
+
type BaseOptGroupProps = {
|
|
6
7
|
/** The label text displayed at the top of the group */
|
|
7
8
|
label: string;
|
|
8
9
|
/** Whether to show a separator line after the group */
|
|
9
10
|
withSeparator?: boolean;
|
|
11
|
+
/** Additional class name for the group wrapper */
|
|
12
|
+
className?: string;
|
|
10
13
|
};
|
|
11
14
|
/**
|
|
12
|
-
* Props for the dynamic API of MultiSelectOptGroup
|
|
13
|
-
* @template T - The type of items in the group
|
|
15
|
+
* Props for the dynamic API of MultiSelectOptGroup.
|
|
16
|
+
* @template T - The type of items in the group.
|
|
14
17
|
*/
|
|
15
|
-
export interface DynamicMultiSelectOptGroup<T> extends BaseOptGroupProps {
|
|
18
|
+
export interface DynamicMultiSelectOptGroup<T> extends BaseOptGroupProps, Omit<ListBoxSectionProps<T>, 'children' | 'id' | 'items' | 'className'> {
|
|
16
19
|
/** Array of items to render as options within the group */
|
|
17
20
|
items: T[];
|
|
18
21
|
/** Render function that converts each item into a MultiSelectOption */
|
|
19
22
|
children: (item: T) => React.JSX.Element;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
|
-
* Props for the static API of MultiSelectOptGroup
|
|
25
|
+
* Props for the static API of MultiSelectOptGroup.
|
|
23
26
|
*/
|
|
24
27
|
export interface StaticMultiSelectOptGroup extends BaseOptGroupProps {
|
|
25
28
|
/** Not used in static API */
|
|
@@ -28,14 +31,18 @@ export interface StaticMultiSelectOptGroup extends BaseOptGroupProps {
|
|
|
28
31
|
children: ReactNode;
|
|
29
32
|
}
|
|
30
33
|
/**
|
|
31
|
-
* Combined props type for MultiSelectOptGroup
|
|
32
|
-
* @template T - The type of items when using dynamic API
|
|
34
|
+
* Combined props type for MultiSelectOptGroup.
|
|
35
|
+
* @template T - The type of items when using the dynamic API.
|
|
33
36
|
*/
|
|
34
37
|
export type MultiSelectOptGroupProps<T = unknown> = DynamicMultiSelectOptGroup<T> | StaticMultiSelectOptGroup;
|
|
35
38
|
/**
|
|
36
39
|
* Groups related options within a `MultiSelect` component.
|
|
37
40
|
*
|
|
38
|
-
* This component
|
|
41
|
+
* This component renders a React Aria `ListBoxSection`, so grouped options keep
|
|
42
|
+
* keyboard navigation, filtering, and selection behavior aligned with the parent
|
|
43
|
+
* multiselect.
|
|
44
|
+
*
|
|
45
|
+
* The component provides two APIs for grouping options:
|
|
39
46
|
* 1. Static API - Directly nest MultiSelectOption components
|
|
40
47
|
* 2. Dynamic API - Provide an array of items and a render function for dynamic items
|
|
41
48
|
* @example
|
|
@@ -53,14 +60,14 @@ export type MultiSelectOptGroupProps<T = unknown> = DynamicMultiSelectOptGroup<T
|
|
|
53
60
|
* withSeparator
|
|
54
61
|
* >
|
|
55
62
|
* {fruit => (
|
|
56
|
-
* <MultiSelectOption value={fruit.id}>
|
|
63
|
+
* <MultiSelectOption value={fruit.id} textValue={fruit.name}>
|
|
57
64
|
* {fruit.name}
|
|
58
65
|
* </MultiSelectOption>
|
|
59
66
|
* )}
|
|
60
67
|
* </MultiSelectOptGroup>
|
|
61
68
|
* ```
|
|
62
|
-
* @template T - The type of items when using the dynamic API
|
|
63
|
-
* @see {@link MultiSelectOption} for the child component API
|
|
69
|
+
* @template T - The type of items when using the dynamic API.
|
|
70
|
+
* @see {@link MultiSelectOption} for the child component API.
|
|
64
71
|
*/
|
|
65
72
|
declare function MultiSelectOptGroup<T>(props: MultiSelectOptGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
66
73
|
declare namespace MultiSelectOptGroup {
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { jsxs as o, Fragment as c, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
3
|
+
import { Collection as y } from "react-aria-components/Collection";
|
|
4
|
+
import { Header as d } from "react-aria-components/Header";
|
|
5
|
+
import { ListBoxSection as b } from "react-aria-components/ListBox";
|
|
6
|
+
import { Separator as f } from "react-aria-components/Separator";
|
|
7
|
+
const p = m({
|
|
7
8
|
slots: {
|
|
8
9
|
base: "uy:flex uy:flex-col uy:bg-surface-neutral",
|
|
9
10
|
label: "uy:px-150 uy:py-100 uy:typography-body-strong uy:text-content-neutral",
|
|
10
11
|
separator: "uy:my-100 uy:border-t uy:border-border-neutral uy:border-solid"
|
|
11
12
|
}
|
|
12
13
|
});
|
|
13
|
-
function
|
|
14
|
+
function h(e) {
|
|
14
15
|
return "items" in e && Array.isArray(e.items) && typeof e.children == "function";
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
function x(e) {
|
|
18
|
+
const { base: a, label: i, separator: l } = p(), { label: r, withSeparator: n, className: u, ...s } = e;
|
|
19
|
+
return /* @__PURE__ */ o(c, { children: [
|
|
20
|
+
/* @__PURE__ */ o(
|
|
21
|
+
b,
|
|
22
|
+
{
|
|
23
|
+
...s,
|
|
24
|
+
id: r,
|
|
25
|
+
className: a({ className: u }),
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ t(d, { className: i(), children: r }),
|
|
28
|
+
h(e) ? /* @__PURE__ */ t(y, { items: e.items, children: e.children }) : e.children
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
),
|
|
32
|
+
n && /* @__PURE__ */ t(
|
|
33
|
+
f,
|
|
34
|
+
{
|
|
35
|
+
orientation: "horizontal",
|
|
36
|
+
className: l(),
|
|
37
|
+
"aria-hidden": !0
|
|
38
|
+
}
|
|
39
|
+
)
|
|
29
40
|
] });
|
|
30
41
|
}
|
|
31
|
-
|
|
42
|
+
x.displayName = "MultiSelectOptGroup";
|
|
32
43
|
export {
|
|
33
|
-
|
|
44
|
+
x as MultiSelectOptGroup
|
|
34
45
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ListBoxItemProps } from 'react-aria-components/ListBox';
|
|
2
3
|
/**
|
|
3
4
|
* Props for the MultiSelectOption component.
|
|
4
|
-
* @template T - The type of the value this option represents (string or number)
|
|
5
|
+
* @template T - The type of the value this option represents (string or number).
|
|
5
6
|
*/
|
|
6
|
-
export interface MultiSelectOptionProps<T> {
|
|
7
|
+
export interface MultiSelectOptionProps<T> extends Omit<ListBoxItemProps, 'children' | 'id' | 'value'> {
|
|
7
8
|
/** The value associated with this option. Must be unique within the MultiSelect */
|
|
8
9
|
value: T;
|
|
9
10
|
/** The content to display for this option */
|
|
@@ -14,6 +15,8 @@ export interface MultiSelectOptionProps<T> {
|
|
|
14
15
|
autoFocus?: boolean;
|
|
15
16
|
/** Additional text displayed below the option to provide more context */
|
|
16
17
|
helperText?: string;
|
|
18
|
+
/** Text used by search and typeahead when the visual content is complex */
|
|
19
|
+
textValue?: string;
|
|
17
20
|
}
|
|
18
21
|
export declare const MultiSelectOption: <T>(props: MultiSelectOptionProps<T> & {
|
|
19
22
|
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { CheckboxIndicator as
|
|
7
|
-
|
|
8
|
-
const O = g({
|
|
1
|
+
import { jsx as r, jsxs as a, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { uyTv as x } from "@payfit/unity-themes";
|
|
4
|
+
import { ListBoxItem as v } from "react-aria-components/ListBox";
|
|
5
|
+
import h from "../../../hooks/use-id.js";
|
|
6
|
+
import { CheckboxIndicator as g } from "../../checkbox/parts/CheckboxIndicator.js";
|
|
7
|
+
const w = x({
|
|
9
8
|
slots: {
|
|
10
9
|
base: [
|
|
11
10
|
"uy:flex uy:flex-col uy:transition",
|
|
12
11
|
"uy:w-full uy:px-150 uy:py-100",
|
|
13
12
|
"uy:rounded-50 uy:cursor-pointer",
|
|
14
|
-
"uy:
|
|
15
|
-
"uy:
|
|
16
|
-
"uy:
|
|
17
|
-
"uy:data-[
|
|
13
|
+
"uy:outline-none",
|
|
14
|
+
"uy:data-[hovered=true]:bg-surface-neutral-hover",
|
|
15
|
+
"uy:data-[pressed=true]:bg-surface-neutral-pressed",
|
|
16
|
+
"uy:data-[focus-visible=true]:outline uy:data-[focus-visible=true]:outline-2 uy:data-[focus-visible=true]:outline-solid uy:data-[focus-visible=true]:outline-utility-focus-ring uy:data-[focus-visible=true]:-outline-offset-2"
|
|
18
17
|
],
|
|
19
18
|
label: "uy:inline-flex uy:items-center uy:gap-100 uy:text-content-neutral uy:typography-body",
|
|
20
|
-
helperText: "uy:inline-block uy:typography-body uy:text-content-neutral-low uy:pl-
|
|
19
|
+
helperText: "uy:inline-block uy:typography-body uy:text-content-neutral-low uy:pl-3.5"
|
|
21
20
|
},
|
|
22
21
|
variants: {
|
|
23
22
|
isDisabled: {
|
|
24
23
|
true: {
|
|
25
24
|
base: "uy:cursor-not-allowed!",
|
|
26
|
-
label: "uy:text-content-neutral-disabled"
|
|
25
|
+
label: "uy:text-content-neutral-disabled",
|
|
26
|
+
helperText: "uy:text-content-neutral-disabled"
|
|
27
27
|
},
|
|
28
28
|
false: {
|
|
29
29
|
base: ""
|
|
@@ -31,57 +31,49 @@ const O = g({
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return /* @__PURE__ */ e(
|
|
38
|
-
S,
|
|
39
|
-
{
|
|
40
|
-
render: (t) => /* @__PURE__ */ e(
|
|
41
|
-
k,
|
|
42
|
-
{
|
|
43
|
-
isSelected: "children" in t && !!t.children,
|
|
44
|
-
isDisabled: i,
|
|
45
|
-
"data-dd-privacy": "hidden"
|
|
46
|
-
}
|
|
47
|
-
)
|
|
48
|
-
}
|
|
49
|
-
);
|
|
34
|
+
function N(t, e) {
|
|
35
|
+
if (e !== void 0) return e;
|
|
36
|
+
if (typeof t == "string") return t;
|
|
50
37
|
}
|
|
51
|
-
function
|
|
52
|
-
value:
|
|
53
|
-
children:
|
|
38
|
+
function l({
|
|
39
|
+
value: t,
|
|
40
|
+
children: e,
|
|
54
41
|
isDisabled: u,
|
|
55
|
-
helperText:
|
|
56
|
-
|
|
57
|
-
...
|
|
58
|
-
},
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
|
|
42
|
+
helperText: o,
|
|
43
|
+
textValue: n,
|
|
44
|
+
...s
|
|
45
|
+
}, d) {
|
|
46
|
+
const i = h(), { base: y, label: c, helperText: p } = w({ isDisabled: u });
|
|
47
|
+
return /* @__PURE__ */ r(
|
|
48
|
+
v,
|
|
62
49
|
{
|
|
63
50
|
"data-dd-privacy": "mask",
|
|
64
|
-
...
|
|
65
|
-
ref:
|
|
66
|
-
id:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
disabled: u,
|
|
51
|
+
...s,
|
|
52
|
+
ref: d,
|
|
53
|
+
id: t,
|
|
54
|
+
isDisabled: u,
|
|
55
|
+
textValue: N(e, n),
|
|
70
56
|
className: y(),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
57
|
+
"aria-describedby": o ? `${i}-helper-text` : void 0,
|
|
58
|
+
children: ({ isSelected: f }) => /* @__PURE__ */ a(b, { children: [
|
|
59
|
+
/* @__PURE__ */ a("div", { className: c(), children: [
|
|
60
|
+
/* @__PURE__ */ r(
|
|
61
|
+
g,
|
|
62
|
+
{
|
|
63
|
+
isSelected: f,
|
|
64
|
+
isDisabled: u,
|
|
65
|
+
"data-dd-privacy": "hidden"
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
e
|
|
69
|
+
] }),
|
|
70
|
+
o && /* @__PURE__ */ r("span", { id: `${i}-helper-text`, className: p(), children: o })
|
|
71
|
+
] })
|
|
72
|
+
}
|
|
81
73
|
);
|
|
82
74
|
}
|
|
83
|
-
|
|
84
|
-
const
|
|
75
|
+
l.displayName = "MultiSelectOption";
|
|
76
|
+
const S = m(l);
|
|
85
77
|
export {
|
|
86
|
-
|
|
78
|
+
S as MultiSelectOption
|
|
87
79
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Key } from '@react-types/shared';
|
|
2
|
+
export type MultiSelectKey = string | number;
|
|
3
|
+
export declare function setToReactAriaValue(value: Set<MultiSelectKey> | undefined): readonly Key[] | undefined;
|
|
4
|
+
export declare function setToReactAriaDefaultValue(value: Set<MultiSelectKey> | undefined): readonly Key[] | undefined;
|
|
5
|
+
export declare function reactAriaValueToSet(value: readonly Key[]): Set<MultiSelectKey>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function e(r) {
|
|
2
|
+
if (r !== void 0)
|
|
3
|
+
return Array.from(r);
|
|
4
|
+
}
|
|
5
|
+
function n(r) {
|
|
6
|
+
if (r !== void 0)
|
|
7
|
+
return Array.from(r);
|
|
8
|
+
}
|
|
9
|
+
function o(r) {
|
|
10
|
+
return new Set(
|
|
11
|
+
r.filter((t) => typeof t == "string" || typeof t == "number")
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
o as reactAriaValueToSet,
|
|
16
|
+
n as setToReactAriaDefaultValue,
|
|
17
|
+
e as setToReactAriaValue
|
|
18
|
+
};
|
|
@@ -8,15 +8,16 @@ import { Input as te } from "react-aria-components/Input";
|
|
|
8
8
|
import { ListBox as ae } from "react-aria-components/ListBox";
|
|
9
9
|
import { Popover as oe } from "react-aria-components/Popover";
|
|
10
10
|
import { Select as ue } from "react-aria-components/Select";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import be from "./
|
|
19
|
-
|
|
11
|
+
import { Separator as de } from "react-aria-components/Separator";
|
|
12
|
+
import { Virtualizer as ie, ListLayout as ne } from "react-aria-components/Virtualizer";
|
|
13
|
+
import { defaultCountries as m, usePhoneInput as le, FlagImage as se, parseCountry as ye } from "react-international-phone";
|
|
14
|
+
import { useIntl as ce } from "react-intl";
|
|
15
|
+
import { CircularIconButton as me } from "../icon-button/CircularIconButton.js";
|
|
16
|
+
import { Icon as f } from "../icon/Icon.js";
|
|
17
|
+
import { Search as fe } from "../search/Search.js";
|
|
18
|
+
import { PhoneNumberItem as be } from "./parts/PhoneNumberItem.js";
|
|
19
|
+
import pe from "./unknownFlag.svg.js";
|
|
20
|
+
const ge = Y({
|
|
20
21
|
slots: {
|
|
21
22
|
base: [
|
|
22
23
|
"uy:group",
|
|
@@ -98,11 +99,11 @@ const pe = Y({
|
|
|
98
99
|
"uy:overflow-y-auto uy:overflow-x-hidden uy:max-h-[296px]"
|
|
99
100
|
]
|
|
100
101
|
}
|
|
101
|
-
}),
|
|
102
|
+
}), he = J(
|
|
102
103
|
(b, p) => {
|
|
103
|
-
const
|
|
104
|
+
const i = ce(), {
|
|
104
105
|
onChange: g,
|
|
105
|
-
value:
|
|
106
|
+
value: n,
|
|
106
107
|
defaultCountry: h = "unknown",
|
|
107
108
|
onClearButtonPress: v,
|
|
108
109
|
isInvalid: o = !1,
|
|
@@ -111,8 +112,8 @@ const pe = Y({
|
|
|
111
112
|
"aria-label": s,
|
|
112
113
|
defaultMask: w,
|
|
113
114
|
charAfterDialCode: C,
|
|
114
|
-
historySaveDebounceMS:
|
|
115
|
-
disableCountryGuess:
|
|
115
|
+
historySaveDebounceMS: N,
|
|
116
|
+
disableCountryGuess: I,
|
|
116
117
|
forceDialCode: P,
|
|
117
118
|
disableDialCodeAndPrefix: k,
|
|
118
119
|
disableFormatting: S,
|
|
@@ -120,23 +121,23 @@ const pe = Y({
|
|
|
120
121
|
...B
|
|
121
122
|
} = b, [D, L] = K(!1), { contains: O } = Z({ sensitivity: "base" }), d = Q(null);
|
|
122
123
|
X(p, () => d.current, [d]);
|
|
123
|
-
const R = [["", "unknown", "", ""], ...
|
|
124
|
+
const R = [["", "unknown", "", ""], ...m], {
|
|
124
125
|
inputRef: y,
|
|
125
126
|
inputValue: c,
|
|
126
127
|
handlePhoneValueChange: j,
|
|
127
128
|
country: t,
|
|
128
129
|
setCountry: A,
|
|
129
130
|
phone: F
|
|
130
|
-
} =
|
|
131
|
+
} = le({
|
|
131
132
|
prefix: x,
|
|
132
133
|
defaultCountry: h,
|
|
133
|
-
value:
|
|
134
|
+
value: n,
|
|
134
135
|
countries: R,
|
|
135
136
|
disableDialCodePrefill: !0,
|
|
136
137
|
defaultMask: w,
|
|
137
138
|
charAfterDialCode: C,
|
|
138
|
-
historySaveDebounceMS:
|
|
139
|
-
disableCountryGuess:
|
|
139
|
+
historySaveDebounceMS: N,
|
|
140
|
+
disableCountryGuess: I,
|
|
140
141
|
forceDialCode: P,
|
|
141
142
|
disableDialCodeAndPrefix: k,
|
|
142
143
|
disableFormatting: S,
|
|
@@ -153,12 +154,12 @@ const pe = Y({
|
|
|
153
154
|
selectIcon: U,
|
|
154
155
|
selectButton: E,
|
|
155
156
|
state: H
|
|
156
|
-
} =
|
|
157
|
+
} = ge(), q = c.replace(F, "").trim() !== "" && !u;
|
|
157
158
|
return /* @__PURE__ */ e("div", { ref: d, children: /* @__PURE__ */ a(
|
|
158
159
|
re,
|
|
159
160
|
{
|
|
160
161
|
className: W(),
|
|
161
|
-
"aria-label": `${s}${
|
|
162
|
+
"aria-label": `${s}${n ? `, ${n}` : ""}`,
|
|
162
163
|
"aria-invalid": o,
|
|
163
164
|
"data-invalid": o,
|
|
164
165
|
"data-disabled": u,
|
|
@@ -185,7 +186,7 @@ const pe = Y({
|
|
|
185
186
|
{
|
|
186
187
|
"data-dd-privacy": "mask",
|
|
187
188
|
className: E(),
|
|
188
|
-
"aria-label":
|
|
189
|
+
"aria-label": i.formatMessage(
|
|
189
190
|
{
|
|
190
191
|
id: "unity:component:phone-number:country-selector:label",
|
|
191
192
|
defaultMessage: "Select country code, {country} {dialCode}"
|
|
@@ -197,7 +198,7 @@ const pe = Y({
|
|
|
197
198
|
),
|
|
198
199
|
children: [
|
|
199
200
|
t.iso2 !== "unknown" ? /* @__PURE__ */ e(
|
|
200
|
-
|
|
201
|
+
se,
|
|
201
202
|
{
|
|
202
203
|
iso2: t.iso2,
|
|
203
204
|
alt: t.name,
|
|
@@ -209,7 +210,7 @@ const pe = Y({
|
|
|
209
210
|
"img",
|
|
210
211
|
{
|
|
211
212
|
"aria-hidden": "true",
|
|
212
|
-
src:
|
|
213
|
+
src: pe,
|
|
213
214
|
alt: "",
|
|
214
215
|
"data-dd-privacy": "mask",
|
|
215
216
|
className: "react-international-phone-flag-emoji",
|
|
@@ -218,7 +219,7 @@ const pe = Y({
|
|
|
218
219
|
}
|
|
219
220
|
),
|
|
220
221
|
/* @__PURE__ */ e(
|
|
221
|
-
|
|
222
|
+
f,
|
|
222
223
|
{
|
|
223
224
|
className: U(),
|
|
224
225
|
"aria-hidden": "true",
|
|
@@ -239,9 +240,10 @@ const pe = Y({
|
|
|
239
240
|
containerPadding: 8,
|
|
240
241
|
className: G(),
|
|
241
242
|
children: /* @__PURE__ */ a(_, { filter: O, children: [
|
|
242
|
-
/* @__PURE__ */ e(
|
|
243
|
+
/* @__PURE__ */ e("div", { className: "uy:m-100", children: /* @__PURE__ */ e(fe, { label: M, "data-dd-privacy": "mask" }) }),
|
|
244
|
+
/* @__PURE__ */ e(de, { className: "uy:mx-100 uy:border-t uy:border-border-neutral uy:border-solid" }),
|
|
243
245
|
/* @__PURE__ */ e(
|
|
244
|
-
|
|
246
|
+
ie,
|
|
245
247
|
{
|
|
246
248
|
layout: ne,
|
|
247
249
|
layoutOptions: {
|
|
@@ -251,11 +253,11 @@ const pe = Y({
|
|
|
251
253
|
ae,
|
|
252
254
|
{
|
|
253
255
|
className: T(),
|
|
254
|
-
items:
|
|
256
|
+
items: m,
|
|
255
257
|
children: (r) => {
|
|
256
|
-
const l =
|
|
258
|
+
const l = ye(r);
|
|
257
259
|
return /* @__PURE__ */ e(
|
|
258
|
-
|
|
260
|
+
be,
|
|
259
261
|
{
|
|
260
262
|
country: l,
|
|
261
263
|
id: l.iso2
|
|
@@ -291,21 +293,21 @@ const pe = Y({
|
|
|
291
293
|
),
|
|
292
294
|
/* @__PURE__ */ a("div", { className: H(), children: [
|
|
293
295
|
o && /* @__PURE__ */ e(
|
|
294
|
-
|
|
296
|
+
f,
|
|
295
297
|
{
|
|
296
298
|
src: "WarningCircleOutlined",
|
|
297
299
|
color: "content.form.invalid",
|
|
298
300
|
role: "img",
|
|
299
|
-
"aria-label":
|
|
301
|
+
"aria-label": i.formatMessage({
|
|
300
302
|
id: "unity:component:form-field:form-input:error:alt",
|
|
301
303
|
defaultMessage: "Error"
|
|
302
304
|
})
|
|
303
305
|
}
|
|
304
306
|
),
|
|
305
307
|
q && /* @__PURE__ */ e(
|
|
306
|
-
|
|
308
|
+
me,
|
|
307
309
|
{
|
|
308
|
-
title:
|
|
310
|
+
title: i.formatMessage({
|
|
309
311
|
id: "unity:component:common:clear:title",
|
|
310
312
|
defaultMessage: "Clear"
|
|
311
313
|
}),
|
|
@@ -323,7 +325,7 @@ const pe = Y({
|
|
|
323
325
|
) });
|
|
324
326
|
}
|
|
325
327
|
);
|
|
326
|
-
|
|
328
|
+
he.displayName = "PhoneNumberInput";
|
|
327
329
|
export {
|
|
328
|
-
|
|
330
|
+
he as PhoneNumberInput
|
|
329
331
|
};
|