@ecohouse/ui 0.1.24 → 0.1.26
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/dist/index.cjs +207 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +207 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/DatePicker/DatePicker.stories.tsx +34 -0
- package/src/components/DatePicker/DatePicker.tsx +165 -11
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/SegmentedToggle/SegmentedToggle.stories.tsx +48 -1
- package/src/components/SegmentedToggle/SegmentedToggle.tsx +63 -23
- package/src/components/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/theme/colors.ts +1 -0
- package/src/theme/typography.ts +21 -0
package/dist/index.d.cts
CHANGED
|
@@ -501,8 +501,20 @@ type DateRange = {
|
|
|
501
501
|
start: Date | null;
|
|
502
502
|
end: Date | null;
|
|
503
503
|
};
|
|
504
|
+
type DatePickerVariant = "default" | "range-horizontal" | "range-vertical";
|
|
504
505
|
type DatePickerBaseProps = Omit<ViewProps, "style" | "children"> & {
|
|
505
506
|
placeholder?: string;
|
|
507
|
+
/** Trigger presentation. Range variants display separate start/end fields. */
|
|
508
|
+
variant?: DatePickerVariant;
|
|
509
|
+
/** Labels shown above the start/end values in range trigger variants. */
|
|
510
|
+
startLabel?: string;
|
|
511
|
+
endLabel?: string;
|
|
512
|
+
/** Optional supplementary times shown beside the start/end dates. */
|
|
513
|
+
startTime?: string;
|
|
514
|
+
endTime?: string;
|
|
515
|
+
/** Per-field placeholders used by range trigger variants. */
|
|
516
|
+
startPlaceholder?: string;
|
|
517
|
+
endPlaceholder?: string;
|
|
506
518
|
open?: boolean;
|
|
507
519
|
defaultOpen?: boolean;
|
|
508
520
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -751,6 +763,7 @@ declare const colors: {
|
|
|
751
763
|
readonly black: "#000000";
|
|
752
764
|
readonly white: "#ffffff";
|
|
753
765
|
readonly whiteAlpha86: "#FFFFFFDB";
|
|
766
|
+
readonly whiteAlpha60: "#FFFFFF99";
|
|
754
767
|
readonly whiteAlpha40: "#FFFFFF66";
|
|
755
768
|
readonly whiteAlpha20: "#FFFFFF33";
|
|
756
769
|
readonly whiteAlpha6: "#FFFFFF0F";
|
|
@@ -967,6 +980,27 @@ declare const datePickerTypography: {
|
|
|
967
980
|
readonly lineHeight: 12;
|
|
968
981
|
readonly letterSpacing: 0.36;
|
|
969
982
|
};
|
|
983
|
+
readonly rangeLabel: {
|
|
984
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
985
|
+
readonly fontSize: 13;
|
|
986
|
+
readonly fontWeight: "500";
|
|
987
|
+
readonly lineHeight: 13;
|
|
988
|
+
readonly letterSpacing: 0;
|
|
989
|
+
};
|
|
990
|
+
readonly rangeDate: {
|
|
991
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
992
|
+
readonly fontSize: 16;
|
|
993
|
+
readonly fontWeight: "500";
|
|
994
|
+
readonly lineHeight: 16;
|
|
995
|
+
readonly letterSpacing: 0;
|
|
996
|
+
};
|
|
997
|
+
readonly rangeTime: {
|
|
998
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
999
|
+
readonly fontSize: 14;
|
|
1000
|
+
readonly fontWeight: "400";
|
|
1001
|
+
readonly lineHeight: 14;
|
|
1002
|
+
readonly letterSpacing: 0;
|
|
1003
|
+
};
|
|
970
1004
|
/** Calendar month/year heading — Bold, centered, White. */
|
|
971
1005
|
readonly monthHeading: {
|
|
972
1006
|
readonly fontFamily: "Noto Sans Armenian";
|
|
@@ -1016,4 +1050,4 @@ declare const textareaTypography: {
|
|
|
1016
1050
|
};
|
|
1017
1051
|
};
|
|
1018
1052
|
|
|
1019
|
-
export { Amenity, AmenityIcon, type AmenityIconProps, type AmenityName, type AmenityProps, type AmenityVariant, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, type AvatarMenuItem, type AvatarProps, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, type BadgeProps, type BadgeVariant, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, type BrandLogoProps, type BrandLogoVariant, BuildingIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, type CheckboxProps, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, type CommentCardProps, CopyIcon, Counter, type CounterProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, FacebookIcon, FavoritesButton, type FavoritesButtonProps, FiltersIcon, GlobeIcon, GooglePlayIcon, type GreyStep, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, type IconByNameProps, type IconComponent, type IconGroup, type IconName, type IconProps, Input, type InputIcon, type InputProps, type InputSize, InstagramIcon, KeyIcon, type LanguageOption, LanguageSwitcher, type LanguageSwitcherProps, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, type MenuIconProps, MenuItem, type MenuItemProps, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, type RangeProps, type RangeValue, RatingInput, type RatingInputProps, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectIcon, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, SettingsIcon, ShareIcon, ShowIcon, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, type StarIconProps, StatCard, type StatCardProps, Textarea, type TextareaProps, Toggle, type ToggleProps, TooltipArrowIcon, UserIcon, UsersAltIcon, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
1053
|
+
export { Amenity, AmenityIcon, type AmenityIconProps, type AmenityName, type AmenityProps, type AmenityVariant, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, type AvatarMenuItem, type AvatarProps, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, type BadgeProps, type BadgeVariant, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, type BrandLogoProps, type BrandLogoVariant, BuildingIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, type CheckboxProps, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, type CommentCardProps, CopyIcon, Counter, type CounterProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerVariant, type DateRange, FacebookIcon, FavoritesButton, type FavoritesButtonProps, FiltersIcon, GlobeIcon, GooglePlayIcon, type GreyStep, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, type IconByNameProps, type IconComponent, type IconGroup, type IconName, type IconProps, Input, type InputIcon, type InputProps, type InputSize, InstagramIcon, KeyIcon, type LanguageOption, LanguageSwitcher, type LanguageSwitcherProps, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, type MenuIconProps, MenuItem, type MenuItemProps, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, type RangeProps, type RangeValue, RatingInput, type RatingInputProps, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectIcon, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, SettingsIcon, ShareIcon, ShowIcon, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, type StarIconProps, StatCard, type StatCardProps, Textarea, type TextareaProps, Toggle, type ToggleProps, TooltipArrowIcon, UserIcon, UsersAltIcon, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
package/dist/index.d.ts
CHANGED
|
@@ -501,8 +501,20 @@ type DateRange = {
|
|
|
501
501
|
start: Date | null;
|
|
502
502
|
end: Date | null;
|
|
503
503
|
};
|
|
504
|
+
type DatePickerVariant = "default" | "range-horizontal" | "range-vertical";
|
|
504
505
|
type DatePickerBaseProps = Omit<ViewProps, "style" | "children"> & {
|
|
505
506
|
placeholder?: string;
|
|
507
|
+
/** Trigger presentation. Range variants display separate start/end fields. */
|
|
508
|
+
variant?: DatePickerVariant;
|
|
509
|
+
/** Labels shown above the start/end values in range trigger variants. */
|
|
510
|
+
startLabel?: string;
|
|
511
|
+
endLabel?: string;
|
|
512
|
+
/** Optional supplementary times shown beside the start/end dates. */
|
|
513
|
+
startTime?: string;
|
|
514
|
+
endTime?: string;
|
|
515
|
+
/** Per-field placeholders used by range trigger variants. */
|
|
516
|
+
startPlaceholder?: string;
|
|
517
|
+
endPlaceholder?: string;
|
|
506
518
|
open?: boolean;
|
|
507
519
|
defaultOpen?: boolean;
|
|
508
520
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -751,6 +763,7 @@ declare const colors: {
|
|
|
751
763
|
readonly black: "#000000";
|
|
752
764
|
readonly white: "#ffffff";
|
|
753
765
|
readonly whiteAlpha86: "#FFFFFFDB";
|
|
766
|
+
readonly whiteAlpha60: "#FFFFFF99";
|
|
754
767
|
readonly whiteAlpha40: "#FFFFFF66";
|
|
755
768
|
readonly whiteAlpha20: "#FFFFFF33";
|
|
756
769
|
readonly whiteAlpha6: "#FFFFFF0F";
|
|
@@ -967,6 +980,27 @@ declare const datePickerTypography: {
|
|
|
967
980
|
readonly lineHeight: 12;
|
|
968
981
|
readonly letterSpacing: 0.36;
|
|
969
982
|
};
|
|
983
|
+
readonly rangeLabel: {
|
|
984
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
985
|
+
readonly fontSize: 13;
|
|
986
|
+
readonly fontWeight: "500";
|
|
987
|
+
readonly lineHeight: 13;
|
|
988
|
+
readonly letterSpacing: 0;
|
|
989
|
+
};
|
|
990
|
+
readonly rangeDate: {
|
|
991
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
992
|
+
readonly fontSize: 16;
|
|
993
|
+
readonly fontWeight: "500";
|
|
994
|
+
readonly lineHeight: 16;
|
|
995
|
+
readonly letterSpacing: 0;
|
|
996
|
+
};
|
|
997
|
+
readonly rangeTime: {
|
|
998
|
+
readonly fontFamily: "Noto Sans Armenian";
|
|
999
|
+
readonly fontSize: 14;
|
|
1000
|
+
readonly fontWeight: "400";
|
|
1001
|
+
readonly lineHeight: 14;
|
|
1002
|
+
readonly letterSpacing: 0;
|
|
1003
|
+
};
|
|
970
1004
|
/** Calendar month/year heading — Bold, centered, White. */
|
|
971
1005
|
readonly monthHeading: {
|
|
972
1006
|
readonly fontFamily: "Noto Sans Armenian";
|
|
@@ -1016,4 +1050,4 @@ declare const textareaTypography: {
|
|
|
1016
1050
|
};
|
|
1017
1051
|
};
|
|
1018
1052
|
|
|
1019
|
-
export { Amenity, AmenityIcon, type AmenityIconProps, type AmenityName, type AmenityProps, type AmenityVariant, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, type AvatarMenuItem, type AvatarProps, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, type BadgeProps, type BadgeVariant, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, type BrandLogoProps, type BrandLogoVariant, BuildingIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, type CheckboxProps, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, type CommentCardProps, CopyIcon, Counter, type CounterProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DateRange, FacebookIcon, FavoritesButton, type FavoritesButtonProps, FiltersIcon, GlobeIcon, GooglePlayIcon, type GreyStep, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, type IconByNameProps, type IconComponent, type IconGroup, type IconName, type IconProps, Input, type InputIcon, type InputProps, type InputSize, InstagramIcon, KeyIcon, type LanguageOption, LanguageSwitcher, type LanguageSwitcherProps, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, type MenuIconProps, MenuItem, type MenuItemProps, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, type RangeProps, type RangeValue, RatingInput, type RatingInputProps, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectIcon, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, SettingsIcon, ShareIcon, ShowIcon, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, type StarIconProps, StatCard, type StatCardProps, Textarea, type TextareaProps, Toggle, type ToggleProps, TooltipArrowIcon, UserIcon, UsersAltIcon, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
1053
|
+
export { Amenity, AmenityIcon, type AmenityIconProps, type AmenityName, type AmenityProps, type AmenityVariant, AppleIcon, AreaExpandIcon, ArrowRightIcon, Avatar, type AvatarMenuItem, type AvatarProps, BRAND_LOGO_COLORS, BRAND_LOGO_DEFAULT_HEIGHT, BRAND_LOGO_DEFAULT_WIDTH, Badge, type BadgeProps, type BadgeVariant, BagIcon, BathroomsIcon, BedroomsIcon, BellIcon, BrandLogo, type BrandLogoProps, type BrandLogoVariant, BuildingIcon, Button, type ButtonProps, type ButtonSize, type ButtonVariant, CalendarIcon, CalendarOutlineIcon, CameraIcon, CardLocationIcon, CheckBadgeIcon, CheckIcon, CheckSuccessIcon, Checkbox, type CheckboxProps, type CheckboxVariant, ChevronDownIcon, ChevronLeftIcon, ClockFilledIcon, ClockIcon, CloseIcon, CommentCard, type CommentCardProps, CopyIcon, Counter, type CounterProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerVariant, type DateRange, FacebookIcon, FavoritesButton, type FavoritesButtonProps, FiltersIcon, GlobeIcon, GooglePlayIcon, type GreyStep, GuestsIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, type IconByNameProps, type IconComponent, type IconGroup, type IconName, type IconProps, Input, type InputIcon, type InputProps, type InputSize, InstagramIcon, KeyIcon, type LanguageOption, LanguageSwitcher, type LanguageSwitcherProps, LayoutGridIcon, LinkedInIcon, ListViewIcon, LocationPinIcon, LogOutIcon, MailIcon, MapCollapseIcon, MapExpandIcon, MapViewIcon, MenuIcon, type MenuIconProps, MenuItem, type MenuItemProps, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, QrCodeIcon, Range, type RangeProps, type RangeValue, RatingInput, type RatingInputProps, RatingStarIcon, SaveHeartIcon, SearchIcon, SegmentedToggle, type SegmentedToggleOption, type SegmentedToggleProps, Select, type SelectIcon, type SelectMultipleProps, type SelectOption, type SelectProps, type SelectSingleProps, SettingsIcon, ShareIcon, ShowIcon, SidebarIcon, SortIcon, StarFilledIcon, StarIcon, type StarIconProps, StatCard, type StatCardProps, Textarea, type TextareaProps, Toggle, type ToggleProps, TooltipArrowIcon, UserIcon, UsersAltIcon, VideoIcon, WhatsAppIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
package/dist/index.js
CHANGED
|
@@ -31,6 +31,7 @@ var colors = {
|
|
|
31
31
|
black: "#000000",
|
|
32
32
|
white: "#ffffff",
|
|
33
33
|
whiteAlpha86: "#FFFFFFDB",
|
|
34
|
+
whiteAlpha60: "#FFFFFF99",
|
|
34
35
|
whiteAlpha40: "#FFFFFF66",
|
|
35
36
|
whiteAlpha20: "#FFFFFF33",
|
|
36
37
|
whiteAlpha6: "#FFFFFF0F",
|
|
@@ -230,6 +231,27 @@ var datePickerTypography = {
|
|
|
230
231
|
lineHeight: 12,
|
|
231
232
|
letterSpacing: 0.36
|
|
232
233
|
},
|
|
234
|
+
rangeLabel: {
|
|
235
|
+
fontFamily: fonts.sans,
|
|
236
|
+
fontSize: 13,
|
|
237
|
+
fontWeight: "500",
|
|
238
|
+
lineHeight: 13,
|
|
239
|
+
letterSpacing: 0
|
|
240
|
+
},
|
|
241
|
+
rangeDate: {
|
|
242
|
+
fontFamily: fonts.sans,
|
|
243
|
+
fontSize: 16,
|
|
244
|
+
fontWeight: "500",
|
|
245
|
+
lineHeight: 16,
|
|
246
|
+
letterSpacing: 0
|
|
247
|
+
},
|
|
248
|
+
rangeTime: {
|
|
249
|
+
fontFamily: fonts.sans,
|
|
250
|
+
fontSize: 14,
|
|
251
|
+
fontWeight: "400",
|
|
252
|
+
lineHeight: 14,
|
|
253
|
+
letterSpacing: 0
|
|
254
|
+
},
|
|
233
255
|
/** Calendar month/year heading — Bold, centered, White. */
|
|
234
256
|
monthHeading: {
|
|
235
257
|
fontFamily: fonts.sans,
|
|
@@ -2224,7 +2246,9 @@ var styles6 = StyleSheet.create({
|
|
|
2224
2246
|
var ICON_SIZE4 = 20;
|
|
2225
2247
|
var ANIMATION_DURATION = 200;
|
|
2226
2248
|
var OPTION_HORIZONTAL_PADDING = 16;
|
|
2249
|
+
var OPTION_CONTENT_GAP = 12;
|
|
2227
2250
|
var OPTION_MIN_WIDTH = 97;
|
|
2251
|
+
var OPTION_MEASUREMENT_TOLERANCE = 0.5;
|
|
2228
2252
|
var SegmentedToggle = forwardRef(
|
|
2229
2253
|
function SegmentedToggle2({
|
|
2230
2254
|
options,
|
|
@@ -2253,12 +2277,15 @@ var SegmentedToggle = forwardRef(
|
|
|
2253
2277
|
const [contentWidths, setContentWidths] = useState([0, 0]);
|
|
2254
2278
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
2255
2279
|
const availableOptionWidth = Math.max(0, (containerWidth - 12) / 2);
|
|
2256
|
-
const
|
|
2257
|
-
|
|
2258
|
-
|
|
2280
|
+
const resolveContentOptionWidth = (contentWidth) => contentWidth > 0 ? Math.max(
|
|
2281
|
+
OPTION_MIN_WIDTH,
|
|
2282
|
+
contentWidth + OPTION_HORIZONTAL_PADDING * 2 + OPTION_MEASUREMENT_TOLERANCE
|
|
2283
|
+
) : 0;
|
|
2284
|
+
const optionWidths = fullWidth ? [availableOptionWidth, availableOptionWidth] : [resolveContentOptionWidth(contentWidths[0]), resolveContentOptionWidth(contentWidths[1])];
|
|
2285
|
+
const selectedOptionWidth = optionWidths[selectedIndex];
|
|
2259
2286
|
const indicatorTranslateX = progress.interpolate({
|
|
2260
2287
|
inputRange: [0, 1],
|
|
2261
|
-
outputRange: [0,
|
|
2288
|
+
outputRange: [0, optionWidths[0] + 4]
|
|
2262
2289
|
});
|
|
2263
2290
|
useApplyWebClassName(containerRef, resolvedClassName);
|
|
2264
2291
|
useEffect(() => {
|
|
@@ -2296,13 +2323,37 @@ var SegmentedToggle = forwardRef(
|
|
|
2296
2323
|
],
|
|
2297
2324
|
accessibilityRole: "radiogroup",
|
|
2298
2325
|
children: [
|
|
2299
|
-
|
|
2326
|
+
!fullWidth ? options.map(({ value: optionValue, label, icon: Icon2 }, index) => /* @__PURE__ */ jsxs(
|
|
2327
|
+
View,
|
|
2328
|
+
{
|
|
2329
|
+
pointerEvents: "none",
|
|
2330
|
+
"aria-hidden": true,
|
|
2331
|
+
accessibilityElementsHidden: true,
|
|
2332
|
+
importantForAccessibility: "no-hide-descendants",
|
|
2333
|
+
onLayout: (event) => {
|
|
2334
|
+
const nextWidth = event.nativeEvent.layout.width;
|
|
2335
|
+
setContentWidths((currentWidths) => {
|
|
2336
|
+
if (currentWidths[index] === nextWidth) return currentWidths;
|
|
2337
|
+
const nextWidths = [currentWidths[0], currentWidths[1]];
|
|
2338
|
+
nextWidths[index] = nextWidth;
|
|
2339
|
+
return nextWidths;
|
|
2340
|
+
});
|
|
2341
|
+
},
|
|
2342
|
+
style: styles7.optionMeasurement,
|
|
2343
|
+
children: [
|
|
2344
|
+
Icon2 ? /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE4 }) : null,
|
|
2345
|
+
/* @__PURE__ */ jsx(Text, { style: [styles7.label, styles7.contentWidthLabel], children: label })
|
|
2346
|
+
]
|
|
2347
|
+
},
|
|
2348
|
+
`${optionValue}-measurement`
|
|
2349
|
+
)) : null,
|
|
2350
|
+
selectedOptionWidth > 0 ? /* @__PURE__ */ jsx(
|
|
2300
2351
|
Animated.View,
|
|
2301
2352
|
{
|
|
2302
2353
|
pointerEvents: "none",
|
|
2303
2354
|
style: [
|
|
2304
2355
|
styles7.activeIndicator,
|
|
2305
|
-
{ width:
|
|
2356
|
+
{ width: selectedOptionWidth, transform: [{ translateX: indicatorTranslateX }] }
|
|
2306
2357
|
]
|
|
2307
2358
|
}
|
|
2308
2359
|
) : null,
|
|
@@ -2321,27 +2372,26 @@ var SegmentedToggle = forwardRef(
|
|
|
2321
2372
|
accessibilityState: { selected, disabled },
|
|
2322
2373
|
style: [
|
|
2323
2374
|
styles7.option,
|
|
2324
|
-
fullWidth ? styles7.optionFullWidth : [
|
|
2375
|
+
fullWidth ? styles7.optionFullWidth : [
|
|
2376
|
+
styles7.optionContentWidth,
|
|
2377
|
+
optionWidths[index] > 0 && { width: optionWidths[index] }
|
|
2378
|
+
]
|
|
2325
2379
|
],
|
|
2326
|
-
children: /* @__PURE__ */ jsxs(
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles7.label, { color: labelColor }], children: label })
|
|
2342
|
-
]
|
|
2343
|
-
}
|
|
2344
|
-
)
|
|
2380
|
+
children: /* @__PURE__ */ jsxs(View, { style: styles7.optionContent, children: [
|
|
2381
|
+
Icon2 ? /* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE4, color: iconColor }) : null,
|
|
2382
|
+
/* @__PURE__ */ jsx(
|
|
2383
|
+
Text,
|
|
2384
|
+
{
|
|
2385
|
+
numberOfLines: fullWidth ? 1 : void 0,
|
|
2386
|
+
style: [
|
|
2387
|
+
styles7.label,
|
|
2388
|
+
!fullWidth && styles7.contentWidthLabel,
|
|
2389
|
+
{ color: labelColor }
|
|
2390
|
+
],
|
|
2391
|
+
children: label
|
|
2392
|
+
}
|
|
2393
|
+
)
|
|
2394
|
+
] })
|
|
2345
2395
|
},
|
|
2346
2396
|
optionValue
|
|
2347
2397
|
);
|
|
@@ -2383,7 +2433,14 @@ var styles7 = StyleSheet.create({
|
|
|
2383
2433
|
maxWidth: "100%",
|
|
2384
2434
|
flexDirection: "row",
|
|
2385
2435
|
alignItems: "center",
|
|
2386
|
-
gap:
|
|
2436
|
+
gap: OPTION_CONTENT_GAP
|
|
2437
|
+
},
|
|
2438
|
+
optionMeasurement: {
|
|
2439
|
+
position: "absolute",
|
|
2440
|
+
flexDirection: "row",
|
|
2441
|
+
alignItems: "center",
|
|
2442
|
+
gap: OPTION_CONTENT_GAP,
|
|
2443
|
+
opacity: 0
|
|
2387
2444
|
},
|
|
2388
2445
|
optionFullWidth: {
|
|
2389
2446
|
flex: 1,
|
|
@@ -2403,6 +2460,9 @@ var styles7 = StyleSheet.create({
|
|
|
2403
2460
|
label: {
|
|
2404
2461
|
...segmentedToggleTypography,
|
|
2405
2462
|
flexShrink: 1
|
|
2463
|
+
},
|
|
2464
|
+
contentWidthLabel: {
|
|
2465
|
+
flexShrink: 0
|
|
2406
2466
|
}
|
|
2407
2467
|
});
|
|
2408
2468
|
var defaultLanguageOptions = [
|
|
@@ -2990,6 +3050,7 @@ var DEFAULT_MONTH_NAMES = [
|
|
|
2990
3050
|
var DEFAULT_WEEKDAY_LABELS = ["\u0535\u0550", "\u0535\u0554", "\u0549\u0550", "\u0540\u0546", "\u0548\u0552\u0550", "\u0547\u0532", "\u053F\u0550"];
|
|
2991
3051
|
var EMPTY_RANGE = { start: null, end: null };
|
|
2992
3052
|
var DEFAULT_WIDTH = 380;
|
|
3053
|
+
var RANGE_TRIGGER_WIDTH = 382;
|
|
2993
3054
|
var TRIGGER_HEIGHT = 44;
|
|
2994
3055
|
var TRIGGER_RADIUS = 60;
|
|
2995
3056
|
var MENU_RADIUS2 = 20;
|
|
@@ -2997,10 +3058,33 @@ var ICON_SIZE7 = 20;
|
|
|
2997
3058
|
var NAV_ICON_SIZE = 20;
|
|
2998
3059
|
var DAY_CELL_HEIGHT = 44;
|
|
2999
3060
|
var DAY_CIRCLE_SIZE = 44;
|
|
3061
|
+
function RangeTriggerField({
|
|
3062
|
+
label,
|
|
3063
|
+
value,
|
|
3064
|
+
time
|
|
3065
|
+
}) {
|
|
3066
|
+
return /* @__PURE__ */ jsxs(View, { style: styles12.rangeField, children: [
|
|
3067
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles12.rangeLabel, children: label }),
|
|
3068
|
+
/* @__PURE__ */ jsxs(View, { style: styles12.rangeValueRow, children: [
|
|
3069
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles12.rangeDate, children: value }),
|
|
3070
|
+
time ? /* @__PURE__ */ jsxs(View, { style: styles12.rangeTimeWrap, children: [
|
|
3071
|
+
/* @__PURE__ */ jsx(ClockFilledIcon, { color: colors.lightGrey, size: 16 }),
|
|
3072
|
+
/* @__PURE__ */ jsx(Text, { style: styles12.rangeTime, children: time })
|
|
3073
|
+
] }) : null
|
|
3074
|
+
] })
|
|
3075
|
+
] });
|
|
3076
|
+
}
|
|
3000
3077
|
var DatePicker = forwardRef(
|
|
3001
3078
|
function DatePicker2(props, forwardedRef) {
|
|
3002
3079
|
const {
|
|
3003
3080
|
placeholder = "Select date",
|
|
3081
|
+
variant = "default",
|
|
3082
|
+
startLabel = "Start",
|
|
3083
|
+
endLabel = "End",
|
|
3084
|
+
startTime,
|
|
3085
|
+
endTime,
|
|
3086
|
+
startPlaceholder = placeholder,
|
|
3087
|
+
endPlaceholder = placeholder,
|
|
3004
3088
|
open: openProp,
|
|
3005
3089
|
defaultOpen = false,
|
|
3006
3090
|
onOpenChange,
|
|
@@ -3138,18 +3222,28 @@ var DatePicker = forwardRef(
|
|
|
3138
3222
|
const today = useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
3139
3223
|
const hasValue = isRange ? rangeValue.start != null : singleValue != null;
|
|
3140
3224
|
const triggerLabel = isRange ? rangeValue.start && rangeValue.end ? `${formatValue(rangeValue.start)} - ${formatValue(rangeValue.end)}` : rangeValue.start ? `${formatValue(rangeValue.start)} - ...` : placeholder : singleValue ? formatValue(singleValue) : placeholder;
|
|
3141
|
-
const
|
|
3225
|
+
const usesRangeTrigger = isRange && variant !== "default";
|
|
3226
|
+
const usesVerticalRangeTrigger = usesRangeTrigger && variant === "range-vertical";
|
|
3227
|
+
const triggerBorderColor = usesRangeTrigger ? isOpen ? colors.primary : colors.grey500 : isOpen ? colors.primaryMuted : colors.grey700;
|
|
3142
3228
|
const triggerTextColor = hasValue ? colors.white : colors.grey100;
|
|
3229
|
+
const startValue = rangeValue.start ? formatValue(rangeValue.start) : startPlaceholder;
|
|
3230
|
+
const endValue = rangeValue.end ? formatValue(rangeValue.end) : endPlaceholder;
|
|
3143
3231
|
const resolvedAccessibilityLabel = accessibilityLabel ?? placeholder;
|
|
3144
3232
|
return /* @__PURE__ */ jsx(
|
|
3145
3233
|
View,
|
|
3146
3234
|
{
|
|
3147
3235
|
...rest,
|
|
3148
3236
|
ref: setRootRef,
|
|
3149
|
-
style: [
|
|
3237
|
+
style: [
|
|
3238
|
+
styles12.root,
|
|
3239
|
+
usesRangeTrigger && styles12.rangeRoot,
|
|
3240
|
+
isOpen && styles12.rootOpen,
|
|
3241
|
+
disabled && styles12.disabled,
|
|
3242
|
+
style
|
|
3243
|
+
],
|
|
3150
3244
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3151
3245
|
children: /* @__PURE__ */ jsxs(View, { style: [styles12.triggerWrap, isOpen && styles12.triggerWrapOpen], children: [
|
|
3152
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ jsx(
|
|
3153
3247
|
Pressable,
|
|
3154
3248
|
{
|
|
3155
3249
|
ref: triggerRef,
|
|
@@ -3160,15 +3254,29 @@ var DatePicker = forwardRef(
|
|
|
3160
3254
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3161
3255
|
style: [
|
|
3162
3256
|
styles12.trigger,
|
|
3163
|
-
|
|
3257
|
+
usesRangeTrigger && styles12.rangeTrigger,
|
|
3258
|
+
usesRangeTrigger && (usesVerticalRangeTrigger ? styles12.rangeTriggerVertical : styles12.rangeTriggerHorizontal),
|
|
3259
|
+
{
|
|
3260
|
+
borderColor: triggerBorderColor,
|
|
3261
|
+
backgroundColor: usesRangeTrigger ? colors.grey800 : colors.grey700
|
|
3262
|
+
}
|
|
3164
3263
|
],
|
|
3165
|
-
children: [
|
|
3264
|
+
children: usesRangeTrigger ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3265
|
+
/* @__PURE__ */ jsx(RangeTriggerField, { label: startLabel, time: startTime, value: startValue }),
|
|
3266
|
+
/* @__PURE__ */ jsx(
|
|
3267
|
+
View,
|
|
3268
|
+
{
|
|
3269
|
+
style: usesVerticalRangeTrigger ? styles12.rangeDividerVertical : styles12.rangeDividerHorizontal
|
|
3270
|
+
}
|
|
3271
|
+
),
|
|
3272
|
+
/* @__PURE__ */ jsx(RangeTriggerField, { label: endLabel, time: endTime, value: endValue })
|
|
3273
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3166
3274
|
/* @__PURE__ */ jsx(Text, { style: [styles12.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
3167
3275
|
/* @__PURE__ */ jsx(View, { style: styles12.iconSlot, children: /* @__PURE__ */ jsx(CalendarOutlineIcon, { size: ICON_SIZE7, color: colors.grey100 }) })
|
|
3168
|
-
]
|
|
3276
|
+
] })
|
|
3169
3277
|
}
|
|
3170
3278
|
),
|
|
3171
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style: [styles12.menu, calendarStyle], children: [
|
|
3279
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: [styles12.menu, usesRangeTrigger && styles12.rangeMenu, calendarStyle], children: [
|
|
3172
3280
|
/* @__PURE__ */ jsxs(View, { style: styles12.calendarHeader, children: [
|
|
3173
3281
|
/* @__PURE__ */ jsx(
|
|
3174
3282
|
Pressable,
|
|
@@ -3311,6 +3419,9 @@ var styles12 = StyleSheet.create({
|
|
|
3311
3419
|
rootOpen: {
|
|
3312
3420
|
zIndex: 30
|
|
3313
3421
|
},
|
|
3422
|
+
rangeRoot: {
|
|
3423
|
+
width: RANGE_TRIGGER_WIDTH
|
|
3424
|
+
},
|
|
3314
3425
|
disabled: {
|
|
3315
3426
|
opacity: 0.6
|
|
3316
3427
|
},
|
|
@@ -3337,6 +3448,65 @@ var styles12 = StyleSheet.create({
|
|
|
3337
3448
|
flex: 1,
|
|
3338
3449
|
minWidth: 0
|
|
3339
3450
|
},
|
|
3451
|
+
rangeTrigger: {
|
|
3452
|
+
paddingVertical: 0,
|
|
3453
|
+
paddingHorizontal: 0,
|
|
3454
|
+
borderRadius: 15,
|
|
3455
|
+
gap: 0
|
|
3456
|
+
},
|
|
3457
|
+
rangeTriggerHorizontal: {
|
|
3458
|
+
height: 78,
|
|
3459
|
+
flexDirection: "row"
|
|
3460
|
+
},
|
|
3461
|
+
rangeTriggerVertical: {
|
|
3462
|
+
height: 156,
|
|
3463
|
+
flexDirection: "column"
|
|
3464
|
+
},
|
|
3465
|
+
rangeField: {
|
|
3466
|
+
flex: 1,
|
|
3467
|
+
alignSelf: "stretch",
|
|
3468
|
+
minWidth: 0,
|
|
3469
|
+
justifyContent: "center",
|
|
3470
|
+
gap: 8,
|
|
3471
|
+
paddingVertical: 12,
|
|
3472
|
+
paddingHorizontal: 16
|
|
3473
|
+
},
|
|
3474
|
+
rangeLabel: {
|
|
3475
|
+
...datePickerTypography.rangeLabel,
|
|
3476
|
+
color: colors.whiteAlpha60
|
|
3477
|
+
},
|
|
3478
|
+
rangeValueRow: {
|
|
3479
|
+
minWidth: 0,
|
|
3480
|
+
flexDirection: "row",
|
|
3481
|
+
alignItems: "center",
|
|
3482
|
+
justifyContent: "space-between",
|
|
3483
|
+
gap: 12
|
|
3484
|
+
},
|
|
3485
|
+
rangeDate: {
|
|
3486
|
+
...datePickerTypography.rangeDate,
|
|
3487
|
+
flexShrink: 1,
|
|
3488
|
+
color: colors.white
|
|
3489
|
+
},
|
|
3490
|
+
rangeTimeWrap: {
|
|
3491
|
+
flexShrink: 0,
|
|
3492
|
+
flexDirection: "row",
|
|
3493
|
+
alignItems: "center",
|
|
3494
|
+
gap: 3
|
|
3495
|
+
},
|
|
3496
|
+
rangeTime: {
|
|
3497
|
+
...datePickerTypography.rangeTime,
|
|
3498
|
+
color: colors.lightGrey
|
|
3499
|
+
},
|
|
3500
|
+
rangeDividerHorizontal: {
|
|
3501
|
+
width: 1,
|
|
3502
|
+
alignSelf: "stretch",
|
|
3503
|
+
backgroundColor: colors.grey500
|
|
3504
|
+
},
|
|
3505
|
+
rangeDividerVertical: {
|
|
3506
|
+
height: 1,
|
|
3507
|
+
alignSelf: "stretch",
|
|
3508
|
+
backgroundColor: colors.grey500
|
|
3509
|
+
},
|
|
3340
3510
|
iconSlot: {
|
|
3341
3511
|
width: ICON_SIZE7,
|
|
3342
3512
|
height: ICON_SIZE7,
|
|
@@ -3364,6 +3534,9 @@ var styles12 = StyleSheet.create({
|
|
|
3364
3534
|
}
|
|
3365
3535
|
})
|
|
3366
3536
|
},
|
|
3537
|
+
rangeMenu: {
|
|
3538
|
+
width: RANGE_TRIGGER_WIDTH
|
|
3539
|
+
},
|
|
3367
3540
|
calendarHeader: {
|
|
3368
3541
|
height: 36,
|
|
3369
3542
|
flexDirection: "row",
|