@payfit/unity-components 1.1.0 → 1.2.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/adapters/standardSchemaAdapter.d.ts +7 -0
- package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
- package/dist/esm/adapters/zodAdapter.d.ts +13 -0
- package/dist/esm/adapters/zodAdapter.js +74 -0
- package/dist/esm/components/action-bar/ActionBar.js +62 -64
- package/dist/esm/components/actionable/Actionable.d.ts +50 -3
- package/dist/esm/components/actionable/Actionable.js +49 -39
- package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
- package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
- package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
- package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
- package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
- package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
- package/dist/esm/components/code/Code.d.ts +37 -0
- package/dist/esm/components/code/Code.js +39 -0
- package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
- package/dist/esm/components/code/copyToClipboard.js +10 -0
- package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
- package/dist/esm/components/collapsible/Collapsible.js +14 -13
- package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
- package/dist/esm/components/data-table/DataTable.d.ts +76 -10
- package/dist/esm/components/data-table/DataTable.js +81 -78
- package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
- package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
- package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
- package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
- package/dist/esm/components/date-picker/DatePicker.js +64 -64
- package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
- package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
- package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
- package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
- package/dist/esm/components/error-state/ErrorState.js +153 -0
- package/dist/esm/components/error-state/initConfig.d.ts +16 -0
- package/dist/esm/components/error-state/initConfig.js +149 -0
- package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
- package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
- package/dist/esm/components/form/Form.d.ts +15 -9
- package/dist/esm/components/form/Form.js +53 -50
- package/dist/esm/components/form-field/FormField.js +24 -23
- package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
- package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
- package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
- package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
- package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
- package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
- package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
- package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
- package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
- package/dist/esm/components/input/Input.js +28 -28
- package/dist/esm/components/label/Label.js +19 -19
- package/dist/esm/components/multi-select/MultiSelect.js +94 -94
- package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
- package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
- package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
- package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
- package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
- package/dist/esm/components/nav/parts/NavGroup.js +21 -21
- package/dist/esm/components/number-field/NumberField.d.ts +3 -3
- package/dist/esm/components/number-input/NumberInput.js +58 -58
- package/dist/esm/components/pagination/Pagination.js +97 -101
- package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
- package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
- package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
- package/dist/esm/components/select-field/SelectField.d.ts +2 -2
- package/dist/esm/components/select-field/SelectField.js +4 -1
- package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
- package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
- package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
- package/dist/esm/components/skip-links/SkipLinks.js +50 -43
- package/dist/esm/components/table/Table.js +79 -76
- package/dist/esm/components/table/parts/TableBody.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +25 -25
- package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
- package/dist/esm/components/table/parts/TablePagination.js +61 -59
- package/dist/esm/components/table/parts/TableRow.js +16 -16
- package/dist/esm/components/tabs/parts/TabList.js +50 -54
- package/dist/esm/components/task-menu/parts/Content.js +24 -24
- package/dist/esm/components/task-menu/parts/Header.js +24 -24
- package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
- package/dist/esm/components/task-menu/parts/Task.js +69 -69
- package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
- package/dist/esm/components/text-area/TextArea.js +30 -31
- package/dist/esm/components/text-field/TextField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
- package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
- package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
- package/dist/esm/hooks/use-form.d.ts +5 -5
- package/dist/esm/hooks/use-form.types.d.ts +2 -2
- package/dist/esm/hooks/use-resizable.js +13 -14
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +22 -19
- package/dist/esm/types/schema.d.ts +8 -0
- package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
- package/dist/esm/utils/createSchemaAdapter.js +13 -0
- package/dist/esm/utils/platform.js +2 -3
- package/i18n/en-GB.json +16 -0
- package/i18n/es-ES.json +16 -0
- package/i18n/fr-FR.json +16 -0
- package/package.json +25 -19
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useBreakpointListener as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as e, Fragment as l, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u } from "react";
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
+
import { useBreakpointListener as y } from "../../../hooks/use-breakpoint-listener.js";
|
|
5
|
+
const d = m({
|
|
6
6
|
base: "uy:flex uy:flex-col uy:gap-200 uy:md:flex-row uy:md:justify-between"
|
|
7
|
-
}),
|
|
8
|
-
({ renderNext:
|
|
9
|
-
const
|
|
10
|
-
return /* @__PURE__ */
|
|
7
|
+
}), f = u(
|
|
8
|
+
({ renderNext: a, renderPrevious: n, renderOptionalActions: o, ...t }, r) => {
|
|
9
|
+
const s = y(), i = s === "xs" || s === "sm";
|
|
10
|
+
return /* @__PURE__ */ e(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
ref:
|
|
13
|
+
ref: r,
|
|
14
14
|
"data-dd-privacy": "allow",
|
|
15
|
-
...
|
|
16
|
-
className:
|
|
15
|
+
...t,
|
|
16
|
+
className: d(),
|
|
17
17
|
role: "group",
|
|
18
18
|
"data-unity-component": "FunnelPageActions",
|
|
19
19
|
children: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
i && /* @__PURE__ */ e(l, { children: [
|
|
21
|
+
a(),
|
|
22
|
+
n?.(),
|
|
23
|
+
o?.()
|
|
24
24
|
] }),
|
|
25
|
-
!
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
!i && /* @__PURE__ */ e(l, { children: [
|
|
26
|
+
/* @__PURE__ */ c("div", { className: "uy:flex uy:gap-100", children: o?.() }),
|
|
27
|
+
/* @__PURE__ */ e("div", { className: "uy:flex uy:gap-100", children: [
|
|
28
|
+
n?.(),
|
|
29
|
+
a()
|
|
30
30
|
] })
|
|
31
31
|
] })
|
|
32
32
|
]
|
|
@@ -34,8 +34,8 @@ const b = p({
|
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
f.displayName = "FunnelPageActions";
|
|
38
38
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
f as FunnelPageActions,
|
|
40
|
+
d as funnelPageActions
|
|
41
41
|
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as n } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useFunnelLayoutContext as
|
|
5
|
-
const
|
|
3
|
+
import { uyTv as m } from "@payfit/unity-themes";
|
|
4
|
+
import { useFunnelLayoutContext as u } from "../FunnelLayout.context.js";
|
|
5
|
+
const d = m({
|
|
6
6
|
base: "uy:px-300 uy:md:px-600"
|
|
7
7
|
}), s = n(
|
|
8
8
|
({ children: o, ...e }, t) => {
|
|
9
|
-
const { ids: r } =
|
|
9
|
+
const { ids: r } = u();
|
|
10
10
|
return /* @__PURE__ */ a(
|
|
11
11
|
"footer",
|
|
12
12
|
{
|
|
13
13
|
ref: t,
|
|
14
14
|
"data-dd-privacy": "allow",
|
|
15
15
|
...e,
|
|
16
|
-
className:
|
|
16
|
+
className: d(),
|
|
17
17
|
"data-unity-component": "FunnelPageFooter",
|
|
18
18
|
id: r.footerId,
|
|
19
|
-
tabIndex: -1,
|
|
20
19
|
children: o
|
|
21
20
|
}
|
|
22
21
|
);
|
|
@@ -25,5 +24,5 @@ const u = d({
|
|
|
25
24
|
s.displayName = "FunnelPageFooter";
|
|
26
25
|
export {
|
|
27
26
|
s as FunnelPageFooter,
|
|
28
|
-
|
|
27
|
+
d as funnelPageFooter
|
|
29
28
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
3
|
export declare const funnelPageHeader: import('tailwind-variants').TVReturnType<{
|
|
4
4
|
gradient: {
|
|
5
5
|
default: {
|
|
@@ -36,7 +36,7 @@ export declare const funnelPageHeader: import('tailwind-variants').TVReturnType<
|
|
|
36
36
|
}, undefined, unknown, unknown, undefined>>;
|
|
37
37
|
export interface FunnelPageHeaderProps extends PropsWithChildren<VariantProps<typeof funnelPageHeader>> {
|
|
38
38
|
title: string;
|
|
39
|
-
subtitle:
|
|
39
|
+
subtitle: ReactNode;
|
|
40
40
|
style?: VariantProps<typeof funnelPageHeader>['gradient'];
|
|
41
41
|
imageSlot?: React.ReactNode;
|
|
42
42
|
imageSlotAltText?: string;
|
|
@@ -5,7 +5,7 @@ export declare const funnelSidebar: import('tailwind-variants').TVReturnType<{
|
|
|
5
5
|
true: string;
|
|
6
6
|
false: string;
|
|
7
7
|
};
|
|
8
|
-
}, undefined, "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:
|
|
8
|
+
}, undefined, "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:basis-1/3 uy:lg:basis-1/4 uy:md:shrink-0", {
|
|
9
9
|
isSticky: {
|
|
10
10
|
true: string;
|
|
11
11
|
false: string;
|
|
@@ -15,7 +15,7 @@ export declare const funnelSidebar: import('tailwind-variants').TVReturnType<{
|
|
|
15
15
|
true: string;
|
|
16
16
|
false: string;
|
|
17
17
|
};
|
|
18
|
-
}, undefined, "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:
|
|
18
|
+
}, undefined, "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:basis-1/3 uy:lg:basis-1/4 uy:md:shrink-0", unknown, unknown, undefined>>;
|
|
19
19
|
export interface FunnelSidebarProps extends PropsWithChildren<VariantProps<typeof funnelSidebar>> {
|
|
20
20
|
'aria-label'?: string;
|
|
21
21
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as l } from "react";
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useIntl as
|
|
3
|
+
import { uyTv as o } from "@payfit/unity-themes";
|
|
4
|
+
import { useIntl as d } from "react-intl";
|
|
5
5
|
import { useFunnelLayoutContext as y } from "../FunnelLayout.context.js";
|
|
6
|
-
const m =
|
|
7
|
-
base: "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:
|
|
6
|
+
const m = o({
|
|
7
|
+
base: "uy:w-full uy:self-start uy:shrink uy:grow-0 uy:md:basis-1/3 uy:lg:basis-1/4 uy:md:shrink-0",
|
|
8
8
|
variants: {
|
|
9
9
|
isSticky: {
|
|
10
|
-
true: "uy:sticky uy:top-
|
|
10
|
+
true: "uy:sticky uy:top-8 uy:md:top-10 uy:z-9",
|
|
11
11
|
false: "uy:static"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -15,20 +15,19 @@ const m = d({
|
|
|
15
15
|
isSticky: !0
|
|
16
16
|
}
|
|
17
17
|
}), f = l(
|
|
18
|
-
({ children: e, isSticky:
|
|
19
|
-
const { ids: a } = y(), u =
|
|
18
|
+
({ children: e, isSticky: s, "aria-label": t, ...i }, r) => {
|
|
19
|
+
const { ids: a } = y(), u = d();
|
|
20
20
|
return /* @__PURE__ */ n(
|
|
21
21
|
"aside",
|
|
22
22
|
{
|
|
23
23
|
ref: r,
|
|
24
|
-
"aria-label":
|
|
24
|
+
"aria-label": t ?? u.formatMessage({
|
|
25
25
|
id: "unity:layout:funnel:sidebar:aria-label",
|
|
26
26
|
defaultMessage: "Process steps"
|
|
27
27
|
}),
|
|
28
28
|
"aria-describedby": a.funnelTitleId,
|
|
29
|
-
className: m({ isSticky:
|
|
29
|
+
className: m({ isSticky: s }),
|
|
30
30
|
id: a.asideId,
|
|
31
|
-
tabIndex: -1,
|
|
32
31
|
"data-unity-component": "FunnelSidebar",
|
|
33
32
|
"data-dd-privacy": "allow",
|
|
34
33
|
...i,
|
|
@@ -5,15 +5,15 @@ import { Input as I } from "react-aria-components";
|
|
|
5
5
|
import { useIntl as N } from "react-intl";
|
|
6
6
|
import { CircularIconButton as W } from "../icon-button/CircularIconButton.js";
|
|
7
7
|
import { Icon as M } from "../icon/Icon.js";
|
|
8
|
-
import { Spinner as
|
|
9
|
-
const
|
|
8
|
+
import { Spinner as C } from "../spinner/Spinner.js";
|
|
9
|
+
const O = h({
|
|
10
10
|
slots: {
|
|
11
|
-
base: "uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-
|
|
12
|
-
prefix: "uy:flex-grow-0 uy:text-content-neutral-low uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-r uy:border-solid uy:rounded-l-
|
|
13
|
-
inputWrapper: "uy:flex uy:gap-50 uy:flex-grow uy:flex-nowrap uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-
|
|
11
|
+
base: "uy:flex uy:h-500 uy:border uy:border-solid uy:rounded-75 uy:focus-within:outline-none uy:focus-within:ring-2 uy:focus-within:ring-utility-focus-ring uy:focus-within:ring-offset-2 uy:active:border-border-form-active",
|
|
12
|
+
prefix: "uy:flex-grow-0 uy:text-content-neutral-low uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-r uy:border-solid uy:rounded-l-75 uy:active:border-border-form-active",
|
|
13
|
+
inputWrapper: "uy:flex uy:gap-50 uy:flex-grow uy:flex-nowrap uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:rounded-75 uy:max-w-full uy:justify-between",
|
|
14
14
|
input: "uy:w-full uy:flex-1 uy:outline-none uy:typography-body uy:placeholder:text-content-neutral-lowest uy:min-w-0 uy:max-w-full",
|
|
15
15
|
state: "uy:flex uy:gap-50 uy:items-center uy:shrink-0",
|
|
16
|
-
suffix: "uy:flex-grow-0 uy:text-content-neutral-low uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-
|
|
16
|
+
suffix: "uy:flex-grow-0 uy:text-content-neutral-low uy:content-center uy:pt-100 uy:pb-100 uy:pl-150 uy:pr-150 uy:border-l uy:border-solid uy:rounded-r-75 uy:active:border-border-form-active"
|
|
17
17
|
},
|
|
18
18
|
variants: {
|
|
19
19
|
isInvalid: {
|
|
@@ -60,38 +60,38 @@ const S = h({
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
]
|
|
63
|
-
}),
|
|
63
|
+
}), S = v(
|
|
64
64
|
({
|
|
65
65
|
type: s = "text",
|
|
66
|
-
prefix:
|
|
67
|
-
suffix:
|
|
68
|
-
isInvalid:
|
|
66
|
+
prefix: d,
|
|
67
|
+
suffix: l,
|
|
68
|
+
isInvalid: i,
|
|
69
69
|
isLoading: r,
|
|
70
70
|
isDisabled: o,
|
|
71
71
|
isReadOnly: u,
|
|
72
|
-
onClearButtonPress:
|
|
73
|
-
...
|
|
72
|
+
onClearButtonPress: f,
|
|
73
|
+
...t
|
|
74
74
|
}, y) => {
|
|
75
|
-
const
|
|
75
|
+
const a = N(), {
|
|
76
76
|
base: b,
|
|
77
77
|
prefix: m,
|
|
78
78
|
inputWrapper: c,
|
|
79
79
|
input: p,
|
|
80
80
|
state: x,
|
|
81
81
|
suffix: g
|
|
82
|
-
} =
|
|
83
|
-
isInvalid: !!
|
|
82
|
+
} = O({
|
|
83
|
+
isInvalid: !!i,
|
|
84
84
|
isReadOnly: !!u,
|
|
85
85
|
isDisabled: !!o
|
|
86
|
-
}), w =
|
|
87
|
-
return delete
|
|
88
|
-
|
|
86
|
+
}), w = t.value && !r && !u && !o;
|
|
87
|
+
return delete t.isRequired, /* @__PURE__ */ n("div", { className: b(), children: [
|
|
88
|
+
d ? /* @__PURE__ */ e("span", { className: m(), children: d }) : null,
|
|
89
89
|
/* @__PURE__ */ n("div", { className: c(), children: [
|
|
90
90
|
/* @__PURE__ */ e(
|
|
91
91
|
I,
|
|
92
92
|
{
|
|
93
93
|
"data-dd-privacy": "mask",
|
|
94
|
-
...
|
|
94
|
+
...t,
|
|
95
95
|
ref: y,
|
|
96
96
|
type: s,
|
|
97
97
|
className: p(),
|
|
@@ -102,22 +102,22 @@ const S = h({
|
|
|
102
102
|
),
|
|
103
103
|
/* @__PURE__ */ n("div", { className: x(), children: [
|
|
104
104
|
r && /* @__PURE__ */ e(
|
|
105
|
-
|
|
105
|
+
C,
|
|
106
106
|
{
|
|
107
107
|
color: "inherit",
|
|
108
108
|
size: "small",
|
|
109
|
-
label:
|
|
109
|
+
label: a.formatMessage({
|
|
110
110
|
id: "unity:component:common:loading:label",
|
|
111
111
|
defaultMessage: "Loading..."
|
|
112
112
|
})
|
|
113
113
|
}
|
|
114
114
|
),
|
|
115
|
-
|
|
115
|
+
i && /* @__PURE__ */ e(
|
|
116
116
|
M,
|
|
117
117
|
{
|
|
118
118
|
src: "WarningCircleOutlined",
|
|
119
119
|
color: "content.form.invalid",
|
|
120
|
-
alt:
|
|
120
|
+
alt: a.formatMessage({
|
|
121
121
|
id: "unity:component:form-field:form-input:error:alt",
|
|
122
122
|
defaultMessage: "Error"
|
|
123
123
|
})
|
|
@@ -126,24 +126,24 @@ const S = h({
|
|
|
126
126
|
w && /* @__PURE__ */ e(
|
|
127
127
|
W,
|
|
128
128
|
{
|
|
129
|
-
title:
|
|
129
|
+
title: a.formatMessage({
|
|
130
130
|
id: "unity:component:common:clear:title",
|
|
131
131
|
defaultMessage: "Clear"
|
|
132
132
|
}),
|
|
133
133
|
color: "content.neutral.low",
|
|
134
134
|
icon: "CloseOutlined",
|
|
135
135
|
onPress: () => {
|
|
136
|
-
|
|
136
|
+
f?.();
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
)
|
|
140
140
|
] })
|
|
141
141
|
] }),
|
|
142
|
-
|
|
142
|
+
l ? /* @__PURE__ */ e("span", { className: g(), children: l }) : null
|
|
143
143
|
] });
|
|
144
144
|
}
|
|
145
145
|
);
|
|
146
|
-
|
|
146
|
+
S.displayName = "Input";
|
|
147
147
|
export {
|
|
148
|
-
|
|
148
|
+
S as Input
|
|
149
149
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
3
|
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
4
|
import { mergeProps as f } from "react-aria";
|
|
5
|
-
import { useSlottedContext as g, InputContext as
|
|
6
|
-
import { useIntl as
|
|
7
|
-
const
|
|
5
|
+
import { useSlottedContext as g, InputContext as x, Label as N } from "react-aria-components";
|
|
6
|
+
import { useIntl as h } from "react-intl";
|
|
7
|
+
const q = b({
|
|
8
8
|
slots: {
|
|
9
9
|
base: "uy:typography-body-strong uy:text-content-form-enabled uy:flex uy:gap-25",
|
|
10
10
|
asterisk: "uy:text-content-danger",
|
|
@@ -23,33 +23,33 @@ const x = b({
|
|
|
23
23
|
defaultVariants: {
|
|
24
24
|
variant: "strong"
|
|
25
25
|
}
|
|
26
|
-
}), v =
|
|
27
|
-
({ children:
|
|
28
|
-
const
|
|
29
|
-
{ isRequired:
|
|
26
|
+
}), v = c(
|
|
27
|
+
({ children: n, ...a }, l) => {
|
|
28
|
+
const e = h(), i = g(x), p = f(
|
|
29
|
+
{ isRequired: i?.["aria-required"] },
|
|
30
30
|
a
|
|
31
31
|
), {
|
|
32
32
|
isRequired: t = !1,
|
|
33
33
|
requiredVariant: o = "required",
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
34
|
+
...d
|
|
35
|
+
} = p, { base: y, asterisk: m, optionalTag: u } = q();
|
|
36
|
+
return /* @__PURE__ */ s(
|
|
37
|
+
N,
|
|
38
38
|
{
|
|
39
39
|
"data-dd-privacy": "allow",
|
|
40
|
-
...
|
|
41
|
-
ref:
|
|
40
|
+
...d,
|
|
41
|
+
ref: l,
|
|
42
42
|
className: y({ className: a.className }),
|
|
43
43
|
children: [
|
|
44
|
-
|
|
45
|
-
o === "required" && t && /* @__PURE__ */
|
|
44
|
+
n,
|
|
45
|
+
o === "required" && t && /* @__PURE__ */ s("span", { className: m(), children: [
|
|
46
46
|
"*",
|
|
47
|
-
/* @__PURE__ */
|
|
47
|
+
/* @__PURE__ */ r("span", { className: "uy:sr-only", children: e.formatMessage({
|
|
48
48
|
id: "unity:component:label:required",
|
|
49
49
|
defaultMessage: "required"
|
|
50
50
|
}) })
|
|
51
51
|
] }),
|
|
52
|
-
o === "optional" && !t && /* @__PURE__ */
|
|
52
|
+
o === "optional" && !t && /* @__PURE__ */ r("span", { className: u({ className: a.className }), children: e.formatMessage({
|
|
53
53
|
id: "unity:component:label:optional",
|
|
54
54
|
defaultMessage: "(optional)"
|
|
55
55
|
}) })
|