@ecohouse/ui 0.1.25 → 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 +142 -7
- 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 +142 -7
- 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/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,
|
|
@@ -3028,6 +3050,7 @@ var DEFAULT_MONTH_NAMES = [
|
|
|
3028
3050
|
var DEFAULT_WEEKDAY_LABELS = ["\u0535\u0550", "\u0535\u0554", "\u0549\u0550", "\u0540\u0546", "\u0548\u0552\u0550", "\u0547\u0532", "\u053F\u0550"];
|
|
3029
3051
|
var EMPTY_RANGE = { start: null, end: null };
|
|
3030
3052
|
var DEFAULT_WIDTH = 380;
|
|
3053
|
+
var RANGE_TRIGGER_WIDTH = 382;
|
|
3031
3054
|
var TRIGGER_HEIGHT = 44;
|
|
3032
3055
|
var TRIGGER_RADIUS = 60;
|
|
3033
3056
|
var MENU_RADIUS2 = 20;
|
|
@@ -3035,10 +3058,33 @@ var ICON_SIZE7 = 20;
|
|
|
3035
3058
|
var NAV_ICON_SIZE = 20;
|
|
3036
3059
|
var DAY_CELL_HEIGHT = 44;
|
|
3037
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
|
+
}
|
|
3038
3077
|
var DatePicker = forwardRef(
|
|
3039
3078
|
function DatePicker2(props, forwardedRef) {
|
|
3040
3079
|
const {
|
|
3041
3080
|
placeholder = "Select date",
|
|
3081
|
+
variant = "default",
|
|
3082
|
+
startLabel = "Start",
|
|
3083
|
+
endLabel = "End",
|
|
3084
|
+
startTime,
|
|
3085
|
+
endTime,
|
|
3086
|
+
startPlaceholder = placeholder,
|
|
3087
|
+
endPlaceholder = placeholder,
|
|
3042
3088
|
open: openProp,
|
|
3043
3089
|
defaultOpen = false,
|
|
3044
3090
|
onOpenChange,
|
|
@@ -3176,18 +3222,28 @@ var DatePicker = forwardRef(
|
|
|
3176
3222
|
const today = useMemo(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
3177
3223
|
const hasValue = isRange ? rangeValue.start != null : singleValue != null;
|
|
3178
3224
|
const triggerLabel = isRange ? rangeValue.start && rangeValue.end ? `${formatValue(rangeValue.start)} - ${formatValue(rangeValue.end)}` : rangeValue.start ? `${formatValue(rangeValue.start)} - ...` : placeholder : singleValue ? formatValue(singleValue) : placeholder;
|
|
3179
|
-
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;
|
|
3180
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;
|
|
3181
3231
|
const resolvedAccessibilityLabel = accessibilityLabel ?? placeholder;
|
|
3182
3232
|
return /* @__PURE__ */ jsx(
|
|
3183
3233
|
View,
|
|
3184
3234
|
{
|
|
3185
3235
|
...rest,
|
|
3186
3236
|
ref: setRootRef,
|
|
3187
|
-
style: [
|
|
3237
|
+
style: [
|
|
3238
|
+
styles12.root,
|
|
3239
|
+
usesRangeTrigger && styles12.rangeRoot,
|
|
3240
|
+
isOpen && styles12.rootOpen,
|
|
3241
|
+
disabled && styles12.disabled,
|
|
3242
|
+
style
|
|
3243
|
+
],
|
|
3188
3244
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3189
3245
|
children: /* @__PURE__ */ jsxs(View, { style: [styles12.triggerWrap, isOpen && styles12.triggerWrapOpen], children: [
|
|
3190
|
-
/* @__PURE__ */
|
|
3246
|
+
/* @__PURE__ */ jsx(
|
|
3191
3247
|
Pressable,
|
|
3192
3248
|
{
|
|
3193
3249
|
ref: triggerRef,
|
|
@@ -3198,15 +3254,29 @@ var DatePicker = forwardRef(
|
|
|
3198
3254
|
accessibilityState: { disabled, expanded: isOpen },
|
|
3199
3255
|
style: [
|
|
3200
3256
|
styles12.trigger,
|
|
3201
|
-
|
|
3257
|
+
usesRangeTrigger && styles12.rangeTrigger,
|
|
3258
|
+
usesRangeTrigger && (usesVerticalRangeTrigger ? styles12.rangeTriggerVertical : styles12.rangeTriggerHorizontal),
|
|
3259
|
+
{
|
|
3260
|
+
borderColor: triggerBorderColor,
|
|
3261
|
+
backgroundColor: usesRangeTrigger ? colors.grey800 : colors.grey700
|
|
3262
|
+
}
|
|
3202
3263
|
],
|
|
3203
|
-
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: [
|
|
3204
3274
|
/* @__PURE__ */ jsx(Text, { style: [styles12.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
3205
3275
|
/* @__PURE__ */ jsx(View, { style: styles12.iconSlot, children: /* @__PURE__ */ jsx(CalendarOutlineIcon, { size: ICON_SIZE7, color: colors.grey100 }) })
|
|
3206
|
-
]
|
|
3276
|
+
] })
|
|
3207
3277
|
}
|
|
3208
3278
|
),
|
|
3209
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style: [styles12.menu, calendarStyle], children: [
|
|
3279
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: [styles12.menu, usesRangeTrigger && styles12.rangeMenu, calendarStyle], children: [
|
|
3210
3280
|
/* @__PURE__ */ jsxs(View, { style: styles12.calendarHeader, children: [
|
|
3211
3281
|
/* @__PURE__ */ jsx(
|
|
3212
3282
|
Pressable,
|
|
@@ -3349,6 +3419,9 @@ var styles12 = StyleSheet.create({
|
|
|
3349
3419
|
rootOpen: {
|
|
3350
3420
|
zIndex: 30
|
|
3351
3421
|
},
|
|
3422
|
+
rangeRoot: {
|
|
3423
|
+
width: RANGE_TRIGGER_WIDTH
|
|
3424
|
+
},
|
|
3352
3425
|
disabled: {
|
|
3353
3426
|
opacity: 0.6
|
|
3354
3427
|
},
|
|
@@ -3375,6 +3448,65 @@ var styles12 = StyleSheet.create({
|
|
|
3375
3448
|
flex: 1,
|
|
3376
3449
|
minWidth: 0
|
|
3377
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
|
+
},
|
|
3378
3510
|
iconSlot: {
|
|
3379
3511
|
width: ICON_SIZE7,
|
|
3380
3512
|
height: ICON_SIZE7,
|
|
@@ -3402,6 +3534,9 @@ var styles12 = StyleSheet.create({
|
|
|
3402
3534
|
}
|
|
3403
3535
|
})
|
|
3404
3536
|
},
|
|
3537
|
+
rangeMenu: {
|
|
3538
|
+
width: RANGE_TRIGGER_WIDTH
|
|
3539
|
+
},
|
|
3405
3540
|
calendarHeader: {
|
|
3406
3541
|
height: 36,
|
|
3407
3542
|
flexDirection: "row",
|