@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.
Files changed (104) hide show
  1. package/dist/esm/adapters/standardSchemaAdapter.d.ts +7 -0
  2. package/dist/esm/adapters/standardSchemaAdapter.js +20 -0
  3. package/dist/esm/adapters/zodAdapter.d.ts +13 -0
  4. package/dist/esm/adapters/zodAdapter.js +74 -0
  5. package/dist/esm/components/action-bar/ActionBar.js +62 -64
  6. package/dist/esm/components/actionable/Actionable.d.ts +50 -3
  7. package/dist/esm/components/actionable/Actionable.js +49 -39
  8. package/dist/esm/components/app-menu/parts/AppMenuFooter.js +63 -63
  9. package/dist/esm/components/autocomplete/parts/AutocompleteClearButton.js +5 -5
  10. package/dist/esm/components/bottom-sheet/parts/BottomSheetDragIndicator.js +30 -31
  11. package/dist/esm/components/checkbox-field/CheckboxField.d.ts +2 -2
  12. package/dist/esm/components/checkbox-field/CheckboxField.js +18 -17
  13. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.d.ts +2 -2
  14. package/dist/esm/components/checkbox-group-field/CheckboxGroupField.js +4 -1
  15. package/dist/esm/components/code/Code.d.ts +37 -0
  16. package/dist/esm/components/code/Code.js +39 -0
  17. package/dist/esm/components/code/copyToClipboard.d.ts +1 -0
  18. package/dist/esm/components/code/copyToClipboard.js +10 -0
  19. package/dist/esm/components/collapsible/Collapsible.d.ts +1 -1
  20. package/dist/esm/components/collapsible/Collapsible.js +14 -13
  21. package/dist/esm/components/collapsible/parts/CollapsibleTitle.js +7 -7
  22. package/dist/esm/components/data-table/DataTable.d.ts +76 -10
  23. package/dist/esm/components/data-table/DataTable.js +81 -78
  24. package/dist/esm/components/data-table/parts/ColumnSortHeader.js +13 -13
  25. package/dist/esm/components/data-table/parts/DataTableBulkActions.js +20 -20
  26. package/dist/esm/components/date-calendar/DateCalendar.js +52 -52
  27. package/dist/esm/components/date-calendar/parts/DateSegmentSelect.js +30 -33
  28. package/dist/esm/components/date-picker/DatePicker.js +64 -64
  29. package/dist/esm/components/date-picker/parts/DateInput.js +33 -33
  30. package/dist/esm/components/date-picker-field/DatePickerField.d.ts +2 -2
  31. package/dist/esm/components/dialog/parts/DialogActions/DialogButton.js +12 -12
  32. package/dist/esm/components/error-state/ErrorState.d.ts +196 -0
  33. package/dist/esm/components/error-state/ErrorState.js +153 -0
  34. package/dist/esm/components/error-state/initConfig.d.ts +16 -0
  35. package/dist/esm/components/error-state/initConfig.js +149 -0
  36. package/dist/esm/components/error-state/parts/Collapsible.d.ts +59 -0
  37. package/dist/esm/components/error-state/parts/Collapsible.js +67 -0
  38. package/dist/esm/components/form/Form.d.ts +15 -9
  39. package/dist/esm/components/form/Form.js +53 -50
  40. package/dist/esm/components/form-field/FormField.js +24 -23
  41. package/dist/esm/components/form-field/utils/isFieldRequired.d.ts +4 -4
  42. package/dist/esm/components/form-field/utils/isFieldRequired.js +5 -20
  43. package/dist/esm/components/funnel-layout/FunnelLayout.d.ts +1 -1
  44. package/dist/esm/components/funnel-layout/FunnelLayout.js +61 -110
  45. package/dist/esm/components/funnel-layout/parts/FunnelPage.js +8 -9
  46. package/dist/esm/components/funnel-layout/parts/FunnelPageActions.js +24 -24
  47. package/dist/esm/components/funnel-layout/parts/FunnelPageFooter.js +6 -7
  48. package/dist/esm/components/funnel-layout/parts/FunnelPageHeader.d.ts +2 -2
  49. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.d.ts +2 -2
  50. package/dist/esm/components/funnel-layout/parts/FunnelSidebar.js +9 -10
  51. package/dist/esm/components/funnel-layout/parts/FunnelTopBar.js +0 -1
  52. package/dist/esm/components/input/Input.js +28 -28
  53. package/dist/esm/components/label/Label.js +19 -19
  54. package/dist/esm/components/multi-select/MultiSelect.js +94 -94
  55. package/dist/esm/components/multi-select/hooks/use-multiselection-state.js +32 -32
  56. package/dist/esm/components/multi-select/parts/MultiSelectButton.js +38 -38
  57. package/dist/esm/components/multi-select/parts/MultiSelectPopover.js +16 -16
  58. package/dist/esm/components/multi-select-field/MultiSelectField.d.ts +2 -2
  59. package/dist/esm/components/multi-select-field/MultiSelectField.js +53 -53
  60. package/dist/esm/components/nav/parts/NavGroup.js +21 -21
  61. package/dist/esm/components/number-field/NumberField.d.ts +3 -3
  62. package/dist/esm/components/number-input/NumberInput.js +58 -58
  63. package/dist/esm/components/pagination/Pagination.js +97 -101
  64. package/dist/esm/components/pagination/parts/PaginationJumpDialog.js +39 -40
  65. package/dist/esm/components/popover/parts/PopoverHeader.js +8 -8
  66. package/dist/esm/components/radio-button-group/parts/RadioButton.js +11 -11
  67. package/dist/esm/components/select-field/SelectField.d.ts +2 -2
  68. package/dist/esm/components/select-field/SelectField.js +4 -1
  69. package/dist/esm/components/selectable-button-group/SelectableButtonGroup.js +22 -23
  70. package/dist/esm/components/selectable-button-group-field/SelectableButtonGroupField.d.ts +2 -2
  71. package/dist/esm/components/side-panel/parts/SidePanelDragIndicator.js +30 -31
  72. package/dist/esm/components/skip-links/SkipLinks.js +50 -43
  73. package/dist/esm/components/table/Table.js +79 -76
  74. package/dist/esm/components/table/parts/TableBody.js +6 -6
  75. package/dist/esm/components/table/parts/TableCell.js +25 -25
  76. package/dist/esm/components/table/parts/TableColumnHeader.js +38 -38
  77. package/dist/esm/components/table/parts/TablePagination.js +61 -59
  78. package/dist/esm/components/table/parts/TableRow.js +16 -16
  79. package/dist/esm/components/tabs/parts/TabList.js +50 -54
  80. package/dist/esm/components/task-menu/parts/Content.js +24 -24
  81. package/dist/esm/components/task-menu/parts/Header.js +24 -24
  82. package/dist/esm/components/task-menu/parts/SubTask.js +74 -74
  83. package/dist/esm/components/task-menu/parts/Task.js +69 -69
  84. package/dist/esm/components/task-menu/parts/TaskGroup.js +45 -45
  85. package/dist/esm/components/text-area/TextArea.js +30 -31
  86. package/dist/esm/components/text-field/TextField.d.ts +2 -2
  87. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.d.ts +2 -2
  88. package/dist/esm/components/toggle-switch-field/ToggleSwitchField.js +4 -1
  89. package/dist/esm/components/toggle-switch-group/ToggleSwitchGroup.js +74 -74
  90. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.d.ts +2 -2
  91. package/dist/esm/components/toggle-switch-group-field/ToggleSwitchGroupField.js +36 -32
  92. package/dist/esm/hooks/use-form.d.ts +5 -5
  93. package/dist/esm/hooks/use-form.types.d.ts +2 -2
  94. package/dist/esm/hooks/use-resizable.js +13 -14
  95. package/dist/esm/index.d.ts +1 -0
  96. package/dist/esm/index.js +22 -19
  97. package/dist/esm/types/schema.d.ts +8 -0
  98. package/dist/esm/utils/createSchemaAdapter.d.ts +7 -0
  99. package/dist/esm/utils/createSchemaAdapter.js +13 -0
  100. package/dist/esm/utils/platform.js +2 -3
  101. package/i18n/en-GB.json +16 -0
  102. package/i18n/es-ES.json +16 -0
  103. package/i18n/fr-FR.json +16 -0
  104. package/package.json +25 -19
@@ -0,0 +1,67 @@
1
+ import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
+ import { useContext as r } from "react";
3
+ import { uyTv as u } from "@payfit/unity-themes";
4
+ import { Disclosure as c, DisclosurePanel as d, DisclosureStateContext as y, Heading as f, Button as p } from "react-aria-components";
5
+ import { FormattedMessage as m } from "react-intl";
6
+ import { Icon as h } from "../../icon/Icon.js";
7
+ import { Text as b } from "../../text/Text.js";
8
+ const n = u({
9
+ slots: {
10
+ base: [
11
+ "uy:w-full uy:rounded-50",
12
+ "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-2",
13
+ "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-solid",
14
+ "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-offset-2",
15
+ "uy:data-[focus-visible-within=true]:not-has-data-[focus-visible-within=true]:outline-utility-focus-ring"
16
+ ],
17
+ heading: "uy:w-full",
18
+ button: [
19
+ "uy:flex uy:pb-100 uy:pt-100 uy:w-full uy:cursor-pointer",
20
+ "uy:hover:text-content-neutral-hover uy:focus-visible:outline-none"
21
+ ],
22
+ title: "uy:flex uy:grow uy:text-left uy:items-center uy:justify-center",
23
+ icon: "uy:mr-100 uy:transition-transform uy:duration-150 uy:ease-linear uy:origin-center",
24
+ content: "uy:transition-all uy:transition-discrete uy:duration-200 uy:origin-top-left uy:aria-hidden:opacity-0 uy:aria-hidden:scale-y-0"
25
+ },
26
+ variants: {
27
+ isExpanded: {
28
+ true: {
29
+ icon: "uy:rotate-180"
30
+ },
31
+ false: {
32
+ icon: "uy:rotate-0"
33
+ }
34
+ }
35
+ }
36
+ }), v = () => {
37
+ const e = r(y), { button: i, title: o, icon: a, heading: l } = n({
38
+ isExpanded: e?.isExpanded
39
+ });
40
+ return /* @__PURE__ */ t(f, { "data-dd-privacy": "allow", className: l(), children: /* @__PURE__ */ t(p, { className: i(), slot: "trigger", children: /* @__PURE__ */ s(b, { variant: "bodyStrong", className: o(), children: [
41
+ /* @__PURE__ */ t(
42
+ h,
43
+ {
44
+ src: "CaretDownOutlined",
45
+ className: a(),
46
+ role: "presentation"
47
+ }
48
+ ),
49
+ /* @__PURE__ */ t(
50
+ m,
51
+ {
52
+ id: "unity:component:error-state:collapsible:title",
53
+ defaultMessage: "Show details"
54
+ }
55
+ )
56
+ ] }) }) });
57
+ }, w = ({ children: e, ...i }) => {
58
+ const { base: o, content: a } = n();
59
+ return /* @__PURE__ */ s(c, { "data-dd-privacy": "allow", ...i, className: o(), children: [
60
+ /* @__PURE__ */ t(v, {}),
61
+ /* @__PURE__ */ t(d, { "data-dd-privacy": "allow", className: a(), children: /* @__PURE__ */ t("div", { className: "uy:ml-400 uy:typography-body", children: e }) })
62
+ ] });
63
+ };
64
+ w.displayName = "Collapsible";
65
+ export {
66
+ w as Collapsible
67
+ };
@@ -1,25 +1,31 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { default as React, PropsWithChildren, Ref } from 'react';
2
+ import { StandardSchemaV1 } from '@standard-schema/spec';
2
3
  import { FormProps as AriaFormProps } from 'react-aria-components';
3
4
  import { FieldErrors, UseFormReturn } from 'react-hook-form';
4
- import { infer as ZodInfer } from 'zod';
5
5
  import { Schema, TFormValues } from '../../hooks/use-form.types.js';
6
6
  type AllowedAriaFormProps = Omit<AriaFormProps, 'action' | 'onSubmit' | 'method' | 'target' | 'validationErrors' | 'onInvalid'>;
7
- export interface FormProps<TSchema extends Schema, TForm extends TFormValues = ZodInfer<TSchema>, TActionResult = unknown> extends PropsWithChildren<AllowedAriaFormProps> {
7
+ export interface FormProps<TSchema extends Schema, TFormInputValues extends TFormValues = StandardSchemaV1.InferInput<TSchema>, TFormOutputs extends TFormValues = StandardSchemaV1.InferOutput<TSchema>, TActionResult = unknown> extends PropsWithChildren<AllowedAriaFormProps> {
8
8
  /** The form instance from react-hook-form */
9
- form: UseFormReturn<TForm>;
9
+ form: UseFormReturn<TFormInputValues, any, TFormOutputs>;
10
10
  /** The schema to validate the form data */
11
11
  schema: TSchema;
12
12
  /** The operations to execute when the form is submitted and the input data is valid */
13
- action: (values: TForm) => Promise<TActionResult> | TActionResult;
13
+ action: (values: TFormOutputs) => Promise<TActionResult> | TActionResult;
14
14
  /** Handle successful form submission (when the `action` callback resolves its promise or does not throw an error) */
15
- onSuccess?: (result: TActionResult, data: TForm) => void;
15
+ onSuccess?: (result: TActionResult, data: TFormOutputs) => void;
16
16
  /** Handle form submission errors (when the `action` callback rejects its promise or throws an error) */
17
- onError?: (error: unknown, data: TForm) => void;
17
+ onError?: (error: unknown, data: TFormOutputs) => void;
18
18
  /** Handle form validation errors (when form data is invalid) */
19
- onInvalid?: (errors: FieldErrors) => void;
19
+ onInvalid?: (errors: FieldErrors<TFormInputValues>) => void;
20
20
  /** Enable or disable `react-hook-form`'s devtools (only in development mode) */
21
21
  debug?: boolean;
22
22
  }
23
+ type FormComponent = {
24
+ <TSchema extends Schema, TFormInputValues extends TFormValues = StandardSchemaV1.InferInput<TSchema>, TFormOutputs extends TFormValues = StandardSchemaV1.InferOutput<TSchema>, TActionResult = unknown>(props: FormProps<TSchema, TFormInputValues, TFormOutputs, TActionResult> & {
25
+ ref?: Ref<HTMLFormElement>;
26
+ }): React.JSX.Element;
27
+ displayName?: string;
28
+ };
23
29
  /**
24
30
  * The `Form` component provides full state management for complex forms with validation by following a schema-based approach.
25
31
  *
@@ -31,5 +37,5 @@ export interface FormProps<TSchema extends Schema, TForm extends TFormValues = Z
31
37
  * $ yarn add zod react-hook-form
32
38
  * ```
33
39
  */
34
- declare const Form: import('react').ForwardRefExoticComponent<FormProps<Schema, TFormValues, unknown> & import('react').RefAttributes<HTMLFormElement>>;
40
+ declare const Form: FormComponent;
35
41
  export { Form };
@@ -1,54 +1,57 @@
1
- import { jsx as m, jsxs as v, Fragment as x } from "react/jsx-runtime";
2
- import { forwardRef as F, Suspense as P, lazy as j } from "react";
3
- import { FormProvider as n } from "react-hook-form";
4
- import { UnityFormProvider as u } from "./Form.context.js";
5
- const D = j(
6
- () => import("@hookform/devtools").then((e) => ({ default: e.DevTool }))
7
- ), T = F(
8
- ({
9
- form: e,
10
- schema: f,
11
- onSuccess: r,
12
- onError: i,
13
- onInvalid: l,
14
- action: p,
15
- children: a,
16
- className: d,
17
- onReset: h,
18
- debug: s = !1,
19
- ...b
20
- }, c) => {
21
- const y = e.handleSubmit(
22
- (t) => {
23
- Promise.resolve().then(() => p(t)).then((o) => {
24
- r == null || r(o, t);
25
- }).catch((o) => {
26
- i == null || i(o, t);
27
- });
28
- },
29
- (t) => {
30
- l == null || l(t);
1
+ import { jsx as e, jsxs as v, Fragment as y } from "react/jsx-runtime";
2
+ import { forwardRef as F, Suspense as b, lazy as S } from "react";
3
+ import { FormProvider as x } from "react-hook-form";
4
+ import { UnityFormProvider as P } from "./Form.context.js";
5
+ const j = S(
6
+ () => import("@hookform/devtools").then((o) => ({ default: o.DevTool }))
7
+ ), D = ({
8
+ form: o,
9
+ schema: t,
10
+ onSuccess: m,
11
+ onError: i,
12
+ onInvalid: l,
13
+ action: c,
14
+ children: s,
15
+ className: a,
16
+ onReset: d,
17
+ debug: f = !1,
18
+ ...p
19
+ }, u) => {
20
+ const h = o.handleSubmit(
21
+ (r) => {
22
+ Promise.resolve().then(() => c(r)).then((n) => {
23
+ m?.(n, r);
24
+ }).catch((n) => {
25
+ i?.(n, r);
26
+ });
27
+ },
28
+ (r) => {
29
+ l?.(r);
30
+ }
31
+ );
32
+ return /* @__PURE__ */ e(P, { schema: t, children: /* @__PURE__ */ v(x, { ...o, children: [
33
+ f && /* @__PURE__ */ e(b, { fallback: /* @__PURE__ */ e(y, {}), children: /* @__PURE__ */ e(j, { control: o.control }) }),
34
+ /* @__PURE__ */ e(
35
+ "form",
36
+ {
37
+ ...p,
38
+ ref: u,
39
+ onSubmit: (r) => {
40
+ h(r);
41
+ },
42
+ className: a,
43
+ onReset: d,
44
+ "data-dd-privacy": "mask",
45
+ children: s
31
46
  }
32
- );
33
- return /* @__PURE__ */ m(u, { schema: f, children: /* @__PURE__ */ v(n, { ...e, children: [
34
- s && /* @__PURE__ */ m(P, { fallback: /* @__PURE__ */ m(x, {}), children: /* @__PURE__ */ m(D, { control: e.control }) }),
35
- /* @__PURE__ */ m(
36
- "form",
37
- {
38
- ...b,
39
- ref: c,
40
- onSubmit: (t) => {
41
- y(t);
42
- },
43
- className: d,
44
- onReset: h,
45
- "data-dd-privacy": "mask",
46
- children: a
47
- }
48
- )
49
- ] }) });
50
- }
51
- );
47
+ )
48
+ ] }) });
49
+ }, T = F(function(t, m) {
50
+ return D(
51
+ t,
52
+ m
53
+ );
54
+ });
52
55
  T.displayName = "Form";
53
56
  export {
54
57
  T as Form
@@ -1,18 +1,19 @@
1
1
  import { jsx as p } from "react/jsx-runtime";
2
- import a, { forwardRef as H, useMemo as d } from "react";
2
+ import n, { forwardRef as H, useMemo as d } from "react";
3
3
  import { uyTv as L } from "@payfit/unity-themes";
4
- import { useController as P } from "react-hook-form";
5
- import S from "../../hooks/use-id.js";
6
- import { useUnityFormProvider as g } from "../form/Form.context.js";
7
- import { FormFieldProvider as j } from "./FormField.context.js";
8
- import { FormContextualLink as D } from "./parts/FormContextualLink.js";
9
- import { FormHelperText as E } from "./parts/FormHelperText.js";
10
- import { isFieldRequired as I } from "./utils/isFieldRequired.js";
11
- const N = L({
4
+ import { useController as S } from "react-hook-form";
5
+ import P from "../../hooks/use-id.js";
6
+ import { createSchemaAdapter as g } from "../../utils/createSchemaAdapter.js";
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({
12
13
  slots: {
13
14
  base: "uy:flex uy:flex-col uy:gap-100"
14
15
  }
15
- }), _ = H(
16
+ }), w = H(
16
17
  ({
17
18
  children: o,
18
19
  control: f,
@@ -23,19 +24,19 @@ const N = L({
23
24
  isRequired: F,
24
25
  isDisabled: h
25
26
  }, y) => {
26
- const b = S(), { schema: t } = g(), { formState: i } = P({ name: r, control: f }), C = d(
27
- () => I(t, r),
27
+ const b = P(), { schema: t } = j(), { formState: i } = S({ name: r, control: f }), C = d(
28
+ () => N(g(t), r),
28
29
  [t, r]
29
30
  ), { hasHelperText: R, hasContextualLink: T } = d(() => {
30
- let s = !1, l = !1;
31
- const m = (v) => {
32
- a.Children.forEach(v, (n) => {
33
- if (!a.isValidElement(n)) return;
34
- const e = n;
35
- e.type === E ? s = !0 : e.type === D && (l = !0), e.props && typeof e.props == "object" && "children" in e.props && m(e.props.children);
31
+ let s = !1, m = !1;
32
+ const l = (v) => {
33
+ n.Children.forEach(v, (a) => {
34
+ if (!n.isValidElement(a)) return;
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
37
  });
37
38
  };
38
- return m(o), { hasHelperText: s, hasContextualLink: l };
39
+ return l(o), { hasHelperText: s, hasContextualLink: m };
39
40
  }, [o]), k = {
40
41
  name: r,
41
42
  isLoading: u,
@@ -45,11 +46,11 @@ const N = L({
45
46
  id: b,
46
47
  isRequired: F ?? C,
47
48
  isDisabled: h ?? (i.isSubmitting || i.disabled)
48
- }, { base: q } = N();
49
- return /* @__PURE__ */ p("div", { ref: y, className: q({ className: x }), children: /* @__PURE__ */ p(j, { ...k, children: o }) });
49
+ }, { base: q } = _();
50
+ return /* @__PURE__ */ p("div", { ref: y, className: q({ className: x }), children: /* @__PURE__ */ p(D, { ...k, children: o }) });
50
51
  }
51
52
  );
52
- _.displayName = "FormField";
53
+ w.displayName = "FormField";
53
54
  export {
54
- _ as FormField
55
+ w as FormField
55
56
  };
@@ -1,8 +1,8 @@
1
- import { ZodObject, ZodRawShape } from 'zod';
1
+ import { StandardSchema } from '../../../types/schema.js';
2
2
  /**
3
- * Determines if a field is required based on its path in a Zod schema
4
- * @param schema - The Zod schema object
3
+ * Determines if a field is required based on its path in a schema
4
+ * @param schema - The schema adapter object
5
5
  * @param fieldPath - The path to the field (e.g., "preferences.marketing")
6
6
  * @returns true if the field is required, false if optional or not found
7
7
  */
8
- export declare function isFieldRequired(schema: ZodObject<ZodRawShape> | null | undefined, fieldPath: string): boolean;
8
+ export declare function isFieldRequired(schema: StandardSchema | null | undefined, fieldPath: string): boolean;
@@ -1,23 +1,8 @@
1
- import { z as f } from "zod";
2
- function p(r, s) {
3
- try {
4
- if (!r) return !1;
5
- const n = s.split(".");
6
- let a = r.shape, e;
7
- for (let t = 0; t < n.length; t++) {
8
- const l = n[t];
9
- if (e = a[l], !e) return !1;
10
- if (t < n.length - 1) {
11
- const i = e instanceof f.ZodOptional ? e._def.innerType.shape : e.shape;
12
- if (!i) return !1;
13
- a = i;
14
- }
15
- }
16
- return e ? !(e instanceof f.ZodOptional) : !1;
17
- } catch {
18
- return !1;
19
- }
1
+ function l(e, t) {
2
+ if (!e) return !1;
3
+ const i = e.getField(t);
4
+ return i ? !i.isOptional : !1;
20
5
  }
21
6
  export {
22
- p as isFieldRequired
7
+ l as isFieldRequired
23
8
  };
@@ -1,6 +1,6 @@
1
1
  import { default as React, PropsWithChildren } from 'react';
2
2
  import { VariantProps } from '@payfit/unity-themes';
3
- export declare const funnelLayout: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas", unknown, unknown, undefined>>;
3
+ export declare const funnelLayout: import('tailwind-variants').TVReturnType<{} | {} | {}, undefined, "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas uy:overflow-auto", {} | {}, undefined, import('tailwind-variants').TVReturnType<unknown, undefined, "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas uy:overflow-auto", unknown, unknown, undefined>>;
4
4
  export interface FunnelLayoutProps extends PropsWithChildren<VariantProps<typeof funnelLayout>> {
5
5
  /** The header content for the funnel layout, typically a FunnelTopBar component */
6
6
  header: React.JSX.Element;
@@ -1,128 +1,79 @@
1
- import { jsx as n, jsxs as l } from "react/jsx-runtime";
2
- import { forwardRef as d, useMemo as y } from "react";
3
- import { uyTv as f } from "@payfit/unity-themes";
4
- import { useId as c } from "react-aria";
5
- import { FormattedMessage as a } from "react-intl";
6
- import { link as p } from "../link/Link.variants.js";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import { forwardRef as s, useMemo as f } from "react";
3
+ import { uyTv as y } from "@payfit/unity-themes";
4
+ import { useId as p } from "react-aria";
5
+ import { FormattedMessage as o } from "react-intl";
6
+ import { SkipLinks as c, SkipLink as a } from "../skip-links/SkipLinks.js";
7
7
  import { FunnelLayoutProvider as m } from "./FunnelLayout.context.js";
8
- const h = f({
9
- base: "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas"
10
- }), b = d(
11
- ({ children: o, header: s, ...u }, r) => {
12
- const e = c(), { base: i } = p(), t = y(
8
+ const I = y({
9
+ base: "uy:relative uy:h-dvh uy:flex uy:flex-col uy:bg-canvas uy:overflow-auto"
10
+ }), k = s(
11
+ ({ children: u, header: l, ...r }, d) => {
12
+ const n = p(), t = f(
13
13
  () => ({
14
- mainContentId: `funnel-main-content-${e}`,
15
- topbarId: `funnel-top-bar-${e}`,
16
- asideId: `funnel-complementary-left-content-${e}`,
17
- funnelTitleId: `funnel-title-${e}`,
18
- funnelDescriptionId: `funnel-description-${e}`,
19
- funnelStatusId: `funnel-status-${e}`,
20
- footerId: `funnel-footer-${e}`
14
+ mainContentId: `funnel-main-content-${n}`,
15
+ topbarId: `funnel-top-bar-${n}`,
16
+ asideId: `funnel-complementary-left-content-${n}`,
17
+ funnelTitleId: `funnel-title-${n}`,
18
+ funnelDescriptionId: `funnel-description-${n}`,
19
+ funnelStatusId: `funnel-status-${n}`,
20
+ footerId: `funnel-footer-${n}`
21
21
  }),
22
- [e]
22
+ [n]
23
23
  );
24
- return /* @__PURE__ */ n(m, { ids: t, children: /* @__PURE__ */ l(
24
+ return /* @__PURE__ */ e(m, { ids: t, children: /* @__PURE__ */ i(
25
25
  "div",
26
26
  {
27
27
  "data-dd-privacy": "mask-user-input",
28
- ...u,
29
- ref: r,
30
- className: h(),
28
+ ...r,
29
+ ref: d,
30
+ className: I(),
31
31
  "data-unity-component": "FunnelLayout",
32
32
  children: [
33
- /* @__PURE__ */ l(
34
- "div",
35
- {
36
- className: "uy:sr-only uy:focus-within:p-200 uy:focus-within:bg-surface-neutral uy:focus-within:shadow-raising uy:focus-within:rounded-100 uy:focus-within:not-sr-only uy:focus-within:absolute uy:focus-within:top-100 uy:focus-within:left-100 uy:focus-within:z-50",
37
- role: "navigation",
38
- "aria-labelledby": `skip-links-label-${e}`,
39
- children: [
40
- /* @__PURE__ */ n("span", { id: `skip-links-label-${e}`, className: "uy:typography-h4", children: /* @__PURE__ */ n(
41
- a,
42
- {
43
- id: "unity:layout:funnel:skip-links:label",
44
- defaultMessage: "Skip to:"
45
- }
46
- ) }),
47
- /* @__PURE__ */ l("ol", { className: "uy:mt-1 uy:space-y-1 uy:list-none", children: [
48
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
49
- "a",
50
- {
51
- href: `#${t.topbarId}`,
52
- tabIndex: 0,
53
- className: i(),
54
- children: /* @__PURE__ */ n(
55
- a,
56
- {
57
- id: "unity:layout:funnel:skip-links:top-bar",
58
- defaultMessage: "Top bar"
59
- }
60
- )
61
- }
62
- ) }),
63
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
64
- "a",
65
- {
66
- href: `#${t.mainContentId}`,
67
- tabIndex: 0,
68
- className: i(),
69
- children: /* @__PURE__ */ n(
70
- a,
71
- {
72
- id: "unity:layout:funnel:skip-links:main-content",
73
- defaultMessage: "Main content"
74
- }
75
- )
76
- }
77
- ) }),
78
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
79
- "a",
80
- {
81
- href: `#${t.asideId}`,
82
- tabIndex: 0,
83
- className: i(),
84
- children: /* @__PURE__ */ n(
85
- a,
86
- {
87
- id: "unity:layout:funnel:skip-links:sidebar",
88
- defaultMessage: "Sidebar"
89
- }
90
- )
91
- }
92
- ) }),
93
- /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
94
- "a",
95
- {
96
- href: `#${t.footerId}`,
97
- tabIndex: 0,
98
- className: i(),
99
- children: /* @__PURE__ */ n(
100
- a,
101
- {
102
- id: "unity:layout:funnel:skip-links:footer",
103
- defaultMessage: "Footer"
104
- }
105
- )
106
- }
107
- ) })
108
- ] })
109
- ]
110
- }
111
- ),
112
- /* @__PURE__ */ n(
33
+ /* @__PURE__ */ i(c, { children: [
34
+ /* @__PURE__ */ e(a, { targetId: t.topbarId, children: /* @__PURE__ */ e(
35
+ o,
36
+ {
37
+ id: "unity:layout:funnel:skip-links:top-bar",
38
+ defaultMessage: "Top bar"
39
+ }
40
+ ) }),
41
+ /* @__PURE__ */ e(a, { targetId: t.mainContentId, children: /* @__PURE__ */ e(
42
+ o,
43
+ {
44
+ id: "unity:layout:funnel:skip-links:main-content",
45
+ defaultMessage: "Main content"
46
+ }
47
+ ) }),
48
+ /* @__PURE__ */ e(a, { targetId: t.asideId, children: /* @__PURE__ */ e(
49
+ o,
50
+ {
51
+ id: "unity:layout:funnel:skip-links:sidebar",
52
+ defaultMessage: "Sidebar"
53
+ }
54
+ ) }),
55
+ /* @__PURE__ */ e(a, { targetId: t.footerId, children: /* @__PURE__ */ e(
56
+ o,
57
+ {
58
+ id: "unity:layout:funnel:skip-links:footer",
59
+ defaultMessage: "Footer"
60
+ }
61
+ ) })
62
+ ] }),
63
+ /* @__PURE__ */ e(
113
64
  "div",
114
65
  {
115
66
  "data-unity-component": "FunnelTopBar",
116
67
  className: "uy:sticky uy:top-0 uy:z-10",
117
- children: s
68
+ children: l
118
69
  }
119
70
  ),
120
- /* @__PURE__ */ n(
71
+ /* @__PURE__ */ e(
121
72
  "div",
122
73
  {
123
- className: "uy:flex-1 uy:flex uy:md:block uy:overflow-auto",
74
+ className: "uy:flex-1 uy:flex uy:md:block uy:overflow-visible",
124
75
  "data-unity-slot": "funnel-layout-content-wrapper",
125
- children: o
76
+ children: u
126
77
  }
127
78
  )
128
79
  ]
@@ -130,8 +81,8 @@ const h = f({
130
81
  ) });
131
82
  }
132
83
  );
133
- b.displayName = "FunnelLayout";
84
+ k.displayName = "FunnelLayout";
134
85
  export {
135
- b as FunnelLayout,
136
- h as funnelLayout
86
+ k as FunnelLayout,
87
+ I as funnelLayout
137
88
  };
@@ -1,15 +1,15 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as d } from "react";
3
- import { uyTv as o } from "@payfit/unity-themes";
2
+ import { forwardRef as o } from "react";
3
+ import { uyTv as d } from "@payfit/unity-themes";
4
4
  import { useFunnelLayoutContext as i } from "../FunnelLayout.context.js";
5
- const t = o({
5
+ const l = d({
6
6
  base: [
7
7
  "uy:group/funnelpage uy:bg-surface-neutral uy:p-100 uy:pb-500 uy:md:shadow-raising uy:md:border-border-neutral uy:md:border uy:md:border-solid uy:md:rounded-400",
8
8
  "uy:basis-full uy:shrink-0 uy:grow-1 uy:md:shrink",
9
9
  "uy:flex uy:flex-col",
10
10
  "uy:md:max-w-container-lg uy:lg:max-w-container-xl"
11
11
  ]
12
- }), l = d(
12
+ }), t = o(
13
13
  ({ children: n, ...r }, u) => {
14
14
  const { ids: e } = i();
15
15
  return /* @__PURE__ */ a(
@@ -21,16 +21,15 @@ const t = o({
21
21
  id: e.mainContentId,
22
22
  "aria-labelledby": e.funnelTitleId,
23
23
  "aria-describedby": e.funnelDescriptionId,
24
- tabIndex: -1,
25
- className: t(),
24
+ className: l(),
26
25
  "data-unity-component": "FunnelPage",
27
26
  children: n
28
27
  }
29
28
  );
30
29
  }
31
30
  );
32
- l.displayName = "FunnelPage";
31
+ t.displayName = "FunnelPage";
33
32
  export {
34
- l as FunnelPage,
35
- t as funnelPage
33
+ t as FunnelPage,
34
+ l as funnelPage
36
35
  };