@payfit/unity-components 2.29.12 → 2.31.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.
|
@@ -3,8 +3,8 @@ import { SwitchProps as AriaSwitchProps } from 'react-aria-components/Switch';
|
|
|
3
3
|
export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
|
|
4
4
|
isDisabled: {
|
|
5
5
|
false: {
|
|
6
|
-
indicator: string;
|
|
7
|
-
knob: string;
|
|
6
|
+
indicator: string[];
|
|
7
|
+
knob: string[];
|
|
8
8
|
};
|
|
9
9
|
true: {
|
|
10
10
|
indicator: string;
|
|
@@ -22,8 +22,8 @@ export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
|
|
|
22
22
|
}, undefined, {
|
|
23
23
|
isDisabled: {
|
|
24
24
|
false: {
|
|
25
|
-
indicator: string;
|
|
26
|
-
knob: string;
|
|
25
|
+
indicator: string[];
|
|
26
|
+
knob: string[];
|
|
27
27
|
};
|
|
28
28
|
true: {
|
|
29
29
|
indicator: string;
|
|
@@ -41,8 +41,8 @@ export declare const toggleSwitch: import('tailwind-variants').TVReturnType<{
|
|
|
41
41
|
}, import('tailwind-variants').TVReturnType<{
|
|
42
42
|
isDisabled: {
|
|
43
43
|
false: {
|
|
44
|
-
indicator: string;
|
|
45
|
-
knob: string;
|
|
44
|
+
indicator: string[];
|
|
45
|
+
knob: string[];
|
|
46
46
|
};
|
|
47
47
|
true: {
|
|
48
48
|
indicator: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as h } from "react";
|
|
3
3
|
import { uyTv as v } from "@payfit/unity-themes";
|
|
4
|
-
import { Switch as
|
|
4
|
+
import { Switch as m } from "react-aria-components/Switch";
|
|
5
5
|
import { useBreakpointListener as w } from "../../hooks/use-breakpoint-listener.js";
|
|
6
6
|
const x = v({
|
|
7
7
|
slots: {
|
|
@@ -35,8 +35,19 @@ const x = v({
|
|
|
35
35
|
variants: {
|
|
36
36
|
isDisabled: {
|
|
37
37
|
false: {
|
|
38
|
-
indicator:
|
|
39
|
-
|
|
38
|
+
indicator: [
|
|
39
|
+
'uy:theme-legacy:group-data-[selected="true"]:bg-surface-form-active uy:theme-legacy:group-data-[selected="true"]:border-border-form-active',
|
|
40
|
+
'uy:theme-rebrand:group-data-[selected="true"]:bg-surface-form-active uy:theme-rebrand:group-data-[selected="true"]:border-surface-form-active',
|
|
41
|
+
'uy:theme-legacy:group-data-[selected="true"]:group-data-[pressed]:bg-surface-form-active',
|
|
42
|
+
'uy:theme-legacy:group-data-[selected="true"]:group-data-[pressed]:border-border-form-active',
|
|
43
|
+
'uy:theme-rebrand:group-data-[selected="true"]:group-data-[pressed]:bg-surface-primary-active',
|
|
44
|
+
'uy:theme-rebrand:group-data-[selected="true"]:group-data-[pressed]:border-border-primary-active'
|
|
45
|
+
],
|
|
46
|
+
knob: [
|
|
47
|
+
"uy:theme-legacy:group-data-[selected=true]:border-border-inverted-enabled uy:theme-rebrand:group-data-[selected=true]:border-transparent",
|
|
48
|
+
"uy:group-data-[selected=true]:group-data-[pressed]:bg-surface-form-pressed",
|
|
49
|
+
"uy:group-data-[selected=true]:group-data-[pressed]:border-border-inverted-pressed"
|
|
50
|
+
]
|
|
40
51
|
},
|
|
41
52
|
true: {
|
|
42
53
|
indicator: "",
|
|
@@ -46,39 +57,39 @@ const x = v({
|
|
|
46
57
|
}
|
|
47
58
|
}), N = h(
|
|
48
59
|
({
|
|
49
|
-
label:
|
|
60
|
+
label: u,
|
|
50
61
|
helperText: r,
|
|
51
|
-
isLabelSrOnly:
|
|
62
|
+
isLabelSrOnly: o = !1,
|
|
52
63
|
isDisabled: d,
|
|
53
|
-
...
|
|
54
|
-
},
|
|
64
|
+
...b
|
|
65
|
+
}, s) => {
|
|
55
66
|
const {
|
|
56
67
|
container: t,
|
|
57
68
|
indicator: i,
|
|
58
69
|
knob: l,
|
|
59
70
|
textWrapper: y,
|
|
60
71
|
label: c,
|
|
61
|
-
hintText:
|
|
62
|
-
mobileContainer:
|
|
63
|
-
} = x({ isDisabled: d }),
|
|
64
|
-
return
|
|
65
|
-
|
|
72
|
+
hintText: p,
|
|
73
|
+
mobileContainer: g
|
|
74
|
+
} = x({ isDisabled: d }), f = w() === "xs", n = { ...b, role: "switch" };
|
|
75
|
+
return f ? /* @__PURE__ */ e(
|
|
76
|
+
m,
|
|
66
77
|
{
|
|
67
|
-
...
|
|
68
|
-
ref:
|
|
78
|
+
...n,
|
|
79
|
+
ref: s,
|
|
69
80
|
className: t(),
|
|
70
81
|
isDisabled: d,
|
|
71
|
-
children: /* @__PURE__ */ a("div", { className:
|
|
82
|
+
children: /* @__PURE__ */ a("div", { className: g(), children: [
|
|
72
83
|
/* @__PURE__ */ a(
|
|
73
84
|
"div",
|
|
74
85
|
{
|
|
75
86
|
className: y({
|
|
76
|
-
className:
|
|
87
|
+
className: o ? "uy:sr-only" : ""
|
|
77
88
|
}),
|
|
78
89
|
"data-dd-privacy": "allow",
|
|
79
90
|
children: [
|
|
80
|
-
/* @__PURE__ */ e("span", { className: c(), children:
|
|
81
|
-
r && /* @__PURE__ */ e("span", { className:
|
|
91
|
+
/* @__PURE__ */ e("span", { className: c(), children: u }),
|
|
92
|
+
r && /* @__PURE__ */ e("span", { className: p(), children: r })
|
|
82
93
|
]
|
|
83
94
|
}
|
|
84
95
|
),
|
|
@@ -86,10 +97,10 @@ const x = v({
|
|
|
86
97
|
] })
|
|
87
98
|
}
|
|
88
99
|
) : /* @__PURE__ */ a(
|
|
89
|
-
|
|
100
|
+
m,
|
|
90
101
|
{
|
|
91
|
-
...
|
|
92
|
-
ref:
|
|
102
|
+
...n,
|
|
103
|
+
ref: s,
|
|
93
104
|
className: t(),
|
|
94
105
|
isDisabled: d,
|
|
95
106
|
children: [
|
|
@@ -98,12 +109,12 @@ const x = v({
|
|
|
98
109
|
"div",
|
|
99
110
|
{
|
|
100
111
|
className: y({
|
|
101
|
-
className:
|
|
112
|
+
className: o ? "uy:sr-only" : ""
|
|
102
113
|
}),
|
|
103
114
|
"data-dd-privacy": "allow",
|
|
104
115
|
children: [
|
|
105
|
-
/* @__PURE__ */ e("span", { className: c(), children:
|
|
106
|
-
r && /* @__PURE__ */ e("span", { className:
|
|
116
|
+
/* @__PURE__ */ e("span", { className: c(), children: u }),
|
|
117
|
+
r && /* @__PURE__ */ e("span", { className: p(), children: r })
|
|
107
118
|
]
|
|
108
119
|
}
|
|
109
120
|
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@hookform/devtools": "4.4.0",
|
|
43
43
|
"@hookform/resolvers": "5.2.1",
|
|
44
44
|
"@internationalized/date": "3.12.1",
|
|
45
|
-
"@payfit/unity-illustrations": "2.
|
|
45
|
+
"@payfit/unity-illustrations": "2.31.0",
|
|
46
46
|
"@radix-ui/react-avatar": "1.1.11",
|
|
47
47
|
"@radix-ui/react-slot": "1.2.4",
|
|
48
48
|
"@react-aria/interactions": "3.28.0",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@hookform/devtools": "^4",
|
|
77
|
-
"@payfit/unity-icons": "2.
|
|
78
|
-
"@payfit/unity-themes": "2.
|
|
77
|
+
"@payfit/unity-icons": "2.31.0",
|
|
78
|
+
"@payfit/unity-themes": "2.31.0",
|
|
79
79
|
"@storybook/react-vite": "^10.3.2",
|
|
80
80
|
"@tanstack/react-query": "^5",
|
|
81
81
|
"@tanstack/react-router": "^1.131",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"@figma/code-connect": "1.4.3",
|
|
90
90
|
"@hookform/devtools": "4.4.0",
|
|
91
91
|
"@internationalized/date": "3.12.1",
|
|
92
|
-
"@payfit/unity-icons": "2.
|
|
93
|
-
"@payfit/unity-illustrations": "2.
|
|
94
|
-
"@payfit/unity-themes": "2.
|
|
92
|
+
"@payfit/unity-icons": "2.31.0",
|
|
93
|
+
"@payfit/unity-illustrations": "2.31.0",
|
|
94
|
+
"@payfit/unity-themes": "2.31.0",
|
|
95
95
|
"@storybook/addon-a11y": "10.3.5",
|
|
96
96
|
"@storybook/addon-designs": "11.1.3",
|
|
97
97
|
"@storybook/addon-docs": "10.3.5",
|