@ovotech/element-native 2.2.0-canary-668a0ee-91 → 2.2.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/dist/components/Accordion/Accordion.d.ts +2 -2
- package/dist/components/Accordion/Accordion.js +24 -21
- package/dist/components/Accordion/Group.js +32 -10
- package/dist/components/Accordion/Icon.js +14 -19
- package/dist/components/Accordion/hooks.d.ts +1 -1
- package/dist/components/Accordion/hooks.js +26 -3
- package/dist/components/Accordion/styles.d.ts +46 -688
- package/dist/components/Accordion/styles.js +49 -56
- package/dist/components/Badge/Badge.d.ts +46 -54
- package/dist/components/Badge/Badge.js +20 -35
- package/dist/components/CTAButton/CTAButton.d.ts +12 -7
- package/dist/components/CTAButton/CTAButton.js +27 -23
- package/dist/components/CTALink/CTALink.d.ts +4 -4
- package/dist/components/CTALink/CTALink.js +27 -5
- package/dist/components/Card/Card.d.ts +45 -47
- package/dist/components/Card/Card.js +25 -5
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/Checkbox/Checkbox.js +57 -18
- package/dist/components/Checkbox/CheckboxField.js +37 -7
- package/dist/components/DataTable/DataTable.d.ts +12 -3
- package/dist/components/DataTable/DataTable.js +98 -11
- package/dist/components/DataTable/index.d.ts +0 -2
- package/dist/components/DataTable/index.js +0 -16
- package/dist/components/DateField/DateField.d.ts +2 -2
- package/dist/components/DateField/DateField.js +28 -9
- package/dist/components/DescriptionList/DescriptionList.js +32 -8
- package/dist/components/DescriptionList/styled.d.ts +44 -50
- package/dist/components/DescriptionList/styled.js +34 -9
- package/dist/components/Disclosure/Disclosure.d.ts +3 -3
- package/dist/components/Disclosure/Disclosure.js +18 -12
- package/dist/components/Divider/Divider.js +7 -4
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.d.ts +1 -1
- package/dist/components/ErrorSummaryNotification/ErrorSummaryNotification.js +28 -6
- package/dist/components/ErrorText/ErrorText.d.ts +39 -45
- package/dist/components/ErrorText/ErrorText.js +4 -7
- package/dist/components/Field/Field.d.ts +2 -2
- package/dist/components/Field/Field.js +49 -18
- package/dist/components/FormGroup/FormGroup.js +3 -2
- package/dist/components/Grid/Col.d.ts +39 -45
- package/dist/components/Grid/Col.js +3 -4
- package/dist/components/Grid/Row.d.ts +41 -47
- package/dist/components/Grid/Row.js +10 -7
- package/dist/components/Heading/Heading.js +32 -21
- package/dist/components/HintText/HintText.d.ts +39 -45
- package/dist/components/HintText/HintText.js +4 -7
- package/dist/components/Icon/Icon.d.ts +4 -3
- package/dist/components/Icon/Icon.js +27 -5
- package/dist/components/Input/CurrencyInput.d.ts +6 -6
- package/dist/components/Input/CurrencyInput.js +25 -3
- package/dist/components/Input/EmailInput.d.ts +6 -6
- package/dist/components/Input/EmailInput.js +25 -3
- package/dist/components/Input/Input.d.ts +8 -8
- package/dist/components/Input/Input.js +32 -26
- package/dist/components/Input/NumberInput.d.ts +6 -6
- package/dist/components/Input/NumberInput.js +25 -3
- package/dist/components/Input/PasswordInput.d.ts +6 -6
- package/dist/components/Input/PasswordInput.js +25 -3
- package/dist/components/Input/PasswordInput.styled.d.ts +39 -45
- package/dist/components/Input/PasswordInput.styled.js +5 -2
- package/dist/components/Input/PasswordVisibilityToggle.js +29 -14
- package/dist/components/Input/TelInput.d.ts +10 -0
- package/dist/components/Input/TelInput.js +41 -0
- package/dist/components/Input/TextInput.d.ts +6 -6
- package/dist/components/Input/TextInput.js +25 -3
- package/dist/components/Input/TextareaInput.d.ts +6 -6
- package/dist/components/Input/TextareaInput.js +10 -13
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/LabelText/LabelText.d.ts +39 -45
- package/dist/components/LabelText/LabelText.js +4 -5
- package/dist/components/List/List.d.ts +131 -149
- package/dist/components/List/List.js +44 -30
- package/dist/components/Margin/Margin.d.ts +39 -45
- package/dist/components/Margin/Margin.js +3 -3
- package/dist/components/NavHeader/NavHeader.d.ts +1 -1
- package/dist/components/NavHeader/NavHeader.js +35 -34
- package/dist/components/Notification/Notification.d.ts +100 -104
- package/dist/components/Notification/Notification.js +49 -32
- package/dist/components/Radio/Radio.d.ts +3 -3
- package/dist/components/Radio/Radio.js +61 -16
- package/dist/components/Radio/RadioField.js +41 -11
- package/dist/components/SkeletonLoading/Skeleton.d.ts +39 -45
- package/dist/components/SkeletonLoading/SkeletonAnimation.js +33 -22
- package/dist/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/components/Stack/Stack.js +28 -6
- package/dist/components/Stretch/Stretch.js +2 -2
- package/dist/components/SubLabelText/SubLabelText.d.ts +39 -45
- package/dist/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/components/SummaryList/SummaryList.js +32 -8
- package/dist/components/Tabs/Tab.d.ts +4 -4
- package/dist/components/Tabs/Tab.js +20 -23
- package/dist/components/Tabs/TabList.d.ts +222 -11
- package/dist/components/Tabs/TabList.js +18 -22
- package/dist/components/Tabs/TabPanel.js +10 -33
- package/dist/components/Tabs/Tabs.d.ts +227 -8
- package/dist/components/Tabs/Tabs.js +23 -26
- package/dist/components/Text/Text.d.ts +204 -234
- package/dist/components/Text/Text.js +20 -17
- package/dist/components/TextField/CurrencyField.d.ts +6 -6
- package/dist/components/TextField/CurrencyField.js +26 -3
- package/dist/components/TextField/EmailField.d.ts +6 -6
- package/dist/components/TextField/EmailField.js +26 -3
- package/dist/components/TextField/NumberField.d.ts +6 -6
- package/dist/components/TextField/NumberField.js +26 -3
- package/dist/components/TextField/PasswordField.d.ts +6 -6
- package/dist/components/TextField/PasswordField.js +26 -3
- package/dist/components/TextField/TelField.d.ts +6 -10
- package/dist/components/TextField/TelField.js +27 -9
- package/dist/components/TextField/TextField.d.ts +6 -6
- package/dist/components/TextField/TextField.js +26 -3
- package/dist/components/TextField/TextareaField.d.ts +6 -6
- package/dist/components/TextField/TextareaField.js +26 -3
- package/dist/components/TextField/index.d.ts +0 -1
- package/dist/components/TextField/index.js +1 -3
- package/dist/components/TextLink/TextLink.d.ts +4 -4
- package/dist/components/TextLink/TextLink.js +8 -5
- package/dist/components/index.d.ts +0 -1
- package/dist/components/index.js +0 -1
- package/dist/esm/components/Accordion/Accordion.js +26 -23
- package/dist/esm/components/Accordion/Group.js +9 -10
- package/dist/esm/components/Accordion/Icon.js +12 -20
- package/dist/esm/components/Accordion/hooks.js +3 -3
- package/dist/esm/components/Accordion/styles.js +48 -29
- package/dist/esm/components/Badge/Badge.js +17 -35
- package/dist/esm/components/CTAButton/CTAButton.js +28 -24
- package/dist/esm/components/CTALink/CTALink.js +4 -5
- package/dist/esm/components/Card/Card.js +25 -5
- package/dist/esm/components/Checkbox/Checkbox.js +34 -15
- package/dist/esm/components/Checkbox/CheckboxField.js +14 -7
- package/dist/esm/components/DataTable/DataTable.js +74 -10
- package/dist/esm/components/DataTable/index.js +0 -2
- package/dist/esm/components/DateField/DateField.js +28 -9
- package/dist/esm/components/DescriptionList/DescriptionList.js +9 -8
- package/dist/esm/components/DescriptionList/styled.js +31 -9
- package/dist/esm/components/Disclosure/Disclosure.js +19 -13
- package/dist/esm/components/Divider/Divider.js +4 -4
- package/dist/esm/components/ErrorSummaryNotification/ErrorSummaryNotification.js +5 -6
- package/dist/esm/components/ErrorText/ErrorText.js +4 -7
- package/dist/esm/components/Field/Field.js +26 -18
- package/dist/esm/components/FormGroup/FormGroup.js +3 -2
- package/dist/esm/components/Grid/Col.js +3 -4
- package/dist/esm/components/Grid/Row.js +7 -7
- package/dist/esm/components/Heading/Heading.js +29 -21
- package/dist/esm/components/HintText/HintText.js +4 -7
- package/dist/esm/components/Icon/Icon.js +4 -5
- package/dist/esm/components/Input/CurrencyInput.js +2 -3
- package/dist/esm/components/Input/EmailInput.js +2 -3
- package/dist/esm/components/Input/Input.js +33 -27
- package/dist/esm/components/Input/NumberInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.js +2 -3
- package/dist/esm/components/Input/PasswordInput.styled.js +5 -2
- package/dist/esm/components/Input/PasswordVisibilityToggle.js +7 -15
- package/dist/esm/components/Input/{PhoneInput.js → TelInput.js} +3 -4
- package/dist/esm/components/Input/TextInput.js +2 -3
- package/dist/esm/components/Input/TextareaInput.js +10 -13
- package/dist/esm/components/Input/index.js +1 -1
- package/dist/esm/components/LabelText/LabelText.js +4 -5
- package/dist/esm/components/List/List.js +45 -31
- package/dist/esm/components/Margin/Margin.js +3 -3
- package/dist/esm/components/NavHeader/NavHeader.js +32 -34
- package/dist/esm/components/Notification/Notification.js +50 -33
- package/dist/esm/components/Radio/Radio.js +38 -16
- package/dist/esm/components/Radio/RadioField.js +18 -11
- package/dist/esm/components/SkeletonLoading/SkeletonAnimation.js +11 -23
- package/dist/esm/components/SkeletonLoading/SkeletonCTA.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonCircle.js +6 -4
- package/dist/esm/components/SkeletonLoading/SkeletonHeading.js +5 -4
- package/dist/esm/components/SkeletonLoading/SkeletonText.js +5 -5
- package/dist/esm/components/Stack/Stack.js +5 -6
- package/dist/esm/components/Stretch/Stretch.js +2 -2
- package/dist/esm/components/SubLabelText/SubLabelText.js +4 -5
- package/dist/esm/components/SummaryList/SummaryList.js +9 -8
- package/dist/esm/components/Tabs/Tab.js +17 -23
- package/dist/esm/components/Tabs/TabList.js +18 -21
- package/dist/esm/components/Tabs/TabPanel.js +7 -10
- package/dist/esm/components/Tabs/Tabs.js +23 -25
- package/dist/esm/components/Text/Text.js +20 -17
- package/dist/esm/components/TextField/CurrencyField.js +3 -3
- package/dist/esm/components/TextField/EmailField.js +3 -3
- package/dist/esm/components/TextField/NumberField.js +3 -3
- package/dist/esm/components/TextField/PasswordField.js +3 -3
- package/dist/esm/components/TextField/TelField.js +4 -9
- package/dist/esm/components/TextField/TextField.js +3 -3
- package/dist/esm/components/TextField/TextareaField.js +3 -3
- package/dist/esm/components/TextField/index.js +0 -1
- package/dist/esm/components/TextLink/TextLink.js +8 -5
- package/dist/esm/components/index.js +0 -1
- package/dist/esm/hooks/use-breakpoint.js +4 -4
- package/dist/esm/providers/IconsProvider.js +2 -3
- package/dist/esm/providers/icons/ArrowDown.js +3 -2
- package/dist/esm/providers/icons/ArrowLeft.js +3 -2
- package/dist/esm/providers/icons/ArrowRight.js +3 -2
- package/dist/esm/providers/icons/ArrowUp.js +3 -2
- package/dist/esm/providers/icons/CaretDown.js +3 -2
- package/dist/esm/providers/icons/CaretLeft.js +3 -2
- package/dist/esm/providers/icons/CaretRight.js +3 -2
- package/dist/esm/providers/icons/CaretUp.js +3 -2
- package/dist/esm/providers/icons/Chart.js +3 -2
- package/dist/esm/providers/icons/Check.js +3 -2
- package/dist/esm/providers/icons/ChevronDown.js +3 -2
- package/dist/esm/providers/icons/ChevronLeft.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronLeftSmallFirst.js +3 -2
- package/dist/esm/providers/icons/ChevronRight.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmall.js +3 -2
- package/dist/esm/providers/icons/ChevronRightSmallLast.js +3 -2
- package/dist/esm/providers/icons/ChevronUp.js +3 -2
- package/dist/esm/providers/icons/Cross.js +3 -2
- package/dist/esm/providers/icons/Dollar.js +3 -2
- package/dist/esm/providers/icons/Download.js +3 -2
- package/dist/esm/providers/icons/Electricity.js +3 -2
- package/dist/esm/providers/icons/Euro.js +3 -2
- package/dist/esm/providers/icons/Gas.js +4 -2
- package/dist/esm/providers/icons/Help.js +3 -2
- package/dist/esm/providers/icons/Hide.js +3 -2
- package/dist/esm/providers/icons/Home.js +3 -2
- package/dist/esm/providers/icons/Info.js +3 -2
- package/dist/esm/providers/icons/Link.js +4 -2
- package/dist/esm/providers/icons/Logo.js +4 -3
- package/dist/esm/providers/icons/Minus.js +3 -2
- package/dist/esm/providers/icons/NewWindow.js +3 -2
- package/dist/esm/providers/icons/PaymentCard.js +3 -2
- package/dist/esm/providers/icons/Plus.js +3 -2
- package/dist/esm/providers/icons/Pound.js +3 -2
- package/dist/esm/providers/icons/Search.js +3 -2
- package/dist/esm/providers/icons/Show.js +3 -2
- package/dist/esm/providers/icons/User.js +3 -2
- package/dist/esm/theme/create-theme.js +153 -0
- package/dist/esm/utils/utils.js +3 -7
- package/dist/hooks/use-breakpoint.js +4 -4
- package/dist/providers/IconsProvider.js +25 -3
- package/dist/providers/icons/ArrowDown.js +6 -2
- package/dist/providers/icons/ArrowLeft.js +6 -2
- package/dist/providers/icons/ArrowRight.js +6 -2
- package/dist/providers/icons/ArrowUp.js +6 -2
- package/dist/providers/icons/CaretDown.js +6 -2
- package/dist/providers/icons/CaretLeft.js +6 -2
- package/dist/providers/icons/CaretRight.js +6 -2
- package/dist/providers/icons/CaretUp.js +6 -2
- package/dist/providers/icons/Chart.js +6 -2
- package/dist/providers/icons/Check.js +6 -2
- package/dist/providers/icons/ChevronDown.js +6 -2
- package/dist/providers/icons/ChevronLeft.js +6 -2
- package/dist/providers/icons/ChevronLeftSmall.js +6 -2
- package/dist/providers/icons/ChevronLeftSmallFirst.js +6 -2
- package/dist/providers/icons/ChevronRight.js +6 -2
- package/dist/providers/icons/ChevronRightSmall.js +6 -2
- package/dist/providers/icons/ChevronRightSmallLast.js +6 -2
- package/dist/providers/icons/ChevronUp.js +6 -2
- package/dist/providers/icons/Cross.js +6 -2
- package/dist/providers/icons/Dollar.js +6 -2
- package/dist/providers/icons/Download.js +6 -2
- package/dist/providers/icons/Electricity.js +6 -2
- package/dist/providers/icons/Euro.js +6 -2
- package/dist/providers/icons/Gas.js +7 -2
- package/dist/providers/icons/Help.js +6 -2
- package/dist/providers/icons/Hide.js +6 -2
- package/dist/providers/icons/Home.js +6 -2
- package/dist/providers/icons/Info.js +6 -2
- package/dist/providers/icons/Link.js +7 -2
- package/dist/providers/icons/Logo.js +6 -2
- package/dist/providers/icons/Minus.js +6 -2
- package/dist/providers/icons/NewWindow.js +6 -2
- package/dist/providers/icons/PaymentCard.js +6 -2
- package/dist/providers/icons/Plus.js +6 -2
- package/dist/providers/icons/Pound.js +6 -2
- package/dist/providers/icons/Search.js +6 -2
- package/dist/providers/icons/Show.js +6 -2
- package/dist/providers/icons/User.js +6 -2
- package/dist/styled.native.d.ts +234 -270
- package/dist/theme/create-theme.js +153 -0
- package/dist/theme/index.d.ts +39 -45
- package/dist/theme/theme.d.ts +90 -0
- package/dist/utils/utils.d.ts +4 -5
- package/dist/utils/utils.js +26 -8
- package/package.json +5 -6
- package/dist/components/DataTable/TableRow.d.ts +0 -2
- package/dist/components/DataTable/TableRow.js +0 -31
- package/dist/components/DataTable/styles.d.ts +0 -2517
- package/dist/components/DataTable/styles.js +0 -77
- package/dist/components/DataTable/types.d.ts +0 -15
- package/dist/components/DataTable/types.js +0 -2
- package/dist/components/Input/PhoneInput.d.ts +0 -10
- package/dist/components/Input/PhoneInput.js +0 -19
- package/dist/components/SelectField/Select.d.ts +0 -244
- package/dist/components/SelectField/Select.js +0 -102
- package/dist/components/SelectField/SelectField.d.ts +0 -7
- package/dist/components/SelectField/SelectField.js +0 -33
- package/dist/components/SelectField/index.d.ts +0 -1
- package/dist/components/SelectField/index.js +0 -5
- package/dist/components/TextField/PhoneField.d.ts +0 -10
- package/dist/components/TextField/PhoneField.js +0 -33
- package/dist/esm/components/DataTable/TableRow.js +0 -27
- package/dist/esm/components/DataTable/styles.js +0 -51
- package/dist/esm/components/DataTable/types.js +0 -1
- package/dist/esm/components/SelectField/Select.js +0 -75
- package/dist/esm/components/SelectField/SelectField.js +0 -29
- package/dist/esm/components/SelectField/index.js +0 -1
- package/dist/esm/components/TextField/PhoneField.js +0 -30
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { ComponentProps, ReactNode } from 'react';
|
|
1
|
+
import React, { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
+
import { Breakpoints } from '../../hooks';
|
|
3
4
|
export declare type NotificationVariantName = 'error' | 'success' | 'info' | 'warning';
|
|
5
|
+
export declare type NotificationVariant = {
|
|
6
|
+
background: string;
|
|
7
|
+
borderColor: string;
|
|
8
|
+
textColor: string;
|
|
9
|
+
};
|
|
4
10
|
declare type NotificationProps = Omit<ComponentProps<typeof Notification>, 'variant'>;
|
|
5
11
|
export declare const NotificationContentBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
6
12
|
core: {
|
|
@@ -8,10 +14,10 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
8
14
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
9
15
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
10
16
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
11
|
-
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
|
17
|
+
space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
|
|
12
18
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
13
|
-
opacity: Record<"
|
|
14
|
-
color: Record<"
|
|
19
|
+
opacity: Record<"transparent" | "translucent" | "solid", string | number>;
|
|
20
|
+
color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
|
|
15
21
|
lightest: string;
|
|
16
22
|
lighter: string;
|
|
17
23
|
light: string;
|
|
@@ -27,53 +33,71 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
27
33
|
web: string;
|
|
28
34
|
}>;
|
|
29
35
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
30
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
36
|
+
fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
31
37
|
small: string | number;
|
|
32
38
|
large: string | number;
|
|
33
39
|
}>;
|
|
34
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
40
|
+
lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
35
41
|
small: string | number;
|
|
36
42
|
large: string | number;
|
|
37
43
|
}>;
|
|
38
|
-
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
39
44
|
};
|
|
40
45
|
semantic: {
|
|
41
46
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
42
47
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
43
48
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
44
|
-
focus: Record<"
|
|
45
|
-
inverted: Record<"
|
|
49
|
+
focus: Record<"outline" | "surface", string>;
|
|
50
|
+
inverted: Record<"surface" | "border", string> & {
|
|
46
51
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
47
52
|
};
|
|
48
53
|
success: {
|
|
49
54
|
border: string;
|
|
50
55
|
surface: string;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
message: {
|
|
57
|
+
base: string;
|
|
58
|
+
secondary: string;
|
|
59
|
+
};
|
|
54
60
|
};
|
|
55
61
|
warning: {
|
|
56
62
|
border: string;
|
|
57
63
|
surface: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
64
|
+
message: {
|
|
65
|
+
base: string;
|
|
66
|
+
secondary: string;
|
|
67
|
+
};
|
|
61
68
|
};
|
|
62
69
|
error: {
|
|
63
70
|
border: string;
|
|
64
71
|
surface: string;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
message: {
|
|
73
|
+
base: string;
|
|
74
|
+
secondary: string;
|
|
75
|
+
};
|
|
68
76
|
};
|
|
69
77
|
info: {
|
|
70
78
|
border: string;
|
|
71
79
|
surface: string;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
message: {
|
|
81
|
+
base: string;
|
|
82
|
+
secondary: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
electricity: {
|
|
86
|
+
border: string;
|
|
87
|
+
surface: string;
|
|
88
|
+
message: {
|
|
89
|
+
base: string;
|
|
90
|
+
secondary: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
gas: {
|
|
94
|
+
border: string;
|
|
95
|
+
surface: string;
|
|
96
|
+
message: {
|
|
97
|
+
base: string;
|
|
98
|
+
secondary: string;
|
|
99
|
+
};
|
|
75
100
|
};
|
|
76
|
-
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
77
101
|
};
|
|
78
102
|
component: {
|
|
79
103
|
heading1: {
|
|
@@ -204,42 +228,20 @@ export declare const NotificationContentBox: import("styled-components").StyledC
|
|
|
204
228
|
backgroundFocused: string;
|
|
205
229
|
};
|
|
206
230
|
};
|
|
207
|
-
badge: {
|
|
208
|
-
variants: {
|
|
209
|
-
red: {
|
|
210
|
-
foreground: string;
|
|
211
|
-
background: string;
|
|
212
|
-
};
|
|
213
|
-
orange: {
|
|
214
|
-
foreground: string;
|
|
215
|
-
background: string;
|
|
216
|
-
};
|
|
217
|
-
yellow: {
|
|
218
|
-
foreground: string;
|
|
219
|
-
background: string;
|
|
220
|
-
};
|
|
221
|
-
green: {
|
|
222
|
-
foreground: string;
|
|
223
|
-
background: string;
|
|
224
|
-
};
|
|
225
|
-
blue: {
|
|
226
|
-
foreground: string;
|
|
227
|
-
background: string;
|
|
228
|
-
};
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
231
|
};
|
|
232
|
-
}, {
|
|
232
|
+
}, {
|
|
233
|
+
variant: NotificationVariantName | (string & {});
|
|
234
|
+
} & Breakpoints, never>;
|
|
233
235
|
export declare const NotificationTitleBox: import("styled-components").StyledComponent<typeof import("react-native").View, import("../../theme/theme").Theme & {
|
|
234
236
|
core: {
|
|
235
237
|
radius: Record<"small" | "medium" | "large" | "max", string>;
|
|
236
238
|
borderWidth: Record<"small" | "medium" | "large", string>;
|
|
237
239
|
breakpoint: Record<"small" | "medium" | "large", string | number>;
|
|
238
240
|
mediaQuery: Record<"small" | "medium" | "large", string>;
|
|
239
|
-
space: Record<0 | 2 | 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|
|
241
|
+
space: Record<0 | 2 | 1 | 10 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | 13 | 14 | 15, string>;
|
|
240
242
|
transition: Record<"medium" | "slow" | "fast", string>;
|
|
241
|
-
opacity: Record<"
|
|
242
|
-
color: Record<"
|
|
243
|
+
opacity: Record<"transparent" | "translucent" | "solid", string | number>;
|
|
244
|
+
color: Record<"sand" | "red" | "orange" | "yellow" | "lime" | "green" | "teal" | "blue" | "purple", {
|
|
243
245
|
lightest: string;
|
|
244
246
|
lighter: string;
|
|
245
247
|
light: string;
|
|
@@ -255,53 +257,71 @@ export declare const NotificationTitleBox: import("styled-components").StyledCom
|
|
|
255
257
|
web: string;
|
|
256
258
|
}>;
|
|
257
259
|
fontWeight: Record<"bold" | "book" | "black", string | number>;
|
|
258
|
-
fontSize: Record<"small" | "body" | "label" | "
|
|
260
|
+
fontSize: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
259
261
|
small: string | number;
|
|
260
262
|
large: string | number;
|
|
261
263
|
}>;
|
|
262
|
-
lineHeight: Record<"small" | "body" | "label" | "
|
|
264
|
+
lineHeight: Record<"small" | "body" | "label" | "heading1" | "heading2" | "heading3" | "heading4" | "lead", {
|
|
263
265
|
small: string | number;
|
|
264
266
|
large: string | number;
|
|
265
267
|
}>;
|
|
266
|
-
letterSpacing: Record<"base" | "compressed" | "extraCompressed", number>;
|
|
267
268
|
};
|
|
268
269
|
semantic: {
|
|
269
270
|
surface: Record<"base" | "cutout" | "elevated", string>;
|
|
270
271
|
message: Record<"base" | "link" | "error" | "secondary" | "branded", string>;
|
|
271
272
|
border: Record<"graphic" | "differentiated" | "functional", string>;
|
|
272
|
-
focus: Record<"
|
|
273
|
-
inverted: Record<"
|
|
273
|
+
focus: Record<"outline" | "surface", string>;
|
|
274
|
+
inverted: Record<"surface" | "border", string> & {
|
|
274
275
|
message: Record<"base" | "link" | "secondary" | "branded", string>;
|
|
275
276
|
};
|
|
276
277
|
success: {
|
|
277
278
|
border: string;
|
|
278
279
|
surface: string;
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
message: {
|
|
281
|
+
base: string;
|
|
282
|
+
secondary: string;
|
|
283
|
+
};
|
|
282
284
|
};
|
|
283
285
|
warning: {
|
|
284
286
|
border: string;
|
|
285
287
|
surface: string;
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
288
|
+
message: {
|
|
289
|
+
base: string;
|
|
290
|
+
secondary: string;
|
|
291
|
+
};
|
|
289
292
|
};
|
|
290
293
|
error: {
|
|
291
294
|
border: string;
|
|
292
295
|
surface: string;
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
message: {
|
|
297
|
+
base: string;
|
|
298
|
+
secondary: string;
|
|
299
|
+
};
|
|
296
300
|
};
|
|
297
301
|
info: {
|
|
298
302
|
border: string;
|
|
299
303
|
surface: string;
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
304
|
+
message: {
|
|
305
|
+
base: string;
|
|
306
|
+
secondary: string;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
electricity: {
|
|
310
|
+
border: string;
|
|
311
|
+
surface: string;
|
|
312
|
+
message: {
|
|
313
|
+
base: string;
|
|
314
|
+
secondary: string;
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
gas: {
|
|
318
|
+
border: string;
|
|
319
|
+
surface: string;
|
|
320
|
+
message: {
|
|
321
|
+
base: string;
|
|
322
|
+
secondary: string;
|
|
323
|
+
};
|
|
303
324
|
};
|
|
304
|
-
data: Record<"gas" | "branded" | "electric", Record<2 | 1 | 3 | 4, string>>;
|
|
305
325
|
};
|
|
306
326
|
component: {
|
|
307
327
|
heading1: {
|
|
@@ -432,46 +452,22 @@ export declare const NotificationTitleBox: import("styled-components").StyledCom
|
|
|
432
452
|
backgroundFocused: string;
|
|
433
453
|
};
|
|
434
454
|
};
|
|
435
|
-
badge: {
|
|
436
|
-
variants: {
|
|
437
|
-
red: {
|
|
438
|
-
foreground: string;
|
|
439
|
-
background: string;
|
|
440
|
-
};
|
|
441
|
-
orange: {
|
|
442
|
-
foreground: string;
|
|
443
|
-
background: string;
|
|
444
|
-
};
|
|
445
|
-
yellow: {
|
|
446
|
-
foreground: string;
|
|
447
|
-
background: string;
|
|
448
|
-
};
|
|
449
|
-
green: {
|
|
450
|
-
foreground: string;
|
|
451
|
-
background: string;
|
|
452
|
-
};
|
|
453
|
-
blue: {
|
|
454
|
-
foreground: string;
|
|
455
|
-
background: string;
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
};
|
|
459
455
|
};
|
|
460
456
|
}, {
|
|
461
|
-
variant: NotificationVariantName;
|
|
457
|
+
variant: NotificationVariantName | (string & {});
|
|
462
458
|
noMargin?: boolean | undefined;
|
|
463
|
-
|
|
464
|
-
}, never>;
|
|
465
|
-
export declare const Notification:
|
|
466
|
-
variant?: NotificationVariantName | undefined;
|
|
467
|
-
title
|
|
459
|
+
dismissable: boolean;
|
|
460
|
+
} & Breakpoints, never>;
|
|
461
|
+
export declare const Notification: React.ForwardRefExoticComponent<{
|
|
462
|
+
variant?: (string & {}) | NotificationVariantName | undefined;
|
|
463
|
+
title?: ReactNode | string;
|
|
468
464
|
noMargin?: boolean | undefined;
|
|
469
465
|
children?: ReactNode;
|
|
470
|
-
|
|
466
|
+
dismissable?: boolean | undefined;
|
|
471
467
|
onDismiss?: (() => void) | undefined;
|
|
472
|
-
} &
|
|
473
|
-
export declare const ErrorNotification:
|
|
474
|
-
export declare const SuccessNotification:
|
|
475
|
-
export declare const InfoNotification:
|
|
476
|
-
export declare const WarningNotification:
|
|
468
|
+
} & React.RefAttributes<View>>;
|
|
469
|
+
export declare const ErrorNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissable" | "onDismiss"> & React.RefAttributes<View>>;
|
|
470
|
+
export declare const SuccessNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissable" | "onDismiss"> & React.RefAttributes<View>>;
|
|
471
|
+
export declare const InfoNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissable" | "onDismiss"> & React.RefAttributes<View>>;
|
|
472
|
+
export declare const WarningNotification: React.ForwardRefExoticComponent<Pick<NotificationProps, "children" | "title" | "key" | "noMargin" | "dismissable" | "onDismiss"> & React.RefAttributes<View>>;
|
|
477
473
|
export {};
|
|
@@ -50,52 +50,69 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
52
|
exports.WarningNotification = exports.InfoNotification = exports.SuccessNotification = exports.ErrorNotification = exports.Notification = exports.NotificationTitleBox = exports.NotificationContentBox = void 0;
|
|
53
|
-
var
|
|
54
|
-
var react_1 = require("react");
|
|
53
|
+
var react_1 = __importStar(require("react"));
|
|
55
54
|
var react_native_1 = require("react-native");
|
|
55
|
+
var hooks_1 = require("../../hooks");
|
|
56
56
|
var styled_native_1 = __importStar(require("../../styled.native"));
|
|
57
57
|
var Icon_1 = require("../Icon");
|
|
58
|
+
var pxToNumber = function (value) { return parseInt(value.replace('px', '')); };
|
|
59
|
+
var numberToPx = function (value) { return "".concat(value, "px"); };
|
|
58
60
|
var NotificationBox = styled_native_1.default.View(function (_a) {
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
+
var _b = _a.theme, colors = _b.colors, notification = _b.notification, space = _b.space, variant = _a.variant, noMargin = _a.noMargin;
|
|
62
|
+
// @ts-ignore
|
|
63
|
+
var currentVariant = notification.variants[variant];
|
|
64
|
+
return (0, styled_native_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "], ["\n position: relative;\n border: ", " solid ", ";\n border-radius: ", ";\n margin-bottom: ", ";\n background-color: ", ";\n "])), notification.borderWidth, currentVariant.borderColor, notification.borderRadius, noMargin ? 0 : space[4], colors.canvas);
|
|
61
65
|
});
|
|
62
66
|
exports.NotificationContentBox = styled_native_1.default.View(function (_a) {
|
|
63
|
-
var
|
|
64
|
-
|
|
67
|
+
var _b = _a.theme, colors = _b.colors, _c = _b.notification, paddingX = _c.paddingX, paddingY = _c.paddingY, variants = _c.variants, smallAndUp = _a.smallAndUp, variant = _a.variant;
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
var currentVariant = variants[variant];
|
|
70
|
+
return (0, styled_native_1.css)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "], ["\n padding: ", " ", ";\n\n a {\n color: ", ";\n :hover {\n color: ", ";\n }\n }\n ul {\n list-style-type: square;\n }\n li {\n color: ", ";\n }\n "])), paddingX[smallAndUp ? 1 : 0], paddingY[smallAndUp ? 1 : 0], currentVariant.textColor, colors.body, currentVariant.textColor);
|
|
65
71
|
});
|
|
66
72
|
exports.NotificationTitleBox = styled_native_1.default.View(function (_a) {
|
|
67
|
-
var
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
var notification = _a.theme.notification, variant = _a.variant, dismissable = _a.dismissable, smallAndUp = _a.smallAndUp;
|
|
74
|
+
// @ts-ignore to support additional palettes.
|
|
75
|
+
var currentVariant = notification.variants[variant];
|
|
76
|
+
return (0, styled_native_1.css)(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "], ["\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n background-color: ", ";\n padding-top: ", ";\n padding-bottom: ", ";\n padding-left: ", ";\n padding-right: ", ";\n "])), currentVariant.background, notification.paddingX[smallAndUp ? 1 : 0], notification.paddingX[smallAndUp ? 1 : 0], notification.paddingY[smallAndUp ? 1 : 0], dismissable
|
|
77
|
+
? numberToPx(pxToNumber(notification.dismiss.touchSize) -
|
|
78
|
+
pxToNumber(notification.dismiss.size))
|
|
79
|
+
: notification.paddingY[smallAndUp ? 1 : 0]);
|
|
70
80
|
});
|
|
71
81
|
var NotificationTitleText = styled_native_1.default.Text(function (_a) {
|
|
72
|
-
var _b = _a.theme,
|
|
73
|
-
|
|
74
|
-
|
|
82
|
+
var _b = _a.theme, fonts = _b.fonts, responsiveFontSizes = _b.responsiveFontSizes, notification = _b.notification, variant = _a.variant;
|
|
83
|
+
// @ts-ignore
|
|
84
|
+
var currentVariant = notification.variants[variant];
|
|
85
|
+
return (0, styled_native_1.css)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "], ["\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n "])), currentVariant.textColor, fonts.bold, responsiveFontSizes.body[0]);
|
|
75
86
|
});
|
|
76
|
-
var DismissButton = styled_native_1.default.TouchableOpacity(function () {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var StyledIcon = (0, styled_native_1.default)(Icon_1.Icon)(function (_a) {
|
|
80
|
-
var semantic = _a.theme.semantic, variant = _a.variant;
|
|
81
|
-
var currentVariant = semantic[variant];
|
|
82
|
-
return (0, styled_native_1.css)(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), currentVariant.message);
|
|
87
|
+
var DismissButton = styled_native_1.default.TouchableOpacity(function (_a) {
|
|
88
|
+
var notification = _a.theme.notification;
|
|
89
|
+
return (0, styled_native_1.css)(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "], ["\n position: absolute;\n top: 0;\n right: 0;\n width: ", ";\n height: ", ";\n align-items: center;\n justify-content: center;\n "])), notification.dismiss.touchSize, notification.dismiss.touchSize);
|
|
83
90
|
});
|
|
84
91
|
exports.Notification = (0, react_1.forwardRef)(function (_a, ref) {
|
|
85
|
-
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin,
|
|
92
|
+
var _b = _a.variant, variant = _b === void 0 ? 'info' : _b, children = _a.children, title = _a.title, noMargin = _a.noMargin, dismissable = _a.dismissable, onDismiss = _a.onDismiss, rest = __rest(_a, ["variant", "children", "title", "noMargin", "dismissable", "onDismiss"]);
|
|
93
|
+
var breakpoints = (0, hooks_1.useBreakpoint)();
|
|
94
|
+
var theme = (0, react_1.useContext)(styled_native_1.ThemeContext);
|
|
86
95
|
var _c = (0, react_1.useState)(false), dismissed = _c[0], setDismissed = _c[1];
|
|
87
|
-
if (dismissed || !children) {
|
|
96
|
+
if (dismissed || (!title && !children)) {
|
|
88
97
|
return null;
|
|
89
98
|
}
|
|
90
|
-
return (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
return (react_1.default.createElement(react_native_1.View, __assign({ ref: ref }, rest),
|
|
100
|
+
react_1.default.createElement(NotificationBox, __assign({ variant: variant, noMargin: noMargin, testID: "nb-notification" }, breakpoints),
|
|
101
|
+
!!title ? (react_1.default.createElement(exports.NotificationTitleBox, __assign({ variant: variant, dismissable: dismissable }, breakpoints),
|
|
102
|
+
react_1.default.createElement(react_native_1.View, null, typeof title === 'string' ? (react_1.default.createElement(NotificationTitleText, { variant: variant }, title)) : (title)))) : null,
|
|
103
|
+
dismissable ? (react_1.default.createElement(DismissButton, { accessibilityLabel: "Dismiss", testID: "nb-notification-dismiss", onPress: function () {
|
|
104
|
+
setDismissed(true);
|
|
105
|
+
if (onDismiss) {
|
|
106
|
+
onDismiss();
|
|
107
|
+
}
|
|
108
|
+
} },
|
|
109
|
+
react_1.default.createElement(Icon_1.Icon, { name: theme.notification.dismiss.icon, size: theme.notification.dismiss.size,
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
color: theme.notification.variants[variant].textColor }))) : null,
|
|
112
|
+
children ? (react_1.default.createElement(exports.NotificationContentBox, __assign({ "data-testid": "el-notification-box", variant: variant }, breakpoints), children)) : null)));
|
|
96
113
|
});
|
|
97
|
-
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
98
|
-
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (
|
|
99
|
-
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return
|
|
100
|
-
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return
|
|
101
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5
|
|
114
|
+
exports.ErrorNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "error", title: "Oops, there\u2019s a problem\u2026" }, props))); });
|
|
115
|
+
exports.SuccessNotification = (0, react_1.forwardRef)(function (props, ref) { return (react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "success" }, props))); });
|
|
116
|
+
exports.InfoNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "info" }, props)); });
|
|
117
|
+
exports.WarningNotification = (0, react_1.forwardRef)(function (props, ref) { return react_1.default.createElement(exports.Notification, __assign({ ref: ref, variant: "warning" }, props)); });
|
|
118
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
import { TouchableOpacity, TouchableOpacityProps } from 'react-native';
|
|
3
|
-
declare const Radio:
|
|
3
|
+
declare const Radio: React.ForwardRefExoticComponent<Omit<TouchableOpacityProps, "children"> & {
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
value: string;
|
|
6
6
|
hint?: ReactNode;
|
|
@@ -8,5 +8,5 @@ declare const Radio: import("react").ForwardRefExoticComponent<Omit<TouchableOpa
|
|
|
8
8
|
invalid?: boolean | undefined;
|
|
9
9
|
onValueChange?: ((value?: string) => void) | undefined;
|
|
10
10
|
activeOpacity?: number | undefined;
|
|
11
|
-
} &
|
|
11
|
+
} & React.RefAttributes<TouchableOpacity>>;
|
|
12
12
|
export { Radio };
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
+
return cooked;
|
|
5
|
+
};
|
|
2
6
|
var __assign = (this && this.__assign) || function () {
|
|
3
7
|
__assign = Object.assign || function(t) {
|
|
4
8
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -10,6 +14,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
14
|
};
|
|
11
15
|
return __assign.apply(this, arguments);
|
|
12
16
|
};
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
13
40
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
41
|
var t = {};
|
|
15
42
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,42 +53,60 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
53
|
};
|
|
27
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
55
|
exports.Radio = void 0;
|
|
29
|
-
var
|
|
30
|
-
var react_1 = require("react");
|
|
56
|
+
var react_1 = __importStar(require("react"));
|
|
31
57
|
var react_native_1 = require("react-native");
|
|
32
58
|
var styled_native_1 = __importDefault(require("../../styled.native"));
|
|
59
|
+
var utils_1 = require("../../utils");
|
|
33
60
|
var HintText_1 = require("../HintText");
|
|
34
61
|
var LabelText_1 = require("../LabelText");
|
|
35
62
|
var StyledRadioInputWrapper = styled_native_1.default.View(function (_a) {
|
|
36
|
-
var
|
|
37
|
-
|
|
63
|
+
var radio = _a.theme.radio;
|
|
64
|
+
var radioSize = (0, utils_1.pxToNumber)(radio.size);
|
|
65
|
+
var gap = (0, utils_1.pxToNumber)(radio.gap);
|
|
66
|
+
return "\n width: ".concat(radioSize + gap, "px;\n height: ").concat(radio.touchSize, ";\n ");
|
|
38
67
|
});
|
|
39
68
|
var StyledRadioInput = styled_native_1.default.View(function (_a) {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
var radio = _a.theme.radio, invalid = _a.invalid, checked = _a.checked;
|
|
70
|
+
var touchSize = (0, utils_1.pxToNumber)(radio.touchSize);
|
|
71
|
+
var radioSize = (0, utils_1.pxToNumber)(radio.size);
|
|
72
|
+
var radioDistance = (touchSize - radioSize) / 2;
|
|
73
|
+
return "\n width: ".concat(radio.size, ";\n height: ").concat(radio.size, ";\n border: ").concat(radio.borderWidth, " solid;\n margin-top: ").concat(radioDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n border-color: ").concat(invalid
|
|
74
|
+
? radio.errorColor
|
|
43
75
|
: checked
|
|
44
|
-
?
|
|
45
|
-
:
|
|
76
|
+
? radio.dotColor
|
|
77
|
+
: radio.borderColor, ";\n background: ").concat(radio.background, ";\n background: ").concat(checked ? radio.checkedBackground : radio.background, ";\n ");
|
|
46
78
|
});
|
|
47
79
|
var StyledRadioInputDot = styled_native_1.default.View(function (_a) {
|
|
48
|
-
var
|
|
49
|
-
|
|
80
|
+
var radio = _a.theme.radio, checked = _a.checked;
|
|
81
|
+
var radioSize = (0, utils_1.pxToNumber)(radio.size);
|
|
82
|
+
var dotSize = (0, utils_1.pxToNumber)(radio.dotSize);
|
|
83
|
+
var borderWidth = (0, utils_1.pxToNumber)(radio.borderWidth);
|
|
84
|
+
var dotDistance = (radioSize - dotSize) / 2 - borderWidth;
|
|
85
|
+
return "\n width: ".concat(radio.dotSize, ";\n height: ").concat(radio.dotSize, ";\n margin: ").concat(dotDistance, "px;\n border-radius: ").concat(radioSize / 2, "px;\n background: ").concat(radio.dotColor, ";\n opacity: ").concat(checked ? 1 : 0, ";\n ");
|
|
50
86
|
});
|
|
51
87
|
var Input = function (_a) {
|
|
52
88
|
var checked = _a.checked, invalid = _a.invalid, testID = _a.testID, rest = __rest(_a, ["checked", "invalid", "testID"]);
|
|
53
|
-
return (
|
|
89
|
+
return (react_1.default.createElement(StyledRadioInputWrapper, __assign({}, rest),
|
|
90
|
+
react_1.default.createElement(StyledRadioInput, { invalid: invalid, checked: checked, testID: testID },
|
|
91
|
+
react_1.default.createElement(StyledRadioInputDot, { checked: checked }))));
|
|
54
92
|
};
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
return "\n padding-top: ".concat(
|
|
93
|
+
var RadioLabelText = (0, styled_native_1.default)(LabelText_1.LabelText)(function (_a) {
|
|
94
|
+
var space = _a.theme.space;
|
|
95
|
+
return "\n padding-top: ".concat(space[3], ";\n ");
|
|
58
96
|
});
|
|
97
|
+
var StyledWrapper = styled_native_1.default.View(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex-direction: row;\n"], ["\n flex-direction: row;\n"])));
|
|
59
98
|
var Radio = (0, react_1.forwardRef)(function (_a, ref) {
|
|
60
99
|
var label = _a.label, hint = _a.hint, checked = _a.checked, invalid = _a.invalid,
|
|
61
100
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
62
101
|
value = _a.value, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
63
102
|
_b = _a.activeOpacity, // "value" is needed for RadioGroup, but isn't actually used in the radio anywhere
|
|
64
103
|
activeOpacity = _b === void 0 ? 0.8 : _b, testID = _a.testID, rest = __rest(_a, ["label", "hint", "checked", "invalid", "value", "activeOpacity", "testID"]);
|
|
65
|
-
return (
|
|
104
|
+
return (react_1.default.createElement(react_native_1.TouchableOpacity, __assign({ ref: ref, accessibilityRole: "radio", activeOpacity: activeOpacity, accessibilityState: { checked: checked } }, rest),
|
|
105
|
+
react_1.default.createElement(StyledWrapper, null,
|
|
106
|
+
react_1.default.createElement(Input, { checked: checked, invalid: invalid, testID: testID }),
|
|
107
|
+
react_1.default.createElement(react_native_1.View, { style: { flexShrink: 1 } },
|
|
108
|
+
react_1.default.createElement(RadioLabelText, null, label),
|
|
109
|
+
hint ? react_1.default.createElement(HintText_1.HintText, null, hint) : null))));
|
|
66
110
|
});
|
|
67
111
|
exports.Radio = Radio;
|
|
112
|
+
var templateObject_1;
|