@ecohouse/ui 0.1.6 → 0.1.8
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 +13 -12
- package/dist/index.cjs +699 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +137 -3
- package/dist/index.d.ts +137 -3
- package/dist/index.js +690 -103
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/CommentCard/CommentCard.stories.tsx +31 -0
- package/src/components/CommentCard/CommentCard.tsx +209 -0
- package/src/components/CommentCard/index.ts +2 -0
- package/src/components/LanguageSwitcher/LanguageSwitcher.stories.tsx +52 -0
- package/src/components/LanguageSwitcher/LanguageSwitcher.tsx +287 -0
- package/src/components/LanguageSwitcher/index.ts +2 -0
- package/src/components/RatingInput/RatingInput.stories.tsx +41 -0
- package/src/components/RatingInput/RatingInput.tsx +168 -0
- package/src/components/RatingInput/index.ts +2 -0
- package/src/components/index.ts +9 -0
- package/src/icons/Globe/GlobeIcon.tsx +20 -0
- package/src/icons/Globe/GlobeIcon.web.tsx +26 -0
- package/src/icons/Globe/globePath.ts +3 -0
- package/src/icons/Globe/index.ts +2 -0
- package/src/icons/Star/StarIcon.tsx +35 -0
- package/src/icons/Star/StarIcon.web.tsx +41 -0
- package/src/icons/Star/index.ts +2 -0
- package/src/icons/Star/starPath.ts +3 -0
- package/src/icons/StarFilled/StarFilledIcon.tsx +28 -0
- package/src/icons/StarFilled/StarFilledIcon.web.tsx +34 -0
- package/src/icons/StarFilled/index.ts +1 -0
- package/src/icons/index.ts +4 -0
- package/src/icons/registry.ts +9 -1
- package/src/index.ts +22 -1
- package/src/theme/index.ts +3 -0
- package/src/theme/typography.ts +50 -0
package/dist/index.js
CHANGED
|
@@ -101,6 +101,13 @@ var segmentedToggleTypography = {
|
|
|
101
101
|
lineHeight: 14,
|
|
102
102
|
letterSpacing: 0
|
|
103
103
|
};
|
|
104
|
+
var languageSwitcherTypography = {
|
|
105
|
+
fontFamily: fonts.sans,
|
|
106
|
+
fontSize: 14,
|
|
107
|
+
fontWeight: "600",
|
|
108
|
+
lineHeight: 19,
|
|
109
|
+
letterSpacing: 0
|
|
110
|
+
};
|
|
104
111
|
var counterTypography = {
|
|
105
112
|
fontFamily: fonts.sans,
|
|
106
113
|
fontSize: 14,
|
|
@@ -108,6 +115,43 @@ var counterTypography = {
|
|
|
108
115
|
lineHeight: 14,
|
|
109
116
|
letterSpacing: 0
|
|
110
117
|
};
|
|
118
|
+
var ratingTypography = {
|
|
119
|
+
fontFamily: fonts.sans,
|
|
120
|
+
fontSize: 32,
|
|
121
|
+
fontWeight: "700",
|
|
122
|
+
lineHeight: 35.84,
|
|
123
|
+
letterSpacing: 0
|
|
124
|
+
};
|
|
125
|
+
var commentCardTypography = {
|
|
126
|
+
name: {
|
|
127
|
+
fontFamily: fonts.sans,
|
|
128
|
+
fontSize: 16,
|
|
129
|
+
fontWeight: "600",
|
|
130
|
+
lineHeight: 18,
|
|
131
|
+
letterSpacing: 0
|
|
132
|
+
},
|
|
133
|
+
date: {
|
|
134
|
+
fontFamily: fonts.sans,
|
|
135
|
+
fontSize: 14,
|
|
136
|
+
fontWeight: "400",
|
|
137
|
+
lineHeight: 16,
|
|
138
|
+
letterSpacing: 0
|
|
139
|
+
},
|
|
140
|
+
comment: {
|
|
141
|
+
fontFamily: fonts.sans,
|
|
142
|
+
fontSize: 14,
|
|
143
|
+
fontWeight: "400",
|
|
144
|
+
lineHeight: 19,
|
|
145
|
+
letterSpacing: 0
|
|
146
|
+
},
|
|
147
|
+
action: {
|
|
148
|
+
fontFamily: fonts.sans,
|
|
149
|
+
fontSize: 12,
|
|
150
|
+
fontWeight: "700",
|
|
151
|
+
lineHeight: 12,
|
|
152
|
+
letterSpacing: 0
|
|
153
|
+
}
|
|
154
|
+
};
|
|
111
155
|
var inputTypography = {
|
|
112
156
|
label: {
|
|
113
157
|
fontFamily: fonts.sans,
|
|
@@ -445,6 +489,21 @@ function HeartIcon({ size = 20, color = colors.primary, strokeWidth = 1.5 }) {
|
|
|
445
489
|
) });
|
|
446
490
|
}
|
|
447
491
|
|
|
492
|
+
// src/icons/Globe/globePath.ts
|
|
493
|
+
var GLOBE_PATH = "M18.3333 10C18.3333 14.6024 14.6024 18.3333 10 18.3333M18.3333 10C18.3333 5.39763 14.6024 1.66667 10 1.66667M18.3333 10H1.66667M10 18.3333C5.39763 18.3333 1.66667 14.6024 1.66667 10M10 18.3333C12.0833 16.0511 13.2675 13.0836 13.3333 10C13.2675 6.91643 12.0833 3.94892 10 1.66667M10 18.3333C7.91667 16.0511 6.73248 13.0836 6.66667 10C6.73248 6.91643 7.91667 3.94892 10 1.66667M1.66667 10C1.66667 5.39763 5.39763 1.66667 10 1.66667";
|
|
494
|
+
function GlobeIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
495
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: size, viewBox: "0 0 20 20", fill: "none", children: /* @__PURE__ */ jsx(
|
|
496
|
+
Path,
|
|
497
|
+
{
|
|
498
|
+
d: GLOBE_PATH,
|
|
499
|
+
stroke: color,
|
|
500
|
+
strokeWidth,
|
|
501
|
+
strokeLinecap: "round",
|
|
502
|
+
strokeLinejoin: "round"
|
|
503
|
+
}
|
|
504
|
+
) });
|
|
505
|
+
}
|
|
506
|
+
|
|
448
507
|
// src/icons/HelpCircle/helpCirclePath.ts
|
|
449
508
|
var HELP_CIRCLE_PATH = "M6.99971 6.00149C7.11717 5.66757 7.34902 5.386 7.6542 5.20665C7.95937 5.0273 8.31817 4.96174 8.66705 5.02158C9.01593 5.08142 9.33238 5.2628 9.56034 5.5336C9.7883 5.8044 9.91306 6.14714 9.91254 6.50112C9.91254 7.50037 8.41365 8 8.41365 8M8.43298 10H8.43964M8.33304 13.3333C11.4627 13.3333 13.9997 10.7963 13.9997 7.66667C13.9997 4.53705 11.4627 2 8.33304 2C5.20343 2 2.66638 4.53705 2.66638 7.66667C2.66638 8.3 2.77027 8.90906 2.96196 9.47774C3.03409 9.69175 3.07016 9.79875 3.07666 9.88095C3.08309 9.96213 3.07823 10.019 3.05814 10.098C3.03781 10.1779 2.99291 10.261 2.9031 10.4272L1.81267 12.4456C1.65713 12.7335 1.57936 12.8774 1.59676 12.9885C1.61192 13.0853 1.66887 13.1705 1.75249 13.2215C1.84849 13.2801 2.01124 13.2632 2.33674 13.2296L5.75075 12.8767C5.85414 12.866 5.90583 12.8606 5.95295 12.8624C5.99929 12.8642 6.03201 12.8686 6.0772 12.879C6.12315 12.8896 6.18092 12.9118 6.29648 12.9564C6.92851 13.1999 7.61519 13.3333 8.33304 13.3333Z";
|
|
450
509
|
function HelpCircleIcon({
|
|
@@ -705,6 +764,47 @@ function SidebarIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
|
705
764
|
) });
|
|
706
765
|
}
|
|
707
766
|
|
|
767
|
+
// src/icons/Star/starPath.ts
|
|
768
|
+
var STAR_PATH = "M12.6112 2.09824C12.9186 1.47565 13.0722 1.16436 13.2808 1.0649C13.4623 0.978367 13.6732 0.978367 13.8546 1.0649C14.0632 1.16436 14.2169 1.47565 14.5242 2.09824L17.4398 8.00486C17.5305 8.18866 17.5759 8.28056 17.6422 8.35192C17.7009 8.41509 17.7713 8.46628 17.8495 8.50264C17.9378 8.54371 18.0392 8.55854 18.242 8.58818L24.7637 9.54142C25.4505 9.6418 25.7938 9.69199 25.9528 9.85973C26.091 10.0057 26.156 10.2062 26.1297 10.4055C26.0995 10.6346 25.8509 10.8767 25.3537 11.361L20.6363 15.9557C20.4893 16.0989 20.4157 16.1706 20.3683 16.2558C20.3263 16.3312 20.2993 16.4141 20.2889 16.4998C20.2772 16.5966 20.2945 16.6978 20.3292 16.9001L21.4423 23.39C21.5597 24.0745 21.6184 24.4167 21.5081 24.6198C21.4121 24.7965 21.2415 24.9205 21.0438 24.9571C20.8165 24.9992 20.5092 24.8376 19.8945 24.5144L14.0642 21.4483C13.8826 21.3527 13.7917 21.305 13.696 21.2862C13.6113 21.2696 13.5242 21.2696 13.4394 21.2862C13.3437 21.305 13.2529 21.3527 13.0713 21.4483L7.24094 24.5144C6.62626 24.8376 6.31892 24.9992 6.09167 24.9571C5.89395 24.9205 5.72334 24.7965 5.62736 24.6198C5.51704 24.4167 5.57574 24.0745 5.69314 23.39L6.80622 16.9001C6.84092 16.6978 6.85828 16.5966 6.84653 16.4998C6.83614 16.4141 6.80919 16.3312 6.76718 16.2558C6.71974 16.1706 6.64621 16.0989 6.49916 15.9557L1.78179 11.361C1.28459 10.8767 1.03599 10.6346 1.00574 10.4055C0.979423 10.2062 1.04445 10.0057 1.18271 9.85973C1.34162 9.69199 1.685 9.6418 2.37177 9.54142L8.89346 8.58818C9.09627 8.55854 9.19768 8.54371 9.286 8.50264C9.36419 8.46628 9.43459 8.41509 9.49329 8.35192C9.55958 8.28056 9.60495 8.18866 9.69567 8.00486L12.6112 2.09824Z";
|
|
769
|
+
function StarIcon({
|
|
770
|
+
active = false,
|
|
771
|
+
size = 28,
|
|
772
|
+
height,
|
|
773
|
+
color,
|
|
774
|
+
strokeWidth = 2
|
|
775
|
+
}) {
|
|
776
|
+
const resolvedColor = color ?? (active ? "#E38E5E" : colors.grey150);
|
|
777
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: height ?? size * 26 / 28, viewBox: "0 0 28 26", fill: "none", children: /* @__PURE__ */ jsx(
|
|
778
|
+
Path,
|
|
779
|
+
{
|
|
780
|
+
d: STAR_PATH,
|
|
781
|
+
fill: active ? resolvedColor : "none",
|
|
782
|
+
stroke: resolvedColor,
|
|
783
|
+
strokeWidth,
|
|
784
|
+
strokeLinecap: "round",
|
|
785
|
+
strokeLinejoin: "round"
|
|
786
|
+
}
|
|
787
|
+
) });
|
|
788
|
+
}
|
|
789
|
+
function StarFilledIcon({
|
|
790
|
+
size = 28,
|
|
791
|
+
height,
|
|
792
|
+
color = "#E38E5E",
|
|
793
|
+
strokeWidth = 2
|
|
794
|
+
}) {
|
|
795
|
+
return /* @__PURE__ */ jsx(Svg, { width: size, height: height ?? size * 26 / 28, viewBox: "0 0 28 26", fill: color, children: /* @__PURE__ */ jsx(
|
|
796
|
+
Path,
|
|
797
|
+
{
|
|
798
|
+
d: STAR_PATH,
|
|
799
|
+
fill: color,
|
|
800
|
+
stroke: color,
|
|
801
|
+
strokeWidth,
|
|
802
|
+
strokeLinecap: "round",
|
|
803
|
+
strokeLinejoin: "round"
|
|
804
|
+
}
|
|
805
|
+
) });
|
|
806
|
+
}
|
|
807
|
+
|
|
708
808
|
// src/icons/User/userPath.ts
|
|
709
809
|
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";
|
|
710
810
|
function UserIcon({ size = 20, color = colors.primary, strokeWidth = 2 }) {
|
|
@@ -761,6 +861,7 @@ var icons = {
|
|
|
761
861
|
clock: ClockIcon,
|
|
762
862
|
facebook: FacebookIcon,
|
|
763
863
|
heart: HeartIcon,
|
|
864
|
+
globe: GlobeIcon,
|
|
764
865
|
helpCircle: HelpCircleIcon,
|
|
765
866
|
home: HomeIcon,
|
|
766
867
|
instagram: InstagramIcon,
|
|
@@ -777,6 +878,8 @@ var icons = {
|
|
|
777
878
|
settings: SettingsIcon,
|
|
778
879
|
show: ShowIcon,
|
|
779
880
|
sidebar: SidebarIcon,
|
|
881
|
+
star: StarIcon,
|
|
882
|
+
starFilled: StarFilledIcon,
|
|
780
883
|
user: UserIcon,
|
|
781
884
|
usersAlt: UsersAltIcon,
|
|
782
885
|
video: VideoIcon
|
|
@@ -795,13 +898,15 @@ var iconGroups = {
|
|
|
795
898
|
"calendar",
|
|
796
899
|
"calendarOutline",
|
|
797
900
|
"heart",
|
|
901
|
+
"star",
|
|
902
|
+
"starFilled",
|
|
798
903
|
"minus",
|
|
799
904
|
"plus"
|
|
800
905
|
],
|
|
801
906
|
objects: ["bag", "building", "clock", "user", "usersAlt", "video"],
|
|
802
907
|
communication: ["mail", "phone"],
|
|
803
908
|
social: ["facebook", "instagram", "linkedin"],
|
|
804
|
-
interface: ["layoutGrid", "sidebar", "settings", "helpCircle", "logOut"]
|
|
909
|
+
interface: ["globe", "layoutGrid", "sidebar", "settings", "helpCircle", "logOut"]
|
|
805
910
|
};
|
|
806
911
|
var iconGroupNames = Object.keys(iconGroups);
|
|
807
912
|
function getIconsByGroup(group) {
|
|
@@ -1530,7 +1635,223 @@ var styles5 = StyleSheet.create({
|
|
|
1530
1635
|
flexShrink: 1
|
|
1531
1636
|
}
|
|
1532
1637
|
});
|
|
1533
|
-
var
|
|
1638
|
+
var defaultLanguageOptions = [
|
|
1639
|
+
{ value: "hy", label: "\u0540\u0561\u0575" },
|
|
1640
|
+
{ value: "en", label: "Eng" },
|
|
1641
|
+
{ value: "ru", label: "\u0420\u0443\u0441" }
|
|
1642
|
+
];
|
|
1643
|
+
var CONTROL_WIDTH = 90;
|
|
1644
|
+
var CONTROL_HEIGHT = 35;
|
|
1645
|
+
var ICON_SIZE4 = 16;
|
|
1646
|
+
var LanguageSwitcher = forwardRef(
|
|
1647
|
+
function LanguageSwitcher2({
|
|
1648
|
+
options = defaultLanguageOptions,
|
|
1649
|
+
value,
|
|
1650
|
+
defaultValue,
|
|
1651
|
+
onValueChange,
|
|
1652
|
+
open: openProp,
|
|
1653
|
+
defaultOpen = false,
|
|
1654
|
+
onOpenChange,
|
|
1655
|
+
disabled = false,
|
|
1656
|
+
accessibilityLabel = "Language",
|
|
1657
|
+
style,
|
|
1658
|
+
className,
|
|
1659
|
+
hitSlop = 8,
|
|
1660
|
+
...rest
|
|
1661
|
+
}, forwardedRef) {
|
|
1662
|
+
const wrapperRef = useRef(null);
|
|
1663
|
+
const triggerRef = useRef(null);
|
|
1664
|
+
const setWrapperRef = useMemo(() => mergeRefs(wrapperRef, forwardedRef), [forwardedRef]);
|
|
1665
|
+
const firstValue = options[0]?.value ?? "";
|
|
1666
|
+
const isValueControlled = value !== void 0;
|
|
1667
|
+
const isOpenControlled = openProp !== void 0;
|
|
1668
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? firstValue);
|
|
1669
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
1670
|
+
const [triggerHovered, setTriggerHovered] = useState(false);
|
|
1671
|
+
const [hoveredValue, setHoveredValue] = useState(null);
|
|
1672
|
+
const selectedValue = isValueControlled ? value : uncontrolledValue;
|
|
1673
|
+
const isOpen = isOpenControlled ? openProp : uncontrolledOpen;
|
|
1674
|
+
const selectedOption = options.find((option) => option.value === selectedValue) ?? options[0] ?? null;
|
|
1675
|
+
useApplyWebClassName(wrapperRef, className?.trim() || void 0);
|
|
1676
|
+
const setOpen = useCallback(
|
|
1677
|
+
(next) => {
|
|
1678
|
+
if (disabled || next === isOpen) return;
|
|
1679
|
+
if (!isOpenControlled) setUncontrolledOpen(next);
|
|
1680
|
+
onOpenChange?.(next);
|
|
1681
|
+
},
|
|
1682
|
+
[disabled, isOpen, isOpenControlled, onOpenChange]
|
|
1683
|
+
);
|
|
1684
|
+
const closeAndFocusTrigger = useCallback(() => {
|
|
1685
|
+
setOpen(false);
|
|
1686
|
+
const node = triggerRef.current;
|
|
1687
|
+
node?.focus?.();
|
|
1688
|
+
}, [setOpen]);
|
|
1689
|
+
useEffect(() => {
|
|
1690
|
+
if (Platform.OS !== "web" || !isOpen) return;
|
|
1691
|
+
const handlePointerDown = (event) => {
|
|
1692
|
+
const wrapper = wrapperRef.current;
|
|
1693
|
+
const target = event.target;
|
|
1694
|
+
if (wrapper?.contains && target instanceof Node && !wrapper.contains(target)) {
|
|
1695
|
+
setOpen(false);
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
const handleKeyDown = (event) => {
|
|
1699
|
+
if (event.key === "Escape") {
|
|
1700
|
+
event.preventDefault();
|
|
1701
|
+
closeAndFocusTrigger();
|
|
1702
|
+
}
|
|
1703
|
+
};
|
|
1704
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
1705
|
+
document.addEventListener("touchstart", handlePointerDown);
|
|
1706
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1707
|
+
return () => {
|
|
1708
|
+
document.removeEventListener("mousedown", handlePointerDown);
|
|
1709
|
+
document.removeEventListener("touchstart", handlePointerDown);
|
|
1710
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1711
|
+
};
|
|
1712
|
+
}, [closeAndFocusTrigger, isOpen, setOpen]);
|
|
1713
|
+
const selectLanguage = (nextValue) => {
|
|
1714
|
+
if (nextValue !== selectedValue) {
|
|
1715
|
+
if (!isValueControlled) setUncontrolledValue(nextValue);
|
|
1716
|
+
onValueChange?.(nextValue);
|
|
1717
|
+
}
|
|
1718
|
+
closeAndFocusTrigger();
|
|
1719
|
+
};
|
|
1720
|
+
return /* @__PURE__ */ jsxs(
|
|
1721
|
+
View,
|
|
1722
|
+
{
|
|
1723
|
+
...rest,
|
|
1724
|
+
ref: setWrapperRef,
|
|
1725
|
+
style: [styles6.wrapper, isOpen && styles6.wrapperOpen, disabled && styles6.disabled, style],
|
|
1726
|
+
children: [
|
|
1727
|
+
/* @__PURE__ */ jsxs(
|
|
1728
|
+
Pressable,
|
|
1729
|
+
{
|
|
1730
|
+
ref: triggerRef,
|
|
1731
|
+
onPress: () => setOpen(!isOpen),
|
|
1732
|
+
disabled: disabled || options.length === 0,
|
|
1733
|
+
hitSlop,
|
|
1734
|
+
accessibilityRole: "button",
|
|
1735
|
+
accessibilityLabel,
|
|
1736
|
+
accessibilityState: { disabled, expanded: isOpen },
|
|
1737
|
+
onHoverIn: () => setTriggerHovered(true),
|
|
1738
|
+
onHoverOut: () => setTriggerHovered(false),
|
|
1739
|
+
style: ({ pressed }) => [
|
|
1740
|
+
styles6.trigger,
|
|
1741
|
+
(triggerHovered || pressed || isOpen) && styles6.triggerActive
|
|
1742
|
+
],
|
|
1743
|
+
children: [
|
|
1744
|
+
/* @__PURE__ */ jsx(GlobeIcon, { size: ICON_SIZE4, color: colors.white, strokeWidth: 2 }),
|
|
1745
|
+
/* @__PURE__ */ jsx(Text, { style: styles6.triggerLabel, numberOfLines: 1, children: selectedOption?.label ?? "" }),
|
|
1746
|
+
/* @__PURE__ */ jsx(View, { style: [styles6.chevron, isOpen && styles6.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: ICON_SIZE4, color: colors.white, strokeWidth: 2 }) })
|
|
1747
|
+
]
|
|
1748
|
+
}
|
|
1749
|
+
),
|
|
1750
|
+
isOpen && options.length > 0 ? /* @__PURE__ */ jsx(View, { style: styles6.menu, accessibilityRole: "menu", children: options.map((option) => {
|
|
1751
|
+
const selected = option.value === selectedValue;
|
|
1752
|
+
return /* @__PURE__ */ jsx(
|
|
1753
|
+
Pressable,
|
|
1754
|
+
{
|
|
1755
|
+
onPress: () => selectLanguage(option.value),
|
|
1756
|
+
accessibilityRole: "menuitem",
|
|
1757
|
+
accessibilityLabel: option.label,
|
|
1758
|
+
accessibilityState: { selected },
|
|
1759
|
+
onHoverIn: () => setHoveredValue(option.value),
|
|
1760
|
+
onHoverOut: () => setHoveredValue(null),
|
|
1761
|
+
style: ({ pressed }) => [
|
|
1762
|
+
styles6.item,
|
|
1763
|
+
selected ? styles6.itemSelected : (hoveredValue === option.value || pressed) && styles6.itemHovered
|
|
1764
|
+
],
|
|
1765
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles6.itemLabel, selected && styles6.itemLabelSelected], children: option.label })
|
|
1766
|
+
},
|
|
1767
|
+
option.value
|
|
1768
|
+
);
|
|
1769
|
+
}) }) : null
|
|
1770
|
+
]
|
|
1771
|
+
}
|
|
1772
|
+
);
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
var styles6 = StyleSheet.create({
|
|
1776
|
+
wrapper: {
|
|
1777
|
+
position: "relative",
|
|
1778
|
+
width: CONTROL_WIDTH,
|
|
1779
|
+
alignSelf: "flex-start"
|
|
1780
|
+
},
|
|
1781
|
+
wrapperOpen: {
|
|
1782
|
+
zIndex: 20
|
|
1783
|
+
},
|
|
1784
|
+
disabled: {
|
|
1785
|
+
opacity: 0.6
|
|
1786
|
+
},
|
|
1787
|
+
trigger: {
|
|
1788
|
+
width: CONTROL_WIDTH,
|
|
1789
|
+
height: CONTROL_HEIGHT,
|
|
1790
|
+
flexDirection: "row",
|
|
1791
|
+
alignItems: "center",
|
|
1792
|
+
gap: 8,
|
|
1793
|
+
padding: 8,
|
|
1794
|
+
borderRadius: 12,
|
|
1795
|
+
backgroundColor: "transparent"
|
|
1796
|
+
},
|
|
1797
|
+
triggerActive: {
|
|
1798
|
+
backgroundColor: colors.grey700
|
|
1799
|
+
},
|
|
1800
|
+
triggerLabel: {
|
|
1801
|
+
...languageSwitcherTypography,
|
|
1802
|
+
...Platform.select({ web: { fontFamily: `${fonts.sans}, sans-serif` } }),
|
|
1803
|
+
minWidth: 0,
|
|
1804
|
+
flex: 1,
|
|
1805
|
+
color: colors.white
|
|
1806
|
+
},
|
|
1807
|
+
chevron: {
|
|
1808
|
+
width: ICON_SIZE4,
|
|
1809
|
+
height: ICON_SIZE4,
|
|
1810
|
+
flexShrink: 0,
|
|
1811
|
+
alignItems: "center",
|
|
1812
|
+
justifyContent: "center"
|
|
1813
|
+
},
|
|
1814
|
+
chevronOpen: {
|
|
1815
|
+
transform: [{ rotate: "180deg" }]
|
|
1816
|
+
},
|
|
1817
|
+
menu: {
|
|
1818
|
+
position: "absolute",
|
|
1819
|
+
top: CONTROL_HEIGHT + 8,
|
|
1820
|
+
left: 0,
|
|
1821
|
+
width: CONTROL_WIDTH,
|
|
1822
|
+
padding: 8,
|
|
1823
|
+
gap: 8,
|
|
1824
|
+
borderRadius: 12,
|
|
1825
|
+
backgroundColor: colors.grey700,
|
|
1826
|
+
...Platform.select({
|
|
1827
|
+
web: { boxShadow: `0 8px 24px ${colors.black}73` },
|
|
1828
|
+
default: { elevation: 8 }
|
|
1829
|
+
})
|
|
1830
|
+
},
|
|
1831
|
+
item: {
|
|
1832
|
+
height: CONTROL_HEIGHT,
|
|
1833
|
+
alignItems: "center",
|
|
1834
|
+
justifyContent: "center",
|
|
1835
|
+
paddingVertical: 8,
|
|
1836
|
+
paddingHorizontal: 12,
|
|
1837
|
+
borderRadius: 8
|
|
1838
|
+
},
|
|
1839
|
+
itemHovered: {
|
|
1840
|
+
backgroundColor: colors.whiteAlpha5
|
|
1841
|
+
},
|
|
1842
|
+
itemSelected: {
|
|
1843
|
+
backgroundColor: colors.primaryMuted
|
|
1844
|
+
},
|
|
1845
|
+
itemLabel: {
|
|
1846
|
+
...languageSwitcherTypography,
|
|
1847
|
+
...Platform.select({ web: { fontFamily: `${fonts.sans}, sans-serif` } }),
|
|
1848
|
+
color: colors.white
|
|
1849
|
+
},
|
|
1850
|
+
itemLabelSelected: {
|
|
1851
|
+
color: colors.primary
|
|
1852
|
+
}
|
|
1853
|
+
});
|
|
1854
|
+
var ICON_SIZE5 = 28;
|
|
1534
1855
|
var StatCard = forwardRef(function StatCard2({ label, icon: Icon2, style, className, accessibilityLabel, ...rest }, forwardedRef) {
|
|
1535
1856
|
const containerRef = useRef(null);
|
|
1536
1857
|
const resolvedClassName = className?.trim() || void 0;
|
|
@@ -1541,17 +1862,17 @@ var StatCard = forwardRef(function StatCard2({ label, icon: Icon2, style, classN
|
|
|
1541
1862
|
{
|
|
1542
1863
|
...rest,
|
|
1543
1864
|
ref: setContainerRef,
|
|
1544
|
-
style: [
|
|
1865
|
+
style: [styles7.base, style],
|
|
1545
1866
|
accessibilityRole: "text",
|
|
1546
1867
|
accessibilityLabel: accessibilityLabel ?? label,
|
|
1547
1868
|
children: [
|
|
1548
|
-
/* @__PURE__ */ jsx(Icon2, { size:
|
|
1549
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
1869
|
+
/* @__PURE__ */ jsx(Icon2, { size: ICON_SIZE5, color: colors.white }),
|
|
1870
|
+
/* @__PURE__ */ jsx(Text, { style: styles7.label, children: label })
|
|
1550
1871
|
]
|
|
1551
1872
|
}
|
|
1552
1873
|
);
|
|
1553
1874
|
});
|
|
1554
|
-
var
|
|
1875
|
+
var styles7 = StyleSheet.create({
|
|
1555
1876
|
base: {
|
|
1556
1877
|
width: 204.5,
|
|
1557
1878
|
minHeight: 114,
|
|
@@ -1637,7 +1958,7 @@ var Button = forwardRef(
|
|
|
1637
1958
|
useApplyWebClassName(textRef, textClassName);
|
|
1638
1959
|
const iconNode = customIcon ?? /* @__PURE__ */ jsx(ArrowRightIcon, { size: metrics.iconSize, color: preset.iconColor });
|
|
1639
1960
|
const containerStyle = [
|
|
1640
|
-
|
|
1961
|
+
styles8.base,
|
|
1641
1962
|
{
|
|
1642
1963
|
minHeight: metrics.minHeight,
|
|
1643
1964
|
borderRadius: metrics.borderRadius,
|
|
@@ -1648,15 +1969,15 @@ var Button = forwardRef(
|
|
|
1648
1969
|
paddingRight: hasIcon ? metrics.paddingRightWithIcon : metrics.paddingRight,
|
|
1649
1970
|
gap: hasIcon ? metrics.gap : 0
|
|
1650
1971
|
},
|
|
1651
|
-
disabled &&
|
|
1972
|
+
disabled && styles8.disabled,
|
|
1652
1973
|
style
|
|
1653
1974
|
];
|
|
1654
1975
|
const labelStyle = [
|
|
1655
|
-
|
|
1976
|
+
styles8.label,
|
|
1656
1977
|
metrics.text,
|
|
1657
1978
|
{ color: preset.textColor },
|
|
1658
|
-
Platform.OS === "android" ?
|
|
1659
|
-
!hasIcon &&
|
|
1979
|
+
Platform.OS === "android" ? styles8.labelAndroid : null,
|
|
1980
|
+
!hasIcon && styles8.labelCentered,
|
|
1660
1981
|
textStyle
|
|
1661
1982
|
];
|
|
1662
1983
|
return /* @__PURE__ */ jsxs(
|
|
@@ -1677,7 +1998,7 @@ var Button = forwardRef(
|
|
|
1677
1998
|
View,
|
|
1678
1999
|
{
|
|
1679
2000
|
style: [
|
|
1680
|
-
|
|
2001
|
+
styles8.iconContainer,
|
|
1681
2002
|
{
|
|
1682
2003
|
width: metrics.iconContainerSize,
|
|
1683
2004
|
height: metrics.iconContainerSize,
|
|
@@ -1693,7 +2014,7 @@ var Button = forwardRef(
|
|
|
1693
2014
|
);
|
|
1694
2015
|
}
|
|
1695
2016
|
);
|
|
1696
|
-
var
|
|
2017
|
+
var styles8 = StyleSheet.create({
|
|
1697
2018
|
base: {
|
|
1698
2019
|
flexDirection: "row",
|
|
1699
2020
|
alignItems: "center",
|
|
@@ -1771,13 +2092,13 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1771
2092
|
accessibilityRole: "checkbox",
|
|
1772
2093
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
1773
2094
|
accessibilityState: { checked: isActive, disabled },
|
|
1774
|
-
style: [
|
|
2095
|
+
style: [styles9.root, disabled && styles9.disabled, style],
|
|
1775
2096
|
children: [
|
|
1776
2097
|
/* @__PURE__ */ jsx(
|
|
1777
2098
|
View,
|
|
1778
2099
|
{
|
|
1779
2100
|
style: [
|
|
1780
|
-
|
|
2101
|
+
styles9.box,
|
|
1781
2102
|
{
|
|
1782
2103
|
backgroundColor: chrome.backgroundColor,
|
|
1783
2104
|
borderColor: chrome.borderColor
|
|
@@ -1786,12 +2107,12 @@ var Checkbox = forwardRef(function Checkbox2({
|
|
|
1786
2107
|
children: isActive ? /* @__PURE__ */ jsx(CheckIcon, { size: CHECK_SIZE, color: colors.primary, strokeWidth: CHECK_STROKE }) : null
|
|
1787
2108
|
}
|
|
1788
2109
|
),
|
|
1789
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2110
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles9.label, labelStyle], children: labelContent }) : labelContent : null
|
|
1790
2111
|
]
|
|
1791
2112
|
}
|
|
1792
2113
|
);
|
|
1793
2114
|
});
|
|
1794
|
-
var
|
|
2115
|
+
var styles9 = StyleSheet.create({
|
|
1795
2116
|
root: {
|
|
1796
2117
|
flexDirection: "row",
|
|
1797
2118
|
alignItems: "center",
|
|
@@ -1889,7 +2210,7 @@ var DEFAULT_WIDTH = 380;
|
|
|
1889
2210
|
var TRIGGER_HEIGHT = 44;
|
|
1890
2211
|
var TRIGGER_RADIUS = 60;
|
|
1891
2212
|
var MENU_RADIUS2 = 20;
|
|
1892
|
-
var
|
|
2213
|
+
var ICON_SIZE6 = 20;
|
|
1893
2214
|
var NAV_ICON_SIZE = 20;
|
|
1894
2215
|
var DAY_CELL_HEIGHT = 44;
|
|
1895
2216
|
var DAY_CIRCLE_SIZE = 44;
|
|
@@ -2041,9 +2362,9 @@ var DatePicker = forwardRef(
|
|
|
2041
2362
|
{
|
|
2042
2363
|
...rest,
|
|
2043
2364
|
ref: setRootRef,
|
|
2044
|
-
style: [
|
|
2365
|
+
style: [styles10.root, isOpen && styles10.rootOpen, disabled && styles10.disabled, style],
|
|
2045
2366
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2046
|
-
children: /* @__PURE__ */ jsxs(View, { style: [
|
|
2367
|
+
children: /* @__PURE__ */ jsxs(View, { style: [styles10.triggerWrap, isOpen && styles10.triggerWrapOpen], children: [
|
|
2047
2368
|
/* @__PURE__ */ jsxs(
|
|
2048
2369
|
Pressable,
|
|
2049
2370
|
{
|
|
@@ -2054,17 +2375,17 @@ var DatePicker = forwardRef(
|
|
|
2054
2375
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2055
2376
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2056
2377
|
style: [
|
|
2057
|
-
|
|
2378
|
+
styles10.trigger,
|
|
2058
2379
|
{ borderColor: triggerBorderColor, backgroundColor: colors.grey700 }
|
|
2059
2380
|
],
|
|
2060
2381
|
children: [
|
|
2061
|
-
/* @__PURE__ */ jsx(Text, { style: [
|
|
2062
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2382
|
+
/* @__PURE__ */ jsx(Text, { style: [styles10.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: triggerLabel }),
|
|
2383
|
+
/* @__PURE__ */ jsx(View, { style: styles10.iconSlot, children: /* @__PURE__ */ jsx(CalendarOutlineIcon, { size: ICON_SIZE6, color: colors.grey100 }) })
|
|
2063
2384
|
]
|
|
2064
2385
|
}
|
|
2065
2386
|
),
|
|
2066
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style:
|
|
2067
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2387
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: styles10.menu, children: [
|
|
2388
|
+
/* @__PURE__ */ jsxs(View, { style: styles10.calendarHeader, children: [
|
|
2068
2389
|
/* @__PURE__ */ jsx(
|
|
2069
2390
|
Pressable,
|
|
2070
2391
|
{
|
|
@@ -2072,11 +2393,11 @@ var DatePicker = forwardRef(
|
|
|
2072
2393
|
hitSlop: 8,
|
|
2073
2394
|
accessibilityRole: "button",
|
|
2074
2395
|
accessibilityLabel: "Previous month",
|
|
2075
|
-
style:
|
|
2396
|
+
style: styles10.navButton,
|
|
2076
2397
|
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white })
|
|
2077
2398
|
}
|
|
2078
2399
|
),
|
|
2079
|
-
/* @__PURE__ */ jsxs(Text, { style:
|
|
2400
|
+
/* @__PURE__ */ jsxs(Text, { style: styles10.monthHeading, children: [
|
|
2080
2401
|
monthNames[visibleMonth.getMonth()],
|
|
2081
2402
|
" ",
|
|
2082
2403
|
visibleMonth.getFullYear()
|
|
@@ -2088,13 +2409,13 @@ var DatePicker = forwardRef(
|
|
|
2088
2409
|
hitSlop: 8,
|
|
2089
2410
|
accessibilityRole: "button",
|
|
2090
2411
|
accessibilityLabel: "Next month",
|
|
2091
|
-
style:
|
|
2092
|
-
children: /* @__PURE__ */ jsx(View, { style:
|
|
2412
|
+
style: styles10.navButton,
|
|
2413
|
+
children: /* @__PURE__ */ jsx(View, { style: styles10.navIconMirror, children: /* @__PURE__ */ jsx(ChevronLeftIcon, { size: NAV_ICON_SIZE, color: colors.white }) })
|
|
2093
2414
|
}
|
|
2094
2415
|
)
|
|
2095
2416
|
] }),
|
|
2096
2417
|
/* @__PURE__ */ jsxs(View, { children: [
|
|
2097
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2418
|
+
/* @__PURE__ */ jsx(View, { style: styles10.weekdayRow, children: weekdayLabels.map((weekdayLabel, index) => /* @__PURE__ */ jsx(View, { style: styles10.dayCellWrap, children: /* @__PURE__ */ jsx(Text, { style: styles10.weekdayText, children: weekdayLabel }) }, `${weekdayLabel}-${index}`)) }),
|
|
2098
2419
|
weeks.map((week, weekIndex) => {
|
|
2099
2420
|
let rangeHighlightStyle = null;
|
|
2100
2421
|
if (isRange && rangeValue.start && rangeValue.end) {
|
|
@@ -2131,13 +2452,13 @@ var DatePicker = forwardRef(
|
|
|
2131
2452
|
return /* @__PURE__ */ jsxs(
|
|
2132
2453
|
View,
|
|
2133
2454
|
{
|
|
2134
|
-
style: [
|
|
2455
|
+
style: [styles10.weekRow, weekIndex > 0 && styles10.weekRowSpaced],
|
|
2135
2456
|
children: [
|
|
2136
2457
|
rangeHighlightStyle ? /* @__PURE__ */ jsx(
|
|
2137
2458
|
View,
|
|
2138
2459
|
{
|
|
2139
2460
|
pointerEvents: "none",
|
|
2140
|
-
style: [
|
|
2461
|
+
style: [styles10.rangeHighlight, rangeHighlightStyle]
|
|
2141
2462
|
}
|
|
2142
2463
|
) : null,
|
|
2143
2464
|
week.map((day, dayIndex) => {
|
|
@@ -2160,7 +2481,7 @@ var DatePicker = forwardRef(
|
|
|
2160
2481
|
onHoverOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2161
2482
|
onPressIn: () => setHoveredDayKey(dayKey),
|
|
2162
2483
|
onPressOut: () => setHoveredDayKey((current) => current === dayKey ? null : current),
|
|
2163
|
-
style:
|
|
2484
|
+
style: styles10.dayCellWrap,
|
|
2164
2485
|
accessibilityRole: "button",
|
|
2165
2486
|
accessibilityLabel: formatValue(day),
|
|
2166
2487
|
accessibilityState: {
|
|
@@ -2172,14 +2493,14 @@ var DatePicker = forwardRef(
|
|
|
2172
2493
|
View,
|
|
2173
2494
|
{
|
|
2174
2495
|
style: [
|
|
2175
|
-
|
|
2176
|
-
isSelectedEndpoint &&
|
|
2177
|
-
isHovered &&
|
|
2496
|
+
styles10.dayCircle,
|
|
2497
|
+
isSelectedEndpoint && styles10.dayCircleSelected,
|
|
2498
|
+
isHovered && styles10.dayCircleHovered
|
|
2178
2499
|
],
|
|
2179
|
-
children: /* @__PURE__ */ jsx(Text, { style: [
|
|
2500
|
+
children: /* @__PURE__ */ jsx(Text, { style: [styles10.dayText, { color: dayTextColor }], children: day.getDate() })
|
|
2180
2501
|
}
|
|
2181
2502
|
),
|
|
2182
|
-
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsx(View, { style:
|
|
2503
|
+
isToday && !isSelectedEndpoint ? /* @__PURE__ */ jsx(View, { style: styles10.todayDot }) : null
|
|
2183
2504
|
]
|
|
2184
2505
|
},
|
|
2185
2506
|
dayIndex
|
|
@@ -2197,7 +2518,7 @@ var DatePicker = forwardRef(
|
|
|
2197
2518
|
);
|
|
2198
2519
|
}
|
|
2199
2520
|
);
|
|
2200
|
-
var
|
|
2521
|
+
var styles10 = StyleSheet.create({
|
|
2201
2522
|
root: {
|
|
2202
2523
|
width: DEFAULT_WIDTH,
|
|
2203
2524
|
gap: 8,
|
|
@@ -2233,8 +2554,8 @@ var styles9 = StyleSheet.create({
|
|
|
2233
2554
|
minWidth: 0
|
|
2234
2555
|
},
|
|
2235
2556
|
iconSlot: {
|
|
2236
|
-
width:
|
|
2237
|
-
height:
|
|
2557
|
+
width: ICON_SIZE6,
|
|
2558
|
+
height: ICON_SIZE6,
|
|
2238
2559
|
alignItems: "center",
|
|
2239
2560
|
justifyContent: "center",
|
|
2240
2561
|
flexShrink: 0
|
|
@@ -2457,13 +2778,13 @@ var Input = forwardRef(function Input2({
|
|
|
2457
2778
|
const rightIconNode = rightIcon ?? /* @__PURE__ */ jsx(ShowIcon, { size: metrics.iconSize, color: chrome.rightIconColor });
|
|
2458
2779
|
useApplyWebClassName(rootRef, className);
|
|
2459
2780
|
useApplyWebClassName(inputRef, inputClassName);
|
|
2460
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
2461
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2781
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles11.root, disabled && styles11.disabled, style], children: [
|
|
2782
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles11.label, { color: chrome.labelColor }], children: label }) : null,
|
|
2462
2783
|
/* @__PURE__ */ jsxs(
|
|
2463
2784
|
View,
|
|
2464
2785
|
{
|
|
2465
2786
|
style: [
|
|
2466
|
-
|
|
2787
|
+
styles11.field,
|
|
2467
2788
|
{
|
|
2468
2789
|
height: metrics.height,
|
|
2469
2790
|
borderRadius: metrics.borderRadius,
|
|
@@ -2478,7 +2799,7 @@ var Input = forwardRef(function Input2({
|
|
|
2478
2799
|
fieldStyle
|
|
2479
2800
|
],
|
|
2480
2801
|
children: [
|
|
2481
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [
|
|
2802
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: [styles11.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: leftIconNode }) : null,
|
|
2482
2803
|
/* @__PURE__ */ jsx(
|
|
2483
2804
|
TextInput,
|
|
2484
2805
|
{
|
|
@@ -2502,11 +2823,11 @@ var Input = forwardRef(function Input2({
|
|
|
2502
2823
|
onBlur?.(event);
|
|
2503
2824
|
},
|
|
2504
2825
|
style: [
|
|
2505
|
-
|
|
2826
|
+
styles11.input,
|
|
2506
2827
|
metrics.text,
|
|
2507
2828
|
{ color: chrome.textColor },
|
|
2508
|
-
Platform.OS === "web" ?
|
|
2509
|
-
Platform.OS === "android" ?
|
|
2829
|
+
Platform.OS === "web" ? styles11.inputWeb : null,
|
|
2830
|
+
Platform.OS === "android" ? styles11.inputAndroid : null,
|
|
2510
2831
|
inputStyle
|
|
2511
2832
|
],
|
|
2512
2833
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -2518,20 +2839,20 @@ var Input = forwardRef(function Input2({
|
|
|
2518
2839
|
{
|
|
2519
2840
|
onPress: onRightIconPress,
|
|
2520
2841
|
disabled,
|
|
2521
|
-
style: [
|
|
2842
|
+
style: [styles11.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }],
|
|
2522
2843
|
accessibilityRole: "button",
|
|
2523
2844
|
accessibilityLabel: rightIconAccessibilityLabel,
|
|
2524
2845
|
hitSlop: 8,
|
|
2525
2846
|
children: rightIconNode
|
|
2526
2847
|
}
|
|
2527
|
-
) : /* @__PURE__ */ jsx(View, { style: [
|
|
2848
|
+
) : /* @__PURE__ */ jsx(View, { style: [styles11.iconSlot, { width: metrics.iconSize, height: metrics.iconSize }], children: rightIconNode }) : null
|
|
2528
2849
|
]
|
|
2529
2850
|
}
|
|
2530
2851
|
),
|
|
2531
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2852
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles11.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
2532
2853
|
] });
|
|
2533
2854
|
});
|
|
2534
|
-
var
|
|
2855
|
+
var styles11 = StyleSheet.create({
|
|
2535
2856
|
root: {
|
|
2536
2857
|
width: DEFAULT_WIDTH2,
|
|
2537
2858
|
gap: 8,
|
|
@@ -2574,7 +2895,7 @@ var TRIGGER_RADIUS2 = 60;
|
|
|
2574
2895
|
var MENU_RADIUS3 = 24;
|
|
2575
2896
|
var MENU_MAX_LIST_HEIGHT = 248;
|
|
2576
2897
|
var ITEM_RADIUS2 = 12;
|
|
2577
|
-
var
|
|
2898
|
+
var ICON_SIZE7 = 20;
|
|
2578
2899
|
var CHIP_GAP = 6;
|
|
2579
2900
|
var FALLBACK_ELLIPSIS_WIDTH = 20;
|
|
2580
2901
|
function itemBackground(state) {
|
|
@@ -2647,25 +2968,25 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
2647
2968
|
const next = Math.ceil(event.nativeEvent.layout.width);
|
|
2648
2969
|
setEllipsisWidth((current) => current === next ? current : next);
|
|
2649
2970
|
};
|
|
2650
|
-
return /* @__PURE__ */ jsxs(View, { style:
|
|
2651
|
-
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style:
|
|
2971
|
+
return /* @__PURE__ */ jsxs(View, { style: styles12.multiValueRoot, children: [
|
|
2972
|
+
/* @__PURE__ */ jsxs(View, { pointerEvents: "none", style: styles12.measureRow, children: [
|
|
2652
2973
|
options.map((option) => /* @__PURE__ */ jsxs(
|
|
2653
2974
|
View,
|
|
2654
2975
|
{
|
|
2655
|
-
style:
|
|
2976
|
+
style: styles12.chip,
|
|
2656
2977
|
onLayout: (event) => handleChipLayout(option.value, event),
|
|
2657
2978
|
children: [
|
|
2658
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2659
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2979
|
+
/* @__PURE__ */ jsx(Text, { style: styles12.chipLabel, numberOfLines: 1, children: option.label }),
|
|
2980
|
+
/* @__PURE__ */ jsx(Text, { style: styles12.chipRemove, children: "\xD7" })
|
|
2660
2981
|
]
|
|
2661
2982
|
},
|
|
2662
2983
|
`measure-${option.value}`
|
|
2663
2984
|
)),
|
|
2664
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
2985
|
+
/* @__PURE__ */ jsx(View, { style: styles12.ellipsis, onLayout: handleEllipsisLayout, children: /* @__PURE__ */ jsx(Text, { style: styles12.ellipsisText, children: "..." }) })
|
|
2665
2986
|
] }),
|
|
2666
|
-
/* @__PURE__ */ jsxs(View, { style:
|
|
2667
|
-
visible.map((option) => /* @__PURE__ */ jsxs(View, { style:
|
|
2668
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
2987
|
+
/* @__PURE__ */ jsxs(View, { style: styles12.chipsRow, onLayout: handleContainerLayout, children: [
|
|
2988
|
+
visible.map((option) => /* @__PURE__ */ jsxs(View, { style: styles12.chip, children: [
|
|
2989
|
+
/* @__PURE__ */ jsx(Text, { style: styles12.chipLabel, numberOfLines: 1, children: option.label }),
|
|
2669
2990
|
/* @__PURE__ */ jsx(
|
|
2670
2991
|
Pressable,
|
|
2671
2992
|
{
|
|
@@ -2677,11 +2998,11 @@ function MultiValueChips({ options, disabled, onRemove }) {
|
|
|
2677
2998
|
hitSlop: 6,
|
|
2678
2999
|
accessibilityRole: "button",
|
|
2679
3000
|
accessibilityLabel: `Remove ${option.label}`,
|
|
2680
|
-
children: /* @__PURE__ */ jsx(Text, { style:
|
|
3001
|
+
children: /* @__PURE__ */ jsx(Text, { style: styles12.chipRemove, children: "\xD7" })
|
|
2681
3002
|
}
|
|
2682
3003
|
)
|
|
2683
3004
|
] }, option.value)),
|
|
2684
|
-
hasOverflow ? /* @__PURE__ */ jsx(View, { style:
|
|
3005
|
+
hasOverflow ? /* @__PURE__ */ jsx(View, { style: styles12.ellipsis, children: /* @__PURE__ */ jsx(Text, { style: styles12.ellipsisText, children: "..." }) }) : null
|
|
2685
3006
|
] })
|
|
2686
3007
|
] });
|
|
2687
3008
|
}
|
|
@@ -2892,7 +3213,7 @@ var Select = forwardRef(
|
|
|
2892
3213
|
const leftIconNode = leftIcon ?? /* @__PURE__ */ jsx(
|
|
2893
3214
|
UserIcon,
|
|
2894
3215
|
{
|
|
2895
|
-
size:
|
|
3216
|
+
size: ICON_SIZE7,
|
|
2896
3217
|
color: error ? colors.red : isOpen ? colors.primary : colors.grey100
|
|
2897
3218
|
}
|
|
2898
3219
|
);
|
|
@@ -2908,11 +3229,11 @@ var Select = forwardRef(
|
|
|
2908
3229
|
{
|
|
2909
3230
|
...rest,
|
|
2910
3231
|
ref: setRootRef,
|
|
2911
|
-
style: [
|
|
3232
|
+
style: [styles12.root, isOpen && styles12.rootOpen, disabled && styles12.disabled, style],
|
|
2912
3233
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2913
3234
|
children: [
|
|
2914
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
2915
|
-
/* @__PURE__ */ jsxs(View, { style: [
|
|
3235
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles12.label, { color: labelColor }], children: label }) : null,
|
|
3236
|
+
/* @__PURE__ */ jsxs(View, { style: [styles12.triggerWrap, isOpen && styles12.triggerWrapOpen], children: [
|
|
2916
3237
|
/* @__PURE__ */ jsxs(
|
|
2917
3238
|
Pressable,
|
|
2918
3239
|
{
|
|
@@ -2923,29 +3244,29 @@ var Select = forwardRef(
|
|
|
2923
3244
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
2924
3245
|
accessibilityState: { disabled, expanded: isOpen },
|
|
2925
3246
|
style: [
|
|
2926
|
-
|
|
3247
|
+
styles12.trigger,
|
|
2927
3248
|
{
|
|
2928
3249
|
borderColor: triggerBorderColor,
|
|
2929
3250
|
backgroundColor: colors.grey700
|
|
2930
3251
|
}
|
|
2931
3252
|
],
|
|
2932
3253
|
children: [
|
|
2933
|
-
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style:
|
|
2934
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3254
|
+
hasLeftIcon ? /* @__PURE__ */ jsx(View, { style: styles12.iconSlot, children: leftIconNode }) : null,
|
|
3255
|
+
/* @__PURE__ */ jsx(View, { style: styles12.triggerContent, children: multiple && hasValue ? /* @__PURE__ */ jsx(
|
|
2935
3256
|
MultiValueChips,
|
|
2936
3257
|
{
|
|
2937
3258
|
options: selectedOptions,
|
|
2938
3259
|
disabled,
|
|
2939
3260
|
onRemove: handleRemoveChip
|
|
2940
3261
|
}
|
|
2941
|
-
) : /* @__PURE__ */ jsx(Text, { style: [
|
|
2942
|
-
/* @__PURE__ */ jsx(View, { style: [
|
|
3262
|
+
) : /* @__PURE__ */ jsx(Text, { style: [styles12.triggerText, { color: triggerTextColor }], numberOfLines: 1, children: multiple ? placeholder : singleLabel }) }),
|
|
3263
|
+
/* @__PURE__ */ jsx(View, { style: [styles12.iconSlot, isOpen && styles12.chevronOpen], children: /* @__PURE__ */ jsx(ChevronDownIcon, { size: ICON_SIZE7, color: isOpen ? colors.primary : colors.grey100 }) })
|
|
2943
3264
|
]
|
|
2944
3265
|
}
|
|
2945
3266
|
),
|
|
2946
|
-
isOpen ? /* @__PURE__ */ jsxs(View, { style:
|
|
2947
|
-
showSearch ? /* @__PURE__ */ jsxs(View, { style:
|
|
2948
|
-
/* @__PURE__ */ jsx(View, { style:
|
|
3267
|
+
isOpen ? /* @__PURE__ */ jsxs(View, { style: styles12.menu, children: [
|
|
3268
|
+
showSearch ? /* @__PURE__ */ jsxs(View, { style: styles12.searchField, children: [
|
|
3269
|
+
/* @__PURE__ */ jsx(View, { style: styles12.iconSlot, children: /* @__PURE__ */ jsx(SearchIcon, { size: ICON_SIZE7, color: colors.grey100 }) }),
|
|
2949
3270
|
/* @__PURE__ */ jsx(
|
|
2950
3271
|
TextInput,
|
|
2951
3272
|
{
|
|
@@ -2956,9 +3277,9 @@ var Select = forwardRef(
|
|
|
2956
3277
|
placeholder: searchPlaceholder,
|
|
2957
3278
|
placeholderTextColor: colors.grey100,
|
|
2958
3279
|
style: [
|
|
2959
|
-
|
|
2960
|
-
Platform.OS === "web" ?
|
|
2961
|
-
Platform.OS === "android" ?
|
|
3280
|
+
styles12.searchInput,
|
|
3281
|
+
Platform.OS === "web" ? styles12.searchInputWeb : null,
|
|
3282
|
+
Platform.OS === "android" ? styles12.searchInputAndroid : null
|
|
2962
3283
|
],
|
|
2963
3284
|
accessibilityLabel: searchPlaceholder
|
|
2964
3285
|
}
|
|
@@ -2967,12 +3288,12 @@ var Select = forwardRef(
|
|
|
2967
3288
|
/* @__PURE__ */ jsxs(
|
|
2968
3289
|
ScrollView,
|
|
2969
3290
|
{
|
|
2970
|
-
style:
|
|
2971
|
-
contentContainerStyle:
|
|
3291
|
+
style: styles12.optionList,
|
|
3292
|
+
contentContainerStyle: styles12.optionListContent,
|
|
2972
3293
|
keyboardShouldPersistTaps: "handled",
|
|
2973
3294
|
showsVerticalScrollIndicator: false,
|
|
2974
3295
|
children: [
|
|
2975
|
-
loading ? /* @__PURE__ */ jsx(View, { style:
|
|
3296
|
+
loading ? /* @__PURE__ */ jsx(View, { style: styles12.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles12.statusText, children: "Loading..." }) }) : filteredOptions.length === 0 ? /* @__PURE__ */ jsx(View, { style: styles12.statusRow, children: /* @__PURE__ */ jsx(Text, { style: styles12.statusText, children: emptyText }) }) : null,
|
|
2976
3297
|
!loading && filteredOptions.map((option) => {
|
|
2977
3298
|
const isSelected = selectedValues.includes(option.value);
|
|
2978
3299
|
const isHovered = hoveredValue === option.value;
|
|
@@ -2989,14 +3310,14 @@ var Select = forwardRef(
|
|
|
2989
3310
|
accessibilityRole: multiple ? "checkbox" : "button",
|
|
2990
3311
|
accessibilityState: { selected: isSelected, checked: isSelected, disabled },
|
|
2991
3312
|
style: [
|
|
2992
|
-
|
|
3313
|
+
styles12.item,
|
|
2993
3314
|
{
|
|
2994
3315
|
backgroundColor: itemBackground(visualState)
|
|
2995
3316
|
}
|
|
2996
3317
|
],
|
|
2997
3318
|
children: [
|
|
2998
|
-
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style:
|
|
2999
|
-
/* @__PURE__ */ jsx(Text, { style:
|
|
3319
|
+
multiple ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles12.itemCheckbox, children: /* @__PURE__ */ jsx(Checkbox, { value: isSelected, variant: "light" }) }) : null,
|
|
3320
|
+
/* @__PURE__ */ jsx(Text, { style: styles12.itemLabel, numberOfLines: 1, children: option.label })
|
|
3000
3321
|
]
|
|
3001
3322
|
},
|
|
3002
3323
|
option.value
|
|
@@ -3007,13 +3328,13 @@ var Select = forwardRef(
|
|
|
3007
3328
|
)
|
|
3008
3329
|
] }) : null
|
|
3009
3330
|
] }),
|
|
3010
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3331
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles12.hint, { color: hintColor }], children: hint }) : null
|
|
3011
3332
|
]
|
|
3012
3333
|
}
|
|
3013
3334
|
);
|
|
3014
3335
|
}
|
|
3015
3336
|
);
|
|
3016
|
-
var
|
|
3337
|
+
var styles12 = StyleSheet.create({
|
|
3017
3338
|
root: {
|
|
3018
3339
|
width: DEFAULT_WIDTH3,
|
|
3019
3340
|
gap: 8,
|
|
@@ -3103,8 +3424,8 @@ var styles11 = StyleSheet.create({
|
|
|
3103
3424
|
lineHeight: 16
|
|
3104
3425
|
},
|
|
3105
3426
|
iconSlot: {
|
|
3106
|
-
width:
|
|
3107
|
-
height:
|
|
3427
|
+
width: ICON_SIZE7,
|
|
3428
|
+
height: ICON_SIZE7,
|
|
3108
3429
|
alignItems: "center",
|
|
3109
3430
|
justifyContent: "center",
|
|
3110
3431
|
flexShrink: 0
|
|
@@ -3275,13 +3596,13 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
3275
3596
|
const resolvedAccessibilityLabel = accessibilityLabel ?? (showLabel ? void 0 : label);
|
|
3276
3597
|
useApplyWebClassName(rootRef, className);
|
|
3277
3598
|
useApplyWebClassName(inputRef, inputClassName);
|
|
3278
|
-
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [
|
|
3279
|
-
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3599
|
+
return /* @__PURE__ */ jsxs(View, { ref: rootRef, style: [styles13.root, disabled && styles13.disabled, style], children: [
|
|
3600
|
+
showLabel && label ? /* @__PURE__ */ jsx(Text, { style: [styles13.label, { color: chrome.labelColor }], children: label }) : null,
|
|
3280
3601
|
/* @__PURE__ */ jsx(
|
|
3281
3602
|
View,
|
|
3282
3603
|
{
|
|
3283
3604
|
style: [
|
|
3284
|
-
|
|
3605
|
+
styles13.field,
|
|
3285
3606
|
{
|
|
3286
3607
|
borderColor: chrome.borderColor,
|
|
3287
3608
|
backgroundColor: chrome.backgroundColor
|
|
@@ -3313,11 +3634,11 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
3313
3634
|
onBlur?.(event);
|
|
3314
3635
|
},
|
|
3315
3636
|
style: [
|
|
3316
|
-
|
|
3637
|
+
styles13.input,
|
|
3317
3638
|
textareaTypography.field,
|
|
3318
3639
|
{ color: chrome.textColor },
|
|
3319
|
-
Platform.OS === "web" ?
|
|
3320
|
-
Platform.OS === "android" ?
|
|
3640
|
+
Platform.OS === "web" ? styles13.inputWeb : null,
|
|
3641
|
+
Platform.OS === "android" ? styles13.inputAndroid : null,
|
|
3321
3642
|
inputStyle
|
|
3322
3643
|
],
|
|
3323
3644
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
@@ -3326,10 +3647,10 @@ var Textarea = forwardRef(function Textarea2({
|
|
|
3326
3647
|
)
|
|
3327
3648
|
}
|
|
3328
3649
|
),
|
|
3329
|
-
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3650
|
+
showHint && hint ? /* @__PURE__ */ jsx(Text, { style: [styles13.hint, { color: chrome.hintColor }], children: hint }) : null
|
|
3330
3651
|
] });
|
|
3331
3652
|
});
|
|
3332
|
-
var
|
|
3653
|
+
var styles13 = StyleSheet.create({
|
|
3333
3654
|
root: {
|
|
3334
3655
|
width: DEFAULT_WIDTH4,
|
|
3335
3656
|
gap: 8,
|
|
@@ -3429,13 +3750,13 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
3429
3750
|
accessibilityRole: "switch",
|
|
3430
3751
|
accessibilityLabel: resolvedAccessibilityLabel,
|
|
3431
3752
|
accessibilityState: { checked: isActive, disabled },
|
|
3432
|
-
style: [
|
|
3753
|
+
style: [styles14.pressable, disabled && styles14.disabled, style],
|
|
3433
3754
|
children: [
|
|
3434
3755
|
/* @__PURE__ */ jsx(
|
|
3435
3756
|
Animated.View,
|
|
3436
3757
|
{
|
|
3437
3758
|
style: [
|
|
3438
|
-
|
|
3759
|
+
styles14.track,
|
|
3439
3760
|
{
|
|
3440
3761
|
backgroundColor: trackBackgroundColor
|
|
3441
3762
|
}
|
|
@@ -3444,7 +3765,7 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
3444
3765
|
Animated.View,
|
|
3445
3766
|
{
|
|
3446
3767
|
style: [
|
|
3447
|
-
|
|
3768
|
+
styles14.thumb,
|
|
3448
3769
|
{
|
|
3449
3770
|
transform: [{ translateX: thumbTranslateX }]
|
|
3450
3771
|
}
|
|
@@ -3453,12 +3774,12 @@ var Toggle = forwardRef(function Toggle2({
|
|
|
3453
3774
|
)
|
|
3454
3775
|
}
|
|
3455
3776
|
),
|
|
3456
|
-
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [
|
|
3777
|
+
labelContent != null && labelContent !== false ? typeof labelContent === "string" || typeof labelContent === "number" ? /* @__PURE__ */ jsx(Text, { style: [styles14.label, labelStyle], children: labelContent }) : labelContent : null
|
|
3457
3778
|
]
|
|
3458
3779
|
}
|
|
3459
3780
|
);
|
|
3460
3781
|
});
|
|
3461
|
-
var
|
|
3782
|
+
var styles14 = StyleSheet.create({
|
|
3462
3783
|
pressable: {
|
|
3463
3784
|
flexDirection: "row",
|
|
3464
3785
|
alignItems: "center",
|
|
@@ -3486,7 +3807,273 @@ var styles13 = StyleSheet.create({
|
|
|
3486
3807
|
color: colors.white
|
|
3487
3808
|
}
|
|
3488
3809
|
});
|
|
3810
|
+
var STAR_COUNT = 5;
|
|
3811
|
+
var BASE_ITEM_SIZE = 16;
|
|
3812
|
+
var ICON_WIDTH_RATIO = 12.57 / BASE_ITEM_SIZE;
|
|
3813
|
+
var ICON_HEIGHT_RATIO = 11.98 / BASE_ITEM_SIZE;
|
|
3814
|
+
var STAR_GAP_RATIO = 2 / BASE_ITEM_SIZE;
|
|
3815
|
+
function clamp2(value) {
|
|
3816
|
+
return Math.max(0, Math.min(value, STAR_COUNT));
|
|
3817
|
+
}
|
|
3818
|
+
var RatingInput = forwardRef(
|
|
3819
|
+
function RatingInput2({
|
|
3820
|
+
value,
|
|
3821
|
+
defaultValue = 0,
|
|
3822
|
+
onValueChange,
|
|
3823
|
+
showValue = true,
|
|
3824
|
+
precision = 1,
|
|
3825
|
+
size = 20,
|
|
3826
|
+
starGap,
|
|
3827
|
+
readOnly = false,
|
|
3828
|
+
disabled = false,
|
|
3829
|
+
style,
|
|
3830
|
+
valueStyle,
|
|
3831
|
+
className,
|
|
3832
|
+
hitSlop = 6,
|
|
3833
|
+
accessibilityLabel,
|
|
3834
|
+
...rest
|
|
3835
|
+
}, forwardedRef) {
|
|
3836
|
+
const containerRef = useRef(null);
|
|
3837
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
3838
|
+
const isControlled = value !== void 0;
|
|
3839
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(() => clamp2(defaultValue));
|
|
3840
|
+
const selectedValue = clamp2(isControlled ? value : uncontrolledValue);
|
|
3841
|
+
const selectedStarCount = Math.round(selectedValue);
|
|
3842
|
+
const iconWidth = size * ICON_WIDTH_RATIO;
|
|
3843
|
+
const iconHeight = size * ICON_HEIGHT_RATIO;
|
|
3844
|
+
const resolvedStarGap = starGap ?? size * STAR_GAP_RATIO;
|
|
3845
|
+
const resolvedAccessibilityLabel = accessibilityLabel ?? (readOnly ? `${selectedValue} out of ${STAR_COUNT} stars` : "Rating");
|
|
3846
|
+
useApplyWebClassName(containerRef, className);
|
|
3847
|
+
const selectValue = (nextValue) => {
|
|
3848
|
+
if (disabled || nextValue === selectedValue) return;
|
|
3849
|
+
if (!isControlled) setUncontrolledValue(nextValue);
|
|
3850
|
+
onValueChange?.(nextValue);
|
|
3851
|
+
};
|
|
3852
|
+
return /* @__PURE__ */ jsxs(
|
|
3853
|
+
View,
|
|
3854
|
+
{
|
|
3855
|
+
...rest,
|
|
3856
|
+
ref: setContainerRef,
|
|
3857
|
+
style: [styles15.root, disabled && styles15.disabled, style],
|
|
3858
|
+
children: [
|
|
3859
|
+
showValue ? /* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles15.value, valueStyle], children: selectedValue.toFixed(precision) }) : null,
|
|
3860
|
+
/* @__PURE__ */ jsx(
|
|
3861
|
+
View,
|
|
3862
|
+
{
|
|
3863
|
+
accessibilityRole: readOnly ? "image" : "radiogroup",
|
|
3864
|
+
accessibilityLabel: resolvedAccessibilityLabel,
|
|
3865
|
+
accessibilityState: { disabled },
|
|
3866
|
+
style: [styles15.stars, { gap: resolvedStarGap }],
|
|
3867
|
+
children: Array.from({ length: STAR_COUNT }, (_, index) => {
|
|
3868
|
+
const starValue = index + 1;
|
|
3869
|
+
const isSelected = starValue <= selectedStarCount;
|
|
3870
|
+
const icon = isSelected ? /* @__PURE__ */ jsx(StarFilledIcon, { size: iconWidth, height: iconHeight }) : /* @__PURE__ */ jsx(StarIcon, { size: iconWidth, height: iconHeight });
|
|
3871
|
+
const itemStyle = [styles15.starItem, { width: size, height: size }];
|
|
3872
|
+
if (readOnly) {
|
|
3873
|
+
return /* @__PURE__ */ jsx(View, { style: itemStyle, children: icon }, starValue);
|
|
3874
|
+
}
|
|
3875
|
+
return /* @__PURE__ */ jsx(
|
|
3876
|
+
Pressable,
|
|
3877
|
+
{
|
|
3878
|
+
disabled,
|
|
3879
|
+
hitSlop,
|
|
3880
|
+
onPress: () => selectValue(starValue),
|
|
3881
|
+
accessibilityRole: "radio",
|
|
3882
|
+
accessibilityLabel: `${starValue} star${starValue === 1 ? "" : "s"}`,
|
|
3883
|
+
accessibilityState: { checked: isSelected, disabled },
|
|
3884
|
+
style: itemStyle,
|
|
3885
|
+
children: icon
|
|
3886
|
+
},
|
|
3887
|
+
starValue
|
|
3888
|
+
);
|
|
3889
|
+
})
|
|
3890
|
+
}
|
|
3891
|
+
)
|
|
3892
|
+
]
|
|
3893
|
+
}
|
|
3894
|
+
);
|
|
3895
|
+
}
|
|
3896
|
+
);
|
|
3897
|
+
var styles15 = StyleSheet.create({
|
|
3898
|
+
root: {
|
|
3899
|
+
flexDirection: "row",
|
|
3900
|
+
alignItems: "center",
|
|
3901
|
+
flexWrap: "nowrap",
|
|
3902
|
+
alignSelf: "flex-start",
|
|
3903
|
+
gap: 16
|
|
3904
|
+
},
|
|
3905
|
+
stars: {
|
|
3906
|
+
flexDirection: "row",
|
|
3907
|
+
alignItems: "center"
|
|
3908
|
+
},
|
|
3909
|
+
starItem: {
|
|
3910
|
+
alignItems: "center",
|
|
3911
|
+
justifyContent: "center"
|
|
3912
|
+
},
|
|
3913
|
+
value: {
|
|
3914
|
+
...ratingTypography,
|
|
3915
|
+
color: colors.white
|
|
3916
|
+
},
|
|
3917
|
+
disabled: {
|
|
3918
|
+
opacity: 0.5
|
|
3919
|
+
}
|
|
3920
|
+
});
|
|
3921
|
+
var CARD_WIDTH = 370;
|
|
3922
|
+
var CARD_MIN_HEIGHT = 173;
|
|
3923
|
+
var AVATAR_SIZE = 44;
|
|
3924
|
+
var CommentCard = forwardRef(
|
|
3925
|
+
function CommentCard2({
|
|
3926
|
+
userName,
|
|
3927
|
+
date,
|
|
3928
|
+
commentText,
|
|
3929
|
+
rating,
|
|
3930
|
+
imageUrl,
|
|
3931
|
+
maxCommentLines = 3,
|
|
3932
|
+
maxCommentLength = 111,
|
|
3933
|
+
readMoreLabel = "\u0534\u056B\u057F\u0565\u056C \u0561\u057E\u0565\u056C\u056B\u0576",
|
|
3934
|
+
readLessLabel = "\u0553\u0561\u056F\u0565\u056C",
|
|
3935
|
+
onExpandedChange,
|
|
3936
|
+
style,
|
|
3937
|
+
commentStyle,
|
|
3938
|
+
className,
|
|
3939
|
+
...rest
|
|
3940
|
+
}, forwardedRef) {
|
|
3941
|
+
const containerRef = useRef(null);
|
|
3942
|
+
const setContainerRef = useMemo(() => mergeRefs(containerRef, forwardedRef), [forwardedRef]);
|
|
3943
|
+
const [imageFailed, setImageFailed] = useState(false);
|
|
3944
|
+
const [expanded, setExpanded] = useState(false);
|
|
3945
|
+
const [actionHovered, setActionHovered] = useState(false);
|
|
3946
|
+
const hasImage = Boolean(imageUrl) && !imageFailed;
|
|
3947
|
+
const shouldShowAction = Array.from(commentText).length >= maxCommentLength;
|
|
3948
|
+
useApplyWebClassName(containerRef, className);
|
|
3949
|
+
useEffect(() => {
|
|
3950
|
+
setImageFailed(false);
|
|
3951
|
+
}, [imageUrl]);
|
|
3952
|
+
useEffect(() => {
|
|
3953
|
+
setExpanded(false);
|
|
3954
|
+
setActionHovered(false);
|
|
3955
|
+
}, [commentText, maxCommentLength, maxCommentLines]);
|
|
3956
|
+
const toggleExpanded = () => {
|
|
3957
|
+
const next = !expanded;
|
|
3958
|
+
setExpanded(next);
|
|
3959
|
+
onExpandedChange?.(next);
|
|
3960
|
+
};
|
|
3961
|
+
return /* @__PURE__ */ jsxs(View, { ...rest, ref: setContainerRef, style: [styles16.root, style], children: [
|
|
3962
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.header, children: [
|
|
3963
|
+
/* @__PURE__ */ jsx(View, { style: styles16.avatar, children: hasImage ? /* @__PURE__ */ jsx(
|
|
3964
|
+
Image,
|
|
3965
|
+
{
|
|
3966
|
+
source: { uri: imageUrl ?? void 0 },
|
|
3967
|
+
style: styles16.avatarImage,
|
|
3968
|
+
onError: () => setImageFailed(true)
|
|
3969
|
+
}
|
|
3970
|
+
) : /* @__PURE__ */ jsx(UserIcon, { size: 20, color: colors.primary }) }),
|
|
3971
|
+
/* @__PURE__ */ jsxs(View, { style: styles16.identity, children: [
|
|
3972
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles16.name, children: userName }),
|
|
3973
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles16.date, children: date })
|
|
3974
|
+
] }),
|
|
3975
|
+
/* @__PURE__ */ jsx(RatingInput, { value: rating, readOnly: true, showValue: false, size: 16 })
|
|
3976
|
+
] }),
|
|
3977
|
+
/* @__PURE__ */ jsx(
|
|
3978
|
+
Text,
|
|
3979
|
+
{
|
|
3980
|
+
numberOfLines: expanded ? void 0 : maxCommentLines,
|
|
3981
|
+
style: [styles16.comment, commentStyle],
|
|
3982
|
+
children: commentText
|
|
3983
|
+
}
|
|
3984
|
+
),
|
|
3985
|
+
shouldShowAction ? /* @__PURE__ */ jsx(
|
|
3986
|
+
Pressable,
|
|
3987
|
+
{
|
|
3988
|
+
onPress: toggleExpanded,
|
|
3989
|
+
accessibilityRole: "button",
|
|
3990
|
+
accessibilityState: { expanded },
|
|
3991
|
+
hitSlop: 6,
|
|
3992
|
+
onHoverIn: () => setActionHovered(true),
|
|
3993
|
+
onHoverOut: () => setActionHovered(false),
|
|
3994
|
+
style: styles16.action,
|
|
3995
|
+
children: /* @__PURE__ */ jsx(
|
|
3996
|
+
Text,
|
|
3997
|
+
{
|
|
3998
|
+
style: [
|
|
3999
|
+
styles16.actionText,
|
|
4000
|
+
expanded && styles16.closeActionText,
|
|
4001
|
+
actionHovered && (expanded ? styles16.closeActionTextHovered : styles16.openActionTextHovered)
|
|
4002
|
+
],
|
|
4003
|
+
children: expanded ? readLessLabel : readMoreLabel
|
|
4004
|
+
}
|
|
4005
|
+
)
|
|
4006
|
+
}
|
|
4007
|
+
) : null
|
|
4008
|
+
] });
|
|
4009
|
+
}
|
|
4010
|
+
);
|
|
4011
|
+
var styles16 = StyleSheet.create({
|
|
4012
|
+
root: {
|
|
4013
|
+
width: CARD_WIDTH,
|
|
4014
|
+
minHeight: CARD_MIN_HEIGHT,
|
|
4015
|
+
padding: 16,
|
|
4016
|
+
gap: 12,
|
|
4017
|
+
borderRadius: 12,
|
|
4018
|
+
backgroundColor: colors.grey750
|
|
4019
|
+
},
|
|
4020
|
+
header: {
|
|
4021
|
+
flexDirection: "row",
|
|
4022
|
+
alignItems: "center",
|
|
4023
|
+
gap: 8
|
|
4024
|
+
},
|
|
4025
|
+
avatar: {
|
|
4026
|
+
width: AVATAR_SIZE,
|
|
4027
|
+
height: AVATAR_SIZE,
|
|
4028
|
+
flexShrink: 0,
|
|
4029
|
+
alignItems: "center",
|
|
4030
|
+
justifyContent: "center",
|
|
4031
|
+
overflow: "hidden",
|
|
4032
|
+
borderRadius: AVATAR_SIZE / 2,
|
|
4033
|
+
backgroundColor: colors.grey600
|
|
4034
|
+
},
|
|
4035
|
+
avatarImage: {
|
|
4036
|
+
width: AVATAR_SIZE,
|
|
4037
|
+
height: AVATAR_SIZE
|
|
4038
|
+
},
|
|
4039
|
+
identity: {
|
|
4040
|
+
minWidth: 0,
|
|
4041
|
+
flex: 1,
|
|
4042
|
+
gap: 4
|
|
4043
|
+
},
|
|
4044
|
+
name: {
|
|
4045
|
+
...commentCardTypography.name,
|
|
4046
|
+
color: colors.white
|
|
4047
|
+
},
|
|
4048
|
+
date: {
|
|
4049
|
+
...commentCardTypography.date,
|
|
4050
|
+
color: colors.grey0
|
|
4051
|
+
},
|
|
4052
|
+
comment: {
|
|
4053
|
+
...commentCardTypography.comment,
|
|
4054
|
+
color: colors.white
|
|
4055
|
+
},
|
|
4056
|
+
action: {
|
|
4057
|
+
alignSelf: "flex-start",
|
|
4058
|
+
marginTop: "auto",
|
|
4059
|
+
minHeight: 16,
|
|
4060
|
+
justifyContent: "center"
|
|
4061
|
+
},
|
|
4062
|
+
actionText: {
|
|
4063
|
+
...commentCardTypography.action,
|
|
4064
|
+
color: colors.white
|
|
4065
|
+
},
|
|
4066
|
+
closeActionText: {
|
|
4067
|
+
color: colors.primary
|
|
4068
|
+
},
|
|
4069
|
+
openActionTextHovered: {
|
|
4070
|
+
color: colors.primary
|
|
4071
|
+
},
|
|
4072
|
+
closeActionTextHovered: {
|
|
4073
|
+
color: colors.white
|
|
4074
|
+
}
|
|
4075
|
+
});
|
|
3489
4076
|
|
|
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 };
|
|
4077
|
+
export { ArrowRightIcon, Avatar, Badge, BagIcon, BellIcon, BuildingIcon, Button, CalendarIcon, CalendarOutlineIcon, CameraIcon, CheckBadgeIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronLeftIcon, ClockIcon, CommentCard, Counter, DatePicker, FacebookIcon, GlobeIcon, HeartIcon, HelpCircleIcon, HomeIcon, Icon, Input, InstagramIcon, KeyIcon, LanguageSwitcher, LayoutGridIcon, LinkedInIcon, LogOutIcon, MailIcon, MenuItem, MinusIcon, NavigateIcon, PhoneIcon, PlusIcon, RatingInput, SearchIcon, SegmentedToggle, Select, SettingsIcon, ShowIcon, SidebarIcon, StarFilledIcon, StarIcon, StatCard, Textarea, Toggle, UserIcon, UsersAltIcon, VideoIcon, avatarTypography, badgeTypography, buttonTypography, colors, commentCardTypography, counterTypography, datePickerTypography, defaultLanguageOptions, fonts, getIconsByGroup, grey, iconGroupNames, iconGroups, iconNames, icons, inputTypography, languageSwitcherTypography, ratingTypography, segmentedToggleTypography, selectTypography, statCardTypography, textareaTypography };
|
|
3491
4078
|
//# sourceMappingURL=index.js.map
|
|
3492
4079
|
//# sourceMappingURL=index.js.map
|