@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,42 +1,42 @@
|
|
|
1
1
|
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as v, useRef as
|
|
2
|
+
import { useState as v, useRef as A, isValidElement as C, cloneElement as I } from "react";
|
|
3
3
|
import { uyMerge as g } from "@payfit/unity-themes";
|
|
4
|
-
import { FormattedMessage as h, useIntl as
|
|
4
|
+
import { FormattedMessage as h, useIntl as O } from "react-intl";
|
|
5
5
|
import { Actionable as x } from "../../actionable/Actionable.js";
|
|
6
|
-
import { Avatar as
|
|
7
|
-
import { AvatarFallback as
|
|
8
|
-
import { AvatarImage as
|
|
9
|
-
import { Badge as
|
|
6
|
+
import { Avatar as V } from "../../avatar/Avatar.js";
|
|
7
|
+
import { AvatarFallback as z } from "../../avatar/parts/AvatarFallback.js";
|
|
8
|
+
import { AvatarImage as F } from "../../avatar/parts/AvatarImage.js";
|
|
9
|
+
import { Badge as H } from "../../badge/Badge.js";
|
|
10
10
|
import { Icon as M } from "../../icon/Icon.js";
|
|
11
|
-
import { Menu as
|
|
12
|
-
import { MenuContent as
|
|
13
|
-
import { MenuHeader as
|
|
14
|
-
import { useAppMenuContext as
|
|
11
|
+
import { Menu as j } from "../../menu/Menu.js";
|
|
12
|
+
import { MenuContent as k } from "../../menu/parts/MenuContent.js";
|
|
13
|
+
import { MenuHeader as E } from "../../menu/parts/MenuHeader.js";
|
|
14
|
+
import { useAppMenuContext as S } from "./AppMenu.context.js";
|
|
15
15
|
const N = (t) => /* @__PURE__ */ l(
|
|
16
|
-
|
|
16
|
+
V,
|
|
17
17
|
{
|
|
18
18
|
"aria-label": `${t.title} avatar`,
|
|
19
19
|
size: "md",
|
|
20
20
|
variant: "square",
|
|
21
21
|
"aria-labelledby": "profile-button-label",
|
|
22
22
|
children: [
|
|
23
|
-
/* @__PURE__ */ e(
|
|
24
|
-
/* @__PURE__ */ e(
|
|
25
|
-
t.avatarPair &&
|
|
23
|
+
/* @__PURE__ */ e(F, { src: t.avatar, alt: t.title ?? "" }),
|
|
24
|
+
/* @__PURE__ */ e(z, { variant: "initials", delayMs: 100, children: t.title }),
|
|
25
|
+
t.avatarPair && C(t.avatarPair) && I(t.avatarPair, {
|
|
26
26
|
isHidden: !t.isPairAvatarVisible
|
|
27
27
|
})
|
|
28
28
|
]
|
|
29
29
|
}
|
|
30
|
-
),
|
|
30
|
+
), B = ({
|
|
31
31
|
avatar: t,
|
|
32
|
-
avatarPair:
|
|
32
|
+
avatarPair: a,
|
|
33
33
|
title: o,
|
|
34
|
-
uploadAvatarCallback:
|
|
35
|
-
uploadAvatarLabel:
|
|
36
|
-
uploadAvatarDescription:
|
|
34
|
+
uploadAvatarCallback: y,
|
|
35
|
+
uploadAvatarLabel: s,
|
|
36
|
+
uploadAvatarDescription: r
|
|
37
37
|
}) => {
|
|
38
|
-
const [n,
|
|
39
|
-
|
|
38
|
+
const [n, u] = v(!0), c = O(), i = () => {
|
|
39
|
+
a && u((f) => !f);
|
|
40
40
|
}, d = g(
|
|
41
41
|
"uy:group/avatar uy:cursor-pointer uy:relative uy:leading-[0] uy:rounded-75 uy:focus-visible:outline-none uy:focus-visible:ring-2 uy:focus-visible:ring-utility-focus-ring uy:focus-visible:ring-offset-2"
|
|
42
42
|
);
|
|
@@ -44,7 +44,7 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
44
44
|
x,
|
|
45
45
|
{
|
|
46
46
|
"aria-describedby": "profile-picture-change-desc",
|
|
47
|
-
"aria-label":
|
|
47
|
+
"aria-label": s || c.formatMessage({
|
|
48
48
|
id: "unity:component:app-menu:footer:profile-button:avatar:change",
|
|
49
49
|
defaultMessage: "Change profile picture"
|
|
50
50
|
}),
|
|
@@ -54,19 +54,19 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
54
54
|
onFocus: i,
|
|
55
55
|
onBlur: i,
|
|
56
56
|
onPress: () => {
|
|
57
|
-
|
|
57
|
+
y?.();
|
|
58
58
|
},
|
|
59
59
|
children: [
|
|
60
60
|
/* @__PURE__ */ e(
|
|
61
61
|
N,
|
|
62
62
|
{
|
|
63
63
|
avatar: t,
|
|
64
|
-
avatarPair:
|
|
64
|
+
avatarPair: a,
|
|
65
65
|
title: o,
|
|
66
66
|
isPairAvatarVisible: n
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
/* @__PURE__ */ l("div", { className: "uy:flex uy:pointer-events-none uy:opacity-0 uy:group-hover/avatar:opacity-
|
|
69
|
+
/* @__PURE__ */ l("div", { className: "uy:flex uy:pointer-events-none uy:opacity-0 uy:group-hover/avatar:opacity-90 uy:group-hover/avatar:pointer-events-auto uy:group-focus-visible/avatar:opacity-90 uy:group-focus-visible/avatar:pointer-events-auto uy:bg-utility-backdrop uy:rounded-75 uy:absolute uy:top-0 uy:left-0 uy:w-full uy:h-full uy:transition-all uy:duration-200 uy:items-center uy:justify-center", children: [
|
|
70
70
|
/* @__PURE__ */ e(
|
|
71
71
|
M,
|
|
72
72
|
{
|
|
@@ -76,7 +76,7 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
76
76
|
src: "CameraOutlined"
|
|
77
77
|
}
|
|
78
78
|
),
|
|
79
|
-
/* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children:
|
|
79
|
+
/* @__PURE__ */ e("span", { className: "uy:sr-only", id: "profile-picture-change-desc", children: r || /* @__PURE__ */ e(
|
|
80
80
|
h,
|
|
81
81
|
{
|
|
82
82
|
id: "unity:component:app-menu:footer:profile-button:avatar:change-description",
|
|
@@ -89,30 +89,30 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
89
89
|
);
|
|
90
90
|
}, b = ({
|
|
91
91
|
asMenuHeader: t = !1,
|
|
92
|
-
avatar:
|
|
92
|
+
avatar: a,
|
|
93
93
|
avatarPair: o,
|
|
94
|
-
badgeLabel:
|
|
95
|
-
description:
|
|
96
|
-
menuTriggerDescription:
|
|
94
|
+
badgeLabel: y,
|
|
95
|
+
description: s,
|
|
96
|
+
menuTriggerDescription: r,
|
|
97
97
|
title: n,
|
|
98
|
-
uploadAvatarCallback:
|
|
99
|
-
uploadAvatarLabel:
|
|
98
|
+
uploadAvatarCallback: u,
|
|
99
|
+
uploadAvatarLabel: c,
|
|
100
100
|
uploadAvatarDescription: i
|
|
101
101
|
}) => /* @__PURE__ */ l("div", { className: "uy:min-w-[240px] uy:w-full uy:flex uy:items-center", children: [
|
|
102
|
-
/* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children:
|
|
103
|
-
|
|
102
|
+
/* @__PURE__ */ e("div", { className: "uy:mr-150 uy:flex uy:items-center", children: u ? /* @__PURE__ */ e(
|
|
103
|
+
B,
|
|
104
104
|
{
|
|
105
|
-
avatar:
|
|
105
|
+
avatar: a,
|
|
106
106
|
avatarPair: o,
|
|
107
107
|
title: n,
|
|
108
|
-
uploadAvatarLabel:
|
|
108
|
+
uploadAvatarLabel: c,
|
|
109
109
|
uploadAvatarDescription: i,
|
|
110
|
-
uploadAvatarCallback:
|
|
110
|
+
uploadAvatarCallback: u
|
|
111
111
|
}
|
|
112
112
|
) : /* @__PURE__ */ e(
|
|
113
113
|
N,
|
|
114
114
|
{
|
|
115
|
-
avatar:
|
|
115
|
+
avatar: a,
|
|
116
116
|
avatarPair: o,
|
|
117
117
|
title: n,
|
|
118
118
|
isPairAvatarVisible: !0
|
|
@@ -133,10 +133,10 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
133
133
|
{
|
|
134
134
|
className: "uy:typography-body-small uy:text-content-neutral-low",
|
|
135
135
|
"data-dd-privacy": "allow",
|
|
136
|
-
children:
|
|
136
|
+
children: s
|
|
137
137
|
}
|
|
138
138
|
),
|
|
139
|
-
!t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children:
|
|
139
|
+
!t && /* @__PURE__ */ e("span", { id: "profile-button-description", className: "uy:sr-only", children: r || /* @__PURE__ */ e(
|
|
140
140
|
h,
|
|
141
141
|
{
|
|
142
142
|
id: "unity:component:app-menu:footer:profile-button:description",
|
|
@@ -144,7 +144,7 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
144
144
|
}
|
|
145
145
|
) })
|
|
146
146
|
] }),
|
|
147
|
-
/* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(
|
|
147
|
+
/* @__PURE__ */ e("div", { className: "uy:p-100", children: t ? /* @__PURE__ */ e(H, { className: "uy:capitalize", variant: "neutral", children: y }) : /* @__PURE__ */ e(
|
|
148
148
|
M,
|
|
149
149
|
{
|
|
150
150
|
src: "CaretUpDownOutlined",
|
|
@@ -155,18 +155,18 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
155
155
|
) })
|
|
156
156
|
] }), D = ({
|
|
157
157
|
avatar: t,
|
|
158
|
-
avatarPair:
|
|
158
|
+
avatarPair: a,
|
|
159
159
|
badgeLabel: o,
|
|
160
|
-
children:
|
|
161
|
-
computeSlot:
|
|
162
|
-
description:
|
|
160
|
+
children: y,
|
|
161
|
+
computeSlot: s,
|
|
162
|
+
description: r,
|
|
163
163
|
title: n,
|
|
164
|
-
menuTriggerDescription:
|
|
165
|
-
uploadAvatarCallback:
|
|
164
|
+
menuTriggerDescription: u,
|
|
165
|
+
uploadAvatarCallback: c,
|
|
166
166
|
uploadAvatarLabel: i,
|
|
167
167
|
uploadAvatarDescription: d
|
|
168
168
|
}) => {
|
|
169
|
-
const { isMobileMenuOpen: f } =
|
|
169
|
+
const { isMobileMenuOpen: f } = S(), [w, p] = v(!1), m = A(null), P = g(
|
|
170
170
|
"uy:fixed uy:bottom-0 uy:left-0 uy:right-0 uy:z-10 uy:bg-canvas",
|
|
171
171
|
"uy:p-150",
|
|
172
172
|
"uy:md:static uy:md:mt-auto uy:md:p-0 uy:md:bg-[transparent]",
|
|
@@ -179,50 +179,50 @@ const N = (t) => /* @__PURE__ */ l(
|
|
|
179
179
|
"data-mobile-open": f,
|
|
180
180
|
id: "app-menu-profile-button",
|
|
181
181
|
children: [
|
|
182
|
-
|
|
182
|
+
s,
|
|
183
183
|
/* @__PURE__ */ e(
|
|
184
184
|
x,
|
|
185
185
|
{
|
|
186
|
-
ref:
|
|
187
|
-
className: "uy:rounded-75 uy:px-150 uy:py-100 uy:w-full uy:not-aria-disabled:hover:bg-surface-neutral-hover uy:not-aria-disabled:active:bg-surface-neutral-active uy:not-aria-disabled:data-[pressed]:bg-surface-neutral-active uy:not-aria-disabled:focus-visible:outline-none uy:not-aria-disabled:focus-visible:ring-2 uy:not-aria-disabled:focus-visible:ring-utility-focus-ring uy:not-aria-disabled:focus-visible:ring-offset-2",
|
|
186
|
+
ref: m,
|
|
187
|
+
className: "uy:transition-colors uy:rounded-75 uy:px-150 uy:py-100 uy:w-full uy:not-aria-disabled:hover:bg-surface-neutral-hover uy:not-aria-disabled:active:bg-surface-neutral-active uy:not-aria-disabled:data-[pressed=true]:bg-surface-neutral-active uy:not-aria-disabled:focus-visible:outline-none uy:not-aria-disabled:focus-visible:ring-2 uy:not-aria-disabled:focus-visible:ring-utility-focus-ring uy:not-aria-disabled:focus-visible:ring-offset-2",
|
|
188
188
|
"aria-labelledby": "profile-button-label",
|
|
189
189
|
"aria-describedby": "profile-button-description",
|
|
190
190
|
onPress: () => {
|
|
191
|
-
|
|
191
|
+
p(!0);
|
|
192
192
|
},
|
|
193
193
|
children: /* @__PURE__ */ e(
|
|
194
194
|
b,
|
|
195
195
|
{
|
|
196
196
|
avatar: t,
|
|
197
|
-
avatarPair:
|
|
197
|
+
avatarPair: a,
|
|
198
198
|
badgeLabel: o,
|
|
199
|
-
description:
|
|
200
|
-
menuTriggerDescription:
|
|
199
|
+
description: r,
|
|
200
|
+
menuTriggerDescription: u,
|
|
201
201
|
title: n,
|
|
202
|
-
uploadAvatarCallback:
|
|
202
|
+
uploadAvatarCallback: c,
|
|
203
203
|
uploadAvatarLabel: i,
|
|
204
204
|
uploadAvatarDescription: d
|
|
205
205
|
}
|
|
206
206
|
)
|
|
207
207
|
}
|
|
208
208
|
),
|
|
209
|
-
/* @__PURE__ */ e(
|
|
210
|
-
/* @__PURE__ */ e(
|
|
209
|
+
/* @__PURE__ */ e(j, { isOpen: w, onOpenChange: p, children: /* @__PURE__ */ l(k, { width: 312, placement: "top left", triggerRef: m, children: [
|
|
210
|
+
/* @__PURE__ */ e(E, { className: "uy:rounded-75", children: /* @__PURE__ */ e(
|
|
211
211
|
b,
|
|
212
212
|
{
|
|
213
213
|
asMenuHeader: !0,
|
|
214
214
|
avatar: t,
|
|
215
|
-
avatarPair:
|
|
215
|
+
avatarPair: a,
|
|
216
216
|
badgeLabel: o,
|
|
217
|
-
description:
|
|
218
|
-
menuTriggerDescription:
|
|
217
|
+
description: r,
|
|
218
|
+
menuTriggerDescription: u,
|
|
219
219
|
title: n,
|
|
220
|
-
uploadAvatarCallback:
|
|
220
|
+
uploadAvatarCallback: c,
|
|
221
221
|
uploadAvatarLabel: i,
|
|
222
222
|
uploadAvatarDescription: d
|
|
223
223
|
}
|
|
224
224
|
) }),
|
|
225
|
-
|
|
225
|
+
y
|
|
226
226
|
] }) })
|
|
227
227
|
]
|
|
228
228
|
}
|
|
@@ -2,16 +2,16 @@ import { jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import { useContext as u } from "react";
|
|
3
3
|
import { uyMerge as m } from "@payfit/unity-themes";
|
|
4
4
|
import { ComboBoxStateContext as a } from "react-aria-components";
|
|
5
|
-
import { useIntl as
|
|
6
|
-
import { CircularIconButton as
|
|
5
|
+
import { useIntl as s } from "react-intl";
|
|
6
|
+
import { CircularIconButton as i } from "../../icon-button/CircularIconButton.js";
|
|
7
7
|
const c = ({
|
|
8
8
|
className: e,
|
|
9
9
|
isReadOnly: o,
|
|
10
10
|
isDisabled: n
|
|
11
11
|
}) => {
|
|
12
|
-
const t = u(a), r =
|
|
13
|
-
return !
|
|
14
|
-
|
|
12
|
+
const t = u(a), r = s();
|
|
13
|
+
return !t?.inputValue || o || n ? null : /* @__PURE__ */ l(
|
|
14
|
+
i,
|
|
15
15
|
{
|
|
16
16
|
slot: null,
|
|
17
17
|
title: r.formatMessage({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useDrag as
|
|
5
|
-
import { OverlayTriggerStateContext as
|
|
6
|
-
import { useBreakpointListener as
|
|
7
|
-
const
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as h, useContext as b } from "react";
|
|
3
|
+
import { uyTv as g } from "@payfit/unity-themes";
|
|
4
|
+
import { useDrag as x } from "@use-gesture/react";
|
|
5
|
+
import { OverlayTriggerStateContext as D } from "react-aria-components";
|
|
6
|
+
import { useBreakpointListener as v } from "../../../hooks/use-breakpoint-listener.js";
|
|
7
|
+
const S = g({
|
|
8
8
|
slots: {
|
|
9
9
|
base: [
|
|
10
10
|
"uy:md:hidden uy:mx-auto uy:py-100 uy:w-500",
|
|
@@ -12,25 +12,24 @@ const T = x({
|
|
|
12
12
|
],
|
|
13
13
|
indicator: "uy:h-50 uy:rounded-pill uy:bg-content-neutral-lowest"
|
|
14
14
|
}
|
|
15
|
-
}),
|
|
16
|
-
function
|
|
17
|
-
const r =
|
|
18
|
-
(
|
|
19
|
-
var s;
|
|
15
|
+
}), T = 100;
|
|
16
|
+
function I() {
|
|
17
|
+
const r = h(null), o = b(D), n = v(), { base: a, indicator: i } = S(), l = n === "xs" || n === "sm", m = x(
|
|
18
|
+
(u) => {
|
|
20
19
|
const {
|
|
21
|
-
movement: [
|
|
22
|
-
direction: [
|
|
23
|
-
intentional:
|
|
24
|
-
cancel:
|
|
25
|
-
last:
|
|
26
|
-
event:
|
|
27
|
-
} =
|
|
28
|
-
if (!
|
|
29
|
-
|
|
20
|
+
movement: [N, e],
|
|
21
|
+
direction: [B, c],
|
|
22
|
+
intentional: d,
|
|
23
|
+
cancel: f,
|
|
24
|
+
last: y,
|
|
25
|
+
event: p
|
|
26
|
+
} = u;
|
|
27
|
+
if (!l) {
|
|
28
|
+
f();
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
|
|
33
|
-
const t =
|
|
31
|
+
p.preventDefault();
|
|
32
|
+
const t = r.current?.closest(
|
|
34
33
|
"[data-unity-bottom-sheet]"
|
|
35
34
|
);
|
|
36
35
|
if (t) {
|
|
@@ -38,7 +37,7 @@ function N() {
|
|
|
38
37
|
t.style.transform = "translate3d(0, 0, 0)";
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
|
-
t.style.transform = `translate3d(0, ${e}px, 0)`, t.style.transition = "none",
|
|
40
|
+
t.style.transform = `translate3d(0, ${e}px, 0)`, t.style.transition = "none", y && d && (e > T || c > 0 ? o && setTimeout(() => {
|
|
42
41
|
o.close();
|
|
43
42
|
}, 50) : (t.style.transform = "translate3d(0, 0, 0)", t.style.transition = "transform 0.3s ease"));
|
|
44
43
|
}
|
|
@@ -49,19 +48,19 @@ function N() {
|
|
|
49
48
|
threshold: 5
|
|
50
49
|
}
|
|
51
50
|
);
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ s(
|
|
53
52
|
"div",
|
|
54
53
|
{
|
|
55
|
-
className:
|
|
54
|
+
className: a(),
|
|
56
55
|
"aria-hidden": "true",
|
|
57
56
|
ref: r,
|
|
58
|
-
...
|
|
59
|
-
children: /* @__PURE__ */
|
|
57
|
+
...m(),
|
|
58
|
+
children: /* @__PURE__ */ s("div", { className: i() })
|
|
60
59
|
}
|
|
61
60
|
);
|
|
62
61
|
}
|
|
63
|
-
|
|
62
|
+
I.displayName = "BottomSheetDragIndicator";
|
|
64
63
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
I as BottomSheetDragIndicator,
|
|
65
|
+
S as bottomSheetDragIndicator
|
|
67
66
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import { ForwardedRef, JSX, ReactNode } from 'react';
|
|
2
3
|
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { Schema } from '../../hooks/use-form.types.js';
|
|
5
5
|
import { LabelProps } from '../label/Label.js';
|
|
6
6
|
interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> extends Pick<LabelProps, 'isRequired' | 'requiredVariant'> {
|
|
@@ -24,7 +24,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
|
|
|
24
24
|
isLoading?: boolean;
|
|
25
25
|
}
|
|
26
26
|
export type CheckboxFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
|
|
27
|
-
type CheckboxFieldComponent = (<TSchema extends Schema>(props: CheckboxFieldProps<
|
|
27
|
+
type CheckboxFieldComponent = (<TSchema extends Schema>(props: CheckboxFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
|
|
28
28
|
ref?: ForwardedRef<HTMLLabelElement>;
|
|
29
29
|
}) => JSX.Element) & {
|
|
30
30
|
displayName?: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { jsxs as k, jsx as
|
|
1
|
+
import { jsxs as k, jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as C, useMemo as y } from "react";
|
|
3
3
|
import { useFormContext as R } from "react-hook-form";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { createSchemaAdapter as q } from "../../utils/createSchemaAdapter.js";
|
|
5
|
+
import { Checkbox as P } from "../checkbox/Checkbox.js";
|
|
6
|
+
import { FormField as S } from "../form-field/FormField.js";
|
|
6
7
|
import { FormControl as j } from "../form-field/parts/FormControl.js";
|
|
7
8
|
import { FormFeedbackText as v } from "../form-field/parts/FormFeedbackText.js";
|
|
8
9
|
import { isFieldRequired as w } from "../form-field/utils/isFieldRequired.js";
|
|
9
10
|
import { useUnityFormProvider as N } from "../form/Form.context.js";
|
|
10
|
-
function
|
|
11
|
+
function T({
|
|
11
12
|
name: o,
|
|
12
13
|
children: e,
|
|
13
14
|
defaultSelected: r,
|
|
@@ -21,12 +22,12 @@ function S({
|
|
|
21
22
|
requiredVariant: p,
|
|
22
23
|
...u
|
|
23
24
|
}, x) {
|
|
24
|
-
const { control: F, watch:
|
|
25
|
-
() => w(
|
|
26
|
-
[
|
|
27
|
-
), b =
|
|
25
|
+
const { control: F, watch: a } = R(), { schema: i } = N(), h = y(
|
|
26
|
+
() => w(q(i), o),
|
|
27
|
+
[i, o]
|
|
28
|
+
), b = a(o);
|
|
28
29
|
return /* @__PURE__ */ k(
|
|
29
|
-
|
|
30
|
+
S,
|
|
30
31
|
{
|
|
31
32
|
control: F,
|
|
32
33
|
name: o,
|
|
@@ -38,17 +39,17 @@ function S({
|
|
|
38
39
|
isReadOnly: f
|
|
39
40
|
},
|
|
40
41
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
42
|
+
/* @__PURE__ */ m(j, { children: /* @__PURE__ */ m(
|
|
43
|
+
P,
|
|
43
44
|
{
|
|
44
45
|
ref: x,
|
|
45
46
|
defaultSelected: r,
|
|
46
47
|
isSelected: b,
|
|
47
48
|
requiredVariant: p,
|
|
48
49
|
helperText: t,
|
|
49
|
-
feedbackText: /* @__PURE__ */
|
|
50
|
+
feedbackText: /* @__PURE__ */ m(v, {}),
|
|
50
51
|
...u,
|
|
51
|
-
isRequired:
|
|
52
|
+
isRequired: h ?? s,
|
|
52
53
|
children: e
|
|
53
54
|
}
|
|
54
55
|
) }),
|
|
@@ -57,10 +58,10 @@ function S({
|
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
}
|
|
60
|
-
const
|
|
61
|
-
return
|
|
61
|
+
const U = C(function(e, r) {
|
|
62
|
+
return T(e, r);
|
|
62
63
|
});
|
|
63
|
-
|
|
64
|
+
U.displayName = "CheckboxField";
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
U as CheckboxField
|
|
66
67
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
1
2
|
import { ForwardedRef, JSX, PropsWithChildren, ReactNode } from 'react';
|
|
2
3
|
import { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
|
-
import { infer as ZodInfer } from 'zod';
|
|
4
4
|
import { Schema } from '../../hooks/use-form.types.js';
|
|
5
5
|
import { CheckboxGroupProps } from '../checkbox-group/CheckboxGroup.js';
|
|
6
6
|
import { LabelProps } from '../label/Label.js';
|
|
@@ -40,7 +40,7 @@ interface FieldProps<TFieldValues extends FieldValues = FieldValues, TName exten
|
|
|
40
40
|
onFocusChange?: (isFocused: boolean) => void;
|
|
41
41
|
}
|
|
42
42
|
export type CheckboxGroupFieldProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = FieldProps<TFieldValues, TName>;
|
|
43
|
-
type CheckboxGroupFieldComponent = (<TSchema extends Schema>(props: CheckboxGroupFieldProps<
|
|
43
|
+
type CheckboxGroupFieldComponent = (<TSchema extends Schema>(props: CheckboxGroupFieldProps<StandardSchemaV1.InferOutput<TSchema>> & {
|
|
44
44
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
45
45
|
}) => JSX.Element) & {
|
|
46
46
|
displayName?: string;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { VariantProps } from '@payfit/unity-themes';
|
|
2
|
+
export declare const code: import('tailwind-variants').TVReturnType<{
|
|
3
|
+
[key: string]: {
|
|
4
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
5
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
6
|
+
pre?: import('tailwind-merge').ClassNameValue;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
[x: string]: {
|
|
11
|
+
[x: string]: import('tailwind-merge').ClassNameValue | {
|
|
12
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
13
|
+
pre?: import('tailwind-merge').ClassNameValue;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {}, {
|
|
17
|
+
base: string[];
|
|
18
|
+
pre: string;
|
|
19
|
+
}, undefined, {
|
|
20
|
+
[key: string]: {
|
|
21
|
+
[key: string]: import('tailwind-merge').ClassNameValue | {
|
|
22
|
+
base?: import('tailwind-merge').ClassNameValue;
|
|
23
|
+
pre?: import('tailwind-merge').ClassNameValue;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
} | {}, {
|
|
27
|
+
base: string[];
|
|
28
|
+
pre: string;
|
|
29
|
+
}, import('tailwind-variants').TVReturnType<unknown, {
|
|
30
|
+
base: string[];
|
|
31
|
+
pre: string;
|
|
32
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
33
|
+
export interface CodeProps extends VariantProps<typeof code> {
|
|
34
|
+
children: string;
|
|
35
|
+
}
|
|
36
|
+
declare const Code: import('react').ForwardRefExoticComponent<CodeProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
37
|
+
export { Code };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as n } from "react";
|
|
3
|
+
import { uyTv as i } from "@payfit/unity-themes";
|
|
4
|
+
import { useIntl as c } from "react-intl";
|
|
5
|
+
import { CircularIconButton as p } from "../icon-button/CircularIconButton.js";
|
|
6
|
+
import { copyToClipboard as y } from "./copyToClipboard.js";
|
|
7
|
+
const m = i({
|
|
8
|
+
slots: {
|
|
9
|
+
base: [
|
|
10
|
+
"uy:group uy:flex uy:p-100 uy:self-stretch uy:content-end uy:gap-100 uy:font-mono uy:rounded-100 uy:border uy:border-solid uy:border-border-neutral uy:bg-surface-neutral-lowest"
|
|
11
|
+
],
|
|
12
|
+
pre: "uy:grow uy:text-wrap"
|
|
13
|
+
}
|
|
14
|
+
}), f = n(
|
|
15
|
+
({ children: o, ...e }, t) => {
|
|
16
|
+
const a = c(), { base: d, pre: s } = m(), u = () => {
|
|
17
|
+
y(o);
|
|
18
|
+
};
|
|
19
|
+
return /* @__PURE__ */ l("code", { ref: t, "data-dd-privacy": "allow", className: d(), ...e, children: [
|
|
20
|
+
/* @__PURE__ */ r("pre", { className: s(), children: o }),
|
|
21
|
+
/* @__PURE__ */ r(
|
|
22
|
+
p,
|
|
23
|
+
{
|
|
24
|
+
title: a.formatMessage({
|
|
25
|
+
id: "unity:command:code:icon:title",
|
|
26
|
+
defaultMessage: "Copy to clipboard"
|
|
27
|
+
}),
|
|
28
|
+
icon: "ClipboardOutlined",
|
|
29
|
+
onClick: u
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
f.displayName = "Code";
|
|
36
|
+
export {
|
|
37
|
+
f as Code,
|
|
38
|
+
m as code
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { DisclosureProps } from 'react-aria-components';
|
|
3
|
-
export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | '
|
|
3
|
+
export interface CollapsibleProps extends Omit<DisclosureProps, 'isDisabled' | 'className'> {
|
|
4
4
|
/**
|
|
5
5
|
* The content of the collapsible component.
|
|
6
6
|
* Typically includes a CollapsibleTitle and CollapsibleContent.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { Disclosure as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as e } from "react";
|
|
3
|
+
import { uyTv as l } from "@payfit/unity-themes";
|
|
4
|
+
import { Disclosure as r } from "react-aria-components";
|
|
5
|
+
const n = l({
|
|
6
6
|
base: [
|
|
7
7
|
"uy:w-full uy:rounded-50",
|
|
8
8
|
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-2",
|
|
@@ -10,20 +10,21 @@ const r = e({
|
|
|
10
10
|
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-offset-2",
|
|
11
11
|
"uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-utility-focus-ring"
|
|
12
12
|
]
|
|
13
|
-
}),
|
|
14
|
-
({ children: i, isExpanded: t,
|
|
15
|
-
|
|
13
|
+
}), f = e(
|
|
14
|
+
({ children: i, isExpanded: t, defaultExpanded: o, ...s }, a) => /* @__PURE__ */ u(
|
|
15
|
+
r,
|
|
16
16
|
{
|
|
17
17
|
"data-dd-privacy": "allow",
|
|
18
|
-
...
|
|
19
|
-
className:
|
|
20
|
-
ref:
|
|
18
|
+
...s,
|
|
19
|
+
className: n(),
|
|
20
|
+
ref: a,
|
|
21
|
+
defaultExpanded: o,
|
|
21
22
|
isExpanded: t,
|
|
22
23
|
children: i
|
|
23
24
|
}
|
|
24
25
|
)
|
|
25
26
|
);
|
|
26
|
-
|
|
27
|
+
f.displayName = "Collapsible";
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
f as Collapsible
|
|
29
30
|
};
|