@swan-io/lake 1.0.0
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/HISTORY.md +3 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/package.json +60 -0
- package/src/components/Alert.d.ts +10 -0
- package/src/components/Alert.js +36 -0
- package/src/components/AppOpeningAnimation.d.ts +10 -0
- package/src/components/AppOpeningAnimation.js +50 -0
- package/src/components/AutoWidthImage.d.ts +8 -0
- package/src/components/AutoWidthImage.js +26 -0
- package/src/components/Avatar.d.ts +7 -0
- package/src/components/Avatar.js +42 -0
- package/src/components/BorderedButton.d.ts +16 -0
- package/src/components/BorderedButton.js +98 -0
- package/src/components/BorderedIcon.d.ts +12 -0
- package/src/components/BorderedIcon.js +25 -0
- package/src/components/BottomPanel.d.ts +9 -0
- package/src/components/BottomPanel.js +94 -0
- package/src/components/Box.d.ts +65 -0
- package/src/components/Box.js +31 -0
- package/src/components/Breadcrumbs.d.ts +18 -0
- package/src/components/Breadcrumbs.js +362 -0
- package/src/components/Button.d.ts +15 -0
- package/src/components/Button.js +83 -0
- package/src/components/Caption.d.ts +6 -0
- package/src/components/Caption.js +11 -0
- package/src/components/Checkbox.d.ts +12 -0
- package/src/components/Checkbox.js +83 -0
- package/src/components/ChoicePicker.d.ts +11 -0
- package/src/components/ChoicePicker.js +99 -0
- package/src/components/Combobox.d.ts +29 -0
- package/src/components/Combobox.js +182 -0
- package/src/components/FailureIcon.d.ts +8 -0
- package/src/components/FailureIcon.js +4 -0
- package/src/components/FileTile.d.ts +11 -0
- package/src/components/FileTile.js +37 -0
- package/src/components/Fill.d.ts +8 -0
- package/src/components/Fill.js +24 -0
- package/src/components/FilterChooser.d.ts +15 -0
- package/src/components/FilterChooser.js +52 -0
- package/src/components/Filters.d.ts +57 -0
- package/src/components/Filters.js +229 -0
- package/src/components/FixedListView.d.ts +104 -0
- package/src/components/FixedListView.js +821 -0
- package/src/components/FixedListViewCells.d.ts +55 -0
- package/src/components/FixedListViewCells.js +157 -0
- package/src/components/Flag.d.ts +8 -0
- package/src/components/Flag.js +36 -0
- package/src/components/FlowPresentation.d.ts +12 -0
- package/src/components/FlowPresentation.js +70 -0
- package/src/components/FocusTrap.d.ts +16 -0
- package/src/components/FocusTrap.js +90 -0
- package/src/components/Form.d.ts +8 -0
- package/src/components/Form.js +17 -0
- package/src/components/FullViewportLayer.d.ts +7 -0
- package/src/components/FullViewportLayer.js +91 -0
- package/src/components/Grid.d.ts +13 -0
- package/src/components/Grid.js +33 -0
- package/src/components/Heading.d.ts +61 -0
- package/src/components/Heading.js +27 -0
- package/src/components/Icon.d.ts +191 -0
- package/src/components/Icon.js +11 -0
- package/src/components/Input.d.ts +34 -0
- package/src/components/Input.js +115 -0
- package/src/components/InputError.d.ts +8 -0
- package/src/components/InputError.js +16 -0
- package/src/components/Label.d.ts +10 -0
- package/src/components/Label.js +19 -0
- package/src/components/LakeAlert.d.ts +14 -0
- package/src/components/LakeAlert.js +75 -0
- package/src/components/LakeButton.d.ts +36 -0
- package/src/components/LakeButton.js +171 -0
- package/src/components/LakeCheckbox.d.ts +16 -0
- package/src/components/LakeCheckbox.js +54 -0
- package/src/components/LakeCombobox.d.ts +28 -0
- package/src/components/LakeCombobox.js +166 -0
- package/src/components/LakeCopyButton.d.ts +10 -0
- package/src/components/LakeCopyButton.js +16 -0
- package/src/components/LakeDownloadButton.d.ts +8 -0
- package/src/components/LakeDownloadButton.js +6 -0
- package/src/components/LakeHeading.d.ts +10 -0
- package/src/components/LakeHeading.js +19 -0
- package/src/components/LakeLabel.d.ts +19 -0
- package/src/components/LakeLabel.js +43 -0
- package/src/components/LakeModal.d.ts +14 -0
- package/src/components/LakeModal.js +132 -0
- package/src/components/LakeRadio.d.ts +9 -0
- package/src/components/LakeRadio.js +44 -0
- package/src/components/LakeScrollView.d.ts +10 -0
- package/src/components/LakeScrollView.js +35 -0
- package/src/components/LakeSearchField.d.ts +10 -0
- package/src/components/LakeSearchField.js +111 -0
- package/src/components/LakeSelect.d.ts +30 -0
- package/src/components/LakeSelect.js +183 -0
- package/src/components/LakeSlider.d.ts +12 -0
- package/src/components/LakeSlider.js +31 -0
- package/src/components/LakeStepper.d.ts +21 -0
- package/src/components/LakeStepper.js +134 -0
- package/src/components/LakeText.d.ts +19 -0
- package/src/components/LakeText.js +20 -0
- package/src/components/LakeTextInput.d.ts +36 -0
- package/src/components/LakeTextInput.js +154 -0
- package/src/components/LakeTooltip.d.ts +24 -0
- package/src/components/LakeTooltip.js +188 -0
- package/src/components/Link.d.ts +138 -0
- package/src/components/Link.js +23 -0
- package/src/components/ListRightPanel.d.ts +17 -0
- package/src/components/ListRightPanel.js +79 -0
- package/src/components/LoadingView.d.ts +9 -0
- package/src/components/LoadingView.js +24 -0
- package/src/components/Modal.d.ts +12 -0
- package/src/components/Modal.js +80 -0
- package/src/components/MultiSelect.d.ts +27 -0
- package/src/components/MultiSelect.js +223 -0
- package/src/components/MultilineInput.d.ts +15 -0
- package/src/components/MultilineInput.js +55 -0
- package/src/components/Picker.d.ts +26 -0
- package/src/components/Picker.js +116 -0
- package/src/components/PlainListView.d.ts +36 -0
- package/src/components/PlainListView.js +208 -0
- package/src/components/Popover.d.ts +23 -0
- package/src/components/Popover.js +147 -0
- package/src/components/PopoverContent.d.ts +8 -0
- package/src/components/PopoverContent.js +9 -0
- package/src/components/Portal.d.ts +7 -0
- package/src/components/Portal.js +9 -0
- package/src/components/Pressable.d.ts +348 -0
- package/src/components/Pressable.js +91 -0
- package/src/components/ProgressBar.d.ts +11 -0
- package/src/components/ProgressBar.js +46 -0
- package/src/components/ProjectEnvTag.d.ts +7 -0
- package/src/components/ProjectEnvTag.js +12 -0
- package/src/components/QuickActions.d.ts +15 -0
- package/src/components/QuickActions.js +38 -0
- package/src/components/RadioGroup.d.ts +16 -0
- package/src/components/RadioGroup.js +34 -0
- package/src/components/ReadOnlyFieldList.d.ts +6 -0
- package/src/components/ReadOnlyFieldList.js +8 -0
- package/src/components/ResponsiveContainer.d.ts +13 -0
- package/src/components/ResponsiveContainer.js +23 -0
- package/src/components/RightPanel.d.ts +10 -0
- package/src/components/RightPanel.js +102 -0
- package/src/components/SegmentedControl.d.ts +19 -0
- package/src/components/SegmentedControl.js +74 -0
- package/src/components/Separator.d.ts +10 -0
- package/src/components/Separator.js +19 -0
- package/src/components/SidebarNavigationTracker.d.ts +13 -0
- package/src/components/SidebarNavigationTracker.js +93 -0
- package/src/components/Slider.d.ts +11 -0
- package/src/components/Slider.js +119 -0
- package/src/components/SmsOpeningAnimation.d.ts +8 -0
- package/src/components/SmsOpeningAnimation.js +52 -0
- package/src/components/Space.d.ts +10 -0
- package/src/components/Space.js +23 -0
- package/src/components/Stack.d.ts +12 -0
- package/src/components/Stack.js +23 -0
- package/src/components/StepDots.d.ts +7 -0
- package/src/components/StepDots.js +24 -0
- package/src/components/Stepper.d.ts +9 -0
- package/src/components/Stepper.js +67 -0
- package/src/components/SuccessIcon.d.ts +8 -0
- package/src/components/SuccessIcon.js +4 -0
- package/src/components/Svg.d.ts +145 -0
- package/src/components/Svg.js +24 -0
- package/src/components/SwanLogo.d.ts +8 -0
- package/src/components/SwanLogo.js +11 -0
- package/src/components/Switch.d.ts +9 -0
- package/src/components/Switch.js +74 -0
- package/src/components/TabView.d.ts +16 -0
- package/src/components/TabView.js +398 -0
- package/src/components/Table.d.ts +34 -0
- package/src/components/Table.js +79 -0
- package/src/components/Tag.d.ts +17 -0
- package/src/components/Tag.js +76 -0
- package/src/components/Tile.d.ts +34 -0
- package/src/components/Tile.js +130 -0
- package/src/components/TilePlaceholder.d.ts +6 -0
- package/src/components/TilePlaceholder.js +51 -0
- package/src/components/ToastStack.d.ts +2 -0
- package/src/components/ToastStack.js +96 -0
- package/src/components/Tooltip.d.ts +18 -0
- package/src/components/Tooltip.js +162 -0
- package/src/components/TransitionGroupView.d.ts +12 -0
- package/src/components/TransitionGroupView.js +43 -0
- package/src/components/TransitionView.d.ts +12 -0
- package/src/components/TransitionView.js +43 -0
- package/src/components/WithCurrentColor.d.ts +12 -0
- package/src/components/WithCurrentColor.js +65 -0
- package/src/components/WithPartnerAccentColor.d.ts +7 -0
- package/src/components/WithPartnerAccentColor.js +91 -0
- package/src/constants/colors.d.ts +42 -0
- package/src/constants/colors.js +42 -0
- package/src/constants/commonStyles.d.ts +66 -0
- package/src/constants/commonStyles.js +45 -0
- package/src/constants/design.d.ts +168 -0
- package/src/constants/design.js +564 -0
- package/src/constants/insets.d.ts +10 -0
- package/src/constants/insets.js +22 -0
- package/src/constants/typography.d.ts +26 -0
- package/src/constants/typography.js +54 -0
- package/src/hooks/useAnimatedValue.d.ts +2 -0
- package/src/hooks/useAnimatedValue.js +3 -0
- package/src/hooks/useBodyClassName.d.ts +3 -0
- package/src/hooks/useBodyClassName.js +14 -0
- package/src/hooks/useBoolean.d.ts +8 -0
- package/src/hooks/useBoolean.js +12 -0
- package/src/hooks/useComputedColors.d.ts +10 -0
- package/src/hooks/useComputedColors.js +42 -0
- package/src/hooks/useDebounce.d.ts +1 -0
- package/src/hooks/useDebounce.js +12 -0
- package/src/hooks/useDisclosure.d.ts +8 -0
- package/src/hooks/useDisclosure.js +12 -0
- package/src/hooks/useFirstMountState.d.ts +1 -0
- package/src/hooks/useFirstMountState.js +9 -0
- package/src/hooks/useForceableState.d.ts +1 -0
- package/src/hooks/useForceableState.js +6 -0
- package/src/hooks/useHover.d.ts +11 -0
- package/src/hooks/useHover.js +4 -0
- package/src/hooks/useInterval.d.ts +1 -0
- package/src/hooks/useInterval.js +11 -0
- package/src/hooks/useLazyRef.d.ts +2 -0
- package/src/hooks/useLazyRef.js +9 -0
- package/src/hooks/useMergeRefs.d.ts +2 -0
- package/src/hooks/useMergeRefs.js +5 -0
- package/src/hooks/useNativeProp.d.ts +2 -0
- package/src/hooks/useNativeProp.js +9 -0
- package/src/hooks/useOutsideClick.d.ts +8 -0
- package/src/hooks/useOutsideClick.js +54 -0
- package/src/hooks/usePersistedState.d.ts +1 -0
- package/src/hooks/usePersistedState.js +21 -0
- package/src/hooks/usePressEvents.d.ts +31 -0
- package/src/hooks/usePressEvents.js +4 -0
- package/src/hooks/usePreviousValue.d.ts +1 -0
- package/src/hooks/usePreviousValue.js +8 -0
- package/src/hooks/useResponsive.d.ts +7 -0
- package/src/hooks/useResponsive.js +20 -0
- package/src/hooks/useUpdateEffect.d.ts +2 -0
- package/src/hooks/useUpdateEffect.js +10 -0
- package/src/hooks/useUrqlMutation.d.ts +4 -0
- package/src/hooks/useUrqlMutation.js +30 -0
- package/src/hooks/useUrqlQuery.d.ts +19 -0
- package/src/hooks/useUrqlQuery.js +73 -0
- package/src/state/toasts.d.ts +21 -0
- package/src/state/toasts.js +61 -0
- package/src/utils/__tests__/array.test.d.ts +1 -0
- package/src/utils/__tests__/array.test.js +127 -0
- package/src/utils/__tests__/base64.test.d.ts +1 -0
- package/src/utils/__tests__/base64.test.js +27 -0
- package/src/utils/__tests__/function.test.d.ts +1 -0
- package/src/utils/__tests__/function.test.js +36 -0
- package/src/utils/__tests__/object.test.d.ts +1 -0
- package/src/utils/__tests__/object.test.js +17 -0
- package/src/utils/__tests__/rifm.test.d.ts +1 -0
- package/src/utils/__tests__/rifm.test.js +124 -0
- package/src/utils/__tests__/string.test.d.ts +1 -0
- package/src/utils/__tests__/string.test.js +16 -0
- package/src/utils/a11y.d.ts +1 -0
- package/src/utils/a11y.js +18 -0
- package/src/utils/array.d.ts +6 -0
- package/src/utils/array.js +71 -0
- package/src/utils/base64.d.ts +2 -0
- package/src/utils/base64.js +20 -0
- package/src/utils/file.d.ts +2 -0
- package/src/utils/file.js +10 -0
- package/src/utils/flagCountry.d.ts +1 -0
- package/src/utils/flagCountry.js +1 -0
- package/src/utils/function.d.ts +4 -0
- package/src/utils/function.js +19 -0
- package/src/utils/math.d.ts +16 -0
- package/src/utils/math.js +47 -0
- package/src/utils/nullish.d.ts +10 -0
- package/src/utils/nullish.js +8 -0
- package/src/utils/object.d.ts +2 -0
- package/src/utils/object.js +7 -0
- package/src/utils/popper.d.ts +3 -0
- package/src/utils/popper.js +30 -0
- package/src/utils/rifm.d.ts +14 -0
- package/src/utils/rifm.js +53 -0
- package/src/utils/string.d.ts +4 -0
- package/src/utils/string.js +233 -0
- package/src/utils/timer.d.ts +11 -0
- package/src/utils/timer.js +46 -0
- package/src/utils/types.d.ts +8 -0
- package/src/utils/types.js +1 -0
- package/src/utils/userAgent.d.ts +4 -0
- package/src/utils/userAgent.js +9 -0
- package/src/utils/viewport.d.ts +1 -0
- package/src/utils/viewport.js +12 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { Text, TextProps } from "react-native";
|
|
3
|
+
import { Except } from "type-fest";
|
|
4
|
+
declare const sizes: {
|
|
5
|
+
40: {
|
|
6
|
+
fontSize: number;
|
|
7
|
+
color: string;
|
|
8
|
+
fontWeight: "600";
|
|
9
|
+
lineHeight: number;
|
|
10
|
+
fontFamily: string;
|
|
11
|
+
letterSpacing: number;
|
|
12
|
+
};
|
|
13
|
+
32: {
|
|
14
|
+
fontSize: number;
|
|
15
|
+
color: string;
|
|
16
|
+
fontWeight: "600";
|
|
17
|
+
lineHeight: number;
|
|
18
|
+
fontFamily: string;
|
|
19
|
+
letterSpacing: number;
|
|
20
|
+
};
|
|
21
|
+
28: {
|
|
22
|
+
fontSize: number;
|
|
23
|
+
color: string;
|
|
24
|
+
fontWeight: "600";
|
|
25
|
+
lineHeight: number;
|
|
26
|
+
fontFamily: string;
|
|
27
|
+
letterSpacing: number;
|
|
28
|
+
};
|
|
29
|
+
24: {
|
|
30
|
+
fontSize: number;
|
|
31
|
+
color: string;
|
|
32
|
+
fontWeight: "600";
|
|
33
|
+
lineHeight: number;
|
|
34
|
+
fontFamily: string;
|
|
35
|
+
letterSpacing: number;
|
|
36
|
+
};
|
|
37
|
+
20: {
|
|
38
|
+
fontSize: number;
|
|
39
|
+
color: string;
|
|
40
|
+
fontWeight: "600";
|
|
41
|
+
lineHeight: number;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
letterSpacing: number;
|
|
44
|
+
};
|
|
45
|
+
16: {
|
|
46
|
+
fontSize: number;
|
|
47
|
+
color: string;
|
|
48
|
+
fontWeight: "600";
|
|
49
|
+
lineHeight: number;
|
|
50
|
+
fontFamily: string;
|
|
51
|
+
letterSpacing: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
type HeadingSize = keyof typeof sizes;
|
|
55
|
+
export declare const Heading: import("react").ForwardRefExoticComponent<Except<TextProps, "accessibilityRole"> & {
|
|
56
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
57
|
+
align?: "center" | "left" | "right" | undefined;
|
|
58
|
+
size: HeadingSize;
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
} & import("react").RefAttributes<Text>>;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { StyleSheet, Text } from "react-native";
|
|
4
|
+
import { colors } from "../constants/colors";
|
|
5
|
+
import { typography } from "../constants/typography";
|
|
6
|
+
const baseStyle = {
|
|
7
|
+
...typography.interFont,
|
|
8
|
+
color: colors.gray[100],
|
|
9
|
+
fontWeight: typography.fontWeights.demi,
|
|
10
|
+
lineHeight: typography.lineHeights.title,
|
|
11
|
+
};
|
|
12
|
+
/* eslint-disable react-native/no-unused-styles */
|
|
13
|
+
const alignments = StyleSheet.create({
|
|
14
|
+
center: { textAlign: "center" },
|
|
15
|
+
left: { textAlign: "left" },
|
|
16
|
+
right: { textAlign: "right" },
|
|
17
|
+
});
|
|
18
|
+
const sizes = StyleSheet.create({
|
|
19
|
+
40: { ...baseStyle, fontSize: 40 },
|
|
20
|
+
32: { ...baseStyle, fontSize: 32 },
|
|
21
|
+
28: { ...baseStyle, fontSize: 28 },
|
|
22
|
+
24: { ...baseStyle, fontSize: 24 },
|
|
23
|
+
20: { ...baseStyle, fontSize: 20 },
|
|
24
|
+
16: { ...baseStyle, fontSize: 16 },
|
|
25
|
+
/* eslint-enable react-native/no-unused-styles */
|
|
26
|
+
});
|
|
27
|
+
export const Heading = forwardRef(({ children, align = "left", size, level, style, ...props }, forwardedRef) => (_jsx(Text, { ref: forwardedRef, accessibilityRole: "header", accessibilityLevel: level, style: [sizes[size], alignments[align], style], ...props, children: children })));
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AccessibilityProps, StyleProp, ViewProps, ViewStyle } from "react-native";
|
|
3
|
+
declare const paths: {
|
|
4
|
+
"lake-calendar-arrow-swap": string;
|
|
5
|
+
"lake-card": string;
|
|
6
|
+
"lake-card-one-off": string;
|
|
7
|
+
"lake-card-physical": string;
|
|
8
|
+
"lake-card-recurring": string;
|
|
9
|
+
"lake-card-single-use": string;
|
|
10
|
+
"lake-card-virtual": string;
|
|
11
|
+
"lake-chevron-double": string;
|
|
12
|
+
"lake-clipboard-bullet": string;
|
|
13
|
+
"lake-clock": string;
|
|
14
|
+
"lake-clock-arrow-swap": string;
|
|
15
|
+
"lake-close": string;
|
|
16
|
+
"lake-currencies": string;
|
|
17
|
+
"lake-delivery-grouped": string;
|
|
18
|
+
"lake-delivery-individual": string;
|
|
19
|
+
"lake-document-csv": string;
|
|
20
|
+
"lake-document-jpg": string;
|
|
21
|
+
"lake-document-pdf": string;
|
|
22
|
+
"lake-document-png": string;
|
|
23
|
+
"lake-document-xls": string;
|
|
24
|
+
"lake-email": string;
|
|
25
|
+
"lake-id-card": string;
|
|
26
|
+
"lake-inbox-empty": string;
|
|
27
|
+
"lake-menu": string;
|
|
28
|
+
"lake-people": string;
|
|
29
|
+
"lake-person-arrow-swap": string;
|
|
30
|
+
"lake-phone": string;
|
|
31
|
+
"lake-receipt": string;
|
|
32
|
+
"lake-settings": string;
|
|
33
|
+
"lake-signature": string;
|
|
34
|
+
"lake-transfer": string;
|
|
35
|
+
"lake-world-map": string;
|
|
36
|
+
"add-circle-filled": string;
|
|
37
|
+
"add-circle-regular": string;
|
|
38
|
+
"add-filled": string;
|
|
39
|
+
"approvals-app-filled": string;
|
|
40
|
+
"apps-list-filled": string;
|
|
41
|
+
"apps-list-regular": string;
|
|
42
|
+
"arrow-counterclockwise-filled": string;
|
|
43
|
+
"arrow-down-filled": string;
|
|
44
|
+
"arrow-down-regular": string;
|
|
45
|
+
"arrow-download-filled": string;
|
|
46
|
+
"arrow-left-filled": string;
|
|
47
|
+
"arrow-left-regular": string;
|
|
48
|
+
"arrow-right-filled": string;
|
|
49
|
+
"arrow-right-regular": string;
|
|
50
|
+
"arrow-swap-filled": string;
|
|
51
|
+
"arrow-swap-regular": string;
|
|
52
|
+
"arrow-up-filled": string;
|
|
53
|
+
"arrow-up-regular": string;
|
|
54
|
+
"beaker-filled": string;
|
|
55
|
+
"beaker-regular": string;
|
|
56
|
+
"board-regular": string;
|
|
57
|
+
"box-regular": string;
|
|
58
|
+
"building-bank-filled": string;
|
|
59
|
+
"building-bank-regular": string;
|
|
60
|
+
"building-filled": string;
|
|
61
|
+
"building-multiple-regular": string;
|
|
62
|
+
"building-regular": string;
|
|
63
|
+
"building-shop-regular": string;
|
|
64
|
+
"calendar-ltr-regular": string;
|
|
65
|
+
"cart-regular": string;
|
|
66
|
+
"chat-help-filled": string;
|
|
67
|
+
"chat-help-regular": string;
|
|
68
|
+
"checkmark-circle-regular": string;
|
|
69
|
+
"checkmark-filled": string;
|
|
70
|
+
"chevron-down-filled": string;
|
|
71
|
+
"chevron-left-filled": string;
|
|
72
|
+
"chevron-right-filled": string;
|
|
73
|
+
"chevron-up-down-regular": string;
|
|
74
|
+
"chevron-up-filled": string;
|
|
75
|
+
"clipboard-search-regular": string;
|
|
76
|
+
"clock-filled": string;
|
|
77
|
+
"clock-regular": string;
|
|
78
|
+
"cloud-sync-filled": string;
|
|
79
|
+
"cloud-sync-regular": string;
|
|
80
|
+
"code-filled": string;
|
|
81
|
+
"code-regular": string;
|
|
82
|
+
"color-regular": string;
|
|
83
|
+
"comment-note-regular": string;
|
|
84
|
+
"copy-filled": string;
|
|
85
|
+
"copy-regular": string;
|
|
86
|
+
"cursor-click-regular": string;
|
|
87
|
+
"database-filled": string;
|
|
88
|
+
"database-regular": string;
|
|
89
|
+
"delete-filled": string;
|
|
90
|
+
"delete-regular": string;
|
|
91
|
+
"desktop-regular": string;
|
|
92
|
+
"device-meeting-room-regular": string;
|
|
93
|
+
"dismiss-circle-regular": string;
|
|
94
|
+
"dismiss-filled": string;
|
|
95
|
+
"dismiss-regular": string;
|
|
96
|
+
"document-regular": string;
|
|
97
|
+
"earth-regular": string;
|
|
98
|
+
"edit-filled": string;
|
|
99
|
+
"edit-regular": string;
|
|
100
|
+
"error-circle-filled": string;
|
|
101
|
+
"error-circle-regular": string;
|
|
102
|
+
"eye-filled": string;
|
|
103
|
+
"eye-off-filled": string;
|
|
104
|
+
"eye-regular": string;
|
|
105
|
+
"filter-filled": string;
|
|
106
|
+
"flag-filled": string;
|
|
107
|
+
"flag-regular": string;
|
|
108
|
+
"flash-filled": string;
|
|
109
|
+
"flash-regular": string;
|
|
110
|
+
"form-new-filled": string;
|
|
111
|
+
"form-new-regular": string;
|
|
112
|
+
"hand-right-regular": string;
|
|
113
|
+
"image-add-filled": string;
|
|
114
|
+
"image-add-regular": string;
|
|
115
|
+
"image-filled": string;
|
|
116
|
+
"image-regular": string;
|
|
117
|
+
"info-filled": string;
|
|
118
|
+
"info-regular": string;
|
|
119
|
+
"key-regular": string;
|
|
120
|
+
"link-filled": string;
|
|
121
|
+
"live-filled": string;
|
|
122
|
+
"live-regular": string;
|
|
123
|
+
"lock-closed-filled": string;
|
|
124
|
+
"lock-closed-regular": string;
|
|
125
|
+
"lock-open-filled": string;
|
|
126
|
+
"lock-open-regular": string;
|
|
127
|
+
"mail-filled": string;
|
|
128
|
+
"mail-regular": string;
|
|
129
|
+
"money-regular": string;
|
|
130
|
+
"more-vertical-filled": string;
|
|
131
|
+
"open-filled": string;
|
|
132
|
+
"open-regular": string;
|
|
133
|
+
"options-regular": string;
|
|
134
|
+
"paint-brush-filled": string;
|
|
135
|
+
"paint-brush-regular": string;
|
|
136
|
+
"pause-regular": string;
|
|
137
|
+
"payment-filled": string;
|
|
138
|
+
"payment-regular": string;
|
|
139
|
+
"people-add-regular": string;
|
|
140
|
+
"people-community-filled": string;
|
|
141
|
+
"people-community-regular": string;
|
|
142
|
+
"people-filled": string;
|
|
143
|
+
"people-regular": string;
|
|
144
|
+
"people-team-regular": string;
|
|
145
|
+
"person-accounts-filled": string;
|
|
146
|
+
"person-accounts-regular": string;
|
|
147
|
+
"person-add-regular": string;
|
|
148
|
+
"person-call-filled": string;
|
|
149
|
+
"person-call-regular": string;
|
|
150
|
+
"person-filled": string;
|
|
151
|
+
"person-lock-regular": string;
|
|
152
|
+
"person-regular": string;
|
|
153
|
+
"phone-filled": string;
|
|
154
|
+
"phone-regular": string;
|
|
155
|
+
"pin-regular": string;
|
|
156
|
+
"play-filled": string;
|
|
157
|
+
"play-regular": string;
|
|
158
|
+
"preview-link-filled": string;
|
|
159
|
+
"question-circle-regular": string;
|
|
160
|
+
"rocket-regular": string;
|
|
161
|
+
"search-filled": string;
|
|
162
|
+
"send-filled": string;
|
|
163
|
+
"send-regular": string;
|
|
164
|
+
"settings-filled": string;
|
|
165
|
+
"settings-regular": string;
|
|
166
|
+
"shield-checkmark-filled": string;
|
|
167
|
+
"shield-checkmark-regular": string;
|
|
168
|
+
"shield-error-regular": string;
|
|
169
|
+
"shield-regular": string;
|
|
170
|
+
"sign-out-regular": string;
|
|
171
|
+
"signature-filled": string;
|
|
172
|
+
"signature-regular": string;
|
|
173
|
+
"subtract-circle-filled": string;
|
|
174
|
+
"subtract-circle-regular": string;
|
|
175
|
+
"target-arrow-regular": string;
|
|
176
|
+
"warning-filled": string;
|
|
177
|
+
"warning-regular": string;
|
|
178
|
+
"window-dev-tools-filled": string;
|
|
179
|
+
"window-dev-tools-regular": string;
|
|
180
|
+
};
|
|
181
|
+
export type IconName = keyof typeof paths;
|
|
182
|
+
type Props = AccessibilityProps & {
|
|
183
|
+
color?: string;
|
|
184
|
+
focusable?: boolean;
|
|
185
|
+
name: IconName;
|
|
186
|
+
pointerEvents?: ViewProps["pointerEvents"];
|
|
187
|
+
size: number;
|
|
188
|
+
style?: StyleProp<ViewStyle>;
|
|
189
|
+
};
|
|
190
|
+
export declare const Icon: import("react").NamedExoticComponent<Props>;
|
|
191
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { Path, Svg } from "./Svg";
|
|
4
|
+
import customIcons from "../icons/custom-icons.json";
|
|
5
|
+
import fluentIcons from "../icons/fluent-icons.json";
|
|
6
|
+
const paths = {
|
|
7
|
+
...fluentIcons,
|
|
8
|
+
...customIcons,
|
|
9
|
+
};
|
|
10
|
+
export const Icon = memo(({ name, color = "currentColor", focusable, size, pointerEvents = "none", style, ...props }) => (_jsx(Svg, { focusable: focusable, pointerEvents: pointerEvents, viewBox: "0 0 24 24", style: [{ height: size, width: size }, style], ...props, children: _jsx(Path, { d: paths[name], fill: color }) })));
|
|
11
|
+
Icon.displayName = "Icon";
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChangeEventHandler, ReactNode } from "react";
|
|
2
|
+
import { KeyboardTypeOptions, NativeSyntheticEvent, ReturnKeyTypeOptions, StyleProp, TextInput, TextInputProps, TextStyle, ViewStyle, WebAccessibilityRole } from "react-native";
|
|
3
|
+
import { IconName } from "./Icon";
|
|
4
|
+
type Props = {
|
|
5
|
+
accessibilityControls?: string;
|
|
6
|
+
accessibilityExpanded?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
error?: string;
|
|
9
|
+
icon?: IconName;
|
|
10
|
+
inputContainerStyle?: StyleProp<ViewStyle>;
|
|
11
|
+
role?: WebAccessibilityRole;
|
|
12
|
+
keyboardType?: KeyboardTypeOptions;
|
|
13
|
+
returnKeyType?: ReturnKeyTypeOptions;
|
|
14
|
+
maxLength?: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
onFocus?: (event: NativeSyntheticEvent<React.FocusEvent>) => void;
|
|
17
|
+
onBlur?: (event: NativeSyntheticEvent<React.FocusEvent>) => void;
|
|
18
|
+
onSubmitEditing?: TextInputProps["onSubmitEditing"];
|
|
19
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
20
|
+
onValueChange?: TextInputProps["onChangeText"];
|
|
21
|
+
onKeyPress?: TextInputProps["onKeyPress"];
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
size?: "large" | "small";
|
|
25
|
+
successful?: boolean;
|
|
26
|
+
suffix?: string;
|
|
27
|
+
value?: string;
|
|
28
|
+
style?: StyleProp<ViewStyle>;
|
|
29
|
+
inputStyle?: StyleProp<TextStyle>;
|
|
30
|
+
RightComponent?: ReactNode;
|
|
31
|
+
hideErrorMessage?: boolean;
|
|
32
|
+
};
|
|
33
|
+
export declare const Input: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<TextInput>>>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useId, useRef } from "react";
|
|
3
|
+
import { StyleSheet, Text, View, } from "react-native";
|
|
4
|
+
import { colors } from "../constants/colors";
|
|
5
|
+
import { commonStyles } from "../constants/commonStyles";
|
|
6
|
+
import { typography } from "../constants/typography";
|
|
7
|
+
import { useMergeRefs } from "../hooks/useMergeRefs";
|
|
8
|
+
import { isNotNullish } from "../utils/nullish";
|
|
9
|
+
import { Box } from "./Box";
|
|
10
|
+
import { Icon } from "./Icon";
|
|
11
|
+
import { InputError } from "./InputError";
|
|
12
|
+
import { Label } from "./Label";
|
|
13
|
+
import { PressableTextInput } from "./Pressable";
|
|
14
|
+
import { Space } from "./Space";
|
|
15
|
+
const styles = StyleSheet.create({
|
|
16
|
+
base: {
|
|
17
|
+
...typography.bodyLarge,
|
|
18
|
+
lineHeight: typography.bodyLarge.fontSize,
|
|
19
|
+
backgroundColor: colors.white,
|
|
20
|
+
borderColor: colors.gray[10],
|
|
21
|
+
borderRadius: 4,
|
|
22
|
+
borderWidth: 1,
|
|
23
|
+
flexGrow: 1,
|
|
24
|
+
flexShrink: 1,
|
|
25
|
+
height: 48,
|
|
26
|
+
maxWidth: "100%",
|
|
27
|
+
outlineStyle: "none",
|
|
28
|
+
paddingHorizontal: 16,
|
|
29
|
+
placeholderTextColor: colors.gray[30],
|
|
30
|
+
textOverflow: "ellipsis",
|
|
31
|
+
transitionDuration: "150ms",
|
|
32
|
+
transitionProperty: ["border-color", "box-shadow"],
|
|
33
|
+
whiteSpace: "nowrap",
|
|
34
|
+
wordBreak: "keep-all",
|
|
35
|
+
},
|
|
36
|
+
small: {
|
|
37
|
+
height: 40,
|
|
38
|
+
},
|
|
39
|
+
focused: {
|
|
40
|
+
borderColor: colors.gray[20],
|
|
41
|
+
shadowColor: colors.gray[100],
|
|
42
|
+
shadowOpacity: 0.12,
|
|
43
|
+
shadowOffset: { height: 0, width: 0 },
|
|
44
|
+
shadowRadius: 2,
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
backgroundColor: colors.gray[3],
|
|
48
|
+
borderColor: colors.gray[3],
|
|
49
|
+
cursor: "not-allowed",
|
|
50
|
+
},
|
|
51
|
+
hovered: {
|
|
52
|
+
shadowColor: colors.gray[100],
|
|
53
|
+
shadowOpacity: 0.06,
|
|
54
|
+
shadowOffset: { height: 4, width: 0 },
|
|
55
|
+
shadowRadius: 8,
|
|
56
|
+
},
|
|
57
|
+
leftIcon: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
left: 16,
|
|
60
|
+
},
|
|
61
|
+
withLeftIcon: {
|
|
62
|
+
paddingLeft: 48,
|
|
63
|
+
},
|
|
64
|
+
withSuffix: {
|
|
65
|
+
borderBottomRightRadius: 0,
|
|
66
|
+
borderTopRightRadius: 0,
|
|
67
|
+
},
|
|
68
|
+
rightIcon: {
|
|
69
|
+
position: "absolute",
|
|
70
|
+
right: 16,
|
|
71
|
+
},
|
|
72
|
+
errored: {
|
|
73
|
+
borderColor: colors.red[100],
|
|
74
|
+
paddingRight: 48,
|
|
75
|
+
},
|
|
76
|
+
successful: {
|
|
77
|
+
borderColor: colors.green[100],
|
|
78
|
+
paddingRight: 48,
|
|
79
|
+
},
|
|
80
|
+
suffix: {
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
backgroundColor: colors.gray[3],
|
|
83
|
+
borderBottomRightRadius: 4,
|
|
84
|
+
borderTopRightRadius: 4,
|
|
85
|
+
borderColor: colors.gray[10],
|
|
86
|
+
borderLeftWidth: 0,
|
|
87
|
+
borderWidth: 1,
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
paddingHorizontal: 16,
|
|
90
|
+
},
|
|
91
|
+
suffixDisabled: {
|
|
92
|
+
borderWidth: 0,
|
|
93
|
+
},
|
|
94
|
+
suffixText: {
|
|
95
|
+
...typography.bodyLarge,
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
export const Input = memo(forwardRef(({ accessibilityControls, accessibilityExpanded, disabled = false, error, icon, inputContainerStyle, role, keyboardType, returnKeyType, maxLength, label = "", onFocus, onBlur, onSubmitEditing, onChange, onValueChange, onKeyPress, placeholder, readOnly = false, size = "large", successful = false, suffix = "", value = "", style, inputStyle, RightComponent = null, hideErrorMessage = false, }, forwardedRef) => {
|
|
99
|
+
const ref = useRef(null);
|
|
100
|
+
const mergedRef = useMergeRefs(ref, forwardedRef);
|
|
101
|
+
const labelId = `label-${useId()}`;
|
|
102
|
+
const id = `input-${useId()}`;
|
|
103
|
+
const errored = isNotNullish(error);
|
|
104
|
+
return (_jsxs(View, { style: style, children: [label !== "" && (_jsxs(_Fragment, { children: [_jsx(Label, { id: labelId, htmlFor: id, children: label }), _jsx(Space, { height: 8 })] })), _jsxs(Box, { direction: "row", style: inputContainerStyle, children: [_jsxs(Box, { direction: "row", alignItems: "center", style: commonStyles.fill, children: [_jsx(PressableTextInput, { ref: mergedRef, accessibilityControls: accessibilityControls, accessibilityExpanded: accessibilityExpanded, accessibilityLabelledBy: labelId, nativeID: id, allowFontScaling: false, autoComplete: "off", accessibilityRole: role, editable: !readOnly && !disabled, keyboardType: keyboardType, returnKeyType: returnKeyType, multiline: false, numberOfLines: 1, maxLength: maxLength, onFocus: onFocus, onBlur: onBlur, onChange: onChange, onChangeText: onValueChange, onSubmitEditing: onSubmitEditing, onKeyPress: onKeyPress, placeholder: placeholder, value: value, style: ({ hovered, focused }) => [
|
|
105
|
+
styles.base,
|
|
106
|
+
size === "small" && styles.small,
|
|
107
|
+
isNotNullish(icon) && styles.withLeftIcon,
|
|
108
|
+
suffix !== "" && styles.withSuffix,
|
|
109
|
+
disabled ? styles.disabled : focused ? styles.focused : hovered && styles.hovered,
|
|
110
|
+
errored && styles.errored,
|
|
111
|
+
successful && styles.successful,
|
|
112
|
+
inputStyle,
|
|
113
|
+
] }), icon && (_jsx(Icon, { name: icon, color: colors.gray[50], size: 20, style: styles.leftIcon })), successful ? (_jsx(Icon, { name: "checkmark-filled", color: colors.green[100], size: 20, style: styles.rightIcon })) : errored ? (_jsx(Icon, { name: "error-circle-regular", size: 20, color: colors.red[100], style: styles.rightIcon })) : null] }), suffix !== "" && (_jsx(View, { style: [styles.suffix, disabled && styles.suffixDisabled], children: _jsx(Text, { numberOfLines: 1, style: styles.suffixText, children: suffix }) })), Boolean(RightComponent) && (_jsxs(_Fragment, { children: [_jsx(Space, { width: 8 }), RightComponent] }))] }), !hideErrorMessage && _jsx(InputError, { message: error })] }));
|
|
114
|
+
}));
|
|
115
|
+
Input.displayName = "Input";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, Text } from "react-native";
|
|
3
|
+
import { colors } from "../constants/colors";
|
|
4
|
+
import { typography } from "../constants/typography";
|
|
5
|
+
import { Space } from "./Space";
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
base: {
|
|
8
|
+
...typography.bodySmall,
|
|
9
|
+
color: colors.red[100],
|
|
10
|
+
lineHeight: typography.lineHeights.input,
|
|
11
|
+
minHeight: 32,
|
|
12
|
+
paddingHorizontal: 3,
|
|
13
|
+
paddingVertical: 4,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const InputError = ({ message = "", style }) => message !== "" ? _jsx(Text, { style: [styles.base, style], children: message }) : _jsx(Space, { height: 32 });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { TextProps } from "react-native";
|
|
3
|
+
import { Except } from "type-fest";
|
|
4
|
+
type Props = Except<TextProps, "accessibilityRole"> & {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
htmlFor?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const Label: ({ htmlFor, id, style, ...props }: Props) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import { StyleSheet, Text } from "react-native";
|
|
4
|
+
import { colors } from "../constants/colors";
|
|
5
|
+
import { typography } from "../constants/typography";
|
|
6
|
+
import { useNativeProp } from "../hooks/useNativeProp";
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
base: {
|
|
9
|
+
...typography.bodyLarge,
|
|
10
|
+
color: colors.gray[60],
|
|
11
|
+
lineHeight: typography.lineHeights.title,
|
|
12
|
+
paddingHorizontal: 3, // borderRadius / 2
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const Label = ({ htmlFor, id, style, ...props }) => {
|
|
16
|
+
const ref = useRef(null);
|
|
17
|
+
useNativeProp(ref, "for", htmlFor);
|
|
18
|
+
return (_jsx(Text, { ref: ref, nativeID: id, accessibilityRole: "label", style: [styles.base, style], ...props }));
|
|
19
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
type AlertVariant = "info" | "warning" | "error" | "success";
|
|
4
|
+
type Props = {
|
|
5
|
+
anchored?: boolean;
|
|
6
|
+
variant: AlertVariant;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
callToAction?: ReactNode;
|
|
9
|
+
title: ReactNode;
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
};
|
|
13
|
+
export declare const LakeAlert: ({ anchored, variant, title, subtitle, children, style, callToAction, }: Props) => JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { commonStyles } from "../constants/commonStyles";
|
|
4
|
+
import { colors, shadows } from "../constants/design";
|
|
5
|
+
import { isNotNullish, isNotNullishOrEmpty } from "../utils/nullish";
|
|
6
|
+
import { Box } from "./Box";
|
|
7
|
+
import { Icon } from "./Icon";
|
|
8
|
+
import { LakeText } from "./LakeText";
|
|
9
|
+
import { Space } from "./Space";
|
|
10
|
+
const styles = StyleSheet.create({
|
|
11
|
+
base: {
|
|
12
|
+
paddingVertical: 20,
|
|
13
|
+
paddingHorizontal: 24,
|
|
14
|
+
borderRadius: 4,
|
|
15
|
+
borderWidth: 0.5,
|
|
16
|
+
borderLeftWidth: 4,
|
|
17
|
+
boxShadow: shadows.tile,
|
|
18
|
+
},
|
|
19
|
+
anchored: {
|
|
20
|
+
borderTopLeftRadius: 0,
|
|
21
|
+
borderTopRightRadius: 0,
|
|
22
|
+
borderLeftWidth: 0.5,
|
|
23
|
+
marginHorizontal: -1,
|
|
24
|
+
marginBottom: -1,
|
|
25
|
+
},
|
|
26
|
+
content: {
|
|
27
|
+
marginLeft: 40,
|
|
28
|
+
},
|
|
29
|
+
callToAction: {
|
|
30
|
+
marginTop: -12,
|
|
31
|
+
marginBottom: -12,
|
|
32
|
+
marginRight: -12,
|
|
33
|
+
flexShrink: 0,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
const alertIcon = {
|
|
37
|
+
info: "info-regular",
|
|
38
|
+
warning: "warning-regular",
|
|
39
|
+
error: "dismiss-circle-regular",
|
|
40
|
+
success: "checkmark-circle-regular",
|
|
41
|
+
};
|
|
42
|
+
const alertColor = {
|
|
43
|
+
info: colors.shakespear[700],
|
|
44
|
+
warning: colors.warning[700],
|
|
45
|
+
error: colors.negative[700],
|
|
46
|
+
success: colors.positive[700],
|
|
47
|
+
};
|
|
48
|
+
const alertBackground = {
|
|
49
|
+
info: colors.shakespear[0],
|
|
50
|
+
warning: colors.warning[0],
|
|
51
|
+
error: colors.negative[0],
|
|
52
|
+
success: colors.positive[0],
|
|
53
|
+
};
|
|
54
|
+
const alertBorder = {
|
|
55
|
+
info: colors.shakespear[200],
|
|
56
|
+
warning: colors.warning[200],
|
|
57
|
+
error: colors.negative[200],
|
|
58
|
+
success: colors.positive[200],
|
|
59
|
+
};
|
|
60
|
+
const alertLeftBorder = {
|
|
61
|
+
info: colors.shakespear[500],
|
|
62
|
+
warning: colors.warning[500],
|
|
63
|
+
error: colors.negative[500],
|
|
64
|
+
success: colors.positive[500],
|
|
65
|
+
};
|
|
66
|
+
const isText = (node) => typeof node === "string" || typeof node === "number";
|
|
67
|
+
export const LakeAlert = ({ anchored = false, variant, title, subtitle, children, style, callToAction, }) => {
|
|
68
|
+
const color = alertColor[variant];
|
|
69
|
+
return (_jsxs(View, { style: [
|
|
70
|
+
styles.base,
|
|
71
|
+
{ backgroundColor: alertBackground[variant], borderColor: alertBorder[variant] },
|
|
72
|
+
anchored ? styles.anchored : { borderLeftColor: alertLeftBorder[variant] },
|
|
73
|
+
style,
|
|
74
|
+
], children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Icon, { name: alertIcon[variant], color: color, size: 20 }), _jsx(Space, { width: 20 }), _jsxs(View, { style: commonStyles.fill, children: [_jsx(LakeText, { color: color, children: title }), isNotNullishOrEmpty(subtitle) && _jsx(LakeText, { color: color, children: subtitle })] }), isNotNullish(callToAction) && _jsx(View, { style: styles.callToAction, children: callToAction })] }), isNotNullish(children) && (_jsxs(View, { style: styles.content, children: [_jsx(Space, { height: 12 }), isText(children) ? _jsx(LakeText, { children: children }) : children] }))] }));
|
|
75
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { GestureResponderEvent, PressableStateCallbackType, StyleProp, View, ViewStyle } from "react-native";
|
|
3
|
+
import { ColorVariants, Spacings } from "../constants/design";
|
|
4
|
+
import { IconName } from "./Icon";
|
|
5
|
+
export type ButtonProps = {
|
|
6
|
+
accessibilityControls?: string;
|
|
7
|
+
accessibilityExpanded?: boolean;
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
color?: ColorVariants;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
grow?: boolean;
|
|
14
|
+
icon?: IconName;
|
|
15
|
+
iconPosition?: "start" | "end";
|
|
16
|
+
mode?: "primary" | "secondary" | "tertiary";
|
|
17
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
18
|
+
size?: "large" | "small";
|
|
19
|
+
style?: StyleProp<ViewStyle> | ((props: PressableStateCallbackType) => StyleProp<ViewStyle>);
|
|
20
|
+
forceBackground?: boolean;
|
|
21
|
+
href?: string;
|
|
22
|
+
hrefAttrs?: {
|
|
23
|
+
download?: boolean;
|
|
24
|
+
rel?: string;
|
|
25
|
+
target?: string;
|
|
26
|
+
};
|
|
27
|
+
pill?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export declare const LakeButton: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<View>>>;
|
|
30
|
+
type GroupProps = {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
justifyContent?: ViewStyle["justifyContent"];
|
|
33
|
+
paddingBottom?: 0 | Spacings;
|
|
34
|
+
};
|
|
35
|
+
export declare const LakeButtonGroup: ({ children, justifyContent, paddingBottom, }: GroupProps) => JSX.Element;
|
|
36
|
+
export {};
|