@payfit/unity-components 2.21.2 → 2.21.4
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,12 +1,12 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { today as I, getLocalTimeZone as
|
|
1
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as c } from "react";
|
|
3
|
+
import { today as I, getLocalTimeZone as m, isToday as T } from "@internationalized/date";
|
|
4
4
|
import { uyTv as k } from "@payfit/unity-themes";
|
|
5
5
|
import { Calendar as B, Heading as F, CalendarGrid as M, CalendarGridHeader as O, CalendarHeaderCell as W, CalendarGridBody as P, CalendarCell as R } from "react-aria-components";
|
|
6
|
-
import { IconButton as
|
|
6
|
+
import { IconButton as f } from "../icon-button/IconButton.js";
|
|
7
7
|
import { useMonthsList as Z } from "./hooks/useMonthsList.js";
|
|
8
8
|
import { useYearsList as $ } from "./hooks/useYearsList.js";
|
|
9
|
-
import { DateSegmentSelect as
|
|
9
|
+
import { DateSegmentSelect as b } from "./parts/DateSegmentSelect.js";
|
|
10
10
|
const q = k({
|
|
11
11
|
slots: {
|
|
12
12
|
base: "",
|
|
@@ -40,34 +40,33 @@ const q = k({
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
function z({
|
|
43
|
-
value:
|
|
44
|
-
defaultValue:
|
|
45
|
-
minValue:
|
|
46
|
-
maxValue:
|
|
47
|
-
onChange:
|
|
48
|
-
onFocusChange:
|
|
43
|
+
value: u,
|
|
44
|
+
defaultValue: o,
|
|
45
|
+
minValue: r,
|
|
46
|
+
maxValue: d,
|
|
47
|
+
onChange: h,
|
|
48
|
+
onFocusChange: p,
|
|
49
49
|
...t
|
|
50
50
|
}) {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
endYear: u?.year
|
|
51
|
+
const g = I(m()), v = Z(), C = $({
|
|
52
|
+
startYear: r?.year,
|
|
53
|
+
endYear: d?.year
|
|
54
|
+
}), [x, D] = c(u ?? o ?? null), [l, n] = c(() => {
|
|
55
|
+
const e = u ?? o ?? g;
|
|
56
|
+
return r && e.compare(r) < 0 ? r : d && e.compare(d) > 0 ? d : e;
|
|
58
57
|
}), N = (e) => {
|
|
59
|
-
|
|
60
|
-
(
|
|
58
|
+
n(
|
|
59
|
+
(i) => i.set({ month: parseInt(e, 10) })
|
|
61
60
|
);
|
|
62
61
|
}, H = (e) => {
|
|
63
|
-
|
|
64
|
-
(
|
|
62
|
+
n(
|
|
63
|
+
(i) => i.set({ year: parseInt(e, 10) })
|
|
65
64
|
);
|
|
66
65
|
}, {
|
|
67
66
|
base: w,
|
|
68
67
|
calendarWrapper: G,
|
|
69
68
|
dialogHeader: L,
|
|
70
|
-
dialogHeaderGroup:
|
|
69
|
+
dialogHeaderGroup: y,
|
|
71
70
|
calendarGrid: S,
|
|
72
71
|
calendarHeaderCell: Y,
|
|
73
72
|
calendarCell: j
|
|
@@ -76,42 +75,42 @@ function z({
|
|
|
76
75
|
B,
|
|
77
76
|
{
|
|
78
77
|
...t,
|
|
79
|
-
minValue:
|
|
80
|
-
maxValue:
|
|
81
|
-
value:
|
|
82
|
-
defaultValue:
|
|
78
|
+
minValue: r,
|
|
79
|
+
maxValue: d,
|
|
80
|
+
value: x,
|
|
81
|
+
defaultValue: o,
|
|
83
82
|
onChange: (e) => {
|
|
84
|
-
|
|
83
|
+
D(e), h?.(e);
|
|
85
84
|
},
|
|
86
85
|
focusedValue: l,
|
|
87
86
|
onFocusChange: (e) => {
|
|
88
|
-
|
|
87
|
+
n(e), p?.(e);
|
|
89
88
|
},
|
|
90
|
-
children: /* @__PURE__ */
|
|
91
|
-
/* @__PURE__ */
|
|
89
|
+
children: /* @__PURE__ */ s("div", { className: G(), children: [
|
|
90
|
+
/* @__PURE__ */ s("header", { className: L(), children: [
|
|
92
91
|
/* @__PURE__ */ a(F, { className: "uy:sr-only" }),
|
|
93
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ s(
|
|
94
93
|
"div",
|
|
95
94
|
{
|
|
96
|
-
className:
|
|
95
|
+
className: y({
|
|
97
96
|
className: "uy:pl-100 uy:gap-200"
|
|
98
97
|
}),
|
|
99
98
|
children: [
|
|
100
99
|
/* @__PURE__ */ a(
|
|
101
|
-
|
|
100
|
+
b,
|
|
102
101
|
{
|
|
103
102
|
type: "month",
|
|
104
|
-
items:
|
|
103
|
+
items: v,
|
|
105
104
|
value: l.month.toString(),
|
|
106
105
|
onChange: N,
|
|
107
106
|
isDisabled: t.isDisabled
|
|
108
107
|
}
|
|
109
108
|
),
|
|
110
109
|
/* @__PURE__ */ a(
|
|
111
|
-
|
|
110
|
+
b,
|
|
112
111
|
{
|
|
113
112
|
type: "year",
|
|
114
|
-
items:
|
|
113
|
+
items: C,
|
|
115
114
|
value: l.year.toString(),
|
|
116
115
|
onChange: H,
|
|
117
116
|
isDisabled: t.isDisabled
|
|
@@ -120,15 +119,15 @@ function z({
|
|
|
120
119
|
]
|
|
121
120
|
}
|
|
122
121
|
),
|
|
123
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ s(
|
|
124
123
|
"div",
|
|
125
124
|
{
|
|
126
|
-
className:
|
|
125
|
+
className: y({
|
|
127
126
|
className: "uy:ml-auto uy:gap-100"
|
|
128
127
|
}),
|
|
129
128
|
children: [
|
|
130
129
|
/* @__PURE__ */ a(
|
|
131
|
-
|
|
130
|
+
f,
|
|
132
131
|
{
|
|
133
132
|
slot: "previous",
|
|
134
133
|
icon: "CaretLeftOutlined",
|
|
@@ -139,7 +138,7 @@ function z({
|
|
|
139
138
|
}
|
|
140
139
|
),
|
|
141
140
|
/* @__PURE__ */ a(
|
|
142
|
-
|
|
141
|
+
f,
|
|
143
142
|
{
|
|
144
143
|
slot: "next",
|
|
145
144
|
icon: "CaretRightOutlined",
|
|
@@ -153,13 +152,13 @@ function z({
|
|
|
153
152
|
}
|
|
154
153
|
)
|
|
155
154
|
] }),
|
|
156
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ s(M, { className: S(), weekdayStyle: "short", children: [
|
|
157
156
|
/* @__PURE__ */ a(O, { children: (e) => /* @__PURE__ */ a(W, { className: Y(), children: e }) }),
|
|
158
157
|
/* @__PURE__ */ a(P, { children: (e) => /* @__PURE__ */ a(
|
|
159
158
|
R,
|
|
160
159
|
{
|
|
161
160
|
date: e,
|
|
162
|
-
"data-today": T(e,
|
|
161
|
+
"data-today": T(e, m()) ? !0 : void 0,
|
|
163
162
|
className: j()
|
|
164
163
|
}
|
|
165
164
|
) })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payfit/unity-components",
|
|
3
|
-
"version": "2.21.
|
|
3
|
+
"version": "2.21.4",
|
|
4
4
|
"module": "./dist/esm/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -42,15 +42,15 @@
|
|
|
42
42
|
"@hookform/devtools": "4.4.0",
|
|
43
43
|
"@hookform/resolvers": "5.2.1",
|
|
44
44
|
"@internationalized/date": "3.12.0",
|
|
45
|
-
"@payfit/unity-illustrations": "2.21.
|
|
45
|
+
"@payfit/unity-illustrations": "2.21.4",
|
|
46
46
|
"@radix-ui/react-avatar": "1.1.11",
|
|
47
47
|
"@radix-ui/react-slot": "1.2.4",
|
|
48
48
|
"@react-aria/interactions": "3.27.1",
|
|
49
49
|
"@react-aria/utils": "3.33.1",
|
|
50
50
|
"@react-types/shared": "3.26.0",
|
|
51
51
|
"@standard-schema/spec": "1.1.0",
|
|
52
|
-
"@tanstack/form-core": "1.28.
|
|
53
|
-
"@tanstack/react-form": "1.28.
|
|
52
|
+
"@tanstack/form-core": "1.28.6",
|
|
53
|
+
"@tanstack/react-form": "1.28.6",
|
|
54
54
|
"@tanstack/react-virtual": "3.13.23",
|
|
55
55
|
"@use-gesture/react": "10.3.1",
|
|
56
56
|
"embla-carousel": "9.0.0-rc01",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@hookform/devtools": "^4",
|
|
77
|
-
"@payfit/unity-icons": "2.21.
|
|
78
|
-
"@payfit/unity-themes": "2.21.
|
|
77
|
+
"@payfit/unity-icons": "2.21.4",
|
|
78
|
+
"@payfit/unity-themes": "2.21.4",
|
|
79
79
|
"@storybook/react-vite": "^10.3.2",
|
|
80
80
|
"@tanstack/react-query": "^5",
|
|
81
81
|
"@tanstack/react-router": "^1.131",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"@payfit/hr-apps-tsconfigs": "0.0.0-use.local",
|
|
96
96
|
"@payfit/storybook-addon-console-errors": "0.0.0-use.local",
|
|
97
97
|
"@payfit/storybook-config": "0.0.0-use.local",
|
|
98
|
-
"@payfit/unity-icons": "2.21.
|
|
99
|
-
"@payfit/unity-illustrations": "2.21.
|
|
100
|
-
"@payfit/unity-themes": "2.21.
|
|
98
|
+
"@payfit/unity-icons": "2.21.4",
|
|
99
|
+
"@payfit/unity-illustrations": "2.21.4",
|
|
100
|
+
"@payfit/unity-themes": "2.21.4",
|
|
101
101
|
"@payfit/vite-configs": "0.0.0-use.local",
|
|
102
102
|
"@storybook/addon-a11y": "10.3.2",
|
|
103
103
|
"@storybook/addon-designs": "11.1.2",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"@storybook/addon-vitest": "10.3.2",
|
|
107
107
|
"@storybook/react-vite": "10.3.2",
|
|
108
108
|
"@tanstack/react-devtools": "0.10.0",
|
|
109
|
-
"@tanstack/react-form-devtools": "0.2.
|
|
109
|
+
"@tanstack/react-form-devtools": "0.2.20",
|
|
110
110
|
"@tanstack/react-query": "5.90.21",
|
|
111
111
|
"@tanstack/react-router": "1.159.5",
|
|
112
112
|
"@tanstack/react-router-devtools": "1.159.5",
|