@ecohouse/ui 0.1.4 → 0.1.6
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.
- package/README.md +66 -15
- package/dist/index.cjs +1293 -147
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +358 -154
- package/dist/index.d.ts +358 -154
- package/dist/index.js +1278 -149
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Avatar/Avatar.tsx +19 -71
- package/src/components/Badge/Badge.stories.tsx +52 -0
- package/src/components/Badge/Badge.tsx +131 -0
- package/src/components/Badge/index.ts +2 -0
- package/src/components/Counter/Counter.stories.tsx +46 -0
- package/src/components/Counter/Counter.tsx +135 -0
- package/src/components/Counter/index.ts +2 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +172 -0
- package/src/components/DatePicker/DatePicker.tsx +628 -0
- package/src/components/DatePicker/index.ts +7 -0
- package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +63 -0
- package/src/components/SegmentedToggle/SegmentedToggle.tsx +221 -0
- package/src/components/SegmentedToggle/index.ts +2 -0
- package/src/components/StatCard/StatCard.stories.tsx +20 -0
- package/src/components/StatCard/StatCard.tsx +61 -0
- package/src/components/StatCard/index.ts +2 -0
- package/src/components/index.ts +20 -0
- package/src/icons/CalendarOutline/CalendarOutlineIcon.tsx +25 -0
- package/src/icons/CalendarOutline/CalendarOutlineIcon.web.tsx +31 -0
- package/src/icons/CalendarOutline/calendarOutlinePath.ts +3 -0
- package/src/icons/CalendarOutline/index.ts +1 -0
- package/src/icons/ChevronLeft/ChevronLeftIcon.tsx +21 -0
- package/src/icons/ChevronLeft/ChevronLeftIcon.web.tsx +27 -0
- package/src/icons/ChevronLeft/chevronLeftPath.ts +2 -0
- package/src/icons/ChevronLeft/index.ts +1 -0
- package/src/icons/Minus/MinusIcon.tsx +20 -0
- package/src/icons/Minus/MinusIcon.web.tsx +19 -0
- package/src/icons/Minus/index.ts +1 -0
- package/src/icons/Minus/minusPath.ts +1 -0
- package/src/icons/Plus/PlusIcon.tsx +20 -0
- package/src/icons/Plus/PlusIcon.web.tsx +19 -0
- package/src/icons/Plus/index.ts +1 -0
- package/src/icons/Plus/plusPath.ts +1 -0
- package/src/icons/Sidebar/SidebarIcon.tsx +21 -0
- package/src/icons/Sidebar/SidebarIcon.web.tsx +27 -0
- package/src/icons/Sidebar/index.ts +1 -0
- package/src/icons/Sidebar/sidebarPath.ts +3 -0
- package/src/icons/UsersAlt/UsersAltIcon.tsx +14 -0
- package/src/icons/UsersAlt/UsersAltIcon.web.tsx +13 -0
- package/src/icons/UsersAlt/index.ts +1 -0
- package/src/icons/UsersAlt/usersAltPath.ts +2 -0
- package/src/icons/index.ts +6 -0
- package/src/icons/registry.ts +29 -4
- package/src/index.ts +38 -1
- package/src/primitives/MenuItem/MenuItem.stories.tsx +98 -0
- package/src/primitives/MenuItem/MenuItem.tsx +138 -0
- package/src/primitives/MenuItem/index.ts +2 -0
- package/src/primitives/index.ts +2 -0
- package/src/theme/colors.test.ts +6 -0
- package/src/theme/colors.ts +7 -0
- package/src/theme/index.ts +5 -0
- package/src/theme/typography.ts +76 -0
- package/src/utils/dateUtils.ts +86 -0
package/dist/index.cjs
CHANGED
|
@@ -36,10 +36,17 @@ var colors = {
|
|
|
36
36
|
primary: "#B46436",
|
|
37
37
|
black: "#000000",
|
|
38
38
|
white: "#ffffff",
|
|
39
|
+
whiteAlpha86: "#FFFFFFDB",
|
|
40
|
+
whiteAlpha40: "#FFFFFF66",
|
|
41
|
+
whiteAlpha20: "#FFFFFF33",
|
|
42
|
+
whiteAlpha10: "#FFFFFF1A",
|
|
43
|
+
whiteAlpha5: "#FFFFFF0D",
|
|
39
44
|
dark: "#090909",
|
|
40
45
|
red: "#A63E3E",
|
|
41
46
|
lightGrey: "#B7B7B7",
|
|
47
|
+
green: "#34A853",
|
|
42
48
|
primaryMuted: "#B464360F",
|
|
49
|
+
primaryHover: "#B4643633",
|
|
43
50
|
redMuted: "#A63E3E0F",
|
|
44
51
|
redHover: "#A63E3E33",
|
|
45
52
|
grey0: grey["0"],
|
|
@@ -79,6 +86,34 @@ var buttonTypography = {
|
|
|
79
86
|
letterSpacing: 0.36
|
|
80
87
|
}
|
|
81
88
|
};
|
|
89
|
+
var badgeTypography = {
|
|
90
|
+
fontFamily: fonts.sans,
|
|
91
|
+
fontSize: 14,
|
|
92
|
+
fontWeight: "400",
|
|
93
|
+
lineHeight: 16,
|
|
94
|
+
letterSpacing: 0
|
|
95
|
+
};
|
|
96
|
+
var statCardTypography = {
|
|
97
|
+
fontFamily: fonts.sans,
|
|
98
|
+
fontSize: 16,
|
|
99
|
+
fontWeight: "500",
|
|
100
|
+
lineHeight: 16,
|
|
101
|
+
letterSpacing: 0
|
|
102
|
+
};
|
|
103
|
+
var segmentedToggleTypography = {
|
|
104
|
+
fontFamily: fonts.sans,
|
|
105
|
+
fontSize: 14,
|
|
106
|
+
fontWeight: "500",
|
|
107
|
+
lineHeight: 14,
|
|
108
|
+
letterSpacing: 0
|
|
109
|
+
};
|
|
110
|
+
var counterTypography = {
|
|
111
|
+
fontFamily: fonts.sans,
|
|
112
|
+
fontSize: 14,
|
|
113
|
+
fontWeight: "700",
|
|
114
|
+
lineHeight: 14,
|
|
115
|
+
letterSpacing: 0
|
|
116
|
+
};
|
|
82
117
|
var inputTypography = {
|
|
83
118
|
label: {
|
|
84
119
|
fontFamily: fonts.sans,
|
|
@@ -148,6 +183,38 @@ var avatarTypography = {
|
|
|
148
183
|
letterSpacing: 0
|
|
149
184
|
}
|
|
150
185
|
};
|
|
186
|
+
var datePickerTypography = {
|
|
187
|
+
field: {
|
|
188
|
+
fontFamily: fonts.sans,
|
|
189
|
+
fontSize: 12,
|
|
190
|
+
fontWeight: "400",
|
|
191
|
+
lineHeight: 12,
|
|
192
|
+
letterSpacing: 0.36
|
|
193
|
+
},
|
|
194
|
+
/** Calendar month/year heading — Bold, centered, White. */
|
|
195
|
+
monthHeading: {
|
|
196
|
+
fontFamily: fonts.sans,
|
|
197
|
+
fontSize: 14,
|
|
198
|
+
fontWeight: "700",
|
|
199
|
+
lineHeight: 14,
|
|
200
|
+
letterSpacing: 0
|
|
201
|
+
},
|
|
202
|
+
/** Weekday header (ԵՐ, ԵՔ, ...) — Regular, uppercase, centered, Grey/300. */
|
|
203
|
+
weekday: {
|
|
204
|
+
fontFamily: fonts.sans,
|
|
205
|
+
fontSize: 12,
|
|
206
|
+
fontWeight: "400",
|
|
207
|
+
lineHeight: 12,
|
|
208
|
+
letterSpacing: 0
|
|
209
|
+
},
|
|
210
|
+
day: {
|
|
211
|
+
fontFamily: fonts.sans,
|
|
212
|
+
fontSize: 14,
|
|
213
|
+
fontWeight: "400",
|
|
214
|
+
lineHeight: 14,
|
|
215
|
+
letterSpacing: 0
|
|
216
|
+
}
|
|
217
|
+
};
|
|
151
218
|
var textareaTypography = {
|
|
152
219
|
label: {
|
|
153
220
|
fontFamily: fonts.sans,
|
|
@@ -248,6 +315,25 @@ function CalendarIcon({ size = 20, color = colors.primary, strokeWidth = 1.5 })
|
|
|
248
315
|
) });
|
|
249
316
|
}
|
|
250
317
|
|
|
318
|
+
// src/icons/CalendarOutline/calendarOutlinePath.ts
|
|
319
|
+
var CALENDAR_OUTLINE_PATH = "M10.6667 1.33334V4.00001M5.33333 1.33334V4.00001M2 6.66668H14M5.2 2.66668H10.8C11.9201 2.66668 12.4802 2.66668 12.908 2.88466C13.2843 3.07641 13.5903 3.38237 13.782 3.7587C14 4.18652 14 4.74657 14 5.86668V11.4667C14 12.5868 14 13.1468 13.782 13.5747C13.5903 13.951 13.2843 14.2569 12.908 14.4487C12.4802 14.6667 11.9201 14.6667 10.8 14.6667H5.2C4.0799 14.6667 3.51984 14.6667 3.09202 14.4487C2.71569 14.2569 2.40973 13.951 2.21799 13.5747C2 13.1468 2 12.5868 2 11.4667V5.86668C2 4.74657 2 4.18652 2.21799 3.7587C2.40973 3.38237 2.71569 3.07641 3.09202 2.88466C3.51984 2.66668 4.0799 2.66668 5.2 2.66668Z";
|
|
320
|
+
function CalendarOutlineIcon({
|
|
321
|
+
size = 20,
|
|
322
|
+
color = colors.primary,
|
|
323
|
+
strokeWidth = 1.5
|
|
324
|
+
}) {
|
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
326
|
+
Svg.Path,
|
|
327
|
+
{
|
|
328
|
+
d: CALENDAR_OUTLINE_PATH,
|
|
329
|
+
stroke: color,
|
|
330
|
+
strokeWidth,
|
|
331
|
+
strokeLinecap: "round",
|
|
332
|
+
strokeLinejoin: "round"
|
|
333
|
+
}
|
|
334
|
+
) });
|
|
335
|
+
}
|
|
336
|
+
|
|
251
337
|
// src/icons/Camera/cameraPath.ts
|
|
252
338
|
var CAMERA_PATH = "M9.48898 7H6.2002C5.08009 7 4.51962 7 4.0918 7.21799C3.71547 7.40973 3.40973 7.71547 3.21799 8.0918C3 8.51962 3 9.08009 3 10.2002V15.8002C3 16.9203 3 17.4796 3.21799 17.9074C3.40973 18.2837 3.71547 18.5905 4.0918 18.7822C4.5192 19 5.07899 19 6.19691 19H17.8031C18.921 19 19.48 19 19.9074 18.7822C20.2837 18.5905 20.5905 18.2837 20.7822 17.9074C21 17.48 21 16.921 21 15.8031V10.1969C21 9.07899 21 8.5192 20.7822 8.0918C20.5905 7.71547 20.2837 7.40973 19.9074 7.21799C19.4796 7 18.9203 7 17.8002 7H14.5108M9.48898 7H9.55078M9.48898 7C9.50151 7.00001 9.51468 7 9.52857 7L9.55078 7M9.48898 7C9.38286 6.99995 9.32339 6.99941 9.27637 6.99414C8.68878 6.92835 8.28578 6.36908 8.40918 5.79084C8.42066 5.73703 8.44336 5.66894 8.4883 5.53412L8.49023 5.52841C8.54156 5.37443 8.56723 5.29743 8.59558 5.22949C8.88586 4.53389 9.54322 4.06083 10.2949 4.00541C10.3683 4 10.449 4 10.6113 4H13.3886C13.5509 4 13.6322 4 13.7057 4.00541C14.4574 4.06083 15.114 4.53389 15.4043 5.22949C15.4326 5.29743 15.4584 5.37434 15.5098 5.52832C15.556 5.66699 15.5791 5.73636 15.5908 5.79093C15.7142 6.36917 15.3118 6.92835 14.7242 6.99414C14.6772 6.99941 14.6171 6.99995 14.5108 7M9.55078 7H14.449M14.449 7H14.5108M14.449 7L14.4712 7C14.4851 7 14.4983 7.00001 14.5108 7M12 16C10.3431 16 9 14.6569 9 13C9 11.3431 10.3431 10 12 10C13.6569 10 15 11.3431 15 13C15 14.6569 13.6569 16 12 16Z";
|
|
253
339
|
function CameraIcon({ size = 24, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -312,6 +398,21 @@ function ChevronDownIcon({
|
|
|
312
398
|
) });
|
|
313
399
|
}
|
|
314
400
|
|
|
401
|
+
// src/icons/ChevronLeft/chevronLeftPath.ts
|
|
402
|
+
var CHEVRON_LEFT_PATH = "M12.5 15L7.5 10L12.5 5";
|
|
403
|
+
function ChevronLeftIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
404
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
405
|
+
Svg.Path,
|
|
406
|
+
{
|
|
407
|
+
d: CHEVRON_LEFT_PATH,
|
|
408
|
+
stroke: color,
|
|
409
|
+
strokeWidth,
|
|
410
|
+
strokeLinecap: "round",
|
|
411
|
+
strokeLinejoin: "round"
|
|
412
|
+
}
|
|
413
|
+
) });
|
|
414
|
+
}
|
|
415
|
+
|
|
315
416
|
// src/icons/Clock/clockPath.ts
|
|
316
417
|
var CLOCK_PATH = "M12 7V12H17M12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12C21 16.9706 16.9706 21 12 21Z";
|
|
317
418
|
function ClockIcon({ size = 24, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -460,6 +561,21 @@ function MailIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
460
561
|
) });
|
|
461
562
|
}
|
|
462
563
|
|
|
564
|
+
// src/icons/Minus/minusPath.ts
|
|
565
|
+
var MINUS_PATH = "M3.33337 8H12.6667";
|
|
566
|
+
function MinusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
|
|
567
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
568
|
+
Svg.Path,
|
|
569
|
+
{
|
|
570
|
+
d: MINUS_PATH,
|
|
571
|
+
stroke: color,
|
|
572
|
+
strokeWidth,
|
|
573
|
+
strokeLinecap: "round",
|
|
574
|
+
strokeLinejoin: "round"
|
|
575
|
+
}
|
|
576
|
+
) });
|
|
577
|
+
}
|
|
578
|
+
|
|
463
579
|
// src/icons/Navigate/navigatePath.ts
|
|
464
580
|
var NAVIGATE_PATH = "M5.691 14.2339C11.5836 17.7694 16.2976 13.0554 15.7084 4.21658C6.86968 3.62732 2.15584 8.34151 5.691 14.2339ZM5.691 14.2339C5.69093 14.2338 5.69107 14.234 5.691 14.2339ZM5.691 14.2339L4.16675 15.7576M5.691 14.2339L8.88079 11.0436";
|
|
465
581
|
function NavigateIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -490,6 +606,21 @@ function PhoneIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
490
606
|
) });
|
|
491
607
|
}
|
|
492
608
|
|
|
609
|
+
// src/icons/Plus/plusPath.ts
|
|
610
|
+
var PLUS_PATH = "M8.00004 3.33325V12.6666M3.33337 7.99992H12.6667";
|
|
611
|
+
function PlusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
|
|
612
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
613
|
+
Svg.Path,
|
|
614
|
+
{
|
|
615
|
+
d: PLUS_PATH,
|
|
616
|
+
stroke: color,
|
|
617
|
+
strokeWidth,
|
|
618
|
+
strokeLinecap: "round",
|
|
619
|
+
strokeLinejoin: "round"
|
|
620
|
+
}
|
|
621
|
+
) });
|
|
622
|
+
}
|
|
623
|
+
|
|
493
624
|
// src/icons/Search/searchPath.ts
|
|
494
625
|
var SEARCH_CIRCLE_PATH = "M9.16667 15.8333C12.8486 15.8333 15.8333 12.8486 15.8333 9.16667C15.8333 5.48477 12.8486 2.5 9.16667 2.5C5.48477 2.5 2.5 5.48477 2.5 9.16667C2.5 12.8486 5.48477 15.8333 9.16667 15.8333Z";
|
|
495
626
|
var SEARCH_HANDLE_PATH = "M17.5 17.5L13.875 13.875";
|
|
@@ -565,6 +696,21 @@ function ShowIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
565
696
|
] });
|
|
566
697
|
}
|
|
567
698
|
|
|
699
|
+
// src/icons/Sidebar/sidebarPath.ts
|
|
700
|
+
var SIDEBAR_PATH = "M12.5 2.5V17.5M6.5 2.5H13.5C14.9001 2.5 15.6002 2.5 16.135 2.77248C16.6054 3.01217 16.9878 3.39462 17.2275 3.86502C17.5 4.3998 17.5 5.09987 17.5 6.5V13.5C17.5 14.9001 17.5 15.6002 17.2275 16.135C16.9878 16.6054 16.6054 16.9878 16.135 17.2275C15.6002 17.5 14.9001 17.5 13.5 17.5H6.5C5.09987 17.5 4.3998 17.5 3.86502 17.2275C3.39462 16.9878 3.01217 16.6054 2.77248 16.135C2.5 15.6002 2.5 14.9001 2.5 13.5V6.5C2.5 5.09987 2.5 4.3998 2.77248 3.86502C3.01217 3.39462 3.39462 3.01217 3.86502 2.77248C4.3998 2.5 5.09987 2.5 6.5 2.5Z";
|
|
701
|
+
function SidebarIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
702
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
703
|
+
Svg.Path,
|
|
704
|
+
{
|
|
705
|
+
d: SIDEBAR_PATH,
|
|
706
|
+
stroke: color,
|
|
707
|
+
strokeWidth,
|
|
708
|
+
strokeLinecap: "round",
|
|
709
|
+
strokeLinejoin: "round"
|
|
710
|
+
}
|
|
711
|
+
) });
|
|
712
|
+
}
|
|
713
|
+
|
|
568
714
|
// src/icons/User/userPath.ts
|
|
569
715
|
var USER_PATH = "M15.8334 17.5C15.8334 14.2783 13.2217 11.6667 10 11.6667C6.77836 11.6667 4.16669 14.2783 4.16669 17.5M10 9.16667C8.15907 9.16667 6.66669 7.67428 6.66669 5.83333C6.66669 3.99238 8.15907 2.5 10 2.5C11.841 2.5 13.3334 3.99238 13.3334 5.83333C13.3334 7.67428 11.841 9.16667 10 9.16667Z";
|
|
570
716
|
function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -580,6 +726,12 @@ function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
580
726
|
) });
|
|
581
727
|
}
|
|
582
728
|
|
|
729
|
+
// src/icons/UsersAlt/usersAltPath.ts
|
|
730
|
+
var USERS_ALT_PATH = "M14.35 14.2566C14.9725 13.7177 15.4718 13.0513 15.814 12.3024C16.1562 11.5536 16.3333 10.7399 16.3333 9.91659C16.3333 8.36949 15.7187 6.88576 14.6248 5.7918C13.5308 4.69783 12.0471 4.08325 10.5 4.08325C8.95289 4.08325 7.46916 4.69783 6.3752 5.7918C5.28124 6.88576 4.66666 8.36949 4.66666 9.91659C4.66665 10.7399 4.84376 11.5536 5.18597 12.3024C5.52818 13.0513 6.02748 13.7177 6.64999 14.2566C5.01682 14.9961 3.6312 16.1904 2.6588 17.6966C1.6864 19.2027 1.16837 20.9571 1.16666 22.7499C1.16666 23.0593 1.28957 23.3561 1.50837 23.5749C1.72716 23.7937 2.0239 23.9166 2.33332 23.9166C2.64274 23.9166 2.93949 23.7937 3.15828 23.5749C3.37707 23.3561 3.49999 23.0593 3.49999 22.7499C3.49999 20.8934 4.23749 19.1129 5.55024 17.8002C6.863 16.4874 8.64347 15.7499 10.5 15.7499C12.3565 15.7499 14.137 16.4874 15.4497 17.8002C16.7625 19.1129 17.5 20.8934 17.5 22.7499C17.5 23.0593 17.6229 23.3561 17.8417 23.5749C18.0605 23.7937 18.3572 23.9166 18.6667 23.9166C18.9761 23.9166 19.2728 23.7937 19.4916 23.5749C19.7104 23.3561 19.8333 23.0593 19.8333 22.7499C19.8316 20.9571 19.3136 19.2027 18.3412 17.6966C17.3688 16.1904 15.9832 14.9961 14.35 14.2566ZM10.5 13.4166C9.80775 13.4166 9.13107 13.2113 8.55549 12.8267C7.97992 12.4421 7.53132 11.8955 7.26641 11.256C7.0015 10.6164 6.93219 9.9127 7.06724 9.23377C7.20229 8.55484 7.53563 7.9312 8.02512 7.44171C8.5146 6.95223 9.13824 6.61889 9.81717 6.48384C10.4961 6.34879 11.1998 6.4181 11.8394 6.68301C12.4789 6.94791 13.0255 7.39652 13.4101 7.97209C13.7947 8.54766 14 9.22435 14 9.91659C14 10.8448 13.6312 11.7351 12.9749 12.3915C12.3185 13.0478 11.4282 13.4166 10.5 13.4166ZM21.8633 13.7899C22.61 12.9491 23.0977 11.9105 23.2678 10.799C23.4378 9.68748 23.2831 8.55051 22.822 7.52492C22.361 6.49933 21.6134 5.62885 20.6692 5.01825C19.725 4.40764 18.6244 4.08295 17.5 4.08325C17.1906 4.08325 16.8938 4.20617 16.675 4.42496C16.4562 4.64375 16.3333 4.9405 16.3333 5.24992C16.3333 5.55934 16.4562 5.85608 16.675 6.07488C16.8938 6.29367 17.1906 6.41659 17.5 6.41659C18.4282 6.41659 19.3185 6.78533 19.9749 7.44171C20.6312 8.09809 21 8.98833 21 9.91659C20.9983 10.5294 20.8358 11.131 20.5287 11.6612C20.2216 12.1915 19.7807 12.6319 19.25 12.9383C19.077 13.038 18.9325 13.1805 18.8304 13.3521C18.7283 13.5237 18.6719 13.7186 18.6667 13.9183C18.6618 14.1163 18.7074 14.3123 18.7993 14.4879C18.8911 14.6634 19.0262 14.8127 19.1917 14.9216L19.6467 15.2249L19.7983 15.3066C21.2046 15.9736 22.391 17.0286 23.2178 18.3473C24.0446 19.666 24.4773 21.1935 24.465 22.7499C24.465 23.0593 24.5879 23.3561 24.8067 23.5749C25.0255 23.7937 25.3222 23.9166 25.6317 23.9166C25.9411 23.9166 26.2378 23.7937 26.4566 23.5749C26.6754 23.3561 26.7983 23.0593 26.7983 22.7499C26.8079 20.9596 26.3594 19.1965 25.4957 17.6283C24.632 16.0601 23.3816 14.7388 21.8633 13.7899Z";
|
|
731
|
+
function UsersAltIcon({ size = 28, color = colors.white }) {
|
|
732
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Svg__default.default, { width: size, height: size, viewBox: "0 0 28 28", fill: "none", children: /* @__PURE__ */ jsxRuntime.jsx(Svg.Path, { d: USERS_ALT_PATH, fill: color }) });
|
|
733
|
+
}
|
|
734
|
+
|
|
583
735
|
// src/icons/Video/videoPath.ts
|
|
584
736
|
var VIDEO_PATHS = [
|
|
585
737
|
"M14.6667 5.95424C14.6667 5.55036 14.6667 5.34843 14.5868 5.25492C14.5175 5.17378 14.4136 5.13072 14.3072 5.13909C14.1846 5.14874 14.0418 5.29153 13.7563 5.57712L11.3334 7.99999L13.7563 10.4229C14.0418 10.7085 14.1846 10.8512 14.3072 10.8609C14.4136 10.8693 14.5175 10.8262 14.5868 10.7451C14.6667 10.6516 14.6667 10.4496 14.6667 10.0457V5.95424Z",
|
|
@@ -606,10 +758,12 @@ var icons = {
|
|
|
606
758
|
bell: BellIcon,
|
|
607
759
|
building: BuildingIcon,
|
|
608
760
|
calendar: CalendarIcon,
|
|
761
|
+
calendarOutline: CalendarOutlineIcon,
|
|
609
762
|
camera: CameraIcon,
|
|
610
763
|
check: CheckIcon,
|
|
611
764
|
checkBadge: CheckBadgeIcon,
|
|
612
765
|
chevronDown: ChevronDownIcon,
|
|
766
|
+
chevronLeft: ChevronLeftIcon,
|
|
613
767
|
clock: ClockIcon,
|
|
614
768
|
facebook: FacebookIcon,
|
|
615
769
|
heart: HeartIcon,
|
|
@@ -621,22 +775,39 @@ var icons = {
|
|
|
621
775
|
linkedin: LinkedInIcon,
|
|
622
776
|
logOut: LogOutIcon,
|
|
623
777
|
mail: MailIcon,
|
|
778
|
+
minus: MinusIcon,
|
|
624
779
|
navigate: NavigateIcon,
|
|
625
780
|
phone: PhoneIcon,
|
|
781
|
+
plus: PlusIcon,
|
|
626
782
|
search: SearchIcon,
|
|
627
783
|
settings: SettingsIcon,
|
|
628
784
|
show: ShowIcon,
|
|
785
|
+
sidebar: SidebarIcon,
|
|
629
786
|
user: UserIcon,
|
|
787
|
+
usersAlt: UsersAltIcon,
|
|
630
788
|
video: VideoIcon
|
|
631
789
|
};
|
|
632
790
|
var iconNames = Object.keys(icons);
|
|
633
791
|
var iconGroups = {
|
|
634
|
-
navigation: ["arrowRight", "chevronDown", "home", "navigate"],
|
|
635
|
-
actions: [
|
|
636
|
-
|
|
792
|
+
navigation: ["arrowRight", "chevronDown", "chevronLeft", "home", "navigate"],
|
|
793
|
+
actions: [
|
|
794
|
+
"show",
|
|
795
|
+
"bell",
|
|
796
|
+
"camera",
|
|
797
|
+
"key",
|
|
798
|
+
"check",
|
|
799
|
+
"checkBadge",
|
|
800
|
+
"search",
|
|
801
|
+
"calendar",
|
|
802
|
+
"calendarOutline",
|
|
803
|
+
"heart",
|
|
804
|
+
"minus",
|
|
805
|
+
"plus"
|
|
806
|
+
],
|
|
807
|
+
objects: ["bag", "building", "clock", "user", "usersAlt", "video"],
|
|
637
808
|
communication: ["mail", "phone"],
|
|
638
809
|
social: ["facebook", "instagram", "linkedin"],
|
|
639
|
-
interface: ["layoutGrid", "settings", "helpCircle", "logOut"]
|
|
810
|
+
interface: ["layoutGrid", "sidebar", "settings", "helpCircle", "logOut"]
|
|
640
811
|
};
|
|
641
812
|
var iconGroupNames = Object.keys(iconGroups);
|
|
642
813
|
function getIconsByGroup(group) {
|
|
@@ -698,13 +869,104 @@ function useApplyWebClassName(ref, className, enabled = true) {
|
|
|
698
869
|
};
|
|
699
870
|
}, [ref, className, enabled]);
|
|
700
871
|
}
|
|
872
|
+
var ITEM_RADIUS = 12;
|
|
873
|
+
var ICON_SIZE = 16;
|
|
874
|
+
var MenuItem = react.forwardRef(function MenuItem2({
|
|
875
|
+
icon,
|
|
876
|
+
label,
|
|
877
|
+
onPress,
|
|
878
|
+
disabled = false,
|
|
879
|
+
backgroundColor,
|
|
880
|
+
hoverColor,
|
|
881
|
+
style,
|
|
882
|
+
labelStyle,
|
|
883
|
+
className,
|
|
884
|
+
accessibilityLabel,
|
|
885
|
+
hitSlop = 4,
|
|
886
|
+
onHoverIn,
|
|
887
|
+
onHoverOut,
|
|
888
|
+
onPressIn,
|
|
889
|
+
onPressOut,
|
|
890
|
+
...rest
|
|
891
|
+
}, forwardedRef) {
|
|
892
|
+
const containerRef = react.useRef(null);
|
|
893
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
894
|
+
const [hovered, setHovered] = react.useState(false);
|
|
895
|
+
useApplyWebClassName(containerRef, className);
|
|
896
|
+
const resolvedBackground = hovered ? hoverColor ?? colors.grey600 : backgroundColor ?? "transparent";
|
|
897
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? label;
|
|
898
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
899
|
+
reactNative.Pressable,
|
|
900
|
+
{
|
|
901
|
+
...rest,
|
|
902
|
+
ref: setContainerRef,
|
|
903
|
+
onPress,
|
|
904
|
+
disabled,
|
|
905
|
+
hitSlop,
|
|
906
|
+
onHoverIn: (event) => {
|
|
907
|
+
setHovered(true);
|
|
908
|
+
onHoverIn?.(event);
|
|
909
|
+
},
|
|
910
|
+
onHoverOut: (event) => {
|
|
911
|
+
setHovered(false);
|
|
912
|
+
onHoverOut?.(event);
|
|
913
|
+
},
|
|
914
|
+
onPressIn: (event) => {
|
|
915
|
+
setHovered(true);
|
|
916
|
+
onPressIn?.(event);
|
|
917
|
+
},
|
|
918
|
+
onPressOut: (event) => {
|
|
919
|
+
setHovered(false);
|
|
920
|
+
onPressOut?.(event);
|
|
921
|
+
},
|
|
922
|
+
accessibilityRole: "menuitem",
|
|
923
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
924
|
+
accessibilityState: { disabled },
|
|
925
|
+
style: [
|
|
926
|
+
styles.root,
|
|
927
|
+
{ backgroundColor: resolvedBackground },
|
|
928
|
+
disabled && styles.disabled,
|
|
929
|
+
style
|
|
930
|
+
],
|
|
931
|
+
children: [
|
|
932
|
+
icon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.iconSlot, children: icon }) : null,
|
|
933
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.label, labelStyle], numberOfLines: 1, children: label })
|
|
934
|
+
]
|
|
935
|
+
}
|
|
936
|
+
);
|
|
937
|
+
});
|
|
938
|
+
var styles = reactNative.StyleSheet.create({
|
|
939
|
+
root: {
|
|
940
|
+
minHeight: 40,
|
|
941
|
+
borderRadius: ITEM_RADIUS,
|
|
942
|
+
paddingVertical: 12,
|
|
943
|
+
paddingHorizontal: 12,
|
|
944
|
+
flexDirection: "row",
|
|
945
|
+
alignItems: "center",
|
|
946
|
+
gap: 8,
|
|
947
|
+
alignSelf: "stretch"
|
|
948
|
+
},
|
|
949
|
+
disabled: {
|
|
950
|
+
opacity: 0.5
|
|
951
|
+
},
|
|
952
|
+
iconSlot: {
|
|
953
|
+
width: ICON_SIZE,
|
|
954
|
+
height: ICON_SIZE,
|
|
955
|
+
alignItems: "center",
|
|
956
|
+
justifyContent: "center",
|
|
957
|
+
flexShrink: 0
|
|
958
|
+
},
|
|
959
|
+
label: {
|
|
960
|
+
...avatarTypography.menuItem,
|
|
961
|
+
color: colors.white,
|
|
962
|
+
flex: 1
|
|
963
|
+
}
|
|
964
|
+
});
|
|
701
965
|
var IMAGE_SIZE = 48;
|
|
702
966
|
var CONTAINER_RADIUS = 71;
|
|
703
967
|
var CHEVRON_SIZE = 20;
|
|
704
968
|
var FALLBACK_ICON_SIZE = 20;
|
|
705
969
|
var MENU_RADIUS = 16;
|
|
706
|
-
var MENU_ITEM_RADIUS = 12;
|
|
707
|
-
var MENU_ITEM_ICON_SIZE = 16;
|
|
708
970
|
var Avatar = react.forwardRef(function Avatar2({
|
|
709
971
|
name,
|
|
710
972
|
email,
|
|
@@ -727,8 +989,8 @@ var Avatar = react.forwardRef(function Avatar2({
|
|
|
727
989
|
const containerRef = react.useRef(null);
|
|
728
990
|
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
729
991
|
const [imageFailed, setImageFailed] = react.useState(false);
|
|
730
|
-
const
|
|
731
|
-
const hasMenu =
|
|
992
|
+
const resolvedMenuItems = menuItems ?? [];
|
|
993
|
+
const hasMenu = resolvedMenuItems.length > 0;
|
|
732
994
|
const isInteractive = onPress != null || hasMenu;
|
|
733
995
|
const isOpenControlled = typeof openProp === "boolean";
|
|
734
996
|
const [uncontrolledOpen, setUncontrolledOpen] = react.useState(defaultOpen);
|
|
@@ -738,7 +1000,6 @@ var Avatar = react.forwardRef(function Avatar2({
|
|
|
738
1000
|
(next) => {
|
|
739
1001
|
if (!isOpenControlled) setUncontrolledOpen(next);
|
|
740
1002
|
onOpenChange?.(next);
|
|
741
|
-
if (!next) setHoveredKey(null);
|
|
742
1003
|
},
|
|
743
1004
|
[isOpenControlled, onOpenChange]
|
|
744
1005
|
);
|
|
@@ -791,7 +1052,7 @@ var Avatar = react.forwardRef(function Avatar2({
|
|
|
791
1052
|
}, [isOpen, closeAndFocusTrigger]);
|
|
792
1053
|
const hasImage = Boolean(imageUrl) && !imageFailed;
|
|
793
1054
|
const resolvedAccessibilityLabel = accessibilityLabel ?? [name, email].filter(Boolean).join(", ");
|
|
794
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: wrapperRef, style: [
|
|
1055
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: wrapperRef, style: [styles2.wrapper, isOpen && styles2.wrapperOpen], children: [
|
|
795
1056
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
796
1057
|
reactNative.Pressable,
|
|
797
1058
|
{
|
|
@@ -803,55 +1064,42 @@ var Avatar = react.forwardRef(function Avatar2({
|
|
|
803
1064
|
accessibilityRole: isInteractive ? "button" : void 0,
|
|
804
1065
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
805
1066
|
accessibilityState: isInteractive ? { disabled, expanded: hasMenu ? isOpen : void 0 } : void 0,
|
|
806
|
-
style: [
|
|
1067
|
+
style: [styles2.root, disabled && styles2.disabled, style],
|
|
807
1068
|
children: [
|
|
808
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
1069
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles2.imageWrap, children: hasImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
809
1070
|
reactNative.Image,
|
|
810
1071
|
{
|
|
811
1072
|
source: { uri: imageUrl ?? void 0 },
|
|
812
|
-
style:
|
|
1073
|
+
style: styles2.image,
|
|
813
1074
|
onError: () => setImageFailed(true)
|
|
814
1075
|
}
|
|
815
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
816
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
817
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
818
|
-
email ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
1076
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles2.imageFallback, children: /* @__PURE__ */ jsxRuntime.jsx(UserIcon, { size: FALLBACK_ICON_SIZE, color: colors.primary }) }) }),
|
|
1077
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles2.textColumn, children: [
|
|
1078
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.name, numberOfLines: 1, children: name }),
|
|
1079
|
+
email ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.email, numberOfLines: 1, children: email }) : null
|
|
819
1080
|
] }),
|
|
820
|
-
showChevron ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
1081
|
+
showChevron ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.chevronSlot, isOpen && styles2.chevronOpen], children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: isOpen ? colors.primary : colors.grey100 }) }) : null
|
|
821
1082
|
]
|
|
822
1083
|
}
|
|
823
1084
|
),
|
|
824
|
-
hasMenu && isOpen ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
1085
|
+
hasMenu && isOpen ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.menu, menuWidth != null && { right: void 0, width: menuWidth }], children: resolvedMenuItems.map((item) => {
|
|
825
1086
|
const itemKey = item.key ?? item.label;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
829
|
-
reactNative.Pressable,
|
|
1087
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1088
|
+
MenuItem,
|
|
830
1089
|
{
|
|
831
|
-
|
|
1090
|
+
icon: item.icon,
|
|
1091
|
+
label: item.label,
|
|
832
1092
|
disabled: item.disabled,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
onPressOut: () => setHoveredKey((current) => current === itemKey ? null : current),
|
|
837
|
-
accessibilityRole: "menuitem",
|
|
838
|
-
accessibilityState: { disabled: item.disabled },
|
|
839
|
-
style: [
|
|
840
|
-
styles.menuItem,
|
|
841
|
-
{ backgroundColor },
|
|
842
|
-
item.disabled && styles.menuItemDisabled
|
|
843
|
-
],
|
|
844
|
-
children: [
|
|
845
|
-
item.icon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.menuItemIcon, children: item.icon }) : null,
|
|
846
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.menuItemLabel, numberOfLines: 1, children: item.label })
|
|
847
|
-
]
|
|
1093
|
+
backgroundColor: item.backgroundColor,
|
|
1094
|
+
hoverColor: item.hoverColor,
|
|
1095
|
+
onPress: () => handleItemPress(item)
|
|
848
1096
|
},
|
|
849
1097
|
itemKey
|
|
850
1098
|
);
|
|
851
1099
|
}) }) : null
|
|
852
1100
|
] });
|
|
853
1101
|
});
|
|
854
|
-
var
|
|
1102
|
+
var styles2 = reactNative.StyleSheet.create({
|
|
855
1103
|
wrapper: {
|
|
856
1104
|
position: "relative",
|
|
857
1105
|
alignSelf: "flex-start"
|
|
@@ -934,33 +1182,396 @@ var styles = reactNative.StyleSheet.create({
|
|
|
934
1182
|
elevation: 8
|
|
935
1183
|
}
|
|
936
1184
|
})
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
var ICON_SIZE2 = 20;
|
|
1188
|
+
var webBlurStyle = reactNative.Platform.OS === "web" ? {
|
|
1189
|
+
backdropFilter: "blur(10.3px)",
|
|
1190
|
+
WebkitBackdropFilter: "blur(10.3px)"
|
|
1191
|
+
} : {};
|
|
1192
|
+
var variantConfig = {
|
|
1193
|
+
default: {
|
|
1194
|
+
backgroundColor: colors.grey750,
|
|
1195
|
+
iconColor: colors.white,
|
|
1196
|
+
border: false,
|
|
1197
|
+
blur: false
|
|
1198
|
+
},
|
|
1199
|
+
transparent: {
|
|
1200
|
+
backgroundColor: colors.whiteAlpha5,
|
|
1201
|
+
iconColor: colors.primary,
|
|
1202
|
+
border: true,
|
|
1203
|
+
blur: true
|
|
1204
|
+
}
|
|
1205
|
+
};
|
|
1206
|
+
var Badge = react.forwardRef(function Badge2({ label, variant = "default", icon: Icon2, style, className, accessibilityLabel, ...rest }, forwardedRef) {
|
|
1207
|
+
const containerRef = react.useRef(null);
|
|
1208
|
+
const preset = variantConfig[variant];
|
|
1209
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1210
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1211
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1212
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1213
|
+
reactNative.View,
|
|
1214
|
+
{
|
|
1215
|
+
...rest,
|
|
1216
|
+
ref: setContainerRef,
|
|
1217
|
+
style: [
|
|
1218
|
+
styles3.base,
|
|
1219
|
+
{ backgroundColor: preset.backgroundColor },
|
|
1220
|
+
preset.border ? styles3.transparentBorder : null,
|
|
1221
|
+
preset.blur ? webBlurStyle : null,
|
|
1222
|
+
style
|
|
1223
|
+
],
|
|
1224
|
+
accessibilityRole: "text",
|
|
1225
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
1226
|
+
children: [
|
|
1227
|
+
Icon2 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.iconSlot, children: /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: ICON_SIZE2, color: preset.iconColor }) }) : null,
|
|
1228
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles3.label, reactNative.Platform.OS === "android" ? styles3.labelAndroid : null], children: label })
|
|
1229
|
+
]
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
});
|
|
1233
|
+
var styles3 = reactNative.StyleSheet.create({
|
|
1234
|
+
base: {
|
|
943
1235
|
flexDirection: "row",
|
|
944
1236
|
alignItems: "center",
|
|
945
|
-
|
|
1237
|
+
alignSelf: "flex-start",
|
|
1238
|
+
minHeight: 44,
|
|
1239
|
+
paddingVertical: 12,
|
|
1240
|
+
paddingHorizontal: 16,
|
|
1241
|
+
gap: 12,
|
|
1242
|
+
borderRadius: 79,
|
|
1243
|
+
overflow: "hidden",
|
|
1244
|
+
borderWidth: 0,
|
|
1245
|
+
borderColor: "transparent",
|
|
1246
|
+
borderStyle: "solid"
|
|
946
1247
|
},
|
|
947
|
-
|
|
948
|
-
|
|
1248
|
+
transparentBorder: {
|
|
1249
|
+
borderWidth: 1,
|
|
1250
|
+
borderColor: colors.whiteAlpha5,
|
|
1251
|
+
borderStyle: "solid"
|
|
949
1252
|
},
|
|
950
|
-
|
|
951
|
-
width:
|
|
952
|
-
height:
|
|
1253
|
+
iconSlot: {
|
|
1254
|
+
width: ICON_SIZE2,
|
|
1255
|
+
height: ICON_SIZE2,
|
|
953
1256
|
alignItems: "center",
|
|
954
1257
|
justifyContent: "center",
|
|
955
1258
|
flexShrink: 0
|
|
956
1259
|
},
|
|
957
|
-
|
|
958
|
-
...
|
|
959
|
-
color: colors.white
|
|
960
|
-
|
|
1260
|
+
label: {
|
|
1261
|
+
...badgeTypography,
|
|
1262
|
+
color: colors.white
|
|
1263
|
+
},
|
|
1264
|
+
labelAndroid: {
|
|
1265
|
+
includeFontPadding: false
|
|
1266
|
+
}
|
|
1267
|
+
});
|
|
1268
|
+
var BUTTON_SIZE = 32;
|
|
1269
|
+
var webBlurStyle2 = reactNative.Platform.OS === "web" ? {
|
|
1270
|
+
backdropFilter: "blur(20px)",
|
|
1271
|
+
WebkitBackdropFilter: "blur(20px)"
|
|
1272
|
+
} : {};
|
|
1273
|
+
function clamp(value, min, max) {
|
|
1274
|
+
return Math.max(min, max === void 0 ? value : Math.min(value, max));
|
|
1275
|
+
}
|
|
1276
|
+
var Counter = react.forwardRef(function Counter2({
|
|
1277
|
+
value,
|
|
1278
|
+
defaultValue,
|
|
1279
|
+
onValueChange,
|
|
1280
|
+
min = 1,
|
|
1281
|
+
max,
|
|
1282
|
+
step = 1,
|
|
1283
|
+
disabled = false,
|
|
1284
|
+
style,
|
|
1285
|
+
className,
|
|
1286
|
+
hitSlop,
|
|
1287
|
+
...rest
|
|
1288
|
+
}, forwardedRef) {
|
|
1289
|
+
const containerRef = react.useRef(null);
|
|
1290
|
+
const isControlled = value !== void 0;
|
|
1291
|
+
const [uncontrolledValue, setUncontrolledValue] = react.useState(
|
|
1292
|
+
() => clamp(defaultValue ?? min, min, max)
|
|
1293
|
+
);
|
|
1294
|
+
const resolvedValue = clamp(isControlled ? value : uncontrolledValue, min, max);
|
|
1295
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1296
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1297
|
+
const decrementDisabled = disabled || resolvedValue <= min;
|
|
1298
|
+
const incrementDisabled = disabled || max !== void 0 && resolvedValue >= max;
|
|
1299
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1300
|
+
const updateValue = (nextValue) => {
|
|
1301
|
+
const next = clamp(nextValue, min, max);
|
|
1302
|
+
if (next === resolvedValue) return;
|
|
1303
|
+
if (!isControlled) setUncontrolledValue(next);
|
|
1304
|
+
onValueChange?.(next);
|
|
1305
|
+
};
|
|
1306
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ...rest, ref: setContainerRef, style: [styles4.base, style], children: [
|
|
1307
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1308
|
+
reactNative.Pressable,
|
|
1309
|
+
{
|
|
1310
|
+
disabled: decrementDisabled,
|
|
1311
|
+
hitSlop,
|
|
1312
|
+
onPress: () => updateValue(resolvedValue - step),
|
|
1313
|
+
accessibilityRole: "button",
|
|
1314
|
+
accessibilityLabel: "Decrease value",
|
|
1315
|
+
accessibilityState: { disabled: decrementDisabled },
|
|
1316
|
+
style: [styles4.button, webBlurStyle2, decrementDisabled && styles4.buttonDisabled],
|
|
1317
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MinusIcon, {})
|
|
1318
|
+
}
|
|
1319
|
+
),
|
|
1320
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.value, children: resolvedValue }),
|
|
1321
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1322
|
+
reactNative.Pressable,
|
|
1323
|
+
{
|
|
1324
|
+
disabled: incrementDisabled,
|
|
1325
|
+
hitSlop,
|
|
1326
|
+
onPress: () => updateValue(resolvedValue + step),
|
|
1327
|
+
accessibilityRole: "button",
|
|
1328
|
+
accessibilityLabel: "Increase value",
|
|
1329
|
+
accessibilityState: { disabled: incrementDisabled },
|
|
1330
|
+
style: [styles4.button, webBlurStyle2, incrementDisabled && styles4.buttonDisabled],
|
|
1331
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(PlusIcon, {})
|
|
1332
|
+
}
|
|
1333
|
+
)
|
|
1334
|
+
] });
|
|
1335
|
+
});
|
|
1336
|
+
var styles4 = reactNative.StyleSheet.create({
|
|
1337
|
+
base: {
|
|
1338
|
+
flexDirection: "row",
|
|
1339
|
+
alignItems: "center",
|
|
1340
|
+
alignSelf: "flex-start",
|
|
1341
|
+
gap: 17
|
|
1342
|
+
},
|
|
1343
|
+
button: {
|
|
1344
|
+
width: BUTTON_SIZE,
|
|
1345
|
+
height: BUTTON_SIZE,
|
|
1346
|
+
alignItems: "center",
|
|
1347
|
+
justifyContent: "center",
|
|
1348
|
+
borderWidth: 1,
|
|
1349
|
+
borderColor: colors.whiteAlpha10,
|
|
1350
|
+
borderRadius: 39
|
|
1351
|
+
},
|
|
1352
|
+
buttonDisabled: {
|
|
1353
|
+
opacity: 0.25
|
|
1354
|
+
},
|
|
1355
|
+
value: {
|
|
1356
|
+
...counterTypography,
|
|
1357
|
+
color: colors.white
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
var ICON_SIZE3 = 20;
|
|
1361
|
+
var ANIMATION_DURATION = 200;
|
|
1362
|
+
var SegmentedToggle = react.forwardRef(
|
|
1363
|
+
function SegmentedToggle2({
|
|
1364
|
+
options,
|
|
1365
|
+
value,
|
|
1366
|
+
defaultValue = options[0].value,
|
|
1367
|
+
onValueChange,
|
|
1368
|
+
fullWidth = true,
|
|
1369
|
+
disabled = false,
|
|
1370
|
+
style,
|
|
1371
|
+
className,
|
|
1372
|
+
hitSlop,
|
|
1373
|
+
onLayout,
|
|
1374
|
+
...rest
|
|
1375
|
+
}, forwardedRef) {
|
|
1376
|
+
const containerRef = react.useRef(null);
|
|
1377
|
+
const isControlled = value !== void 0;
|
|
1378
|
+
const [uncontrolledValue, setUncontrolledValue] = react.useState(defaultValue);
|
|
1379
|
+
const selectedValue = isControlled ? value : uncontrolledValue;
|
|
1380
|
+
const selectedIndex = Math.max(
|
|
1381
|
+
0,
|
|
1382
|
+
options.findIndex(({ value: optionValue }) => optionValue === selectedValue)
|
|
1383
|
+
);
|
|
1384
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1385
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1386
|
+
const progress = react.useRef(new reactNative.Animated.Value(selectedIndex)).current;
|
|
1387
|
+
const [contentWidths, setContentWidths] = react.useState([0, 0]);
|
|
1388
|
+
const [containerWidth, setContainerWidth] = react.useState(0);
|
|
1389
|
+
const availableOptionWidth = Math.max(0, (containerWidth - 12) / 2);
|
|
1390
|
+
const widestContentWidth = Math.max(...contentWidths);
|
|
1391
|
+
const contentBasedOptionWidth = widestContentWidth > 0 ? widestContentWidth + 24 * 2 : 0;
|
|
1392
|
+
const optionWidth = fullWidth ? availableOptionWidth : contentBasedOptionWidth;
|
|
1393
|
+
const indicatorTranslateX = progress.interpolate({
|
|
1394
|
+
inputRange: [0, 1],
|
|
1395
|
+
outputRange: [0, optionWidth + 4]
|
|
1396
|
+
});
|
|
1397
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1398
|
+
react.useEffect(() => {
|
|
1399
|
+
const animation = reactNative.Animated.timing(progress, {
|
|
1400
|
+
toValue: selectedIndex,
|
|
1401
|
+
duration: ANIMATION_DURATION,
|
|
1402
|
+
easing: reactNative.Easing.out(reactNative.Easing.cubic),
|
|
1403
|
+
useNativeDriver: true
|
|
1404
|
+
});
|
|
1405
|
+
animation.start();
|
|
1406
|
+
return () => animation.stop();
|
|
1407
|
+
}, [progress, selectedIndex]);
|
|
1408
|
+
const selectOption = (nextValue) => {
|
|
1409
|
+
if (disabled || nextValue === selectedValue) return;
|
|
1410
|
+
if (!isControlled) setUncontrolledValue(nextValue);
|
|
1411
|
+
onValueChange?.(nextValue);
|
|
1412
|
+
};
|
|
1413
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1414
|
+
reactNative.View,
|
|
1415
|
+
{
|
|
1416
|
+
...rest,
|
|
1417
|
+
ref: setContainerRef,
|
|
1418
|
+
onLayout: (event) => {
|
|
1419
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
1420
|
+
setContainerWidth(
|
|
1421
|
+
(currentWidth) => currentWidth === nextWidth ? currentWidth : nextWidth
|
|
1422
|
+
);
|
|
1423
|
+
onLayout?.(event);
|
|
1424
|
+
},
|
|
1425
|
+
style: [
|
|
1426
|
+
styles5.base,
|
|
1427
|
+
fullWidth ? styles5.fullWidth : styles5.contentWidth,
|
|
1428
|
+
disabled && styles5.disabled,
|
|
1429
|
+
style
|
|
1430
|
+
],
|
|
1431
|
+
accessibilityRole: "radiogroup",
|
|
1432
|
+
children: [
|
|
1433
|
+
optionWidth > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1434
|
+
reactNative.Animated.View,
|
|
1435
|
+
{
|
|
1436
|
+
pointerEvents: "none",
|
|
1437
|
+
style: [
|
|
1438
|
+
styles5.activeIndicator,
|
|
1439
|
+
{ width: optionWidth, transform: [{ translateX: indicatorTranslateX }] }
|
|
1440
|
+
]
|
|
1441
|
+
}
|
|
1442
|
+
) : null,
|
|
1443
|
+
options.map(({ value: optionValue, label, icon: Icon2 }, index) => {
|
|
1444
|
+
const selected = optionValue === selectedValue;
|
|
1445
|
+
const iconColor = selected ? colors.primary : colors.whiteAlpha20;
|
|
1446
|
+
const labelColor = selected ? colors.whiteAlpha86 : colors.whiteAlpha40;
|
|
1447
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1448
|
+
reactNative.Pressable,
|
|
1449
|
+
{
|
|
1450
|
+
onPress: () => selectOption(optionValue),
|
|
1451
|
+
disabled,
|
|
1452
|
+
hitSlop,
|
|
1453
|
+
accessibilityRole: "radio",
|
|
1454
|
+
accessibilityLabel: label,
|
|
1455
|
+
accessibilityState: { selected, disabled },
|
|
1456
|
+
style: [
|
|
1457
|
+
styles5.option,
|
|
1458
|
+
fullWidth ? styles5.optionFullWidth : optionWidth > 0 && { minWidth: optionWidth }
|
|
1459
|
+
],
|
|
1460
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1461
|
+
reactNative.View,
|
|
1462
|
+
{
|
|
1463
|
+
onLayout: (event) => {
|
|
1464
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
1465
|
+
setContentWidths((currentWidths) => {
|
|
1466
|
+
if (currentWidths[index] === nextWidth) return currentWidths;
|
|
1467
|
+
const nextWidths = [currentWidths[0], currentWidths[1]];
|
|
1468
|
+
nextWidths[index] = nextWidth;
|
|
1469
|
+
return nextWidths;
|
|
1470
|
+
});
|
|
1471
|
+
},
|
|
1472
|
+
style: styles5.optionContent,
|
|
1473
|
+
children: [
|
|
1474
|
+
Icon2 ? /* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: ICON_SIZE3, color: iconColor }) : null,
|
|
1475
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles5.label, { color: labelColor }], children: label })
|
|
1476
|
+
]
|
|
1477
|
+
}
|
|
1478
|
+
)
|
|
1479
|
+
},
|
|
1480
|
+
optionValue
|
|
1481
|
+
);
|
|
1482
|
+
})
|
|
1483
|
+
]
|
|
1484
|
+
}
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
);
|
|
1488
|
+
var styles5 = reactNative.StyleSheet.create({
|
|
1489
|
+
base: {
|
|
1490
|
+
height: 44,
|
|
1491
|
+
flexDirection: "row",
|
|
1492
|
+
padding: 4,
|
|
1493
|
+
gap: 4,
|
|
1494
|
+
borderRadius: 60,
|
|
1495
|
+
backgroundColor: colors.grey700,
|
|
1496
|
+
overflow: "hidden"
|
|
1497
|
+
},
|
|
1498
|
+
fullWidth: {
|
|
1499
|
+
width: "100%",
|
|
1500
|
+
alignSelf: "stretch"
|
|
1501
|
+
},
|
|
1502
|
+
contentWidth: {
|
|
1503
|
+
alignSelf: "flex-start"
|
|
1504
|
+
},
|
|
1505
|
+
disabled: {
|
|
1506
|
+
opacity: 0.6
|
|
1507
|
+
},
|
|
1508
|
+
option: {
|
|
1509
|
+
zIndex: 1,
|
|
1510
|
+
flexDirection: "row",
|
|
1511
|
+
alignItems: "center",
|
|
1512
|
+
justifyContent: "center",
|
|
1513
|
+
paddingHorizontal: 24,
|
|
1514
|
+
borderRadius: 60
|
|
1515
|
+
},
|
|
1516
|
+
optionContent: {
|
|
1517
|
+
maxWidth: "100%",
|
|
1518
|
+
flexDirection: "row",
|
|
1519
|
+
alignItems: "center",
|
|
1520
|
+
gap: 12
|
|
1521
|
+
},
|
|
1522
|
+
optionFullWidth: {
|
|
1523
|
+
flex: 1,
|
|
1524
|
+
minWidth: 0
|
|
1525
|
+
},
|
|
1526
|
+
activeIndicator: {
|
|
1527
|
+
position: "absolute",
|
|
1528
|
+
top: 4,
|
|
1529
|
+
left: 4,
|
|
1530
|
+
height: 36,
|
|
1531
|
+
backgroundColor: colors.grey600,
|
|
1532
|
+
borderRadius: 60
|
|
1533
|
+
},
|
|
1534
|
+
label: {
|
|
1535
|
+
...segmentedToggleTypography,
|
|
1536
|
+
flexShrink: 1
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
var ICON_SIZE4 = 28;
|
|
1540
|
+
var StatCard = react.forwardRef(function StatCard2({ label, icon: Icon2, style, className, accessibilityLabel, ...rest }, forwardedRef) {
|
|
1541
|
+
const containerRef = react.useRef(null);
|
|
1542
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1543
|
+
const setContainerRef = react.useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1544
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1545
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1546
|
+
reactNative.View,
|
|
1547
|
+
{
|
|
1548
|
+
...rest,
|
|
1549
|
+
ref: setContainerRef,
|
|
1550
|
+
style: [styles6.base, style],
|
|
1551
|
+
accessibilityRole: "text",
|
|
1552
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
1553
|
+
children: [
|
|
1554
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon2, { size: ICON_SIZE4, color: colors.white }),
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles6.label, children: label })
|
|
1556
|
+
]
|
|
1557
|
+
}
|
|
1558
|
+
);
|
|
1559
|
+
});
|
|
1560
|
+
var styles6 = reactNative.StyleSheet.create({
|
|
1561
|
+
base: {
|
|
1562
|
+
width: 204.5,
|
|
1563
|
+
minHeight: 114,
|
|
1564
|
+
padding: 24,
|
|
1565
|
+
gap: 16,
|
|
1566
|
+
borderRadius: 20,
|
|
1567
|
+
backgroundColor: colors.grey750
|
|
1568
|
+
},
|
|
1569
|
+
label: {
|
|
1570
|
+
...statCardTypography,
|
|
1571
|
+
color: colors.whiteAlpha86
|
|
961
1572
|
}
|
|
962
1573
|
});
|
|
963
|
-
var
|
|
1574
|
+
var variantConfig2 = {
|
|
964
1575
|
primary: {
|
|
965
1576
|
backgroundColor: colors.primary,
|
|
966
1577
|
textColor: colors.white,
|
|
@@ -1019,7 +1630,7 @@ var Button = react.forwardRef(
|
|
|
1019
1630
|
}, forwardedRef) {
|
|
1020
1631
|
const containerRef = react.useRef(null);
|
|
1021
1632
|
const textRef = react.useRef(null);
|
|
1022
|
-
const preset =
|
|
1633
|
+
const preset = variantConfig2[variant];
|
|
1023
1634
|
const metrics = sizeConfig[size];
|
|
1024
1635
|
const label = typeof children !== "undefined" ? children : title;
|
|
1025
1636
|
const hasCustomChildren = typeof children !== "undefined";
|
|
@@ -1032,7 +1643,7 @@ var Button = react.forwardRef(
|
|
|
1032
1643
|
useApplyWebClassName(textRef, textClassName);
|
|
1033
1644
|
const iconNode = customIcon ?? /* @__PURE__ */ jsxRuntime.jsx(ArrowRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
1034
1645
|
const containerStyle = [
|
|
1035
|
-
|
|
1646
|
+
styles7.base,
|
|
1036
1647
|
{
|
|
1037
1648
|
minHeight: metrics.minHeight,
|
|
1038
1649
|
borderRadius: metrics.borderRadius,
|
|
@@ -1043,15 +1654,15 @@ var Button = react.forwardRef(
|
|
|
1043
1654
|
paddingRight: hasIcon ? metrics.paddingRightWithIcon : metrics.paddingRight,
|
|
1044
1655
|
gap: hasIcon ? metrics.gap : 0
|
|
1045
1656
|
},
|
|
1046
|
-
disabled &&
|
|
1657
|
+
disabled && styles7.disabled,
|
|
1047
1658
|
style
|
|
1048
1659
|
];
|
|
1049
1660
|
const labelStyle = [
|
|
1050
|
-
|
|
1661
|
+
styles7.label,
|
|
1051
1662
|
metrics.text,
|
|
1052
1663
|
{ color: preset.textColor },
|
|
1053
|
-
reactNative.Platform.OS === "android" ?
|
|
1054
|
-
!hasIcon &&
|
|
1664
|
+
reactNative.Platform.OS === "android" ? styles7.labelAndroid : null,
|
|
1665
|
+
!hasIcon && styles7.labelCentered,
|
|
1055
1666
|
textStyle
|
|
1056
1667
|
];
|
|
1057
1668
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1072,7 +1683,7 @@ var Button = react.forwardRef(
|
|
|
1072
1683
|
reactNative.View,
|
|
1073
1684
|
{
|
|
1074
1685
|
style: [
|
|
1075
|
-
|
|
1686
|
+
styles7.iconContainer,
|
|
1076
1687
|
{
|
|
1077
1688
|
width: metrics.iconContainerSize,
|
|
1078
1689
|
height: metrics.iconContainerSize,
|
|
@@ -1088,7 +1699,7 @@ var Button = react.forwardRef(
|
|
|
1088
1699
|
);
|
|
1089
1700
|
}
|
|
1090
1701
|
);
|
|
1091
|
-
var
|
|
1702
|
+
var styles7 = reactNative.StyleSheet.create({
|
|
1092
1703
|
base: {
|
|
1093
1704
|
flexDirection: "row",
|
|
1094
1705
|
alignItems: "center",
|
|
@@ -1166,13 +1777,13 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
1166
1777
|
accessibilityRole: "checkbox",
|
|
1167
1778
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
1168
1779
|
accessibilityState: { checked: isActive, disabled },
|
|
1169
|
-
style: [
|
|
1780
|
+
style: [styles8.root, disabled && styles8.disabled, style],
|
|
1170
1781
|
children: [
|
|
1171
1782
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1172
1783
|
reactNative.View,
|
|
1173
1784
|
{
|
|
1174
1785
|
style: [
|
|
1175
|
-
|
|
1786
|
+
styles8.box,
|
|
1176
1787
|
{
|
|
1177
1788
|
backgroundColor: chrome.backgroundColor,
|
|
1178
1789
|
borderColor: chrome.borderColor
|
|
@@ -1181,12 +1792,12 @@ var Checkbox = react.forwardRef(function Checkbox2({
|
|
|
1181
1792
|
children: isActive ? /* @__PURE__ */ jsxRuntime.jsx(CheckIcon, { size: CHECK_SIZE, color: colors.primary, strokeWidth: CHECK_STROKE }) : null
|
|
1182
1793
|
}
|
|
1183
1794
|
),
|
|
1184
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1795
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles8.label, labelStyle], children: labelContent }) : labelContent : null
|
|
1185
1796
|
]
|
|
1186
1797
|
}
|
|
1187
1798
|
);
|
|
1188
1799
|
});
|
|
1189
|
-
var
|
|
1800
|
+
var styles8 = reactNative.StyleSheet.create({
|
|
1190
1801
|
root: {
|
|
1191
1802
|
flexDirection: "row",
|
|
1192
1803
|
alignItems: "center",
|
|
@@ -1210,7 +1821,525 @@ var styles3 = reactNative.StyleSheet.create({
|
|
|
1210
1821
|
color: colors.white
|
|
1211
1822
|
}
|
|
1212
1823
|
});
|
|
1213
|
-
|
|
1824
|
+
|
|
1825
|
+
// src/utils/dateUtils.ts
|
|
1826
|
+
function startOfDay(date) {
|
|
1827
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1828
|
+
}
|
|
1829
|
+
function isSameDay(a, b) {
|
|
1830
|
+
if (a == null || b == null) return false;
|
|
1831
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
1832
|
+
}
|
|
1833
|
+
function isSameMonth(a, b) {
|
|
1834
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
1835
|
+
}
|
|
1836
|
+
function addMonths(date, amount) {
|
|
1837
|
+
return new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
1838
|
+
}
|
|
1839
|
+
function isBefore(a, b) {
|
|
1840
|
+
return startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
1841
|
+
}
|
|
1842
|
+
function isAfter(a, b) {
|
|
1843
|
+
return startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
1844
|
+
}
|
|
1845
|
+
function isWithinRange(date, start, end) {
|
|
1846
|
+
const time = startOfDay(date).getTime();
|
|
1847
|
+
return time >= startOfDay(start).getTime() && time <= startOfDay(end).getTime();
|
|
1848
|
+
}
|
|
1849
|
+
function isDateDisabled(date, min, max) {
|
|
1850
|
+
if (min && isBefore(date, min)) return true;
|
|
1851
|
+
if (max && isAfter(date, max)) return true;
|
|
1852
|
+
return false;
|
|
1853
|
+
}
|
|
1854
|
+
function formatDate(date) {
|
|
1855
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
1856
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
1857
|
+
return `${day}.${month}.${date.getFullYear()}`;
|
|
1858
|
+
}
|
|
1859
|
+
function getMonthMatrix(monthDate, weekStartsOn = 1) {
|
|
1860
|
+
const year = monthDate.getFullYear();
|
|
1861
|
+
const month = monthDate.getMonth();
|
|
1862
|
+
const firstOfMonth = new Date(year, month, 1);
|
|
1863
|
+
const firstWeekday = firstOfMonth.getDay();
|
|
1864
|
+
const leadingDays = (firstWeekday - weekStartsOn + 7) % 7;
|
|
1865
|
+
const gridStart = new Date(year, month, 1 - leadingDays);
|
|
1866
|
+
const weeks = [];
|
|
1867
|
+
let cursor = gridStart;
|
|
1868
|
+
for (let week = 0; week < 6; week += 1) {
|
|
1869
|
+
const days = [];
|
|
1870
|
+
for (let day = 0; day < 7; day += 1) {
|
|
1871
|
+
days.push(cursor);
|
|
1872
|
+
cursor = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate() + 1);
|
|
1873
|
+
}
|
|
1874
|
+
weeks.push(days);
|
|
1875
|
+
}
|
|
1876
|
+
return weeks;
|
|
1877
|
+
}
|
|
1878
|
+
var DEFAULT_MONTH_NAMES = [
|
|
1879
|
+
"\u0540\u0578\u0582\u0576\u057E\u0561\u0580",
|
|
1880
|
+
"\u0553\u0565\u057F\u0580\u057E\u0561\u0580",
|
|
1881
|
+
"\u0544\u0561\u0580\u057F",
|
|
1882
|
+
"\u0531\u057A\u0580\u056B\u056C",
|
|
1883
|
+
"\u0544\u0561\u0575\u056B\u057D",
|
|
1884
|
+
"\u0540\u0578\u0582\u0576\u056B\u057D",
|
|
1885
|
+
"\u0540\u0578\u0582\u056C\u056B\u057D",
|
|
1886
|
+
"\u0555\u0563\u0578\u057D\u057F\u0578\u057D",
|
|
1887
|
+
"\u054D\u0565\u057A\u057F\u0565\u0574\u0562\u0565\u0580",
|
|
1888
|
+
"\u0540\u0578\u056F\u057F\u0565\u0574\u0562\u0565\u0580",
|
|
1889
|
+
"\u0546\u0578\u0575\u0565\u0574\u0562\u0565\u0580",
|
|
1890
|
+
"\u0534\u0565\u056F\u057F\u0565\u0574\u0562\u0565\u0580"
|
|
1891
|
+
];
|
|
1892
|
+
var DEFAULT_WEEKDAY_LABELS = ["\u0535\u0550", "\u0535\u0554", "\u0549\u0550", "\u0540\u0546", "\u0548\u0552\u0550", "\u0547\u0532", "\u053F\u0550"];
|
|
1893
|
+
var EMPTY_RANGE = { start: null, end: null };
|
|
1894
|
+
var DEFAULT_WIDTH = 380;
|
|
1895
|
+
var TRIGGER_HEIGHT = 44;
|
|
1896
|
+
var TRIGGER_RADIUS = 60;
|
|
1897
|
+
var MENU_RADIUS2 = 20;
|
|
1898
|
+
var ICON_SIZE5 = 20;
|
|
1899
|
+
var NAV_ICON_SIZE = 20;
|
|
1900
|
+
var DAY_CELL_HEIGHT = 44;
|
|
1901
|
+
var DAY_CIRCLE_SIZE = 44;
|
|
1902
|
+
var DatePicker = react.forwardRef(
|
|
1903
|
+
function DatePicker2(props, forwardedRef) {
|
|
1904
|
+
const {
|
|
1905
|
+
placeholder = "Select date",
|
|
1906
|
+
open: openProp,
|
|
1907
|
+
defaultOpen = false,
|
|
1908
|
+
onOpenChange,
|
|
1909
|
+
disabled = false,
|
|
1910
|
+
closeOnSelect = true,
|
|
1911
|
+
minDate,
|
|
1912
|
+
maxDate,
|
|
1913
|
+
defaultVisibleMonth,
|
|
1914
|
+
monthNames = DEFAULT_MONTH_NAMES,
|
|
1915
|
+
weekdayLabels = DEFAULT_WEEKDAY_LABELS,
|
|
1916
|
+
formatValue = formatDate,
|
|
1917
|
+
weekStartsOn = 1,
|
|
1918
|
+
style,
|
|
1919
|
+
className,
|
|
1920
|
+
accessibilityLabel,
|
|
1921
|
+
// Pulled out only to keep them off `rest` (which is spread onto the root View);
|
|
1922
|
+
// the real values are read from `props` directly below to preserve discriminated typing.
|
|
1923
|
+
range: _range,
|
|
1924
|
+
value: _value,
|
|
1925
|
+
defaultValue: _defaultValue,
|
|
1926
|
+
onValueChange: _onValueChange,
|
|
1927
|
+
...rest
|
|
1928
|
+
} = props;
|
|
1929
|
+
const isRange = props.range === true;
|
|
1930
|
+
const valueProp = props.value;
|
|
1931
|
+
const rootRef = react.useRef(null);
|
|
1932
|
+
const triggerRef = react.useRef(null);
|
|
1933
|
+
const setRootRef = react.useMemo(() => mergeRefs(rootRef, forwardedRef), [forwardedRef]);
|
|
1934
|
+
const isOpenControlled = typeof openProp === "boolean";
|
|
1935
|
+
const isValueControlled = valueProp !== void 0;
|
|
1936
|
+
const [uncontrolledSingle, setUncontrolledSingle] = react.useState(
|
|
1937
|
+
!isRange ? props.defaultValue ?? null : null
|
|
1938
|
+
);
|
|
1939
|
+
const [uncontrolledRange, setUncontrolledRange] = react.useState(
|
|
1940
|
+
isRange ? props.defaultValue ?? EMPTY_RANGE : EMPTY_RANGE
|
|
1941
|
+
);
|
|
1942
|
+
const [uncontrolledOpen, setUncontrolledOpen] = react.useState(defaultOpen);
|
|
1943
|
+
const [hoveredDayKey, setHoveredDayKey] = react.useState(null);
|
|
1944
|
+
const rangeValue = isRange ? isValueControlled ? valueProp ?? EMPTY_RANGE : uncontrolledRange : EMPTY_RANGE;
|
|
1945
|
+
const singleValue = !isRange ? isValueControlled ? valueProp ?? null : uncontrolledSingle : null;
|
|
1946
|
+
const isOpen = isOpenControlled ? openProp : uncontrolledOpen;
|
|
1947
|
+
const [visibleMonth, setVisibleMonth] = react.useState(() => {
|
|
1948
|
+
const anchor = defaultVisibleMonth ?? (isRange ? rangeValue.start : singleValue) ?? /* @__PURE__ */ new Date();
|
|
1949
|
+
return new Date(anchor.getFullYear(), anchor.getMonth(), 1);
|
|
1950
|
+
});
|
|
1951
|
+
useApplyWebClassName(rootRef, className);
|
|
1952
|
+
const setOpen = react.useCallback(
|
|
1953
|
+
(next) => {
|
|
1954
|
+
if (!isOpenControlled) setUncontrolledOpen(next);
|
|
1955
|
+
onOpenChange?.(next);
|
|
1956
|
+
if (next) {
|
|
1957
|
+
const anchor = (isRange ? rangeValue.start : singleValue) ?? /* @__PURE__ */ new Date();
|
|
1958
|
+
setVisibleMonth(new Date(anchor.getFullYear(), anchor.getMonth(), 1));
|
|
1959
|
+
} else {
|
|
1960
|
+
setHoveredDayKey(null);
|
|
1961
|
+
}
|
|
1962
|
+
},
|
|
1963
|
+
[isOpenControlled, isRange, onOpenChange, rangeValue.start, singleValue]
|
|
1964
|
+
);
|
|
1965
|
+
react.useEffect(() => {
|
|
1966
|
+
if (reactNative.Platform.OS !== "web" || !isOpen) return;
|
|
1967
|
+
const handlePointerDown = (event) => {
|
|
1968
|
+
const root = rootRef.current;
|
|
1969
|
+
const target = event.target;
|
|
1970
|
+
if (root?.contains && target instanceof Node && !root.contains(target)) {
|
|
1971
|
+
setOpen(false);
|
|
1972
|
+
}
|
|
1973
|
+
};
|
|
1974
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
1975
|
+
document.addEventListener("touchstart", handlePointerDown);
|
|
1976
|
+
return () => {
|
|
1977
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
1978
|
+
document.removeEventListener("touchstart", handlePointerDown);
|
|
1979
|
+
};
|
|
1980
|
+
}, [isOpen, setOpen]);
|
|
1981
|
+
const focusTrigger = react.useCallback(() => {
|
|
1982
|
+
const node = triggerRef.current;
|
|
1983
|
+
node?.focus?.();
|
|
1984
|
+
}, []);
|
|
1985
|
+
const closeAndFocusTrigger = react.useCallback(() => {
|
|
1986
|
+
setOpen(false);
|
|
1987
|
+
focusTrigger();
|
|
1988
|
+
}, [focusTrigger, setOpen]);
|
|
1989
|
+
react.useEffect(() => {
|
|
1990
|
+
if (reactNative.Platform.OS !== "web" || !isOpen) return;
|
|
1991
|
+
const handleKeyDown = (event) => {
|
|
1992
|
+
if (event.key === "Escape") {
|
|
1993
|
+
event.preventDefault();
|
|
1994
|
+
closeAndFocusTrigger();
|
|
1995
|
+
}
|
|
1996
|
+
};
|
|
1997
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1998
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1999
|
+
}, [isOpen, closeAndFocusTrigger]);
|
|
2000
|
+
const handleTriggerPress = () => {
|
|
2001
|
+
if (disabled) return;
|
|
2002
|
+
setOpen(!isOpen);
|
|
2003
|
+
};
|
|
2004
|
+
const handleDayPress = react.useCallback(
|
|
2005
|
+
(day) => {
|
|
2006
|
+
if (disabled || isDateDisabled(day, minDate, maxDate)) return;
|
|
2007
|
+
const picked = startOfDay(day);
|
|
2008
|
+
if (!isRange) {
|
|
2009
|
+
if (!isValueControlled) setUncontrolledSingle(picked);
|
|
2010
|
+
props.onValueChange?.(picked);
|
|
2011
|
+
if (closeOnSelect) setOpen(false);
|
|
2012
|
+
return;
|
|
2013
|
+
}
|
|
2014
|
+
const { start, end } = rangeValue;
|
|
2015
|
+
const startingNewRange = !start || start && end;
|
|
2016
|
+
const nextRange = startingNewRange ? { start: picked, end: null } : isBefore(picked, start) ? { start: picked, end: null } : { start, end: picked };
|
|
2017
|
+
if (!isValueControlled) setUncontrolledRange(nextRange);
|
|
2018
|
+
props.onValueChange?.(nextRange);
|
|
2019
|
+
if (closeOnSelect && nextRange.start && nextRange.end) setOpen(false);
|
|
2020
|
+
},
|
|
2021
|
+
[
|
|
2022
|
+
closeOnSelect,
|
|
2023
|
+
disabled,
|
|
2024
|
+
isRange,
|
|
2025
|
+
isValueControlled,
|
|
2026
|
+
maxDate,
|
|
2027
|
+
minDate,
|
|
2028
|
+
props,
|
|
2029
|
+
rangeValue,
|
|
2030
|
+
setOpen
|
|
2031
|
+
]
|
|
2032
|
+
);
|
|
2033
|
+
const handlePrevMonth = () => setVisibleMonth((current) => addMonths(current, -1));
|
|
2034
|
+
const handleNextMonth = () => setVisibleMonth((current) => addMonths(current, 1));
|
|
2035
|
+
const weeks = react.useMemo(
|
|
2036
|
+
() => getMonthMatrix(visibleMonth, weekStartsOn),
|
|
2037
|
+
[visibleMonth, weekStartsOn]
|
|
2038
|
+
);
|
|
2039
|
+
const today = react.useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2040
|
+
const hasValue = isRange ? rangeValue.start != null : singleValue != null;
|
|
2041
|
+
const triggerLabel = isRange ? rangeValue.start && rangeValue.end ? `${formatValue(rangeValue.start)} - ${formatValue(rangeValue.end)}` : rangeValue.start ? `${formatValue(rangeValue.start)} - ...` : placeholder : singleValue ? formatValue(singleValue) : placeholder;
|
|
2042
|
+
const triggerBorderColor = isOpen ? colors.primaryMuted : colors.grey700;
|
|
2043
|
+
const triggerTextColor = hasValue ? colors.white : colors.grey100;
|
|
2044
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? placeholder;
|
|
2045
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2046
|
+
reactNative.View,
|
|
2047
|
+
{
|
|
2048
|
+
...rest,
|
|
2049
|
+
ref: setRootRef,
|
|
2050
|
+
style: [styles9.root, isOpen && styles9.rootOpen, disabled && styles9.disabled, style],
|
|
2051
|
+
accessibilityState: { disabled, expanded: isOpen },
|
|
2052
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles9.triggerWrap, isOpen && styles9.triggerWrapOpen], children: [
|
|
2053
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2054
|
+
reactNative.Pressable,
|
|
2055
|
+
{
|
|
2056
|
+
ref: triggerRef,
|
|
2057
|
+
onPress: handleTriggerPress,
|
|
2058
|
+
disabled,
|
|
2059
|
+
accessibilityRole: "button",
|
|
2060
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2061
|
+
accessibilityState: { disabled, expanded: isOpen },
|
|
2062
|
+
style: [
|
|
2063
|
+
styles9.trigger,
|
|
2064
|
+
{ borderColor: triggerBorderColor, backgroundColor: colors.grey700 }
|
|
2065
|
+
],
|
|
2066
|
+
children: [
|
|
2067
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
2068
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.iconSlot, children: /* @__PURE__ */ jsxRuntime.jsx(CalendarOutlineIcon, { size: ICON_SIZE5, color: colors.grey100 }) })
|
|
2069
|
+
]
|
|
2070
|
+
}
|
|
2071
|
+
),
|
|
2072
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.menu, children: [
|
|
2073
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles9.calendarHeader, children: [
|
|
2074
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2075
|
+
reactNative.Pressable,
|
|
2076
|
+
{
|
|
2077
|
+
onPress: handlePrevMonth,
|
|
2078
|
+
hitSlop: 8,
|
|
2079
|
+
accessibilityRole: "button",
|
|
2080
|
+
accessibilityLabel: "Previous month",
|
|
2081
|
+
style: styles9.navButton,
|
|
2082
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white })
|
|
2083
|
+
}
|
|
2084
|
+
),
|
|
2085
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles9.monthHeading, children: [
|
|
2086
|
+
monthNames[visibleMonth.getMonth()],
|
|
2087
|
+
" ",
|
|
2088
|
+
visibleMonth.getFullYear()
|
|
2089
|
+
] }),
|
|
2090
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2091
|
+
reactNative.Pressable,
|
|
2092
|
+
{
|
|
2093
|
+
onPress: handleNextMonth,
|
|
2094
|
+
hitSlop: 8,
|
|
2095
|
+
accessibilityRole: "button",
|
|
2096
|
+
accessibilityLabel: "Next month",
|
|
2097
|
+
style: styles9.navButton,
|
|
2098
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.navIconMirror, children: /* @__PURE__ */ jsxRuntime.jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white }) })
|
|
2099
|
+
}
|
|
2100
|
+
)
|
|
2101
|
+
] }),
|
|
2102
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { children: [
|
|
2103
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.weekdayRow, children: weekdayLabels.map((weekdayLabel, index) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.dayCellWrap, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles9.weekdayText, children: weekdayLabel }) }, `${weekdayLabel}-${index}`)) }),
|
|
2104
|
+
weeks.map((week, weekIndex) => {
|
|
2105
|
+
let rangeHighlightStyle = null;
|
|
2106
|
+
if (isRange && rangeValue.start && rangeValue.end) {
|
|
2107
|
+
const rangeIndices = week.reduce((acc, day, index) => {
|
|
2108
|
+
if (isWithinRange(day, rangeValue.start, rangeValue.end)) {
|
|
2109
|
+
acc.push(index);
|
|
2110
|
+
}
|
|
2111
|
+
return acc;
|
|
2112
|
+
}, []);
|
|
2113
|
+
if (rangeIndices.length > 0) {
|
|
2114
|
+
const first = rangeIndices[0];
|
|
2115
|
+
const last = rangeIndices[rangeIndices.length - 1];
|
|
2116
|
+
const startsHere = isSameDay(week[first], rangeValue.start);
|
|
2117
|
+
const endsHere = isSameDay(week[last], rangeValue.end);
|
|
2118
|
+
const cellPct = 100 / 7;
|
|
2119
|
+
const halfCellPct = cellPct / 2;
|
|
2120
|
+
let leftPct = first * cellPct;
|
|
2121
|
+
let widthPct = (last - first + 1) * cellPct;
|
|
2122
|
+
if (startsHere) {
|
|
2123
|
+
leftPct += halfCellPct;
|
|
2124
|
+
widthPct -= halfCellPct;
|
|
2125
|
+
}
|
|
2126
|
+
if (endsHere) {
|
|
2127
|
+
widthPct -= halfCellPct;
|
|
2128
|
+
}
|
|
2129
|
+
if (widthPct > 0) {
|
|
2130
|
+
rangeHighlightStyle = {
|
|
2131
|
+
left: `${leftPct}%`,
|
|
2132
|
+
width: `${widthPct}%`
|
|
2133
|
+
};
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2138
|
+
reactNative.View,
|
|
2139
|
+
{
|
|
2140
|
+
style: [styles9.weekRow, weekIndex > 0 && styles9.weekRowSpaced],
|
|
2141
|
+
children: [
|
|
2142
|
+
rangeHighlightStyle ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2143
|
+
reactNative.View,
|
|
2144
|
+
{
|
|
2145
|
+
pointerEvents: "none",
|
|
2146
|
+
style: [styles9.rangeHighlight, rangeHighlightStyle]
|
|
2147
|
+
}
|
|
2148
|
+
) : null,
|
|
2149
|
+
week.map((day, dayIndex) => {
|
|
2150
|
+
const inCurrentMonth = isSameMonth(day, visibleMonth);
|
|
2151
|
+
const isToday = isSameDay(day, today);
|
|
2152
|
+
const isSelectedSingle = !isRange && isSameDay(day, singleValue);
|
|
2153
|
+
const isRangeStart = isRange && isSameDay(day, rangeValue.start);
|
|
2154
|
+
const isRangeEnd = isRange && isSameDay(day, rangeValue.end);
|
|
2155
|
+
const isSelectedEndpoint = isSelectedSingle || isRangeStart || isRangeEnd;
|
|
2156
|
+
const dayDisabled = disabled || isDateDisabled(day, minDate, maxDate);
|
|
2157
|
+
const dayKey = startOfDay(day).getTime();
|
|
2158
|
+
const isHovered = !dayDisabled && !isSelectedEndpoint && hoveredDayKey === dayKey;
|
|
2159
|
+
const dayTextColor = isSelectedEndpoint ? colors.white : dayDisabled ? colors.grey400 : isToday ? colors.primary : !inCurrentMonth ? colors.grey300 : colors.white;
|
|
2160
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2161
|
+
reactNative.Pressable,
|
|
2162
|
+
{
|
|
2163
|
+
onPress: () => handleDayPress(day),
|
|
2164
|
+
disabled: dayDisabled,
|
|
2165
|
+
onHoverIn: () => setHoveredDayKey(dayKey),
|
|
2166
|
+
onHoverOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2167
|
+
onPressIn: () => setHoveredDayKey(dayKey),
|
|
2168
|
+
onPressOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2169
|
+
style: styles9.dayCellWrap,
|
|
2170
|
+
accessibilityRole: "button",
|
|
2171
|
+
accessibilityLabel: formatValue(day),
|
|
2172
|
+
accessibilityState: {
|
|
2173
|
+
disabled: dayDisabled,
|
|
2174
|
+
selected: isSelectedEndpoint
|
|
2175
|
+
},
|
|
2176
|
+
children: [
|
|
2177
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2178
|
+
reactNative.View,
|
|
2179
|
+
{
|
|
2180
|
+
style: [
|
|
2181
|
+
styles9.dayCircle,
|
|
2182
|
+
isSelectedEndpoint && styles9.dayCircleSelected,
|
|
2183
|
+
isHovered && styles9.dayCircleHovered
|
|
2184
|
+
],
|
|
2185
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles9.dayText, { color: dayTextColor }], children: day.getDate() })
|
|
2186
|
+
}
|
|
2187
|
+
),
|
|
2188
|
+
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles9.todayDot }) : null
|
|
2189
|
+
]
|
|
2190
|
+
},
|
|
2191
|
+
dayIndex
|
|
2192
|
+
);
|
|
2193
|
+
})
|
|
2194
|
+
]
|
|
2195
|
+
},
|
|
2196
|
+
weekIndex
|
|
2197
|
+
);
|
|
2198
|
+
})
|
|
2199
|
+
] })
|
|
2200
|
+
] }) : null
|
|
2201
|
+
] })
|
|
2202
|
+
}
|
|
2203
|
+
);
|
|
2204
|
+
}
|
|
2205
|
+
);
|
|
2206
|
+
var styles9 = reactNative.StyleSheet.create({
|
|
2207
|
+
root: {
|
|
2208
|
+
width: DEFAULT_WIDTH,
|
|
2209
|
+
gap: 8,
|
|
2210
|
+
alignSelf: "flex-start"
|
|
2211
|
+
},
|
|
2212
|
+
rootOpen: {
|
|
2213
|
+
zIndex: 30
|
|
2214
|
+
},
|
|
2215
|
+
disabled: {
|
|
2216
|
+
opacity: 0.6
|
|
2217
|
+
},
|
|
2218
|
+
triggerWrap: {
|
|
2219
|
+
position: "relative",
|
|
2220
|
+
zIndex: 1
|
|
2221
|
+
},
|
|
2222
|
+
triggerWrapOpen: {
|
|
2223
|
+
zIndex: 20
|
|
2224
|
+
},
|
|
2225
|
+
trigger: {
|
|
2226
|
+
height: TRIGGER_HEIGHT,
|
|
2227
|
+
borderRadius: TRIGGER_RADIUS,
|
|
2228
|
+
borderWidth: 1,
|
|
2229
|
+
paddingVertical: 10,
|
|
2230
|
+
paddingHorizontal: 16,
|
|
2231
|
+
flexDirection: "row",
|
|
2232
|
+
alignItems: "center",
|
|
2233
|
+
gap: 10,
|
|
2234
|
+
overflow: "hidden"
|
|
2235
|
+
},
|
|
2236
|
+
triggerText: {
|
|
2237
|
+
...datePickerTypography.field,
|
|
2238
|
+
flex: 1,
|
|
2239
|
+
minWidth: 0
|
|
2240
|
+
},
|
|
2241
|
+
iconSlot: {
|
|
2242
|
+
width: ICON_SIZE5,
|
|
2243
|
+
height: ICON_SIZE5,
|
|
2244
|
+
alignItems: "center",
|
|
2245
|
+
justifyContent: "center",
|
|
2246
|
+
flexShrink: 0
|
|
2247
|
+
},
|
|
2248
|
+
menu: {
|
|
2249
|
+
position: "absolute",
|
|
2250
|
+
top: "100%",
|
|
2251
|
+
left: 0,
|
|
2252
|
+
right: 0,
|
|
2253
|
+
marginTop: 8,
|
|
2254
|
+
zIndex: 10,
|
|
2255
|
+
borderRadius: MENU_RADIUS2,
|
|
2256
|
+
padding: 12,
|
|
2257
|
+
gap: 0,
|
|
2258
|
+
backgroundColor: colors.grey700,
|
|
2259
|
+
...reactNative.Platform.select({
|
|
2260
|
+
web: {
|
|
2261
|
+
boxShadow: `0 8px 24px ${colors.black}73`
|
|
2262
|
+
},
|
|
2263
|
+
default: {
|
|
2264
|
+
elevation: 8
|
|
2265
|
+
}
|
|
2266
|
+
})
|
|
2267
|
+
},
|
|
2268
|
+
calendarHeader: {
|
|
2269
|
+
height: 36,
|
|
2270
|
+
flexDirection: "row",
|
|
2271
|
+
alignItems: "center",
|
|
2272
|
+
justifyContent: "space-between"
|
|
2273
|
+
},
|
|
2274
|
+
navButton: {
|
|
2275
|
+
width: 36,
|
|
2276
|
+
height: 36,
|
|
2277
|
+
alignItems: "center",
|
|
2278
|
+
justifyContent: "center"
|
|
2279
|
+
},
|
|
2280
|
+
navIconMirror: {
|
|
2281
|
+
transform: [{ scaleX: -1 }]
|
|
2282
|
+
},
|
|
2283
|
+
monthHeading: {
|
|
2284
|
+
...datePickerTypography.monthHeading,
|
|
2285
|
+
color: colors.white,
|
|
2286
|
+
textAlign: "center"
|
|
2287
|
+
},
|
|
2288
|
+
weekdayRow: {
|
|
2289
|
+
flexDirection: "row"
|
|
2290
|
+
},
|
|
2291
|
+
weekdayText: {
|
|
2292
|
+
...datePickerTypography.weekday,
|
|
2293
|
+
color: colors.grey300,
|
|
2294
|
+
textAlign: "center",
|
|
2295
|
+
textTransform: "uppercase"
|
|
2296
|
+
},
|
|
2297
|
+
weekRow: {
|
|
2298
|
+
flexDirection: "row",
|
|
2299
|
+
position: "relative"
|
|
2300
|
+
},
|
|
2301
|
+
weekRowSpaced: {
|
|
2302
|
+
marginTop: 8
|
|
2303
|
+
},
|
|
2304
|
+
rangeHighlight: {
|
|
2305
|
+
position: "absolute",
|
|
2306
|
+
top: (DAY_CELL_HEIGHT - DAY_CIRCLE_SIZE) / 2,
|
|
2307
|
+
bottom: (DAY_CELL_HEIGHT - DAY_CIRCLE_SIZE) / 2,
|
|
2308
|
+
borderRadius: DAY_CIRCLE_SIZE / 2,
|
|
2309
|
+
backgroundColor: colors.primaryHover
|
|
2310
|
+
},
|
|
2311
|
+
dayCellWrap: {
|
|
2312
|
+
flex: 1,
|
|
2313
|
+
height: DAY_CELL_HEIGHT,
|
|
2314
|
+
alignItems: "center",
|
|
2315
|
+
justifyContent: "center"
|
|
2316
|
+
},
|
|
2317
|
+
dayCircle: {
|
|
2318
|
+
width: DAY_CIRCLE_SIZE,
|
|
2319
|
+
height: DAY_CIRCLE_SIZE,
|
|
2320
|
+
borderRadius: DAY_CIRCLE_SIZE / 2,
|
|
2321
|
+
alignItems: "center",
|
|
2322
|
+
justifyContent: "center"
|
|
2323
|
+
},
|
|
2324
|
+
dayCircleSelected: {
|
|
2325
|
+
backgroundColor: colors.primary
|
|
2326
|
+
},
|
|
2327
|
+
dayCircleHovered: {
|
|
2328
|
+
backgroundColor: colors.grey600
|
|
2329
|
+
},
|
|
2330
|
+
dayText: {
|
|
2331
|
+
...datePickerTypography.day
|
|
2332
|
+
},
|
|
2333
|
+
todayDot: {
|
|
2334
|
+
position: "absolute",
|
|
2335
|
+
bottom: 2,
|
|
2336
|
+
width: 4,
|
|
2337
|
+
height: 4,
|
|
2338
|
+
borderRadius: 2,
|
|
2339
|
+
backgroundColor: colors.primary
|
|
2340
|
+
}
|
|
2341
|
+
});
|
|
2342
|
+
var DEFAULT_WIDTH2 = 308;
|
|
1214
2343
|
var sizeConfig2 = {
|
|
1215
2344
|
lg: {
|
|
1216
2345
|
height: 44,
|
|
@@ -1334,13 +2463,13 @@ var Input = react.forwardRef(function Input2({
|
|
|
1334
2463
|
const rightIconNode = rightIcon ?? /* @__PURE__ */ jsxRuntime.jsx(ShowIcon, { size: metrics.iconSize, color: chrome.rightIconColor });
|
|
1335
2464
|
useApplyWebClassName(rootRef, className);
|
|
1336
2465
|
useApplyWebClassName(inputRef, inputClassName);
|
|
1337
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: rootRef, style: [
|
|
1338
|
-
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2466
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: rootRef, style: [styles10.root, disabled && styles10.disabled, style], children: [
|
|
2467
|
+
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.label, { color: chrome.labelColor }], children: label }) : null,
|
|
1339
2468
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1340
2469
|
reactNative.View,
|
|
1341
2470
|
{
|
|
1342
2471
|
style: [
|
|
1343
|
-
|
|
2472
|
+
styles10.field,
|
|
1344
2473
|
{
|
|
1345
2474
|
height: metrics.height,
|
|
1346
2475
|
borderRadius: metrics.borderRadius,
|
|
@@ -1355,7 +2484,7 @@ var Input = react.forwardRef(function Input2({
|
|
|
1355
2484
|
fieldStyle
|
|
1356
2485
|
],
|
|
1357
2486
|
children: [
|
|
1358
|
-
hasLeftIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2487
|
+
hasLeftIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: leftIconNode }) : null,
|
|
1359
2488
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1360
2489
|
reactNative.TextInput,
|
|
1361
2490
|
{
|
|
@@ -1379,11 +2508,11 @@ var Input = react.forwardRef(function Input2({
|
|
|
1379
2508
|
onBlur?.(event);
|
|
1380
2509
|
},
|
|
1381
2510
|
style: [
|
|
1382
|
-
|
|
2511
|
+
styles10.input,
|
|
1383
2512
|
metrics.text,
|
|
1384
2513
|
{ color: chrome.textColor },
|
|
1385
|
-
reactNative.Platform.OS === "web" ?
|
|
1386
|
-
reactNative.Platform.OS === "android" ?
|
|
2514
|
+
reactNative.Platform.OS === "web" ? styles10.inputWeb : null,
|
|
2515
|
+
reactNative.Platform.OS === "android" ? styles10.inputAndroid : null,
|
|
1387
2516
|
inputStyle
|
|
1388
2517
|
],
|
|
1389
2518
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -1395,22 +2524,22 @@ var Input = react.forwardRef(function Input2({
|
|
|
1395
2524
|
{
|
|
1396
2525
|
onPress: onRightIconPress,
|
|
1397
2526
|
disabled,
|
|
1398
|
-
style: [
|
|
2527
|
+
style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }],
|
|
1399
2528
|
accessibilityRole: "button",
|
|
1400
2529
|
accessibilityLabel: rightIconAccessibilityLabel,
|
|
1401
2530
|
hitSlop: 8,
|
|
1402
2531
|
children: rightIconNode
|
|
1403
2532
|
}
|
|
1404
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2533
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: rightIconNode }) : null
|
|
1405
2534
|
]
|
|
1406
2535
|
}
|
|
1407
2536
|
),
|
|
1408
|
-
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
2537
|
+
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles10.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
1409
2538
|
] });
|
|
1410
2539
|
});
|
|
1411
|
-
var
|
|
2540
|
+
var styles10 = reactNative.StyleSheet.create({
|
|
1412
2541
|
root: {
|
|
1413
|
-
width:
|
|
2542
|
+
width: DEFAULT_WIDTH2,
|
|
1414
2543
|
gap: 8,
|
|
1415
2544
|
alignSelf: "flex-start"
|
|
1416
2545
|
},
|
|
@@ -1445,13 +2574,13 @@ var styles4 = reactNative.StyleSheet.create({
|
|
|
1445
2574
|
...inputTypography.hint
|
|
1446
2575
|
}
|
|
1447
2576
|
});
|
|
1448
|
-
var
|
|
1449
|
-
var
|
|
1450
|
-
var
|
|
1451
|
-
var
|
|
2577
|
+
var DEFAULT_WIDTH3 = 308;
|
|
2578
|
+
var TRIGGER_HEIGHT2 = 44;
|
|
2579
|
+
var TRIGGER_RADIUS2 = 60;
|
|
2580
|
+
var MENU_RADIUS3 = 24;
|
|
1452
2581
|
var MENU_MAX_LIST_HEIGHT = 248;
|
|
1453
|
-
var
|
|
1454
|
-
var
|
|
2582
|
+
var ITEM_RADIUS2 = 12;
|
|
2583
|
+
var ICON_SIZE6 = 20;
|
|
1455
2584
|
var CHIP_GAP = 6;
|
|
1456
2585
|
var FALLBACK_ELLIPSIS_WIDTH = 20;
|
|
1457
2586
|
function itemBackground(state) {
|
|
@@ -1524,25 +2653,25 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
1524
2653
|
const next = Math.ceil(event.nativeEvent.layout.width);
|
|
1525
2654
|
setEllipsisWidth((current) => current === next ? current : next);
|
|
1526
2655
|
};
|
|
1527
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1528
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { pointerEvents: "none", style:
|
|
2656
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.multiValueRoot, children: [
|
|
2657
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { pointerEvents: "none", style: styles11.measureRow, children: [
|
|
1529
2658
|
options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1530
2659
|
reactNative.View,
|
|
1531
2660
|
{
|
|
1532
|
-
style:
|
|
2661
|
+
style: styles11.chip,
|
|
1533
2662
|
onLayout: (event) => handleChipLayout(option.value, event),
|
|
1534
2663
|
children: [
|
|
1535
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
1536
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
2664
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.chipLabel, numberOfLines: 1, children: option.label }),
|
|
2665
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.chipRemove, children: "\xD7" })
|
|
1537
2666
|
]
|
|
1538
2667
|
},
|
|
1539
2668
|
`measure-${option.value}`
|
|
1540
2669
|
)),
|
|
1541
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2670
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.ellipsis, onLayout: handleEllipsisLayout, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.ellipsisText, children: "..." }) })
|
|
1542
2671
|
] }),
|
|
1543
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1544
|
-
visible.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1545
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
2672
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.chipsRow, onLayout: handleContainerLayout, children: [
|
|
2673
|
+
visible.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.chip, children: [
|
|
2674
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.chipLabel, numberOfLines: 1, children: option.label }),
|
|
1546
2675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1547
2676
|
reactNative.Pressable,
|
|
1548
2677
|
{
|
|
@@ -1554,11 +2683,11 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
1554
2683
|
hitSlop: 6,
|
|
1555
2684
|
accessibilityRole: "button",
|
|
1556
2685
|
accessibilityLabel: `Remove ${option.label}`,
|
|
1557
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
2686
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.chipRemove, children: "\xD7" })
|
|
1558
2687
|
}
|
|
1559
2688
|
)
|
|
1560
2689
|
] }, option.value)),
|
|
1561
|
-
hasOverflow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2690
|
+
hasOverflow ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.ellipsis, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.ellipsisText, children: "..." }) }) : null
|
|
1562
2691
|
] })
|
|
1563
2692
|
] });
|
|
1564
2693
|
}
|
|
@@ -1769,7 +2898,7 @@ var Select = react.forwardRef(
|
|
|
1769
2898
|
const leftIconNode = leftIcon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1770
2899
|
UserIcon,
|
|
1771
2900
|
{
|
|
1772
|
-
size:
|
|
2901
|
+
size: ICON_SIZE6,
|
|
1773
2902
|
color: error ? colors.red : isOpen ? colors.primary : colors.grey100
|
|
1774
2903
|
}
|
|
1775
2904
|
);
|
|
@@ -1785,11 +2914,11 @@ var Select = react.forwardRef(
|
|
|
1785
2914
|
{
|
|
1786
2915
|
...rest,
|
|
1787
2916
|
ref: setRootRef,
|
|
1788
|
-
style: [
|
|
2917
|
+
style: [styles11.root, isOpen && styles11.rootOpen, disabled && styles11.disabled, style],
|
|
1789
2918
|
accessibilityState: { disabled, expanded: isOpen },
|
|
1790
2919
|
children: [
|
|
1791
|
-
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1792
|
-
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [
|
|
2920
|
+
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.label, { color: labelColor }], children: label }) : null,
|
|
2921
|
+
/* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles11.triggerWrap, isOpen && styles11.triggerWrapOpen], children: [
|
|
1793
2922
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1794
2923
|
reactNative.Pressable,
|
|
1795
2924
|
{
|
|
@@ -1800,29 +2929,29 @@ var Select = react.forwardRef(
|
|
|
1800
2929
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
1801
2930
|
accessibilityState: { disabled, expanded: isOpen },
|
|
1802
2931
|
style: [
|
|
1803
|
-
|
|
2932
|
+
styles11.trigger,
|
|
1804
2933
|
{
|
|
1805
2934
|
borderColor: triggerBorderColor,
|
|
1806
2935
|
backgroundColor: colors.grey700
|
|
1807
2936
|
}
|
|
1808
2937
|
],
|
|
1809
2938
|
children: [
|
|
1810
|
-
hasLeftIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
1811
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2939
|
+
hasLeftIcon ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.iconSlot, children: leftIconNode }) : null,
|
|
2940
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.triggerContent, children: multiple && hasValue ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1812
2941
|
MultiValueChips,
|
|
1813
2942
|
{
|
|
1814
2943
|
options: selectedOptions,
|
|
1815
2944
|
disabled,
|
|
1816
2945
|
onRemove: handleRemoveChip
|
|
1817
2946
|
}
|
|
1818
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
1819
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [
|
|
2947
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: multiple ? placeholder : singleLabel }) }),
|
|
2948
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles11.iconSlot, isOpen && styles11.chevronOpen], children: /* @__PURE__ */ jsxRuntime.jsx(ChevronDownIcon, { size: ICON_SIZE6, color: isOpen ? colors.primary : colors.grey100 }) })
|
|
1820
2949
|
]
|
|
1821
2950
|
}
|
|
1822
2951
|
),
|
|
1823
|
-
isOpen ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1824
|
-
showSearch ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style:
|
|
1825
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2952
|
+
isOpen ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.menu, children: [
|
|
2953
|
+
showSearch ? /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles11.searchField, children: [
|
|
2954
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.iconSlot, children: /* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { size: ICON_SIZE6, color: colors.grey100 }) }),
|
|
1826
2955
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1827
2956
|
reactNative.TextInput,
|
|
1828
2957
|
{
|
|
@@ -1833,9 +2962,9 @@ var Select = react.forwardRef(
|
|
|
1833
2962
|
placeholder: searchPlaceholder,
|
|
1834
2963
|
placeholderTextColor: colors.grey100,
|
|
1835
2964
|
style: [
|
|
1836
|
-
|
|
1837
|
-
reactNative.Platform.OS === "web" ?
|
|
1838
|
-
reactNative.Platform.OS === "android" ?
|
|
2965
|
+
styles11.searchInput,
|
|
2966
|
+
reactNative.Platform.OS === "web" ? styles11.searchInputWeb : null,
|
|
2967
|
+
reactNative.Platform.OS === "android" ? styles11.searchInputAndroid : null
|
|
1839
2968
|
],
|
|
1840
2969
|
accessibilityLabel: searchPlaceholder
|
|
1841
2970
|
}
|
|
@@ -1844,12 +2973,12 @@ var Select = react.forwardRef(
|
|
|
1844
2973
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1845
2974
|
reactNative.ScrollView,
|
|
1846
2975
|
{
|
|
1847
|
-
style:
|
|
1848
|
-
contentContainerStyle:
|
|
2976
|
+
style: styles11.optionList,
|
|
2977
|
+
contentContainerStyle: styles11.optionListContent,
|
|
1849
2978
|
keyboardShouldPersistTaps: "handled",
|
|
1850
2979
|
showsVerticalScrollIndicator: false,
|
|
1851
2980
|
children: [
|
|
1852
|
-
loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style:
|
|
2981
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.statusRow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.statusText, children: "Loading..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles11.statusRow, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.statusText, children: emptyText }) }) : null,
|
|
1853
2982
|
!loading && filteredOptions.map((option) => {
|
|
1854
2983
|
const isSelected = selectedValues.includes(option.value);
|
|
1855
2984
|
const isHovered = hoveredValue === option.value;
|
|
@@ -1866,14 +2995,14 @@ var Select = react.forwardRef(
|
|
|
1866
2995
|
accessibilityRole: multiple ? "checkbox" : "button",
|
|
1867
2996
|
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
1868
2997
|
style: [
|
|
1869
|
-
|
|
2998
|
+
styles11.item,
|
|
1870
2999
|
{
|
|
1871
3000
|
backgroundColor: itemBackground(visualState)
|
|
1872
3001
|
}
|
|
1873
3002
|
],
|
|
1874
3003
|
children: [
|
|
1875
|
-
multiple ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style:
|
|
1876
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style:
|
|
3004
|
+
multiple ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { pointerEvents: "none", style: styles11.itemCheckbox, children: /* @__PURE__ */ jsxRuntime.jsx(Checkbox, { value: isSelected, variant: "light" }) }) : null,
|
|
3005
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles11.itemLabel, numberOfLines: 1, children: option.label })
|
|
1877
3006
|
]
|
|
1878
3007
|
},
|
|
1879
3008
|
option.value
|
|
@@ -1884,15 +3013,15 @@ var Select = react.forwardRef(
|
|
|
1884
3013
|
)
|
|
1885
3014
|
] }) : null
|
|
1886
3015
|
] }),
|
|
1887
|
-
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3016
|
+
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles11.hint, { color: hintColor }], children: hint }) : null
|
|
1888
3017
|
]
|
|
1889
3018
|
}
|
|
1890
3019
|
);
|
|
1891
3020
|
}
|
|
1892
3021
|
);
|
|
1893
|
-
var
|
|
3022
|
+
var styles11 = reactNative.StyleSheet.create({
|
|
1894
3023
|
root: {
|
|
1895
|
-
width:
|
|
3024
|
+
width: DEFAULT_WIDTH3,
|
|
1896
3025
|
gap: 8,
|
|
1897
3026
|
alignSelf: "flex-start"
|
|
1898
3027
|
},
|
|
@@ -1913,8 +3042,8 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
1913
3042
|
zIndex: 20
|
|
1914
3043
|
},
|
|
1915
3044
|
trigger: {
|
|
1916
|
-
height:
|
|
1917
|
-
borderRadius:
|
|
3045
|
+
height: TRIGGER_HEIGHT2,
|
|
3046
|
+
borderRadius: TRIGGER_RADIUS2,
|
|
1918
3047
|
borderWidth: 1,
|
|
1919
3048
|
paddingVertical: 12,
|
|
1920
3049
|
paddingHorizontal: 16,
|
|
@@ -1980,8 +3109,8 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
1980
3109
|
lineHeight: 16
|
|
1981
3110
|
},
|
|
1982
3111
|
iconSlot: {
|
|
1983
|
-
width:
|
|
1984
|
-
height:
|
|
3112
|
+
width: ICON_SIZE6,
|
|
3113
|
+
height: ICON_SIZE6,
|
|
1985
3114
|
alignItems: "center",
|
|
1986
3115
|
justifyContent: "center",
|
|
1987
3116
|
flexShrink: 0
|
|
@@ -1996,7 +3125,7 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
1996
3125
|
right: 0,
|
|
1997
3126
|
marginTop: 8,
|
|
1998
3127
|
zIndex: 10,
|
|
1999
|
-
borderRadius:
|
|
3128
|
+
borderRadius: MENU_RADIUS3,
|
|
2000
3129
|
padding: 12,
|
|
2001
3130
|
gap: 8,
|
|
2002
3131
|
backgroundColor: colors.grey700,
|
|
@@ -2026,7 +3155,7 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
2026
3155
|
},
|
|
2027
3156
|
searchField: {
|
|
2028
3157
|
height: 40,
|
|
2029
|
-
borderRadius:
|
|
3158
|
+
borderRadius: ITEM_RADIUS2,
|
|
2030
3159
|
paddingHorizontal: 12,
|
|
2031
3160
|
flexDirection: "row",
|
|
2032
3161
|
alignItems: "center",
|
|
@@ -2048,7 +3177,7 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
2048
3177
|
},
|
|
2049
3178
|
item: {
|
|
2050
3179
|
minHeight: 43,
|
|
2051
|
-
borderRadius:
|
|
3180
|
+
borderRadius: ITEM_RADIUS2,
|
|
2052
3181
|
padding: 12,
|
|
2053
3182
|
flexDirection: "row",
|
|
2054
3183
|
alignItems: "center",
|
|
@@ -2066,7 +3195,7 @@ var styles5 = reactNative.StyleSheet.create({
|
|
|
2066
3195
|
...selectTypography.hint
|
|
2067
3196
|
}
|
|
2068
3197
|
});
|
|
2069
|
-
var
|
|
3198
|
+
var DEFAULT_WIDTH4 = 308;
|
|
2070
3199
|
var FIELD_HEIGHT = 100;
|
|
2071
3200
|
var FIELD_RADIUS = 16;
|
|
2072
3201
|
var FIELD_PADDING_VERTICAL = 12;
|
|
@@ -2152,13 +3281,13 @@ var Textarea = react.forwardRef(function Textarea2({
|
|
|
2152
3281
|
const resolvedAccessibilityLabel = accessibilityLabel ?? (showLabel ? void 0 : label);
|
|
2153
3282
|
useApplyWebClassName(rootRef, className);
|
|
2154
3283
|
useApplyWebClassName(inputRef, inputClassName);
|
|
2155
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: rootRef, style: [
|
|
2156
|
-
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3284
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { ref: rootRef, style: [styles12.root, disabled && styles12.disabled, style], children: [
|
|
3285
|
+
showLabel && label ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.label, { color: chrome.labelColor }], children: label }) : null,
|
|
2157
3286
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2158
3287
|
reactNative.View,
|
|
2159
3288
|
{
|
|
2160
3289
|
style: [
|
|
2161
|
-
|
|
3290
|
+
styles12.field,
|
|
2162
3291
|
{
|
|
2163
3292
|
borderColor: chrome.borderColor,
|
|
2164
3293
|
backgroundColor: chrome.backgroundColor
|
|
@@ -2190,11 +3319,11 @@ var Textarea = react.forwardRef(function Textarea2({
|
|
|
2190
3319
|
onBlur?.(event);
|
|
2191
3320
|
},
|
|
2192
3321
|
style: [
|
|
2193
|
-
|
|
3322
|
+
styles12.input,
|
|
2194
3323
|
textareaTypography.field,
|
|
2195
3324
|
{ color: chrome.textColor },
|
|
2196
|
-
reactNative.Platform.OS === "web" ?
|
|
2197
|
-
reactNative.Platform.OS === "android" ?
|
|
3325
|
+
reactNative.Platform.OS === "web" ? styles12.inputWeb : null,
|
|
3326
|
+
reactNative.Platform.OS === "android" ? styles12.inputAndroid : null,
|
|
2198
3327
|
inputStyle
|
|
2199
3328
|
],
|
|
2200
3329
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -2203,12 +3332,12 @@ var Textarea = react.forwardRef(function Textarea2({
|
|
|
2203
3332
|
)
|
|
2204
3333
|
}
|
|
2205
3334
|
),
|
|
2206
|
-
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3335
|
+
showHint && hint ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles12.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
2207
3336
|
] });
|
|
2208
3337
|
});
|
|
2209
|
-
var
|
|
3338
|
+
var styles12 = reactNative.StyleSheet.create({
|
|
2210
3339
|
root: {
|
|
2211
|
-
width:
|
|
3340
|
+
width: DEFAULT_WIDTH4,
|
|
2212
3341
|
gap: 8,
|
|
2213
3342
|
alignSelf: "flex-start"
|
|
2214
3343
|
},
|
|
@@ -2249,7 +3378,7 @@ var TRACK_RADIUS = 43;
|
|
|
2249
3378
|
var TRACK_PADDING = 4;
|
|
2250
3379
|
var THUMB_SIZE = TRACK_HEIGHT - TRACK_PADDING * 2;
|
|
2251
3380
|
var THUMB_TRAVEL = TRACK_WIDTH - TRACK_PADDING * 2 - THUMB_SIZE;
|
|
2252
|
-
var
|
|
3381
|
+
var ANIMATION_DURATION2 = 300;
|
|
2253
3382
|
var Toggle = react.forwardRef(function Toggle2({
|
|
2254
3383
|
value,
|
|
2255
3384
|
defaultValue = false,
|
|
@@ -2276,7 +3405,7 @@ var Toggle = react.forwardRef(function Toggle2({
|
|
|
2276
3405
|
react.useEffect(() => {
|
|
2277
3406
|
reactNative.Animated.timing(progress, {
|
|
2278
3407
|
toValue: isActive ? 1 : 0,
|
|
2279
|
-
duration:
|
|
3408
|
+
duration: ANIMATION_DURATION2,
|
|
2280
3409
|
easing: reactNative.Easing.out(reactNative.Easing.ease),
|
|
2281
3410
|
useNativeDriver: false
|
|
2282
3411
|
}).start();
|
|
@@ -2306,13 +3435,13 @@ var Toggle = react.forwardRef(function Toggle2({
|
|
|
2306
3435
|
accessibilityRole: "switch",
|
|
2307
3436
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2308
3437
|
accessibilityState: { checked: isActive, disabled },
|
|
2309
|
-
style: [
|
|
3438
|
+
style: [styles13.pressable, disabled && styles13.disabled, style],
|
|
2310
3439
|
children: [
|
|
2311
3440
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2312
3441
|
reactNative.Animated.View,
|
|
2313
3442
|
{
|
|
2314
3443
|
style: [
|
|
2315
|
-
|
|
3444
|
+
styles13.track,
|
|
2316
3445
|
{
|
|
2317
3446
|
backgroundColor: trackBackgroundColor
|
|
2318
3447
|
}
|
|
@@ -2321,7 +3450,7 @@ var Toggle = react.forwardRef(function Toggle2({
|
|
|
2321
3450
|
reactNative.Animated.View,
|
|
2322
3451
|
{
|
|
2323
3452
|
style: [
|
|
2324
|
-
|
|
3453
|
+
styles13.thumb,
|
|
2325
3454
|
{
|
|
2326
3455
|
transform: [{ translateX: thumbTranslateX }]
|
|
2327
3456
|
}
|
|
@@ -2330,12 +3459,12 @@ var Toggle = react.forwardRef(function Toggle2({
|
|
|
2330
3459
|
)
|
|
2331
3460
|
}
|
|
2332
3461
|
),
|
|
2333
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
|
|
3462
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles13.label, labelStyle], children: labelContent }) : labelContent : null
|
|
2334
3463
|
]
|
|
2335
3464
|
}
|
|
2336
3465
|
);
|
|
2337
3466
|
});
|
|
2338
|
-
var
|
|
3467
|
+
var styles13 = reactNative.StyleSheet.create({
|
|
2339
3468
|
pressable: {
|
|
2340
3469
|
flexDirection: "row",
|
|
2341
3470
|
alignItems: "center",
|
|
@@ -2366,17 +3495,22 @@ var styles7 = reactNative.StyleSheet.create({
|
|
|
2366
3495
|
|
|
2367
3496
|
exports.ArrowRightIcon = ArrowRightIcon;
|
|
2368
3497
|
exports.Avatar = Avatar;
|
|
3498
|
+
exports.Badge = Badge;
|
|
2369
3499
|
exports.BagIcon = BagIcon;
|
|
2370
3500
|
exports.BellIcon = BellIcon;
|
|
2371
3501
|
exports.BuildingIcon = BuildingIcon;
|
|
2372
3502
|
exports.Button = Button;
|
|
2373
3503
|
exports.CalendarIcon = CalendarIcon;
|
|
3504
|
+
exports.CalendarOutlineIcon = CalendarOutlineIcon;
|
|
2374
3505
|
exports.CameraIcon = CameraIcon;
|
|
2375
3506
|
exports.CheckBadgeIcon = CheckBadgeIcon;
|
|
2376
3507
|
exports.CheckIcon = CheckIcon;
|
|
2377
3508
|
exports.Checkbox = Checkbox;
|
|
2378
3509
|
exports.ChevronDownIcon = ChevronDownIcon;
|
|
3510
|
+
exports.ChevronLeftIcon = ChevronLeftIcon;
|
|
2379
3511
|
exports.ClockIcon = ClockIcon;
|
|
3512
|
+
exports.Counter = Counter;
|
|
3513
|
+
exports.DatePicker = DatePicker;
|
|
2380
3514
|
exports.FacebookIcon = FacebookIcon;
|
|
2381
3515
|
exports.HeartIcon = HeartIcon;
|
|
2382
3516
|
exports.HelpCircleIcon = HelpCircleIcon;
|
|
@@ -2389,19 +3523,29 @@ exports.LayoutGridIcon = LayoutGridIcon;
|
|
|
2389
3523
|
exports.LinkedInIcon = LinkedInIcon;
|
|
2390
3524
|
exports.LogOutIcon = LogOutIcon;
|
|
2391
3525
|
exports.MailIcon = MailIcon;
|
|
3526
|
+
exports.MenuItem = MenuItem;
|
|
3527
|
+
exports.MinusIcon = MinusIcon;
|
|
2392
3528
|
exports.NavigateIcon = NavigateIcon;
|
|
2393
3529
|
exports.PhoneIcon = PhoneIcon;
|
|
3530
|
+
exports.PlusIcon = PlusIcon;
|
|
2394
3531
|
exports.SearchIcon = SearchIcon;
|
|
3532
|
+
exports.SegmentedToggle = SegmentedToggle;
|
|
2395
3533
|
exports.Select = Select;
|
|
2396
3534
|
exports.SettingsIcon = SettingsIcon;
|
|
2397
3535
|
exports.ShowIcon = ShowIcon;
|
|
3536
|
+
exports.SidebarIcon = SidebarIcon;
|
|
3537
|
+
exports.StatCard = StatCard;
|
|
2398
3538
|
exports.Textarea = Textarea;
|
|
2399
3539
|
exports.Toggle = Toggle;
|
|
2400
3540
|
exports.UserIcon = UserIcon;
|
|
3541
|
+
exports.UsersAltIcon = UsersAltIcon;
|
|
2401
3542
|
exports.VideoIcon = VideoIcon;
|
|
2402
3543
|
exports.avatarTypography = avatarTypography;
|
|
3544
|
+
exports.badgeTypography = badgeTypography;
|
|
2403
3545
|
exports.buttonTypography = buttonTypography;
|
|
2404
3546
|
exports.colors = colors;
|
|
3547
|
+
exports.counterTypography = counterTypography;
|
|
3548
|
+
exports.datePickerTypography = datePickerTypography;
|
|
2405
3549
|
exports.fonts = fonts;
|
|
2406
3550
|
exports.getIconsByGroup = getIconsByGroup;
|
|
2407
3551
|
exports.grey = grey;
|
|
@@ -2410,7 +3554,9 @@ exports.iconGroups = iconGroups;
|
|
|
2410
3554
|
exports.iconNames = iconNames;
|
|
2411
3555
|
exports.icons = icons;
|
|
2412
3556
|
exports.inputTypography = inputTypography;
|
|
3557
|
+
exports.segmentedToggleTypography = segmentedToggleTypography;
|
|
2413
3558
|
exports.selectTypography = selectTypography;
|
|
3559
|
+
exports.statCardTypography = statCardTypography;
|
|
2414
3560
|
exports.textareaTypography = textareaTypography;
|
|
2415
3561
|
//# sourceMappingURL=index.cjs.map
|
|
2416
3562
|
//# sourceMappingURL=index.cjs.map
|