@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.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { forwardRef, useRef, useMemo, useState, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { Pressable, View, Text, StyleSheet, Platform, Image, Animated, Easing, TouchableOpacity, TextInput, ScrollView } from 'react-native';
|
|
3
3
|
import Svg, { Path } from 'react-native-svg';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -30,10 +30,17 @@ var colors = {
|
|
|
30
30
|
primary: "#B46436",
|
|
31
31
|
black: "#000000",
|
|
32
32
|
white: "#ffffff",
|
|
33
|
+
whiteAlpha86: "#FFFFFFDB",
|
|
34
|
+
whiteAlpha40: "#FFFFFF66",
|
|
35
|
+
whiteAlpha20: "#FFFFFF33",
|
|
36
|
+
whiteAlpha10: "#FFFFFF1A",
|
|
37
|
+
whiteAlpha5: "#FFFFFF0D",
|
|
33
38
|
dark: "#090909",
|
|
34
39
|
red: "#A63E3E",
|
|
35
40
|
lightGrey: "#B7B7B7",
|
|
41
|
+
green: "#34A853",
|
|
36
42
|
primaryMuted: "#B464360F",
|
|
43
|
+
primaryHover: "#B4643633",
|
|
37
44
|
redMuted: "#A63E3E0F",
|
|
38
45
|
redHover: "#A63E3E33",
|
|
39
46
|
grey0: grey["0"],
|
|
@@ -73,6 +80,34 @@ var buttonTypography = {
|
|
|
73
80
|
letterSpacing: 0.36
|
|
74
81
|
}
|
|
75
82
|
};
|
|
83
|
+
var badgeTypography = {
|
|
84
|
+
fontFamily: fonts.sans,
|
|
85
|
+
fontSize: 14,
|
|
86
|
+
fontWeight: "400",
|
|
87
|
+
lineHeight: 16,
|
|
88
|
+
letterSpacing: 0
|
|
89
|
+
};
|
|
90
|
+
var statCardTypography = {
|
|
91
|
+
fontFamily: fonts.sans,
|
|
92
|
+
fontSize: 16,
|
|
93
|
+
fontWeight: "500",
|
|
94
|
+
lineHeight: 16,
|
|
95
|
+
letterSpacing: 0
|
|
96
|
+
};
|
|
97
|
+
var segmentedToggleTypography = {
|
|
98
|
+
fontFamily: fonts.sans,
|
|
99
|
+
fontSize: 14,
|
|
100
|
+
fontWeight: "500",
|
|
101
|
+
lineHeight: 14,
|
|
102
|
+
letterSpacing: 0
|
|
103
|
+
};
|
|
104
|
+
var counterTypography = {
|
|
105
|
+
fontFamily: fonts.sans,
|
|
106
|
+
fontSize: 14,
|
|
107
|
+
fontWeight: "700",
|
|
108
|
+
lineHeight: 14,
|
|
109
|
+
letterSpacing: 0
|
|
110
|
+
};
|
|
76
111
|
var inputTypography = {
|
|
77
112
|
label: {
|
|
78
113
|
fontFamily: fonts.sans,
|
|
@@ -142,6 +177,38 @@ var avatarTypography = {
|
|
|
142
177
|
letterSpacing: 0
|
|
143
178
|
}
|
|
144
179
|
};
|
|
180
|
+
var datePickerTypography = {
|
|
181
|
+
field: {
|
|
182
|
+
fontFamily: fonts.sans,
|
|
183
|
+
fontSize: 12,
|
|
184
|
+
fontWeight: "400",
|
|
185
|
+
lineHeight: 12,
|
|
186
|
+
letterSpacing: 0.36
|
|
187
|
+
},
|
|
188
|
+
/** Calendar month/year heading — Bold, centered, White. */
|
|
189
|
+
monthHeading: {
|
|
190
|
+
fontFamily: fonts.sans,
|
|
191
|
+
fontSize: 14,
|
|
192
|
+
fontWeight: "700",
|
|
193
|
+
lineHeight: 14,
|
|
194
|
+
letterSpacing: 0
|
|
195
|
+
},
|
|
196
|
+
/** Weekday header (ԵՐ, ԵՔ, ...) — Regular, uppercase, centered, Grey/300. */
|
|
197
|
+
weekday: {
|
|
198
|
+
fontFamily: fonts.sans,
|
|
199
|
+
fontSize: 12,
|
|
200
|
+
fontWeight: "400",
|
|
201
|
+
lineHeight: 12,
|
|
202
|
+
letterSpacing: 0
|
|
203
|
+
},
|
|
204
|
+
day: {
|
|
205
|
+
fontFamily: fonts.sans,
|
|
206
|
+
fontSize: 14,
|
|
207
|
+
fontWeight: "400",
|
|
208
|
+
lineHeight: 14,
|
|
209
|
+
letterSpacing: 0
|
|
210
|
+
}
|
|
211
|
+
};
|
|
145
212
|
var textareaTypography = {
|
|
146
213
|
label: {
|
|
147
214
|
fontFamily: fonts.sans,
|
|
@@ -242,6 +309,25 @@ function CalendarIcon({ size = 20, color = colors.primary, strokeWidth = 1.5 })
|
|
|
242
309
|
) });
|
|
243
310
|
}
|
|
244
311
|
|
|
312
|
+
// src/icons/CalendarOutline/calendarOutlinePath.ts
|
|
313
|
+
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";
|
|
314
|
+
function CalendarOutlineIcon({
|
|
315
|
+
size = 20,
|
|
316
|
+
color = colors.primary,
|
|
317
|
+
strokeWidth = 1.5
|
|
318
|
+
}) {
|
|
319
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
|
|
320
|
+
Path,
|
|
321
|
+
{
|
|
322
|
+
d: CALENDAR_OUTLINE_PATH,
|
|
323
|
+
stroke: color,
|
|
324
|
+
strokeWidth,
|
|
325
|
+
strokeLinecap: "round",
|
|
326
|
+
strokeLinejoin: "round"
|
|
327
|
+
}
|
|
328
|
+
) });
|
|
329
|
+
}
|
|
330
|
+
|
|
245
331
|
// src/icons/Camera/cameraPath.ts
|
|
246
332
|
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";
|
|
247
333
|
function CameraIcon({ size = 24, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -306,6 +392,21 @@ function ChevronDownIcon({
|
|
|
306
392
|
) });
|
|
307
393
|
}
|
|
308
394
|
|
|
395
|
+
// src/icons/ChevronLeft/chevronLeftPath.ts
|
|
396
|
+
var CHEVRON_LEFT_PATH = "M12.5 15L7.5 10L12.5 5";
|
|
397
|
+
function ChevronLeftIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
398
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
399
|
+
Path,
|
|
400
|
+
{
|
|
401
|
+
d: CHEVRON_LEFT_PATH,
|
|
402
|
+
stroke: color,
|
|
403
|
+
strokeWidth,
|
|
404
|
+
strokeLinecap: "round",
|
|
405
|
+
strokeLinejoin: "round"
|
|
406
|
+
}
|
|
407
|
+
) });
|
|
408
|
+
}
|
|
409
|
+
|
|
309
410
|
// src/icons/Clock/clockPath.ts
|
|
310
411
|
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";
|
|
311
412
|
function ClockIcon({ size = 24, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -454,6 +555,21 @@ function MailIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
454
555
|
) });
|
|
455
556
|
}
|
|
456
557
|
|
|
558
|
+
// src/icons/Minus/minusPath.ts
|
|
559
|
+
var MINUS_PATH = "M3.33337 8H12.6667";
|
|
560
|
+
function MinusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
|
|
561
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
|
|
562
|
+
Path,
|
|
563
|
+
{
|
|
564
|
+
d: MINUS_PATH,
|
|
565
|
+
stroke: color,
|
|
566
|
+
strokeWidth,
|
|
567
|
+
strokeLinecap: "round",
|
|
568
|
+
strokeLinejoin: "round"
|
|
569
|
+
}
|
|
570
|
+
) });
|
|
571
|
+
}
|
|
572
|
+
|
|
457
573
|
// src/icons/Navigate/navigatePath.ts
|
|
458
574
|
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";
|
|
459
575
|
function NavigateIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -484,6 +600,21 @@ function PhoneIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
484
600
|
) });
|
|
485
601
|
}
|
|
486
602
|
|
|
603
|
+
// src/icons/Plus/plusPath.ts
|
|
604
|
+
var PLUS_PATH = "M8.00004 3.33325V12.6666M3.33337 7.99992H12.6667";
|
|
605
|
+
function PlusIcon({ size = 16, color = colors.white, strokeWidth = 2 }) {
|
|
606
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ jsx(
|
|
607
|
+
Path,
|
|
608
|
+
{
|
|
609
|
+
d: PLUS_PATH,
|
|
610
|
+
stroke: color,
|
|
611
|
+
strokeWidth,
|
|
612
|
+
strokeLinecap: "round",
|
|
613
|
+
strokeLinejoin: "round"
|
|
614
|
+
}
|
|
615
|
+
) });
|
|
616
|
+
}
|
|
617
|
+
|
|
487
618
|
// src/icons/Search/searchPath.ts
|
|
488
619
|
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";
|
|
489
620
|
var SEARCH_HANDLE_PATH = "M17.5 17.5L13.875 13.875";
|
|
@@ -559,6 +690,21 @@ function ShowIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
559
690
|
] });
|
|
560
691
|
}
|
|
561
692
|
|
|
693
|
+
// src/icons/Sidebar/sidebarPath.ts
|
|
694
|
+
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";
|
|
695
|
+
function SidebarIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
696
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
697
|
+
Path,
|
|
698
|
+
{
|
|
699
|
+
d: SIDEBAR_PATH,
|
|
700
|
+
stroke: color,
|
|
701
|
+
strokeWidth,
|
|
702
|
+
strokeLinecap: "round",
|
|
703
|
+
strokeLinejoin: "round"
|
|
704
|
+
}
|
|
705
|
+
) });
|
|
706
|
+
}
|
|
707
|
+
|
|
562
708
|
// src/icons/User/userPath.ts
|
|
563
709
|
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";
|
|
564
710
|
function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -574,6 +720,12 @@ function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
574
720
|
) });
|
|
575
721
|
}
|
|
576
722
|
|
|
723
|
+
// src/icons/UsersAlt/usersAltPath.ts
|
|
724
|
+
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";
|
|
725
|
+
function UsersAltIcon({ size = 28, color = colors.white }) {
|
|
726
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 28 28", fill: "none", children: /* @__PURE__ */ jsx(Path, { d: USERS_ALT_PATH, fill: color }) });
|
|
727
|
+
}
|
|
728
|
+
|
|
577
729
|
// src/icons/Video/videoPath.ts
|
|
578
730
|
var VIDEO_PATHS = [
|
|
579
731
|
"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",
|
|
@@ -600,10 +752,12 @@ var icons = {
|
|
|
600
752
|
bell: BellIcon,
|
|
601
753
|
building: BuildingIcon,
|
|
602
754
|
calendar: CalendarIcon,
|
|
755
|
+
calendarOutline: CalendarOutlineIcon,
|
|
603
756
|
camera: CameraIcon,
|
|
604
757
|
check: CheckIcon,
|
|
605
758
|
checkBadge: CheckBadgeIcon,
|
|
606
759
|
chevronDown: ChevronDownIcon,
|
|
760
|
+
chevronLeft: ChevronLeftIcon,
|
|
607
761
|
clock: ClockIcon,
|
|
608
762
|
facebook: FacebookIcon,
|
|
609
763
|
heart: HeartIcon,
|
|
@@ -615,22 +769,39 @@ var icons = {
|
|
|
615
769
|
linkedin: LinkedInIcon,
|
|
616
770
|
logOut: LogOutIcon,
|
|
617
771
|
mail: MailIcon,
|
|
772
|
+
minus: MinusIcon,
|
|
618
773
|
navigate: NavigateIcon,
|
|
619
774
|
phone: PhoneIcon,
|
|
775
|
+
plus: PlusIcon,
|
|
620
776
|
search: SearchIcon,
|
|
621
777
|
settings: SettingsIcon,
|
|
622
778
|
show: ShowIcon,
|
|
779
|
+
sidebar: SidebarIcon,
|
|
623
780
|
user: UserIcon,
|
|
781
|
+
usersAlt: UsersAltIcon,
|
|
624
782
|
video: VideoIcon
|
|
625
783
|
};
|
|
626
784
|
var iconNames = Object.keys(icons);
|
|
627
785
|
var iconGroups = {
|
|
628
|
-
navigation: ["arrowRight", "chevronDown", "home", "navigate"],
|
|
629
|
-
actions: [
|
|
630
|
-
|
|
786
|
+
navigation: ["arrowRight", "chevronDown", "chevronLeft", "home", "navigate"],
|
|
787
|
+
actions: [
|
|
788
|
+
"show",
|
|
789
|
+
"bell",
|
|
790
|
+
"camera",
|
|
791
|
+
"key",
|
|
792
|
+
"check",
|
|
793
|
+
"checkBadge",
|
|
794
|
+
"search",
|
|
795
|
+
"calendar",
|
|
796
|
+
"calendarOutline",
|
|
797
|
+
"heart",
|
|
798
|
+
"minus",
|
|
799
|
+
"plus"
|
|
800
|
+
],
|
|
801
|
+
objects: ["bag", "building", "clock", "user", "usersAlt", "video"],
|
|
631
802
|
communication: ["mail", "phone"],
|
|
632
803
|
social: ["facebook", "instagram", "linkedin"],
|
|
633
|
-
interface: ["layoutGrid", "settings", "helpCircle", "logOut"]
|
|
804
|
+
interface: ["layoutGrid", "sidebar", "settings", "helpCircle", "logOut"]
|
|
634
805
|
};
|
|
635
806
|
var iconGroupNames = Object.keys(iconGroups);
|
|
636
807
|
function getIconsByGroup(group) {
|
|
@@ -692,13 +863,104 @@ function useApplyWebClassName(ref, className, enabled = true) {
|
|
|
692
863
|
};
|
|
693
864
|
}, [ref, className, enabled]);
|
|
694
865
|
}
|
|
866
|
+
var ITEM_RADIUS = 12;
|
|
867
|
+
var ICON_SIZE = 16;
|
|
868
|
+
var MenuItem = forwardRef(function MenuItem2({
|
|
869
|
+
icon,
|
|
870
|
+
label,
|
|
871
|
+
onPress,
|
|
872
|
+
disabled = false,
|
|
873
|
+
backgroundColor,
|
|
874
|
+
hoverColor,
|
|
875
|
+
style,
|
|
876
|
+
labelStyle,
|
|
877
|
+
className,
|
|
878
|
+
accessibilityLabel,
|
|
879
|
+
hitSlop = 4,
|
|
880
|
+
onHoverIn,
|
|
881
|
+
onHoverOut,
|
|
882
|
+
onPressIn,
|
|
883
|
+
onPressOut,
|
|
884
|
+
...rest
|
|
885
|
+
}, forwardedRef) {
|
|
886
|
+
const containerRef = useRef(null);
|
|
887
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
888
|
+
const [hovered, setHovered] = useState(false);
|
|
889
|
+
useApplyWebClassName(containerRef, className);
|
|
890
|
+
const resolvedBackground = hovered ? hoverColor ?? colors.grey600 : backgroundColor ?? "transparent";
|
|
891
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? label;
|
|
892
|
+
return /* @__PURE__ */ jsxs(
|
|
893
|
+
Pressable,
|
|
894
|
+
{
|
|
895
|
+
...rest,
|
|
896
|
+
ref: setContainerRef,
|
|
897
|
+
onPress,
|
|
898
|
+
disabled,
|
|
899
|
+
hitSlop,
|
|
900
|
+
onHoverIn: (event) => {
|
|
901
|
+
setHovered(true);
|
|
902
|
+
onHoverIn?.(event);
|
|
903
|
+
},
|
|
904
|
+
onHoverOut: (event) => {
|
|
905
|
+
setHovered(false);
|
|
906
|
+
onHoverOut?.(event);
|
|
907
|
+
},
|
|
908
|
+
onPressIn: (event) => {
|
|
909
|
+
setHovered(true);
|
|
910
|
+
onPressIn?.(event);
|
|
911
|
+
},
|
|
912
|
+
onPressOut: (event) => {
|
|
913
|
+
setHovered(false);
|
|
914
|
+
onPressOut?.(event);
|
|
915
|
+
},
|
|
916
|
+
accessibilityRole: "menuitem",
|
|
917
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
918
|
+
accessibilityState: { disabled },
|
|
919
|
+
style: [
|
|
920
|
+
styles.root,
|
|
921
|
+
{ backgroundColor: resolvedBackground },
|
|
922
|
+
disabled && styles.disabled,
|
|
923
|
+
style
|
|
924
|
+
],
|
|
925
|
+
children: [
|
|
926
|
+
icon ? /* @__PURE__ */ jsx(View, { style: styles.iconSlot, children: icon }) : null,
|
|
927
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.label, labelStyle], numberOfLines: 1, children: label })
|
|
928
|
+
]
|
|
929
|
+
}
|
|
930
|
+
);
|
|
931
|
+
});
|
|
932
|
+
var styles = StyleSheet.create({
|
|
933
|
+
root: {
|
|
934
|
+
minHeight: 40,
|
|
935
|
+
borderRadius: ITEM_RADIUS,
|
|
936
|
+
paddingVertical: 12,
|
|
937
|
+
paddingHorizontal: 12,
|
|
938
|
+
flexDirection: "row",
|
|
939
|
+
alignItems: "center",
|
|
940
|
+
gap: 8,
|
|
941
|
+
alignSelf: "stretch"
|
|
942
|
+
},
|
|
943
|
+
disabled: {
|
|
944
|
+
opacity: 0.5
|
|
945
|
+
},
|
|
946
|
+
iconSlot: {
|
|
947
|
+
width: ICON_SIZE,
|
|
948
|
+
height: ICON_SIZE,
|
|
949
|
+
alignItems: "center",
|
|
950
|
+
justifyContent: "center",
|
|
951
|
+
flexShrink: 0
|
|
952
|
+
},
|
|
953
|
+
label: {
|
|
954
|
+
...avatarTypography.menuItem,
|
|
955
|
+
color: colors.white,
|
|
956
|
+
flex: 1
|
|
957
|
+
}
|
|
958
|
+
});
|
|
695
959
|
var IMAGE_SIZE = 48;
|
|
696
960
|
var CONTAINER_RADIUS = 71;
|
|
697
961
|
var CHEVRON_SIZE = 20;
|
|
698
962
|
var FALLBACK_ICON_SIZE = 20;
|
|
699
963
|
var MENU_RADIUS = 16;
|
|
700
|
-
var MENU_ITEM_RADIUS = 12;
|
|
701
|
-
var MENU_ITEM_ICON_SIZE = 16;
|
|
702
964
|
var Avatar = forwardRef(function Avatar2({
|
|
703
965
|
name,
|
|
704
966
|
email,
|
|
@@ -721,8 +983,8 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
721
983
|
const containerRef = useRef(null);
|
|
722
984
|
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
723
985
|
const [imageFailed, setImageFailed] = useState(false);
|
|
724
|
-
const
|
|
725
|
-
const hasMenu =
|
|
986
|
+
const resolvedMenuItems = menuItems ?? [];
|
|
987
|
+
const hasMenu = resolvedMenuItems.length > 0;
|
|
726
988
|
const isInteractive = onPress != null || hasMenu;
|
|
727
989
|
const isOpenControlled = typeof openProp === "boolean";
|
|
728
990
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
@@ -732,7 +994,6 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
732
994
|
(next) => {
|
|
733
995
|
if (!isOpenControlled) setUncontrolledOpen(next);
|
|
734
996
|
onOpenChange?.(next);
|
|
735
|
-
if (!next) setHoveredKey(null);
|
|
736
997
|
},
|
|
737
998
|
[isOpenControlled, onOpenChange]
|
|
738
999
|
);
|
|
@@ -785,7 +1046,7 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
785
1046
|
}, [isOpen, closeAndFocusTrigger]);
|
|
786
1047
|
const hasImage = Boolean(imageUrl) && !imageFailed;
|
|
787
1048
|
const resolvedAccessibilityLabel = accessibilityLabel ?? [name, email].filter(Boolean).join(", ");
|
|
788
|
-
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [
|
|
1049
|
+
return /* @__PURE__ */ jsxs(View, { ref: wrapperRef, style: [styles2.wrapper, isOpen && styles2.wrapperOpen], children: [
|
|
789
1050
|
/* @__PURE__ */ jsxs(
|
|
790
1051
|
Pressable,
|
|
791
1052
|
{
|
|
@@ -797,55 +1058,42 @@ var Avatar = forwardRef(function Avatar2({
|
|
|
797
1058
|
accessibilityRole: isInteractive ? "button" : void 0,
|
|
798
1059
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
799
1060
|
accessibilityState: isInteractive ? { disabled, expanded: hasMenu ? isOpen : void 0 } : void 0,
|
|
800
|
-
style: [
|
|
1061
|
+
style: [styles2.root, disabled && styles2.disabled, style],
|
|
801
1062
|
children: [
|
|
802
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
1063
|
+
/* @__PURE__ */ jsx(View, { style: styles2.imageWrap, children: hasImage ? /* @__PURE__ */ jsx(
|
|
803
1064
|
Image,
|
|
804
1065
|
{
|
|
805
1066
|
source: { uri: imageUrl ?? void 0 },
|
|
806
|
-
style:
|
|
1067
|
+
style: styles2.image,
|
|
807
1068
|
onError: () => setImageFailed(true)
|
|
808
1069
|
}
|
|
809
|
-
) : /* @__PURE__ */ jsx(View, { style:
|
|
810
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
811
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
812
|
-
email ? /* @__PURE__ */ jsx(Text, { style:
|
|
1070
|
+
) : /* @__PURE__ */ jsx(View, { style: styles2.imageFallback, children: /* @__PURE__ */ jsx(UserIcon, { size: FALLBACK_ICON_SIZE, color: colors.primary }) }) }),
|
|
1071
|
+
/* @__PURE__ */ jsxs(View, { style: styles2.textColumn, children: [
|
|
1072
|
+
/* @__PURE__ */ jsx(Text, { style: styles2.name, numberOfLines: 1, children: name }),
|
|
1073
|
+
email ? /* @__PURE__ */ jsx(Text, { style: styles2.email, numberOfLines: 1, children: email }) : null
|
|
813
1074
|
] }),
|
|
814
|
-
showChevron ? /* @__PURE__ */ jsx(View, { style: [
|
|
1075
|
+
showChevron ? /* @__PURE__ */ jsx(View, { style: [styles2.chevronSlot, isOpen && styles2.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: CHEVRON_SIZE, color: isOpen ? colors.primary : colors.grey100 }) }) : null
|
|
815
1076
|
]
|
|
816
1077
|
}
|
|
817
1078
|
),
|
|
818
|
-
hasMenu && isOpen ? /* @__PURE__ */ jsx(View, { style: [
|
|
1079
|
+
hasMenu && isOpen ? /* @__PURE__ */ jsx(View, { style: [styles2.menu, menuWidth != null && { right: void 0, width: menuWidth }], children: resolvedMenuItems.map((item) => {
|
|
819
1080
|
const itemKey = item.key ?? item.label;
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
return /* @__PURE__ */ jsxs(
|
|
823
|
-
Pressable,
|
|
1081
|
+
return /* @__PURE__ */ jsx(
|
|
1082
|
+
MenuItem,
|
|
824
1083
|
{
|
|
825
|
-
|
|
1084
|
+
icon: item.icon,
|
|
1085
|
+
label: item.label,
|
|
826
1086
|
disabled: item.disabled,
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
onPressOut: () => setHoveredKey((current) => current === itemKey ? null : current),
|
|
831
|
-
accessibilityRole: "menuitem",
|
|
832
|
-
accessibilityState: { disabled: item.disabled },
|
|
833
|
-
style: [
|
|
834
|
-
styles.menuItem,
|
|
835
|
-
{ backgroundColor },
|
|
836
|
-
item.disabled && styles.menuItemDisabled
|
|
837
|
-
],
|
|
838
|
-
children: [
|
|
839
|
-
item.icon ? /* @__PURE__ */ jsx(View, { style: styles.menuItemIcon, children: item.icon }) : null,
|
|
840
|
-
/* @__PURE__ */ jsx(Text, { style: styles.menuItemLabel, numberOfLines: 1, children: item.label })
|
|
841
|
-
]
|
|
1087
|
+
backgroundColor: item.backgroundColor,
|
|
1088
|
+
hoverColor: item.hoverColor,
|
|
1089
|
+
onPress: () => handleItemPress(item)
|
|
842
1090
|
},
|
|
843
1091
|
itemKey
|
|
844
1092
|
);
|
|
845
1093
|
}) }) : null
|
|
846
1094
|
] });
|
|
847
1095
|
});
|
|
848
|
-
var
|
|
1096
|
+
var styles2 = StyleSheet.create({
|
|
849
1097
|
wrapper: {
|
|
850
1098
|
position: "relative",
|
|
851
1099
|
alignSelf: "flex-start"
|
|
@@ -928,33 +1176,396 @@ var styles = StyleSheet.create({
|
|
|
928
1176
|
elevation: 8
|
|
929
1177
|
}
|
|
930
1178
|
})
|
|
931
|
-
}
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
1179
|
+
}
|
|
1180
|
+
});
|
|
1181
|
+
var ICON_SIZE2 = 20;
|
|
1182
|
+
var webBlurStyle = Platform.OS === "web" ? {
|
|
1183
|
+
backdropFilter: "blur(10.3px)",
|
|
1184
|
+
WebkitBackdropFilter: "blur(10.3px)"
|
|
1185
|
+
} : {};
|
|
1186
|
+
var variantConfig = {
|
|
1187
|
+
default: {
|
|
1188
|
+
backgroundColor: colors.grey750,
|
|
1189
|
+
iconColor: colors.white,
|
|
1190
|
+
border: false,
|
|
1191
|
+
blur: false
|
|
1192
|
+
},
|
|
1193
|
+
transparent: {
|
|
1194
|
+
backgroundColor: colors.whiteAlpha5,
|
|
1195
|
+
iconColor: colors.primary,
|
|
1196
|
+
border: true,
|
|
1197
|
+
blur: true
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
var Badge = forwardRef(function Badge2({ label, variant = "default", icon: Icon2, style, className, accessibilityLabel, ...rest }, forwardedRef) {
|
|
1201
|
+
const containerRef = useRef(null);
|
|
1202
|
+
const preset = variantConfig[variant];
|
|
1203
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1204
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1205
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1206
|
+
return /* @__PURE__ */ jsxs(
|
|
1207
|
+
View,
|
|
1208
|
+
{
|
|
1209
|
+
...rest,
|
|
1210
|
+
ref: setContainerRef,
|
|
1211
|
+
style: [
|
|
1212
|
+
styles3.base,
|
|
1213
|
+
{ backgroundColor: preset.backgroundColor },
|
|
1214
|
+
preset.border ? styles3.transparentBorder : null,
|
|
1215
|
+
preset.blur ? webBlurStyle : null,
|
|
1216
|
+
style
|
|
1217
|
+
],
|
|
1218
|
+
accessibilityRole: "text",
|
|
1219
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
1220
|
+
children: [
|
|
1221
|
+
Icon2 ? /* @__PURE__ */ jsx(View, { style: styles3.iconSlot, children: /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE2, color: preset.iconColor }) }) : null,
|
|
1222
|
+
/* @__PURE__ */ jsx(Text, { style: [styles3.label, Platform.OS === "android" ? styles3.labelAndroid : null], children: label })
|
|
1223
|
+
]
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
});
|
|
1227
|
+
var styles3 = StyleSheet.create({
|
|
1228
|
+
base: {
|
|
937
1229
|
flexDirection: "row",
|
|
938
1230
|
alignItems: "center",
|
|
939
|
-
|
|
1231
|
+
alignSelf: "flex-start",
|
|
1232
|
+
minHeight: 44,
|
|
1233
|
+
paddingVertical: 12,
|
|
1234
|
+
paddingHorizontal: 16,
|
|
1235
|
+
gap: 12,
|
|
1236
|
+
borderRadius: 79,
|
|
1237
|
+
overflow: "hidden",
|
|
1238
|
+
borderWidth: 0,
|
|
1239
|
+
borderColor: "transparent",
|
|
1240
|
+
borderStyle: "solid"
|
|
940
1241
|
},
|
|
941
|
-
|
|
942
|
-
|
|
1242
|
+
transparentBorder: {
|
|
1243
|
+
borderWidth: 1,
|
|
1244
|
+
borderColor: colors.whiteAlpha5,
|
|
1245
|
+
borderStyle: "solid"
|
|
943
1246
|
},
|
|
944
|
-
|
|
945
|
-
width:
|
|
946
|
-
height:
|
|
1247
|
+
iconSlot: {
|
|
1248
|
+
width: ICON_SIZE2,
|
|
1249
|
+
height: ICON_SIZE2,
|
|
947
1250
|
alignItems: "center",
|
|
948
1251
|
justifyContent: "center",
|
|
949
1252
|
flexShrink: 0
|
|
950
1253
|
},
|
|
951
|
-
|
|
952
|
-
...
|
|
953
|
-
color: colors.white
|
|
954
|
-
|
|
1254
|
+
label: {
|
|
1255
|
+
...badgeTypography,
|
|
1256
|
+
color: colors.white
|
|
1257
|
+
},
|
|
1258
|
+
labelAndroid: {
|
|
1259
|
+
includeFontPadding: false
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
var BUTTON_SIZE = 32;
|
|
1263
|
+
var webBlurStyle2 = Platform.OS === "web" ? {
|
|
1264
|
+
backdropFilter: "blur(20px)",
|
|
1265
|
+
WebkitBackdropFilter: "blur(20px)"
|
|
1266
|
+
} : {};
|
|
1267
|
+
function clamp(value, min, max) {
|
|
1268
|
+
return Math.max(min, max === void 0 ? value : Math.min(value, max));
|
|
1269
|
+
}
|
|
1270
|
+
var Counter = forwardRef(function Counter2({
|
|
1271
|
+
value,
|
|
1272
|
+
defaultValue,
|
|
1273
|
+
onValueChange,
|
|
1274
|
+
min = 1,
|
|
1275
|
+
max,
|
|
1276
|
+
step = 1,
|
|
1277
|
+
disabled = false,
|
|
1278
|
+
style,
|
|
1279
|
+
className,
|
|
1280
|
+
hitSlop,
|
|
1281
|
+
...rest
|
|
1282
|
+
}, forwardedRef) {
|
|
1283
|
+
const containerRef = useRef(null);
|
|
1284
|
+
const isControlled = value !== void 0;
|
|
1285
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
1286
|
+
() => clamp(defaultValue ?? min, min, max)
|
|
1287
|
+
);
|
|
1288
|
+
const resolvedValue = clamp(isControlled ? value : uncontrolledValue, min, max);
|
|
1289
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1290
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1291
|
+
const decrementDisabled = disabled || resolvedValue <= min;
|
|
1292
|
+
const incrementDisabled = disabled || max !== void 0 && resolvedValue >= max;
|
|
1293
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1294
|
+
const updateValue = (nextValue) => {
|
|
1295
|
+
const next = clamp(nextValue, min, max);
|
|
1296
|
+
if (next === resolvedValue) return;
|
|
1297
|
+
if (!isControlled) setUncontrolledValue(next);
|
|
1298
|
+
onValueChange?.(next);
|
|
1299
|
+
};
|
|
1300
|
+
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [styles4.base, style], children: [
|
|
1301
|
+
/* @__PURE__ */ jsx(
|
|
1302
|
+
Pressable,
|
|
1303
|
+
{
|
|
1304
|
+
disabled: decrementDisabled,
|
|
1305
|
+
hitSlop,
|
|
1306
|
+
onPress: () => updateValue(resolvedValue - step),
|
|
1307
|
+
accessibilityRole: "button",
|
|
1308
|
+
accessibilityLabel: "Decrease value",
|
|
1309
|
+
accessibilityState: { disabled: decrementDisabled },
|
|
1310
|
+
style: [styles4.button, webBlurStyle2, decrementDisabled && styles4.buttonDisabled],
|
|
1311
|
+
children: /* @__PURE__ */ jsx(MinusIcon, {})
|
|
1312
|
+
}
|
|
1313
|
+
),
|
|
1314
|
+
/* @__PURE__ */ jsx(Text, { style: styles4.value, children: resolvedValue }),
|
|
1315
|
+
/* @__PURE__ */ jsx(
|
|
1316
|
+
Pressable,
|
|
1317
|
+
{
|
|
1318
|
+
disabled: incrementDisabled,
|
|
1319
|
+
hitSlop,
|
|
1320
|
+
onPress: () => updateValue(resolvedValue + step),
|
|
1321
|
+
accessibilityRole: "button",
|
|
1322
|
+
accessibilityLabel: "Increase value",
|
|
1323
|
+
accessibilityState: { disabled: incrementDisabled },
|
|
1324
|
+
style: [styles4.button, webBlurStyle2, incrementDisabled && styles4.buttonDisabled],
|
|
1325
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
1326
|
+
}
|
|
1327
|
+
)
|
|
1328
|
+
] });
|
|
1329
|
+
});
|
|
1330
|
+
var styles4 = StyleSheet.create({
|
|
1331
|
+
base: {
|
|
1332
|
+
flexDirection: "row",
|
|
1333
|
+
alignItems: "center",
|
|
1334
|
+
alignSelf: "flex-start",
|
|
1335
|
+
gap: 17
|
|
1336
|
+
},
|
|
1337
|
+
button: {
|
|
1338
|
+
width: BUTTON_SIZE,
|
|
1339
|
+
height: BUTTON_SIZE,
|
|
1340
|
+
alignItems: "center",
|
|
1341
|
+
justifyContent: "center",
|
|
1342
|
+
borderWidth: 1,
|
|
1343
|
+
borderColor: colors.whiteAlpha10,
|
|
1344
|
+
borderRadius: 39
|
|
1345
|
+
},
|
|
1346
|
+
buttonDisabled: {
|
|
1347
|
+
opacity: 0.25
|
|
1348
|
+
},
|
|
1349
|
+
value: {
|
|
1350
|
+
...counterTypography,
|
|
1351
|
+
color: colors.white
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
var ICON_SIZE3 = 20;
|
|
1355
|
+
var ANIMATION_DURATION = 200;
|
|
1356
|
+
var SegmentedToggle = forwardRef(
|
|
1357
|
+
function SegmentedToggle2({
|
|
1358
|
+
options,
|
|
1359
|
+
value,
|
|
1360
|
+
defaultValue = options[0].value,
|
|
1361
|
+
onValueChange,
|
|
1362
|
+
fullWidth = true,
|
|
1363
|
+
disabled = false,
|
|
1364
|
+
style,
|
|
1365
|
+
className,
|
|
1366
|
+
hitSlop,
|
|
1367
|
+
onLayout,
|
|
1368
|
+
...rest
|
|
1369
|
+
}, forwardedRef) {
|
|
1370
|
+
const containerRef = useRef(null);
|
|
1371
|
+
const isControlled = value !== void 0;
|
|
1372
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
|
|
1373
|
+
const selectedValue = isControlled ? value : uncontrolledValue;
|
|
1374
|
+
const selectedIndex = Math.max(
|
|
1375
|
+
0,
|
|
1376
|
+
options.findIndex(({ value: optionValue }) => optionValue === selectedValue)
|
|
1377
|
+
);
|
|
1378
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1379
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1380
|
+
const progress = useRef(new Animated.Value(selectedIndex)).current;
|
|
1381
|
+
const [contentWidths, setContentWidths] = useState([0, 0]);
|
|
1382
|
+
const [containerWidth, setContainerWidth] = useState(0);
|
|
1383
|
+
const availableOptionWidth = Math.max(0, (containerWidth - 12) / 2);
|
|
1384
|
+
const widestContentWidth = Math.max(...contentWidths);
|
|
1385
|
+
const contentBasedOptionWidth = widestContentWidth > 0 ? widestContentWidth + 24 * 2 : 0;
|
|
1386
|
+
const optionWidth = fullWidth ? availableOptionWidth : contentBasedOptionWidth;
|
|
1387
|
+
const indicatorTranslateX = progress.interpolate({
|
|
1388
|
+
inputRange: [0, 1],
|
|
1389
|
+
outputRange: [0, optionWidth + 4]
|
|
1390
|
+
});
|
|
1391
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1392
|
+
useEffect(() => {
|
|
1393
|
+
const animation = Animated.timing(progress, {
|
|
1394
|
+
toValue: selectedIndex,
|
|
1395
|
+
duration: ANIMATION_DURATION,
|
|
1396
|
+
easing: Easing.out(Easing.cubic),
|
|
1397
|
+
useNativeDriver: true
|
|
1398
|
+
});
|
|
1399
|
+
animation.start();
|
|
1400
|
+
return () => animation.stop();
|
|
1401
|
+
}, [progress, selectedIndex]);
|
|
1402
|
+
const selectOption = (nextValue) => {
|
|
1403
|
+
if (disabled || nextValue === selectedValue) return;
|
|
1404
|
+
if (!isControlled) setUncontrolledValue(nextValue);
|
|
1405
|
+
onValueChange?.(nextValue);
|
|
1406
|
+
};
|
|
1407
|
+
return /* @__PURE__ */ jsxs(
|
|
1408
|
+
View,
|
|
1409
|
+
{
|
|
1410
|
+
...rest,
|
|
1411
|
+
ref: setContainerRef,
|
|
1412
|
+
onLayout: (event) => {
|
|
1413
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
1414
|
+
setContainerWidth(
|
|
1415
|
+
(currentWidth) => currentWidth === nextWidth ? currentWidth : nextWidth
|
|
1416
|
+
);
|
|
1417
|
+
onLayout?.(event);
|
|
1418
|
+
},
|
|
1419
|
+
style: [
|
|
1420
|
+
styles5.base,
|
|
1421
|
+
fullWidth ? styles5.fullWidth : styles5.contentWidth,
|
|
1422
|
+
disabled && styles5.disabled,
|
|
1423
|
+
style
|
|
1424
|
+
],
|
|
1425
|
+
accessibilityRole: "radiogroup",
|
|
1426
|
+
children: [
|
|
1427
|
+
optionWidth > 0 ? /* @__PURE__ */ jsx(
|
|
1428
|
+
Animated.View,
|
|
1429
|
+
{
|
|
1430
|
+
pointerEvents: "none",
|
|
1431
|
+
style: [
|
|
1432
|
+
styles5.activeIndicator,
|
|
1433
|
+
{ width: optionWidth, transform: [{ translateX: indicatorTranslateX }] }
|
|
1434
|
+
]
|
|
1435
|
+
}
|
|
1436
|
+
) : null,
|
|
1437
|
+
options.map(({ value: optionValue, label, icon: Icon2 }, index) => {
|
|
1438
|
+
const selected = optionValue === selectedValue;
|
|
1439
|
+
const iconColor = selected ? colors.primary : colors.whiteAlpha20;
|
|
1440
|
+
const labelColor = selected ? colors.whiteAlpha86 : colors.whiteAlpha40;
|
|
1441
|
+
return /* @__PURE__ */ jsx(
|
|
1442
|
+
Pressable,
|
|
1443
|
+
{
|
|
1444
|
+
onPress: () => selectOption(optionValue),
|
|
1445
|
+
disabled,
|
|
1446
|
+
hitSlop,
|
|
1447
|
+
accessibilityRole: "radio",
|
|
1448
|
+
accessibilityLabel: label,
|
|
1449
|
+
accessibilityState: { selected, disabled },
|
|
1450
|
+
style: [
|
|
1451
|
+
styles5.option,
|
|
1452
|
+
fullWidth ? styles5.optionFullWidth : optionWidth > 0 && { minWidth: optionWidth }
|
|
1453
|
+
],
|
|
1454
|
+
children: /* @__PURE__ */ jsxs(
|
|
1455
|
+
View,
|
|
1456
|
+
{
|
|
1457
|
+
onLayout: (event) => {
|
|
1458
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
1459
|
+
setContentWidths((currentWidths) => {
|
|
1460
|
+
if (currentWidths[index] === nextWidth) return currentWidths;
|
|
1461
|
+
const nextWidths = [currentWidths[0], currentWidths[1]];
|
|
1462
|
+
nextWidths[index] = nextWidth;
|
|
1463
|
+
return nextWidths;
|
|
1464
|
+
});
|
|
1465
|
+
},
|
|
1466
|
+
style: styles5.optionContent,
|
|
1467
|
+
children: [
|
|
1468
|
+
Icon2 ? /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE3, color: iconColor }) : null,
|
|
1469
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles5.label, { color: labelColor }], children: label })
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
)
|
|
1473
|
+
},
|
|
1474
|
+
optionValue
|
|
1475
|
+
);
|
|
1476
|
+
})
|
|
1477
|
+
]
|
|
1478
|
+
}
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
);
|
|
1482
|
+
var styles5 = StyleSheet.create({
|
|
1483
|
+
base: {
|
|
1484
|
+
height: 44,
|
|
1485
|
+
flexDirection: "row",
|
|
1486
|
+
padding: 4,
|
|
1487
|
+
gap: 4,
|
|
1488
|
+
borderRadius: 60,
|
|
1489
|
+
backgroundColor: colors.grey700,
|
|
1490
|
+
overflow: "hidden"
|
|
1491
|
+
},
|
|
1492
|
+
fullWidth: {
|
|
1493
|
+
width: "100%",
|
|
1494
|
+
alignSelf: "stretch"
|
|
1495
|
+
},
|
|
1496
|
+
contentWidth: {
|
|
1497
|
+
alignSelf: "flex-start"
|
|
1498
|
+
},
|
|
1499
|
+
disabled: {
|
|
1500
|
+
opacity: 0.6
|
|
1501
|
+
},
|
|
1502
|
+
option: {
|
|
1503
|
+
zIndex: 1,
|
|
1504
|
+
flexDirection: "row",
|
|
1505
|
+
alignItems: "center",
|
|
1506
|
+
justifyContent: "center",
|
|
1507
|
+
paddingHorizontal: 24,
|
|
1508
|
+
borderRadius: 60
|
|
1509
|
+
},
|
|
1510
|
+
optionContent: {
|
|
1511
|
+
maxWidth: "100%",
|
|
1512
|
+
flexDirection: "row",
|
|
1513
|
+
alignItems: "center",
|
|
1514
|
+
gap: 12
|
|
1515
|
+
},
|
|
1516
|
+
optionFullWidth: {
|
|
1517
|
+
flex: 1,
|
|
1518
|
+
minWidth: 0
|
|
1519
|
+
},
|
|
1520
|
+
activeIndicator: {
|
|
1521
|
+
position: "absolute",
|
|
1522
|
+
top: 4,
|
|
1523
|
+
left: 4,
|
|
1524
|
+
height: 36,
|
|
1525
|
+
backgroundColor: colors.grey600,
|
|
1526
|
+
borderRadius: 60
|
|
1527
|
+
},
|
|
1528
|
+
label: {
|
|
1529
|
+
...segmentedToggleTypography,
|
|
1530
|
+
flexShrink: 1
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
var ICON_SIZE4 = 28;
|
|
1534
|
+
var StatCard = forwardRef(function StatCard2({ label, icon: Icon2, style, className, accessibilityLabel, ...rest }, forwardedRef) {
|
|
1535
|
+
const containerRef = useRef(null);
|
|
1536
|
+
const resolvedClassName = className?.trim() || void 0;
|
|
1537
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
1538
|
+
useApplyWebClassName(containerRef, resolvedClassName);
|
|
1539
|
+
return /* @__PURE__ */ jsxs(
|
|
1540
|
+
View,
|
|
1541
|
+
{
|
|
1542
|
+
...rest,
|
|
1543
|
+
ref: setContainerRef,
|
|
1544
|
+
style: [styles6.base, style],
|
|
1545
|
+
accessibilityRole: "text",
|
|
1546
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
1547
|
+
children: [
|
|
1548
|
+
/* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE4, color: colors.white }),
|
|
1549
|
+
/* @__PURE__ */ jsx(Text, { style: styles6.label, children: label })
|
|
1550
|
+
]
|
|
1551
|
+
}
|
|
1552
|
+
);
|
|
1553
|
+
});
|
|
1554
|
+
var styles6 = StyleSheet.create({
|
|
1555
|
+
base: {
|
|
1556
|
+
width: 204.5,
|
|
1557
|
+
minHeight: 114,
|
|
1558
|
+
padding: 24,
|
|
1559
|
+
gap: 16,
|
|
1560
|
+
borderRadius: 20,
|
|
1561
|
+
backgroundColor: colors.grey750
|
|
1562
|
+
},
|
|
1563
|
+
label: {
|
|
1564
|
+
...statCardTypography,
|
|
1565
|
+
color: colors.whiteAlpha86
|
|
955
1566
|
}
|
|
956
1567
|
});
|
|
957
|
-
var
|
|
1568
|
+
var variantConfig2 = {
|
|
958
1569
|
primary: {
|
|
959
1570
|
backgroundColor: colors.primary,
|
|
960
1571
|
textColor: colors.white,
|
|
@@ -1013,7 +1624,7 @@ var Button = forwardRef(
|
|
|
1013
1624
|
}, forwardedRef) {
|
|
1014
1625
|
const containerRef = useRef(null);
|
|
1015
1626
|
const textRef = useRef(null);
|
|
1016
|
-
const preset =
|
|
1627
|
+
const preset = variantConfig2[variant];
|
|
1017
1628
|
const metrics = sizeConfig[size];
|
|
1018
1629
|
const label = typeof children !== "undefined" ? children : title;
|
|
1019
1630
|
const hasCustomChildren = typeof children !== "undefined";
|
|
@@ -1026,7 +1637,7 @@ var Button = forwardRef(
|
|
|
1026
1637
|
useApplyWebClassName(textRef, textClassName);
|
|
1027
1638
|
const iconNode = customIcon ?? /* @__PURE__ */ jsx(ArrowRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
1028
1639
|
const containerStyle = [
|
|
1029
|
-
|
|
1640
|
+
styles7.base,
|
|
1030
1641
|
{
|
|
1031
1642
|
minHeight: metrics.minHeight,
|
|
1032
1643
|
borderRadius: metrics.borderRadius,
|
|
@@ -1037,15 +1648,15 @@ var Button = forwardRef(
|
|
|
1037
1648
|
paddingRight: hasIcon ? metrics.paddingRightWithIcon : metrics.paddingRight,
|
|
1038
1649
|
gap: hasIcon ? metrics.gap : 0
|
|
1039
1650
|
},
|
|
1040
|
-
disabled &&
|
|
1651
|
+
disabled && styles7.disabled,
|
|
1041
1652
|
style
|
|
1042
1653
|
];
|
|
1043
1654
|
const labelStyle = [
|
|
1044
|
-
|
|
1655
|
+
styles7.label,
|
|
1045
1656
|
metrics.text,
|
|
1046
1657
|
{ color: preset.textColor },
|
|
1047
|
-
Platform.OS === "android" ?
|
|
1048
|
-
!hasIcon &&
|
|
1658
|
+
Platform.OS === "android" ? styles7.labelAndroid : null,
|
|
1659
|
+
!hasIcon && styles7.labelCentered,
|
|
1049
1660
|
textStyle
|
|
1050
1661
|
];
|
|
1051
1662
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1066,7 +1677,7 @@ var Button = forwardRef(
|
|
|
1066
1677
|
View,
|
|
1067
1678
|
{
|
|
1068
1679
|
style: [
|
|
1069
|
-
|
|
1680
|
+
styles7.iconContainer,
|
|
1070
1681
|
{
|
|
1071
1682
|
width: metrics.iconContainerSize,
|
|
1072
1683
|
height: metrics.iconContainerSize,
|
|
@@ -1082,7 +1693,7 @@ var Button = forwardRef(
|
|
|
1082
1693
|
);
|
|
1083
1694
|
}
|
|
1084
1695
|
);
|
|
1085
|
-
var
|
|
1696
|
+
var styles7 = StyleSheet.create({
|
|
1086
1697
|
base: {
|
|
1087
1698
|
flexDirection: "row",
|
|
1088
1699
|
alignItems: "center",
|
|
@@ -1160,13 +1771,13 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1160
1771
|
accessibilityRole: "checkbox",
|
|
1161
1772
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
1162
1773
|
accessibilityState: { checked: isActive, disabled },
|
|
1163
|
-
style: [
|
|
1774
|
+
style: [styles8.root, disabled && styles8.disabled, style],
|
|
1164
1775
|
children: [
|
|
1165
1776
|
/* @__PURE__ */ jsx(
|
|
1166
1777
|
View,
|
|
1167
1778
|
{
|
|
1168
1779
|
style: [
|
|
1169
|
-
|
|
1780
|
+
styles8.box,
|
|
1170
1781
|
{
|
|
1171
1782
|
backgroundColor: chrome.backgroundColor,
|
|
1172
1783
|
borderColor: chrome.borderColor
|
|
@@ -1175,12 +1786,12 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1175
1786
|
children: isActive ? /* @__PURE__ */ jsx(CheckIcon, { size: CHECK_SIZE, color: colors.primary, strokeWidth: CHECK_STROKE }) : null
|
|
1176
1787
|
}
|
|
1177
1788
|
),
|
|
1178
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1789
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles8.label, labelStyle], children: labelContent }) : labelContent : null
|
|
1179
1790
|
]
|
|
1180
1791
|
}
|
|
1181
1792
|
);
|
|
1182
1793
|
});
|
|
1183
|
-
var
|
|
1794
|
+
var styles8 = StyleSheet.create({
|
|
1184
1795
|
root: {
|
|
1185
1796
|
flexDirection: "row",
|
|
1186
1797
|
alignItems: "center",
|
|
@@ -1204,7 +1815,525 @@ var styles3 = StyleSheet.create({
|
|
|
1204
1815
|
color: colors.white
|
|
1205
1816
|
}
|
|
1206
1817
|
});
|
|
1207
|
-
|
|
1818
|
+
|
|
1819
|
+
// src/utils/dateUtils.ts
|
|
1820
|
+
function startOfDay(date) {
|
|
1821
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
1822
|
+
}
|
|
1823
|
+
function isSameDay(a, b) {
|
|
1824
|
+
if (a == null || b == null) return false;
|
|
1825
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
1826
|
+
}
|
|
1827
|
+
function isSameMonth(a, b) {
|
|
1828
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
1829
|
+
}
|
|
1830
|
+
function addMonths(date, amount) {
|
|
1831
|
+
return new Date(date.getFullYear(), date.getMonth() + amount, 1);
|
|
1832
|
+
}
|
|
1833
|
+
function isBefore(a, b) {
|
|
1834
|
+
return startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
1835
|
+
}
|
|
1836
|
+
function isAfter(a, b) {
|
|
1837
|
+
return startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
1838
|
+
}
|
|
1839
|
+
function isWithinRange(date, start, end) {
|
|
1840
|
+
const time = startOfDay(date).getTime();
|
|
1841
|
+
return time >= startOfDay(start).getTime() && time <= startOfDay(end).getTime();
|
|
1842
|
+
}
|
|
1843
|
+
function isDateDisabled(date, min, max) {
|
|
1844
|
+
if (min && isBefore(date, min)) return true;
|
|
1845
|
+
if (max && isAfter(date, max)) return true;
|
|
1846
|
+
return false;
|
|
1847
|
+
}
|
|
1848
|
+
function formatDate(date) {
|
|
1849
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
1850
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
1851
|
+
return `${day}.${month}.${date.getFullYear()}`;
|
|
1852
|
+
}
|
|
1853
|
+
function getMonthMatrix(monthDate, weekStartsOn = 1) {
|
|
1854
|
+
const year = monthDate.getFullYear();
|
|
1855
|
+
const month = monthDate.getMonth();
|
|
1856
|
+
const firstOfMonth = new Date(year, month, 1);
|
|
1857
|
+
const firstWeekday = firstOfMonth.getDay();
|
|
1858
|
+
const leadingDays = (firstWeekday - weekStartsOn + 7) % 7;
|
|
1859
|
+
const gridStart = new Date(year, month, 1 - leadingDays);
|
|
1860
|
+
const weeks = [];
|
|
1861
|
+
let cursor = gridStart;
|
|
1862
|
+
for (let week = 0; week < 6; week += 1) {
|
|
1863
|
+
const days = [];
|
|
1864
|
+
for (let day = 0; day < 7; day += 1) {
|
|
1865
|
+
days.push(cursor);
|
|
1866
|
+
cursor = new Date(cursor.getFullYear(), cursor.getMonth(), cursor.getDate() + 1);
|
|
1867
|
+
}
|
|
1868
|
+
weeks.push(days);
|
|
1869
|
+
}
|
|
1870
|
+
return weeks;
|
|
1871
|
+
}
|
|
1872
|
+
var DEFAULT_MONTH_NAMES = [
|
|
1873
|
+
"\u0540\u0578\u0582\u0576\u057E\u0561\u0580",
|
|
1874
|
+
"\u0553\u0565\u057F\u0580\u057E\u0561\u0580",
|
|
1875
|
+
"\u0544\u0561\u0580\u057F",
|
|
1876
|
+
"\u0531\u057A\u0580\u056B\u056C",
|
|
1877
|
+
"\u0544\u0561\u0575\u056B\u057D",
|
|
1878
|
+
"\u0540\u0578\u0582\u0576\u056B\u057D",
|
|
1879
|
+
"\u0540\u0578\u0582\u056C\u056B\u057D",
|
|
1880
|
+
"\u0555\u0563\u0578\u057D\u057F\u0578\u057D",
|
|
1881
|
+
"\u054D\u0565\u057A\u057F\u0565\u0574\u0562\u0565\u0580",
|
|
1882
|
+
"\u0540\u0578\u056F\u057F\u0565\u0574\u0562\u0565\u0580",
|
|
1883
|
+
"\u0546\u0578\u0575\u0565\u0574\u0562\u0565\u0580",
|
|
1884
|
+
"\u0534\u0565\u056F\u057F\u0565\u0574\u0562\u0565\u0580"
|
|
1885
|
+
];
|
|
1886
|
+
var DEFAULT_WEEKDAY_LABELS = ["\u0535\u0550", "\u0535\u0554", "\u0549\u0550", "\u0540\u0546", "\u0548\u0552\u0550", "\u0547\u0532", "\u053F\u0550"];
|
|
1887
|
+
var EMPTY_RANGE = { start: null, end: null };
|
|
1888
|
+
var DEFAULT_WIDTH = 380;
|
|
1889
|
+
var TRIGGER_HEIGHT = 44;
|
|
1890
|
+
var TRIGGER_RADIUS = 60;
|
|
1891
|
+
var MENU_RADIUS2 = 20;
|
|
1892
|
+
var ICON_SIZE5 = 20;
|
|
1893
|
+
var NAV_ICON_SIZE = 20;
|
|
1894
|
+
var DAY_CELL_HEIGHT = 44;
|
|
1895
|
+
var DAY_CIRCLE_SIZE = 44;
|
|
1896
|
+
var DatePicker = forwardRef(
|
|
1897
|
+
function DatePicker2(props, forwardedRef) {
|
|
1898
|
+
const {
|
|
1899
|
+
placeholder = "Select date",
|
|
1900
|
+
open: openProp,
|
|
1901
|
+
defaultOpen = false,
|
|
1902
|
+
onOpenChange,
|
|
1903
|
+
disabled = false,
|
|
1904
|
+
closeOnSelect = true,
|
|
1905
|
+
minDate,
|
|
1906
|
+
maxDate,
|
|
1907
|
+
defaultVisibleMonth,
|
|
1908
|
+
monthNames = DEFAULT_MONTH_NAMES,
|
|
1909
|
+
weekdayLabels = DEFAULT_WEEKDAY_LABELS,
|
|
1910
|
+
formatValue = formatDate,
|
|
1911
|
+
weekStartsOn = 1,
|
|
1912
|
+
style,
|
|
1913
|
+
className,
|
|
1914
|
+
accessibilityLabel,
|
|
1915
|
+
// Pulled out only to keep them off `rest` (which is spread onto the root View);
|
|
1916
|
+
// the real values are read from `props` directly below to preserve discriminated typing.
|
|
1917
|
+
range: _range,
|
|
1918
|
+
value: _value,
|
|
1919
|
+
defaultValue: _defaultValue,
|
|
1920
|
+
onValueChange: _onValueChange,
|
|
1921
|
+
...rest
|
|
1922
|
+
} = props;
|
|
1923
|
+
const isRange = props.range === true;
|
|
1924
|
+
const valueProp = props.value;
|
|
1925
|
+
const rootRef = useRef(null);
|
|
1926
|
+
const triggerRef = useRef(null);
|
|
1927
|
+
const setRootRef = useMemo(() => mergeRefs(rootRef, forwardedRef), [forwardedRef]);
|
|
1928
|
+
const isOpenControlled = typeof openProp === "boolean";
|
|
1929
|
+
const isValueControlled = valueProp !== void 0;
|
|
1930
|
+
const [uncontrolledSingle, setUncontrolledSingle] = useState(
|
|
1931
|
+
!isRange ? props.defaultValue ?? null : null
|
|
1932
|
+
);
|
|
1933
|
+
const [uncontrolledRange, setUncontrolledRange] = useState(
|
|
1934
|
+
isRange ? props.defaultValue ?? EMPTY_RANGE : EMPTY_RANGE
|
|
1935
|
+
);
|
|
1936
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1937
|
+
const [hoveredDayKey, setHoveredDayKey] = useState(null);
|
|
1938
|
+
const rangeValue = isRange ? isValueControlled ? valueProp ?? EMPTY_RANGE : uncontrolledRange : EMPTY_RANGE;
|
|
1939
|
+
const singleValue = !isRange ? isValueControlled ? valueProp ?? null : uncontrolledSingle : null;
|
|
1940
|
+
const isOpen = isOpenControlled ? openProp : uncontrolledOpen;
|
|
1941
|
+
const [visibleMonth, setVisibleMonth] = useState(() => {
|
|
1942
|
+
const anchor = defaultVisibleMonth ?? (isRange ? rangeValue.start : singleValue) ?? /* @__PURE__ */ new Date();
|
|
1943
|
+
return new Date(anchor.getFullYear(), anchor.getMonth(), 1);
|
|
1944
|
+
});
|
|
1945
|
+
useApplyWebClassName(rootRef, className);
|
|
1946
|
+
const setOpen = useCallback(
|
|
1947
|
+
(next) => {
|
|
1948
|
+
if (!isOpenControlled) setUncontrolledOpen(next);
|
|
1949
|
+
onOpenChange?.(next);
|
|
1950
|
+
if (next) {
|
|
1951
|
+
const anchor = (isRange ? rangeValue.start : singleValue) ?? /* @__PURE__ */ new Date();
|
|
1952
|
+
setVisibleMonth(new Date(anchor.getFullYear(), anchor.getMonth(), 1));
|
|
1953
|
+
} else {
|
|
1954
|
+
setHoveredDayKey(null);
|
|
1955
|
+
}
|
|
1956
|
+
},
|
|
1957
|
+
[isOpenControlled, isRange, onOpenChange, rangeValue.start, singleValue]
|
|
1958
|
+
);
|
|
1959
|
+
useEffect(() => {
|
|
1960
|
+
if (Platform.OS !== "web" || !isOpen) return;
|
|
1961
|
+
const handlePointerDown = (event) => {
|
|
1962
|
+
const root = rootRef.current;
|
|
1963
|
+
const target = event.target;
|
|
1964
|
+
if (root?.contains && target instanceof Node && !root.contains(target)) {
|
|
1965
|
+
setOpen(false);
|
|
1966
|
+
}
|
|
1967
|
+
};
|
|
1968
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
1969
|
+
document.addEventListener("touchstart", handlePointerDown);
|
|
1970
|
+
return () => {
|
|
1971
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
1972
|
+
document.removeEventListener("touchstart", handlePointerDown);
|
|
1973
|
+
};
|
|
1974
|
+
}, [isOpen, setOpen]);
|
|
1975
|
+
const focusTrigger = useCallback(() => {
|
|
1976
|
+
const node = triggerRef.current;
|
|
1977
|
+
node?.focus?.();
|
|
1978
|
+
}, []);
|
|
1979
|
+
const closeAndFocusTrigger = useCallback(() => {
|
|
1980
|
+
setOpen(false);
|
|
1981
|
+
focusTrigger();
|
|
1982
|
+
}, [focusTrigger, setOpen]);
|
|
1983
|
+
useEffect(() => {
|
|
1984
|
+
if (Platform.OS !== "web" || !isOpen) return;
|
|
1985
|
+
const handleKeyDown = (event) => {
|
|
1986
|
+
if (event.key === "Escape") {
|
|
1987
|
+
event.preventDefault();
|
|
1988
|
+
closeAndFocusTrigger();
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1991
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1992
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1993
|
+
}, [isOpen, closeAndFocusTrigger]);
|
|
1994
|
+
const handleTriggerPress = () => {
|
|
1995
|
+
if (disabled) return;
|
|
1996
|
+
setOpen(!isOpen);
|
|
1997
|
+
};
|
|
1998
|
+
const handleDayPress = useCallback(
|
|
1999
|
+
(day) => {
|
|
2000
|
+
if (disabled || isDateDisabled(day, minDate, maxDate)) return;
|
|
2001
|
+
const picked = startOfDay(day);
|
|
2002
|
+
if (!isRange) {
|
|
2003
|
+
if (!isValueControlled) setUncontrolledSingle(picked);
|
|
2004
|
+
props.onValueChange?.(picked);
|
|
2005
|
+
if (closeOnSelect) setOpen(false);
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2008
|
+
const { start, end } = rangeValue;
|
|
2009
|
+
const startingNewRange = !start || start && end;
|
|
2010
|
+
const nextRange = startingNewRange ? { start: picked, end: null } : isBefore(picked, start) ? { start: picked, end: null } : { start, end: picked };
|
|
2011
|
+
if (!isValueControlled) setUncontrolledRange(nextRange);
|
|
2012
|
+
props.onValueChange?.(nextRange);
|
|
2013
|
+
if (closeOnSelect && nextRange.start && nextRange.end) setOpen(false);
|
|
2014
|
+
},
|
|
2015
|
+
[
|
|
2016
|
+
closeOnSelect,
|
|
2017
|
+
disabled,
|
|
2018
|
+
isRange,
|
|
2019
|
+
isValueControlled,
|
|
2020
|
+
maxDate,
|
|
2021
|
+
minDate,
|
|
2022
|
+
props,
|
|
2023
|
+
rangeValue,
|
|
2024
|
+
setOpen
|
|
2025
|
+
]
|
|
2026
|
+
);
|
|
2027
|
+
const handlePrevMonth = () => setVisibleMonth((current) => addMonths(current, -1));
|
|
2028
|
+
const handleNextMonth = () => setVisibleMonth((current) => addMonths(current, 1));
|
|
2029
|
+
const weeks = useMemo(
|
|
2030
|
+
() => getMonthMatrix(visibleMonth, weekStartsOn),
|
|
2031
|
+
[visibleMonth, weekStartsOn]
|
|
2032
|
+
);
|
|
2033
|
+
const today = useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2034
|
+
const hasValue = isRange ? rangeValue.start != null : singleValue != null;
|
|
2035
|
+
const triggerLabel = isRange ? rangeValue.start && rangeValue.end ? `${formatValue(rangeValue.start)} - ${formatValue(rangeValue.end)}` : rangeValue.start ? `${formatValue(rangeValue.start)} - ...` : placeholder : singleValue ? formatValue(singleValue) : placeholder;
|
|
2036
|
+
const triggerBorderColor = isOpen ? colors.primaryMuted : colors.grey700;
|
|
2037
|
+
const triggerTextColor = hasValue ? colors.white : colors.grey100;
|
|
2038
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? placeholder;
|
|
2039
|
+
return /* @__PURE__ */ jsx(
|
|
2040
|
+
View,
|
|
2041
|
+
{
|
|
2042
|
+
...rest,
|
|
2043
|
+
ref: setRootRef,
|
|
2044
|
+
style: [styles9.root, isOpen && styles9.rootOpen, disabled && styles9.disabled, style],
|
|
2045
|
+
accessibilityState: { disabled, expanded: isOpen },
|
|
2046
|
+
children: /* @__PURE__ */ jsxs(View, { style: [styles9.triggerWrap, isOpen && styles9.triggerWrapOpen], children: [
|
|
2047
|
+
/* @__PURE__ */ jsxs(
|
|
2048
|
+
Pressable,
|
|
2049
|
+
{
|
|
2050
|
+
ref: triggerRef,
|
|
2051
|
+
onPress: handleTriggerPress,
|
|
2052
|
+
disabled,
|
|
2053
|
+
accessibilityRole: "button",
|
|
2054
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2055
|
+
accessibilityState: { disabled, expanded: isOpen },
|
|
2056
|
+
style: [
|
|
2057
|
+
styles9.trigger,
|
|
2058
|
+
{ borderColor: triggerBorderColor, backgroundColor: colors.grey700 }
|
|
2059
|
+
],
|
|
2060
|
+
children: [
|
|
2061
|
+
/* @__PURE__ */ jsx(Text, { style: [styles9.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
2062
|
+
/* @__PURE__ */ jsx(View, { style: styles9.iconSlot, children: /* @__PURE__ */ jsx(CalendarOutlineIcon, { size: ICON_SIZE5, color: colors.grey100 }) })
|
|
2063
|
+
]
|
|
2064
|
+
}
|
|
2065
|
+
),
|
|
2066
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: styles9.menu, children: [
|
|
2067
|
+
/* @__PURE__ */ jsxs(View, { style: styles9.calendarHeader, children: [
|
|
2068
|
+
/* @__PURE__ */ jsx(
|
|
2069
|
+
Pressable,
|
|
2070
|
+
{
|
|
2071
|
+
onPress: handlePrevMonth,
|
|
2072
|
+
hitSlop: 8,
|
|
2073
|
+
accessibilityRole: "button",
|
|
2074
|
+
accessibilityLabel: "Previous month",
|
|
2075
|
+
style: styles9.navButton,
|
|
2076
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white })
|
|
2077
|
+
}
|
|
2078
|
+
),
|
|
2079
|
+
/* @__PURE__ */ jsxs(Text, { style: styles9.monthHeading, children: [
|
|
2080
|
+
monthNames[visibleMonth.getMonth()],
|
|
2081
|
+
" ",
|
|
2082
|
+
visibleMonth.getFullYear()
|
|
2083
|
+
] }),
|
|
2084
|
+
/* @__PURE__ */ jsx(
|
|
2085
|
+
Pressable,
|
|
2086
|
+
{
|
|
2087
|
+
onPress: handleNextMonth,
|
|
2088
|
+
hitSlop: 8,
|
|
2089
|
+
accessibilityRole: "button",
|
|
2090
|
+
accessibilityLabel: "Next month",
|
|
2091
|
+
style: styles9.navButton,
|
|
2092
|
+
children: /* @__PURE__ */ jsx(View, { style: styles9.navIconMirror, children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white }) })
|
|
2093
|
+
}
|
|
2094
|
+
)
|
|
2095
|
+
] }),
|
|
2096
|
+
/* @__PURE__ */ jsxs(View, { children: [
|
|
2097
|
+
/* @__PURE__ */ jsx(View, { style: styles9.weekdayRow, children: weekdayLabels.map((weekdayLabel, index) => /* @__PURE__ */ jsx(View, { style: styles9.dayCellWrap, children: /* @__PURE__ */ jsx(Text, { style: styles9.weekdayText, children: weekdayLabel }) }, `${weekdayLabel}-${index}`)) }),
|
|
2098
|
+
weeks.map((week, weekIndex) => {
|
|
2099
|
+
let rangeHighlightStyle = null;
|
|
2100
|
+
if (isRange && rangeValue.start && rangeValue.end) {
|
|
2101
|
+
const rangeIndices = week.reduce((acc, day, index) => {
|
|
2102
|
+
if (isWithinRange(day, rangeValue.start, rangeValue.end)) {
|
|
2103
|
+
acc.push(index);
|
|
2104
|
+
}
|
|
2105
|
+
return acc;
|
|
2106
|
+
}, []);
|
|
2107
|
+
if (rangeIndices.length > 0) {
|
|
2108
|
+
const first = rangeIndices[0];
|
|
2109
|
+
const last = rangeIndices[rangeIndices.length - 1];
|
|
2110
|
+
const startsHere = isSameDay(week[first], rangeValue.start);
|
|
2111
|
+
const endsHere = isSameDay(week[last], rangeValue.end);
|
|
2112
|
+
const cellPct = 100 / 7;
|
|
2113
|
+
const halfCellPct = cellPct / 2;
|
|
2114
|
+
let leftPct = first * cellPct;
|
|
2115
|
+
let widthPct = (last - first + 1) * cellPct;
|
|
2116
|
+
if (startsHere) {
|
|
2117
|
+
leftPct += halfCellPct;
|
|
2118
|
+
widthPct -= halfCellPct;
|
|
2119
|
+
}
|
|
2120
|
+
if (endsHere) {
|
|
2121
|
+
widthPct -= halfCellPct;
|
|
2122
|
+
}
|
|
2123
|
+
if (widthPct > 0) {
|
|
2124
|
+
rangeHighlightStyle = {
|
|
2125
|
+
left: `${leftPct}%`,
|
|
2126
|
+
width: `${widthPct}%`
|
|
2127
|
+
};
|
|
2128
|
+
}
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
return /* @__PURE__ */ jsxs(
|
|
2132
|
+
View,
|
|
2133
|
+
{
|
|
2134
|
+
style: [styles9.weekRow, weekIndex > 0 && styles9.weekRowSpaced],
|
|
2135
|
+
children: [
|
|
2136
|
+
rangeHighlightStyle ? /* @__PURE__ */ jsx(
|
|
2137
|
+
View,
|
|
2138
|
+
{
|
|
2139
|
+
pointerEvents: "none",
|
|
2140
|
+
style: [styles9.rangeHighlight, rangeHighlightStyle]
|
|
2141
|
+
}
|
|
2142
|
+
) : null,
|
|
2143
|
+
week.map((day, dayIndex) => {
|
|
2144
|
+
const inCurrentMonth = isSameMonth(day, visibleMonth);
|
|
2145
|
+
const isToday = isSameDay(day, today);
|
|
2146
|
+
const isSelectedSingle = !isRange && isSameDay(day, singleValue);
|
|
2147
|
+
const isRangeStart = isRange && isSameDay(day, rangeValue.start);
|
|
2148
|
+
const isRangeEnd = isRange && isSameDay(day, rangeValue.end);
|
|
2149
|
+
const isSelectedEndpoint = isSelectedSingle || isRangeStart || isRangeEnd;
|
|
2150
|
+
const dayDisabled = disabled || isDateDisabled(day, minDate, maxDate);
|
|
2151
|
+
const dayKey = startOfDay(day).getTime();
|
|
2152
|
+
const isHovered = !dayDisabled && !isSelectedEndpoint && hoveredDayKey === dayKey;
|
|
2153
|
+
const dayTextColor = isSelectedEndpoint ? colors.white : dayDisabled ? colors.grey400 : isToday ? colors.primary : !inCurrentMonth ? colors.grey300 : colors.white;
|
|
2154
|
+
return /* @__PURE__ */ jsxs(
|
|
2155
|
+
Pressable,
|
|
2156
|
+
{
|
|
2157
|
+
onPress: () => handleDayPress(day),
|
|
2158
|
+
disabled: dayDisabled,
|
|
2159
|
+
onHoverIn: () => setHoveredDayKey(dayKey),
|
|
2160
|
+
onHoverOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2161
|
+
onPressIn: () => setHoveredDayKey(dayKey),
|
|
2162
|
+
onPressOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2163
|
+
style: styles9.dayCellWrap,
|
|
2164
|
+
accessibilityRole: "button",
|
|
2165
|
+
accessibilityLabel: formatValue(day),
|
|
2166
|
+
accessibilityState: {
|
|
2167
|
+
disabled: dayDisabled,
|
|
2168
|
+
selected: isSelectedEndpoint
|
|
2169
|
+
},
|
|
2170
|
+
children: [
|
|
2171
|
+
/* @__PURE__ */ jsx(
|
|
2172
|
+
View,
|
|
2173
|
+
{
|
|
2174
|
+
style: [
|
|
2175
|
+
styles9.dayCircle,
|
|
2176
|
+
isSelectedEndpoint && styles9.dayCircleSelected,
|
|
2177
|
+
isHovered && styles9.dayCircleHovered
|
|
2178
|
+
],
|
|
2179
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles9.dayText, { color: dayTextColor }], children: day.getDate() })
|
|
2180
|
+
}
|
|
2181
|
+
),
|
|
2182
|
+
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsx(View, { style: styles9.todayDot }) : null
|
|
2183
|
+
]
|
|
2184
|
+
},
|
|
2185
|
+
dayIndex
|
|
2186
|
+
);
|
|
2187
|
+
})
|
|
2188
|
+
]
|
|
2189
|
+
},
|
|
2190
|
+
weekIndex
|
|
2191
|
+
);
|
|
2192
|
+
})
|
|
2193
|
+
] })
|
|
2194
|
+
] }) : null
|
|
2195
|
+
] })
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
);
|
|
2200
|
+
var styles9 = StyleSheet.create({
|
|
2201
|
+
root: {
|
|
2202
|
+
width: DEFAULT_WIDTH,
|
|
2203
|
+
gap: 8,
|
|
2204
|
+
alignSelf: "flex-start"
|
|
2205
|
+
},
|
|
2206
|
+
rootOpen: {
|
|
2207
|
+
zIndex: 30
|
|
2208
|
+
},
|
|
2209
|
+
disabled: {
|
|
2210
|
+
opacity: 0.6
|
|
2211
|
+
},
|
|
2212
|
+
triggerWrap: {
|
|
2213
|
+
position: "relative",
|
|
2214
|
+
zIndex: 1
|
|
2215
|
+
},
|
|
2216
|
+
triggerWrapOpen: {
|
|
2217
|
+
zIndex: 20
|
|
2218
|
+
},
|
|
2219
|
+
trigger: {
|
|
2220
|
+
height: TRIGGER_HEIGHT,
|
|
2221
|
+
borderRadius: TRIGGER_RADIUS,
|
|
2222
|
+
borderWidth: 1,
|
|
2223
|
+
paddingVertical: 10,
|
|
2224
|
+
paddingHorizontal: 16,
|
|
2225
|
+
flexDirection: "row",
|
|
2226
|
+
alignItems: "center",
|
|
2227
|
+
gap: 10,
|
|
2228
|
+
overflow: "hidden"
|
|
2229
|
+
},
|
|
2230
|
+
triggerText: {
|
|
2231
|
+
...datePickerTypography.field,
|
|
2232
|
+
flex: 1,
|
|
2233
|
+
minWidth: 0
|
|
2234
|
+
},
|
|
2235
|
+
iconSlot: {
|
|
2236
|
+
width: ICON_SIZE5,
|
|
2237
|
+
height: ICON_SIZE5,
|
|
2238
|
+
alignItems: "center",
|
|
2239
|
+
justifyContent: "center",
|
|
2240
|
+
flexShrink: 0
|
|
2241
|
+
},
|
|
2242
|
+
menu: {
|
|
2243
|
+
position: "absolute",
|
|
2244
|
+
top: "100%",
|
|
2245
|
+
left: 0,
|
|
2246
|
+
right: 0,
|
|
2247
|
+
marginTop: 8,
|
|
2248
|
+
zIndex: 10,
|
|
2249
|
+
borderRadius: MENU_RADIUS2,
|
|
2250
|
+
padding: 12,
|
|
2251
|
+
gap: 0,
|
|
2252
|
+
backgroundColor: colors.grey700,
|
|
2253
|
+
...Platform.select({
|
|
2254
|
+
web: {
|
|
2255
|
+
boxShadow: `0 8px 24px ${colors.black}73`
|
|
2256
|
+
},
|
|
2257
|
+
default: {
|
|
2258
|
+
elevation: 8
|
|
2259
|
+
}
|
|
2260
|
+
})
|
|
2261
|
+
},
|
|
2262
|
+
calendarHeader: {
|
|
2263
|
+
height: 36,
|
|
2264
|
+
flexDirection: "row",
|
|
2265
|
+
alignItems: "center",
|
|
2266
|
+
justifyContent: "space-between"
|
|
2267
|
+
},
|
|
2268
|
+
navButton: {
|
|
2269
|
+
width: 36,
|
|
2270
|
+
height: 36,
|
|
2271
|
+
alignItems: "center",
|
|
2272
|
+
justifyContent: "center"
|
|
2273
|
+
},
|
|
2274
|
+
navIconMirror: {
|
|
2275
|
+
transform: [{ scaleX: -1 }]
|
|
2276
|
+
},
|
|
2277
|
+
monthHeading: {
|
|
2278
|
+
...datePickerTypography.monthHeading,
|
|
2279
|
+
color: colors.white,
|
|
2280
|
+
textAlign: "center"
|
|
2281
|
+
},
|
|
2282
|
+
weekdayRow: {
|
|
2283
|
+
flexDirection: "row"
|
|
2284
|
+
},
|
|
2285
|
+
weekdayText: {
|
|
2286
|
+
...datePickerTypography.weekday,
|
|
2287
|
+
color: colors.grey300,
|
|
2288
|
+
textAlign: "center",
|
|
2289
|
+
textTransform: "uppercase"
|
|
2290
|
+
},
|
|
2291
|
+
weekRow: {
|
|
2292
|
+
flexDirection: "row",
|
|
2293
|
+
position: "relative"
|
|
2294
|
+
},
|
|
2295
|
+
weekRowSpaced: {
|
|
2296
|
+
marginTop: 8
|
|
2297
|
+
},
|
|
2298
|
+
rangeHighlight: {
|
|
2299
|
+
position: "absolute",
|
|
2300
|
+
top: (DAY_CELL_HEIGHT - DAY_CIRCLE_SIZE) / 2,
|
|
2301
|
+
bottom: (DAY_CELL_HEIGHT - DAY_CIRCLE_SIZE) / 2,
|
|
2302
|
+
borderRadius: DAY_CIRCLE_SIZE / 2,
|
|
2303
|
+
backgroundColor: colors.primaryHover
|
|
2304
|
+
},
|
|
2305
|
+
dayCellWrap: {
|
|
2306
|
+
flex: 1,
|
|
2307
|
+
height: DAY_CELL_HEIGHT,
|
|
2308
|
+
alignItems: "center",
|
|
2309
|
+
justifyContent: "center"
|
|
2310
|
+
},
|
|
2311
|
+
dayCircle: {
|
|
2312
|
+
width: DAY_CIRCLE_SIZE,
|
|
2313
|
+
height: DAY_CIRCLE_SIZE,
|
|
2314
|
+
borderRadius: DAY_CIRCLE_SIZE / 2,
|
|
2315
|
+
alignItems: "center",
|
|
2316
|
+
justifyContent: "center"
|
|
2317
|
+
},
|
|
2318
|
+
dayCircleSelected: {
|
|
2319
|
+
backgroundColor: colors.primary
|
|
2320
|
+
},
|
|
2321
|
+
dayCircleHovered: {
|
|
2322
|
+
backgroundColor: colors.grey600
|
|
2323
|
+
},
|
|
2324
|
+
dayText: {
|
|
2325
|
+
...datePickerTypography.day
|
|
2326
|
+
},
|
|
2327
|
+
todayDot: {
|
|
2328
|
+
position: "absolute",
|
|
2329
|
+
bottom: 2,
|
|
2330
|
+
width: 4,
|
|
2331
|
+
height: 4,
|
|
2332
|
+
borderRadius: 2,
|
|
2333
|
+
backgroundColor: colors.primary
|
|
2334
|
+
}
|
|
2335
|
+
});
|
|
2336
|
+
var DEFAULT_WIDTH2 = 308;
|
|
1208
2337
|
var sizeConfig2 = {
|
|
1209
2338
|
lg: {
|
|
1210
2339
|
height: 44,
|
|
@@ -1328,13 +2457,13 @@ var Input = forwardRef(function Input2({
|
|
|
1328
2457
|
const rightIconNode = rightIcon ?? /* @__PURE__ */ jsx(ShowIcon, { size: metrics.iconSize, color: chrome.rightIconColor });
|
|
1329
2458
|
useApplyWebClassName(rootRef, className);
|
|
1330
2459
|
useApplyWebClassName(inputRef, inputClassName);
|
|
1331
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
1332
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2460
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles10.root, disabled && styles10.disabled, style], children: [
|
|
2461
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles10.label, { color: chrome.labelColor }], children: label }) : null,
|
|
1333
2462
|
/* @__PURE__ */ jsxs(
|
|
1334
2463
|
View,
|
|
1335
2464
|
{
|
|
1336
2465
|
style: [
|
|
1337
|
-
|
|
2466
|
+
styles10.field,
|
|
1338
2467
|
{
|
|
1339
2468
|
height: metrics.height,
|
|
1340
2469
|
borderRadius: metrics.borderRadius,
|
|
@@ -1349,7 +2478,7 @@ var Input = forwardRef(function Input2({
|
|
|
1349
2478
|
fieldStyle
|
|
1350
2479
|
],
|
|
1351
2480
|
children: [
|
|
1352
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [
|
|
2481
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: leftIconNode }) : null,
|
|
1353
2482
|
/* @__PURE__ */ jsx(
|
|
1354
2483
|
TextInput,
|
|
1355
2484
|
{
|
|
@@ -1373,11 +2502,11 @@ var Input = forwardRef(function Input2({
|
|
|
1373
2502
|
onBlur?.(event);
|
|
1374
2503
|
},
|
|
1375
2504
|
style: [
|
|
1376
|
-
|
|
2505
|
+
styles10.input,
|
|
1377
2506
|
metrics.text,
|
|
1378
2507
|
{ color: chrome.textColor },
|
|
1379
|
-
Platform.OS === "web" ?
|
|
1380
|
-
Platform.OS === "android" ?
|
|
2508
|
+
Platform.OS === "web" ? styles10.inputWeb : null,
|
|
2509
|
+
Platform.OS === "android" ? styles10.inputAndroid : null,
|
|
1381
2510
|
inputStyle
|
|
1382
2511
|
],
|
|
1383
2512
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -1389,22 +2518,22 @@ var Input = forwardRef(function Input2({
|
|
|
1389
2518
|
{
|
|
1390
2519
|
onPress: onRightIconPress,
|
|
1391
2520
|
disabled,
|
|
1392
|
-
style: [
|
|
2521
|
+
style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }],
|
|
1393
2522
|
accessibilityRole: "button",
|
|
1394
2523
|
accessibilityLabel: rightIconAccessibilityLabel,
|
|
1395
2524
|
hitSlop: 8,
|
|
1396
2525
|
children: rightIconNode
|
|
1397
2526
|
}
|
|
1398
|
-
) : /* @__PURE__ */ jsx(View, { style: [
|
|
2527
|
+
) : /* @__PURE__ */ jsx(View, { style: [styles10.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: rightIconNode }) : null
|
|
1399
2528
|
]
|
|
1400
2529
|
}
|
|
1401
2530
|
),
|
|
1402
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2531
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles10.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
1403
2532
|
] });
|
|
1404
2533
|
});
|
|
1405
|
-
var
|
|
2534
|
+
var styles10 = StyleSheet.create({
|
|
1406
2535
|
root: {
|
|
1407
|
-
width:
|
|
2536
|
+
width: DEFAULT_WIDTH2,
|
|
1408
2537
|
gap: 8,
|
|
1409
2538
|
alignSelf: "flex-start"
|
|
1410
2539
|
},
|
|
@@ -1439,13 +2568,13 @@ var styles4 = StyleSheet.create({
|
|
|
1439
2568
|
...inputTypography.hint
|
|
1440
2569
|
}
|
|
1441
2570
|
});
|
|
1442
|
-
var
|
|
1443
|
-
var
|
|
1444
|
-
var
|
|
1445
|
-
var
|
|
2571
|
+
var DEFAULT_WIDTH3 = 308;
|
|
2572
|
+
var TRIGGER_HEIGHT2 = 44;
|
|
2573
|
+
var TRIGGER_RADIUS2 = 60;
|
|
2574
|
+
var MENU_RADIUS3 = 24;
|
|
1446
2575
|
var MENU_MAX_LIST_HEIGHT = 248;
|
|
1447
|
-
var
|
|
1448
|
-
var
|
|
2576
|
+
var ITEM_RADIUS2 = 12;
|
|
2577
|
+
var ICON_SIZE6 = 20;
|
|
1449
2578
|
var CHIP_GAP = 6;
|
|
1450
2579
|
var FALLBACK_ELLIPSIS_WIDTH = 20;
|
|
1451
2580
|
function itemBackground(state) {
|
|
@@ -1518,25 +2647,25 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
1518
2647
|
const next = Math.ceil(event.nativeEvent.layout.width);
|
|
1519
2648
|
setEllipsisWidth((current) => current === next ? current : next);
|
|
1520
2649
|
};
|
|
1521
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
1522
|
-
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style:
|
|
2650
|
+
return /* @__PURE__ */ jsxs(View, { style: styles11.multiValueRoot, children: [
|
|
2651
|
+
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style: styles11.measureRow, children: [
|
|
1523
2652
|
options.map((option) => /* @__PURE__ */ jsxs(
|
|
1524
2653
|
View,
|
|
1525
2654
|
{
|
|
1526
|
-
style:
|
|
2655
|
+
style: styles11.chip,
|
|
1527
2656
|
onLayout: (event) => handleChipLayout(option.value, event),
|
|
1528
2657
|
children: [
|
|
1529
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
1530
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2658
|
+
/* @__PURE__ */ jsx(Text, { style: styles11.chipLabel, numberOfLines: 1, children: option.label }),
|
|
2659
|
+
/* @__PURE__ */ jsx(Text, { style: styles11.chipRemove, children: "\xD7" })
|
|
1531
2660
|
]
|
|
1532
2661
|
},
|
|
1533
2662
|
`measure-${option.value}`
|
|
1534
2663
|
)),
|
|
1535
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2664
|
+
/* @__PURE__ */ jsx(View, { style: styles11.ellipsis, onLayout: handleEllipsisLayout, children: /* @__PURE__ */ jsx(Text, { style: styles11.ellipsisText, children: "..." }) })
|
|
1536
2665
|
] }),
|
|
1537
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
1538
|
-
visible.map((option) => /* @__PURE__ */ jsxs(View, { style:
|
|
1539
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2666
|
+
/* @__PURE__ */ jsxs(View, { style: styles11.chipsRow, onLayout: handleContainerLayout, children: [
|
|
2667
|
+
visible.map((option) => /* @__PURE__ */ jsxs(View, { style: styles11.chip, children: [
|
|
2668
|
+
/* @__PURE__ */ jsx(Text, { style: styles11.chipLabel, numberOfLines: 1, children: option.label }),
|
|
1540
2669
|
/* @__PURE__ */ jsx(
|
|
1541
2670
|
Pressable,
|
|
1542
2671
|
{
|
|
@@ -1548,11 +2677,11 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
1548
2677
|
hitSlop: 6,
|
|
1549
2678
|
accessibilityRole: "button",
|
|
1550
2679
|
accessibilityLabel: `Remove ${option.label}`,
|
|
1551
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
2680
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles11.chipRemove, children: "\xD7" })
|
|
1552
2681
|
}
|
|
1553
2682
|
)
|
|
1554
2683
|
] }, option.value)),
|
|
1555
|
-
hasOverflow ? /* @__PURE__ */ jsx(View, { style:
|
|
2684
|
+
hasOverflow ? /* @__PURE__ */ jsx(View, { style: styles11.ellipsis, children: /* @__PURE__ */ jsx(Text, { style: styles11.ellipsisText, children: "..." }) }) : null
|
|
1556
2685
|
] })
|
|
1557
2686
|
] });
|
|
1558
2687
|
}
|
|
@@ -1763,7 +2892,7 @@ var Select = forwardRef(
|
|
|
1763
2892
|
const leftIconNode = leftIcon ?? /* @__PURE__ */ jsx(
|
|
1764
2893
|
UserIcon,
|
|
1765
2894
|
{
|
|
1766
|
-
size:
|
|
2895
|
+
size: ICON_SIZE6,
|
|
1767
2896
|
color: error ? colors.red : isOpen ? colors.primary : colors.grey100
|
|
1768
2897
|
}
|
|
1769
2898
|
);
|
|
@@ -1779,11 +2908,11 @@ var Select = forwardRef(
|
|
|
1779
2908
|
{
|
|
1780
2909
|
...rest,
|
|
1781
2910
|
ref: setRootRef,
|
|
1782
|
-
style: [
|
|
2911
|
+
style: [styles11.root, isOpen && styles11.rootOpen, disabled && styles11.disabled, style],
|
|
1783
2912
|
accessibilityState: { disabled, expanded: isOpen },
|
|
1784
2913
|
children: [
|
|
1785
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
1786
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
2914
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles11.label, { color: labelColor }], children: label }) : null,
|
|
2915
|
+
/* @__PURE__ */ jsxs(View, { style: [styles11.triggerWrap, isOpen && styles11.triggerWrapOpen], children: [
|
|
1787
2916
|
/* @__PURE__ */ jsxs(
|
|
1788
2917
|
Pressable,
|
|
1789
2918
|
{
|
|
@@ -1794,29 +2923,29 @@ var Select = forwardRef(
|
|
|
1794
2923
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
1795
2924
|
accessibilityState: { disabled, expanded: isOpen },
|
|
1796
2925
|
style: [
|
|
1797
|
-
|
|
2926
|
+
styles11.trigger,
|
|
1798
2927
|
{
|
|
1799
2928
|
borderColor: triggerBorderColor,
|
|
1800
2929
|
backgroundColor: colors.grey700
|
|
1801
2930
|
}
|
|
1802
2931
|
],
|
|
1803
2932
|
children: [
|
|
1804
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style:
|
|
1805
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2933
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: styles11.iconSlot, children: leftIconNode }) : null,
|
|
2934
|
+
/* @__PURE__ */ jsx(View, { style: styles11.triggerContent, children: multiple && hasValue ? /* @__PURE__ */ jsx(
|
|
1806
2935
|
MultiValueChips,
|
|
1807
2936
|
{
|
|
1808
2937
|
options: selectedOptions,
|
|
1809
2938
|
disabled,
|
|
1810
2939
|
onRemove: handleRemoveChip
|
|
1811
2940
|
}
|
|
1812
|
-
) : /* @__PURE__ */ jsx(Text, { style: [
|
|
1813
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
2941
|
+
) : /* @__PURE__ */ jsx(Text, { style: [styles11.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: multiple ? placeholder : singleLabel }) }),
|
|
2942
|
+
/* @__PURE__ */ jsx(View, { style: [styles11.iconSlot, isOpen && styles11.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: ICON_SIZE6, color: isOpen ? colors.primary : colors.grey100 }) })
|
|
1814
2943
|
]
|
|
1815
2944
|
}
|
|
1816
2945
|
),
|
|
1817
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style:
|
|
1818
|
-
showSearch ? /* @__PURE__ */ jsxs(View, { style:
|
|
1819
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2946
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: styles11.menu, children: [
|
|
2947
|
+
showSearch ? /* @__PURE__ */ jsxs(View, { style: styles11.searchField, children: [
|
|
2948
|
+
/* @__PURE__ */ jsx(View, { style: styles11.iconSlot, children: /* @__PURE__ */ jsx(SearchIcon, { size: ICON_SIZE6, color: colors.grey100 }) }),
|
|
1820
2949
|
/* @__PURE__ */ jsx(
|
|
1821
2950
|
TextInput,
|
|
1822
2951
|
{
|
|
@@ -1827,9 +2956,9 @@ var Select = forwardRef(
|
|
|
1827
2956
|
placeholder: searchPlaceholder,
|
|
1828
2957
|
placeholderTextColor: colors.grey100,
|
|
1829
2958
|
style: [
|
|
1830
|
-
|
|
1831
|
-
Platform.OS === "web" ?
|
|
1832
|
-
Platform.OS === "android" ?
|
|
2959
|
+
styles11.searchInput,
|
|
2960
|
+
Platform.OS === "web" ? styles11.searchInputWeb : null,
|
|
2961
|
+
Platform.OS === "android" ? styles11.searchInputAndroid : null
|
|
1833
2962
|
],
|
|
1834
2963
|
accessibilityLabel: searchPlaceholder
|
|
1835
2964
|
}
|
|
@@ -1838,12 +2967,12 @@ var Select = forwardRef(
|
|
|
1838
2967
|
/* @__PURE__ */ jsxs(
|
|
1839
2968
|
ScrollView,
|
|
1840
2969
|
{
|
|
1841
|
-
style:
|
|
1842
|
-
contentContainerStyle:
|
|
2970
|
+
style: styles11.optionList,
|
|
2971
|
+
contentContainerStyle: styles11.optionListContent,
|
|
1843
2972
|
keyboardShouldPersistTaps: "handled",
|
|
1844
2973
|
showsVerticalScrollIndicator: false,
|
|
1845
2974
|
children: [
|
|
1846
|
-
loading ? /* @__PURE__ */ jsx(View, { style:
|
|
2975
|
+
loading ? /* @__PURE__ */ jsx(View, { style: styles11.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles11.statusText, children: "Loading..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx(View, { style: styles11.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles11.statusText, children: emptyText }) }) : null,
|
|
1847
2976
|
!loading && filteredOptions.map((option) => {
|
|
1848
2977
|
const isSelected = selectedValues.includes(option.value);
|
|
1849
2978
|
const isHovered = hoveredValue === option.value;
|
|
@@ -1860,14 +2989,14 @@ var Select = forwardRef(
|
|
|
1860
2989
|
accessibilityRole: multiple ? "checkbox" : "button",
|
|
1861
2990
|
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
1862
2991
|
style: [
|
|
1863
|
-
|
|
2992
|
+
styles11.item,
|
|
1864
2993
|
{
|
|
1865
2994
|
backgroundColor: itemBackground(visualState)
|
|
1866
2995
|
}
|
|
1867
2996
|
],
|
|
1868
2997
|
children: [
|
|
1869
|
-
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style:
|
|
1870
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2998
|
+
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles11.itemCheckbox, children: /* @__PURE__ */ jsx(Checkbox, { value: isSelected, variant: "light" }) }) : null,
|
|
2999
|
+
/* @__PURE__ */ jsx(Text, { style: styles11.itemLabel, numberOfLines: 1, children: option.label })
|
|
1871
3000
|
]
|
|
1872
3001
|
},
|
|
1873
3002
|
option.value
|
|
@@ -1878,15 +3007,15 @@ var Select = forwardRef(
|
|
|
1878
3007
|
)
|
|
1879
3008
|
] }) : null
|
|
1880
3009
|
] }),
|
|
1881
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3010
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles11.hint, { color: hintColor }], children: hint }) : null
|
|
1882
3011
|
]
|
|
1883
3012
|
}
|
|
1884
3013
|
);
|
|
1885
3014
|
}
|
|
1886
3015
|
);
|
|
1887
|
-
var
|
|
3016
|
+
var styles11 = StyleSheet.create({
|
|
1888
3017
|
root: {
|
|
1889
|
-
width:
|
|
3018
|
+
width: DEFAULT_WIDTH3,
|
|
1890
3019
|
gap: 8,
|
|
1891
3020
|
alignSelf: "flex-start"
|
|
1892
3021
|
},
|
|
@@ -1907,8 +3036,8 @@ var styles5 = StyleSheet.create({
|
|
|
1907
3036
|
zIndex: 20
|
|
1908
3037
|
},
|
|
1909
3038
|
trigger: {
|
|
1910
|
-
height:
|
|
1911
|
-
borderRadius:
|
|
3039
|
+
height: TRIGGER_HEIGHT2,
|
|
3040
|
+
borderRadius: TRIGGER_RADIUS2,
|
|
1912
3041
|
borderWidth: 1,
|
|
1913
3042
|
paddingVertical: 12,
|
|
1914
3043
|
paddingHorizontal: 16,
|
|
@@ -1974,8 +3103,8 @@ var styles5 = StyleSheet.create({
|
|
|
1974
3103
|
lineHeight: 16
|
|
1975
3104
|
},
|
|
1976
3105
|
iconSlot: {
|
|
1977
|
-
width:
|
|
1978
|
-
height:
|
|
3106
|
+
width: ICON_SIZE6,
|
|
3107
|
+
height: ICON_SIZE6,
|
|
1979
3108
|
alignItems: "center",
|
|
1980
3109
|
justifyContent: "center",
|
|
1981
3110
|
flexShrink: 0
|
|
@@ -1990,7 +3119,7 @@ var styles5 = StyleSheet.create({
|
|
|
1990
3119
|
right: 0,
|
|
1991
3120
|
marginTop: 8,
|
|
1992
3121
|
zIndex: 10,
|
|
1993
|
-
borderRadius:
|
|
3122
|
+
borderRadius: MENU_RADIUS3,
|
|
1994
3123
|
padding: 12,
|
|
1995
3124
|
gap: 8,
|
|
1996
3125
|
backgroundColor: colors.grey700,
|
|
@@ -2020,7 +3149,7 @@ var styles5 = StyleSheet.create({
|
|
|
2020
3149
|
},
|
|
2021
3150
|
searchField: {
|
|
2022
3151
|
height: 40,
|
|
2023
|
-
borderRadius:
|
|
3152
|
+
borderRadius: ITEM_RADIUS2,
|
|
2024
3153
|
paddingHorizontal: 12,
|
|
2025
3154
|
flexDirection: "row",
|
|
2026
3155
|
alignItems: "center",
|
|
@@ -2042,7 +3171,7 @@ var styles5 = StyleSheet.create({
|
|
|
2042
3171
|
},
|
|
2043
3172
|
item: {
|
|
2044
3173
|
minHeight: 43,
|
|
2045
|
-
borderRadius:
|
|
3174
|
+
borderRadius: ITEM_RADIUS2,
|
|
2046
3175
|
padding: 12,
|
|
2047
3176
|
flexDirection: "row",
|
|
2048
3177
|
alignItems: "center",
|
|
@@ -2060,7 +3189,7 @@ var styles5 = StyleSheet.create({
|
|
|
2060
3189
|
...selectTypography.hint
|
|
2061
3190
|
}
|
|
2062
3191
|
});
|
|
2063
|
-
var
|
|
3192
|
+
var DEFAULT_WIDTH4 = 308;
|
|
2064
3193
|
var FIELD_HEIGHT = 100;
|
|
2065
3194
|
var FIELD_RADIUS = 16;
|
|
2066
3195
|
var FIELD_PADDING_VERTICAL = 12;
|
|
@@ -2146,13 +3275,13 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
2146
3275
|
const resolvedAccessibilityLabel = accessibilityLabel ?? (showLabel ? void 0 : label);
|
|
2147
3276
|
useApplyWebClassName(rootRef, className);
|
|
2148
3277
|
useApplyWebClassName(inputRef, inputClassName);
|
|
2149
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
2150
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3278
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles12.root, disabled && styles12.disabled, style], children: [
|
|
3279
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles12.label, { color: chrome.labelColor }], children: label }) : null,
|
|
2151
3280
|
/* @__PURE__ */ jsx(
|
|
2152
3281
|
View,
|
|
2153
3282
|
{
|
|
2154
3283
|
style: [
|
|
2155
|
-
|
|
3284
|
+
styles12.field,
|
|
2156
3285
|
{
|
|
2157
3286
|
borderColor: chrome.borderColor,
|
|
2158
3287
|
backgroundColor: chrome.backgroundColor
|
|
@@ -2184,11 +3313,11 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
2184
3313
|
onBlur?.(event);
|
|
2185
3314
|
},
|
|
2186
3315
|
style: [
|
|
2187
|
-
|
|
3316
|
+
styles12.input,
|
|
2188
3317
|
textareaTypography.field,
|
|
2189
3318
|
{ color: chrome.textColor },
|
|
2190
|
-
Platform.OS === "web" ?
|
|
2191
|
-
Platform.OS === "android" ?
|
|
3319
|
+
Platform.OS === "web" ? styles12.inputWeb : null,
|
|
3320
|
+
Platform.OS === "android" ? styles12.inputAndroid : null,
|
|
2192
3321
|
inputStyle
|
|
2193
3322
|
],
|
|
2194
3323
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -2197,12 +3326,12 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
2197
3326
|
)
|
|
2198
3327
|
}
|
|
2199
3328
|
),
|
|
2200
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3329
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles12.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
2201
3330
|
] });
|
|
2202
3331
|
});
|
|
2203
|
-
var
|
|
3332
|
+
var styles12 = StyleSheet.create({
|
|
2204
3333
|
root: {
|
|
2205
|
-
width:
|
|
3334
|
+
width: DEFAULT_WIDTH4,
|
|
2206
3335
|
gap: 8,
|
|
2207
3336
|
alignSelf: "flex-start"
|
|
2208
3337
|
},
|
|
@@ -2243,7 +3372,7 @@ var TRACK_RADIUS = 43;
|
|
|
2243
3372
|
var TRACK_PADDING = 4;
|
|
2244
3373
|
var THUMB_SIZE = TRACK_HEIGHT - TRACK_PADDING * 2;
|
|
2245
3374
|
var THUMB_TRAVEL = TRACK_WIDTH - TRACK_PADDING * 2 - THUMB_SIZE;
|
|
2246
|
-
var
|
|
3375
|
+
var ANIMATION_DURATION2 = 300;
|
|
2247
3376
|
var Toggle = forwardRef(function Toggle2({
|
|
2248
3377
|
value,
|
|
2249
3378
|
defaultValue = false,
|
|
@@ -2270,7 +3399,7 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
2270
3399
|
useEffect(() => {
|
|
2271
3400
|
Animated.timing(progress, {
|
|
2272
3401
|
toValue: isActive ? 1 : 0,
|
|
2273
|
-
duration:
|
|
3402
|
+
duration: ANIMATION_DURATION2,
|
|
2274
3403
|
easing: Easing.out(Easing.ease),
|
|
2275
3404
|
useNativeDriver: false
|
|
2276
3405
|
}).start();
|
|
@@ -2300,13 +3429,13 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
2300
3429
|
accessibilityRole: "switch",
|
|
2301
3430
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2302
3431
|
accessibilityState: { checked: isActive, disabled },
|
|
2303
|
-
style: [
|
|
3432
|
+
style: [styles13.pressable, disabled && styles13.disabled, style],
|
|
2304
3433
|
children: [
|
|
2305
3434
|
/* @__PURE__ */ jsx(
|
|
2306
3435
|
Animated.View,
|
|
2307
3436
|
{
|
|
2308
3437
|
style: [
|
|
2309
|
-
|
|
3438
|
+
styles13.track,
|
|
2310
3439
|
{
|
|
2311
3440
|
backgroundColor: trackBackgroundColor
|
|
2312
3441
|
}
|
|
@@ -2315,7 +3444,7 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
2315
3444
|
Animated.View,
|
|
2316
3445
|
{
|
|
2317
3446
|
style: [
|
|
2318
|
-
|
|
3447
|
+
styles13.thumb,
|
|
2319
3448
|
{
|
|
2320
3449
|
transform: [{ translateX: thumbTranslateX }]
|
|
2321
3450
|
}
|
|
@@ -2324,12 +3453,12 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
2324
3453
|
)
|
|
2325
3454
|
}
|
|
2326
3455
|
),
|
|
2327
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3456
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles13.label, labelStyle], children: labelContent }) : labelContent : null
|
|
2328
3457
|
]
|
|
2329
3458
|
}
|
|
2330
3459
|
);
|
|
2331
3460
|
});
|
|
2332
|
-
var
|
|
3461
|
+
var styles13 = StyleSheet.create({
|
|
2333
3462
|
pressable: {
|
|
2334
3463
|
flexDirection: "row",
|
|
2335
3464
|
alignItems: "center",
|
|
@@ -2358,6 +3487,6 @@ var styles7 = StyleSheet.create({
|
|
|
2358
3487
|
}
|
|
2359
3488
|
});
|
|
2360
3489
|
|
|
2361
|
-
export { ArrowRightIcon, Avatar, BagIcon, BellIcon, BuildingIcon, Button, CalendarIcon, CameraIcon, CheckBadgeIcon, CheckIcon, Checkbox, ChevronDownIcon, ClockIcon, FacebookIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, Input, InstagramIcon, KeyIcon, LayoutGridIcon, LinkedInIcon, LogOutIcon, MailIcon, NavigateIcon, PhoneIcon, SearchIcon, Select, SettingsIcon, ShowIcon, Textarea, Toggle, UserIcon, VideoIcon, avatarTypography, buttonTypography, colors, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, selectTypography, textareaTypography };
|
|
3490
|
+
export { ArrowRightIcon, Avatar, Badge, BagIcon, BellIcon, BuildingIcon, Button, CalendarIcon, CalendarOutlineIcon, CameraIcon, CheckBadgeIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ClockIcon, Counter, DatePicker, FacebookIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, Input, InstagramIcon, KeyIcon, LayoutGridIcon, LinkedInIcon, LogOutIcon, MailIcon, MenuItem, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, SearchIcon, SegmentedToggle, Select, SettingsIcon, ShowIcon, SidebarIcon, StatCard, Textarea, Toggle, UserIcon, UsersAltIcon, VideoIcon, avatarTypography, badgeTypography, buttonTypography, colors, counterTypography, datePickerTypography, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
2362
3491
|
//# sourceMappingURL=index.js.map
|
|
2363
3492
|
//# sourceMappingURL=index.js.map
|