@artsy/palette-mobile 13.2.33 → 13.2.35
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/Theme.js +9 -13
- package/dist/animation/CssTransition.js +8 -12
- package/dist/animation/index.js +1 -17
- package/dist/constants.js +4 -8
- package/dist/elements/ArtsyKeyboardAvoidingView/ArtsyKeyboardAvoidingView.js +19 -23
- package/dist/elements/ArtsyKeyboardAvoidingView/index.js +1 -17
- package/dist/elements/Autocomplete/Autocomplete.js +4 -8
- package/dist/elements/Autocomplete/Autocomplete.tests.js +9 -11
- package/dist/elements/Autocomplete/index.js +1 -17
- package/dist/elements/Avatar/Avatar.js +17 -44
- package/dist/elements/Avatar/Avatar.stories.js +7 -11
- package/dist/elements/Avatar/Avatar.tests.js +8 -10
- package/dist/elements/Avatar/index.js +1 -17
- package/dist/elements/BackButton/BackButton.js +9 -14
- package/dist/elements/BackButton/BackButton.stories.js +8 -12
- package/dist/elements/BackButton/index.js +1 -17
- package/dist/elements/Banner/Banner.js +14 -18
- package/dist/elements/Banner/Banner.stories.js +7 -11
- package/dist/elements/Banner/index.js +1 -17
- package/dist/elements/BorderBox/BorderBox.js +9 -15
- package/dist/elements/BorderBox/index.js +1 -17
- package/dist/elements/Box/Box.js +11 -17
- package/dist/elements/Box/Box.stories.js +14 -20
- package/dist/elements/Box/index.js +1 -17
- package/dist/elements/Button/Button.js +30 -37
- package/dist/elements/Button/Button.stories.js +18 -25
- package/dist/elements/Button/CTAButton.js +3 -7
- package/dist/elements/Button/FollowButton.js +7 -11
- package/dist/elements/Button/LinkButton.js +4 -8
- package/dist/elements/Button/colors.js +3 -7
- package/dist/elements/Button/index.js +4 -20
- package/dist/elements/ButtonNew/Button.js +32 -62
- package/dist/elements/ButtonNew/Button.stories.js +36 -50
- package/dist/elements/ButtonNew/Button.tests.js +13 -15
- package/dist/elements/ButtonNew/CTAButton.js +3 -7
- package/dist/elements/ButtonNew/FollowButton.js +7 -11
- package/dist/elements/ButtonNew/LinkButton.js +4 -8
- package/dist/elements/ButtonNew/colors.js +3 -7
- package/dist/elements/ButtonNew/index.js +4 -20
- package/dist/elements/Checkbox/Check.js +29 -56
- package/dist/elements/Checkbox/Checkbox.js +22 -30
- package/dist/elements/Checkbox/Checkbox.stories.js +8 -12
- package/dist/elements/Checkbox/index.js +2 -18
- package/dist/elements/ClassTheme/ClassTheme.js +5 -9
- package/dist/elements/ClassTheme/index.js +1 -17
- package/dist/elements/Collapse/Collapse.js +4 -8
- package/dist/elements/Collapse/Collapse.stories.js +9 -13
- package/dist/elements/Collapse/index.js +1 -17
- package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.js +18 -21
- package/dist/elements/CollapsibleMenuItem/CollapsibleMenuItem.stories.js +30 -38
- package/dist/elements/CollapsibleMenuItem/index.js +1 -17
- package/dist/elements/Dialog/Dialog.js +20 -24
- package/dist/elements/Dialog/Dialog.stories.js +14 -16
- package/dist/elements/Dialog/Dialog.tests.js +12 -14
- package/dist/elements/Dialog/index.js +1 -17
- package/dist/elements/EntityHeader/EntityHeader.js +14 -18
- package/dist/elements/EntityHeader/EntityHeader.stories.js +17 -25
- package/dist/elements/EntityHeader/index.js +1 -17
- package/dist/elements/Flex/Flex.js +4 -7
- package/dist/elements/Flex/index.js +1 -17
- package/dist/elements/Header/ArtsyLogoHeader.js +8 -12
- package/dist/elements/Header/index.js +1 -17
- package/dist/elements/Histogram/Histogram.js +6 -10
- package/dist/elements/Histogram/index.js +1 -17
- package/dist/elements/Image/Image.js +26 -55
- package/dist/elements/Image/Image.stories.js +14 -16
- package/dist/elements/Image/index.js +1 -17
- package/dist/elements/Input/Input.js +127 -157
- package/dist/elements/Input/Input.stories.js +9 -11
- package/dist/elements/Input/Input.tests.js +17 -19
- package/dist/elements/Input/InputTitle.js +4 -8
- package/dist/elements/Input/helpers.d.ts +1 -1
- package/dist/elements/Input/helpers.js +51 -56
- package/dist/elements/Input/index.js +3 -19
- package/dist/elements/Input/maskValue.js +5 -10
- package/dist/elements/Input/maskValue.tests.js +11 -13
- package/dist/elements/Join/Join.js +6 -10
- package/dist/elements/Join/index.js +1 -17
- package/dist/elements/LazyFlatlist/LazyFlatlist.js +3 -7
- package/dist/elements/LazyFlatlist/index.js +2 -18
- package/dist/elements/LazyFlatlist/useHasSeenItem.js +6 -10
- package/dist/elements/LegacyScreen/LegacyScreen.js +51 -59
- package/dist/elements/LegacyScreen/index.js +1 -17
- package/dist/elements/LegacyTabs/ContentTabs.js +8 -12
- package/dist/elements/LegacyTabs/NavigationalTabs.js +11 -15
- package/dist/elements/LegacyTabs/StepTabs.js +15 -19
- package/dist/elements/LegacyTabs/Tab.js +9 -13
- package/dist/elements/LegacyTabs/TabBarContainer.js +28 -34
- package/dist/elements/LegacyTabs/index.js +9 -15
- package/dist/elements/List/BulletedItem.js +7 -11
- package/dist/elements/List/List.stories.js +8 -10
- package/dist/elements/List/index.js +1 -17
- package/dist/elements/MeasuredView/MeasuredView.js +10 -15
- package/dist/elements/MeasuredView/index.js +1 -17
- package/dist/elements/MenuItem/MenuItem.js +9 -13
- package/dist/elements/MenuItem/MenuItem.stories.js +5 -9
- package/dist/elements/MenuItem/index.js +1 -17
- package/dist/elements/Message/Message.js +15 -19
- package/dist/elements/Message/Message.stories.js +10 -12
- package/dist/elements/Message/Message.tests.js +9 -11
- package/dist/elements/Message/index.js +1 -17
- package/dist/elements/Pill/Pill.js +53 -83
- package/dist/elements/Pill/Pill.stories.js +16 -18
- package/dist/elements/Pill/Pill.tests.js +8 -10
- package/dist/elements/Pill/index.js +1 -17
- package/dist/elements/PopIn/PopIn.js +8 -12
- package/dist/elements/PopIn/index.js +1 -17
- package/dist/elements/Popover/Popover.js +21 -28
- package/dist/elements/Popover/Popover.stories.js +15 -17
- package/dist/elements/Popover/index.js +1 -17
- package/dist/elements/ProgressBar/ProgressBar.js +16 -43
- package/dist/elements/ProgressBar/ProgressBar.stories.js +6 -8
- package/dist/elements/ProgressBar/ProgressBar.tests.js +7 -9
- package/dist/elements/ProgressBar/index.js +1 -17
- package/dist/elements/Radio/RadioButton.js +20 -28
- package/dist/elements/Radio/RadioButton.stories.js +13 -15
- package/dist/elements/Radio/RadioDot.js +10 -14
- package/dist/elements/Radio/index.js +2 -7
- package/dist/elements/Screen/Background.js +3 -7
- package/dist/elements/Screen/Body.js +9 -13
- package/dist/elements/Screen/BottomView.js +9 -16
- package/dist/elements/Screen/FloatingHeader.js +9 -13
- package/dist/elements/Screen/FullWidthDivider.js +5 -9
- package/dist/elements/Screen/FullWidthItem.js +5 -9
- package/dist/elements/Screen/Header.js +21 -49
- package/dist/elements/Screen/Screen.stories.js +18 -20
- package/dist/elements/Screen/ScreenBase.js +9 -13
- package/dist/elements/Screen/ScreenFlatList.js +8 -15
- package/dist/elements/Screen/ScreenScrollContext.js +9 -14
- package/dist/elements/Screen/ScreenScrollView.js +8 -15
- package/dist/elements/Screen/StickySubHeader.js +20 -47
- package/dist/elements/Screen/constants.js +5 -8
- package/dist/elements/Screen/hooks/useAnimatedHeaderScrolling.js +10 -14
- package/dist/elements/Screen/hooks/useListenForScreenScroll.js +10 -14
- package/dist/elements/Screen/index.js +29 -46
- package/dist/elements/SearchInput/SearchInput.js +6 -10
- package/dist/elements/SearchInput/index.js +1 -17
- package/dist/elements/Separator/Separator.js +9 -15
- package/dist/elements/Separator/Separator.stories.js +6 -10
- package/dist/elements/Separator/ShadowSeparator.js +3 -9
- package/dist/elements/Separator/index.js +2 -18
- package/dist/elements/SimpleMessage/SimpleMessage.js +9 -16
- package/dist/elements/SimpleMessage/index.js +1 -17
- package/dist/elements/Skeleton/Skeleton.js +16 -45
- package/dist/elements/Skeleton/Skeleton.stories.js +10 -14
- package/dist/elements/Skeleton/index.js +1 -17
- package/dist/elements/Spacer/Spacer.js +3 -7
- package/dist/elements/Spacer/Spacer.stories.js +15 -20
- package/dist/elements/Spacer/index.js +1 -17
- package/dist/elements/Spinner/Spinner.js +15 -23
- package/dist/elements/Spinner/index.js +1 -17
- package/dist/elements/Switch/Switch.js +8 -12
- package/dist/elements/Switch/Switch.stories.js +11 -15
- package/dist/elements/Switch/index.js +1 -17
- package/dist/elements/Tabs/SubTabBar.js +11 -15
- package/dist/elements/Tabs/TabFlashList.js +8 -12
- package/dist/elements/Tabs/TabFlatList.js +8 -12
- package/dist/elements/Tabs/TabMasonry.js +8 -12
- package/dist/elements/Tabs/TabScrollView.js +8 -12
- package/dist/elements/Tabs/Tabs.js +24 -27
- package/dist/elements/Tabs/Tabs.stories.js +11 -13
- package/dist/elements/Tabs/TabsContainer.js +15 -19
- package/dist/elements/Tabs/TabsWithHeader.js +8 -12
- package/dist/elements/Tabs/hooks/useListenForTabContentScroll.js +8 -12
- package/dist/elements/Tabs/index.js +1 -17
- package/dist/elements/Text/LinkText.js +3 -7
- package/dist/elements/Text/Text.js +15 -21
- package/dist/elements/Text/Text.stories.js +18 -27
- package/dist/elements/Text/Text.tests.js +3 -5
- package/dist/elements/Text/helpers.js +5 -10
- package/dist/elements/Text/index.js +3 -19
- package/dist/elements/ToolTip/ToolTip.js +29 -34
- package/dist/elements/ToolTip/ToolTip.stories.js +11 -13
- package/dist/elements/ToolTip/ToolTip.tests.js +7 -9
- package/dist/elements/ToolTip/ToolTipFlyout.js +19 -47
- package/dist/elements/ToolTip/index.js +1 -17
- package/dist/elements/Touchable/Touchable.js +12 -19
- package/dist/elements/Touchable/Touchable.stories.js +9 -13
- package/dist/elements/Touchable/TouchableHighlightColor.js +6 -10
- package/dist/elements/Touchable/TouchableWithScale.js +7 -11
- package/dist/elements/Touchable/index.js +3 -19
- package/dist/elements/VisualClue/VisualClue.stories.js +6 -8
- package/dist/elements/VisualClue/VisualClueDot.js +6 -10
- package/dist/elements/VisualClue/VisualClueText.js +9 -13
- package/dist/elements/VisualClue/index.js +2 -18
- package/dist/elements/index.js +45 -61
- package/dist/index.js +10 -26
- package/dist/setupJest.js +2 -7
- package/dist/storybook/decorators.js +20 -28
- package/dist/storybook/helpers.js +6 -12
- package/dist/svgs/AddCircleFillIcon.js +6 -10
- package/dist/svgs/AddCircleIcon.js +6 -10
- package/dist/svgs/AddIcon.js +6 -10
- package/dist/svgs/AlertCircleFillIcon.js +6 -10
- package/dist/svgs/AlertIcon.js +6 -10
- package/dist/svgs/ArrowCircleFillIcons.js +7 -12
- package/dist/svgs/ArrowDownCircleIcon.js +6 -10
- package/dist/svgs/ArrowDownIcon.js +6 -10
- package/dist/svgs/ArrowLeftCircleIcon.js +6 -10
- package/dist/svgs/ArrowLeftIcon.js +6 -10
- package/dist/svgs/ArrowRightCircleIcon.js +6 -10
- package/dist/svgs/ArrowRightIcon.js +6 -10
- package/dist/svgs/ArrowUpCircleIcon.js +6 -10
- package/dist/svgs/ArrowUpIcon.js +6 -10
- package/dist/svgs/ArtsyLogoBlackIcon.js +6 -10
- package/dist/svgs/ArtsyLogoWhiteIcon.js +4 -8
- package/dist/svgs/ArtsyMarkBlackIcon.js +6 -10
- package/dist/svgs/ArtsyMarkWhiteIcon.js +4 -8
- package/dist/svgs/ArtworkIcon.js +6 -10
- package/dist/svgs/AuctionIcon.js +6 -10
- package/dist/svgs/BellFillIcon.js +6 -10
- package/dist/svgs/BellIcon.js +6 -10
- package/dist/svgs/BlueChipIcon.js +6 -10
- package/dist/svgs/BoltCircleFill.js +6 -10
- package/dist/svgs/BoltFill.js +6 -10
- package/dist/svgs/BookmarkFill.js +6 -10
- package/dist/svgs/BriefcaseIcon.js +6 -10
- package/dist/svgs/CertificateIcon.js +6 -10
- package/dist/svgs/CheckCircleFillIcon.js +6 -10
- package/dist/svgs/CheckCircleIcon.js +6 -10
- package/dist/svgs/CheckIcon.js +6 -10
- package/dist/svgs/ChevronIcon.js +11 -15
- package/dist/svgs/ClockFill.js +6 -10
- package/dist/svgs/CloseCircleFillIcon.js +6 -10
- package/dist/svgs/CloseCircleIcon.js +6 -10
- package/dist/svgs/CloseIcon.js +6 -10
- package/dist/svgs/CollapseIcon.js +6 -10
- package/dist/svgs/CreditCardIcon.js +14 -18
- package/dist/svgs/DecreaseIcon.js +6 -10
- package/dist/svgs/DocumentIcon.js +6 -10
- package/dist/svgs/DownloadIcon.js +6 -10
- package/dist/svgs/EditIcon.js +6 -10
- package/dist/svgs/EmptyCheckCircleIcon.js +6 -10
- package/dist/svgs/EnterIcon.js +6 -10
- package/dist/svgs/EnvelopeIcon.js +6 -10
- package/dist/svgs/EstablishedIcon.js +6 -10
- package/dist/svgs/ExclamationMarkCircleFill.js +6 -10
- package/dist/svgs/ExpandIcon.js +6 -10
- package/dist/svgs/EyeClosedIcon.js +6 -10
- package/dist/svgs/EyeOpenedIcon.js +6 -10
- package/dist/svgs/FacebookIcon.js +6 -10
- package/dist/svgs/FairIcon.js +6 -10
- package/dist/svgs/FilterIcon.js +6 -10
- package/dist/svgs/FullWidthIcon.js +6 -10
- package/dist/svgs/GenomeIcon.js +6 -10
- package/dist/svgs/GraphIcon.js +6 -10
- package/dist/svgs/GridIcon.js +6 -10
- package/dist/svgs/GuaranteeIcon.js +7 -11
- package/dist/svgs/HeartFillIcon.js +6 -10
- package/dist/svgs/HeartIcon.js +6 -10
- package/dist/svgs/HideIcon.js +6 -10
- package/dist/svgs/HomeIcon.js +6 -10
- package/dist/svgs/Icon.js +15 -30
- package/dist/svgs/ImageIcon.js +6 -10
- package/dist/svgs/ImageSetIcon.js +6 -10
- package/dist/svgs/IncreaseIcon.js +6 -10
- package/dist/svgs/InfoCircleIcon.js +6 -10
- package/dist/svgs/InstagramAppIcon.js +3 -7
- package/dist/svgs/InstitutionIcon.js +6 -10
- package/dist/svgs/LinkIcon.js +6 -10
- package/dist/svgs/LoaderIcon.js +6 -10
- package/dist/svgs/LockIcon.js +6 -10
- package/dist/svgs/LogoutIcon.js +6 -10
- package/dist/svgs/MagnifyingGlassIcon.js +6 -10
- package/dist/svgs/MapPinIcon.js +6 -10
- package/dist/svgs/MenuIcon.js +6 -10
- package/dist/svgs/MessageIcon.js +7 -11
- package/dist/svgs/MessagesAppIcon.js +4 -8
- package/dist/svgs/MoneyCircleIcon.js +6 -10
- package/dist/svgs/MoneyFillIcon.js +6 -10
- package/dist/svgs/MoreIcon.js +6 -10
- package/dist/svgs/MultiplePersonsIcon.js +6 -10
- package/dist/svgs/NoArtworkIcon.js +6 -10
- package/dist/svgs/NoImageIcon.js +6 -10
- package/dist/svgs/PageIcon.js +6 -10
- package/dist/svgs/Payment2Icon.js +6 -10
- package/dist/svgs/PaymentIcon.js +6 -10
- package/dist/svgs/PersonIcon.js +6 -10
- package/dist/svgs/PublicationIcon.js +6 -10
- package/dist/svgs/QuestionCircleIcon.js +6 -10
- package/dist/svgs/ReloadIcon.js +6 -10
- package/dist/svgs/SecureLockIcon.js +6 -10
- package/dist/svgs/SettingsIcon.js +6 -10
- package/dist/svgs/ShareIcon.js +6 -10
- package/dist/svgs/ShieldFilledIcon.js +6 -10
- package/dist/svgs/ShieldIcon.js +6 -10
- package/dist/svgs/StarCircleFill.js +6 -10
- package/dist/svgs/StarCircleIcon.js +6 -10
- package/dist/svgs/Stopwatch.js +6 -10
- package/dist/svgs/Tag2Icon.js +7 -11
- package/dist/svgs/TagIcon.js +6 -10
- package/dist/svgs/TimerIcon.js +6 -10
- package/dist/svgs/TopEmergingIcon.js +6 -10
- package/dist/svgs/TrashIcon.js +6 -10
- package/dist/svgs/TrendingIcon.js +6 -10
- package/dist/svgs/TriangleDown.js +6 -10
- package/dist/svgs/TwitterIcon.js +6 -10
- package/dist/svgs/UserMultiIcon.js +6 -10
- package/dist/svgs/UserSingleIcon.js +6 -10
- package/dist/svgs/VerifiedIcon.js +6 -10
- package/dist/svgs/VerifiedPersonIcon.js +6 -10
- package/dist/svgs/WhatsAppAppIcon.js +4 -8
- package/dist/svgs/WorldGlobeCircleIcon.js +6 -10
- package/dist/svgs/XCircleIcon.js +6 -10
- package/dist/svgs/icons.stories.js +11 -38
- package/dist/svgs/index.js +113 -129
- package/dist/tokens.js +9 -12
- package/dist/types.js +5 -10
- package/dist/utils/Wrap.js +7 -11
- package/dist/utils/colors.stories.js +16 -20
- package/dist/utils/createGeminiUrl.js +6 -10
- package/dist/utils/flattenChildren.js +5 -9
- package/dist/utils/formatLargeNumber.js +1 -5
- package/dist/utils/formatLargeNumbers.tests.js +8 -10
- package/dist/utils/hooks/index.js +4 -20
- package/dist/utils/hooks/useColor.js +2 -6
- package/dist/utils/hooks/useMeasure.js +4 -8
- package/dist/utils/hooks/useScreenDimensions.js +11 -16
- package/dist/utils/hooks/useSpace.js +2 -6
- package/dist/utils/hooks/useTheme.js +6 -10
- package/dist/utils/normalizeText.js +1 -5
- package/dist/utils/space.stories.js +9 -13
- package/dist/utils/tests/renderWithWrappers.js +7 -12
- package/dist/utils/text.js +9 -13
- package/dist/utils/types.js +1 -2
- package/dist/utils/webTokensToMobile.js +4 -9
- package/package.json +14 -14
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const Banner = ({ text, onClose, dismissable = false, variant = "defaultLight", ...restProps }) => {
|
|
12
|
-
const [tempHeight, setTempHeight] = (0, react_1.useState)(undefined);
|
|
13
|
-
const scaleYAnim = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useState } from "react";
|
|
3
|
+
import { Animated, Easing, TouchableOpacity } from "react-native";
|
|
4
|
+
import { DEFAULT_HIT_SLOP } from "../../constants";
|
|
5
|
+
import { CloseIcon } from "../../svgs";
|
|
6
|
+
import { Flex } from "../Flex";
|
|
7
|
+
import { Text } from "../Text";
|
|
8
|
+
export const Banner = ({ text, onClose, dismissable = false, variant = "defaultLight", ...restProps }) => {
|
|
9
|
+
const [tempHeight, setTempHeight] = useState(undefined);
|
|
10
|
+
const scaleYAnim = useRef(new Animated.Value(0)).current;
|
|
14
11
|
const handleClose = () => {
|
|
15
|
-
|
|
12
|
+
Animated.timing(scaleYAnim, {
|
|
16
13
|
toValue: 1,
|
|
17
14
|
duration: 150,
|
|
18
|
-
easing:
|
|
15
|
+
easing: Easing.linear,
|
|
19
16
|
useNativeDriver: true,
|
|
20
17
|
}).start(() => {
|
|
21
18
|
setTempHeight(0);
|
|
22
19
|
});
|
|
23
20
|
onClose?.();
|
|
24
21
|
};
|
|
25
|
-
return ((
|
|
22
|
+
return (_jsx(Animated.View, { style: {
|
|
26
23
|
height: tempHeight,
|
|
27
24
|
transform: [
|
|
28
25
|
{
|
|
@@ -32,9 +29,8 @@ const Banner = ({ text, onClose, dismissable = false, variant = "defaultLight",
|
|
|
32
29
|
}),
|
|
33
30
|
},
|
|
34
31
|
],
|
|
35
|
-
}, children: (
|
|
32
|
+
}, children: _jsx(Flex, { backgroundColor: BANNER_VARIANTS[variant].backgroundColor, ...restProps, children: _jsxs(Flex, { px: 2, py: 1, flexDirection: "row", alignItems: "center", justifyContent: "space-between", children: [_jsx(Flex, { flex: 1, alignItems: "center", children: _jsx(Text, { textAlign: "center", variant: "xs", color: BANNER_VARIANTS[variant].color, children: text }) }), !!dismissable && (_jsx(Flex, { children: _jsx(TouchableOpacity, { testID: "banner-close-button", onPress: handleClose, hitSlop: DEFAULT_HIT_SLOP, children: _jsx(CloseIcon, { fill: BANNER_VARIANTS[variant].color }) }) }))] }) }) }));
|
|
36
33
|
};
|
|
37
|
-
exports.Banner = Banner;
|
|
38
34
|
const BANNER_VARIANTS = {
|
|
39
35
|
defaultLight: {
|
|
40
36
|
backgroundColor: "black10",
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const Banner_1 = require("./Banner");
|
|
6
|
-
const helpers_1 = require("../../storybook/helpers");
|
|
7
|
-
exports.default = {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Banner } from "./Banner";
|
|
3
|
+
import { List } from "../../storybook/helpers";
|
|
4
|
+
export default {
|
|
8
5
|
title: "Banner",
|
|
9
|
-
component:
|
|
6
|
+
component: Banner,
|
|
10
7
|
};
|
|
11
|
-
const States = () => {
|
|
12
|
-
return ((
|
|
8
|
+
export const States = () => {
|
|
9
|
+
return (_jsxs(List, { contentContainerStyle: { alignItems: undefined }, children: [_jsx(Banner, { text: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Reiciendis quae\n natus assumenda distinctio, voluptatum magni. autem sunt." }), _jsx(Banner, { dismissable: true, text: "Default Light", variant: "defaultLight" }), _jsx(Banner, { dismissable: true, text: "Default Dark", variant: "defaultDark" }), _jsx(Banner, { dismissable: true, text: "Success", variant: "success" }), _jsx(Banner, { dismissable: true, text: "Error", variant: "error" }), _jsx(Banner, { dismissable: true, text: "Brand", variant: "brand" })] }));
|
|
13
10
|
};
|
|
14
|
-
exports.States = States;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Banner"), exports);
|
|
1
|
+
export * from "./Banner";
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.BorderBox = void 0;
|
|
7
|
-
const theme_get_1 = require("@styled-system/theme-get");
|
|
8
|
-
const native_1 = __importDefault(require("styled-components/native"));
|
|
9
|
-
const styled_system_1 = require("styled-system");
|
|
10
|
-
const Flex_1 = require("../Flex");
|
|
1
|
+
import { themeGet } from "@styled-system/theme-get";
|
|
2
|
+
import styled from "styled-components/native";
|
|
3
|
+
import { border, space as styledSpace } from "styled-system";
|
|
4
|
+
import { Flex } from "../Flex";
|
|
11
5
|
/**
|
|
12
6
|
* A `View` or `div` (depending on the platform) that has a common border
|
|
13
7
|
* and padding set by default
|
|
14
8
|
*/
|
|
15
|
-
|
|
16
|
-
border: 1px solid ${
|
|
9
|
+
export const BorderBox = styled(Flex) `
|
|
10
|
+
border: 1px solid ${themeGet("colors.black10")};
|
|
17
11
|
border-radius: 2px;
|
|
18
|
-
padding: ${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
12
|
+
padding: ${themeGet("space.2")};
|
|
13
|
+
${border}
|
|
14
|
+
${styledSpace}
|
|
21
15
|
`;
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./BorderBox"), exports);
|
|
1
|
+
export * from "./BorderBox";
|
package/dist/elements/Box/Box.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Box = void 0;
|
|
7
|
-
const react_native_1 = require("react-native");
|
|
8
|
-
const native_1 = __importDefault(require("styled-components/native"));
|
|
9
|
-
const styled_system_1 = require("styled-system");
|
|
1
|
+
import { View } from "react-native";
|
|
2
|
+
import styled from "styled-components/native";
|
|
3
|
+
import { border, color, flexbox, layout, position, space, textAlign, } from "styled-system";
|
|
10
4
|
/**
|
|
11
5
|
* Box is just a `View` with common styled-system props.
|
|
12
6
|
*/
|
|
13
|
-
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
7
|
+
export const Box = styled(View) `
|
|
8
|
+
${space}
|
|
9
|
+
${color}
|
|
10
|
+
${flexbox}
|
|
11
|
+
${layout}
|
|
12
|
+
${position}
|
|
13
|
+
${border}
|
|
14
|
+
${textAlign}
|
|
21
15
|
`;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const Spacer_1 = require("../Spacer");
|
|
10
|
-
const Text_1 = require("../Text");
|
|
11
|
-
exports.default = {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { List } from "../../storybook/helpers";
|
|
4
|
+
import { Box } from "../Box";
|
|
5
|
+
import { Flex } from "../Flex";
|
|
6
|
+
import { Spacer } from "../Spacer";
|
|
7
|
+
import { Text } from "../Text";
|
|
8
|
+
export default {
|
|
12
9
|
title: "Box",
|
|
13
|
-
component:
|
|
10
|
+
component: Box,
|
|
14
11
|
};
|
|
15
|
-
const Styled = () => ((
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flex: 1, children: (0, jsx_runtime_1.jsx)(Box_1.Box, { px: 1, height: 200, width: 200, backgroundColor: "red100", onLayout: (e) => console.log(e.nativeEvent.layout), ref: r }) }));
|
|
12
|
+
export const Styled = () => (_jsx(List, { style: { marginLeft: 50 }, contentContainerStyle: { alignItems: "flex-start" }, children: _jsx(Box, { px: 1, backgroundColor: "blue100", flexDirection: "row", height: 300, width: 200, top: 2, borderBottomWidth: 1, textAlign: "center" }) }));
|
|
13
|
+
export const RegularViewProps = () => {
|
|
14
|
+
const r = useRef(null);
|
|
15
|
+
return (_jsx(Flex, { flex: 1, children: _jsx(Box, { px: 1, height: 200, width: 200, backgroundColor: "red100", onLayout: (e) => console.log(e.nativeEvent.layout), ref: r }) }));
|
|
20
16
|
};
|
|
21
|
-
exports.RegularViewProps = RegularViewProps;
|
|
22
17
|
const colors = ["red10", "green10", "yellow10", "devpurple", "red100", "black10"];
|
|
23
|
-
const GapProps = () => ((
|
|
24
|
-
exports.GapProps = GapProps;
|
|
18
|
+
export const GapProps = () => (_jsxs(List, { style: { marginHorizontal: 20 }, children: [_jsx(Text, { children: "Gap \uD83D\uDC47" }), _jsx(Box, { borderWidth: 1, borderColor: "black100", gap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => (_jsx(Box, { backgroundColor: color, width: 100, height: 100, children: _jsx(Text, { children: color }) }, `${color}-1`))) }), _jsx(Text, { children: "Row gap \uD83D\uDC47" }), _jsx(Box, { borderWidth: 1, borderColor: "black100", rowGap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => (_jsx(Box, { backgroundColor: color, width: 100, height: 100, children: _jsx(Text, { children: color }) }, `${color}-2`))) }), _jsx(Text, { children: "Column gap \uD83D\uDC47" }), _jsx(Box, { borderWidth: 1, borderColor: "black100", columnGap: 10, flexWrap: "wrap", flexDirection: "row", children: colors.map((color) => (_jsx(Box, { backgroundColor: color, width: 100, height: 100, children: _jsx(Text, { children: color }) }, `${color}-3`))) }), _jsx(Spacer, { y: 6 })] }));
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Box"), exports);
|
|
1
|
+
export * from "./Box";
|
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports._test_DisplayState = exports.Button = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = require("react");
|
|
9
|
-
const react_native_1 = require("react-native");
|
|
10
|
-
const react_native_haptic_feedback_1 = __importDefault(require("react-native-haptic-feedback"));
|
|
11
|
-
const react_spring_1 = require("react-spring");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Pressable } from "react-native";
|
|
4
|
+
import Haptic from "react-native-haptic-feedback";
|
|
5
|
+
import { config } from "react-spring";
|
|
12
6
|
// @ts-ignore
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
import { animated, Spring } from "react-spring/renderprops-native";
|
|
8
|
+
import styled from "styled-components/native";
|
|
9
|
+
import { useColor } from "../../utils/hooks";
|
|
10
|
+
import { Box } from "../Box";
|
|
11
|
+
import { Flex } from "../Flex/Flex";
|
|
12
|
+
import { MeasuredView } from "../MeasuredView";
|
|
13
|
+
import { Spacer } from "../Spacer";
|
|
14
|
+
import { Spinner } from "../Spinner";
|
|
15
|
+
import { Text } from "../Text/Text";
|
|
16
|
+
import { useTextStyleForPalette } from "../Text/helpers";
|
|
23
17
|
var DisplayState;
|
|
24
18
|
(function (DisplayState) {
|
|
25
19
|
DisplayState["Enabled"] = "enabled";
|
|
@@ -27,12 +21,11 @@ var DisplayState;
|
|
|
27
21
|
DisplayState["Loading"] = "loading";
|
|
28
22
|
DisplayState["Pressed"] = "pressed";
|
|
29
23
|
})(DisplayState || (DisplayState = {}));
|
|
30
|
-
|
|
31
|
-
const Button = ({ children, disabled, haptic, icon, iconPosition = "left", loading, longestText, onPress, size = "large", variant = "fillDark", testOnly_state, testID, textVariant, hitSlop, ...rest }) => {
|
|
24
|
+
export const Button = ({ children, disabled, haptic, icon, iconPosition = "left", loading, longestText, onPress, size = "large", variant = "fillDark", testOnly_state, testID, textVariant, hitSlop, ...rest }) => {
|
|
32
25
|
const textVariantBySize = size === "small" ? "xs" : "sm";
|
|
33
|
-
const textStyle =
|
|
34
|
-
const [innerDisplayState, setInnerDisplayState] =
|
|
35
|
-
const [longestTextMeasurements, setLongestTextMeasurements] =
|
|
26
|
+
const textStyle = useTextStyleForPalette(textVariant ?? textVariantBySize);
|
|
27
|
+
const [innerDisplayState, setInnerDisplayState] = useState(DisplayState.Enabled);
|
|
28
|
+
const [longestTextMeasurements, setLongestTextMeasurements] = useState({
|
|
36
29
|
width: 0,
|
|
37
30
|
height: 0,
|
|
38
31
|
});
|
|
@@ -69,13 +62,13 @@ const Button = ({ children, disabled, haptic, icon, iconPosition = "left", loadi
|
|
|
69
62
|
setInnerDisplayState(DisplayState.Enabled);
|
|
70
63
|
}
|
|
71
64
|
if (haptic !== undefined) {
|
|
72
|
-
|
|
65
|
+
Haptic.trigger(haptic === true ? "impactLight" : haptic);
|
|
73
66
|
}
|
|
74
67
|
onPress(event);
|
|
75
68
|
};
|
|
76
69
|
const containerSize = getSize();
|
|
77
70
|
const to = useStyleForVariantAndState(variant, testOnly_state ?? displayState);
|
|
78
|
-
return ((
|
|
71
|
+
return (_jsx(Spring, { native: true, to: to, config: config.stiff, children: (springProps) => (_jsx(Pressable, { hitSlop: hitSlop, testOnly_pressed: testOnly_state === DisplayState.Pressed, disabled: testOnly_state === DisplayState.Disabled || disabled, onPressIn: () => {
|
|
79
72
|
if (displayState === DisplayState.Loading) {
|
|
80
73
|
return;
|
|
81
74
|
}
|
|
@@ -85,22 +78,21 @@ const Button = ({ children, disabled, haptic, icon, iconPosition = "left", loadi
|
|
|
85
78
|
return;
|
|
86
79
|
}
|
|
87
80
|
setInnerDisplayState(DisplayState.Enabled);
|
|
88
|
-
}, onPress: handlePress, testID: testID, children: (
|
|
81
|
+
}, onPress: handlePress, testID: testID, children: _jsx(Flex, { flexDirection: "row", children: _jsx(AnimatedContainer, { ...rest, style: {
|
|
89
82
|
backgroundColor: springProps.backgroundColor,
|
|
90
83
|
borderColor: springProps.borderColor,
|
|
91
84
|
height: containerSize.height,
|
|
92
|
-
}, children: (
|
|
85
|
+
}, children: _jsxs(Flex, { mx: containerSize.mx, children: [_jsxs(Flex, { height: "100%", flexDirection: "row", alignItems: "center", justifyContent: "center", children: [iconPosition === "left-start" && !!icon ? (_jsxs(Box, { position: "absolute", left: 0, children: [icon, _jsx(Spacer, { x: 0.5 })] })) : null, iconPosition === "left" && !!icon ? (_jsxs(_Fragment, { children: [icon, _jsx(Spacer, { x: 0.5 })] })) : null, !__TEST__ && longestText && (_jsx(MeasuredView, { setMeasuredState: setLongestTextMeasurements, children: _jsx(Text, { color: "red", style: textStyle, children: longestText ? longestText : children }) })), _jsx(AnimatedText, { style: [
|
|
93
86
|
{
|
|
94
87
|
width: longestText ? Math.ceil(longestTextMeasurements.width) : "auto",
|
|
95
88
|
color: springProps.textColor,
|
|
96
89
|
textDecorationLine: springProps.textDecorationLine,
|
|
97
90
|
},
|
|
98
91
|
textStyle,
|
|
99
|
-
], textAlign: "center", children: children }), iconPosition === "right" && !!icon && ((
|
|
92
|
+
], textAlign: "center", children: children }), iconPosition === "right" && !!icon && (_jsxs(_Fragment, { children: [_jsx(Spacer, { x: 0.5 }), icon] }))] }), displayState === DisplayState.Loading && (_jsx(SpinnerContainer, { children: _jsx(Spinner, { size: size, color: to.loaderColor }) }))] }) }) }) })) }));
|
|
100
93
|
};
|
|
101
|
-
exports.Button = Button;
|
|
102
94
|
const useStyleForVariantAndState = (variant, state) => {
|
|
103
|
-
const color =
|
|
95
|
+
const color = useColor();
|
|
104
96
|
const retval = {
|
|
105
97
|
textDecorationLine: "none",
|
|
106
98
|
};
|
|
@@ -324,19 +316,20 @@ const useStyleForVariantAndState = (variant, state) => {
|
|
|
324
316
|
}
|
|
325
317
|
return retval;
|
|
326
318
|
};
|
|
327
|
-
const Container = (
|
|
319
|
+
const Container = styled(Box) `
|
|
328
320
|
position: relative;
|
|
329
321
|
border-width: 1px;
|
|
330
322
|
border-radius: 50px;
|
|
331
323
|
width: ${(p) => (p.block ? "100%" : "auto")};
|
|
332
324
|
overflow: hidden;
|
|
333
325
|
`;
|
|
334
|
-
const SpinnerContainer = (
|
|
326
|
+
const SpinnerContainer = styled(Box) `
|
|
335
327
|
position: absolute;
|
|
336
328
|
width: 100%;
|
|
337
329
|
height: 100%;
|
|
338
330
|
align-items: center;
|
|
339
331
|
justify-content: center;
|
|
340
332
|
`;
|
|
341
|
-
const AnimatedContainer =
|
|
342
|
-
const AnimatedText =
|
|
333
|
+
const AnimatedContainer = animated(Container);
|
|
334
|
+
const AnimatedText = animated(Text);
|
|
335
|
+
export { DisplayState as _test_DisplayState };
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const Wrap_1 = require("../../utils/Wrap");
|
|
10
|
-
const Flex_1 = require("../Flex");
|
|
11
|
-
const Text_1 = require("../Text");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { capitalize } from "lodash";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { Button } from "./Button";
|
|
5
|
+
import { DataList, List } from "../../storybook/helpers";
|
|
6
|
+
import { Wrap } from "../../utils/Wrap";
|
|
7
|
+
import { Flex } from "../Flex";
|
|
8
|
+
import { LinkText } from "../Text";
|
|
12
9
|
const sizes = ["small", "large"];
|
|
13
10
|
const variants = [
|
|
14
11
|
"fillDark",
|
|
@@ -20,23 +17,19 @@ const variants = [
|
|
|
20
17
|
"outlineLight",
|
|
21
18
|
"text",
|
|
22
19
|
];
|
|
23
|
-
|
|
20
|
+
export default {
|
|
24
21
|
title: "Button",
|
|
25
|
-
component:
|
|
22
|
+
component: Button,
|
|
26
23
|
};
|
|
27
|
-
const Sizes = () => ((
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(helpers_1.List, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "row", flexWrap: "wrap", px: 2, children: variants.map((v) => ((0, jsx_runtime_1.jsx)(Text_1.LinkText, { color: "orange", onPress: () => setVariant(v), mr: "2", children: v }))) }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: variant, onPress: () => console.log(`tapped`), longestText: "Regular YEA", children: "Regular" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: variant, onPress: () => console.log(`tapped`), disabled: true, children: "Disabled" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: variant, onPress: () => console.log(`tapped`), loading: true, children: "Loading" })] }));
|
|
24
|
+
export const Sizes = () => (_jsx(DataList, { data: sizes, renderItem: ({ item: size }) => (_jsx(Button, { size: size, onPress: () => console.log(`tapped ${size}`), children: capitalize(size) })) }));
|
|
25
|
+
export const States = () => {
|
|
26
|
+
const [variant, setVariant] = useState("fillDark");
|
|
27
|
+
return (_jsxs(List, { children: [_jsx(Flex, { flexDirection: "row", flexWrap: "wrap", px: 2, children: variants.map((v) => (_jsx(LinkText, { color: "orange", onPress: () => setVariant(v), mr: "2", children: v }))) }), _jsx(Button, { variant: variant, onPress: () => console.log(`tapped`), longestText: "Regular YEA", children: "Regular" }), _jsx(Button, { variant: variant, onPress: () => console.log(`tapped`), disabled: true, children: "Disabled" }), _jsx(Button, { variant: variant, onPress: () => console.log(`tapped`), loading: true, children: "Loading" })] }));
|
|
32
28
|
};
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
exports.Variants = Variants;
|
|
36
|
-
const VariantsLoading = () => ((0, jsx_runtime_1.jsx)(helpers_1.DataList, { data: variants, renderItem: ({ item: variant }) => {
|
|
29
|
+
export const Variants = () => (_jsx(DataList, { data: variants, renderItem: ({ item: variant }) => (_jsx(Wrap, { if: variant === "outlineLight" || variant === "fillLight", children: _jsx(Flex, { backgroundColor: "pink", p: 1, children: _jsx(Wrap.Content, { children: _jsx(Button, { variant: variant, onPress: () => console.log(`tapped ${variant}`), children: variant }) }) }) })) }));
|
|
30
|
+
export const VariantsLoading = () => (_jsx(DataList, { data: variants, renderItem: ({ item: variant }) => {
|
|
37
31
|
if (variant !== "outlineLight") {
|
|
38
|
-
return ((
|
|
32
|
+
return (_jsx(Button, { variant: variant, loading: true, onPress: () => console.log(`tapped ${variant}`), children: variant }));
|
|
39
33
|
}
|
|
40
|
-
return ((
|
|
34
|
+
return (_jsx(Flex, { backgroundColor: "pink", py: 0.5, children: _jsx(Button, { variant: variant, loading: true, onPress: () => console.log(`tapped ${variant}`), children: variant }) }));
|
|
41
35
|
} }));
|
|
42
|
-
exports.VariantsLoading = VariantsLoading;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const Button_1 = require("./Button");
|
|
6
|
-
const CTAButton = (props) => (0, jsx_runtime_1.jsx)(Button_1.Button, { block: true, haptic: true, ...props });
|
|
7
|
-
exports.CTAButton = CTAButton;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "./Button";
|
|
3
|
+
export const CTAButton = (props) => _jsx(Button, { block: true, haptic: true, ...props });
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const Text_1 = require("../Text");
|
|
9
|
-
const FollowButton = ({ isFollowed, followCount, longestText, loading, ...restProps }) => {
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(Button_1.Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && !loading && (0, jsx_runtime_1.jsx)(CheckIcon_1.CheckIcon, { fill: "black60", width: "16px", height: "16px" }), loading: loading, ...restProps, children: !loading && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { variant: "xs", color: "black60", children: " " + (0, formatLargeNumber_1.formatLargeNumber)(followCount, 1) }) }))] })) }));
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckIcon } from "../../svgs/CheckIcon";
|
|
3
|
+
import { formatLargeNumber } from "../../utils/formatLargeNumber";
|
|
4
|
+
import { Button } from "../Button";
|
|
5
|
+
import { Text } from "../Text";
|
|
6
|
+
export const FollowButton = ({ isFollowed, followCount, longestText, loading, ...restProps }) => {
|
|
7
|
+
return (_jsx(Button, { variant: isFollowed ? "outline" : "outlineGray", size: "small", longestText: longestText ? longestText : "Following", icon: isFollowed && !loading && _jsx(CheckIcon, { fill: "black60", width: "16px", height: "16px" }), loading: loading, ...restProps, children: !loading && (_jsxs(_Fragment, { children: [_jsx(Text, { variant: "xs", children: isFollowed ? "Following" : "Follow" }), !!followCount && followCount > 1 && (_jsx(_Fragment, { children: _jsx(Text, { variant: "xs", color: "black60", children: " " + formatLargeNumber(followCount, 1) }) }))] })) }));
|
|
11
8
|
};
|
|
12
|
-
exports.FollowButton = FollowButton;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const Text_1 = require("../Text");
|
|
6
|
-
const Touchable_1 = require("../Touchable");
|
|
7
|
-
const LinkButton = (props) => ((0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: props.onPress, children: (0, jsx_runtime_1.jsx)(Text_1.Text, { underline: true, ...props }) }));
|
|
8
|
-
exports.LinkButton = LinkButton;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from "../Text";
|
|
3
|
+
import { Touchable } from "../Touchable";
|
|
4
|
+
export const LinkButton = (props) => (_jsx(Touchable, { onPress: props.onPress, children: _jsx(Text, { underline: true, ...props }) }));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useColor_1 = require("../../utils/hooks/useColor");
|
|
5
|
-
const useColorsForVariantAndState = () => {
|
|
6
|
-
const color = (0, useColor_1.useColor)();
|
|
1
|
+
import { useColor } from "../../utils/hooks/useColor";
|
|
2
|
+
export const useColorsForVariantAndState = () => {
|
|
3
|
+
const color = useColor();
|
|
7
4
|
return {
|
|
8
5
|
fillDark: {
|
|
9
6
|
disabled: { bg: color("black30"), border: color("black30"), text: color("onPrimaryHigh") },
|
|
@@ -75,4 +72,3 @@ const useColorsForVariantAndState = () => {
|
|
|
75
72
|
},
|
|
76
73
|
};
|
|
77
74
|
};
|
|
78
|
-
exports.useColorsForVariantAndState = useColorsForVariantAndState;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Button"), exports);
|
|
18
|
-
__exportStar(require("./CTAButton"), exports);
|
|
19
|
-
__exportStar(require("./LinkButton"), exports);
|
|
20
|
-
__exportStar(require("./FollowButton"), exports);
|
|
1
|
+
export * from "./Button";
|
|
2
|
+
export * from "./CTAButton";
|
|
3
|
+
export * from "./LinkButton";
|
|
4
|
+
export * from "./FollowButton";
|