@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.
Files changed (136) hide show
  1. package/dist/esm/components/action-bar/ActionBar.js +14 -14
  2. package/dist/esm/components/actionable/Actionable.js +31 -28
  3. package/dist/esm/components/app-layout/AppLayout.js +17 -17
  4. package/dist/esm/components/app-menu/parts/AppMenuHeader.d.ts +86 -4
  5. package/dist/esm/components/app-menu/parts/AppMenuHeader.js +25 -25
  6. package/dist/esm/components/breadcrumbs/Breadcrumbs.context.js +3 -3
  7. package/dist/esm/components/breadcrumbs/Breadcrumbs.d.ts +19 -11
  8. package/dist/esm/components/breadcrumbs/Breadcrumbs.js +29 -18
  9. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.d.ts +30 -5
  10. package/dist/esm/components/breadcrumbs/parts/Breadcrumb.js +35 -27
  11. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.d.ts +37 -0
  12. package/dist/esm/components/breadcrumbs/parts/RawBreadcrumbLink.js +36 -0
  13. package/dist/esm/components/client-side-pagination/ClientSidePagination.d.ts +103 -0
  14. package/dist/esm/components/client-side-pagination/ClientSidePagination.js +177 -0
  15. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.d.ts +11 -0
  16. package/dist/esm/components/client-side-pagination/parts/PaginationEllipsis.js +30 -0
  17. package/dist/esm/components/client-side-pagination/parts/PaginationJumpDialog.d.ts +8 -0
  18. package/dist/esm/components/{pagination/parts/PaginationLink.d.ts → client-side-pagination/parts/RawPaginationLink.d.ts} +2 -2
  19. package/dist/esm/components/{pagination/parts/PaginationLink.js → client-side-pagination/parts/RawPaginationLink.js} +2 -2
  20. package/dist/esm/components/client-side-pagination/utils/pagination-window.d.ts +8 -0
  21. package/dist/esm/components/client-side-pagination/utils/pagination-window.js +33 -0
  22. package/dist/esm/components/error-state/ErrorState.d.ts +13 -1
  23. package/dist/esm/components/error-state/ErrorState.js +133 -92
  24. package/dist/esm/components/error-state/initConfig.js +1 -1
  25. package/dist/esm/components/fieldset/Fieldset.d.ts +19 -0
  26. package/dist/esm/components/fieldset/Fieldset.js +32 -26
  27. package/dist/esm/components/flex/Flex.js +52 -37
  28. package/dist/esm/components/form-field/FormField.js +12 -12
  29. package/dist/esm/components/form-field/parts/{FormContextualLink.d.ts → RawFormContextualLink.d.ts} +2 -2
  30. package/dist/esm/components/form-field/parts/RawFormContextualLink.js +39 -0
  31. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  32. package/dist/esm/components/icon/Icon.js +23 -19
  33. package/dist/esm/components/link/{Link.variants.d.ts → RawLink.d.ts} +92 -0
  34. package/dist/esm/components/link/{Link.variants.js → RawLink.js} +70 -4
  35. package/dist/esm/components/menu/parts/{MenuItem.d.ts → RawMenuItem.d.ts} +3 -4
  36. package/dist/esm/components/menu/parts/{MenuItem.js → RawMenuItem.js} +9 -9
  37. package/dist/esm/components/nav/parts/NavGroup.d.ts +3 -3
  38. package/dist/esm/components/nav/parts/NavGroup.js +62 -51
  39. package/dist/esm/components/nav/parts/{NavItem.d.ts → RawNavItem.d.ts} +102 -5
  40. package/dist/esm/components/nav/parts/RawNavItem.js +106 -0
  41. package/dist/esm/components/page/Page.js +1 -1
  42. package/dist/esm/components/page/parts/PageHeader.d.ts +79 -9
  43. package/dist/esm/components/page/parts/PageHeader.js +22 -20
  44. package/dist/esm/components/pagination/Pagination.d.ts +23 -44
  45. package/dist/esm/components/pagination/Pagination.js +89 -163
  46. package/dist/esm/components/pagination/PaginationContext.d.ts +11 -0
  47. package/dist/esm/components/pagination/PaginationContext.js +15 -0
  48. package/dist/esm/components/pagination/hooks/use-pagination-state.d.ts +63 -0
  49. package/dist/esm/components/pagination/hooks/use-pagination-state.js +27 -0
  50. package/dist/esm/components/pagination/hooks/use-pagination-window.d.ts +64 -0
  51. package/dist/esm/components/pagination/hooks/use-pagination-window.js +15 -0
  52. package/dist/esm/components/pagination/parts/PaginationContent.d.ts +30 -0
  53. package/dist/esm/components/pagination/parts/PaginationContent.js +37 -0
  54. package/dist/esm/components/pagination/parts/PaginationEllipsis.d.ts +23 -4
  55. package/dist/esm/components/pagination/parts/PaginationEllipsis.js +20 -16
  56. package/dist/esm/components/pagination/parts/PaginationItem.d.ts +38 -0
  57. package/dist/esm/components/pagination/parts/PaginationItem.js +22 -0
  58. package/dist/esm/components/pagination/parts/RawPaginationLink.d.ts +11 -0
  59. package/dist/esm/components/pagination/parts/RawPaginationLink.js +60 -0
  60. package/dist/esm/components/pagination/parts/RawPaginationNext.d.ts +22 -0
  61. package/dist/esm/components/pagination/parts/RawPaginationNext.js +70 -0
  62. package/dist/esm/components/pagination/parts/RawPaginationPrevious.d.ts +22 -0
  63. package/dist/esm/components/pagination/parts/RawPaginationPrevious.js +67 -0
  64. package/dist/esm/components/pagination/utils/pagination-window.js +29 -20
  65. package/dist/esm/components/select/Select.js +63 -45
  66. package/dist/esm/components/select/parts/SelectOption.js +9 -9
  67. package/dist/esm/components/skip-links/SkipLinks.js +1 -1
  68. package/dist/esm/components/table/Table.d.ts +1 -0
  69. package/dist/esm/components/table/Table.js +82 -73
  70. package/dist/esm/components/table/hooks/useTableKeyboardNavigation.js +6 -6
  71. package/dist/esm/components/table/parts/TableCell.js +29 -26
  72. package/dist/esm/components/table/parts/TablePagination.d.ts +5 -5
  73. package/dist/esm/components/table/parts/TablePagination.js +10 -10
  74. package/dist/esm/components/table/parts/TableRow.js +21 -18
  75. package/dist/esm/components/tabs/parts/{Tab.d.ts → RawTab.d.ts} +2 -2
  76. package/dist/esm/components/tabs/parts/{Tab.js → RawTab.js} +6 -6
  77. package/dist/esm/components/task-menu/TaskMenu.d.ts +4 -4
  78. package/dist/esm/components/task-menu/parts/{SubTask.d.ts → RawSubTask.d.ts} +7 -7
  79. package/dist/esm/components/task-menu/parts/{SubTask.js → RawSubTask.js} +19 -19
  80. package/dist/esm/components/task-menu/parts/{Task.d.ts → RawTask.d.ts} +7 -7
  81. package/dist/esm/components/task-menu/parts/{Task.js → RawTask.js} +17 -17
  82. package/dist/esm/components/task-menu/parts/TaskGroup.d.ts +5 -5
  83. package/dist/esm/components/text/Text.js +30 -27
  84. package/dist/esm/hooks/use-container-query-level.d.ts +42 -0
  85. package/dist/esm/hooks/use-container-query-level.js +33 -0
  86. package/dist/esm/index.d.ts +21 -11
  87. package/dist/esm/index.js +424 -399
  88. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumb.d.ts +23 -0
  89. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.d.ts +38 -0
  90. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/BreadcrumbLink.js +7 -0
  91. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/Breadcrumbs.d.ts +23 -0
  92. package/dist/esm/integrations/tanstack-router/components/breadcrumbs/use-route-breadcrumb.d.ts +53 -0
  93. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.d.ts +40 -0
  94. package/dist/esm/integrations/tanstack-router/components/form-contextual-link/FormContextualLink.js +7 -0
  95. package/dist/esm/integrations/tanstack-router/components/link/Link.d.ts +33 -0
  96. package/dist/esm/integrations/tanstack-router/components/link/Link.js +7 -0
  97. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.d.ts +49 -0
  98. package/dist/esm/integrations/tanstack-router/components/menu-item/MenuItem.js +16 -0
  99. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.d.ts +52 -0
  100. package/dist/esm/integrations/tanstack-router/components/nav-item/NavItem.js +29 -0
  101. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.d.ts +54 -0
  102. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationLink.js +21 -0
  103. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.d.ts +52 -0
  104. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationNext.js +22 -0
  105. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.d.ts +51 -0
  106. package/dist/esm/integrations/tanstack-router/components/pagination/PaginationPrevious.js +22 -0
  107. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.d.ts +82 -0
  108. package/dist/esm/integrations/tanstack-router/components/tabs/Tabs.js +41 -0
  109. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.d.ts +52 -0
  110. package/dist/esm/integrations/tanstack-router/components/tabs/parts/Tab.js +15 -0
  111. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabList.d.ts +5 -0
  112. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.d.ts +77 -0
  113. package/dist/esm/integrations/tanstack-router/components/tabs/parts/TabPanel.js +16 -0
  114. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.d.ts +69 -0
  115. package/dist/esm/integrations/tanstack-router/components/task-menu/SubTask.js +14 -0
  116. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.d.ts +64 -0
  117. package/dist/esm/integrations/tanstack-router/components/task-menu/Task.js +14 -0
  118. package/dist/esm/integrations/tanstack-router/index.d.ts +16 -0
  119. package/dist/esm/integrations/tanstack-router/utils/decorators.d.ts +23 -0
  120. package/dist/esm/integrations/tanstack-router.js +34 -0
  121. package/dist/esm/providers/router/RouterProvider.d.ts +7 -2
  122. package/dist/esm/providers/router/RouterProvider.js +14 -10
  123. package/dist/esm/types/DataAttributes.d.ts +1 -1
  124. package/i18n/en-GB.json +1 -0
  125. package/i18n/es-ES.json +1 -0
  126. package/i18n/fr-FR.json +1 -0
  127. package/package.json +47 -25
  128. package/dist/esm/components/form-field/parts/FormContextualLink.js +0 -37
  129. package/dist/esm/components/link/Link.d.ts +0 -93
  130. package/dist/esm/components/link/Link.js +0 -68
  131. package/dist/esm/components/nav/parts/NavItem.js +0 -95
  132. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.d.ts +0 -0
  133. /package/dist/esm/components/{pagination → client-side-pagination}/hooks/use-pagination.js +0 -0
  134. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationJumpDialog.js +0 -0
  135. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.d.ts +0 -0
  136. /package/dist/esm/components/{pagination → client-side-pagination}/parts/PaginationNavButton.js +0 -0
@@ -1,16 +1,26 @@
1
- import { jsx as n, jsxs as c } from "react/jsx-runtime";
2
- import { forwardRef as q } from "react";
3
- import { Illustration as A } from "@payfit/unity-illustrations";
4
- import { useIntl as F } from "react-intl";
5
- import { tv as G } from "tailwind-variants";
6
- import { Button as y } from "../button/Button.js";
7
- import { Code as H } from "../code/Code.js";
8
- import { Icon as J } from "../icon/Icon.js";
9
- import { Text as o } from "../text/Text.js";
10
- import { initConfig as K } from "./initConfig.js";
11
- import { Collapsible as O } from "./parts/Collapsible.js";
12
- const Q = G({
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-[220px]",
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
- }), U = (t, i) => {
63
- const r = t.detailDescription ?? i?.detailDescription;
64
- return /* @__PURE__ */ c(O, { children: [
65
- /* @__PURE__ */ n("div", { className: "uy:mb-200", children: r }),
66
- /* @__PURE__ */ n(H, { children: t.error.message })
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
- }, V = (t, i) => {
69
- const r = t.backButtonLabel ?? i?.backButtonLabel;
70
- return /* @__PURE__ */ n("div", { className: "uy:mt-200", children: /* @__PURE__ */ n(
71
- y,
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: r
88
+ children: i
79
89
  }
80
90
  ) });
81
- }, W = q((t, i) => {
91
+ }, oe = J((t, n) => {
82
92
  const {
83
- icon: r,
84
- illustration: p,
85
- onButtonPress: h,
86
- buttonLabel: f,
87
- mainTitle: b,
88
- mainDescription: v,
89
- mainDescriptionComponent: g,
90
- type: u,
91
- error: k,
92
- role: x = "status"
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: w,
95
- illustration: N,
96
- icon: C,
97
- informationContainer: D,
98
- information: E,
99
- informationComponent: B,
100
- description: L,
101
- h1: M,
102
- h2: j,
103
- h3: I,
104
- h4: T
105
- } = Q(), l = F(), S = K(l);
106
- let a = u === "404" ? "404" : "unknown";
107
- u === "generic" && k && (a = "known");
108
- const e = S.get(a), m = p ?? e?.illustration, d = r ?? e?.icon, P = f ?? e?.buttonLabel, s = b ?? e?.mainTitle, z = v ?? e?.mainDescription, R = g ?? e?.mainDescriptionComponent;
109
- return /* @__PURE__ */ n("div", { role: x, ref: i, className: "uy:@container uy:w-full", children: /* @__PURE__ */ c("div", { className: w(), children: [
110
- m && /* @__PURE__ */ n(
111
- A,
112
- {
113
- src: m,
114
- variant: "picture",
115
- alt: l.formatMessage({
116
- id: "unity:component:error-state:common:illustration:alt",
117
- defaultMessage: "Error states"
118
- }),
119
- className: N(),
120
- isDecorative: !0
121
- }
122
- ),
123
- d && /* @__PURE__ */ n(
124
- J,
125
- {
126
- src: d,
127
- size: 24,
128
- color: "content.neutral.low",
129
- alt: l.formatMessage({
130
- id: "unity:component:error-state:common:icon:alt",
131
- defaultMessage: "Error states"
132
- }),
133
- className: C()
134
- }
135
- ),
136
- /* @__PURE__ */ c("div", { className: D(), children: [
137
- /* @__PURE__ */ n(o, { asElement: "h1", variant: "h1", className: M(), children: s }),
138
- /* @__PURE__ */ n(o, { asElement: "h2", variant: "h2", className: j(), children: s }),
139
- /* @__PURE__ */ n(o, { asElement: "h3", variant: "h3", className: I(), children: s }),
140
- /* @__PURE__ */ n(o, { asElement: "h4", variant: "h4", className: T(), children: s }),
141
- /* @__PURE__ */ n(o, { asElement: "p", variant: "body", className: E(), children: z }),
142
- /* @__PURE__ */ n(o, { asElement: "p", variant: "body", className: B(), children: R })
143
- ] }),
144
- /* @__PURE__ */ n(y, { variant: "primary", onPress: h, children: P }),
145
- a === "unknown" && V(t, e),
146
- a === "known" && /* @__PURE__ */ n("div", { className: L(), children: U(t, e) })
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
- W.displayName = "ErrorState";
190
+ oe.displayName = "ErrorState";
150
191
  export {
151
- W as ErrorState,
152
- Q as errorState
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 { Link as n } from "../link/Link.js";
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 f, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as m } from "react";
3
- import { uyTv as g } from "@payfit/unity-themes";
4
- import { useId as b } from "react-aria";
5
- const x = g({
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
- }), h = m(
30
- ({ children: i, ...d }, n) => {
31
- const s = b(), { legend: l, description: e, isLegendHidden: o, ...r } = d, {
32
- base: a,
33
- legend: y,
34
- description: c,
35
- fieldsContainer: u
36
- } = x({ isLegendHidden: o }), p = e ? `${s}-fieldset-description` : void 0;
37
- return /* @__PURE__ */ f(
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
- ...r,
47
+ ...o,
42
48
  ref: n,
43
- className: a(),
44
- "aria-describedby": p,
49
+ className: y(),
50
+ "aria-describedby": f,
45
51
  children: [
46
- /* @__PURE__ */ t("legend", { className: y(), children: l }),
47
- e && /* @__PURE__ */ t(
52
+ /* @__PURE__ */ s("legend", { className: c(), children: l }),
53
+ e && /* @__PURE__ */ s(
48
54
  "span",
49
55
  {
50
- id: `${s}-fieldset-description`,
56
+ id: `${i}-fieldset-description`,
51
57
  "data-fieldset-slot": "description",
52
- className: c(),
58
+ className: u(),
53
59
  children: e
54
60
  }
55
61
  ),
56
- /* @__PURE__ */ t("div", { className: u(), children: i })
62
+ /* @__PURE__ */ s("div", { className: p(), children: t })
57
63
  ]
58
64
  }
59
65
  );
60
66
  }
61
67
  );
62
- h.displayName = "Fieldset";
68
+ v.displayName = "Fieldset";
63
69
  export {
64
- h as Fieldset,
65
- x as fieldset
70
+ v as Fieldset,
71
+ h as fieldset
66
72
  };
@@ -1,42 +1,57 @@
1
- import { jsx as N } from "react/jsx-runtime";
2
- import { forwardRef as j } from "react";
3
- import { flex as k } from "./Flex.variants.js";
4
- const e = j(
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: o = "div",
7
- children: r,
8
- className: t,
9
- inline: s,
10
- direction: m,
11
- isReversed: a,
12
- wrap: l,
13
- gap: f,
14
- gapX: c,
15
- gapY: i,
16
- justify: n,
17
- align: p,
18
- alignContent: x,
19
- ...d
20
- }, y) => {
21
- const F = k({
22
- inline: s,
23
- direction: m,
24
- isReversed: a,
25
- wrap: l,
26
- gap: f,
27
- gapX: c,
28
- gapY: i,
29
- justify: n,
30
- align: p,
31
- alignContent: x,
32
- className: t
33
- });
34
- return /* @__PURE__ */ N(o, { ref: y, className: F, ...d, children: r });
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
- e.displayName = "Flex";
38
- const E = e;
52
+ N.displayName = "Flex";
53
+ const v = N;
39
54
  export {
40
- e as Flex,
41
- E as Stack
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 D } from "./FormField.context.js";
9
- import { FormContextualLink as E } from "./parts/FormContextualLink.js";
10
- import { FormHelperText as I } from "./parts/FormHelperText.js";
11
- import { isFieldRequired as N } from "./utils/isFieldRequired.js";
12
- const _ = L({
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
- }), w = H(
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
- () => N(g(t), r),
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 === I ? s = !0 : e.type === E && (m = !0), e.props && typeof e.props == "object" && "children" in e.props && l(e.props.children);
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(D, { ...k, children: o }) });
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
- w.displayName = "FormField";
53
+ _.displayName = "FormField";
54
54
  export {
55
- w as FormField
55
+ _ as FormField
56
56
  };
@@ -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 FormContextualLink: import('react').ForwardRefExoticComponent<PropsWithChildren<FormContextualLinkProps | FormContextualLinkActionProps> & import('react').RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
20
- export { FormContextualLink };
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
- * <Task>
35
+ * <RawTask>
36
36
  * <TaskTitle>Task 1</TaskTitle>
37
- * </Task>
37
+ * </RawTask>
38
38
  * </TaskMenu>
39
39
  * </FunnelSidebar>
40
40
  * )