@payfit/unity-components 2.46.20 → 2.46.22

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.
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { CheckboxProps as AriaCheckboxProps } from 'react-aria-components/Checkbox';
3
- export interface CheckboxProps extends Omit<AriaCheckboxProps, 'className'> {
2
+ import { CheckboxFieldProps as AriaCheckboxFieldProps } from 'react-aria-components/Checkbox';
3
+ export interface CheckboxProps extends Omit<AriaCheckboxFieldProps, 'className'> {
4
4
  /**
5
5
  * The content to display as the checkbox label.
6
6
  * This is required for accessibility.
@@ -1,17 +1,17 @@
1
- import { jsxs as r, jsx as e, Fragment as B } from "react/jsx-runtime";
1
+ import { jsxs as r, jsx as a, Fragment as B } from "react/jsx-runtime";
2
2
  import { forwardRef as R, isValidElement as h, cloneElement as f } from "react";
3
- import { Checkbox as D } from "react-aria-components/Checkbox";
4
- import { useId as E } from "react-aria/useId";
3
+ import { CheckboxField as D, CheckboxButton as E } from "react-aria-components/Checkbox";
4
+ import { useId as F } from "react-aria/useId";
5
5
  import { Text as N } from "../text/Text.js";
6
6
  import { checkbox as V } from "./Checkbox.variants.js";
7
- import { CheckboxIndicator as F } from "./parts/CheckboxIndicator.js";
8
- const L = R(
9
- ({ children: v, helperText: i, feedbackText: l, ...o }, u) => {
10
- const a = E(), {
11
- isDisabled: t,
12
- isReadOnly: d,
13
- isInvalid: s,
14
- isRequired: n,
7
+ import { CheckboxIndicator as L } from "./parts/CheckboxIndicator.js";
8
+ const O = R(
9
+ ({ children: u, helperText: i, feedbackText: l, ...o }, v) => {
10
+ const e = F(), {
11
+ isDisabled: s,
12
+ isReadOnly: n,
13
+ isInvalid: t,
14
+ isRequired: d,
15
15
  requiredVariant: c = "required",
16
16
  ...x
17
17
  } = o, {
@@ -24,83 +24,82 @@ const L = R(
24
24
  helperText: m,
25
25
  feedbackText: b
26
26
  } = V({
27
- isDisabled: t,
28
- isReadOnly: d,
29
- isInvalid: s
30
- }), p = [o["aria-labelledby"], `${a}-label`].filter(Boolean), y = [
27
+ isDisabled: s,
28
+ isReadOnly: n,
29
+ isInvalid: t
30
+ }), y = [o["aria-labelledby"], `${e}-label`].filter(Boolean), p = [
31
31
  o["aria-describedby"],
32
- typeof i == "string" ? `${a}-helper-text` : void 0,
33
- typeof l == "string" ? `${a}-feedback-text` : void 0
34
- ].filter(Boolean), I = p.length > 0 ? p.join(" ") : void 0, S = y.length > 0 ? y.join(" ") : void 0;
32
+ typeof i == "string" ? `${e}-helper-text` : void 0,
33
+ typeof l == "string" ? `${e}-feedback-text` : void 0
34
+ ].filter(Boolean), I = y.length > 0 ? y.join(" ") : void 0, S = p.length > 0 ? p.join(" ") : void 0;
35
35
  return /* @__PURE__ */ r("div", { className: g(), children: [
36
- /* @__PURE__ */ e(
36
+ /* @__PURE__ */ a(
37
37
  D,
38
38
  {
39
39
  ...x,
40
- isInvalid: s,
41
- ref: u,
42
- className: $(),
40
+ isInvalid: t,
41
+ className: "uy:contents",
43
42
  "aria-labelledby": I,
44
43
  "aria-describedby": S,
45
- isDisabled: t,
46
- isReadOnly: d,
47
- children: (j) => /* @__PURE__ */ r(B, { children: [
48
- /* @__PURE__ */ e(
49
- F,
44
+ isDisabled: s,
45
+ isReadOnly: n,
46
+ children: /* @__PURE__ */ a(E, { ref: v, className: $(), children: (j) => /* @__PURE__ */ r(B, { children: [
47
+ /* @__PURE__ */ a(
48
+ L,
50
49
  {
51
50
  ...j,
52
51
  className: "uy:mt-25 uy:ml-0"
53
52
  }
54
53
  ),
55
- /* @__PURE__ */ e(
54
+ /* @__PURE__ */ a(
56
55
  "span",
57
56
  {
58
- id: `${a}-label`,
57
+ id: `${e}-label`,
59
58
  className: k(),
60
59
  "data-dd-privacy": "allow",
61
- children: v
60
+ children: u
62
61
  }
63
62
  ),
64
- c === "required" && n && /* @__PURE__ */ r("span", { className: C(), children: [
63
+ c === "required" && d && /* @__PURE__ */ r("span", { className: C(), children: [
65
64
  "*",
66
- /* @__PURE__ */ e("span", { className: "uy:sr-only", children: "required" })
65
+ /* @__PURE__ */ a("span", { className: "uy:sr-only", children: "required" })
67
66
  ] }),
68
- c === "optional" && !n && /* @__PURE__ */ e("span", { className: q(), children: "(optional)" })
69
- ] })
67
+ c === "optional" && !d && /* @__PURE__ */ a("span", { className: q(), children: "(optional)" })
68
+ ] }) })
70
69
  }
71
70
  ),
72
71
  (i || l) && /* @__PURE__ */ r("div", { className: w(), "data-dd-privacy": "allow", children: [
73
- typeof i == "string" ? /* @__PURE__ */ e(
72
+ typeof i == "string" ? /* @__PURE__ */ a(
74
73
  N,
75
74
  {
76
75
  variant: "bodySmall",
77
76
  color: "content.neutral.low",
78
- id: `${a}-helper-text`,
77
+ id: `${e}-helper-text`,
79
78
  className: m(),
80
79
  children: i
81
80
  }
82
81
  ) : h(i) && f(i, {
83
- "data-id": `${a}-helper-text`,
82
+ "data-id": `${e}-helper-text`,
84
83
  className: m()
85
84
  }),
86
- s && (typeof l == "string" ? /* @__PURE__ */ e(
85
+ t && (typeof l == "string" ? /* @__PURE__ */ a(
87
86
  N,
88
87
  {
89
88
  variant: "bodySmallStrong",
90
89
  color: "content.form.invalid",
91
- id: `${a}-feedback-text`,
90
+ id: `${e}-feedback-text`,
92
91
  className: b(),
93
92
  children: l
94
93
  }
95
94
  ) : h(l) && f(l, {
96
- "data-id": `${a}-feedback-text`,
95
+ "data-id": `${e}-feedback-text`,
97
96
  className: b()
98
97
  }))
99
98
  ] })
100
99
  ] });
101
100
  }
102
101
  );
103
- L.displayName = "Checkbox";
102
+ O.displayName = "Checkbox";
104
103
  export {
105
- L as Checkbox
104
+ O as Checkbox
106
105
  };
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { CheckboxProps as AriaCheckboxProps } from 'react-aria-components/Checkbox';
3
- export interface CheckboxStandaloneProps extends AriaCheckboxProps {
2
+ import { CheckboxFieldProps as AriaCheckboxFieldProps } from 'react-aria-components/Checkbox';
3
+ export interface CheckboxStandaloneProps extends AriaCheckboxFieldProps {
4
4
  /**
5
5
  * The content to display as the checkbox label.
6
6
  * This is required for accessibility.
@@ -1,30 +1,29 @@
1
- import { jsx as e, jsxs as f, Fragment as h } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as h, Fragment as f } from "react/jsx-runtime";
2
2
  import { forwardRef as x } from "react";
3
- import { Checkbox as p } from "react-aria-components/Checkbox";
4
- import { useId as y } from "react-aria/useId";
5
- import { checkbox as k } from "./Checkbox.variants.js";
3
+ import { CheckboxField as y, CheckboxButton as p } from "react-aria-components/Checkbox";
4
+ import { useId as k } from "react-aria/useId";
5
+ import { checkbox as u } from "./Checkbox.variants.js";
6
6
  import { CheckboxIndicator as C } from "./parts/CheckboxIndicator.js";
7
- const I = x(({ children: r, ...a }, i) => {
8
- const o = y(), { isDisabled: n, isReadOnly: s, isInvalid: d } = a, { base: t, wrapper: c } = k({
7
+ const N = x(({ children: r, ...a }, i) => {
8
+ const o = k(), { isDisabled: n, isReadOnly: s, isInvalid: t } = a, { base: c, wrapper: d } = u({
9
9
  isDisabled: n,
10
10
  isReadOnly: s,
11
- isInvalid: d
11
+ isInvalid: t
12
12
  }), l = [a["aria-labelledby"], `${o}-label`].filter(Boolean), m = l.length > 0 ? l.join(" ") : void 0;
13
- return /* @__PURE__ */ e("div", { className: t(), children: /* @__PURE__ */ e(
14
- p,
13
+ return /* @__PURE__ */ e("div", { className: c(), children: /* @__PURE__ */ e(
14
+ y,
15
15
  {
16
16
  ...a,
17
- ref: i,
18
- className: c(),
17
+ className: "uy:contents",
19
18
  "aria-labelledby": m,
20
- children: (b) => /* @__PURE__ */ f(h, { children: [
19
+ children: /* @__PURE__ */ e(p, { ref: i, className: d(), children: (b) => /* @__PURE__ */ h(f, { children: [
21
20
  /* @__PURE__ */ e(C, { ...b }),
22
21
  /* @__PURE__ */ e("span", { id: `${o}-label`, className: "uy:sr-only", children: r })
23
- ] })
22
+ ] }) })
24
23
  }
25
24
  ) });
26
25
  });
27
- I.displayName = "CheckboxStandalone";
26
+ N.displayName = "CheckboxStandalone";
28
27
  export {
29
- I as CheckboxStandalone
28
+ N as CheckboxStandalone
30
29
  };
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from '@payfit/unity-themes';
2
2
  import { ReactNode } from 'react';
3
- import { RadioProps } from 'react-aria-components/RadioGroup';
3
+ import { RadioFieldProps } from 'react-aria-components/RadioGroup';
4
4
  export { RadioIndicator } from './RadioIndicator.js';
5
5
  export type { RadioIndicatorProps, RadioState } from './RadioIndicator.js';
6
6
  export declare const radioButton: import('tailwind-variants').TVReturnType<{
@@ -64,7 +64,7 @@ export declare const radioButton: import('tailwind-variants').TVReturnType<{
64
64
  * @see {@link RadioButtonGroup} for the parent component
65
65
  */
66
66
  declare const RadioButton: import('react').ForwardRefExoticComponent<RadioButtonProps & import('react').RefAttributes<HTMLLabelElement>>;
67
- export interface RadioButtonProps extends Omit<RadioProps, 'children'>, VariantProps<typeof radioButton> {
67
+ export interface RadioButtonProps extends Omit<RadioFieldProps, 'children'>, VariantProps<typeof radioButton> {
68
68
  /**
69
69
  * The content to display as the radio button's label.
70
70
  */
@@ -1,12 +1,12 @@
1
- import { jsxs as a, jsx as t, Fragment as f } from "react/jsx-runtime";
2
- import { forwardRef as x, useContext as g } from "react";
3
- import { uyTv as h, useUnityTheme as R } from "@payfit/unity-themes";
4
- import { RadioGroupStateContext as w, Radio as N } from "react-aria-components/RadioGroup";
5
- import { Flex as v } from "../../flex/Flex.js";
6
- import { Text as B } from "../../text/Text.js";
1
+ import { jsxs as a, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as f, useContext as x } from "react";
3
+ import { uyTv as g, useUnityTheme as h } from "@payfit/unity-themes";
4
+ import { RadioGroupStateContext as R, RadioField as w, RadioButton as B } from "react-aria-components/RadioGroup";
5
+ import { Flex as N } from "../../flex/Flex.js";
6
+ import { Text as v } from "../../text/Text.js";
7
7
  import { RadioButtonHelper as S } from "./RadioButtonHelper.js";
8
8
  import { RadioIndicator as j } from "./RadioIndicator.js";
9
- const C = h({
9
+ const C = g({
10
10
  slots: {
11
11
  container: [
12
12
  "uy:group uy:inline-flex uy:flex-col uy:gap-50",
@@ -29,29 +29,28 @@ const C = h({
29
29
  "uy:group-data-[readonly=true]:text-content-neutral uy:group-data-[readonly]:cursor-text"
30
30
  ]
31
31
  }
32
- }), F = x(
33
- ({ children: u, value: d, isDisabled: o, helperText: r, ...n }, i) => {
34
- const { base: l, label: s, container: y, radio: m } = C(), e = g(w), { theme: c } = R(), p = e?.isReadOnly ? "readonly" : e?.isDisabled || o ? "disabled" : e?.isInvalid ? "invalid" : "enabled";
35
- return /* @__PURE__ */ a(v, { direction: "col", gap: "50", className: y(), children: [
32
+ }), F = f(
33
+ ({ children: u, value: d, isDisabled: e, helperText: r, ...n }, i) => {
34
+ const { base: l, label: s, container: y, radio: c } = C(), o = x(R), { theme: m } = h(), p = o?.isReadOnly ? "readonly" : o?.isDisabled || e ? "disabled" : o?.isInvalid ? "invalid" : "enabled";
35
+ return /* @__PURE__ */ a(N, { direction: "col", gap: "50", className: y(), children: [
36
36
  /* @__PURE__ */ t(
37
- N,
37
+ w,
38
38
  {
39
39
  ...n,
40
40
  value: d,
41
- isDisabled: o,
42
- className: () => l(),
43
- ref: i,
44
- children: ({ isSelected: b }) => /* @__PURE__ */ a(f, { children: [
41
+ isDisabled: e,
42
+ className: "uy:contents",
43
+ children: ({ isSelected: b }) => /* @__PURE__ */ a(B, { ref: i, className: () => l(), children: [
45
44
  /* @__PURE__ */ t(
46
45
  j,
47
46
  {
48
47
  isSelected: b,
49
48
  state: p,
50
- theme: c,
51
- className: m()
49
+ theme: m,
50
+ className: c()
52
51
  }
53
52
  ),
54
- /* @__PURE__ */ t(B, { variant: "body", className: s(), children: u })
53
+ /* @__PURE__ */ t(v, { variant: "body", className: s(), children: u })
55
54
  ] })
56
55
  }
57
56
  ),
@@ -1,8 +1,8 @@
1
1
  import { VariantProps } from '@payfit/unity-themes';
2
2
  import { ReactNode } from 'react';
3
- import { CheckboxProps as AriaCheckboxProps } from 'react-aria-components/Checkbox';
3
+ import { CheckboxFieldProps as AriaCheckboxFieldProps } from 'react-aria-components/Checkbox';
4
4
  import { selectableCard } from '../../selectableCard.variant.js';
5
- export interface SelectableCardCheckboxProps extends Omit<AriaCheckboxProps, 'children'>, VariantProps<typeof selectableCard> {
5
+ export interface SelectableCardCheckboxProps extends Omit<AriaCheckboxFieldProps, 'children'>, VariantProps<typeof selectableCard> {
6
6
  /**
7
7
  * The title of the selectable card.
8
8
  */
@@ -1,34 +1,39 @@
1
1
  import { jsx as r, jsxs as m, Fragment as d } from "react/jsx-runtime";
2
- import { forwardRef as f } from "react";
3
- import { Checkbox as p } from "react-aria-components/Checkbox";
4
- import { useId as s } from "react-aria/useId";
5
- import { CheckboxIndicator as h } from "../../../checkbox/parts/CheckboxIndicator.js";
6
- import { Text as b } from "../../../text/Text.js";
7
- import { Content as x } from "../../internals/Content.js";
8
- import { Description as C } from "../../internals/Description.js";
2
+ import { forwardRef as s } from "react";
3
+ import { CheckboxField as h, CheckboxButton as f } from "react-aria-components/Checkbox";
4
+ import { useId as p } from "react-aria/useId";
5
+ import { CheckboxIndicator as b } from "../../../checkbox/parts/CheckboxIndicator.js";
6
+ import { Text as x } from "../../../text/Text.js";
7
+ import { Content as C } from "../../internals/Content.js";
8
+ import { Description as u } from "../../internals/Description.js";
9
9
  import { Illustration as k } from "../../internals/Illustration.js";
10
- import { SelectedIndicator as I } from "../../internals/SelectedIndicator.js";
11
- import { selectableCard as S } from "../../selectableCard.variant.js";
12
- const g = f(({ title: i, description: o, illustration: t, ...c }, a) => {
13
- const { base: l } = S(), n = s();
14
- return /* @__PURE__ */ r(
15
- p,
10
+ import { SelectedIndicator as g } from "../../internals/SelectedIndicator.js";
11
+ import { selectableCard as y } from "../../selectableCard.variant.js";
12
+ const I = s(({ title: c, description: o, illustration: t, ...i }, a) => {
13
+ const { base: l } = y(), n = p();
14
+ return /* @__PURE__ */ r(h, { className: "uy:contents", ...i, children: /* @__PURE__ */ r(
15
+ f,
16
16
  {
17
- ref: a,
18
17
  className: ({ isFocusVisible: e }) => l({ isFocusVisible: e }),
19
- ...c,
18
+ ref: a,
20
19
  children: (e) => /* @__PURE__ */ m(d, { children: [
21
- /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(h, { ...e }) }),
22
- /* @__PURE__ */ m(x, { children: [
20
+ /* @__PURE__ */ r(g, { children: /* @__PURE__ */ r(
21
+ b,
22
+ {
23
+ className: "uy:group-hover:border-border-form-hover",
24
+ ...e
25
+ }
26
+ ) }),
27
+ /* @__PURE__ */ m(C, { children: [
23
28
  t && /* @__PURE__ */ r(k, { children: t }),
24
- /* @__PURE__ */ r(b, { variant: "bodyLargeStrong", asElement: "h3", id: `${n}-label`, children: i }),
25
- o && /* @__PURE__ */ r(C, { children: o })
29
+ /* @__PURE__ */ r(x, { variant: "bodyLargeStrong", asElement: "h3", id: `${n}-label`, children: c }),
30
+ o && /* @__PURE__ */ r(u, { children: o })
26
31
  ] })
27
32
  ] })
28
33
  }
29
- );
34
+ ) });
30
35
  });
31
- g.displayName = "SelectableCardCheckbox";
36
+ I.displayName = "SelectableCardCheckbox";
32
37
  export {
33
- g as SelectableCardCheckbox
38
+ I as SelectableCardCheckbox
34
39
  };
@@ -1,8 +1,8 @@
1
1
  import { VariantProps } from '@payfit/unity-themes';
2
2
  import { PropsWithChildren, ReactNode } from 'react';
3
- import { RadioProps } from 'react-aria-components/RadioGroup';
3
+ import { RadioFieldProps } from 'react-aria-components/RadioGroup';
4
4
  import { selectableCard } from '../../selectableCard.variant.js';
5
- export interface SelectableCardRadioProps extends Omit<RadioProps, 'children'>, PropsWithChildren<VariantProps<typeof selectableCard>> {
5
+ export interface SelectableCardRadioProps extends Omit<RadioFieldProps, 'children'>, PropsWithChildren<VariantProps<typeof selectableCard>> {
6
6
  /**
7
7
  * The title of the selectable card.
8
8
  */
@@ -1,44 +1,44 @@
1
- import { jsx as e, jsxs as n, Fragment as b } from "react/jsx-runtime";
2
- import { useId as h, useContext as S } from "react";
3
- import { useUnityTheme as u } from "@payfit/unity-themes";
4
- import { RadioGroupStateContext as x, Radio as y } from "react-aria-components/RadioGroup";
1
+ import { jsx as e, jsxs as n, Fragment as h } from "react/jsx-runtime";
2
+ import { useId as b, useContext as u } from "react";
3
+ import { useUnityTheme as y } from "@payfit/unity-themes";
4
+ import { RadioGroupStateContext as R, RadioField as S, RadioButton as x } from "react-aria-components/RadioGroup";
5
5
  import { RadioIndicator as C } from "../../../radio-button-group/parts/RadioIndicator.js";
6
6
  import { Text as I } from "../../../text/Text.js";
7
- import { Content as R } from "../../internals/Content.js";
8
- import { Description as g } from "../../internals/Description.js";
9
- import { Illustration as v } from "../../internals/Illustration.js";
7
+ import { Content as g } from "../../internals/Content.js";
8
+ import { Description as v } from "../../internals/Description.js";
9
+ import { Illustration as N } from "../../internals/Illustration.js";
10
10
  import { SelectedIndicator as j } from "../../internals/SelectedIndicator.js";
11
- import { selectableCard as N } from "../../selectableCard.variant.js";
11
+ import { selectableCard as F } from "../../selectableCard.variant.js";
12
12
  const T = ({
13
13
  title: l,
14
- description: o,
14
+ description: r,
15
15
  illustration: a,
16
16
  isDisabled: i,
17
17
  ...m
18
18
  }) => {
19
- const s = h(), { theme: c } = u(), { base: p } = N(), t = S(x), f = t?.isReadOnly ? "readonly" : t?.isDisabled || i ? "disabled" : t?.isInvalid ? "invalid" : "enabled", d = `selectable-card-radio-${s}__title`;
19
+ const s = b(), { theme: c } = y(), { base: p } = F(), t = u(R), f = t?.isReadOnly ? "readonly" : t?.isDisabled || i ? "disabled" : t?.isInvalid ? "invalid" : "enabled", d = `selectable-card-radio-${s}__title`;
20
20
  return /* @__PURE__ */ e(
21
- y,
21
+ S,
22
22
  {
23
- className: ({ isFocusVisible: r }) => p({ isFocusVisible: r }),
24
23
  "aria-labelledby": d,
25
24
  isDisabled: i,
25
+ className: "uy:contents",
26
26
  ...m,
27
- children: ({ isSelected: r }) => /* @__PURE__ */ n(b, { children: [
27
+ children: /* @__PURE__ */ e(x, { className: ({ isFocusVisible: o }) => p({ isFocusVisible: o }), children: ({ isSelected: o }) => /* @__PURE__ */ n(h, { children: [
28
28
  /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
29
29
  C,
30
30
  {
31
- isSelected: r,
31
+ isSelected: o,
32
32
  state: f,
33
33
  theme: c
34
34
  }
35
35
  ) }),
36
- /* @__PURE__ */ n(R, { children: [
37
- a && /* @__PURE__ */ e(v, { children: a }),
36
+ /* @__PURE__ */ n(g, { children: [
37
+ a && /* @__PURE__ */ e(N, { children: a }),
38
38
  /* @__PURE__ */ e(I, { asElement: "h3", variant: "bodyLargeStrong", id: d, children: l }),
39
- o && /* @__PURE__ */ e(g, { children: o })
39
+ r && /* @__PURE__ */ e(v, { children: r })
40
40
  ] })
41
- ] })
41
+ ] }) })
42
42
  }
43
43
  );
44
44
  };
@@ -1,5 +1,5 @@
1
1
  import { VariantProps } from '@payfit/unity-themes';
2
- import { SwitchProps as AriaSwitchProps } from 'react-aria-components/Switch';
2
+ import { SwitchFieldProps as AriaSwitchFieldProps } from 'react-aria-components/Switch';
3
3
  export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
4
4
  isDisabled: {
5
5
  false: {
@@ -58,7 +58,7 @@ export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
58
58
  indicator: string[];
59
59
  knob: string[];
60
60
  }, undefined, unknown, unknown, undefined>>;
61
- export interface ToggleSwitchProps extends Omit<AriaSwitchProps, 'children' | 'className' | 'style'>, VariantProps<typeof toggleSwitch> {
61
+ export interface ToggleSwitchProps extends Omit<AriaSwitchFieldProps, 'children' | 'className' | 'style'>, VariantProps<typeof toggleSwitch> {
62
62
  /** The label for the toggle switch. */
63
63
  label: string;
64
64
  /** Whether the label is visually hidden and accessible only to screen readers. */
@@ -1,9 +1,9 @@
1
1
  import { jsx as e, jsxs as a } from "react/jsx-runtime";
2
- import { forwardRef as h } from "react";
3
- import { uyTv as v } from "@payfit/unity-themes";
4
- import { Switch as m } from "react-aria-components/Switch";
5
- import { useBreakpointListener as w } from "../../hooks/use-breakpoint-listener.js";
6
- const x = v({
2
+ import { forwardRef as v } from "react";
3
+ import { uyTv as w } from "@payfit/unity-themes";
4
+ import { SwitchField as m, SwitchButton as b } from "react-aria-components/Switch";
5
+ import { useBreakpointListener as N } from "../../hooks/use-breakpoint-listener.js";
6
+ const x = w({
7
7
  slots: {
8
8
  container: ["uy:flex uy:flex-col uy:sm:flex-row uy:gap-100 uy:group"],
9
9
  mobileContainer: [
@@ -55,76 +55,58 @@ const x = v({
55
55
  }
56
56
  }
57
57
  }
58
- }), N = h(
58
+ }), k = v(
59
59
  ({
60
- label: u,
60
+ label: s,
61
61
  helperText: r,
62
- isLabelSrOnly: o = !1,
62
+ isLabelSrOnly: u = !1,
63
63
  isDisabled: d,
64
- ...b
65
- }, s) => {
64
+ ...g
65
+ }, o) => {
66
66
  const {
67
67
  container: t,
68
- indicator: i,
69
- knob: l,
68
+ indicator: l,
69
+ knob: i,
70
70
  textWrapper: y,
71
71
  label: c,
72
- hintText: p,
73
- mobileContainer: g
74
- } = x({ isDisabled: d }), f = w() === "xs", n = { ...b, role: "switch" };
75
- return f ? /* @__PURE__ */ e(
76
- m,
77
- {
78
- ...n,
79
- ref: s,
80
- className: t(),
81
- isDisabled: d,
82
- children: /* @__PURE__ */ a("div", { className: g(), children: [
83
- /* @__PURE__ */ a(
84
- "div",
85
- {
86
- className: y({
87
- className: o ? "uy:sr-only" : ""
88
- }),
89
- "data-dd-privacy": "allow",
90
- children: [
91
- /* @__PURE__ */ e("span", { className: c(), children: u }),
92
- r && /* @__PURE__ */ e("span", { className: p(), children: r })
93
- ]
94
- }
95
- ),
96
- /* @__PURE__ */ e("div", { className: i(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: l() }) })
97
- ] })
98
- }
99
- ) : /* @__PURE__ */ a(
100
- m,
101
- {
102
- ...n,
103
- ref: s,
104
- className: t(),
105
- isDisabled: d,
106
- children: [
107
- /* @__PURE__ */ e("div", { className: i(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: l() }) }),
108
- /* @__PURE__ */ a(
109
- "div",
110
- {
111
- className: y({
112
- className: o ? "uy:sr-only" : ""
113
- }),
114
- "data-dd-privacy": "allow",
115
- children: [
116
- /* @__PURE__ */ e("span", { className: c(), children: u }),
117
- r && /* @__PURE__ */ e("span", { className: p(), children: r })
118
- ]
119
- }
120
- )
121
- ]
122
- }
123
- );
72
+ hintText: n,
73
+ mobileContainer: f
74
+ } = x({ isDisabled: d }), h = N() === "xs", p = { ...g, role: "switch" };
75
+ return h ? /* @__PURE__ */ e(m, { ...p, className: "uy:contents", isDisabled: d, children: /* @__PURE__ */ e(b, { ref: o, className: t(), children: /* @__PURE__ */ a("div", { className: f(), children: [
76
+ /* @__PURE__ */ a(
77
+ "div",
78
+ {
79
+ className: y({
80
+ className: u ? "uy:sr-only" : ""
81
+ }),
82
+ "data-dd-privacy": "allow",
83
+ children: [
84
+ /* @__PURE__ */ e("span", { className: c(), children: s }),
85
+ r && /* @__PURE__ */ e("span", { className: n(), children: r })
86
+ ]
87
+ }
88
+ ),
89
+ /* @__PURE__ */ e("div", { className: l(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: i() }) })
90
+ ] }) }) }) : /* @__PURE__ */ e(m, { ...p, className: "uy:contents", isDisabled: d, children: /* @__PURE__ */ a(b, { className: t(), ref: o, children: [
91
+ /* @__PURE__ */ e("div", { className: l(), "data-dd-privacy": "mask", children: /* @__PURE__ */ e("div", { className: i() }) }),
92
+ /* @__PURE__ */ a(
93
+ "div",
94
+ {
95
+ className: y({
96
+ className: u ? "uy:sr-only" : ""
97
+ }),
98
+ "data-dd-privacy": "allow",
99
+ children: [
100
+ /* @__PURE__ */ e("span", { className: c(), children: s }),
101
+ r && /* @__PURE__ */ e("span", { className: n(), children: r })
102
+ ]
103
+ }
104
+ )
105
+ ] }) });
124
106
  }
125
107
  );
126
- N.displayName = "ToggleSwitch";
108
+ k.displayName = "ToggleSwitch";
127
109
  export {
128
- N as ToggleSwitch,
110
+ k as ToggleSwitch,
129
111
  x as toggleSwitch
130
112
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payfit/unity-components",
3
- "version": "2.46.20",
3
+ "version": "2.46.22",
4
4
  "module": "./dist/esm/index.js",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -62,11 +62,11 @@
62
62
  "@formatjs/intl": "4.1.12",
63
63
  "@hookform/devtools": "4.4.0",
64
64
  "@hookform/resolvers": "5.2.1",
65
- "@internationalized/date": "3.12.1",
65
+ "@internationalized/date": "3.12.2",
66
66
  "@radix-ui/react-avatar": "1.1.11",
67
67
  "@radix-ui/react-slot": "1.2.4",
68
- "@react-aria/interactions": "3.28.0",
69
- "@react-aria/utils": "3.34.0",
68
+ "@react-aria/interactions": "3.28.1",
69
+ "@react-aria/utils": "3.34.1",
70
70
  "@react-types/shared": "3.26.0",
71
71
  "@standard-schema/spec": "1.1.0",
72
72
  "@tanstack/form-core": "1.33.0",
@@ -79,20 +79,20 @@
79
79
  "embla-carousel-react": "9.0.0-rc02",
80
80
  "prettier": "3.8.3",
81
81
  "react": "18.3.1",
82
- "react-aria": "3.48.0",
83
- "react-aria-components": "1.17.0",
82
+ "react-aria": "3.49.0",
83
+ "react-aria-components": "1.18.0",
84
84
  "react-dom": "18.3.1",
85
85
  "react-hook-form": "7.62.0",
86
86
  "react-hot-toast": "2.5.1",
87
87
  "react-hotkeys-hook": "5.1.0",
88
88
  "react-international-phone": "4.5.0",
89
89
  "react-intl": "7.1.14",
90
- "react-stately": "3.46.0",
90
+ "react-stately": "3.47.0",
91
91
  "storybook": "10.4.1",
92
92
  "tailwind-variants": "3.2.2",
93
93
  "usehooks-ts": "3.1.1",
94
94
  "zod": "4.4.3",
95
- "@payfit/unity-illustrations": "2.46.20"
95
+ "@payfit/unity-illustrations": "2.46.22"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@hookform/devtools": "^4",
@@ -104,14 +104,14 @@
104
104
  "react-hook-form": "^7",
105
105
  "react-router-dom": "^5",
106
106
  "zod": "^3 || ^4",
107
- "@payfit/unity-icons": "2.46.20",
108
- "@payfit/unity-themes": "2.46.20"
107
+ "@payfit/unity-icons": "2.46.22",
108
+ "@payfit/unity-themes": "2.46.22"
109
109
  },
110
110
  "devDependencies": {
111
111
  "@figma/code-connect": "1.4.3",
112
112
  "@github-ui/storybook-addon-performance-panel": "1.1.4",
113
113
  "@hookform/devtools": "4.4.0",
114
- "@internationalized/date": "3.12.1",
114
+ "@internationalized/date": "3.12.2",
115
115
  "@storybook/addon-a11y": "10.4.1",
116
116
  "@storybook/addon-designs": "11.1.3",
117
117
  "@storybook/addon-docs": "10.4.1",
@@ -123,7 +123,7 @@
123
123
  "@tanstack/intent": "0.0.40",
124
124
  "@tanstack/react-devtools": "0.10.5",
125
125
  "@tanstack/react-form-devtools": "0.2.29",
126
- "@tanstack/react-query": "5.100.14",
126
+ "@tanstack/react-query": "5.101.0",
127
127
  "@tanstack/react-router": "1.170.10",
128
128
  "@tanstack/react-router-devtools": "1.167.0",
129
129
  "@testing-library/dom": "10.4.0",
@@ -154,9 +154,9 @@
154
154
  "@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
155
155
  "@payfit/storybook-addon-console-errors": "0.0.0-use.local",
156
156
  "@payfit/storybook-config": "0.0.0-use.local",
157
- "@payfit/unity-icons": "2.46.20",
158
- "@payfit/unity-illustrations": "2.46.20",
159
- "@payfit/unity-themes": "2.46.20",
157
+ "@payfit/unity-icons": "2.46.22",
158
+ "@payfit/unity-illustrations": "2.46.22",
159
+ "@payfit/unity-themes": "2.46.22",
160
160
  "@payfit/vite-configs": "0.0.0-use.local"
161
161
  },
162
162
  "peerDependenciesMeta": {