@payfit/unity-components 1.2.0 → 2.0.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/action-bar/ActionBar.js +14 -14
- package/dist/esm/components/actionable/Actionable.js +31 -28
- package/dist/esm/components/app-layout/AppLayout.js +17 -17
- package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +86 -4
- package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
- package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
- package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
- package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
- package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
- package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
- package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
- package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
- package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
- package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +2 -2
- package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
- package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
- package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
- package/dist/esm/components/error-state/ErrorState.js +133 -92
- package/dist/esm/components/error-state/initConfig.js +1 -1
- package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
- package/dist/esm/components/fieldset/Fieldset.js +32 -26
- package/dist/esm/components/flex/Flex.js +52 -37
- package/dist/esm/components/form-field/FormField.js +12 -12
- package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts} +2 -2
- package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
- package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
- package/dist/esm/components/icon/Icon.js +23 -19
- package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
- package/dist/esm/components/link/{Link.variants.js → RawLink.js} +70 -4
- package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
- package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
- package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
- package/dist/esm/components/nav/parts/NavGroup.js +62 -51
- package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
- package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
- package/dist/esm/components/page/Page.js +1 -1
- package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
- package/dist/esm/components/page/parts/PageHeader.js +22 -20
- package/dist/esm/components/pagination/Pagination.d.ts +23 -44
- package/dist/esm/components/pagination/Pagination.js +89 -163
- package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
- package/dist/esm/components/pagination/PaginationContext.js +15 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
- package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
- package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
- package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
- package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
- package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
- package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
- package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
- package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
- package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
- package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
- package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
- package/dist/esm/components/select/Select.js +63 -45
- package/dist/esm/components/select/parts/SelectOption.js +9 -9
- package/dist/esm/components/skip-links/SkipLinks.js +1 -1
- package/dist/esm/components/table/Table.d.ts +1 -0
- package/dist/esm/components/table/Table.js +82 -73
- package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
- package/dist/esm/components/table/parts/TableCell.js +29 -26
- package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
- package/dist/esm/components/table/parts/TablePagination.js +10 -10
- package/dist/esm/components/table/parts/TableRow.js +21 -18
- package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
- package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
- package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
- package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +19 -19
- package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
- package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +17 -17
- package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
- package/dist/esm/components/text/Text.js +30 -27
- package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
- package/dist/esm/hooks/use-container-query-level.js +33 -0
- package/dist/esm/index.d.ts +21 -11
- package/dist/esm/index.js +424 -399
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +40 -0
- package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
- package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
- package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
- package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
- package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
- package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
- package/dist/esm/integrations/tanstack-router/index.d.ts +16 -0
- package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
- package/dist/esm/integrations/tanstack-router.js +34 -0
- package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
- package/dist/esm/providers/router/RouterProvider.js +14 -10
- package/dist/esm/types/DataAttributes.d.ts +1 -1
- package/i18n/en-GB.json +1 -0
- package/i18n/es-ES.json +1 -0
- package/i18n/fr-FR.json +1 -0
- package/package.json +47 -25
- package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
- package/dist/esm/components/link/Link.d.ts +0 -93
- package/dist/esm/components/link/Link.js +0 -68
- package/dist/esm/components/nav/parts/NavItem.js +0 -95
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
- /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +0 -0
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { Illustration as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import { tv as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { jsx as e, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as J, useRef as K, useCallback as O } from "react";
|
|
3
|
+
import { Illustration as U } from "@payfit/unity-illustrations";
|
|
4
|
+
import { useIntl as V } from "react-intl";
|
|
5
|
+
import { tv as W } from "tailwind-variants";
|
|
6
|
+
import { useContainerQueryLevel as X } from "../../hooks/use-container-query-level.js";
|
|
7
|
+
import { Button as h } from "../button/Button.js";
|
|
8
|
+
import { Code as Y } from "../code/Code.js";
|
|
9
|
+
import { Icon as Z } from "../icon/Icon.js";
|
|
10
|
+
import { Text as r } from "../text/Text.js";
|
|
11
|
+
import { initConfig as _ } from "./initConfig.js";
|
|
12
|
+
import { Collapsible as $ } from "./parts/Collapsible.js";
|
|
13
|
+
const ee = W({
|
|
13
14
|
slots: {
|
|
15
|
+
container: [
|
|
16
|
+
"uy:@container uy:w-full uy:h-full uy:content-center uy:flex-1"
|
|
17
|
+
],
|
|
18
|
+
wrapper: [
|
|
19
|
+
"uy:border-solid uy:border-border-neutral uy:border uy:rounded-200 uy:p-300",
|
|
20
|
+
"uy:@section:py-600 uy:@section:px-auto",
|
|
21
|
+
"uy:@page:border-0 uy:@page:py-auto uy:@page:px-auto",
|
|
22
|
+
"uy:@app:border-0 uy:@app:py-auto uy:@app:px-auto"
|
|
23
|
+
],
|
|
14
24
|
base: [
|
|
15
25
|
"uy:max-w-[704px] uy:flex uy:flex-col uy:items-center uy:justify-center uy:gap-250 uy:w-full uy:justify-self-center"
|
|
16
26
|
],
|
|
@@ -19,9 +29,9 @@ const Q = G({
|
|
|
19
29
|
//common but start from section level
|
|
20
30
|
"uy:hidden",
|
|
21
31
|
//component
|
|
22
|
-
"",
|
|
32
|
+
"uy:@page:w-[200px]",
|
|
23
33
|
// page
|
|
24
|
-
"uy:@section:w-[
|
|
34
|
+
"uy:@section:w-[200px]",
|
|
25
35
|
//section
|
|
26
36
|
"uy:@app:w-[240px]"
|
|
27
37
|
//app
|
|
@@ -59,95 +69,126 @@ const Q = G({
|
|
|
59
69
|
// only on component
|
|
60
70
|
description: ["uy:hidden uy:@section:block uy:@section:w-full"]
|
|
61
71
|
}
|
|
62
|
-
}),
|
|
63
|
-
const
|
|
64
|
-
return /* @__PURE__ */
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
72
|
+
}), ne = (t, n) => {
|
|
73
|
+
const i = t.detailDescription ?? n?.detailDescription;
|
|
74
|
+
return /* @__PURE__ */ u($, { children: [
|
|
75
|
+
/* @__PURE__ */ e("div", { className: "uy:mb-200", children: i }),
|
|
76
|
+
/* @__PURE__ */ e(Y, { children: t.error.message })
|
|
67
77
|
] });
|
|
68
|
-
},
|
|
69
|
-
const
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
|
|
78
|
+
}, te = (t, n) => {
|
|
79
|
+
const i = t.backButtonLabel ?? n?.backButtonLabel;
|
|
80
|
+
return /* @__PURE__ */ e("div", { className: "uy:mt-200", children: /* @__PURE__ */ e(
|
|
81
|
+
h,
|
|
72
82
|
{
|
|
73
83
|
onClick: () => {
|
|
74
84
|
window.history.go(-1);
|
|
75
85
|
},
|
|
76
86
|
color: "primary",
|
|
77
87
|
variant: "ghost",
|
|
78
|
-
children:
|
|
88
|
+
children: i
|
|
79
89
|
}
|
|
80
90
|
) });
|
|
81
|
-
},
|
|
91
|
+
}, oe = J((t, n) => {
|
|
82
92
|
const {
|
|
83
|
-
icon:
|
|
84
|
-
illustration:
|
|
85
|
-
onButtonPress:
|
|
86
|
-
buttonLabel:
|
|
87
|
-
mainTitle:
|
|
88
|
-
mainDescription:
|
|
89
|
-
mainDescriptionComponent:
|
|
90
|
-
type:
|
|
91
|
-
error:
|
|
92
|
-
role:
|
|
93
|
+
icon: i,
|
|
94
|
+
illustration: b,
|
|
95
|
+
onButtonPress: v,
|
|
96
|
+
buttonLabel: g,
|
|
97
|
+
mainTitle: x,
|
|
98
|
+
mainDescription: k,
|
|
99
|
+
mainDescriptionComponent: w,
|
|
100
|
+
type: m,
|
|
101
|
+
error: C,
|
|
102
|
+
role: N = "status"
|
|
93
103
|
} = t, {
|
|
94
|
-
base:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
104
|
+
base: D,
|
|
105
|
+
container: E,
|
|
106
|
+
wrapper: B,
|
|
107
|
+
illustration: L,
|
|
108
|
+
icon: M,
|
|
109
|
+
informationContainer: j,
|
|
110
|
+
information: I,
|
|
111
|
+
informationComponent: T,
|
|
112
|
+
description: R,
|
|
113
|
+
h1: S,
|
|
114
|
+
h2: P,
|
|
115
|
+
h3: z,
|
|
116
|
+
h4: Q
|
|
117
|
+
} = ee(), l = V(), q = _(l), y = K(null), { level: p } = X({ ref: y }), A = O(
|
|
118
|
+
(c) => {
|
|
119
|
+
y.current = c, n && (typeof n == "function" ? n(c) : n.current = c);
|
|
120
|
+
},
|
|
121
|
+
[n]
|
|
122
|
+
);
|
|
123
|
+
let a = m === "404" ? "404" : "unknown";
|
|
124
|
+
m === "generic" && C && (a = "known");
|
|
125
|
+
const o = q.get(a), d = b ?? o?.illustration, f = i ?? o?.icon, F = g ?? o?.buttonLabel, s = x ?? o?.mainTitle, G = k ?? o?.mainDescription, H = w ?? o?.mainDescriptionComponent;
|
|
126
|
+
return /* @__PURE__ */ e(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
role: N,
|
|
130
|
+
className: E(),
|
|
131
|
+
ref: A,
|
|
132
|
+
"data-container-level": p,
|
|
133
|
+
children: /* @__PURE__ */ e("div", { className: B(), children: /* @__PURE__ */ u("div", { className: D(), children: [
|
|
134
|
+
d && /* @__PURE__ */ e(
|
|
135
|
+
U,
|
|
136
|
+
{
|
|
137
|
+
src: d,
|
|
138
|
+
variant: "picture",
|
|
139
|
+
alt: l.formatMessage({
|
|
140
|
+
id: "unity:component:error-state:common:illustration:alt",
|
|
141
|
+
defaultMessage: "Error states"
|
|
142
|
+
}),
|
|
143
|
+
className: L(),
|
|
144
|
+
isDecorative: !0
|
|
145
|
+
}
|
|
146
|
+
),
|
|
147
|
+
f && /* @__PURE__ */ e(
|
|
148
|
+
Z,
|
|
149
|
+
{
|
|
150
|
+
src: f,
|
|
151
|
+
size: 24,
|
|
152
|
+
color: "content.neutral.low",
|
|
153
|
+
alt: l.formatMessage({
|
|
154
|
+
id: "unity:component:error-state:common:icon:alt",
|
|
155
|
+
defaultMessage: "Error states"
|
|
156
|
+
}),
|
|
157
|
+
className: M()
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ u("div", { className: j(), children: [
|
|
161
|
+
/* @__PURE__ */ e(r, { asElement: "h1", variant: "h1", className: S(), children: s }),
|
|
162
|
+
/* @__PURE__ */ e(r, { asElement: "h2", variant: "h2", className: P(), children: s }),
|
|
163
|
+
/* @__PURE__ */ e(r, { asElement: "h3", variant: "h3", className: z(), children: s }),
|
|
164
|
+
/* @__PURE__ */ e(r, { asElement: "h4", variant: "h4", className: Q(), children: s }),
|
|
165
|
+
/* @__PURE__ */ e(r, { asElement: "p", variant: "body", className: I(), children: G }),
|
|
166
|
+
/* @__PURE__ */ e(
|
|
167
|
+
r,
|
|
168
|
+
{
|
|
169
|
+
asElement: "p",
|
|
170
|
+
variant: "body",
|
|
171
|
+
className: T(),
|
|
172
|
+
children: H
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ e(
|
|
177
|
+
h,
|
|
178
|
+
{
|
|
179
|
+
variant: p === "component" ? "ghost" : "primary",
|
|
180
|
+
onPress: v,
|
|
181
|
+
children: F
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
a === "unknown" && te(t, o),
|
|
185
|
+
a === "known" && /* @__PURE__ */ e("div", { className: R(), children: ne(t, o) })
|
|
186
|
+
] }) })
|
|
187
|
+
}
|
|
188
|
+
);
|
|
148
189
|
});
|
|
149
|
-
|
|
190
|
+
oe.displayName = "ErrorState";
|
|
150
191
|
export {
|
|
151
|
-
|
|
152
|
-
|
|
192
|
+
oe as ErrorState,
|
|
193
|
+
ee as errorState
|
|
153
194
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import t from "@payfit/unity-illustrations/assets/EmptyStateIncidentPanel";
|
|
3
3
|
import a from "@payfit/unity-illustrations/assets/EmptyStateResearch";
|
|
4
|
-
import {
|
|
4
|
+
import { RawLink as n } from "../link/RawLink.js";
|
|
5
5
|
const c = (e) => /* @__PURE__ */ new Map([
|
|
6
6
|
[
|
|
7
7
|
"known",
|
|
@@ -13,6 +13,11 @@ export declare const fieldset: import('tailwind-variants').TVReturnType<{
|
|
|
13
13
|
fieldsContainer: string;
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
+
disableEndMargin: {
|
|
17
|
+
true: {
|
|
18
|
+
base: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
16
21
|
}, {
|
|
17
22
|
base: string;
|
|
18
23
|
legend: string;
|
|
@@ -31,6 +36,11 @@ export declare const fieldset: import('tailwind-variants').TVReturnType<{
|
|
|
31
36
|
fieldsContainer: string;
|
|
32
37
|
};
|
|
33
38
|
};
|
|
39
|
+
disableEndMargin: {
|
|
40
|
+
true: {
|
|
41
|
+
base: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
34
44
|
}, {
|
|
35
45
|
base: string;
|
|
36
46
|
legend: string;
|
|
@@ -49,6 +59,11 @@ export declare const fieldset: import('tailwind-variants').TVReturnType<{
|
|
|
49
59
|
fieldsContainer: string;
|
|
50
60
|
};
|
|
51
61
|
};
|
|
62
|
+
disableEndMargin: {
|
|
63
|
+
true: {
|
|
64
|
+
base: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
52
67
|
}, {
|
|
53
68
|
base: string;
|
|
54
69
|
legend: string;
|
|
@@ -68,6 +83,10 @@ export interface FieldsetProps extends PropsWithChildren<VariantProps<typeof fie
|
|
|
68
83
|
* Whether to hide the legend of the fieldset.
|
|
69
84
|
*/
|
|
70
85
|
isLegendHidden?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether to disable the end margin of the fieldset.
|
|
88
|
+
*/
|
|
89
|
+
disableEndMargin?: boolean;
|
|
71
90
|
}
|
|
72
91
|
/**
|
|
73
92
|
* The `Fieldset` component groups related form fields together with an accessible structure.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { uyTv as
|
|
4
|
-
import { useId as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g } from "react";
|
|
3
|
+
import { uyTv as b } from "@payfit/unity-themes";
|
|
4
|
+
import { useId as x } from "react-aria";
|
|
5
|
+
const h = b({
|
|
6
6
|
slots: {
|
|
7
7
|
base: "uy:p-0 uy:m-0 uy:[&+&]:mt-500 uy:[&:last-of-type]:mb-500",
|
|
8
8
|
legend: "uy:typography-h3 uy:text-content-neutral",
|
|
@@ -21,46 +21,52 @@ const x = g({
|
|
|
21
21
|
description: "uy:block",
|
|
22
22
|
fieldsContainer: "uy:mt-300"
|
|
23
23
|
}
|
|
24
|
+
},
|
|
25
|
+
disableEndMargin: {
|
|
26
|
+
true: {
|
|
27
|
+
base: "uy:[&:last-of-type]:mb-0"
|
|
28
|
+
}
|
|
24
29
|
}
|
|
25
30
|
},
|
|
26
31
|
defaultVariants: {
|
|
27
|
-
isLegendHidden: !1
|
|
32
|
+
isLegendHidden: !1,
|
|
33
|
+
disableEndMargin: !1
|
|
28
34
|
}
|
|
29
|
-
}),
|
|
30
|
-
({ children:
|
|
31
|
-
const
|
|
32
|
-
base:
|
|
33
|
-
legend:
|
|
34
|
-
description:
|
|
35
|
-
fieldsContainer:
|
|
36
|
-
} =
|
|
37
|
-
return /* @__PURE__ */
|
|
35
|
+
}), v = g(
|
|
36
|
+
({ children: t, ...d }, n) => {
|
|
37
|
+
const i = x(), { legend: l, description: e, isLegendHidden: a, disableEndMargin: r, ...o } = d, {
|
|
38
|
+
base: y,
|
|
39
|
+
legend: c,
|
|
40
|
+
description: u,
|
|
41
|
+
fieldsContainer: p
|
|
42
|
+
} = h({ isLegendHidden: a, disableEndMargin: r }), f = e ? `${i}-fieldset-description` : void 0;
|
|
43
|
+
return /* @__PURE__ */ m(
|
|
38
44
|
"fieldset",
|
|
39
45
|
{
|
|
40
46
|
"data-dd-privacy": "allow",
|
|
41
|
-
...
|
|
47
|
+
...o,
|
|
42
48
|
ref: n,
|
|
43
|
-
className:
|
|
44
|
-
"aria-describedby":
|
|
49
|
+
className: y(),
|
|
50
|
+
"aria-describedby": f,
|
|
45
51
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
e && /* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ s("legend", { className: c(), children: l }),
|
|
53
|
+
e && /* @__PURE__ */ s(
|
|
48
54
|
"span",
|
|
49
55
|
{
|
|
50
|
-
id: `${
|
|
56
|
+
id: `${i}-fieldset-description`,
|
|
51
57
|
"data-fieldset-slot": "description",
|
|
52
|
-
className:
|
|
58
|
+
className: u(),
|
|
53
59
|
children: e
|
|
54
60
|
}
|
|
55
61
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ s("div", { className: p(), children: t })
|
|
57
63
|
]
|
|
58
64
|
}
|
|
59
65
|
);
|
|
60
66
|
}
|
|
61
67
|
);
|
|
62
|
-
|
|
68
|
+
v.displayName = "Fieldset";
|
|
63
69
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
v as Fieldset,
|
|
71
|
+
h as fieldset
|
|
66
72
|
};
|
|
@@ -1,42 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { flex as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as E } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as M, useMemo as S } from "react";
|
|
3
|
+
import { flex as b } from "./Flex.variants.js";
|
|
4
|
+
const N = M(
|
|
5
5
|
({
|
|
6
|
-
asElement:
|
|
7
|
-
children:
|
|
8
|
-
className:
|
|
9
|
-
inline:
|
|
10
|
-
direction:
|
|
11
|
-
isReversed:
|
|
12
|
-
wrap:
|
|
13
|
-
gap:
|
|
14
|
-
gapX:
|
|
15
|
-
gapY:
|
|
16
|
-
justify:
|
|
17
|
-
align:
|
|
18
|
-
alignContent:
|
|
19
|
-
...
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
asElement: a = "div",
|
|
7
|
+
children: d,
|
|
8
|
+
className: m,
|
|
9
|
+
inline: o,
|
|
10
|
+
direction: r,
|
|
11
|
+
isReversed: e,
|
|
12
|
+
wrap: f,
|
|
13
|
+
gap: s,
|
|
14
|
+
gapX: t,
|
|
15
|
+
gapY: x,
|
|
16
|
+
justify: l,
|
|
17
|
+
align: c,
|
|
18
|
+
alignContent: F,
|
|
19
|
+
...k
|
|
20
|
+
}, p) => {
|
|
21
|
+
const u = S(
|
|
22
|
+
() => b({
|
|
23
|
+
inline: o,
|
|
24
|
+
direction: r,
|
|
25
|
+
isReversed: e,
|
|
26
|
+
wrap: f,
|
|
27
|
+
gap: s,
|
|
28
|
+
gapX: t,
|
|
29
|
+
gapY: x,
|
|
30
|
+
justify: l,
|
|
31
|
+
align: c,
|
|
32
|
+
alignContent: F,
|
|
33
|
+
className: m
|
|
34
|
+
}),
|
|
35
|
+
[
|
|
36
|
+
c,
|
|
37
|
+
F,
|
|
38
|
+
m,
|
|
39
|
+
r,
|
|
40
|
+
s,
|
|
41
|
+
t,
|
|
42
|
+
x,
|
|
43
|
+
o,
|
|
44
|
+
e,
|
|
45
|
+
l,
|
|
46
|
+
f
|
|
47
|
+
]
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ E(a, { ref: p, className: u, ...k, children: d });
|
|
35
50
|
}
|
|
36
51
|
);
|
|
37
|
-
|
|
38
|
-
const
|
|
52
|
+
N.displayName = "Flex";
|
|
53
|
+
const v = N;
|
|
39
54
|
export {
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
N as Flex,
|
|
56
|
+
v as Stack
|
|
42
57
|
};
|
|
@@ -5,15 +5,15 @@ import { useController as S } from "react-hook-form";
|
|
|
5
5
|
import P from "../../hooks/use-id.js";
|
|
6
6
|
import { createSchemaAdapter as g } from "../../utils/createSchemaAdapter.js";
|
|
7
7
|
import { useUnityFormProvider as j } from "../form/Form.context.js";
|
|
8
|
-
import { FormFieldProvider as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { isFieldRequired as
|
|
12
|
-
const
|
|
8
|
+
import { FormFieldProvider as w } from "./FormField.context.js";
|
|
9
|
+
import { FormHelperText as D } from "./parts/FormHelperText.js";
|
|
10
|
+
import { RawFormContextualLink as E } from "./parts/RawFormContextualLink.js";
|
|
11
|
+
import { isFieldRequired as I } from "./utils/isFieldRequired.js";
|
|
12
|
+
const N = L({
|
|
13
13
|
slots: {
|
|
14
14
|
base: "uy:flex uy:flex-col uy:gap-100"
|
|
15
15
|
}
|
|
16
|
-
}),
|
|
16
|
+
}), _ = H(
|
|
17
17
|
({
|
|
18
18
|
children: o,
|
|
19
19
|
control: f,
|
|
@@ -25,7 +25,7 @@ const _ = L({
|
|
|
25
25
|
isDisabled: h
|
|
26
26
|
}, y) => {
|
|
27
27
|
const b = P(), { schema: t } = j(), { formState: i } = S({ name: r, control: f }), C = d(
|
|
28
|
-
() =>
|
|
28
|
+
() => I(g(t), r),
|
|
29
29
|
[t, r]
|
|
30
30
|
), { hasHelperText: R, hasContextualLink: T } = d(() => {
|
|
31
31
|
let s = !1, m = !1;
|
|
@@ -33,7 +33,7 @@ const _ = L({
|
|
|
33
33
|
n.Children.forEach(v, (a) => {
|
|
34
34
|
if (!n.isValidElement(a)) return;
|
|
35
35
|
const e = a;
|
|
36
|
-
e.type ===
|
|
36
|
+
e.type === D ? s = !0 : e.type === E && (m = !0), e.props && typeof e.props == "object" && "children" in e.props && l(e.props.children);
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
return l(o), { hasHelperText: s, hasContextualLink: m };
|
|
@@ -46,11 +46,11 @@ const _ = L({
|
|
|
46
46
|
id: b,
|
|
47
47
|
isRequired: F ?? C,
|
|
48
48
|
isDisabled: h ?? (i.isSubmitting || i.disabled)
|
|
49
|
-
}, { base: q } =
|
|
50
|
-
return /* @__PURE__ */ p("div", { ref: y, className: q({ className: x }), children: /* @__PURE__ */ p(
|
|
49
|
+
}, { base: q } = N();
|
|
50
|
+
return /* @__PURE__ */ p("div", { ref: y, className: q({ className: x }), children: /* @__PURE__ */ p(w, { ...k, children: o }) });
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
|
-
|
|
53
|
+
_.displayName = "FormField";
|
|
54
54
|
export {
|
|
55
|
-
|
|
55
|
+
_ as FormField
|
|
56
56
|
};
|
package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts}
RENAMED
|
@@ -16,5 +16,5 @@ interface FormContextualLinkActionProps {
|
|
|
16
16
|
/**
|
|
17
17
|
* FormContextualLink is a component that displays a contextual link for a form field.
|
|
18
18
|
*/
|
|
19
|
-
declare const
|
|
20
|
-
export {
|
|
19
|
+
declare const RawFormContextualLink: import('react').ForwardRefExoticComponent<PropsWithChildren<FormContextualLinkProps | FormContextualLinkActionProps> & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
20
|
+
export { RawFormContextualLink };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as d } from "react";
|
|
3
|
+
import { Button as m } from "react-aria-components";
|
|
4
|
+
import { RawLink as s } from "../../link/RawLink.js";
|
|
5
|
+
import { useFormField as u } from "../FormField.context.js";
|
|
6
|
+
const c = d((l, o) => {
|
|
7
|
+
const { children: t, href: a, onPress: e, ...r } = l, { formContextualLinkId: n } = u();
|
|
8
|
+
return a ? /* @__PURE__ */ i(
|
|
9
|
+
s,
|
|
10
|
+
{
|
|
11
|
+
id: n,
|
|
12
|
+
size: "small",
|
|
13
|
+
color: "secondary",
|
|
14
|
+
variant: "standalone",
|
|
15
|
+
"data-unity-slot": "contextual-link",
|
|
16
|
+
href: a,
|
|
17
|
+
ref: o,
|
|
18
|
+
"data-dd-privacy": "allow",
|
|
19
|
+
...r,
|
|
20
|
+
children: t
|
|
21
|
+
}
|
|
22
|
+
) : /* @__PURE__ */ i(
|
|
23
|
+
m,
|
|
24
|
+
{
|
|
25
|
+
id: n,
|
|
26
|
+
onPress: e,
|
|
27
|
+
"data-unity-slot": "contextual-link",
|
|
28
|
+
className: "uy:typography-body-small uy:w-fit",
|
|
29
|
+
ref: o,
|
|
30
|
+
"data-dd-privacy": "allow",
|
|
31
|
+
...r,
|
|
32
|
+
children: t
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
});
|
|
36
|
+
c.displayName = "RawFormContextualLink";
|
|
37
|
+
export {
|
|
38
|
+
c as RawFormContextualLink
|
|
39
|
+
};
|
|
@@ -32,9 +32,9 @@ export interface FunnelSidebarProps extends PropsWithChildren<VariantProps<typeo
|
|
|
32
32
|
* return (
|
|
33
33
|
* <FunnelSidebar>
|
|
34
34
|
* <TaskMenu>
|
|
35
|
-
* <
|
|
35
|
+
* <RawTask>
|
|
36
36
|
* <TaskTitle>Task 1</TaskTitle>
|
|
37
|
-
* </
|
|
37
|
+
* </RawTask>
|
|
38
38
|
* </TaskMenu>
|
|
39
39
|
* </FunnelSidebar>
|
|
40
40
|
* )
|